Advertisement
Dekita

Untitled

May 29th, 2014
2,497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 54.46 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Statistic Control
  5. # -- Author : Dekita
  6. # -- Version : 1.8
  7. # -- Level : Easy / Normal
  8. # -- Requires : N/A
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:Stats_Control]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 29/o5/2o14 - Improved Code for Add-on's,
  21. # ??/o3/2o14 - Small change to code,
  22. # 31/o5/2o13 - Added More Help Info For Script Calls.
  23. # 19/o4/2o13 - Small bugfixx, (<stat limit:X> notetag)
  24. # 12/o4/2o13 - Small Bugfix, (require :Dev_SLUD)
  25. # 28/o3/2o13 - Small Efficiency Update,
  26. # 25/o3/2o13 - Compatibility, (Elements Control)
  27. # 23/o3/2o13 - Fixed Bug, (default equip params)
  28. # 2o/o3/2o13 - Compatibility - Skill Levels
  29. # 13/o3/2o13 - updated import method,
  30. # 12/o3/2o13 - Finished,
  31. # 1o/o3/2o13 - Started
  32. #
  33. #===============================================================================
  34. # ☆ Introduction
  35. #-------------------------------------------------------------------------------
  36. # This Script 'fixes' actor statistics, ie. params / xparams / sparams
  37. # and allows the stats to be increased/decreased by a steady value rather
  38. # than a percentage of the current value as it offers more control and
  39. # flexibility, also I prefer it this way.
  40. # It also adds min and max limits for x/s-params and gives control over these
  41. # new limitations, as well as the standard params.
  42. #
  43. # You are allowed the use of some new ways to control these stats
  44. # using actors/classes/enemies/weapons/armors/states/skills notetags
  45. # and some script calls.
  46. # e.g
  47. # an actor knowing a certain skill can controls statistics (using notetags).
  48. # you can use script calls to decrease/increase/multiply/divide x/s-params.
  49. #
  50. # Note :
  51. # x/s-Params still work with percentage values, ie 0.01 is 1%, 1.0 is 100%
  52. #
  53. # This Script also overwrites the default level up/down method to be a little
  54. # more flexible.
  55. # It does the same to the learn skill and initialize skill methods.
  56. # And also acts as a base for some other actor related scripts of mine.
  57. #
  58. # in short : this is a limiter / limit-breaker script with bonuses :p
  59. #
  60. #===============================================================================
  61. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  62. #===============================================================================
  63. # 1. You MUST give credit to "Dekita" !!
  64. # 2. You are NOT allowed to repost this script.(or modified versions)
  65. # 3. You are NOT allowed to convert this script.
  66. # 4. You are NOT allowed to use this script for Commercial games.
  67. # 5. ENJOY!
  68. #
  69. # "FINE PRINT"
  70. # By using this script you hereby agree to the above terms and conditions,
  71. # if any violation of the above terms occurs "legal action" may be taken.
  72. # Not understanding the above terms and conditions does NOT mean that
  73. # they do not apply to you.
  74. # If you wish to discuss the terms and conditions in further detail you can
  75. # contact me at http://dekitarpg.wordpress.com/
  76. #
  77. #===============================================================================
  78. # ☆ Instructions
  79. #-------------------------------------------------------------------------------
  80. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  81. # Place Under My $D13x - Core Script. (if used)
  82. #
  83. #===============================================================================
  84. # ☆ Notetags ( default )
  85. # For use with Weapons / Armors / Enemies / Actors / Classes / States / Skills
  86. #-------------------------------------------------------------------------------
  87. # <stat: value>
  88. # stat = mhp, mmp, agi, luk, cri ect...
  89. # value = the value for that equip/enemy/skill/state/whatever..
  90. # e.g
  91. # <agi: 4> would add 4 agility onto the notetagged item
  92. # <cri: 0.04> would add 4% crit rate onto the notetagged item
  93. # Also, value can be negative e.g <stat: -0.05>
  94. #
  95. # <stat limit: max>
  96. # Used to modify the stat maximum limit
  97. # stat limit = hit, atk, pha, def, exr ect...
  98. # max = the value for that equip/enemy/ect
  99. #
  100. #-------------------------------------------------------------------------------
  101. # IMPORTANT :
  102. # The settings below are the default settings, ie. the base settings.
  103. # If you want to have a lower max stat than the default, you must make
  104. # the notetags value for that actor (or whatever) be negative, ie. reduced
  105. # from the default stat settings.
  106. # If you want to increase simply use the notetag and the value will be added
  107. # onto the default value.
  108. # This is the same for all note-taggable items.
  109. #
  110. # All Increases and Decreases are stacked, using the following calculation ..
  111. # Base + Actor(or Enemy) + Class(if actor) + Equipment(if actor) + States +
  112. # Skills that modify stats or max stats (ie passive skills)
  113. #
  114. #===============================================================================
  115. # ☆ Script Calls
  116. #-------------------------------------------------------------------------------
  117. # $game_actors[id].add_param(param_id, value) << From Default Engine .
  118. # $game_actors[id].sub_param(param_id, value)
  119. # $game_actors[id].div_param(param_id, value)
  120. # $game_actors[id].mul_param(param_id, value)
  121. # $game_actors[id].mod_param(param_id, value)
  122. #
  123. # $game_actors[id].add_xparam(xparam_id, value)
  124. # $game_actors[id].sub_xparam(xparam_id, value)
  125. # $game_actors[id].div_xparam(xparam_id, value)
  126. # $game_actors[id].mul_xparam(xparam_id, value)
  127. # $game_actors[id].mod_xparam(xparam_id, value)
  128. #
  129. # $game_actors[id].add_sparam(xparam_id, value)
  130. # $game_actors[id].sub_sparam(xparam_id, value)
  131. # $game_actors[id].div_sparam(xparam_id, value)
  132. # $game_actors[id].mul_sparam(xparam_id, value)
  133. # $game_actors[id].mod_sparam(xparam_id, value)
  134. #
  135. # these are the calculatons for each control type
  136. # add : current stat += value
  137. # sub : current stat -= value
  138. # div : current stat /= value
  139. # mul : current stat *= value
  140. # mod : current stat %= value
  141. #
  142. # These script calls modify the Actor value, other items remain in the same order.
  143. #
  144. # There is also a third arguement for all the above script calls,
  145. # it is a boolean arguement to determine if the player should be refreshed.
  146. # eg.. $game_actors[1].add_param(0, 50, false)
  147. # this is very helpfull for maintaining FPS when adding LOTS of stats..
  148. # The default to this arguemet is true.
  149. # If you don't understand what this mean, just disregard this information :)
  150. #
  151. #===============================================================================
  152. # ☆ HELP
  153. #-------------------------------------------------------------------------------
  154. # PARAMS : # XPARAMS : # SPARAMS : #
  155. # stat = id # stat = id # stat = id #
  156. # mhp = 0 # hit = 0 # tgr = 0 #
  157. # mmp = 1 # eva = 1 # grd = 1 #
  158. # atk = 2 # cri = 2 # rec = 2 #
  159. # def = 3 # cev = 3 # pha = 3 #
  160. # mat = 4 # mev = 4 # mcr = 4 #
  161. # mdf = 5 # mrf = 5 # tcr = 5 #
  162. # agi = 6 # cnt = 6 # pdr = 6 #
  163. # luk = 7 # hrg = 7 # mdr = 7 #
  164. # # mrg = 8 # fdr = 8 #
  165. # # trg = 9 # exr = 9 #
  166. #-------------------------------------------------------------------------------
  167. # Remember :
  168. # All Params work with integer values, eg. 1, 5, 123, 653, 198123
  169. # All x/s-Params work with float values, eg. 1.0, 0.5, 0.1, 0.05, 0.01
  170. # 1.0 = 100%, 0.01 = 1%,
  171. #
  172. #===============================================================================
  173. # ☆ For Scripters
  174. #-------------------------------------------------------------------------------
  175. # This script creates new params ( Pi Variables ) and uses them (when possible)
  176. # to modify the base params (the VX Ace default engine ones)
  177. # These new params are :
  178. # pars = [0] * 8
  179. # xpars = [0] * 10
  180. # spars = [0] * 10
  181. # max_pars = [0] * 8
  182. # max_xpars = [0] * 10
  183. # max_spars = [0] * 10
  184. # They are the same for all classes.
  185. #
  186. #===============================================================================
  187. module Par_Fixx
  188. #===============================================================================
  189. Notes={}# << Keep
  190. Stats={}# << Keep
  191.  
  192. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  193. # ☆ Display Settings
  194. #--------------------------------------------------------------------------
  195. # Make this false if you do not wish to display text when an actor levels down
  196. Show_Level_Down = true
  197.  
  198. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  199. # ☆ Statistics Settings
  200. #--------------------------------------------------------------------------
  201. # This is where you adjust the settings for the base min and max values
  202. # used for actors / enemies.
  203. #--------------------------------------------------------------------------
  204. # Stats[:id]= [ min , max ]
  205. # Params
  206. Stats[:mhp] = [ 0 , 99999 ]
  207. Stats[:mmp] = [ 0 , 99999 ]
  208. Stats[:atk] = [ 1 , 9999 ]
  209. Stats[:def] = [ 1 , 9999 ]
  210. Stats[:mat] = [ 1 , 9999 ]
  211. Stats[:mdf] = [ 1 , 9999 ]
  212. Stats[:agi] = [ 1 , 9999 ]
  213. Stats[:luk] = [ 1 , 9999 ]
  214. # x-Params
  215. Stats[:hit] = [ 0.0 , 0.99 ]
  216. Stats[:eva] = [ 0.0 , 0.99 ]
  217. Stats[:cri] = [ 0.0 , 0.99 ]
  218. Stats[:cev] = [ 0.0 , 0.99 ]
  219. Stats[:mev] = [ 0.0 , 0.99 ]
  220. Stats[:mrf] = [ 0.0 , 0.99 ]
  221. Stats[:cnt] = [ 0.0 , 0.99 ]
  222. Stats[:hrg] = [-0.99 , 0.99 ]
  223. Stats[:mrg] = [-0.99 , 0.99 ]
  224. Stats[:trg] = [-0.99 , 0.99 ]
  225. # s-Params
  226. Stats[:tgr] = [ 0.0 , 2.0 ]
  227. Stats[:grd] = [ 0.0 , 2.0 ]
  228. Stats[:rec] = [ 0.0 , 2.0 ]
  229. Stats[:pha] = [ 0.0 , 2.0 ]
  230. Stats[:mcr] = [ 0.0 , 2.0 ]
  231. Stats[:tcr] = [ 0.0 , 2.0 ]
  232. Stats[:pdr] = [ 0.0 , 2.0 ]
  233. Stats[:mdr] = [ 0.0 , 2.0 ]
  234. Stats[:fdr] = [ 0.0 , 2.0 ]
  235. Stats[:exr] = [ 0.0 , 2.0 ]
  236.  
  237. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  238. # ☆ Notetag Settings
  239. #-----------------------------------------------------------------------------
  240. # This is where you adjust the settings for the notetags used in all
  241. # notetaggable items.
  242. # Only modify this if you understand how to.
  243. #-----------------------------------------------------------------------------
  244. # Notes[:id]= [ <stat: value> , <stat limit: max> ]
  245. # Params :
  246. Notes[:mhp] = [ /<mhp:(.*)>/i , /<mhp limit:(.*)>/i ]
  247. Notes[:mmp] = [ /<mmp:(.*)>/i , /<mmp limit:(.*)>/i ]
  248. Notes[:atk] = [ /<atk:(.*)>/i , /<atk limit:(.*)>/i ]
  249. Notes[:def] = [ /<def:(.*)>/i , /<def limit:(.*)>/i ]
  250. Notes[:mat] = [ /<mat:(.*)>/i , /<mat limit:(.*)>/i ]
  251. Notes[:mdf] = [ /<mdf:(.*)>/i , /<mdf limit:(.*)>/i ]
  252. Notes[:agi] = [ /<agi:(.*)>/i , /<agi limit:(.*)>/i ]
  253. Notes[:luk] = [ /<luk:(.*)>/i , /<luk limit:(.*)>/i ]
  254. # x-Params :
  255. Notes[:hit] = [ /<hit:(.*)>/i , /<hit limit:(.*)>/i ]
  256. Notes[:eva] = [ /<eva:(.*)>/i , /<eva limit:(.*)>/i ]
  257. Notes[:cri] = [ /<cri:(.*)>/i , /<cri limit:(.*)>/i ]
  258. Notes[:cev] = [ /<cev:(.*)>/i , /<cev limit:(.*)>/i ]
  259. Notes[:mev] = [ /<mev:(.*)>/i , /<mev limit:(.*)>/i ]
  260. Notes[:mrf] = [ /<mrf:(.*)>/i , /<mrf limit:(.*)>/i ]
  261. Notes[:cnt] = [ /<cnt:(.*)>/i , /<cnt limit:(.*)>/i ]
  262. Notes[:hrg] = [ /<hrg:(.*)>/i , /<hrg limit:(.*)>/i ]
  263. Notes[:mrg] = [ /<mrg:(.*)>/i , /<mrg limit:(.*)>/i ]
  264. Notes[:trg] = [ /<trg:(.*)>/i , /<trg limit:(.*)>/i ]
  265. # s-Params :
  266. Notes[:tgr] = [ /<tgr:(.*)>/i , /<tgr limit:(.*)>/i ]
  267. Notes[:grd] = [ /<grd:(.*)>/i , /<grd limit:(.*)>/i ]
  268. Notes[:rec] = [ /<rec:(.*)>/i , /<rec limit:(.*)>/i ]
  269. Notes[:pha] = [ /<pha:(.*)>/i , /<pha limit:(.*)>/i ]
  270. Notes[:mcr] = [ /<mcr:(.*)>/i , /<mcr limit:(.*)>/i ]
  271. Notes[:tcr] = [ /<tcr:(.*)>/i , /<tcr limit:(.*)>/i ]
  272. Notes[:pdr] = [ /<pdr:(.*)>/i , /<pdr limit:(.*)>/i ]
  273. Notes[:mdr] = [ /<mdr:(.*)>/i , /<mdr limit:(.*)>/i ]
  274. Notes[:fdr] = [ /<fdr:(.*)>/i , /<fdr limit:(.*)>/i ]
  275. Notes[:exr] = [ /<exr:(.*)>/i , /<exr limit:(.*)>/i ]
  276.  
  277. end#<< Keep
  278. module Vocab#<< Keep
  279. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  280. # ☆ Vocab Settings
  281. #-----------------------------------------------------------------------------
  282. # This is where you change the text shown when actors level down or
  283. # forget skills, sprintf format.
  284. LevelDown = "%s has fell back to %s %s!"
  285. ForgetSkill = "%s's requirements are no longer met!"
  286.  
  287. #####################
  288. # CUSTOMISATION END #
  289. end #####################
  290. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  291. # #
  292. # http://dekitarpg.wordpress.com/ #
  293. # #
  294. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  295. # The following code is protected under the 2013 Dekita Data Protection Act. #
  296. # Ie. The “Do Not Fucking Look” Law. #
  297. # Breaking This One And Only Rule WILL Result in Me Raping Your USB Port. #
  298. # That is all ! #
  299. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  300. #===============================================================================#
  301. module DataManager
  302. #===============================================================================
  303. #-----------------------------------------------------------------------------
  304. # Alias List
  305. #-----------------------------------------------------------------------------
  306. class << self
  307. alias :lbd_unique_stats :load_database
  308. end
  309. #-----------------------------------------------------------------------------
  310. # Load Database (alias)
  311. #-----------------------------------------------------------------------------
  312. def self.load_database
  313. lbd_unique_stats
  314. loa_unique_stats
  315. end
  316. #-----------------------------------------------------------------------------
  317. # Load Unique Shit
  318. #-----------------------------------------------------------------------------
  319. def self.loa_unique_stats
  320. #~ classes = [$data_weapons, $data_armors , $data_items , $data_skills ,
  321. #~ $data_actors , $data_classes, $data_enemies, $data_states ]
  322. #~ for g in classes
  323. #~ for o in g
  324. #~ next if o == nil
  325. #~ o.load_stat_control
  326. #~ end
  327. #~ end
  328. database = $data_weapons + $data_armors + $data_skills + $data_items +
  329. $data_classes + $data_actors + $data_states + $data_enemies
  330. database.compact.each { |item| item.load_stat_control }
  331. end
  332. #-----------------------------------------------------------------------------
  333. #
  334. #-----------------------------------------------------------------------------
  335. end # DataManager
  336.  
  337. #===============================================================================
  338. class RPG::BaseItem
  339. #===============================================================================
  340. #-----------------------------------------------------------------------------
  341. # Pi Variables
  342. #-----------------------------------------------------------------------------
  343. attr_accessor :pars
  344. attr_accessor :xpars
  345. attr_accessor :spars
  346. attr_accessor :max_pars
  347. attr_accessor :max_spars
  348. attr_accessor :max_xpars
  349. #-----------------------------------------------------------------------------
  350. # Load Stat Control
  351. #-----------------------------------------------------------------------------
  352. def load_stat_control
  353. @pars = [0] * 8
  354. @xpars = [0] * 10
  355. @spars = [0] * 10
  356. @max_pars = [0] * 8
  357. @max_xpars = [0] * 10
  358. @max_spars = [0] * 10
  359. check_parfixx_notetags
  360. end
  361. #-----------------------------------------------------------------------------
  362. # Parse Notes
  363. #-----------------------------------------------------------------------------
  364. def check_parfixx_notetags
  365. self.note.split(/[\r\n]+/).each do |line|
  366. case line
  367. when Par_Fixx::Notes[:mhp][0] then @pars[0] = $1.to_i
  368. when Par_Fixx::Notes[:mmp][0] then @pars[1] = $1.to_i
  369. when Par_Fixx::Notes[:atk][0] then @pars[2] = $1.to_i
  370. when Par_Fixx::Notes[:def][0] then @pars[3] = $1.to_i
  371. when Par_Fixx::Notes[:mat][0] then @pars[4] = $1.to_i
  372. when Par_Fixx::Notes[:mdf][0] then @pars[5] = $1.to_i
  373. when Par_Fixx::Notes[:agi][0] then @pars[6] = $1.to_i
  374. when Par_Fixx::Notes[:luk][0] then @pars[7] = $1.to_i
  375. when Par_Fixx::Notes[:hit][0] then @xpars[0] = $1.to_f
  376. when Par_Fixx::Notes[:eva][0] then @xpars[1] = $1.to_f
  377. when Par_Fixx::Notes[:cri][0] then @xpars[2] = $1.to_f
  378. when Par_Fixx::Notes[:cev][0] then @xpars[3] = $1.to_f
  379. when Par_Fixx::Notes[:mev][0] then @xpars[4] = $1.to_f
  380. when Par_Fixx::Notes[:mrf][0] then @xpars[5] = $1.to_f
  381. when Par_Fixx::Notes[:cnt][0] then @xpars[6] = $1.to_f
  382. when Par_Fixx::Notes[:hrg][0] then @xpars[7] = $1.to_f
  383. when Par_Fixx::Notes[:mrg][0] then @xpars[8] = $1.to_f
  384. when Par_Fixx::Notes[:trg][0] then @xpars[9] = $1.to_f
  385. when Par_Fixx::Notes[:tgr][0] then @spars[0] = $1.to_f
  386. when Par_Fixx::Notes[:grd][0] then @spars[1] = $1.to_f
  387. when Par_Fixx::Notes[:rec][0] then @spars[2] = $1.to_f
  388. when Par_Fixx::Notes[:pha][0] then @spars[3] = $1.to_f
  389. when Par_Fixx::Notes[:mcr][0] then @spars[4] = $1.to_f
  390. when Par_Fixx::Notes[:tcr][0] then @spars[5] = $1.to_f
  391. when Par_Fixx::Notes[:pdr][0] then @spars[6] = $1.to_f
  392. when Par_Fixx::Notes[:mdr][0] then @spars[7] = $1.to_f
  393. when Par_Fixx::Notes[:fdr][0] then @spars[8] = $1.to_f
  394. when Par_Fixx::Notes[:exr][0] then @spars[9] = $1.to_f
  395. when Par_Fixx::Notes[:mhp][1] then @max_pars[0] = $1.to_i
  396. when Par_Fixx::Notes[:mmp][1] then @max_pars[1] = $1.to_i
  397. when Par_Fixx::Notes[:atk][1] then @max_pars[2] = $1.to_i
  398. when Par_Fixx::Notes[:def][1] then @max_pars[3] = $1.to_i
  399. when Par_Fixx::Notes[:mat][1] then @max_pars[4] = $1.to_i
  400. when Par_Fixx::Notes[:mdf][1] then @max_pars[5] = $1.to_i
  401. when Par_Fixx::Notes[:agi][1] then @max_pars[6] = $1.to_i
  402. when Par_Fixx::Notes[:luk][1] then @max_pars[7] = $1.to_i
  403. when Par_Fixx::Notes[:hit][1] then @max_xpars[0] = $1.to_f
  404. when Par_Fixx::Notes[:eva][1] then @max_xpars[1] = $1.to_f
  405. when Par_Fixx::Notes[:cri][1] then @max_xpars[2] = $1.to_f
  406. when Par_Fixx::Notes[:cev][1] then @max_xpars[3] = $1.to_f
  407. when Par_Fixx::Notes[:mev][1] then @max_xpars[4] = $1.to_f
  408. when Par_Fixx::Notes[:mrf][1] then @max_xpars[5] = $1.to_f
  409. when Par_Fixx::Notes[:cnt][1] then @max_xpars[6] = $1.to_f
  410. when Par_Fixx::Notes[:hrg][1] then @max_xpars[7] = $1.to_f
  411. when Par_Fixx::Notes[:mrg][1] then @max_xpars[8] = $1.to_f
  412. when Par_Fixx::Notes[:trg][1] then @max_xpars[9] = $1.to_f
  413. when Par_Fixx::Notes[:tgr][1] then @max_spars[0] = $1.to_f
  414. when Par_Fixx::Notes[:grd][1] then @max_spars[1] = $1.to_f
  415. when Par_Fixx::Notes[:rec][1] then @max_spars[2] = $1.to_f
  416. when Par_Fixx::Notes[:pha][1] then @max_spars[3] = $1.to_f
  417. when Par_Fixx::Notes[:mcr][1] then @max_spars[4] = $1.to_f
  418. when Par_Fixx::Notes[:tcr][1] then @max_spars[5] = $1.to_f
  419. when Par_Fixx::Notes[:pdr][1] then @max_spars[6] = $1.to_f
  420. when Par_Fixx::Notes[:mdr][1] then @max_spars[7] = $1.to_f
  421. when Par_Fixx::Notes[:fdr][1] then @max_spars[8] = $1.to_f
  422. when Par_Fixx::Notes[:exr][1] then @max_spars[9] = $1.to_f
  423. end
  424. end
  425. end
  426. #-----------------------------------------------------------------------------
  427. #
  428. #-----------------------------------------------------------------------------
  429. end # << RPG::BaseItem
  430. #===============================================================================
  431. class Game_BattlerBase
  432. #===============================================================================
  433. #-----------------------------------------------------------------------------
  434. # Alias List
  435. #-----------------------------------------------------------------------------
  436. alias :sd13x_GB_init :initialize
  437. #-----------------------------------------------------------------------------
  438. # Initialize Data
  439. #-----------------------------------------------------------------------------
  440. def initialize(*a,&b)
  441. clear_xparam_plus
  442. clear_sparam_plus
  443. sd13x_GB_init(*a,&b)
  444. end
  445. #-----------------------------------------------------------------------------
  446. # Get Reduced Value of Parameter
  447. #-----------------------------------------------------------------------------
  448. def param_min(param_id)
  449. case param_id
  450. when 0 then return Par_Fixx::Stats[:mhp][0]
  451. when 1 then return Par_Fixx::Stats[:mmp][0]
  452. when 2 then return Par_Fixx::Stats[:atk][0]
  453. when 3 then return Par_Fixx::Stats[:def][0]
  454. when 4 then return Par_Fixx::Stats[:mat][0]
  455. when 5 then return Par_Fixx::Stats[:mdf][0]
  456. when 6 then return Par_Fixx::Stats[:agi][0]
  457. when 7 then return Par_Fixx::Stats[:luk][0]
  458. end
  459. end
  460. #-----------------------------------------------------------------------------
  461. # Get Maximum Value of Parameter
  462. #-----------------------------------------------------------------------------
  463. def param_max(param_id)
  464. case param_id
  465. when 0 then return Par_Fixx::Stats[:mhp][1]
  466. when 1 then return Par_Fixx::Stats[:mmp][1]
  467. when 2 then return Par_Fixx::Stats[:atk][1]
  468. when 3 then return Par_Fixx::Stats[:def][1]
  469. when 4 then return Par_Fixx::Stats[:mat][1]
  470. when 5 then return Par_Fixx::Stats[:mdf][1]
  471. when 6 then return Par_Fixx::Stats[:agi][1]
  472. when 7 then return Par_Fixx::Stats[:luk][1]
  473. end
  474. end
  475. #-----------------------------------------------------------------------------
  476. # Add To Parameter
  477. #-----------------------------------------------------------------------------
  478. def add_param(param_id, value, ref = true)
  479. @param_plus[param_id] += value
  480. refresh if ref
  481. end
  482. #-----------------------------------------------------------------------------
  483. # Subtract from Parameter
  484. #-----------------------------------------------------------------------------
  485. def sub_param(param_id, value, ref = true)
  486. @param_plus[param_id] -= value
  487. refresh if ref
  488. end
  489. #-----------------------------------------------------------------------------
  490. # Divide Parameter By Value
  491. #-----------------------------------------------------------------------------
  492. def div_param(param_id, value, ref = true)
  493. @param_plus[param_id] /= value
  494. refresh if ref
  495. end
  496. #-----------------------------------------------------------------------------
  497. # Multiply Parameter By Value
  498. #-----------------------------------------------------------------------------
  499. def mul_param(param_id, value, ref = true)
  500. @param_plus[param_id] *= value
  501. refresh if ref
  502. end
  503. #-----------------------------------------------------------------------------
  504. # Divide Parameter By Value
  505. #-----------------------------------------------------------------------------
  506. def mod_param(param_id, value, ref = true)
  507. @param_plus[param_id] %= value
  508. refresh if ref
  509. end
  510. #-----------------------------------------------------------------------------
  511. # Get Min Value of xParameter
  512. #-----------------------------------------------------------------------------
  513. def xparam_min(xparam_id)
  514. case xparam_id
  515. when 0 then return Par_Fixx::Stats[:hit][0]
  516. when 1 then return Par_Fixx::Stats[:eva][0]
  517. when 2 then return Par_Fixx::Stats[:cri][0]
  518. when 3 then return Par_Fixx::Stats[:cev][0]
  519. when 4 then return Par_Fixx::Stats[:mev][0]
  520. when 5 then return Par_Fixx::Stats[:mrf][0]
  521. when 6 then return Par_Fixx::Stats[:cnt][0]
  522. when 7 then return Par_Fixx::Stats[:hrg][0]
  523. when 8 then return Par_Fixx::Stats[:mrg][0]
  524. when 9 then return Par_Fixx::Stats[:trg][0]
  525. end
  526. end
  527. #-----------------------------------------------------------------------------
  528. # Get Maximum Value of xParameter
  529. #-----------------------------------------------------------------------------
  530. def xparam_max(xparam_id)
  531. case xparam_id
  532. when 0 then return Par_Fixx::Stats[:hit][1]
  533. when 1 then return Par_Fixx::Stats[:eva][1]
  534. when 2 then return Par_Fixx::Stats[:cri][1]
  535. when 3 then return Par_Fixx::Stats[:cev][1]
  536. when 4 then return Par_Fixx::Stats[:mev][1]
  537. when 5 then return Par_Fixx::Stats[:mrf][1]
  538. when 6 then return Par_Fixx::Stats[:cnt][1]
  539. when 7 then return Par_Fixx::Stats[:hrg][1]
  540. when 8 then return Par_Fixx::Stats[:mrg][1]
  541. when 9 then return Par_Fixx::Stats[:trg][1]
  542. end
  543. end
  544. #-----------------------------------------------------------------------------
  545. # Get Base xParam Value (from features)
  546. #-----------------------------------------------------------------------------
  547. def xparam_base(xparam_id)
  548. features_sum(FEATURE_XPARAM, xparam_id)
  549. end
  550. #-----------------------------------------------------------------------------
  551. # Get Real xParam Value
  552. #-----------------------------------------------------------------------------
  553. def xparam(xpar_id)
  554. val = (xparam_base(xpar_id) + xparam_plus(xpar_id))
  555. [[val, xparam_max(xpar_id)].min, xparam_min(xpar_id)].max.to_f
  556. end
  557. #-----------------------------------------------------------------------------
  558. # xParam Plus
  559. #-----------------------------------------------------------------------------
  560. def xparam_plus(xparam_id)
  561. @xparam_plus[xparam_id]
  562. end
  563. #-----------------------------------------------------------------------------
  564. # Clear xParam Plus
  565. #-----------------------------------------------------------------------------
  566. def clear_xparam_plus
  567. @xparam_plus = [0] * 10
  568. end
  569. #-----------------------------------------------------------------------------
  570. # Add xParam
  571. #-----------------------------------------------------------------------------
  572. def add_xparam(xparam_id, value, ref = true)
  573. @xparam_plus[xparam_id] += value
  574. refresh if ref
  575. end
  576. #-----------------------------------------------------------------------------
  577. # Sub xParam
  578. #-----------------------------------------------------------------------------
  579. def sub_xparam(xparam_id, value, ref = true)
  580. @xparam_plus[xparam_id] -= value
  581. refresh if ref
  582. end
  583. #-----------------------------------------------------------------------------
  584. # Div xParam
  585. #-----------------------------------------------------------------------------
  586. def div_xparam(xparam_id, value, ref = true)
  587. @xparam_plus[xparam_id] /= value
  588. refresh if ref
  589. end
  590. #-----------------------------------------------------------------------------
  591. # Mul xParam
  592. #-----------------------------------------------------------------------------
  593. def mul_xparam(xparam_id, value, ref = true)
  594. @xparam_plus[xparam_id] *= value
  595. refresh if ref
  596. end
  597. #-----------------------------------------------------------------------------
  598. # Mod xParam
  599. #-----------------------------------------------------------------------------
  600. def mod_xparam(xparam_id, value, ref = true)
  601. @xparam_plus[xparam_id] %= value
  602. refresh if ref
  603. end
  604. #-----------------------------------------------------------------------------
  605. # Get Min Value of sParameter
  606. #-----------------------------------------------------------------------------
  607. def sparam_min(sparam_id)
  608. case sparam_id
  609. when 0 then return Par_Fixx::Stats[:tgr][0]
  610. when 1 then return Par_Fixx::Stats[:grd][0]
  611. when 2 then return Par_Fixx::Stats[:rec][0]
  612. when 3 then return Par_Fixx::Stats[:pha][0]
  613. when 4 then return Par_Fixx::Stats[:mcr][0]
  614. when 5 then return Par_Fixx::Stats[:tcr][0]
  615. when 6 then return Par_Fixx::Stats[:pdr][0]
  616. when 7 then return Par_Fixx::Stats[:mdr][0]
  617. when 8 then return Par_Fixx::Stats[:fdr][0]
  618. when 9 then return Par_Fixx::Stats[:exr][0]
  619. end
  620. end
  621. #-----------------------------------------------------------------------------
  622. # Get Maximum Value of xParameter
  623. #-----------------------------------------------------------------------------
  624. def sparam_max(sparam_id)
  625. case sparam_id
  626. when 0 then return Par_Fixx::Stats[:tgr][1]
  627. when 1 then return Par_Fixx::Stats[:grd][1]
  628. when 2 then return Par_Fixx::Stats[:rec][1]
  629. when 3 then return Par_Fixx::Stats[:pha][1]
  630. when 4 then return Par_Fixx::Stats[:mcr][1]
  631. when 5 then return Par_Fixx::Stats[:tcr][1]
  632. when 6 then return Par_Fixx::Stats[:pdr][1]
  633. when 7 then return Par_Fixx::Stats[:mdr][1]
  634. when 8 then return Par_Fixx::Stats[:fdr][1]
  635. when 9 then return Par_Fixx::Stats[:exr][1]
  636. end
  637. end
  638. #-----------------------------------------------------------------------------
  639. # Get Base sParam Value (from features)
  640. #-----------------------------------------------------------------------------
  641. def sparam_base(sparam_id)
  642. features_pi(FEATURE_SPARAM, sparam_id)
  643. end
  644. #-----------------------------------------------------------------------------
  645. # Get Real sParam Value
  646. #-----------------------------------------------------------------------------
  647. def sparam(spar_id)
  648. val = (sparam_base(spar_id) + sparam_plus(spar_id))
  649. [[val, sparam_max(spar_id)].min, sparam_min(spar_id)].max.to_f
  650. end
  651. #-----------------------------------------------------------------------------
  652. # sParam Plus
  653. #-----------------------------------------------------------------------------
  654. def sparam_plus(sparam_id)
  655. @sparam_plus[sparam_id]
  656. end
  657. #-----------------------------------------------------------------------------
  658. # Clear sParam Plus
  659. #-----------------------------------------------------------------------------
  660. def clear_sparam_plus
  661. @sparam_plus = [0] * 10
  662. end
  663. #-----------------------------------------------------------------------------
  664. # Add sParam Plus
  665. #-----------------------------------------------------------------------------
  666. def add_sparam(sparam_id, value, ref = true)
  667. @sparam_plus[sparam_id] += value
  668. refresh if ref
  669. end
  670. #-----------------------------------------------------------------------------
  671. # Sub sParam
  672. #-----------------------------------------------------------------------------
  673. def sub_sparam(sparam_id, value, ref = true)
  674. @sparam_plus[sparam_id] -= value
  675. refresh if ref
  676. end
  677. #-----------------------------------------------------------------------------
  678. # Div sParam
  679. #-----------------------------------------------------------------------------
  680. def div_sparam(sparam_id, value, ref = true)
  681. @sparam_plus[sparam_id] /= value
  682. refresh if ref
  683. end
  684. #-----------------------------------------------------------------------------
  685. # Mul sParam
  686. #-----------------------------------------------------------------------------
  687. def mul_sparam(sparam_id, value, ref = true)
  688. @sparam_plus[sparam_id] *= value
  689. refresh if ref
  690. end
  691. #-----------------------------------------------------------------------------
  692. # Mod sParam
  693. #-----------------------------------------------------------------------------
  694. def mod_sparam(sparam_id, value, ref = true)
  695. @sparam_plus[sparam_id] %= value
  696. refresh if ref
  697. end
  698. #-----------------------------------------------------------------------------
  699. #
  700. #-----------------------------------------------------------------------------
  701. end # << Game_BattlerBase
  702. #===============================================================================
  703. class Game_Actor < Game_Battler
  704. #===============================================================================
  705. #-----------------------------------------------------------------------------
  706. # Alias List
  707. #-----------------------------------------------------------------------------
  708. alias :change_exp_sD13x :change_exp
  709. #-----------------------------------------------------------------------------
  710. # Change Experience | show : Level up display flag
  711. #-----------------------------------------------------------------------------
  712. def change_exp(exp, show)
  713. inf = [@level, skills]
  714. change_exp_sD13x(exp, show)
  715. deki_change_exp(inf)
  716. end
  717. #-----------------------------------------------------------------------------
  718. # Change Experience | (Level Down display)
  719. #-----------------------------------------------------------------------------
  720. def deki_change_exp(i)
  721. return unless Par_Fixx::Show_Level_Down
  722. return unless i[0] > @level
  723. display_level_down( i[1] - skills )
  724. refresh
  725. end
  726. #-----------------------------------------------------------------------------
  727. # * Show Level Down Message | old_skills : Array of forgotten skills
  728. #-----------------------------------------------------------------------------
  729. def display_level_down(old_skills)
  730. $game_message.new_page
  731. $game_message.add(sprintf(Vocab::LevelDown, @name, Vocab::level, @level))
  732. old_skills.each do |skill|
  733. $game_message.add(sprintf(Vocab::ForgetSkill, skill.name))
  734. end
  735. end
  736. #-----------------------------------------------------------------------------
  737. # Level Up (overwrite)
  738. #-----------------------------------------------------------------------------
  739. def level_up
  740. increase_level
  741. determine_stat_inc_type if $D13x[:Dev_SLUD]
  742. lv_up_learn_skill
  743. end
  744. #-----------------------------------------------------------------------------
  745. # Increase level
  746. #-----------------------------------------------------------------------------
  747. def increase_level
  748. @level += 1
  749. end
  750. #-----------------------------------------------------------------------------
  751. # Initialize Skills
  752. #-----------------------------------------------------------------------------
  753. def init_skills
  754. @skills = []
  755. @skills_list = []
  756. self.class.learnings.each do |lning|
  757. learn_skill(lning.skill_id) if learn_skill_conditions_met?(lning)
  758. end
  759. end
  760. #-----------------------------------------------------------------------------
  761. # Level Up Learn Skill
  762. #-----------------------------------------------------------------------------
  763. def lv_up_learn_skill
  764. self.class.learnings.each do |lning|
  765. learn_skill(lning.skill_id) if learn_skill_conditions_met?(lning)
  766. end
  767. end
  768. #-----------------------------------------------------------------------------
  769. # Level Down (overwrite)
  770. #-----------------------------------------------------------------------------
  771. def level_down
  772. reduce_level
  773. lv_down_extra
  774. end
  775. #-----------------------------------------------------------------------------
  776. # Reduce Level
  777. #-----------------------------------------------------------------------------
  778. def reduce_level
  779. @level -= 1
  780. end
  781. #-----------------------------------------------------------------------------
  782. # Level Down Extra Shit
  783. #-----------------------------------------------------------------------------
  784. def lv_down_extra
  785. end
  786. #-----------------------------------------------------------------------------
  787. # Get Learning Skill Conditions
  788. #-----------------------------------------------------------------------------
  789. def learn_skill_conditions_met?(learning, mult = 1.0)
  790. return false if @level < (learning.level * mult).to_i
  791. return false if @skills_list.include?(learning.skill_id)
  792. return true
  793. end
  794. #-----------------------------------------------------------------------------
  795. # Param Max
  796. #-----------------------------------------------------------------------------
  797. def param_max(param_id)
  798. base = super
  799. base += param_max_actor_max_pars(param_id)
  800. base += param_max_self_class_max_pars(param_id)
  801. base += param_max_equips_max_pars(param_id)
  802. base += param_max_states_max_pars(param_id)
  803. base += param_max_skills_max_pars(param_id)
  804. base
  805. end
  806. #-----------------------------------------------------------------------------
  807. # Param Max [actor]
  808. #-----------------------------------------------------------------------------
  809. def param_max_actor_max_pars(param_id)
  810. actor.max_pars[param_id]
  811. end
  812. #-----------------------------------------------------------------------------
  813. # Param Max [class]
  814. #-----------------------------------------------------------------------------
  815. def param_max_self_class_max_pars(param_id)
  816. self.class.max_pars[param_id]
  817. end
  818. #-----------------------------------------------------------------------------
  819. # Param Max [equips]
  820. #-----------------------------------------------------------------------------
  821. def param_max_equips_max_pars(param_id)
  822. equips.compact.inject(0) {|r, i| r += i.max_pars[param_id] }
  823. end
  824. #-----------------------------------------------------------------------------
  825. # Param Max [states]
  826. #-----------------------------------------------------------------------------
  827. def param_max_states_max_pars(param_id)
  828. states.compact.inject(0) {|r, i| r += i.max_pars[param_id] }
  829. end
  830. #-----------------------------------------------------------------------------
  831. # Param Max [skills]
  832. #-----------------------------------------------------------------------------
  833. def param_max_skills_max_pars(param_id)
  834. if $D13x[:Skill_Lv]
  835. skills.compact.inject(0) {|r, i| r += (i.max_pars[param_id]*
  836. Skill_Levels::Exp_Set[i.exp_set][@skills_lv[i.id]][2] ).to_i}
  837. else
  838. skills.compact.inject(0) {|r, i| r += i.max_pars[param_id] }
  839. end
  840. end
  841. #-----------------------------------------------------------------------------
  842. # Param Plus
  843. #-----------------------------------------------------------------------------
  844. def param_plus(param_id)
  845. base = super
  846. base += param_plus_actor_pars(param_id)
  847. base += param_plus_self_class_pars(param_id)
  848. base += param_plus_equips_pars(param_id)
  849. base += param_plus_states_pars(param_id)
  850. base += param_plus_skills_pars(param_id)
  851. base
  852. end
  853. #-----------------------------------------------------------------------------
  854. # Param Plus [actor]
  855. #-----------------------------------------------------------------------------
  856. def param_plus_actor_pars(param_id)
  857. actor.pars[param_id]
  858. end
  859. #-----------------------------------------------------------------------------
  860. # Param Plus [class]
  861. #-----------------------------------------------------------------------------
  862. def param_plus_self_class_pars(param_id)
  863. self.class.pars[param_id]
  864. end
  865. #-----------------------------------------------------------------------------
  866. # Param Plus [equips]
  867. #-----------------------------------------------------------------------------
  868. def param_plus_equips_pars(param_id)
  869. equips.compact.inject(0) {|r, i| r += i.pars[param_id] }
  870. end
  871. #-----------------------------------------------------------------------------
  872. # Param Plus [states]
  873. #-----------------------------------------------------------------------------
  874. def param_plus_states_pars(param_id)
  875. states.compact.inject(0) {|r, i| r += i.pars[param_id] }
  876. end
  877. #-----------------------------------------------------------------------------
  878. # Param Plus [skills]
  879. #-----------------------------------------------------------------------------
  880. def param_plus_skills_pars(param_id)
  881. if $D13x[:Skill_Lv]
  882. skills.compact.inject(0) {|r, i| r += (i.pars[param_id]*
  883. Skill_Levels::Exp_Set[i.exp_set][@skills_lv[i.id]][2] ).to_i}
  884. else
  885. skills.compact.inject(0) {|r, i| r += i.pars[param_id] }
  886. end
  887. end
  888. #-----------------------------------------------------------------------------
  889. # xParam Max
  890. #-----------------------------------------------------------------------------
  891. def xparam_max(xparam_id)
  892. base = super
  893. base += xparam_max_actor_max_pars(xparam_id)
  894. base += xparam_max_self_class_max_pars(xparam_id)
  895. base += xparam_max_equips_max_pars(xparam_id)
  896. base += xparam_max_states_max_pars(xparam_id)
  897. base += xparam_max_skills_max_pars(xparam_id)
  898. base
  899. end
  900. #-----------------------------------------------------------------------------
  901. # xParam Max [actor]
  902. #-----------------------------------------------------------------------------
  903. def xparam_max_actor_max_pars(xparam_id)
  904. actor.max_xpars[xparam_id]
  905. end
  906. #-----------------------------------------------------------------------------
  907. # xParam Max [class]
  908. #-----------------------------------------------------------------------------
  909. def xparam_max_self_class_max_pars(xparam_id)
  910. self.class.max_xpars[xparam_id]
  911. end
  912. #-----------------------------------------------------------------------------
  913. # xParam Max [equips]
  914. #-----------------------------------------------------------------------------
  915. def xparam_max_equips_max_pars(xparam_id)
  916. equips.compact.inject(0) {|r, i| r += i.max_xpars[xparam_id] }
  917. end
  918. #-----------------------------------------------------------------------------
  919. # xParam Max [states]
  920. #-----------------------------------------------------------------------------
  921. def xparam_max_states_max_pars(xparam_id)
  922. states.compact.inject(0) {|r, i| r += i.max_xpars[xparam_id] }
  923. end
  924. #-----------------------------------------------------------------------------
  925. # xParam Max [skills]
  926. #-----------------------------------------------------------------------------
  927. def xparam_max_skills_max_pars(xparam_id)
  928. if $D13x[:Skill_Lv]
  929. skills.compact.inject(0) {|r, i| r += (i.max_xpars[xparam_id]*
  930. Skill_Levels::Exp_Set[i.exp_set][@skills_lv[i.id]][2] ).to_i}
  931. else
  932. skills.compact.inject(0) {|r, i| r += i.max_xpars[xparam_id] }
  933. end
  934. end
  935. #-----------------------------------------------------------------------------
  936. # xParam Plus
  937. #-----------------------------------------------------------------------------
  938. def xparam_plus(xparam_id)
  939. base = super
  940. base += xparam_plus_actor_pars(xparam_id)
  941. base += xparam_plus_self_class_pars(xparam_id)
  942. base += xparam_plus_equips_pars(xparam_id)
  943. base += xparam_plus_states_pars(xparam_id)
  944. base += xparam_plus_skills_pars(xparam_id)
  945. base
  946. end
  947. #-----------------------------------------------------------------------------
  948. # xParam Plus [actor]
  949. #-----------------------------------------------------------------------------
  950. def xparam_plus_actor_pars(xparam_id)
  951. actor.xpars[xparam_id]
  952. end
  953. #-----------------------------------------------------------------------------
  954. # xParam Plus [class]
  955. #-----------------------------------------------------------------------------
  956. def xparam_plus_self_class_pars(xparam_id)
  957. self.class.xpars[xparam_id]
  958. end
  959. #-----------------------------------------------------------------------------
  960. # xParam Plus [equips]
  961. #-----------------------------------------------------------------------------
  962. def xparam_plus_equips_pars(xparam_id)
  963. equips.compact.inject(0) {|r, i| r += i.xpars[xparam_id] }
  964. end
  965. #-----------------------------------------------------------------------------
  966. # xParam Plus [states]
  967. #-----------------------------------------------------------------------------
  968. def xparam_plus_states_pars(xparam_id)
  969. states.compact.inject(0) {|r, i| r += i.xpars[xparam_id] }
  970. end
  971. #-----------------------------------------------------------------------------
  972. # xParam Plus [skills]
  973. #-----------------------------------------------------------------------------
  974. def xparam_plus_skills_pars(xparam_id)
  975. if $D13x[:Skill_Lv]
  976. skills.compact.inject(0) {|r, i| r += (i.xpars[xparam_id]*
  977. Skill_Levels::Exp_Set[i.exp_set][@skills_lv[i.id]][2] ).to_i}
  978. else
  979. skills.compact.inject(0) {|r, i| r += i.xpars[xparam_id] }
  980. end
  981. end
  982. #-----------------------------------------------------------------------------
  983. # sParam Max
  984. #-----------------------------------------------------------------------------
  985. def sparam_max(sparam_id)
  986. base = super
  987. base += sparam_max_actor_max_pars(sparam_id)
  988. base += sparam_max_self_class_max_pars(sparam_id)
  989. base += sparam_max_equips_max_pars(sparam_id)
  990. base += sparam_max_states_max_pars(sparam_id)
  991. base += sparam_max_skills_max_pars(sparam_id)
  992. base
  993. end
  994. #-----------------------------------------------------------------------------
  995. # sParam Max [actor]
  996. #-----------------------------------------------------------------------------
  997. def sparam_max_actor_max_pars(sparam_id)
  998. actor.max_spars[sparam_id]
  999. end
  1000. #-----------------------------------------------------------------------------
  1001. # sParam Max [class]
  1002. #-----------------------------------------------------------------------------
  1003. def sparam_max_self_class_max_pars(sparam_id)
  1004. self.class.max_spars[sparam_id]
  1005. end
  1006. #-----------------------------------------------------------------------------
  1007. # sParam Max [equips]
  1008. #-----------------------------------------------------------------------------
  1009. def sparam_max_equips_max_pars(sparam_id)
  1010. equips.compact.inject(0) {|r, i| r += i.max_spars[sparam_id] }
  1011. end
  1012. #-----------------------------------------------------------------------------
  1013. # sParam Max [states]
  1014. #-----------------------------------------------------------------------------
  1015. def sparam_max_states_max_pars(sparam_id)
  1016. states.compact.inject(0) {|r, i| r += i.max_spars[sparam_id] }
  1017. end
  1018. #-----------------------------------------------------------------------------
  1019. # sParam Max [skills]
  1020. #-----------------------------------------------------------------------------
  1021. def sparam_max_skills_max_pars(sparam_id)
  1022. if $D13x[:Skill_Lv]
  1023. skills.compact.inject(0) {|r, i| r += (i.max_spars[sparam_id]*
  1024. Skill_Levels::Exp_Set[i.exp_set][@skills_lv[i.id]][2] ).to_i}
  1025. else
  1026. skills.compact.inject(0) {|r, i| r += i.max_spars[sparam_id] }
  1027. end
  1028. end
  1029. #-----------------------------------------------------------------------------
  1030. # sParam Plus
  1031. #-----------------------------------------------------------------------------
  1032. def sparam_plus(sparam_id)
  1033. base = super
  1034. base += sparam_plus_actor_pars(sparam_id)
  1035. base += sparam_plus_self_class_pars(sparam_id)
  1036. base += sparam_plus_equips_pars(sparam_id)
  1037. base += sparam_plus_states_pars(sparam_id)
  1038. base += sparam_plus_skills_pars(sparam_id)
  1039. base
  1040. end
  1041. #-----------------------------------------------------------------------------
  1042. # sParam Plus [actor]
  1043. #-----------------------------------------------------------------------------
  1044. def sparam_plus_actor_pars(sparam_id)
  1045. actor.spars[sparam_id]
  1046. end
  1047. #-----------------------------------------------------------------------------
  1048. # sParam Plus [class]
  1049. #-----------------------------------------------------------------------------
  1050. def sparam_plus_self_class_pars(sparam_id)
  1051. self.class.spars[sparam_id]
  1052. end
  1053. #-----------------------------------------------------------------------------
  1054. # sParam Plus [equips]
  1055. #-----------------------------------------------------------------------------
  1056. def sparam_plus_equips_pars(sparam_id)
  1057. equips.compact.inject(0) {|r, i| r += i.spars[sparam_id] }
  1058. end
  1059. #-----------------------------------------------------------------------------
  1060. # sParam Plus [states]
  1061. #-----------------------------------------------------------------------------
  1062. def sparam_plus_states_pars(sparam_id)
  1063. states.compact.inject(0) {|r, i| r += i.spars[sparam_id] }
  1064. end
  1065. #-----------------------------------------------------------------------------
  1066. # sParam Plus [skills]
  1067. #-----------------------------------------------------------------------------
  1068. def sparam_plus_skills_pars(sparam_id)
  1069. if $D13x[:Skill_Lv]
  1070. skills.compact.inject(0) {|r, i| r += (i.spars[sparam_id]*
  1071. Skill_Levels::Exp_Set[i.exp_set][@skills_lv[i.id]][2] ).to_i}
  1072. else
  1073. skills.compact.inject(0) {|r, i| r += i.spars[sparam_id] }
  1074. end
  1075. end
  1076. #-----------------------------------------------------------------------------
  1077. #
  1078. #-----------------------------------------------------------------------------
  1079. end # << Game_Actor
  1080. #===============================================================================
  1081. class Game_Enemy < Game_Battler
  1082. #===============================================================================
  1083. #-----------------------------------------------------------------------------
  1084. # Param Max
  1085. #-----------------------------------------------------------------------------
  1086. def param_max(param_id)
  1087. base = super
  1088. base += param_max_enemy_pars(param_id)
  1089. base += param_max_state_pars(param_id)
  1090. base
  1091. end
  1092. #-----------------------------------------------------------------------------
  1093. # Param Max [enemy]
  1094. #-----------------------------------------------------------------------------
  1095. def param_max_enemy_pars(param_id)
  1096. enemy.max_pars[param_id]
  1097. end
  1098. #-----------------------------------------------------------------------------
  1099. # Param Max [states]
  1100. #-----------------------------------------------------------------------------
  1101. def param_max_state_pars(param_id)
  1102. states.compact.inject(0) {|r, i| r += i.max_pars[param_id] }
  1103. end
  1104. #-----------------------------------------------------------------------------
  1105. # Param Plus
  1106. #-----------------------------------------------------------------------------
  1107. def param_plus(param_id)
  1108. base = super
  1109. base += param_plus_enemy_pars(param_id)
  1110. base += param_plus_state_pars(param_id)
  1111. base
  1112. end
  1113. #-----------------------------------------------------------------------------
  1114. # Param Max [enemy]
  1115. #-----------------------------------------------------------------------------
  1116. def param_plus_enemy_pars(param_id)
  1117. enemy.pars[param_id]
  1118. end
  1119. #-----------------------------------------------------------------------------
  1120. # Param Max [states]
  1121. #-----------------------------------------------------------------------------
  1122. def param_plus_state_pars(param_id)
  1123. states.compact.inject(0) {|r, i| r += i.pars[param_id] }
  1124. end
  1125. #-----------------------------------------------------------------------------
  1126. # xParam Max
  1127. #-----------------------------------------------------------------------------
  1128. def xparam_max(xparam_id)
  1129. base = super
  1130. base += xparam_max_enemy_pars(xparam_id)
  1131. base += xparam_max_state_pars(xparam_id)
  1132. base
  1133. end
  1134. #-----------------------------------------------------------------------------
  1135. # xParam Max [enemy]
  1136. #-----------------------------------------------------------------------------
  1137. def xparam_max_enemy_pars(xparam_id)
  1138. enemy.max_xpars[xparam_id]
  1139. end
  1140. #-----------------------------------------------------------------------------
  1141. # xParam Max [states]
  1142. #-----------------------------------------------------------------------------
  1143. def xparam_max_state_pars(xparam_id)
  1144. states.compact.inject(0) {|r, i| r += i.max_xpars[xparam_id] }
  1145. end
  1146. #-----------------------------------------------------------------------------
  1147. # xParam Plus
  1148. #-----------------------------------------------------------------------------
  1149. def xparam_plus(xparam_id)
  1150. base = super
  1151. base += xparam_plus_enemy_pars(xparam_id)
  1152. base += xparam_plus_state_pars(xparam_id)
  1153. base
  1154. end
  1155. #-----------------------------------------------------------------------------
  1156. # xParam Plus [enemy]
  1157. #-----------------------------------------------------------------------------
  1158. def xparam_plus_enemy_pars(xparam_id)
  1159. enemy.xpars[xparam_id]
  1160. end
  1161. #-----------------------------------------------------------------------------
  1162. # xParam Plus [states]
  1163. #-----------------------------------------------------------------------------
  1164. def xparam_plus_state_pars(xparam_id)
  1165. states.compact.inject(0) {|r, i| r += i.xpars[xparam_id] }
  1166. end
  1167. #-----------------------------------------------------------------------------
  1168. # sParam Max
  1169. #-----------------------------------------------------------------------------
  1170. def sparam_max(sparam_id)
  1171. base = super
  1172. base += sparam_max_enemy_pars(sparam_id)
  1173. base += sparam_max_state_pars(sparam_id)
  1174. base
  1175. end
  1176. #-----------------------------------------------------------------------------
  1177. # sParam Max [enemy]
  1178. #-----------------------------------------------------------------------------
  1179. def sparam_max_enemy_pars(sparam_id)
  1180. enemy.max_spars[sparam_id]
  1181. end
  1182. #-----------------------------------------------------------------------------
  1183. # sParam Max [states]
  1184. #-----------------------------------------------------------------------------
  1185. def sparam_max_state_pars(sparam_id)
  1186. states.compact.inject(0) {|r, i| r += i.max_spars[sparam_id] }
  1187. end
  1188. #-----------------------------------------------------------------------------
  1189. # sParam Plus
  1190. #-----------------------------------------------------------------------------
  1191. def sparam_plus(sparam_id)
  1192. base = super
  1193. base += enemy.spars[sparam_id]
  1194. base += states.compact.inject(0) {|r, i| r += i.spars[sparam_id] }
  1195. base
  1196. end
  1197. #-----------------------------------------------------------------------------
  1198. # sParam Max [enemy]
  1199. #-----------------------------------------------------------------------------
  1200. def sparam_plus_enemy_pars(sparam_id)
  1201. enemy.spars[sparam_id]
  1202. end
  1203. #-----------------------------------------------------------------------------
  1204. # sParam Max [states]
  1205. #-----------------------------------------------------------------------------
  1206. def sparam_plus_state_pars(sparam_id)
  1207. states.compact.inject(0) {|r, i| r += i.spars[sparam_id] }
  1208. end
  1209. #-----------------------------------------------------------------------------
  1210. #
  1211. #-----------------------------------------------------------------------------
  1212. end # << Game_Enemy
  1213. #==============================================================================#
  1214. # http://dekitarpg.wordpress.com/ #
  1215. #==============================================================================#
  1216. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement