Guest User

Untitled

a guest
Jun 25th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.46 KB | None | 0 0
  1. #===============================================================================
  2. # N.A.S.T.Y. EZ Crit/Hit/Evasion Plus
  3. # Nelderson's Awesome Scripts To You
  4. #
  5. # By: Nelderson
  6. # Last Updated: 2/16/2012
  7. # Version 1.0 - 2/16/2012
  8. #===============================================================================
  9. # Update History:
  10. # - Version 1.0 - Initial release, made for EZaxess (The Ultimate in BITCH!)
  11. #===============================================================================
  12. # *Notes:
  13. # - There is one section to fill out at the top for your
  14. # actor's base stats.
  15. #
  16. # - For weapons and armor a new notetag is used for extra stats.
  17. # <nel_stat STAT x>
  18. # Where STAT can be: (cri, hit, eva)
  19. # Where x is the variable increase(Can also be a negative number)
  20. #
  21. # Example:
  22. # <nel_stat cri+ 14>
  23. #
  24. # - Added compatibility with the Passive Skills Script.
  25. #
  26. # New Parameters for Skill Notetags: (hit+, cri+, eva+, hit-, cri-, eva-)
  27. #
  28. # Example:
  29. # <passive_skill cri+ 14>
  30. #
  31. # This would put the passive skill's owner critical rate up 14
  32. #===============================================================================
  33. # Credits:
  34. # -Nelderson
  35. #===============================================================================
  36. module NEL
  37. #Starting Base Rates for Actors
  38. #Actor ID => [Hit, Evasion, Critical]
  39. def self.base_hitevacrit_rate(actor_id)
  40. case actor_id
  41. when 1; return [70, 2, 3]
  42. else; return [75, 4, 4]
  43. end
  44. end
  45. end
  46.  
  47. class Game_Actor < Game_Battler
  48. include NOTEREADER
  49. include Passive_Configs
  50. alias nel_crihiteva_stats_setup setup
  51. def setup(*args)
  52. @nel_eva = 0 #Evasion Bonus from Passive Skills
  53. @nel_hit = 0 #Hit Bonus from Passive Skills
  54. @nel_cri = 0 #Critical Bonus from Passive Skills
  55. nel_crihiteva_stats_setup(*args)
  56. end
  57. #--------------------------------------------------------------------------
  58. # * Get Evasion Rate - Overwriten
  59. #--------------------------------------------------------------------------
  60. def eva
  61. n = NEL.base_hitevacrit_rate(self.id)[1] + @nel_eva
  62. for item in armors.compact do n += item.eva end
  63. for wep in weapons.compact do n += wep.eva end
  64. n = [[Integer(n), 0].max, 100].min
  65. return n
  66. end
  67. #--------------------------------------------------------------------------
  68. # * Get Critical Ratio - Overwriten
  69. #--------------------------------------------------------------------------
  70. def cri
  71. n = NEL.base_hitevacrit_rate(self.id)[2]+ @nel_cri
  72. for weapon in weapons.compact do n += weapon.cri end
  73. for item in armors.compact do n += item.cri end
  74. n = [[Integer(n), 0].max, 100].min
  75. return n
  76. end
  77. #--------------------------------------------------------------------------
  78. # * Get Hit Ratio - Overwriten
  79. #--------------------------------------------------------------------------
  80. def hit
  81. n = NEL.base_hitevacrit_rate(self.id)[0] + @nel_hit
  82. if two_swords_style
  83. n1 = weapons[0] == nil ? 0 : weapons[0].hit
  84. n2 = weapons[1] == nil ? 0 : weapons[1].hit
  85. n += [n1, n2].min
  86. else
  87. n += weapons[0] == nil ? 0 : weapons[0].hit
  88. end
  89. n = [[Integer(n), 0].max, 100].min
  90. return n
  91. end
  92. #----------------------------------------------------------------------------#
  93. # * Passive Refresh - Compatibility for PassiveSkills 3.0 By: Rockleedude
  94. # skill_id : skill ID #####START#####
  95. #----------------------------------------------------------------------------#
  96. #Adding Passive Skills
  97. alias nel_crithiteva_passvi_skils_learn passive_learn
  98. def passive_learn(skill_id)
  99. hastag = get_tag_array_for($data_skills[skill_id].note,"passive_skill","nil")
  100. if skill_learn?($data_skills[skill_id]) and hastag = true
  101. #--------------------# Add passive property #----------------------#
  102. # Critical Rate - cri+
  103. get_tag_array_for($data_skills[skill_id].note,"passive_skill","cri+")
  104. if $tag_array[1].eql?("cri+") and $tag_array[2] != nil
  105. if $tag_array[2].eql?("var") and $tag_array[3] != nil
  106. ammount = $game_variables[$tag_array[3].to_i]
  107. else
  108. ammount = $tag_array[2].to_i
  109. end
  110. @nel_cri += ammount
  111. end
  112. #--------------------# Add passive property #----------------------#
  113. # Evasion Rate - eva+
  114. get_tag_array_for($data_skills[skill_id].note,"passive_skill","eva+")
  115. if $tag_array[1].eql?("eva+") and $tag_array[2] != nil
  116. if $tag_array[2].eql?("var") and $tag_array[3] != nil
  117. ammount = $game_variables[$tag_array[3].to_i]
  118. else
  119. ammount = $tag_array[2].to_i
  120. end
  121. @nel_eva += ammount
  122. end
  123. #--------------------# Add passive property #----------------------#
  124. # Hit Rate - hit+
  125. get_tag_array_for($data_skills[skill_id].note,"passive_skill","hit+")
  126. if $tag_array[1].eql?("hit+") and $tag_array[2] != nil
  127. if $tag_array[2].eql?("var") and $tag_array[3] != nil
  128. ammount = $game_variables[$tag_array[3].to_i]
  129. else
  130. ammount = $tag_array[2].to_i
  131. end
  132. @nel_hit += ammount
  133. end
  134. #--------------------# Add passive property #----------------------#
  135. # Critical Rate - cri-
  136. get_tag_array_for($data_skills[skill_id].note,"passive_skill","cri-")
  137. if $tag_array[1].eql?("cri-") and $tag_array[2] != nil
  138. if $tag_array[2].eql?("var") and $tag_array[3] != nil
  139. ammount = $game_variables[$tag_array[3].to_i]
  140. else
  141. ammount = $tag_array[2].to_i
  142. end
  143. @nel_cri -= ammount
  144. end
  145. #--------------------# Add passive property #----------------------#
  146. # Evasion Rate - eva-
  147. get_tag_array_for($data_skills[skill_id].note,"passive_skill","eva-")
  148. if $tag_array[1].eql?("eva-") and $tag_array[2] != nil
  149. if $tag_array[2].eql?("var") and $tag_array[3] != nil
  150. ammount = $game_variables[$tag_array[3].to_i]
  151. else
  152. ammount = $tag_array[2].to_i
  153. end
  154. @nel_eva -= ammount
  155. end
  156. #--------------------# Add passive property #----------------------#
  157. # Hit Rate - hit-
  158. get_tag_array_for($data_skills[skill_id].note,"passive_skill","hit-")
  159. if $tag_array[1].eql?("hit-") and $tag_array[2] != nil
  160. if $tag_array[2].eql?("var") and $tag_array[3] != nil
  161. ammount = $game_variables[$tag_array[3].to_i]
  162. else
  163. ammount = $tag_array[2].to_i
  164. end
  165. @nel_hit -= ammount
  166. end
  167. end
  168. nel_crithiteva_passvi_skils_learn(skill_id)
  169. end
  170.  
  171. #Removing Passive Skills
  172. alias nel_crithiteva_passvi_skils_unlearn passive_unlearn
  173. def passive_unlearn(skill_id)
  174. hastag = get_tag_array_for($data_skills[skill_id].note,"passive_skill","nil")
  175. if skill_learn?($data_skills[skill_id]) and hastag = true
  176. #--------------------# Remove passive property #----------------------#
  177. # Critical Rate - cri+
  178. get_tag_array_for($data_skills[skill_id].note,"passive_skill","cri+")
  179. if $tag_array[1].eql?("cri+") and $tag_array[2] != nil
  180. if $tag_array[2].eql?("var") and $tag_array[3] != nil
  181. ammount = $game_variables[$tag_array[3].to_i]
  182. else
  183. ammount = $tag_array[2].to_i
  184. end
  185. @nel_cri -= ammount
  186. end
  187. #--------------------# Remove passive property #----------------------#
  188. # Evasiom Rate - eva+
  189. get_tag_array_for($data_skills[skill_id].note,"passive_skill","eva+")
  190. if $tag_array[1].eql?("eva+") and $tag_array[2] != nil
  191. if $tag_array[2].eql?("var") and $tag_array[3] != nil
  192. ammount = $game_variables[$tag_array[3].to_i]
  193. else
  194. ammount = $tag_array[2].to_i
  195. end
  196. @nel_eva -= ammount
  197. end
  198. #--------------------# Remove passive property #----------------------#
  199. # Hit Rate - hit+
  200. get_tag_array_for($data_skills[skill_id].note,"passive_skill","hit+")
  201. if $tag_array[1].eql?("hit+") and $tag_array[2] != nil
  202. if $tag_array[2].eql?("var") and $tag_array[3] != nil
  203. ammount = $game_variables[$tag_array[3].to_i]
  204. else
  205. ammount = $tag_array[2].to_i
  206. end
  207. @nel_hit -= ammount
  208. end
  209. #--------------------# Remove passive property #----------------------#
  210. # Critical Rate - cri-
  211. get_tag_array_for($data_skills[skill_id].note,"passive_skill","cri-")
  212. if $tag_array[1].eql?("cri-") and $tag_array[2] != nil
  213. if $tag_array[2].eql?("var") and $tag_array[3] != nil
  214. ammount = $game_variables[$tag_array[3].to_i]
  215. else
  216. ammount = $tag_array[2].to_i
  217. end
  218. @nel_cri += ammount
  219. end
  220. #--------------------# Remove passive property #----------------------#
  221. # Evasiom Rate - eva-
  222. get_tag_array_for($data_skills[skill_id].note,"passive_skill","eva-")
  223. if $tag_array[1].eql?("eva-") and $tag_array[2] != nil
  224. if $tag_array[2].eql?("var") and $tag_array[3] != nil
  225. ammount = $game_variables[$tag_array[3].to_i]
  226. else
  227. ammount = $tag_array[2].to_i
  228. end
  229. @nel_eva += ammount
  230. end
  231. #--------------------# Remove passive property #----------------------#
  232. # Hit Rate - hit_
  233. get_tag_array_for($data_skills[skill_id].note,"passive_skill","hit-")
  234. if $tag_array[1].eql?("hit-") and $tag_array[2] != nil
  235. if $tag_array[2].eql?("var") and $tag_array[3] != nil
  236. ammount = $game_variables[$tag_array[3].to_i]
  237. else
  238. ammount = $tag_array[2].to_i
  239. end
  240. @nel_hit += ammount
  241. end
  242. end
  243. nel_crithiteva_passvi_skils_unlearn(skill_id)
  244. end
  245. end
  246. #----------------------------------------------------------------------------#
  247. # * Passive Refresh - Compatibility for PassiveSkills 3.0 By: Rockleedude
  248. # skill_id : skill ID #####END#####
  249. #----------------------------------------------------------------------------#
  250.  
  251. class RPG::Weapon
  252. attr_accessor :cri
  253. attr_accessor :eva
  254. def load_cr_eva_cahce
  255. @cri = 0
  256. @eva = 0
  257. end
  258. def weapon_hcr_neld_stat_info #Checks the atribute and how much it goes up in notetag
  259. self.note.split(/[\r\n]+/).each{ |a|
  260. case a
  261. when /<nel_stat[ ](.*)[ ](\-?\d+)>/i
  262. eval("self.#{$1.downcase} += #{$2}")
  263. end}
  264. end
  265. end
  266.  
  267. class RPG::Armor
  268. attr_accessor :cri
  269. attr_accessor :hit
  270. def load_cr_hit_cahce
  271. @hit = 0
  272. @cri = 0
  273. end
  274. def armor_hcr_neld_stat_info #Checks the atribute and how much it goes up in notetag
  275. self.note.split(/[\r\n]+/).each{ |a|
  276. case a
  277. when /<nel_stat[ ](.*)[ ](\-?\d+)>/i
  278. eval("self.#{$1.downcase} += #{$2}")
  279. end}
  280. end
  281. end
  282.  
  283. class Scene_Title < Scene_Base
  284. #--------------------------------------------------------------------------#
  285. # * Aliased method load_database
  286. #--------------------------------------------------------------------------#
  287. alias nel_load_datbas_critevahit_loda_d load_database unless $@
  288. def load_database
  289. nel_load_datbas_critevahit_loda_d
  290. nel_load_wep_armor_item_stuuff
  291. end
  292. def nel_load_wep_armor_item_stuuff
  293. for a in $data_weapons #Weapon cri/eva initialization
  294. next if a == nil
  295. a.load_cr_eva_cahce
  296. a.weapon_hcr_neld_stat_info
  297. end
  298. for b in $data_armors #Armor cri/hit initialization
  299. next if b == nil
  300. b.load_cr_hit_cahce
  301. b.armor_hcr_neld_stat_info
  302. end
  303. end
  304. end
Add Comment
Please, Sign In to add comment