Advertisement
Dekita

$D13x Statistic Control v1.5

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