Advertisement
Guest User

Untitled

a guest
Jul 7th, 2024
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.06 KB | None | 0 0
  1. #=============================================================================
  2. # Damage Calculation
  3. #=============================================================================
  4. #.isSpecies?(:) .pbHasType?(:) .hasActiveAbility?(:) .hasActiveItem?(:) [:].include?(user.status) pbHasStatus?(:)
  5. #@battle.pbOwnSide.effects[] @battle.pbOpposingSide.effects[] @battle.field.effects[] @battle.pbCheckGlobalAbility(:)
  6. #[:].include?(.effectiveWeather) .affectedByTerrain? [:].include?(@id) .effects[]
  7. #type == : physicalMove? specialMove? contactMove? soundMove? recoilMove? multiHitMove? punchingMove? bitingMove? pulseMove? bombMove?
  8. class Battle::Move
  9. alias fieldEffects_pbCalcDamageMultipliers pbCalcDamageMultipliers
  10. def pbCalcDamageMultipliers(user, target, numTargets, type, baseDmg, multipliers)
  11. #=============================================================================
  12. # Global Damage Calculation
  13. #=begin
  14. # if !target.pbOwnedByPlayer?
  15. # multipliers[:power_multiplier] *= 0.9
  16. # multipliers[:defense_multiplier] *= 1.1
  17. # multipliers[:final_damage_multiplier] *= 0.9
  18. # end
  19. # if target.pbOwnedByPlayer?
  20. # multipliers[:power_multiplier] *= 1.1
  21. # multipliers[:defense_multiplier] *= 0.9
  22. # multipliers[:final_damage_multiplier] *= 1.1
  23. # end
  24.  
  25. # if target.isSpecies?(:LARVITAR)
  26. # multipliers[:defense_multiplier] *= 2
  27. # end
  28. # if user.isSpecies?(:LARVITAR)
  29. # multipliers[:power_multiplier] *= 2
  30. # end
  31. #=end
  32.  
  33. # NONE OF THIS CODE WORKS IDK WHY
  34. #=============================================================================
  35. case @battle.field.terrain
  36. #============================================================================= 01
  37. when :ElectricTerrain
  38. if type == :ELECTRIC && user.affectedByTerrain?
  39. multipliers[:power_multiplier] *= 1.3
  40. @battle.pbDisplay(_INTL("The current strengthened the attack!"))
  41. end
  42. if user.hasActiveAbility?(:HADRONENGINE) && specialMove?
  43. @battle.pbShowAbilitySplash(user)
  44. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the current!", target.pbThis))
  45. @battle.pbHideAbilitySplash(user)
  46. end
  47. if user.hasActiveAbility?(:GALVANIZE) && powerBoost
  48. @battle.pbShowAbilitySplash(user)
  49. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the current!", target.pbThis))
  50. @battle.pbHideAbilitySplash(user)
  51. end
  52. if [:RISINGVOLTAGE].include?(@id) && target.affectedByTerrain?
  53. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the current!", target.pbThis))
  54. end
  55. if [:PSYBLADE].include?(@id)
  56. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the current!", target.pbThis))
  57. end
  58. if [:TERRAINPULSE].include?(@id) && user.affectedByTerrain?
  59. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the current!", target.pbThis))
  60. end
  61. #============================================================================= 02
  62. when :GrassyTerrain
  63. if type == :GRASS && user.affectedByTerrain?
  64. multipliers[:power_multiplier] *= 1.3
  65. @battle.pbDisplay(_INTL("The grass strengthened the attack!"))
  66. end
  67. if [:GRASSYGLIDE].include?(@id) && user.affectedByTerrain?
  68. @battle.pbDisplay(_INTL("{1} moves faster on the grass!", @name))
  69. end
  70. if [:BULLDOZE, :EARTHQUAKE, :MAGNITUDE].include?(@id)
  71. @battle.pbDisplay(_INTL("The attack on {1} was weakened by the grass!", target.pbThis))
  72. end
  73. if [:TERRAINPULSE].include?(@id) && user.affectedByTerrain?
  74. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the grass!", target.pbThis))
  75. end
  76. #============================================================================= 03
  77. when :MistyTerrain
  78. if type == :DRAGON && target.affectedByTerrain?
  79. multipliers[:power_multiplier] *= 0.5
  80. @battle.pbDisplay(_INTL("The draconic power weakened..."))
  81. end
  82. if user.hasActiveAbility?(:PIXILATE) && powerBoost
  83. @battle.pbShowAbilitySplash(user)
  84. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the mist!", target.pbThis))
  85. @battle.pbHideAbilitySplash(user)
  86. end
  87. if [:MISTYEXPLOSION].include?(@id)
  88. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the mist!", target.pbThis))
  89. end
  90. if [:TERRAINPULSE].include?(@id) && user.affectedByTerrain?
  91. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the mist!", target.pbThis))
  92. end
  93. #============================================================================= 04
  94. when :PsychicTerrain
  95. if type == :PSYCHIC && user.affectedByTerrain?
  96. multipliers[:power_multiplier] *= 1.3
  97. @battle.pbDisplay(_INTL("The weirdness boosted the attack!"))
  98. end
  99. if [:EXPANDINGFORCE].include?(@id) && user.affectedByTerrain?
  100. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the weirdness!", target.pbThis))
  101. end
  102. if [:TERRAINPULSE].include?(@id) && user.affectedByTerrain?
  103. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the weirdness!", target.pbThis))
  104. end
  105. #============================================================================= 05
  106. when :ElectricField
  107. if type == :ELECTRIC && user.affectedByTerrain?
  108. multipliers[:power_multiplier] *= 1.3
  109. @battle.pbDisplay(_INTL("The current strengthened the attack!"))
  110. end
  111. if user.hasActiveAbility?(:HADRONENGINE) && specialMove?
  112. multipliers[:power_multiplier] *= 4 / 3.0
  113. @battle.pbShowAbilitySplash(user)
  114. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the current!", target.pbThis))
  115. @battle.pbHideAbilitySplash(user)
  116. end
  117. if user.hasActiveAbility?(:GALVANIZE) && powerBoost
  118. multipliers[:power_multiplier] *= 1.25
  119. @battle.pbShowAbilitySplash(user)
  120. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the current!", target.pbThis))
  121. @battle.pbHideAbilitySplash(user)
  122. end
  123. if user.isSpecies?(:ZAPDOS)
  124. multipliers[:power_multiplier] *= 1.5
  125. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the current!", target.pbThis))
  126. end
  127. if user.isSpecies?(:MAGNEMITE)
  128. multipliers[:power_multiplier] *= 2
  129. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the current!", target.pbThis))
  130. end
  131. if [:EXPLOSION, :SELFDESTRUCT, :SURF, :MUDDYWATER, :HURRICANE, :SMACKDOWN, :THOUSANDARROWS].include?(@id) && user.affectedByTerrain?
  132. multipliers[:power_multiplier] *= 1.3
  133. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the current!", target.pbThis))
  134. end
  135. if [:PSYBLADE].include?(@id)
  136. multipliers[:power_multiplier] *= 1.5
  137. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the current!", target.pbThis))
  138. end
  139. if [:TERRAINPULSE, :MAGNETBOMB, :PLASMAFISTS].include?(@id) && user.affectedByTerrain?
  140. multipliers[:power_multiplier] *= 2
  141. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the current!", target.pbThis))
  142. end
  143. if [:RISINGVOLTAGE].include?(@id) && target.affectedByTerrain?
  144. multipliers[:power_multiplier] *= 2
  145. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the current!", target.pbThis))
  146. end
  147. if type == :ELECTRIC && target.affectedByTerrain? && [:PARALYSIS].include?(target.status)
  148. multipliers[:power_multiplier] *= 1.3
  149. @battle.pbDisplay(_INTL("{1} was hurt even more because its paralysis!", target.pbThis))
  150. end
  151. #============================================================================= 06
  152. when :GrassyField
  153. if type == :GRASS && user.affectedByTerrain?
  154. multipliers[:power_multiplier] *= 1.5
  155. @battle.pbDisplay(_INTL("The grass strengthened the attack!"))
  156. end
  157. if type == :FIRE && target.affectedByTerrain?
  158. multipliers[:power_multiplier] *= 1.5
  159. @battle.pbDisplay(_INTL("The fire burned the grass!"))
  160. end
  161. if [:GRASSYGLIDE].include?(@id) && user.affectedByTerrain?
  162. @battle.pbDisplay(_INTL("{1} moves faster on the grass!", @name))
  163. end
  164. if [:BULLDOZE, :EARTHQUAKE, :MAGNITUDE, :SURF, :MUDDYWATER].include?(@id)
  165. multipliers[:power_multiplier] *= 0.5
  166. @battle.pbDisplay(_INTL("The attack on {1} was weakened by the grass!", target.pbThis))
  167. end
  168. if [:FAIRYWIND, :SILVERWIND].include?(@id)
  169. multipliers[:power_multiplier] *= 1.5
  170. @battle.pbDisplay(_INTL("The wind blew the grass up!"))
  171. end
  172. if [:TERRAINPULSE].include?(@id) && user.affectedByTerrain?
  173. multipliers[:power_multiplier] *= 2
  174. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the grass!", target.pbThis))
  175. end
  176. if target.hasActiveAbility?(:GRASSPELT)
  177. multipliers[:defense_multiplier] *= 1.5
  178. @battle.pbShowAbilitySplash(target)
  179. @battle.pbDisplay(_INTL("The grass protected {1}!", target.pbThis))
  180. @battle.pbHideAbilitySplash(target)
  181. end
  182. #============================================================================= 07
  183. when :MistyField
  184. if target.pbHasType?(:FAIRY) && target.affectedByTerrain? && specialMove?
  185. multipliers[:defense_multiplier] *= 1.5
  186. @battle.pbDisplay(_INTL("The mist protected {1}!", target.pbThis))
  187. end
  188. if type == :DRAGON && target.affectedByTerrain?
  189. multipliers[:power_multiplier] *= 0.5
  190. @battle.pbDisplay(_INTL("The draconic power weakened..."))
  191. end
  192. if type == :FAIRY && user.affectedByTerrain?
  193. multipliers[:power_multiplier] *= 1.5
  194. @battle.pbDisplay(_INTL("The mist strengthened the attack!"))
  195. end
  196. if target.hasActiveAbility?(:MARVELSCALE)
  197. multipliers[:defense_multiplier] *= 1.5
  198. @battle.pbShowAbilitySplash(target)
  199. @battle.pbDisplay(_INTL("The mist protected {1}!", target.pbThis))
  200. @battle.pbHideAbilitySplash(target)
  201. end
  202. if user.hasActiveAbility?(:PIXILATE) && powerBoost
  203. multipliers[:power_multiplier] *= 1.25
  204. @battle.pbShowAbilitySplash(user)
  205. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the mist!", target.pbThis))
  206. @battle.pbHideAbilitySplash(user)
  207. end
  208. if [:DARKPULSE, :NIGHTDAZE,:SHADOWBALL].include?(@id)
  209. multipliers[:power_multiplier] *= 0.5
  210. @battle.pbDisplay(_INTL("The attack on {1} was weakened by the mist!", target.pbThis))
  211. end
  212. if [:MISTYEXPLOSION, :MYSTICALFIRE, :MAGICALLEAF, :DOOMDESIRE, :HIDDENPOWER, :ICYWIND, :AURASPHERE].include?(@id) ||
  213. [:MISTBALL, :STEAMERUPTION, :CLEARSMOG, :SMOG, :SILVERWIND, :STRANGESTEAM, :MOONGEISTBEAM].include?(@id)
  214. multipliers[:power_multiplier] *= 1.5
  215. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the mist!", target.pbThis))
  216. end
  217. if [:TERRAINPULSE].include?(@id) && user.affectedByTerrain?
  218. multipliers[:power_multiplier] *= 2
  219. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the mist!", target.pbThis))
  220. end
  221. #============================================================================= 08
  222. when :PsychicField
  223. if type == :PSYCHIC && user.affectedByTerrain?
  224. multipliers[:power_multiplier] *= 1.5
  225. @battle.pbDisplay(_INTL("The weirdness boosted the attack!"))
  226. end
  227. if [:EXPANDINGFORCE, :MYSTICALFIRE, :MAGICALLEAF, :AURASPHERE, :HEX, :MOONBLAST, :MINDBLOWN].include?(@id) && user.affectedByTerrain?
  228. multipliers[:power_multiplier] *= 1.5
  229. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the weirdness!", target.pbThis))
  230. end
  231. if [:TERRAINPULSE].include?(@id) && user.affectedByTerrain?
  232. multipliers[:power_multiplier] *= 2
  233. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the weirdness!", target.pbThis))
  234. end
  235. #============================================================================= 09
  236. when :InverseField
  237. if type == :NORMAL && user.affectedByTerrain?
  238. multipliers[:power_multiplier] *= 1.5
  239. @battle.pbDisplay(_INTL("!kcatta eht detsoob dleif ehT"))
  240. end
  241. if user.hasActiveAbility?(:NORMALIZE) && powerBoost
  242. multipliers[:power_multiplier] *= 1.25
  243. @battle.pbShowAbilitySplash(user)
  244. @battle.pbDisplay(_INTL("!dleif eht yb decnahne saw {1} no kcatta ehT", target.pbThis))
  245. @battle.pbHideAbilitySplash(user)
  246. end
  247. #============================================================================= 10
  248. when :RockyField
  249. if [:TERRAINPULSE, :EARTHQUAKE, :MAGNITUDE, :ROCKCLIMB, :STRENGTH, :BULLDOZE, :HEADBUTT].include?(@id)
  250. @battle.pbDisplay(_INTL("{1} changed to Rock type!", @name))
  251. end
  252. if type == :ROCK && user.affectedByTerrain?
  253. multipliers[:power_multiplier] *= 1.3
  254. @battle.pbDisplay(_INTL("The rock boosted the attack on {1}!", target.pbThis))
  255. end
  256. if user.isSpecies?(:AERODACTYL)
  257. multipliers[:power_multiplier] *= 1.2
  258. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the rock!", target.pbThis))
  259. end
  260. if [:TERRAINPULSE, :ROCKSMASH].include?(@id) && user.affectedByTerrain?
  261. multipliers[:power_multiplier] *= 2
  262. @battle.pbDisplay(_INTL("The attack on {1} was enhanced by the rock!", target.pbThis))
  263. end
  264. #============================================================================= 11
  265. when :CorrosiveField
  266. if [:SMACKDOWN, :MUDSLAP, :MUDSHOT, :MUDBOMB, :MUDDYWATER, :WHIRLPOOL, :THOUSANDARROWS].include?(@id)
  267. @battle.pbDisplay(_INTL("The corrosion strengthened the attack!", @name))
  268. multipliers[:power_multiplier] *= 1.5
  269. end
  270. if [:ACID, :ACIDSPRAY, :GRASSKNOT].include?(@id)
  271. @battle.pbDisplay(_INTL("The corrosion strengthened the attack!", @name))
  272. multipliers[:power_multiplier] *= 2
  273. end
  274. #=============================================================================
  275. end
  276. # fieldEffects_pbCalcDamageMultipliers(user, target, numTargets, type, baseDmg, multipliers)
  277. end
  278. end
  279.  
  280. #=begin
  281. # if user.pokemon.species_data.has_flag?("Legendary")
  282. # if type == :PSYCHIC && physicalMove? && user.affectedByTerrain?
  283. # multipliers[:power_multiplier] *= 1.5
  284. # @battle.pbDisplay(_INTL("The attack gets all beefed up!"))
  285. # end
  286. # if type == :BUG && specialMove? && user.affectedByTerrain?
  287. # multipliers[:power_multiplier] *= 1.5
  288. # @battle.pbDisplay(_INTL("The attack spreads through the exemplifying power of the field!"))
  289. # end
  290. # if target.isSpecies?(:PIKACHU)
  291. # multipliers[:defense_multiplier] *= 1000
  292. # end
  293. # if target.pbHasType?(:ICE) && physicalMove?
  294. # multipliers[:defense_multiplier] *= 1.2
  295. # @battle.pbDisplay(_INTL(""))
  296. # end
  297. # if contactMove?
  298. # multipliers[:power_multiplier] *= 1.2
  299. # @battle.pbDisplay(_INTL("The contact move got powered up!"))
  300. # end
  301. # if !contactMove?
  302. # multipliers[:power_multiplier] *= 1.2
  303. # @battle.pbDisplay(_INTL("The non-contact move went super sayan!"))
  304. # end
  305. # if soundMove?
  306. # multipliers[:power_multiplier] *= 1.1
  307. # @battle.pbDisplay(_INTL("Echo...echo...echo..."))
  308. # end
  309. # if type == :GRASS && user.affectedByTerrain?
  310. # multipliers[:power_multiplier] *= 0.5
  311. # @battle.pbDisplay(_INTL("The move got weaker cause the user is touching grass!"))
  312. # end
  313. # if type == :FIRE && target.affectedByTerrain?
  314. # multipliers[:power_multiplier] *= 0.5
  315. # @battle.pbDisplay(_INTL("The enemy is touching grass, which makes the move weaker!"))
  316. # end
  317. # if @id == :GRAVAPPLE
  318. # multipliers[:power_multiplier] *= 1.5
  319. # @battle.pbDisplay(_INTL("An apple fell from the tree!"))
  320. # end
  321. # if [:CUT, :PSYCHOCUT, :FURYCUTTER].include?(@id)
  322. # multipliers[:power_multiplier] *= 1.5
  323. # @battle.pbDisplay(_INTL("A tree fell onto {1}!",target.pbThis(true)))
  324. # end
  325. # if [:SURF, :MUDDYWATER, :ROCKTHROW].include?(@id)
  326. # multipliers[:power_multiplier] *= 0.5
  327. # @battle.pbDisplay(_INTL("The attack got weaker!"))
  328. # end
  329. # if @id == :HURRICANE
  330. # multipliers[:power_multiplier] *= 2
  331. # @battle.pbDisplay(_INTL("Multiple trees fell on {1}!",target.pbThis(true)))
  332. # end
  333. # if @id == :ATTACKORDER
  334. # multipliers[:power_multiplier] *= 1.5
  335. # @battle.pbDisplay(_INTL("The wild bugs joined the attack!"))
  336. # end
  337. #=end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement