Advertisement
Dekita

Stat Formulas

Feb 21st, 2014
546
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.39 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Stat Formulas
  5. # -- Author : Dekita
  6. # -- Version : 1.0
  7. # -- Level : Hard
  8. # -- Requires : Various scripts depending on features used. Details below.
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:Stat_Formulas]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 21/o2/2o14 - Started, Finished,
  21. #
  22. #===============================================================================
  23. # ☆ Introduction
  24. #-------------------------------------------------------------------------------
  25. # This Script is simply my own interpretation of Yanflys - Extra Param Formula
  26. # Script. It was requested by simplestchaos, on my blog, that I make the two
  27. # scripts compatable. It was easier to write my own.
  28. #
  29. # The main difference between mine and yanflys script is that this one offers
  30. # MUCH more control over other statistics, such as; params, xparams, sparams,
  31. # attack elements, defence elements, max tp, attack level, defence level
  32. # && ALL Parent stats created using the ISPDS...
  33. #
  34. # The credit for the formula's goes to Yanfly, I simply used his formulas to
  35. # save time testing.
  36. #
  37. #===============================================================================
  38. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  39. #===============================================================================
  40. # 1. You MUST give credit to "Dekita" !!
  41. # 2. You are NOT allowed to repost this script.(or modified versions)
  42. # 3. You are NOT allowed to convert this script.
  43. # 4. You are NOT allowed to use this script for Commercial games.
  44. # 5. ENJOY!
  45. #
  46. # "FINE PRINT"
  47. # By using this script you hereby agree to the above terms and conditions,
  48. # if any violation of the above terms occurs "legal action" may be taken.
  49. # Not understanding the above terms and conditions does NOT mean that
  50. # they do not apply to you.
  51. # If you wish to discuss the terms and conditions in further detail you can
  52. # contact me at http://dekitarpg.wordpress.com/
  53. #
  54. #===============================================================================
  55. # ☆ Instructions
  56. #-------------------------------------------------------------------------------
  57. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  58. # Place Below My $D13x - Core Script. (if used)
  59. # Place Below My $D13x - Stats Control Script. (if used)
  60. # Place Below My $D13x - Element Control Script. (if used)
  61. # Place Below My $D13x - Max TP Control Script. (if used)
  62. # Place Below My $D13x - ATK/DFL Script. (if used)
  63. #
  64. #===============================================================================
  65. # ☆ HELP
  66. #-------------------------------------------------------------------------------
  67. # PARAMS : # XPARAMS : # SPARAMS : #
  68. # stat = id # stat = id # stat = id #
  69. # mhp = 0 # hit = 0 # tgr = 0 #
  70. # mmp = 1 # eva = 1 # grd = 1 #
  71. # atk = 2 # cri = 2 # rec = 2 #
  72. # def = 3 # cev = 3 # pha = 3 #
  73. # mat = 4 # mev = 4 # mcr = 4 #
  74. # mdf = 5 # mrf = 5 # tcr = 5 #
  75. # agi = 6 # cnt = 6 # pdr = 6 #
  76. # luk = 7 # hrg = 7 # mdr = 7 #
  77. # # mrg = 8 # fdr = 8 #
  78. # # trg = 9 # exr = 9 #
  79. #-------------------------------------------------------------------------------
  80. # Remember :
  81. # All Params work with integer values, eg. 1, 5, 123, 653, 198123
  82. # All x/s-Params work with float values, eg. 1.0, 0.5, 0.1, 0.05, 0.01
  83. # 1.0 = 100%, 0.01 = 1%,
  84. #
  85. #===============================================================================
  86. module StatsFomula
  87. #===============================================================================
  88. #-----------------------------------------------------------------------------
  89. # Parameters (requires $D13x - Statistic Control)
  90. #-----------------------------------------------------------------------------
  91. Params={
  92. 0 => { :n => "0", :f => "base", }, # MHP
  93. 1 => { :n => "0", :f => "base", }, # MMP
  94. 2 => { :n => "0", :f => "base", }, # ATK
  95. 3 => { :n => "0", :f => "base", }, # DEF
  96. 4 => { :n => "0", :f => "base", }, # MAT
  97. 5 => { :n => "0", :f => "base", }, # MDF
  98. 6 => { :n => "0", :f => "base", }, # AGI
  99. 7 => { :n => "0", :f => "base", }, # LUK
  100. } # << END Params
  101. #-----------------------------------------------------------------------------
  102. # x-Parameters (requires $D13x - Statistic Control)
  103. #-----------------------------------------------------------------------------
  104. X_Params={
  105. 0 => { # HIT
  106. :n => "(atk + agi) / 2",
  107. :f => "(n / (100.0 + n)) * 0.250 + 0.050 + base * 2/3",
  108. }, # <<
  109. 1 => { # EVA
  110. :n => "(agi + luk) / 2",
  111. :f => "(n / (256.0 + n)) * 0.250 + 0.000 + base",
  112. }, # <<
  113. 2 => { # CRI
  114. :n => "luk",
  115. :f => "(n / (100.0 + n)) * 0.333 + 0.000 + base",
  116. }, # <<
  117. 3 => { # CEV
  118. :n => "agi * 0.75 + luk * 0.25",
  119. :f => "(n / (512.0 + n)) * 0.167 + 0.000 + base",
  120. }, # <<
  121. 4 => { # MEV
  122. :n => "(mdf + luk) / 2",
  123. :f => "(n / (256.0 + n)) * 0.250 + 0.000 + base",
  124. }, # <<
  125. 5 => { :n => "0", :f => "base", }, # MRF
  126. 6 => { :n => "0", :f => "base", }, # CNT
  127. 7 => { :n => "0", :f => "base", }, # HRG
  128. 8 => { :n => "0", :f => "base", }, # MRG
  129. 9 => { :n => "0", :f => "base", }, # TRG
  130. } # << END X_Params
  131. #-----------------------------------------------------------------------------
  132. # s-Parameters (requires $D13x - Statistic Control)
  133. #-----------------------------------------------------------------------------
  134. S_Params={
  135. 0 => { :n => "0", :f => "base", }, # TGR
  136. 1 => {
  137. :n => "(self.def + mdf) / 2",
  138. :f => "(n / (256.0 + n)) * 0.333 + 0.000 + base",
  139. }, # GRD
  140. 2 => { :n => "0", :f => "base", }, # REC
  141. 3 => { :n => "0", :f => "base", }, # PHA
  142. 4 => { :n => "0", :f => "base", }, # MCR
  143. 5 => { :n => "0", :f => "base", }, # TCR
  144. 6 => { # PDR
  145. :n => "self.def",
  146. :f => "base - (n / (256.0 + n)) * 0.500 - 0.000",
  147. }, # <<
  148. 7 => { # MDR
  149. :n => "mdf",
  150. :f => "base - (n / (256.0 + n)) * 0.500 - 0.000",
  151. }, # <<
  152. 8 => { :n => "0", :f => "base", }, # FDR
  153. 9 => { :n => "0", :f => "base", }, # EXR
  154. } # << END S_Params
  155. #-----------------------------------------------------------------------------
  156. # Defence Element Formulas (requires $D13x - Elements Control)
  157. #-----------------------------------------------------------------------------
  158. Def_Ele={
  159. 0 => { :n => "0", :f => "base", }, # Element 0
  160. 1 => { :n => "0", :f => "base", }, # Element 1
  161. 2 => { :n => "0", :f => "base", }, # Element 2
  162. 3 => { :n => "0", :f => "base", }, # Element 3...
  163. 4 => { :n => "0", :f => "base", },
  164. 5 => { :n => "0", :f => "base", },
  165. 6 => { :n => "0", :f => "base", },
  166. 7 => { :n => "0", :f => "base", },
  167. 8 => { :n => "0", :f => "base", },
  168. 9 => { :n => "0", :f => "base", },
  169. 10 => { :n => "0", :f => "base", },
  170. } # << END Def_Ele
  171. #-----------------------------------------------------------------------------
  172. # Attack Element Formulas (requires $D13x - Elements Control)
  173. #-----------------------------------------------------------------------------
  174. Atk_Ele={
  175. 0 => { :n => "0", :f => "base", }, # Element 0
  176. 1 => { :n => "0", :f => "base", }, # Element 1
  177. 2 => { :n => "0", :f => "base", }, # Element 2
  178. 3 => { :n => "0", :f => "base", }, # Element 3...
  179. 4 => { :n => "0", :f => "base", },
  180. 5 => { :n => "0", :f => "base", },
  181. 6 => { :n => "0", :f => "base", },
  182. 7 => { :n => "0", :f => "base", },
  183. 8 => { :n => "0", :f => "base", },
  184. 9 => { :n => "0", :f => "base", },
  185. 10 => { :n => "0", :f => "base", },
  186. } # << END Atk_Ele
  187. #-----------------------------------------------------------------------------
  188. # Max TP Formula (requires $D13x - Max TP Control)
  189. #-----------------------------------------------------------------------------
  190. Max_TP = { :n => "0", :f => "base", }
  191. #-----------------------------------------------------------------------------
  192. # Atk / Def Level Formulas (requires $D13x - Attack | Defence Levels)
  193. #-----------------------------------------------------------------------------
  194. Atl_Dfl={
  195. 0 => { :n => "0", :f => "base", }, # Attack Level
  196. 1 => { :n => "0", :f => "base", }, # Defence Level
  197. } # << END Atl_Dfl
  198. #-----------------------------------------------------------------------------
  199. # Parent Stat Formulas (requires $D13x - ISPDS)
  200. # NOTE:
  201. # I have allowed for multiple parent stat formulas due to the fact that two
  202. # actors can have different setups.
  203. # If your actor has Stat_Set[0] then Parent_Stat[0] will be used for that
  204. # actors formulas.
  205. # REMEMBER, ALL parent stats need to have a formula, even if the stat is
  206. # not used. As the default setting is for 8 parent stats, I have used 8
  207. # formula's per Stat_Set.
  208. #-----------------------------------------------------------------------------
  209. Parent_Stat=[]
  210. Parent_Stat[0]={ # Stat_Set[0]
  211. 0 => { :n => "0", :f => "base", }, # Vitality
  212. 1 => { :n => "0", :f => "base", }, # Strength
  213. 2 => { :n => "0", :f => "base", }, # Dexterity
  214. 3 => { :n => "0", :f => "base", }, # Magic...
  215. 4 => { :n => "0", :f => "base", }, # NOT USED
  216. 5 => { :n => "0", :f => "base", }, # NOT USED
  217. 6 => { :n => "0", :f => "base", }, # NOT USED
  218. 7 => { :n => "0", :f => "base", }, # NOT USED
  219. } # << END Parent_Stat[0]
  220.  
  221. Parent_Stat[1]={ # Stat_Set[1]
  222. 0 => { :n => "0", :f => "base", }, # Ifrit
  223. 1 => { :n => "0", :f => "base", }, # Shiva
  224. 2 => { :n => "0", :f => "base", }, # Ramuh
  225. 3 => { :n => "0", :f => "base", }, # Levithon
  226. 4 => { :n => "0", :f => "base", }, # Titan
  227. 5 => { :n => "0", :f => "base", }, # Bahamut
  228. 6 => { :n => "0", :f => "base", }, # Ashura
  229. 7 => { :n => "0", :f => "base", }, # Hades
  230. } # << END Parent_Stat[0]
  231.  
  232. #####################
  233. # CUSTOMISATION END #
  234. end #####################
  235. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  236. # #
  237. # http://dekitarpg.wordpress.com/ #
  238. # #
  239. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  240. #===============================================================================#
  241. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  242. # YES?\.\. #
  243. # OMG, REALLY? \| #
  244. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  245. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  246. #===============================================================================#
  247. class Game_BattlerBase
  248. #===============================================================================
  249. #-----------------------------------------------------------------------------
  250. # Alias List
  251. #-----------------------------------------------------------------------------
  252. alias :epf_param_plus :param_plus if $D13x[:Stats_Control]
  253. alias :epf_xparam_plus :xparam_plus if $D13x[:Stats_Control]
  254. alias :epf_sparam_plus :sparam_plus if $D13x[:Stats_Control]
  255. alias :epf_def_ele_plus :def_ele_plus if $D13x[:Elems_Control]
  256. alias :epf_atk_ele_plus :atk_ele_plus if $D13x[:Elems_Control]
  257. alias :epf_max_tp_plus :max_tp_plus if $D13x[:TP_Control]
  258. alias :epf_atl_dfl_plus :atl_dfl_plus if $D13x[:Atk_Def_Lvs]
  259. alias :epf_spds_plus :spds_plus if $D13x[:ISPDS]
  260. #-----------------------------------------------------------------------------
  261. if $D13x[:Stats_Control]
  262. #---------------------------------------------------------------------------
  263. # Param Plus
  264. #---------------------------------------------------------------------------
  265. def param_plus(param_id)
  266. base = epf_param_plus(param_id)
  267. n = eval( StatsFomula::Params[param_id][:n] )
  268. r = eval( StatsFomula::Params[param_id][:f] )
  269. return r
  270. end
  271. #---------------------------------------------------------------------------
  272. # xParam Plus
  273. #---------------------------------------------------------------------------
  274. def xparam_plus(xparam_id)
  275. base = epf_xparam_plus(xparam_id)
  276. n = eval( StatsFomula::X_Params[xparam_id][:n] )
  277. r = eval( StatsFomula::X_Params[xparam_id][:f] )
  278. return r
  279. end
  280. #---------------------------------------------------------------------------
  281. # sParam Plus
  282. #---------------------------------------------------------------------------
  283. def sparam_plus(sparam_id)
  284. base = epf_sparam_plus(sparam_id)
  285. n = eval( StatsFomula::S_Params[sparam_id][:n] )
  286. r = eval( StatsFomula::S_Params[sparam_id][:f] )
  287. return r
  288. end
  289. end # if $D13x[:Stats_Control]
  290. if $D13x[:Elems_Control]
  291. #---------------------------------------------------------------------------
  292. # Defencive Elements Plus
  293. #---------------------------------------------------------------------------
  294. def def_ele_plus(element_id)
  295. base = epf_def_ele_plus(element_id)
  296. n = eval( StatsFomula::Def_Ele[element_id][:n] )
  297. r = eval( StatsFomula::Def_Ele[element_id][:f] )
  298. return r
  299. end
  300. #---------------------------------------------------------------------------
  301. # Attack Elements Plus
  302. #---------------------------------------------------------------------------
  303. def atk_ele_plus(element_id)
  304. base = epf_atk_ele_plus(element_id)
  305. n = eval( StatsFomula::Atk_Ele[element_id][:n] )
  306. r = eval( StatsFomula::Atk_Ele[element_id][:f] )
  307. return r
  308. end
  309. end # if $D13x[:Elems_Control]
  310. if $D13x[:TP_Control]
  311. #---------------------------------------------------------------------------
  312. # Max TP Plus
  313. #---------------------------------------------------------------------------
  314. def max_tp_plus
  315. base = epf_max_tp_plus
  316. n = eval( StatsFomula::Max_TP[:n] )
  317. r = eval( StatsFomula::Max_TP[:f] )
  318. return r
  319. end
  320. end # if $D13x[:TP_Control]
  321. if $D13x[:Atk_Def_Lvs]
  322. #---------------------------------------------------------------------------
  323. # Atk Lv | Def Lv ++
  324. #---------------------------------------------------------------------------
  325. def atl_dfl_plus(id)
  326. base = epf_atl_dfl_plus(id)
  327. n = eval( StatsFomula::Atl_Dfl[id][:n] )
  328. r = eval( StatsFomula::Atl_Dfl[id][:f] )
  329. return r
  330. end
  331. end # if $D13x[:Atk_Def_Lvs]
  332. if $D13x[:ISPDS]
  333. #---------------------------------------------------------------------------
  334. # Get SPDS Stats Plus
  335. #---------------------------------------------------------------------------
  336. def spds_plus(id)
  337. base = epf_spds_plus(id)
  338. n = eval( StatsFomula::Parent_Stat[@spds_set][id][:n] )
  339. r = eval( StatsFomula::Parent_Stat[@spds_set][id][:f] )
  340. return r
  341. end
  342. end # if $D13x[:ISPDS]
  343.  
  344. end
  345.  
  346. #===============================================================================
  347. # http://dekitarpg.wordpress.com/
  348. #===============================================================================
  349. end # if true / false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement