Advertisement
Dekita

core2.7

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