Advertisement
Dekita

core v2.5

Mar 26th, 2014
571
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 75.15 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - CORE
  5. # -- Author : Dekita
  6. # -- Version : 2.5
  7. # -- Level : Easy
  8. # -- Requires : N/A
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:CORE] = true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 26/o3/2o14 - Added Detailed Status Windows, (used in my scenes)
  21. # 17/o3/2o14 - Added More General Settings,
  22. # - Added Screen Fix Module,
  23. # 16/o3/2o14 - Started Re-write,
  24. # - Changes Keys Module to support direct :symbol reference,
  25. # - Added Vocanicon module,
  26. # - Added Effect Block module,
  27. # - Improved info in script,
  28. # 13/o3/2o14 - Update, (added this_event method for script calls) - v2.3
  29. # 24/o2/2o14 - Update, (Added Default status window)
  30. # o3/o6/2o13 - Bugfix, (Exp Showing incorrect info),
  31. # 27/o5/2o13 - Added $game_party.alive_battle_members Method
  32. # 22/o5/2o13 - Small Bugfix, (fixed max tp gauge bug)
  33. # o4/o5/2o13 - Small Update, (added @database_id)
  34. # 18/o4/2o13 - Bugfixx, (tp gauge),
  35. # - Added PrtSc Key,
  36. # o4/o4/2o13 - Added more keyboard keys,
  37. # ^- :S_Colon, :Equal, :Comma, :Minus, :Period, :F_Slash, :HASH,
  38. # ^- :L_Sqr_Brack, :B_Slash, :R_Sqr_Brack, :S_Quote,
  39. # o3/o4/2o13 - Fixed Keys.trigger? method
  40. # - Added Keys.release? method
  41. # o1/o4/2o13 - Added More Keyboard Keys,
  42. # ^- :F1, :F2, :F3, :F4, :F5, :F6, :F7, :F8, :F9, :F10, :F11, :F12
  43. # ^- :N_0, :N_1, :N_2, :N_3, :N_4, :N_5, :N_6, :N_7, :N_8, :N_9,
  44. # ^- :ADD, :MUL, :SUB, :DIV, :DECI, :TAB, :BACK, :ENTER, :CAPS,
  45. # ^- :SPACE, :ESC, :ALT
  46. # 29/o3/2o13 - Added More Keyboard Keys,(Left/Right CTRL)
  47. # 28/o3/2o13 - Improved Customisation Layout,
  48. # - Removed Some Methods,
  49. # - Improved Keyboard Code,
  50. # 27/o3/2o13 - Added Keyboard Control,
  51. # 26/o3/2o13 - Compatibility, (Status Scene)
  52. # - Update, (Icons w/Hue)
  53. # 18/03/2013 - Compatibility, (Skill Scene)
  54. # 23/o2/2o13 - Started, Finished,
  55. #
  56. #===============================================================================
  57. # ☆ Introduction
  58. #-------------------------------------------------------------------------------
  59. # This script is the 'core' script for the $D13x Engine.
  60. # It holds necessary information that is required by my other scripts.
  61. #
  62. # Currently, this script holds information for the following;
  63. # -Fonts,
  64. # -Vocab,
  65. # -Icons (w/Hue),
  66. # -Text Color,
  67. # -Keyboard Control,
  68. #
  69. # You should place this script above all other scripts from the $D13x Engine.
  70. #
  71. #===============================================================================
  72. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  73. #===============================================================================
  74. # 1. You MUST give credit to "Dekita" !!
  75. # 2. You are NOT allowed to repost this script.(or modified versions)
  76. # 3. You are NOT allowed to convert this script.
  77. # 4. You are NOT allowed to use this script for Commercial games.
  78. # 5. ENJOY!
  79. #
  80. # "FINE PRINT"
  81. # By using this script you hereby agree to the above terms and conditions,
  82. # if any violation of the above terms occurs "legal action" may be taken.
  83. # Not understanding the above terms and conditions does NOT mean that
  84. # they do not apply to you.
  85. # If you wish to discuss the terms and conditions in further detail you can
  86. # contact me at http://dekitarpg.wordpress.com/ or DekitaRPG@gmail.com
  87. #
  88. #===============================================================================
  89. # ☆ Instructions
  90. #-------------------------------------------------------------------------------
  91. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  92. # Place Above ALL Other $D13x Scripts.
  93. #
  94. #===============================================================================
  95. # ☆ Notetags
  96. # For use with Weapons / Armors
  97. #-------------------------------------------------------------------------------
  98. # <tcol: red, grn, blu>
  99. # use this notetag to change the color of the items text shown in some of my
  100. # scenes.
  101. #
  102. # <ihue: hue>
  103. # use this notetag to change the color of icons used in some of my scenes.
  104. # give to equip etc..
  105. #
  106. #===============================================================================
  107. # ☆ Key Input Module Information ::
  108. #-------------------------------------------------------------------------------
  109. # Script Calls :
  110. #--------------#
  111. #
  112. # Keys.press?(:symbol)
  113. # ^- will be triggered if the key is being pressed down
  114. #
  115. # Keys.repeat?(:symbol)
  116. # ^- will be triggered if the key is in the "on" state (caps lock ect)
  117. #
  118. # Keys.trigger?(:symbol)
  119. # ^- will be triggered when they key is first pressed
  120. #
  121. # Keys.release?(:symbol)
  122. # ^- will be triggered when they key is de-pressed (let go)
  123. #
  124. # List Of Key Symbols ::
  125. # :F1, :F2, :F3, :F4, :F5, :F6, :F7, :F8, :F9, :F10, :F11, :F12 # << F KEYS
  126. # :_1, :_2, :_3, :_4, :_5, :_6, :_7, :_8, :_9, :_0 # << NUMBER KEYS
  127. # :A, :B, :C, :D, :E, :F, :G, :H, :I, :J, :K, :L, :M, :N, # << LETTER KEYS
  128. # :O, :P, :Q, :R, :S, :T, :U, :V, :W, :X, :Y, :Z # << LETTER KEYS
  129. # :N_0, :N_1, :N_2, :N_3, :N_4, :N_5, :N_6, :N_7, :N_8, :N_9, # << NUMPAD KEYS
  130. # :ADD, :MUL, :SUB, :DIV, :DECI # << NUMPAD KEYS
  131. # :LEFT, :RIGHT, :UP, :DOWN # << ARROW KEYS
  132. # -- -- -- -- -- OTHER KEYS ::
  133. # :SHIFT, :LSHIFT, :RSHIFT, :TAB, :PAUSE, :CTRL, :L_CTRL, :R_CTRL,
  134. # :BACK, :ENTER, :CAPS, :SPACE, :ESC, :ALT
  135. # :S_Colon, :Equal, :Comma, :Minus, :Period, :F_Slash, :HASH, :L_Sqr_Brack
  136. # :B_Slash, :R_Sqr_Brack, :S_Quote,
  137. #
  138. # You can use any of the keys above in your own scripts, simply change the
  139. # default Input.press? / Input.trigger? / Input.repeat? methods with the
  140. # equivalent new method :
  141. # Keys.press?(:SYMBOL)
  142. # Keys.repeat?(:SYMBOL)
  143. # Keys.trigger?(:SYMBOL)
  144. # Keys.release?(:SYMBOL)
  145. # :SYMBOL should be one of the symbols above.
  146. # It can also be either the keys 'virtual key code' or you can reference
  147. # the Keys module like so... Keys::Key[:SYMBOL]
  148. #
  149. #-------------------------------------------------------------------------------
  150. # ☆ Effect Blocks Module Information ::
  151. #-------------------------------------------------------------------------------
  152. # Script Calls :
  153. #--------------#
  154. # block = the effect block ie, [:common, id].
  155. # Effect_Blocks.trigger(block)
  156. #
  157. # An Effect Block is basically an array that holds information.
  158. #
  159. # Effect Blocks will always be used in the customization options.
  160. # They are used for certain scripts that unlock achievements or change
  161. # the environment at times that may not be able to be controlled by
  162. # the Developer. e.g A new Level is reached,
  163.  
  164. # I have written them as easy to understand as possible..
  165. # here is a "default" effect blocks to get things started..
  166. # [:common, id]
  167. # as you can see the effect block is surrounded by square brackets '[' ']'
  168. # this is what holds the information held in the block ie. an array
  169. # :common = basically the method, the method MUST ALWAYS be first in the block
  170. # this tells the block what it was designed to control, in this case ,
  171. # it triggers a common event.
  172. # id = the id of the common event to trigger.
  173. #
  174. # And its that easy.
  175. # Of course some more complex effect blocks can be a little complicated,
  176. # But ALL Effect Blocks work in this way, ie. you can read it and it tells you
  177. # EXACTLY what it does..
  178. # [:common, id]
  179. # [:switch, id, true]
  180. # [:switch, id, false]
  181. # [:switch, id, :alternate]
  182. # [:variable, id, :set, value]
  183. # [:variable, id, :add, value]
  184. # [:variable, id, :sub, value]
  185. # [:variable, id, :div, value]
  186. # [:variable, id, :mul, value]
  187. # [:variable, id, :mod, value]
  188. # [:gold, :gain, value]
  189. # [:gold, :lose, value]
  190. # [:item, id, amount, include equip(bool)]
  191. # [:weapon, id, amount, include equip(bool)]
  192. # [:armor, id, amount, include equip(bool)]
  193. # Note ~
  194. # for :weapon and :armor, if using my $D13x equip system, the amount will become
  195. # the teir of the equip rather than the amount.(equip can also only be added)
  196. #
  197. # You can also create your own custom effect blocks in scripts that use them.
  198. # And thats all there is to know about the basics of effect blocks..
  199. #
  200. #===============================================================================
  201. module Text_Color
  202. #===============================================================================
  203. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  204. # ☆ Color Settings
  205. #-----------------------------------------------------------------------------
  206. # You can use these colors in any of my scripts that offer color customisation.
  207. # simply put Text_Color::THE_COLOR_YOU_WANT as the setting.
  208. # eg.
  209. # Text_Color::Pure_White
  210. #-----------------------------------------------------------------------------
  211. # Shade's
  212. Pure_White = Color.new(255,255,255)
  213. White = Color.new(222,222,222)
  214. Grey = Color.new(111,111,111)
  215. Black = Color.new(0 ,0 ,0 )
  216. #-----------------------------------------------------------------------------
  217. # Yellow's
  218. Yellow = Color.new(255,255,0)
  219. Gold = Color.new(212,212,64)
  220. Orange = Color.new(255,182,0)
  221. Deep_Orange = Color.new(212,64,0)
  222. Dirt_Orange = Color.new(182,64,0)
  223. Brown = Color.new(128,32,0)
  224. #-----------------------------------------------------------------------------
  225. # Red's
  226. Red = Color.new(251,111,111)
  227. Deep_Red = Color.new(222,60,60)
  228. Pure_Red = Color.new(255,0,0)
  229. Pink = Color.new(255,0,255)
  230. Dark_Pink = Color.new(182,0,156)
  231. #-----------------------------------------------------------------------------
  232. # Blue's
  233. Sky_Blue = Color.new(0,182,255)
  234. Light_Blue = Color.new(64,128,255)
  235. Dark_Blue = Color.new(32,64,255)
  236. Purple = Color.new(182,64,255)
  237. Magenta = Color.new(156,156,255)
  238. #-----------------------------------------------------------------------------
  239. # Green's
  240. Green = Color.new(111,251,111)
  241. Candy_Green = Color.new(0,255,0)
  242. Dirty_Green = Color.new(128,182,0)
  243. Khaki_Green = Color.new(111,156,64)
  244. Turquoise = Color.new(0,255,182)
  245. #-----------------------------------------------------------------------------
  246. # Sets the default equipment text color
  247. Default_Equip_Color = White
  248. #####################
  249. # CUSTOMISATION END #
  250. end #####################
  251. #===============================================================================
  252. module General
  253. #===============================================================================
  254. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  255. # ☆ General Settings
  256. #-----------------------------------------------------------------------------
  257. # these settings are usined for visual scripts of mine, such as status screen.
  258. Fonts = ["VL Gothic","Serif","Arial"]
  259. Font_Size = 14
  260. Font_Bold = true
  261. #-----------------------------------------------------------------------------
  262. # Gauges = [ Color 1 , Color 2 ]
  263. Hp_Colors = [ Text_Color::Dirt_Orange , Text_Color::Gold ]
  264. Mp_Colors = [ Text_Color::Dark_Blue , Text_Color::Sky_Blue ]
  265. Tp_Colors = [ Text_Color::Grey , Text_Color::Pure_Red ]
  266. Exp_Color = [ Text_Color::Deep_Red , Text_Color::Dark_Pink ]
  267. #-----------------------------------------------------------------------------
  268. # Show TP as a percentage ?
  269. # Only works in scripts i have written :p
  270. Show_Tp_As_Perc = false
  271. #-----------------------------------------------------------------------------
  272. Show_Icons = true
  273. Box_Color = Color.new(0,0,0,64)
  274. Page_Turn_Noise = ["Audio\\SE\\Book1", 80, "80+rand(50)"]
  275. No_Change_Vocab = "--"
  276.  
  277. #####################
  278. # CUSTOMISATION END #
  279. end #####################
  280. #===============================================================================
  281. module Screen_Fix
  282. #===============================================================================
  283. #-----------------------------------------------------------------------------
  284. # Setup Screen Width and Height
  285. #-----------------------------------------------------------------------------
  286. Width = 640 #####################
  287. Height = 416 # CUSTOMISATION END #
  288. end #####################
  289. #===============================================================================
  290. module Vocanicon
  291. #===============================================================================
  292. #-----------------------------------------------------------------------------
  293. # Actor Info
  294. #-----------------------------------------------------------------------------
  295. Name = ["Name:" , Text_Color::White, 0, 0]
  296. Nick = ["Alias:" , Text_Color::White, 0, 0]
  297. Clas = ["Class:" , Text_Color::White, 0, 0]
  298. Stts = ["↓ Status ↓" , Text_Color::White, 0, 0]
  299. Level = ['Level:' , Text_Color::White, 0, 0]
  300. TP = ["Chi" , Text_Color::White,119, 0]
  301. Exp = ["Exp" , Text_Color::White, 60, 0]
  302. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  303. # ☆ Statistic Settings
  304. #-----------------------------------------------------------------------------
  305. # This is where you would adjust the info shown in my scripts.
  306. #-----------------------------------------------------------------------------
  307. # Parameters
  308. def self.param(param_id)
  309. case param_id
  310. when 0 then ["Health" , Text_Color::White, 117, 0]
  311. when 1 then ["Mana" , Text_Color::White, 118, 0]
  312. when 2 then ["P. Attack" , Text_Color::White, 120, 0]
  313. when 3 then ["P. Resist" , Text_Color::White, 121, 0]
  314. when 4 then ["M. Attack" , Text_Color::White, 122, 0]
  315. when 5 then ["M. Resist" , Text_Color::White, 123, 0]
  316. when 6 then ["Agility" , Text_Color::White, 124, 0]
  317. when 7 then ["Luck" , Text_Color::White, 266, 0]
  318. end
  319. end
  320. #-----------------------------------------------------------------------------
  321. # X - Parameters
  322. def self.xparam(xparam_id)
  323. case xparam_id
  324. when 0 then ["Accuracy" , Text_Color::White, 133, 0]
  325. when 1 then ["Evasion" , Text_Color::White, 134, 0]
  326. when 2 then ["Critical" , Text_Color::White, 135, 0]
  327. when 3 then ["C. Evade" , Text_Color::White, 136, 0]
  328. when 4 then ["M. Evade" , Text_Color::White, 137, 0]
  329. when 5 then ["M. Reflect" , Text_Color::White, 138, 0]
  330. when 6 then ["Counter" , Text_Color::White, 139, 0]
  331. when 7 then ["HP Regen" , Text_Color::White, 140, 0]
  332. when 8 then ["MP Regen" , Text_Color::White, 141, 0]
  333. when 9 then ["TP Regen" , Text_Color::White, 142, 0]
  334. end
  335. end
  336. #-----------------------------------------------------------------------------
  337. # S - Parameters
  338. def self.sparam(sparam_id)
  339. case sparam_id
  340. when 0 then ["Aggro" , Text_Color::White, 149, 0]
  341. when 1 then ["Guard" , Text_Color::White, 150, 0]
  342. when 2 then ["Recovery" , Text_Color::White, 151, 0]
  343. when 3 then ["Medicine" , Text_Color::White, 152, 0]
  344. when 4 then ["MP Cost" , Text_Color::White, 153, 0]
  345. when 5 then ["TP Charge" , Text_Color::White, 154, 0]
  346. when 6 then ["P DMG Taken" , Text_Color::White, 155, 0]
  347. when 7 then ["M DMG Taken" , Text_Color::White, 156, 0]
  348. when 8 then ["Floor DMG" , Text_Color::White, 157, 0]
  349. when 9 then ["Exp Rate" , Text_Color::White, 158, 0]
  350. end
  351. end
  352. #-----------------------------------------------------------------------------
  353. # Specials
  354. def self.specials(id)
  355. case id
  356. when 0 then ["Auto-Fight", Text_Color::White, 60, 0]
  357. when 1 then ["Guard", Text_Color::White, 60, 0]
  358. when 2 then ["Substitue", Text_Color::White, 60, 0]
  359. when 3 then ["Preserve TP", Text_Color::White, 60, 0]
  360. end
  361. end
  362. #-----------------------------------------------------------------------------
  363. # Collapse Type
  364. def self.collapse_type(id)
  365. case id
  366. when 0 then ["Boss", Text_Color::White, 60, 0]
  367. when 1 then ["Instant", Text_Color::White, 60, 0]
  368. when 2 then ["No Vanish", Text_Color::White, 60, 0]
  369. end
  370. end
  371. #-----------------------------------------------------------------------------
  372. # Party Ability
  373. def self.party_ability(id)
  374. case id
  375. when 0 then ["Encounter ½", Text_Color::White, 60, 0]
  376. when 1 then ["Encounter NA", Text_Color::White, 60, 0]
  377. when 2 then ["No Surprise", Text_Color::White, 60, 0]
  378. when 3 then ["Pre-Emptive +", Text_Color::White, 60, 0]
  379. when 4 then ["Gold Double", Text_Color::White, 60, 0]
  380. when 5 then ["Double Drops", Text_Color::White, 60, 0]
  381. end
  382. end
  383. #-----------------------------------------------------------------------------
  384. # Various Statistics
  385. Attack_Speed = ["Atk Speed", Text_Color::White, 60, 0]
  386. Attack_Times = ["Atks Per Turn", Text_Color::White, 60, 0] # "APT"
  387. Skill_Type = ["Skillset", Text_Color::White, 60, 0]
  388. Skill = ["Skills", Text_Color::White, 60, 0]
  389. Equip_Type = ["Equipable", Text_Color::White, 60, 0]
  390. Action_Times = ["Action Time", Text_Color::White, 60, 0]
  391. Fixed = ["Fixed ", Text_Color::White, 60, 0]
  392. Sealed = ["Sealed ", Text_Color::White, 60, 0]
  393. Slot_Type = ["Slot Type", Text_Color::White, 60, 0]
  394. Dual_Slot = ["Dual Wield", Text_Color::White, 60, 0]
  395. One__Slot = ["Single", Text_Color::White, 60, 0]
  396. #####################
  397. # CUSTOMISATION END #
  398. end #####################
  399. #===============================================================================
  400. module Core_Notes
  401. #===============================================================================
  402. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  403. # ☆ Notetag Settings
  404. #-----------------------------------------------------------------------------
  405. Icon_Hue = /<ihue:(.*)>/i
  406. Text_Col = /<tcol:(.*),(.*),(.*)>/i
  407. #####################
  408. # CUSTOMISATION END #
  409. end #####################
  410.  
  411. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  412. # #
  413. # http://dekitarpg.wordpress.com/ #
  414. # #
  415. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  416. # The following code is protected under the 2013 Dekita Data Protection Act. #
  417. # Ie. The “Do Not Fucking Look” Law. #
  418. # Breaking This One And Only Rule May Result In The Following Side Effects : #
  419. # Eyes Bleeding, Nightmares, Severe Head Ache's AND A Scratch On Your Knee :p #
  420. # That is all ! #
  421. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  422. #===============================================================================
  423. module Screen_Fix
  424. #===============================================================================
  425. #-----------------------------------------------------------------------------
  426. #
  427. #-----------------------------------------------------------------------------
  428. Graphics.resize_screen(Width,Height)
  429. end
  430. #===============================================================================
  431. module Vocab
  432. #===============================================================================
  433. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  434. # This is to overwrite the methods used in vocab..
  435. #-----------------------------------------------------------------------------
  436. def self.param(param_id) ; return Vocanicon.param(param_id)[0] ; end
  437. def self.x_param(x_param_id); return Vocanicon.xparam(x_param_id)[0] ; end
  438. def self.s_param(s_param_id); return Vocanicon.sparam(s_param_id)[0] ; end
  439. def self.specials(id) ; return Vocanicon.specials(id)[0] ; end
  440. def self.collapse_type(id) ; return Vocanicon.collapse_type(id)[0] ; end
  441. def self.party_ability(id) ; return Vocanicon.party_ability(id)[0] ; end
  442. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  443. # This is to overwrite the methods used in vocab..
  444. #-----------------------------------------------------------------------------
  445. Attack_Speed = Vocanicon::Attack_Speed[0]
  446. Attack_Times = Vocanicon::Attack_Times[0]
  447. Skill_Type = Vocanicon::Skill_Type[0]
  448. Skill = Vocanicon::Skill[0]
  449. Equip_Type = Vocanicon::Equip_Type[0]
  450. Action_Times = Vocanicon::Action_Times[0]
  451. Fixed = Vocanicon::Fixed[0]
  452. Sealed = Vocanicon::Sealed[0]
  453. Slot_Type = Vocanicon::Slot_Type[0]
  454. Dual_Slot = Vocanicon::Dual_Slot[0]
  455. One__Slot = Vocanicon::One__Slot[0]
  456. Exp = Vocanicon::Exp[0]
  457. Tp = Vocanicon::TP[0]
  458. end
  459. #===============================================================================
  460. module Effect_Blocks
  461. #===============================================================================
  462. #-----------------------------------------------------------------------------
  463. # This is simply the module that holds the default effect blocks
  464. # DO NOT modify the exsisting code, but feel free to add to it, IF
  465. # you are confident in what you are doing and need to impliment
  466. # a new common effect block.
  467. #-----------------------------------------------------------------------------
  468. def self.trigger(block)
  469. return if block == nil
  470. case block[0]
  471. when :switch then self.switch block
  472. when :variable then self.variable block
  473. when :common then self.common block
  474. when :gold then self.gold block
  475. when :item then self.item block
  476. when :weapon then self.weapon block
  477. when :armor then self.armor block
  478. when :popup then self.popup block
  479. end
  480. end
  481. #-----------------------------------------------------------------------------
  482. #
  483. #-----------------------------------------------------------------------------
  484. def self.switch(block)
  485. # [:switch, id, :alternate]
  486. if block[2] == :alternate
  487. $game_switches[block[1]] = !$game_switches[block[1]]
  488. else
  489. $game_switches[block[1]] = block[2]
  490. end
  491. end
  492. #-----------------------------------------------------------------------------
  493. #
  494. #-----------------------------------------------------------------------------
  495. def self.variable(block)
  496. case block[2]
  497. when :set then value = block[3]
  498. when :add then value = ($game_variables[block[1]] + block[3]).to_i
  499. when :sub then value = ($game_variables[block[1]] - block[3]).to_i
  500. when :div then value = ($game_variables[block[1]] / block[3]).to_i
  501. when :mul then value = ($game_variables[block[1]] * block[3]).to_i
  502. when :mod then value = ($game_variables[block[1]] % block[3]).to_i
  503. end
  504. $game_variables[block[1]] = (value)
  505. end
  506. #-----------------------------------------------------------------------------
  507. #
  508. #-----------------------------------------------------------------------------
  509. def self.comomon(block)
  510. $game_temp.reserve_common_event( eff[1] )
  511. end
  512. #-----------------------------------------------------------------------------
  513. #
  514. #-----------------------------------------------------------------------------
  515. def self.gold(block)
  516. case block[1]
  517. when :gain ; $game_party.gain_gold(block[2].to_i)
  518. when :lose ; $game_party.lose_gold(block[2].to_i)
  519. end
  520. end
  521. #-----------------------------------------------------------------------------
  522. #
  523. #-----------------------------------------------------------------------------
  524. def self.item(block)
  525. $game_party.gain_item($data_items[block[1]],block[2].to_i)
  526. end
  527. #-----------------------------------------------------------------------------
  528. #
  529. #-----------------------------------------------------------------------------
  530. def self.weapon(block)
  531. inc_e = block[3] == nil ? false : block[3]
  532. if $D13x[:UniEquip]
  533. Cloning_101.start_clone(:weapon, block[1], block[2].to_i)
  534. else
  535. $game_party.gain_item($data_weapons[block[1]],block[2].to_i,inc_e)
  536. end
  537. end
  538. #-----------------------------------------------------------------------------
  539. #
  540. #-----------------------------------------------------------------------------
  541. def self.armor(block)
  542. inc_e = block[3] == nil ? false : block[3]
  543. if $D13x[:UniEquip]
  544. Cloning_101.start_clone(:armor, block[1], block[2].to_i)
  545. else
  546. $game_party.gain_item($data_armors[block[1]],block[2].to_i,inc_e)
  547. end
  548. end
  549. #-----------------------------------------------------------------------------
  550. #
  551. #-----------------------------------------------------------------------------
  552. def self.popup(block)
  553. return unless $D13x[:Epic_Popups]
  554. end
  555. end
  556. #===============================================================================
  557. class Object
  558. #===============================================================================
  559. #-------------------------------------------------------------------------
  560. # rand_between
  561. #-------------------------------------------------------------------------
  562. def rand_between(min, max)
  563. min + rand(max - min + 1)
  564. end
  565. end
  566. #===============================================================================
  567. class Numeric
  568. #===============================================================================
  569. #---------------------------------------------------------------------------
  570. # To Float (with limited digits after decimal point)
  571. #---------------------------------------------------------------------------
  572. def to_flim(limit = 5, saftey = "0")
  573. str = self.to_f.to_s + saftey
  574. new_str = ""
  575. limit.times do |i|
  576. break if new_str =~ /[0-9].[0-9][0-9]/
  577. break if str[i] == nil
  578. new_str += str[i]
  579. end
  580. return new_str
  581. end
  582. #---------------------------------------------------------------------------
  583. # To A Percentage Of (num)
  584. #---------------------------------------------------------------------------
  585. def perc_of(num)
  586. self.to_f / num.to_f * 100.0
  587. end
  588. #---------------------------------------------------------------------------
  589. # Even ?
  590. #---------------------------------------------------------------------------
  591. def even?
  592. e = self.to_s
  593. e[e.size] == ("0"||"2"||"4"||"6"||"8")
  594. end
  595. #---------------------------------------------------------------------------
  596. # 0dd?
  597. #---------------------------------------------------------------------------
  598. def odd?
  599. o = self.to_s
  600. o[o.size] == ("1"||"3"||"5"||"7"||"9")
  601. end
  602. end
  603. #===============================================================================
  604. module Keys
  605. #===============================================================================
  606. #-----------------------------------------------------------------------------
  607. # Win32API Information
  608. #-----------------------------------------------------------------------------
  609. def self.w ; Win32API ; end
  610. def self.u ; "user32" ; end
  611. def self.i ; "i" ; end
  612. def self.gk ; "GetKeyState" ; end
  613. def self.ga ; "GetAsyncKeyState" ; end
  614. #---------------------------------------------------------------------------
  615. # Key Settings
  616. #---------------------------------------------------------------------------
  617. Key={
  618. # Func's
  619. :F1 => 0x70,:F2 => 0x71,:F3 => 0x72,:F4 => 0x73,:F5 => 0x74,:F6 => 0x75,
  620. :F7 => 0x76,:F8 => 0x77,:F9 => 0x78,:F10 => 0x7a,:F11 => 0x7b,:F12 => 0x7c,
  621. # Numbers
  622. :_0 => 0x30,:_1 => 0x31,:_2 => 0x32,:_3 => 0x33,:_4 => 0x34,
  623. :_5 => 0x35,:_6 => 0x36,:_7 => 0x37,:_8 => 0x38,:_9 => 0x39,
  624. # Letters
  625. :A => 0x41,:B => 0x42,:C => 0x43,:D => 0x44,:E => 0x45,:F => 0x46,:G => 0x47,
  626. :H => 0x48,:I => 0x49,:J => 0x4A,:K => 0x4B,:L => 0x4C,:M => 0x4D,:N => 0x4E,
  627. :O => 0x4F,:P => 0x50,:Q => 0x51,:R => 0x52,:S => 0x53,:T => 0x54,:U => 0x55,
  628. :V => 0x56,:W => 0x57,:X => 0x58,:Y => 0x59,:Z => 0x5A,
  629. # NumPad
  630. :N_0 => 0x60, :N_1 => 0x61, :N_2 => 0x62, :N_3 => 0x63, :N_4 => 0x64,
  631. :N_5 => 0x65, :N_6 => 0x66, :N_7 => 0x67, :N_8 => 0x68, :N_9 => 0x69,
  632. :ADD => 0x6b, :MUL => 0x6a, :SUB => 0x6d, :DIV => 0x6f, :DECI => 0x6e,
  633. # Arrows
  634. :LEFT => 0x25, :RIGHT => 0x27, :UP => 0x26, :DOWN => 0x28,
  635. # Symbols
  636. :S_Colon => 0xBA, :Equal => 0xBB, :Comma => 0xBC, :Minus => 0xBD,
  637. :Period => 0xBE, :F_Slash => 0xBF, :HASH => 0xDE, :L_Sqr_Brack => 0xDB,
  638. :B_Slash => 0xDC, :R_Sqr_Brack => 0xDD, :S_Quote => 0xC0,
  639. # Other
  640. :SHIFT => 0x10, :LSHIFT => 0xa0, :RSHIFT => 0xa1, :TAB => 0x09,
  641. :PAUSE => 0x13, :L_CTRL => 0xa2, :R_CTRL => 0xa3, :CTRL => 0x11,
  642. :BACK => 0x08, :ENTER => 0x0D, :CAPS => 0x14, :SPACE => 0x20,
  643. :ESC => 0x1B, :ALT => 0x12, :PrtSc => 0x2c,
  644. } # << End Key {}
  645. #---------------------------------------------------------------------------
  646. # Constants
  647. #---------------------------------------------------------------------------
  648. KS = w.new(u,gk,[i],i)
  649. AK = w.new(u,ga,[i],i)
  650. #---------------------------------------------------------------------------
  651. # Variables
  652. #---------------------------------------------------------------------------
  653. @trigger = Array.new(256) { false }
  654. @presses = Array.new(256) { false }
  655. @release = Array.new(256) { false }
  656. @repeats = Array.new(256) { false }
  657. #---------------------------------------------------------------------------
  658. # Update All Key's State's
  659. #---------------------------------------------------------------------------
  660. def self.update
  661. @trigger = Array.new(256) { false }
  662. @release = Array.new(256) { false }
  663. Key.each do |key|
  664. akey = AK.call(key[1])
  665. ktri = KS.call(key[1])
  666. @trigger[ key[1] ] = true if ((!@presses[key[1]]) && (akey != 0))
  667. @release[ key[1] ] = true if (( @presses[key[1]]) && (akey == 0))
  668. @presses[ key[1] ] = (akey != 0) ? true : false
  669. @repeats[ key[1] ] = (ktri == 1) ? true : false
  670. end
  671. end
  672. #---------------------------------------------------------------------------
  673. # Key Got Triggered? [ inital key press ]
  674. #---------------------------------------------------------------------------
  675. def self.trigger?(key)
  676. return if key.nil?
  677. if key.is_a?(Symbol)
  678. return @trigger[Key[key]]
  679. end
  680. return @trigger[key]
  681. end
  682. #---------------------------------------------------------------------------
  683. # Key Got Released? [ inital key depress ]
  684. #---------------------------------------------------------------------------
  685. def self.release?(key)
  686. return if key.nil?
  687. if key.is_a?(Symbol)
  688. return @release[Key[key]]
  689. end
  690. return @release[key]
  691. end
  692. #---------------------------------------------------------------------------
  693. # Key Being Pressed Currently ?
  694. #---------------------------------------------------------------------------
  695. def self.press?(key)
  696. return if key.nil?
  697. if key.is_a?(Symbol)
  698. return @presses[Key[key]]
  699. end
  700. return @presses[key]
  701. end
  702. #---------------------------------------------------------------------------
  703. # Key Turned On? [Caps Lock, Num Lock, ect..]
  704. #---------------------------------------------------------------------------
  705. def self.repeat?(key)
  706. return if key.nil?
  707. if key.is_a?(Symbol)
  708. return @repeats[Key[key]]
  709. end
  710. return @repeats[key]
  711. end
  712. end
  713. #===============================================================================
  714. module Input
  715. #===============================================================================
  716. #---------------------------------------------------------------------------
  717. # Alias List
  718. #---------------------------------------------------------------------------
  719. class << self
  720. alias :update_dekita_core_keys :update
  721. end
  722. #---------------------------------------------------------------------------
  723. # Update $D13x Keys
  724. #---------------------------------------------------------------------------
  725. def self.update(*args)
  726. update_dekita_core_keys(*args)
  727. Keys.update
  728. end
  729. end
  730. #===============================================================================
  731. module Cache
  732. #===============================================================================
  733. #--------------------------------------------------------------------------
  734. # * Get System Graphic
  735. #--------------------------------------------------------------------------
  736. def self.icon(filename = "IconSet", hue = 0)
  737. load_bitmap("Graphics/System/", filename, hue)
  738. end
  739. end
  740. #===============================================================================
  741. module DataManager
  742. #===============================================================================
  743. #---------------------------------------------------------------------------
  744. # Alias List
  745. #---------------------------------------------------------------------------
  746. class << self
  747. alias :lbd_dekita_core :load_database
  748. end
  749. #---------------------------------------------------------------------------
  750. # Load Database (alias)
  751. #---------------------------------------------------------------------------
  752. def self.load_database
  753. lbd_dekita_core
  754. loa_dekita_core
  755. end
  756. #---------------------------------------------------------------------------
  757. # Load Unique Shit
  758. #---------------------------------------------------------------------------
  759. def self.loa_dekita_core
  760. classes = [$data_weapons, $data_armors , $data_items , $data_skills ,
  761. $data_actors , $data_classes, $data_enemies, $data_states ]
  762. classes.each do |c|
  763. c.each do |o|
  764. next if o == nil
  765. o.load_dekita_core
  766. end
  767. end
  768. end
  769. end # << DataManager
  770. #===============================================================================
  771. class RPG::BaseItem
  772. #===============================================================================
  773. #--------------------------------------------------------------------------
  774. # Pi Variables
  775. #--------------------------------------------------------------------------
  776. attr_accessor :item_disp_color
  777. attr_accessor :database_id
  778. attr_accessor :icon_hue
  779. #--------------------------------------------------------------------------
  780. # Loads Unique Shit
  781. #--------------------------------------------------------------------------
  782. def load_dekita_core
  783. @item_disp_color = Text_Color::Default_Equip_Color
  784. @database_id = @id
  785. @icon_hue = 0
  786. self.note.split(/[\r\n]+/).each do |line|
  787. case line
  788. when Core_Notes::Icon_Hue
  789. @icon_hue = $1.to_i
  790. when Core_Notes::Text_Col
  791. @item_disp_color = Color.new($1.to_i,$2.to_i,$3.to_i)
  792. end
  793. end
  794. end
  795. #--------------------------------------------------------------------------
  796. # Returns features for item filtered by code (credits Tsukihime)
  797. #--------------------------------------------------------------------------
  798. def feature_val(code)
  799. self.features.select {|ft| ft.code == code}
  800. end
  801. #--------------------------------------------------------------------------
  802. # Returns features for item filtered by code and data ID (credits Tsukihime)
  803. #--------------------------------------------------------------------------
  804. def feature_val_with_id(code, data_id)
  805. self.features.select {|ft| ft.code == code && ft.data_id == data_id}
  806. end
  807. #--------------------------------------------------------------------------
  808. # Returns sum of all features for item, by code and data ID (credits Tsukihime)
  809. #--------------------------------------------------------------------------
  810. def features_sum(code, data_id)
  811. feature_val_with_id(code, data_id).inject(0.0) {|r, ft| r += ft.value }
  812. end
  813. #--------------------------------------------------------------------------
  814. # Returns features pi
  815. #--------------------------------------------------------------------------
  816. def features_pi(code, data_id)
  817. feature_val_with_id(code, data_id).inject(1.0) {|r, ft| r *= ft.value }
  818. end
  819. #--------------------------------------------------------------------------
  820. # Calculate Set Sum of Features
  821. #--------------------------------------------------------------------------
  822. def features_set(code)
  823. feature_val(code).inject([]) {|r, ft| r |= [ft.data_id] }
  824. end
  825. end
  826. #==============================================================================
  827. class Game_Party < Game_Unit
  828. #==============================================================================
  829. #-----------------------------------------------------------------------------
  830. # Get Battle Members
  831. #-----------------------------------------------------------------------------
  832. def alive_battle_members
  833. all_members[0, max_battle_members].select {|a| a.exist? && a.hp > 0 }
  834. end
  835. end
  836. #===============================================================================
  837. class Game_Troop < Game_Unit
  838. #===============================================================================
  839. #-----------------------------------------------------------------------------
  840. #
  841. #-----------------------------------------------------------------------------
  842. def setup(troop_id)
  843. clear
  844. @troop_id = troop_id
  845. @enemies = []
  846. troop.members.each do |member|
  847. next unless $data_enemies[member.enemy_id]
  848. enemy = Game_Enemy.new(@enemies.size, member.enemy_id)
  849. enemy.hide if member.hidden
  850. enemy.screen_x = member.x + (Graphics.width - 544)/2
  851. enemy.screen_y = member.y + (Graphics.height - 416)
  852. @enemies.push(enemy)
  853. end
  854. init_screen_tone
  855. make_unique_names
  856. end
  857. end
  858. #==============================================================================
  859. class Game_Event < Game_Character
  860. #==============================================================================
  861. #-----------------------------------------------------------------------------
  862. #
  863. #-----------------------------------------------------------------------------
  864. def near_the_screen?(dx = nil, dy = nil)
  865. dx = [Graphics.width, $game_map.width * 256].min/32 - 5 if dx.nil?
  866. dy = [Graphics.height, $game_map.height * 256].min/32 - 5 if dy.nil?
  867. ax = $game_map.adjust_x(@real_x) - Graphics.width / 2 / 32
  868. ay = $game_map.adjust_y(@real_y) - Graphics.height / 2 / 32
  869. ax >= -dx && ax <= dx && ay >= -dy && ay <= dy
  870. end
  871. end # Game_Event
  872. #===============================================================================
  873. class Game_Interpreter
  874. #===============================================================================
  875. #-----------------------------------------------------------------------------
  876. #
  877. #-----------------------------------------------------------------------------
  878. def this_event
  879. return $game_map.events[@event_id]
  880. end
  881. end
  882. #===============================================================================
  883. module Spriteset_MapBattle
  884. #===============================================================================
  885. #-----------------------------------------------------------------------------
  886. #
  887. #-----------------------------------------------------------------------------
  888. def init_map_battle
  889. @deki_vp = Viewport.new
  890. @deki_vp.z = 200
  891. end
  892. #-----------------------------------------------------------------------------
  893. #
  894. #-----------------------------------------------------------------------------
  895. def disp_map_battle
  896. @deki_vp.dispose
  897. end
  898. #-----------------------------------------------------------------------------
  899. #
  900. #-----------------------------------------------------------------------------
  901. def updt_map_battle
  902. #@deki_vp.update
  903. end
  904. end
  905. #===============================================================================
  906. class Spriteset_Map
  907. #===============================================================================
  908. #-----------------------------------------------------------------------------
  909. # Included Modules
  910. #-----------------------------------------------------------------------------
  911. include Spriteset_MapBattle
  912. #-----------------------------------------------------------------------------
  913. # Alias List
  914. #-----------------------------------------------------------------------------
  915. alias :init_dekiview :initialize
  916. alias :disp_dekiview :dispose
  917. alias :updt_dekiview :update
  918. #-----------------------------------------------------------------------------
  919. # Initialize
  920. #-----------------------------------------------------------------------------
  921. def initialize
  922. init_map_battle
  923. init_dekiview
  924. end
  925. #-----------------------------------------------------------------------------
  926. # Dispose
  927. #-----------------------------------------------------------------------------
  928. def dispose
  929. disp_map_battle
  930. disp_dekiview
  931. end
  932. #-----------------------------------------------------------------------------
  933. # Update
  934. #-----------------------------------------------------------------------------
  935. def update
  936. updt_map_battle
  937. updt_dekiview
  938. end
  939. #-----------------------------------------------------------------------------
  940. #
  941. #-----------------------------------------------------------------------------
  942. def create_viewports
  943. if Graphics.width > $game_map.width * 32 && !$game_map.loop_horizontal?
  944. dx = (Graphics.width - $game_map.width * 32) / 2
  945. else
  946. dx = 0
  947. end
  948. dw = [Graphics.width, $game_map.width * 32].min
  949. dw = Graphics.width if $game_map.loop_horizontal?
  950. if Graphics.height > $game_map.height * 32 && !$game_map.loop_vertical?
  951. dy = (Graphics.height - $game_map.height * 32) / 2
  952. else
  953. dy = 0
  954. end
  955. dh = [Graphics.height, $game_map.height * 32].min
  956. dh = Graphics.height if $game_map.loop_vertical?
  957. @viewport1 = Viewport.new(dx, dy, dw, dh)
  958. @viewport2 = Viewport.new(dx, dy, dw, dh)
  959. @viewport3 = Viewport.new(dx, dy, dw, dh)
  960. @viewport2.z = 50
  961. @viewport3.z = 100
  962. end
  963. #-----------------------------------------------------------------------------
  964. #
  965. #-----------------------------------------------------------------------------
  966. def update_viewport_sizes
  967. if Graphics.width > $game_map.width * 32 && !$game_map.loop_horizontal?
  968. dx = (Graphics.width - $game_map.width * 32) / 2
  969. else
  970. dx = 0
  971. end
  972. dw = [Graphics.width, $game_map.width * 32].min
  973. dw = Graphics.width if $game_map.loop_horizontal?
  974. if Graphics.height > $game_map.height * 32 && !$game_map.loop_vertical?
  975. dy = (Graphics.height - $game_map.height * 32) / 2
  976. else
  977. dy = 0
  978. end
  979. dh = [Graphics.height, $game_map.height * 32].min
  980. dh = Graphics.height if $game_map.loop_vertical?
  981. rect = Rect.new(dx, dy, dw, dh)
  982. for viewport in [@viewport1, @viewport2, @viewport3, @deki_vp]
  983. viewport.rect = rect
  984. end
  985. end
  986. end
  987. #===============================================================================
  988. class Spriteset_Battle
  989. #===============================================================================
  990. #-----------------------------------------------------------------------------
  991. # Included Modules
  992. #-----------------------------------------------------------------------------
  993. include Spriteset_MapBattle
  994. #-----------------------------------------------------------------------------
  995. # Alias List
  996. #-----------------------------------------------------------------------------
  997. alias :init_dekiview :initialize
  998. alias :disp_dekiview :dispose
  999. alias :updt_dekiview :update
  1000. #-----------------------------------------------------------------------------
  1001. # Initialize
  1002. #-----------------------------------------------------------------------------
  1003. def initialize
  1004. init_map_battle
  1005. init_dekiview
  1006. end
  1007. #-----------------------------------------------------------------------------
  1008. # Dispose
  1009. #-----------------------------------------------------------------------------
  1010. def dispose
  1011. disp_map_battle
  1012. disp_dekiview
  1013. end
  1014. #-----------------------------------------------------------------------------
  1015. # Update
  1016. #-----------------------------------------------------------------------------
  1017. def update
  1018. updt_map_battle
  1019. updt_dekiview
  1020. end
  1021. end
  1022. #==============================================================================
  1023. class Window_Base < Window
  1024. #==============================================================================
  1025.  
  1026. def refresh_fonts
  1027. if !General::Fonts.include?(self.contents.font.name)
  1028. self.contents.font.name = General::Fonts
  1029. end
  1030. if self.contents.font.size != General::Font_Size
  1031. self.contents.font.size = General::Font_Size
  1032. end
  1033. if self.contents.font.bold != General::Font_Bold
  1034. self.contents.font.bold = General::Font_Bold
  1035. end
  1036. end
  1037. #--------------------------------------------------------------------------
  1038. # Draw Gauge (w/height)
  1039. #--------------------------------------------------------------------------
  1040. def draw_deki_gauge(gx, gy, gw, gh, rate, color1, color2)
  1041. empty_gauge_color = Color.new(0,0,0,128)
  1042. fill_w = [(gw * rate).to_i, gw].min
  1043. gauge_h = gh
  1044. gauge_y = gy + line_height - 2 - gauge_h
  1045. contents.fill_rect(gx, gauge_y, gw, gauge_h, empty_gauge_color)
  1046. contents.gradient_fill_rect(gx, gauge_y, fill_w, gauge_h, color1, color2)
  1047. end
  1048. #--------------------------------------------------------------------------
  1049. # Draw Hp
  1050. #--------------------------------------------------------------------------
  1051. def draw_de_hp(x, y, wid = nil)
  1052. wid = self.width/2 - (standard_padding*2) if wid == nil
  1053. rate = @actor.hp_rate
  1054. color1 = General::Hp_Colors[0]
  1055. color2 = General::Hp_Colors[1]
  1056. draw_deki_gauge(x, y, wid-x-2, 2, rate, color1, color2)
  1057. draw_text(x+4, y, wid, line_height, Vocanicon.param(0)[0])
  1058. draw_text(x, y, wid-x-6, line_height, "#{@actor.hp}/#{@actor.mhp}",2)
  1059. end
  1060. #--------------------------------------------------------------------------
  1061. # Draw Mp
  1062. #--------------------------------------------------------------------------
  1063. def draw_de_mp(x, y, wid = nil)
  1064. wid = self.width/2 - (standard_padding*2) if wid == nil
  1065. rate = @actor.mp_rate
  1066. color1 = General::Mp_Colors[0]
  1067. color2 = General::Mp_Colors[1]
  1068. draw_deki_gauge(x, y, wid-x-2, 2, rate, color1, color2)
  1069. draw_text(x+4, y, wid, line_height, Vocanicon.param(1)[0])
  1070. draw_text(x, y, wid-x-6, line_height, "#{@actor.mp}/#{@actor.mmp}",2)
  1071. end
  1072. #--------------------------------------------------------------------------
  1073. # Draw Tp
  1074. #--------------------------------------------------------------------------
  1075. def draw_de_tp(x, y, wid = nil)
  1076. wid = self.width/2 - (standard_padding*2) if wid == nil
  1077. rate = @actor.max_tp == 0 ? 0 : @actor.tp.to_i.to_f / @actor.max_tp.to_i
  1078. color1 = General::Tp_Colors[0]
  1079. color2 = General::Tp_Colors[1]
  1080. draw_deki_gauge(x, y, wid-x-2, 2, rate, color1, color2)
  1081. draw_text(x+4, y, wid, line_height, Vocanicon::TP[0])
  1082. text = "#{(@actor.tp).to_i}/#{@actor.max_tp.to_i}"
  1083. text = "#{(@actor.tp.perc_of(@actor.max_tp)).to_flim}%" if General::Show_Tp_As_Perc
  1084. draw_text(x, y, wid-x-6, line_height, text,2)
  1085. end
  1086. #--------------------------------------------------------------------------
  1087. # Draw Exp (w/gauge)
  1088. #--------------------------------------------------------------------------
  1089. def draw_de_xp(x, y, gauge = true)
  1090. s1 = @actor.current_level_exp
  1091. s2 = @actor.next_level_exp
  1092. s1_g = @actor.exp - @actor.current_level_exp
  1093. s2_g = @actor.next_level_exp - @actor.current_level_exp
  1094. wid = self.width/2 - (standard_padding*2)
  1095. wid_b = self.width/2 - (standard_padding)
  1096. rate = (s1_g).to_f / (s2_g)
  1097. color1 = General::Exp_Color[0]
  1098. color2 = General::Exp_Color[1]
  1099. draw_deki_gauge(wid_b, y, wid-x-2, 2, rate, color1, color2) if gauge
  1100. draw_text(wid_b+4, y, wid, line_height, Vocanicon::Exp[0])
  1101. draw_text(wid_b, y, wid-x-2, line_height, "#{@actor.exp}/#{s2}",2)
  1102. end
  1103. #--------------------------------------------------------------------------
  1104. # Draw Icon (w/Hue)
  1105. #--------------------------------------------------------------------------
  1106. def draw_de_icon(icon_index, x, y, hue = 0, enabled = true)
  1107. bitmap = Cache.icon("IconSet",hue)
  1108. rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  1109. contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  1110. end
  1111. end
  1112. #==============================================================================
  1113. class Deki_Help < Window_Base
  1114. #==============================================================================
  1115. #--------------------------------------------------------------------------
  1116. # Object Initialization
  1117. #--------------------------------------------------------------------------
  1118. def initialize(line_number = 2)
  1119. super(0, 0, Graphics.width/4*3, fitting_height(line_number))
  1120. @item = nil
  1121. end
  1122. #--------------------------------------------------------------------------
  1123. # Set Text
  1124. #--------------------------------------------------------------------------
  1125. def set_text(text)
  1126. if text != @text
  1127. @text = text
  1128. refresh
  1129. end
  1130. end
  1131. #--------------------------------------------------------------------------
  1132. # Clear
  1133. #--------------------------------------------------------------------------
  1134. def clear
  1135. set_text("")
  1136. end
  1137. #--------------------------------------------------------------------------
  1138. # Set Item , item : Skills and items etc.
  1139. #--------------------------------------------------------------------------
  1140. def set_item(item)
  1141. return if @item == item
  1142. @item = item
  1143. refresh
  1144. set_text(item ? item.description : "")
  1145. end
  1146. #--------------------------------------------------------------------------
  1147. # Refresh
  1148. #--------------------------------------------------------------------------
  1149. def refresh
  1150. contents.clear
  1151. draw_text_ex(4, 0, @text)
  1152. end
  1153. #--------------------------------------------------------------------------
  1154. # Reset Font Settings
  1155. #--------------------------------------------------------------------------
  1156. def reset_font_settings
  1157. change_color(normal_color)
  1158. self.contents.font.name = General::Fonts
  1159. self.contents.font.size = General::Font_Size
  1160. self.contents.font.bold = General::Font_Bold
  1161. end
  1162. end
  1163. #===============================================================================
  1164. class Window_StatusDekita < Window_Selectable
  1165. #===============================================================================
  1166. #-----------------------------------------------------------------------------
  1167. # Initialization
  1168. #-----------------------------------------------------------------------------
  1169. def initialize(actor, y)
  1170. super(0, y, Graphics.width, 104)
  1171. @actor = actor
  1172. refresh
  1173. end
  1174. #-----------------------------------------------------------------------------
  1175. # Line Height
  1176. #-----------------------------------------------------------------------------
  1177. def line_height
  1178. return 22
  1179. end
  1180. #-----------------------------------------------------------------------------
  1181. # Window Padding
  1182. #-----------------------------------------------------------------------------
  1183. def standard_padding
  1184. return 8
  1185. end
  1186. #-----------------------------------------------------------------------------
  1187. # Set Actor
  1188. #-----------------------------------------------------------------------------
  1189. def actor=(actor)
  1190. return unless @actor != actor
  1191. @actor = actor
  1192. refresh
  1193. end
  1194. #-----------------------------------------------------------------------------
  1195. # Do Refresh
  1196. #-----------------------------------------------------------------------------
  1197. def refresh
  1198. contents.clear
  1199. return unless @actor
  1200. if !General::Fonts.include?(self.contents.font.name)
  1201. self.contents.font.name = General::Fonts
  1202. end
  1203. if self.contents.font.size != General::Font_Size
  1204. self.contents.font.size = General::Font_Size
  1205. end
  1206. if self.contents.font.bold != General::Font_Bold
  1207. self.contents.font.bold = General::Font_Bold
  1208. end
  1209. draw_actor_face(@actor,0,-2,enabled = true)
  1210. draw_names
  1211. draw_infonshit
  1212. end
  1213. #-----------------------------------------------------------------------------
  1214. # Draw Info And Shit
  1215. #-----------------------------------------------------------------------------
  1216. def draw_infonshit
  1217. x = 104
  1218. y = line_height
  1219. w = self.width/2 - (standard_padding*2)
  1220. draw_info_box(x,y * 1,w-100)
  1221. draw_de_hp(x,y*1,w+6)
  1222. draw_info_box(x,y * 2,w-100)
  1223. draw_de_mp(x,y*2,w+6)
  1224. draw_info_box(x,y * 3,w-100)
  1225. draw_de_tp(x,y*3,w+6)
  1226. end
  1227. #-----------------------------------------------------------------------------
  1228. # Draw Names ( and Lv )
  1229. #-----------------------------------------------------------------------------
  1230. def draw_names
  1231. x = self.width/2-(standard_padding)+4
  1232. y = line_height
  1233. nx = self.width/2 - (standard_padding*2)
  1234. # // Name
  1235. draw_info_box(104,0,nx-100)
  1236. draw_text(108, 0, nx, line_height, Vocanicon::Name[0])
  1237. draw_text(108, 0, nx-108, line_height, @actor.name.to_s, 2)
  1238. # // NickName
  1239. draw_info_box(x,0,nx/2-2)
  1240. draw_text(x+4, 0, nx/2-2, line_height, Vocanicon::Nick[0])
  1241. draw_text(x, 0, nx/2-6, line_height, @actor.nickname.to_s, 2)
  1242. # // Class
  1243. draw_info_box(x,y*1,nx/2-2)
  1244. draw_text(x+4, y*1, nx/2-2, line_height, Vocanicon::Clas[0])
  1245. draw_text(x, y*1, nx/2-6, line_height, @actor.class.name,2)
  1246. # // Status(s)
  1247. draw_info_box(x+(nx/2),0,nx/2+4)
  1248. draw_text(x+(nx/2), 0, nx/2-4, line_height, Vocanicon::Stts[0],1)
  1249. draw_info_box(x+(nx/2),y*1,nx/2+4)
  1250. draw_actor_icons(@actor, x+(nx/2), line_height * 1 - 2,nx/2)
  1251. # // Level
  1252. lw = nx/3-2
  1253. draw_info_box(x,y*2,nx/3-2)
  1254. draw_text(x+4, y*2, nx/3-2, line_height, Vocanicon::Level[0])
  1255. draw_text(x , y*2, nx/3-6, line_height, "#{@actor.level}",2)
  1256. # // SPDS Stats
  1257. draw_info_box(x+(nx/3),y*2,nx/3)
  1258. if $D13x[:ISPDS]
  1259. draw_text(x+(nx/3)+2, y*2, nx/3, line_height, SPDS::DP_Vocab[0])
  1260. draw_text(x+(nx/3), y*2, nx/3-4, line_height, "#{@actor.points}", 2)
  1261. end
  1262. # // SUG Stats
  1263. draw_info_box(x+(nx/3*2)+2,y*2,nx/3+6)
  1264. if $D13x[:SUG]
  1265. draw_text(x+(nx/3*2)+6, y*2, nx/3, line_height, Skill_Upgrade::SP_Vocab[2])
  1266. draw_text(x+(nx/3*2), y*2, nx/3, line_height, "#{@actor.skill_points.to_i}", 2)
  1267. end
  1268. # // Exp
  1269. draw_info_box(x,y*3,nx+4)
  1270. draw_de_xp(x, y * 3)
  1271. end
  1272. #-----------------------------------------------------------------------------
  1273. # Draw Info Box
  1274. #-----------------------------------------------------------------------------
  1275. def draw_info_box(x,y,w)
  1276. contents.fill_rect(x,y+1,w,line_height-2,Color.new(0,0,0,64))
  1277. end
  1278. #-----------------------------------------------------------------------------
  1279. # Draw Exp (w/gauge)
  1280. #-----------------------------------------------------------------------------
  1281. def draw_de_xp(x, y, gauge = true)
  1282. s1 = @actor.exp # current_level_exp
  1283. s2 = @actor.next_level_exp
  1284. s1_g = @actor.exp - @actor.current_level_exp
  1285. s2_g = @actor.next_level_exp - @actor.current_level_exp
  1286. wid = self.width/2 - (standard_padding*2)
  1287. wid_b = self.width/2 - (standard_padding)
  1288. rate = (s1_g).to_f / (s2_g)
  1289. color1 = General::Exp_Color[0]
  1290. color2 = General::Exp_Color[1]
  1291. draw_deki_gauge(x, y, wid+4, 2, rate, color1, color2) if gauge
  1292. draw_text(x+4, y, wid, line_height, Vocanicon::Exp[0])
  1293. draw_text(x, y, wid, line_height, "#{s1}/#{s2}",2)
  1294. end
  1295. end
  1296. #===============================================================================
  1297. class Dekita_Core_Status < Window_Selectable
  1298. #===============================================================================
  1299. attr_reader :page
  1300. #-----------------------------------------------------------------------------
  1301. # Initialization
  1302. #-----------------------------------------------------------------------------
  1303. def initialize(x,y,w,h,actor=nil,page=nil)
  1304. super(x,y,w,h)
  1305. @just_startingg = true
  1306. @actor = actor
  1307. @page = page
  1308. refresh
  1309. end
  1310. #-----------------------------------------------------------------------------
  1311. # Set Actor
  1312. #-----------------------------------------------------------------------------
  1313. def actor=(actor)
  1314. return if @actor == actor
  1315. @actor = actor
  1316. refresh
  1317. end
  1318. #-----------------------------------------------------------------------------
  1319. # Set Page
  1320. #-----------------------------------------------------------------------------
  1321. def page=(page)
  1322. return if @page == page
  1323. @page = page
  1324. sound = General::Page_Turn_Noise
  1325. Audio.se_play(sound[0], sound[1], eval(sound[2])) if !@just_startingg
  1326. @just_startingg = false if @just_startingg
  1327. refresh
  1328. end
  1329. #-----------------------------------------------------------------------------
  1330. # Refresh
  1331. #-----------------------------------------------------------------------------
  1332. def refresh
  1333. contents.clear
  1334. freshen
  1335. draw_status_inf if @page
  1336. end
  1337. #-----------------------------------------------------------------------------
  1338. # Refresh Fonts
  1339. #-----------------------------------------------------------------------------
  1340. def freshen
  1341. if !General::Fonts.include?(self.contents.font.name)
  1342. self.contents.font.name = General::Fonts
  1343. end
  1344. if self.contents.font.size != General::Font_Size
  1345. self.contents.font.size = General::Font_Size
  1346. end
  1347. if self.contents.font.bold != General::Font_Bold
  1348. self.contents.font.bold = General::Font_Bold
  1349. end
  1350. end
  1351. #-----------------------------------------------------------------------------
  1352. # Define wid
  1353. #-----------------------------------------------------------------------------
  1354. def wid
  1355. self.width-(standard_padding*2)
  1356. end
  1357. #-----------------------------------------------------------------------------
  1358. # Enable ALL Icons (make opacity = 255)
  1359. #-----------------------------------------------------------------------------
  1360. def all_icons_enable?
  1361. return true
  1362. end
  1363. #-----------------------------------------------------------------------------
  1364. # Get Setup Info
  1365. #-----------------------------------------------------------------------------
  1366. def setup_info
  1367. return []
  1368. end
  1369. #-----------------------------------------------------------------------------
  1370. # Draw Status Page Info
  1371. #-----------------------------------------------------------------------------
  1372. def draw_status_inf
  1373. x = 0 ; y = 0
  1374. data = setup_info
  1375. for i in data
  1376. case i[0]
  1377. # [:header, "TEXT", Text_Color, icon_id, icon_hue, alignment],
  1378. when :header then y = draw_header(x,y,i[1],i[2],i[3],i[4],i[5])
  1379. when :param then y = draw_parameters(x,y,i[1])
  1380. when :x_param then y = draw_xparameters(x,y,i[1])
  1381. when :s_param then y = draw_sparameters(x,y,i[1])
  1382. when :atk_ele then y = draw_atk_eles(x,y,i[1])
  1383. when :def_ele then y = draw_def_eles(x,y,i[1])
  1384. when :atk_lev then y = draw_atk_level(x,y)
  1385. when :def_lev then y = draw_def_level(x,y)
  1386. when :tp_info then y = draw_tp_info(x,y)
  1387. when :spds_stat then y = draw_spds_info(x,y,i[1])
  1388. end
  1389. end
  1390. end
  1391. #-----------------------------------------------------------------------------
  1392. # Draw Stat Icons
  1393. #-----------------------------------------------------------------------------
  1394. def draw_stat_icons(icon, x, y, hue, enabled = true)
  1395. return x+4 unless icon != 0
  1396. draw_de_icon(icon, x, y, hue, enabled)
  1397. return x += 26
  1398. end
  1399. #-----------------------------------------------------------------------------
  1400. # Draw Box
  1401. #-----------------------------------------------------------------------------
  1402. def draw_box(x, y)
  1403. contents.fill_rect(x,y+1,wid,line_height-2,General::Box_Color)
  1404. end
  1405. #-----------------------------------------------------------------------------
  1406. # Draw Box
  1407. #-----------------------------------------------------------------------------
  1408. def draw_box_ww(x, y, w)
  1409. contents.fill_rect(x,y+1,w,line_height-2,General::Box_Color)
  1410. end
  1411. #-----------------------------------------------------------------------------
  1412. # Draw Header
  1413. #-----------------------------------------------------------------------------
  1414. def draw_header(x,y,text,col,icon,hue,align)
  1415. draw_box(x, y)
  1416. x = draw_stat_icons(icon, x, y, hue, all_icons_enable?)
  1417. change_color(col)
  1418. draw_text(x, y, wid, line_height, text.to_s, align)
  1419. return y += line_height
  1420. end
  1421. #-----------------------------------------------------------------------------
  1422. # Draw Data
  1423. #-----------------------------------------------------------------------------
  1424. def draw_data(x,y,text,colo,icon,ihue,valu,alig)
  1425. draw_box(x, y)
  1426. x = draw_stat_icons(icon, x, y, ihue, all_icons_enable?)
  1427. change_color(colo)
  1428. draw_text(x, y, wid, line_height, text)
  1429. change_color(Text_Color::White)
  1430. draw_text(x, y, wid-34, line_height, valu, alig)
  1431. return y += line_height
  1432. end
  1433. #-----------------------------------------------------------------------------
  1434. # Draw Parameters
  1435. #-----------------------------------------------------------------------------
  1436. def draw_parameters(x,y,i)
  1437. data = Vocanicon.param(i)
  1438. text = data[0]
  1439. colo = data[1]
  1440. icon = data[2]
  1441. ihue = data[3]
  1442. valu = sprintf("%s", @actor.param(i))
  1443. y = draw_data(x,y,text,colo,icon,ihue,valu,2)
  1444. return y
  1445. end
  1446. #-----------------------------------------------------------------------------
  1447. # Draw x Parameters
  1448. #-----------------------------------------------------------------------------
  1449. def draw_xparameters(x,y,i)
  1450. data = Vocanicon.xparam(i)
  1451. text = data[0]
  1452. colo = data[1]
  1453. icon = data[2]
  1454. ihue = data[3]
  1455. valu = sprintf("%1.2f%%",@actor.xparam(i)*100)
  1456. y = draw_data(x,y,text,colo,icon,ihue,valu,2)
  1457. return y
  1458. end
  1459. #-----------------------------------------------------------------------------
  1460. # Draw sParameters
  1461. #-----------------------------------------------------------------------------
  1462. def draw_sparameters(x,y,i)
  1463. data = Vocanicon.sparam(i)
  1464. text = data[0]
  1465. colo = data[1]
  1466. icon = data[2]
  1467. ihue = data[3]
  1468. valu = sprintf("%1.2f%%",@actor.sparam(i)*100)
  1469. y = draw_data(x,y,text,colo,icon,ihue,valu,2)
  1470. return y
  1471. end
  1472. #-----------------------------------------------------------------------------
  1473. # Draw Attack Elements
  1474. #-----------------------------------------------------------------------------
  1475. def draw_atk_eles(x,y,i)
  1476. return y unless $D13x[:Elems_Control]
  1477. data = Vocanicon.atk_element(i)
  1478. text = data[0]
  1479. colo = data[1]
  1480. icon = data[2]
  1481. ihue = data[3]
  1482. valu = sprintf("%1.2f%%",@actor.atk_element_rate(i)*100)
  1483. y = draw_data(x,y,text,colo,icon,ihue,valu,2)
  1484. return y
  1485. end
  1486. #-----------------------------------------------------------------------------
  1487. # Draw Defence Elements
  1488. #-----------------------------------------------------------------------------
  1489. def draw_def_eles(x,y,i)
  1490. return y unless $D13x[:Elems_Control]
  1491. data = Vocanicon.def_element(i)
  1492. text = data[0]
  1493. colo = data[1]
  1494. icon = data[2]
  1495. ihue = data[3]
  1496. valu = sprintf("%1.2f%%",@actor.element_rate(i)*100)
  1497. y = draw_data(x,y,text,colo,icon,ihue,valu,2)
  1498. return y
  1499. end
  1500. #-----------------------------------------------------------------------------
  1501. # Draw Attack Level
  1502. #-----------------------------------------------------------------------------
  1503. def draw_atk_level(x,y)
  1504. return y unless $D13x[:Atk_Def_Lvs]
  1505. data = Vocanicon::Atk_Level
  1506. text = data[0]
  1507. colo = data[1]
  1508. icon = data[2]
  1509. ihue = data[3]
  1510. valu = sprintf("%s",@actor.atl.to_i)
  1511. y = draw_data(x,y,text,colo,icon,ihue,valu,2)
  1512. return y
  1513. end
  1514. #-----------------------------------------------------------------------------
  1515. # Draw Defence Level
  1516. #-----------------------------------------------------------------------------
  1517. def draw_def_level(x,y)
  1518. return y unless $D13x[:Atk_Def_Lvs]
  1519. data = Vocanicon::Def_Level
  1520. text = data[0]
  1521. colo = data[1]
  1522. icon = data[2]
  1523. ihue = data[3]
  1524. valu = sprintf("%s",@actor.dfl.to_i)
  1525. y = draw_data(x,y,text,colo,icon,ihue,valu,2)
  1526. return y
  1527. end
  1528. #-----------------------------------------------------------------------------
  1529. # Draw TP Info
  1530. #-----------------------------------------------------------------------------
  1531. def draw_tp_info(x,y)
  1532. return y unless $D13x[:TP_Control]
  1533. data = Vocanicon::TP
  1534. text = data[0]
  1535. colo = data[1]
  1536. icon = data[2]
  1537. ihue = data[3]
  1538. valu = sprintf("%s",@actor.maximum_tp.to_i)
  1539. y = draw_data(x,y,text,colo,icon,ihue,valu,2)
  1540. return y
  1541. end
  1542. #-----------------------------------------------------------------------------
  1543. # Draw TP Info
  1544. #-----------------------------------------------------------------------------
  1545. def draw_spds_info(x,y,i)
  1546. return y unless $D13x[:ISPDS]
  1547. data = Vocanicon.spds_stat(@actor,i)
  1548. text = data[0]
  1549. colo = data[1]
  1550. icon = data[2]
  1551. ihue = data[3]
  1552. valu = sprintf("%s",@actor.spds_stats(i).to_i)
  1553. y = draw_data(x,y,text,colo,icon,ihue,valu,2)
  1554. return y
  1555. end
  1556. end
  1557. #===============================================================================
  1558. class Dekita_Core_Status_Changes < Dekita_Core_Status
  1559. #===============================================================================
  1560. #-----------------------------------------------------------------------------
  1561. # Initialization
  1562. #-----------------------------------------------------------------------------
  1563. def initialize(x,y,w,h,actor=nil,page=nil)
  1564. super(x,y,w,h,actor,page)
  1565. @temp_actor = Marshal.load(Marshal.dump(@actor))
  1566. @dis_window = nil
  1567. refresh
  1568. end
  1569. #-----------------------------------------------------------------------------
  1570. # Set Actor
  1571. #-----------------------------------------------------------------------------
  1572. def actor=(actor)
  1573. return if @actor == actor
  1574. @actor = actor
  1575. @temp_actor = Marshal.load(Marshal.dump(@actor))
  1576. refresh
  1577. end
  1578. #-----------------------------------------------------------------------------
  1579. # Set Dis Window
  1580. #-----------------------------------------------------------------------------
  1581. def dis_window=(window)
  1582. return if @dis_window == window
  1583. @dis_window = window
  1584. refresh
  1585. end
  1586. #-----------------------------------------------------------------------------
  1587. # Get No Stats
  1588. #-----------------------------------------------------------------------------
  1589. def show_no_stats
  1590. return unless @dis_window
  1591. @temp_actor = Marshal.load(Marshal.dump(@actor))
  1592. refresh
  1593. end
  1594. #-----------------------------------------------------------------------------
  1595. # Draw Data
  1596. #-----------------------------------------------------------------------------
  1597. def draw_data(x,y,text,colo,icon,ihue,valu,alig)
  1598. draw_box(x, y)
  1599. change_color(Text_Color::White)
  1600. draw_text(x, y, wid, line_height, valu, alig)
  1601. return y += line_height
  1602. end
  1603. #-----------------------------------------------------------------------------
  1604. # Draw Parameters
  1605. #-----------------------------------------------------------------------------
  1606. def draw_parameters(x,y,i)
  1607. data = Vocanicon.param(i)
  1608. text = data[0]
  1609. colo = data[1]
  1610. icon = data[2]
  1611. ihue = data[3]
  1612. stat = @temp_actor.param(i) - @actor.param(i)
  1613. valu = General::No_Change_Vocab
  1614. valu = sprintf("%s", stat) if stat < 0
  1615. valu = sprintf("+%s", stat) if stat > 0
  1616. y = draw_data(x,y,text,colo,icon,ihue,valu,1)
  1617. return y
  1618. end
  1619. #-----------------------------------------------------------------------------
  1620. # Draw x Parameters
  1621. #-----------------------------------------------------------------------------
  1622. def draw_xparameters(x,y,i)
  1623. data = Vocanicon.xparam(i)
  1624. text = data[0]
  1625. colo = data[1]
  1626. icon = data[2]
  1627. ihue = data[3]
  1628. stat = (@temp_actor.xparam(i)-@actor.xparam(i))*100
  1629. valu = General::No_Change_Vocab
  1630. valu = sprintf("%1.2f%%", stat) if stat < 0.0
  1631. valu = sprintf("+%1.2f%%", stat) if stat > 0.0
  1632. y = draw_data(x,y,text,colo,icon,ihue,valu,1)
  1633. return y
  1634. end
  1635. #-----------------------------------------------------------------------------
  1636. # Draw sParameters
  1637. #-----------------------------------------------------------------------------
  1638. def draw_sparameters(x,y,i)
  1639. data = Vocanicon.sparam(i)
  1640. text = data[0]
  1641. colo = data[1]
  1642. icon = data[2]
  1643. ihue = data[3]
  1644. stat = (@temp_actor.sparam(i)-@actor.sparam(i))*100
  1645. valu = General::No_Change_Vocab
  1646. valu = sprintf("%1.2f%%", stat) if stat < 0.0
  1647. valu = sprintf("+%1.2f%%", stat) if stat > 0.0
  1648. y = draw_data(x,y,text,colo,icon,ihue,valu,1)
  1649. return y
  1650. end
  1651. #-----------------------------------------------------------------------------
  1652. # Draw Attack Elements
  1653. #-----------------------------------------------------------------------------
  1654. def draw_atk_eles(x,y,i)
  1655. return y unless $D13x[:Elems_Control]
  1656. data = Vocanicon.atk_element(i)
  1657. text = data[0]
  1658. colo = data[1]
  1659. icon = data[2]
  1660. ihue = data[3]
  1661. stat = (@temp_actor.atk_element_rate(i)-@actor.atk_element_rate(i))*100
  1662. valu = General::No_Change_Vocab
  1663. valu = sprintf("%1.2f%%", stat) if stat < 0.0
  1664. valu = sprintf("+%1.2f%%", stat) if stat > 0.0
  1665. y = draw_data(x,y,text,colo,icon,ihue,valu,1)
  1666. return y
  1667. end
  1668. #-----------------------------------------------------------------------------
  1669. # Draw Defence Elements
  1670. #-----------------------------------------------------------------------------
  1671. def draw_def_eles(x,y,i)
  1672. return y unless $D13x[:Elems_Control]
  1673. data = Vocanicon.def_element(i)
  1674. text = data[0]
  1675. colo = data[1]
  1676. icon = data[2]
  1677. ihue = data[3]
  1678. stat = (@temp_actor.element_rate(i)-@actor.element_rate(i))*100
  1679. valu = General::No_Change_Vocab
  1680. valu = sprintf("%1.2f%%", stat) if stat < 0.0
  1681. valu = sprintf("+%1.2f%%", stat) if stat > 0.0
  1682. y = draw_data(x,y,text,colo,icon,ihue,valu,1)
  1683. return y
  1684. end
  1685. #-----------------------------------------------------------------------------
  1686. # Draw Attack Level
  1687. #-----------------------------------------------------------------------------
  1688. def draw_atk_level(x,y)
  1689. return y unless $D13x[:Atk_Def_Lvs]
  1690. data = Vocanicon::Atk_Level
  1691. text = data[0]
  1692. colo = data[1]
  1693. icon = data[2]
  1694. ihue = data[3]
  1695. stat = (@temp_actor.atl-@actor.atl).to_i
  1696. valu = General::No_Change_Vocab
  1697. valu = sprintf("%s", stat) if stat < 0
  1698. valu = sprintf("+%s", stat) if stat > 0
  1699. y = draw_data(x,y,text,colo,icon,ihue,valu,1)
  1700. return y
  1701. end
  1702. #-----------------------------------------------------------------------------
  1703. # Draw Defence Level
  1704. #-----------------------------------------------------------------------------
  1705. def draw_def_level(x,y)
  1706. return y unless $D13x[:Atk_Def_Lvs]
  1707. data = Vocanicon::Def_Level
  1708. text = data[0]
  1709. colo = data[1]
  1710. icon = data[2]
  1711. ihue = data[3]
  1712. stat = (@temp_actor.dfl-@actor.dfl).to_i
  1713. valu = General::No_Change_Vocab
  1714. valu = sprintf("%s", stat) if stat < 0
  1715. valu = sprintf("+%s", stat) if stat > 0
  1716. y = draw_data(x,y,text,colo,icon,ihue,valu,1)
  1717. return y
  1718. end
  1719. #-----------------------------------------------------------------------------
  1720. # Draw TP Info
  1721. #-----------------------------------------------------------------------------
  1722. def draw_tp_info(x,y)
  1723. return y unless $D13x[:TP_Control]
  1724. data = Vocanicon::TP
  1725. text = data[0]
  1726. colo = data[1]
  1727. icon = data[2]
  1728. ihue = data[3]
  1729. stat = (@temp_actor.maximum_tp-@actor.maximum_tp).to_i
  1730. valu = General::No_Change_Vocab
  1731. valu = sprintf("%s", stat) if stat < 0
  1732. valu = sprintf("+%s", stat) if stat > 0
  1733. y = draw_data(x,y,text,colo,icon,ihue,valu,1)
  1734. return y
  1735. end
  1736. #-----------------------------------------------------------------------------
  1737. # Draw TP Info
  1738. #-----------------------------------------------------------------------------
  1739. def draw_spds_info(x,y,i)
  1740. return y unless $D13x[:ISPDS]
  1741. data = Vocanicon.spds_stat(@actor,i)
  1742. text = data[0]
  1743. colo = data[1]
  1744. icon = data[2]
  1745. ihue = data[3]
  1746. stat = (@temp_actor.spds_stats(i)-@actor.spds_stats(i)).to_i
  1747. valu = General::No_Change_Vocab
  1748. valu = sprintf("%s", stat) if stat < 0
  1749. valu = sprintf("+%s", stat) if stat > 0
  1750. y = draw_data(x,y,text,colo,icon,ihue,valu,1)
  1751. return y
  1752. end
  1753. end
  1754. #===============================================================================
  1755. class Scene_Map < Scene_Base
  1756. #===============================================================================
  1757. #-----------------------------------------------------------------------------
  1758. #
  1759. #-----------------------------------------------------------------------------
  1760. attr_reader :spriteset
  1761. #-----------------------------------------------------------------------------
  1762. # Alias List
  1763. #-----------------------------------------------------------------------------
  1764. alias :postrns_dekita_core :post_transfer
  1765. #-----------------------------------------------------------------------------
  1766. #
  1767. #-----------------------------------------------------------------------------
  1768. def post_transfer
  1769. @spriteset.update_viewport_sizes
  1770. postrns_dekita_core
  1771. end
  1772. end
  1773. #===============================================================================
  1774. class Scene_Battle < Scene_Base
  1775. #===============================================================================
  1776. #-----------------------------------------------------------------------------
  1777. #
  1778. #-----------------------------------------------------------------------------
  1779. attr_reader :spriteset
  1780. end
  1781. #==============================================================================#
  1782. # http://dekitarpg.wordpress.com/ #
  1783. #==============================================================================#
  1784. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement