Advertisement
Dekita

stat formulas 1.1

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