Advertisement
Guest User

Desert's MArk

a guest
May 26th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.20 KB | None | 0 0
  1. Changelog:
  2. - Speed Boost/Moody/Protect AI [under when 0xAA # Protect]
  3. (Protect AI)
  4. if attacker.hasWorkingAbility(:SPEEDBOOST) && attacker.pbSpeed<pbRoughStat(opponent,PBStats::SPEED,skill) && @trickroom==0
  5. score*=3
  6. end
  7. if attacker.hasWorkingAbility(:MOODY) && attacker.effects[PBEffects::ProtectRate]<1
  8. score*=3
  9. end
  10. if (attacker.hasWorkingItem(:TOXICORB) || attacker.hasWorkingItem(:FLAMEORB)) &&
  11. attacker.turncount<1
  12. score*=3
  13. end
  14. -----------------------------------------------------------
  15. - Arenite Wall 8 turns in Desert Field [Move_204]
  16. attacker.pbOwnSide.effects[PBEffects::AreniteWall]=8 if attacker.hasWorkingItem(:LIGHTCLAY) || $fefieldeffect=12 || $fefieldeffect=20
  17. -----------------------------------------------------------
  18. - PbStatusDamage
  19. def pbStatusDamage(move)
  20. if (move.id == PBMoves::AFTERYOU || move.id == PBMoves::BESTOW ||
  21. move.id == PBMoves::CRAFTYSHIELD || move.id == PBMoves::LUCKYCHANT ||
  22. move.id == PBMoves::MEMENTO || move.id == PBMoves::QUASH ||
  23. move.id == PBMoves::SAFEGUARD || move.id == PBMoves::SPITE ||
  24. move.id == PBMoves::SPLASH || move.id == PBMoves::SWEETSCENT ||
  25. move.id == PBMoves::TELEKINESIS || move.id == PBMoves::TELEPORT)
  26. return 0
  27. elsif (move.id == PBMoves::ALLYSWITCH || move.id == PBMoves::AROMATICMIST ||
  28. move.id == PBMoves::CONVERSION || move.id == PBMoves::ENDURE ||
  29. move.id == PBMoves::ENTRAINMENT || move.id == PBMoves::FORESIGHT ||
  30. move.id == PBMoves::FORESTSCURSE || move.id == PBMoves::DEFOG ||
  31. move.id == PBMoves::GUARDSWAP || move.id == PBMoves::HEALBLOCK ||
  32. move.id == PBMoves::IMPRISON || move.id == PBMoves::INSTRUCT ||
  33. move.id == PBMoves::FAIRYLOCK || move.id == PBMoves::LASERFOCUS ||
  34. move.id == PBMoves::HELPINGHAND || move.id == PBMoves::MAGICROOM ||
  35. move.id == PBMoves::MAGNETRISE ||
  36. move.id == PBMoves::LOCKON || move.id == PBMoves::MINDREADER ||
  37. move.id == PBMoves::MIRACLEEYE || move.id == PBMoves::MUDSPORT ||
  38. move.id == PBMoves::NIGHTMARE || move.id == PBMoves::ODORSLEUTH ||
  39. move.id == PBMoves::POWERSPLIT || move.id == PBMoves::POWERSWAP ||
  40. move.id == PBMoves::GRUDGE || move.id == PBMoves::GUARDSPLIT ||
  41. move.id == PBMoves::POWERTRICK || move.id == PBMoves::QUICKGUARD ||
  42. move.id == PBMoves::RECYCLE || move.id == PBMoves::REFLECTTYPE ||
  43. move.id == PBMoves::ROTOTILLER || move.id == PBMoves::SANDATTACK ||
  44. move.id == PBMoves::SKILLSWAP || move.id == PBMoves::SNATCH ||
  45. move.id == PBMoves::MAGICCOAT || move.id == PBMoves::SPEEDSWAP ||
  46. move.id == PBMoves::SPOTLIGHT ||
  47. move.id == PBMoves::TEETERDANCE || move.id == PBMoves::WATERSPORT)
  48. return 5
  49. elsif (move.id == PBMoves::ACUPRESSURE || move.id == PBMoves::CAMOUFLAGE ||
  50. move.id == PBMoves::CHARM || move.id == PBMoves::CONFIDE ||
  51. move.id == PBMoves::DEFENSECURL || move.id == PBMoves::GROWTH ||
  52. move.id == PBMoves::EMBARGO || move.id == PBMoves::FLASH ||
  53. move.id == PBMoves::FOCUSENERGY || move.id == PBMoves::GROWL ||
  54. move.id == PBMoves::HARDEN || move.id == PBMoves::HAZE ||
  55. move.id == PBMoves::HOWL ||
  56. move.id == PBMoves::KINESIS || move.id == PBMoves::LEER ||
  57. move.id == PBMoves::METALSOUND || move.id == PBMoves::NOBLEROAR ||
  58. move.id == PBMoves::PLAYNICE || move.id == PBMoves::POWDER ||
  59. move.id == PBMoves::PSYCHUP || move.id == PBMoves::SHARPEN ||
  60. move.id == PBMoves::SMOKESCREEN || move.id == PBMoves::STRINGSHOT ||
  61. move.id == PBMoves::SUPERSONIC || move.id == PBMoves::TAILWHIP ||
  62. move.id == PBMoves::TEARFULLOOK || move.id == PBMoves::TORMENT ||
  63. move.id == PBMoves::WITHDRAW || move.id == PBMoves::WORKUP)
  64. return 10
  65. elsif (move.id == PBMoves::ASSIST || move.id == PBMoves::BABYDOLLEYES ||
  66. move.id == PBMoves::CAPTIVATE || move.id == PBMoves::COTTONSPORE ||
  67. move.id == PBMoves::DARKVOID || move.id == PBMoves::AGILITY ||
  68. move.id == PBMoves::DOUBLETEAM || move.id == PBMoves::EERIEIMPULSE ||
  69. move.id == PBMoves::FAKETEARS || move.id == PBMoves::FEATHERDANCE ||
  70. move.id == PBMoves::FLORALHEALING ||
  71. move.id == PBMoves::HEALPULSE || move.id == PBMoves::HEALINGWISH ||
  72. move.id == PBMoves::INGRAIN ||
  73. move.id == PBMoves::LUNARDANCE || move.id == PBMoves::MEFIRST ||
  74. move.id == PBMoves::MEDITATE || move.id == PBMoves::MIMIC ||
  75. move.id == PBMoves::POISONPOWDER ||
  76. move.id == PBMoves::REFRESH || move.id == PBMoves::ROLEPLAY ||
  77. move.id == PBMoves::SCARYFACE || move.id == PBMoves::SCREECH ||
  78. move.id == PBMoves::SKETCH ||
  79. move.id == PBMoves::TICKLE || move.id == PBMoves::CHARGE ||
  80. move.id == PBMoves::TRICKORTREAT || move.id == PBMoves::VENOMDRENCH ||
  81. move.id == PBMoves::GEARUP || move.id == PBMoves::MAGNETICFLUX ||
  82. move.id == PBMoves::SANDSTORM || move.id == PBMoves::HAIL ||
  83. move.id == PBMoves::SUNNYDAY || move.id == PBMoves::RAINDANCE)
  84. return 15
  85. elsif (move.id == PBMoves::AQUARING || move.id == PBMoves::BLOCK ||
  86. move.id == PBMoves::CONVERSION2 || move.id == PBMoves::ELECTRIFY ||
  87. move.id == PBMoves::FLATTER || move.id == PBMoves::GASTROACID ||
  88. move.id == PBMoves::HEARTSWAP || move.id == PBMoves::IONDELUGE ||
  89. move.id == PBMoves::MEANLOOK || move.id == PBMoves::LOVELYKISS ||
  90. move.id == PBMoves::METRONOME || move.id == PBMoves::COPYCAT ||
  91. move.id == PBMoves::MIRRORMOVE || move.id == PBMoves::MIST ||
  92. move.id == PBMoves::PERISHSONG || move.id == PBMoves::REST ||
  93. move.id == PBMoves::ROAR || move.id == PBMoves::SIMPLEBEAM ||
  94. move.id == PBMoves::SPIDERWEB || move.id == PBMoves::FLOWERSHIELD ||
  95. move.id == PBMoves::SWAGGER || move.id == PBMoves::SWEETKISS ||
  96. move.id == PBMoves::POISONGAS || move.id == PBMoves::TOXICTHREAD ||
  97. move.id == PBMoves::TRANSFORM || move.id == PBMoves::WHIRLWIND ||
  98. move.id == PBMoves::WORRYSEED || move.id == PBMoves::YAWN)
  99. return 20
  100. elsif (move.id == PBMoves::AMNESIA || move.id == PBMoves::ATTRACT ||
  101. move.id == PBMoves::BARRIER || move.id == PBMoves::BELLYDRUM ||
  102. move.id == PBMoves::CONFUSERAY || move.id == PBMoves::DESTINYBOND ||
  103. move.id == PBMoves::DETECT || move.id == PBMoves::DISABLE ||
  104. move.id == PBMoves::ACIDARMOR || move.id == PBMoves::COSMICPOWER ||
  105. move.id == PBMoves::COTTONGUARD || move.id == PBMoves::DEFENDORDER ||
  106. move.id == PBMoves::FOLLOWME || move.id == PBMoves::AUTOTOMIZE ||
  107. move.id == PBMoves::IRONDEFENSE || move.id == PBMoves::MINIMIZE ||
  108. move.id == PBMoves::PSYCHOSHIFT || move.id == PBMoves::GRAVITY ||
  109. move.id == PBMoves::RAGEPOWDER || move.id == PBMoves::ROCKPOLISH ||
  110. move.id == PBMoves::STOCKPILE || move.id == PBMoves::SUBSTITUTE ||
  111. move.id == PBMoves::SWITCHEROO || move.id == PBMoves::SWALLOW ||
  112. move.id == PBMoves::TAUNT || move.id == PBMoves::TOPSYTURVY ||
  113. move.id == PBMoves::TRICK)
  114. return 25
  115. elsif (move.id == PBMoves::BATONPASS || move.id == PBMoves::BULKUP ||
  116. move.id == PBMoves::CALMMIND || move.id == PBMoves::COIL ||
  117. move.id == PBMoves::CURSE || move.id == PBMoves::ELECTRICTERRAIN ||
  118. move.id == PBMoves::ENCORE || move.id == PBMoves::SOAK ||
  119. move.id == PBMoves::LEECHSEED || move.id == PBMoves::MORNINGSUN ||
  120. move.id == PBMoves::PAINSPLIT || move.id == PBMoves::MILKDRINK ||
  121. move.id == PBMoves::SHOREUP || move.id == PBMoves::SLACKOFF ||
  122. move.id == PBMoves::ROOST || move.id == PBMoves::RECOVER ||
  123. move.id == PBMoves::SYNTHESIS || move.id == PBMoves::WISH ||
  124. move.id == PBMoves::HEALORDER || move.id == PBMoves::MOONLIGHT ||
  125. move.id == PBMoves::SOFTBOILED || move.id == PBMoves::STRENGTHSAP ||
  126. move.id == PBMoves::GRASSYTERRAIN || move.id == PBMoves::MISTYTERRAIN ||
  127. move.id == PBMoves::NATUREPOWER || move.id == PBMoves::PSYCHICTERRAIN ||
  128. move.id == PBMoves::PURIFY || move.id == PBMoves::SLEEPTALK ||
  129. move.id == PBMoves::TRICKROOM || move.id == PBMoves::WONDERROOM)
  130. return 30
  131. elsif (move.id == PBMoves::AROMATHERAPY || move.id == PBMoves::BANEFULBUNKER ||
  132. move.id == PBMoves::HEALBELL ||
  133. move.id == PBMoves::LIGHTSCREEN || move.id == PBMoves::MATBLOCK ||
  134. move.id == PBMoves::NASTYPLOT || move.id == PBMoves::REFLECT ||
  135. move.id == PBMoves::ARENITEWALL || move.id == PBMoves::SPIKES ||
  136. move.id == PBMoves::STEALTHROCK || move.id == PBMoves::THUNDERWAVE ||
  137. move.id == PBMoves::WILLOWISP || move.id == PBMoves::TOXICSPIKES ||
  138. move.id == PBMoves::TOXIC || move.id == PBMoves::GLARE ||
  139. move.id == PBMoves::SING || move.id == PBMoves::PARTINGSHOT ||
  140. move.id == PBMoves::GRASSWHISTLE || move.id == PBMoves::WIDEGUARD ||
  141. move.id == PBMoves::HONECLAWS || move.id == PBMoves::HYPNOSIS ||
  142. move.id == PBMoves::STUNSPORE || move.id == PBMoves::SLEEPPOWDER ||
  143. move.id == PBMoves::SWORDSDANCE || move.id == PBMoves::TAILGLOW ||
  144. move.id == PBMoves::TAILWIND)
  145. return 35
  146. elsif (move.id == PBMoves::DRAGONDANCE || move.id == PBMoves::GEOMANCY ||
  147. move.id == PBMoves::QUIVERDANCE || move.id == PBMoves::SHELLSMASH ||
  148. move.id == PBMoves::SHIFTGEAR || move.id == PBMoves::DESERTSMARK)
  149. return 40
  150. elsif (move.id == PBMoves::AURORAVEIL || move.id == PBMoves::STICKYWEB ||
  151. move.id == PBMoves::SPORE || move.id == PBMoves::PROTECT ||
  152. move.id == PBMoves::SPIKYSHIELD || move.id == PBMoves::KINGSSHIELD)
  153. return 60
  154. end
  155. end
  156. -----------------------------------------------------------
  157. - Toxic Spikes AI [0x104]
  158. if attacker.pbOpposingSide.effects[PBEffects::ToxicSpikes]!=2
  159. if roles.include?("Lead")
  160. score*=1.4
  161. end
  162. if attacker.hp==attacker.totalhp && ((attacker.hasWorkingItem(:FOCUSSASH) || (attacker.hasWorkingAbility(:STURDY) && !attacker.moldbroken)) && (pbWeather!=PBWeather::HAIL || attacker.pbHasType?(:ICE)) && (pbWeather!=PBWeather::SANDSTORM || attacker.pbHasType?(:ROCK) || attacker.pbHasType?(:GROUND) || attacker.pbHasType?(:STEEL)))
  163. score*=1.1
  164. end
  165. if attacker.turncount<2
  166. score*=1.2
  167. end
  168. livecount1=0
  169. for i in pbParty(opponent.index)
  170. next if i.nil?
  171. livecount1+=1 if i.hp!=0
  172. end
  173. livecount2=0
  174. for i in pbParty(attacker.index)
  175. next if i.nil?
  176. livecount2+=1 if i.hp!=0
  177. end
  178. if livecount1>3
  179. miniscore=(livecount1-1)
  180. miniscore*=0.2
  181. score*=miniscore
  182. else
  183. score*=0.1
  184. end
  185. if attacker.pbOpposingSide.effects[PBEffects::ToxicSpikes]>0
  186. score*=0.9
  187. end
  188. -----------------------------------------------------------
  189. - Desert's Mark
  190. when 0x206 # Desert's Mark
  191. sevar = false
  192. for i in attacker.moves
  193. if isConst?(i.type,PBTypes,:GRASS) || isConst?(i.type,PBTypes,:WATER) || isConst?(i.type,PBTypes,:ICE)
  194. sevar = true
  195. end
  196. end
  197. if sevar
  198. score*=1.5
  199. else
  200. score*=1.1
  201. end
  202. if roles.include?("Physical Wall") || roles.include?("Special Wall")
  203. if attacker.pbHasMove?(getID(PBMoves,:TOXIC))
  204. if opponent.pbHasType?(:STEEL) || opponent.pbHasType?(:POISON)
  205. score*=1.5
  206. end
  207. else
  208. score*=1.3
  209. end
  210. end
  211. if roles.include?("Tank")
  212. score*=1.5
  213. end
  214. if opponent.pbHasType?(PBTypes::BUG) || opponent.pbHasType?(PBTypes::FLYING) || opponent.pbHasType?(PBTypes::GRASS)
  215. score*=1.5
  216. end
  217. if skill>=PBTrainerAI.bestSkill
  218. if @aiMoveMemory[2][opponent.pokemonIndex].length>0
  219. movecheck=false
  220. for j in @aiMoveMemory[2][opponent.pokemonIndex]
  221. movecheck=true if isConst?(j.type,PBTypes,:GROUND)
  222. end
  223. if movecheck
  224. score*=0.5
  225. else
  226. score*=1.2
  227. end
  228. end
  229. elsif skill>=PBTrainerAI.highSkill
  230. if @aiMoveMemory[1].length>0
  231. movecheck=false
  232. for j in @aiMoveMemory[2][opponent.pokemonIndex]
  233. movecheck=true if isConst?(j.type,PBTypes,:GROUND)
  234. end
  235. if movecheck
  236. score*=0.5
  237. else
  238. score*=1.2
  239. end
  240. end
  241. elsif skill>=PBTrainerAI.mediumSkill
  242. if @aiMoveMemory[0].length>0
  243. movecheck=false
  244. for j in @aiMoveMemory[2][opponent.pokemonIndex]
  245. movecheck=true if isConst?(j.type,PBTypes,:GROUND)
  246. end
  247. if movecheck
  248. score*=0.5
  249. else
  250. score*=1.2
  251. end
  252. end
  253. end
  254. if opponent.effects[PBEffects::Substitute]>0
  255. score*=0
  256. end
  257. if opponent.type1==getConst(PBTypes,:GROUND) || opponent.type1==getConst(PBTypes,:GROUND)
  258. score=0
  259. end
  260. # next when goes here
  261. end
  262. -----------------------------------------------------------
  263. Arenite Wall AI
  264. if attacker.pbOwnSide.effects[PBEffects::AreniteWall]<=0
  265. if pbWeather==PBWeather::SANDSTORM || (skill>=PBTrainerAI.bestSkill && ($fefieldeffect==12 || $fefieldeffect==20))
  266. score*=1.5
  267. if attacker.pbOwnSide.effects[PBEffects::AreniteWall]>0
  268. score*=0.1
  269. end
  270. if attacker.hasWorkingItem(:LIGHTCLAY) || $fefieldeffect==12
  271. score*=1.5
  272. end
  273. -----------------------------------------------------------
  274. - Ace ["Ace"]
  275. if theseRoles.include?("Ace") && skill>=PBTrainerAI.bestSkill
  276. monscore*=0.523
  277. end
  278. -----------------------------------------------------------
  279. - Superpower-Esque move drawbacks [0x3B]
  280. if livecount>1
  281. miniscore*=(livecount-1)
  282. miniscore/=100.0
  283. miniscore*=0.06
  284. miniscore=(1-miniscore)
  285. score*=miniscore
  286. end
  287. -----------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement