Advertisement
Dekita

$D13x Statistic Control v1.5 b

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