Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Changelog:
- - Speed Boost/Moody/Protect AI [under when 0xAA # Protect]
- (Protect AI)
- if attacker.hasWorkingAbility(:SPEEDBOOST) && attacker.pbSpeed<pbRoughStat(opponent,PBStats::SPEED,skill) && @trickroom==0
- score*=3
- end
- if attacker.hasWorkingAbility(:MOODY) && attacker.effects[PBEffects::ProtectRate]<1
- score*=3
- end
- if (attacker.hasWorkingItem(:TOXICORB) || attacker.hasWorkingItem(:FLAMEORB)) &&
- attacker.turncount<1
- score*=3
- end
- -----------------------------------------------------------
- - Arenite Wall 8 turns in Desert Field [Move_204]
- attacker.pbOwnSide.effects[PBEffects::AreniteWall]=8 if attacker.hasWorkingItem(:LIGHTCLAY) || $fefieldeffect=12 || $fefieldeffect=20
- -----------------------------------------------------------
- - PbStatusDamage
- def pbStatusDamage(move)
- if (move.id == PBMoves::AFTERYOU || move.id == PBMoves::BESTOW ||
- move.id == PBMoves::CRAFTYSHIELD || move.id == PBMoves::LUCKYCHANT ||
- move.id == PBMoves::MEMENTO || move.id == PBMoves::QUASH ||
- move.id == PBMoves::SAFEGUARD || move.id == PBMoves::SPITE ||
- move.id == PBMoves::SPLASH || move.id == PBMoves::SWEETSCENT ||
- move.id == PBMoves::TELEKINESIS || move.id == PBMoves::TELEPORT)
- return 0
- elsif (move.id == PBMoves::ALLYSWITCH || move.id == PBMoves::AROMATICMIST ||
- move.id == PBMoves::CONVERSION || move.id == PBMoves::ENDURE ||
- move.id == PBMoves::ENTRAINMENT || move.id == PBMoves::FORESIGHT ||
- move.id == PBMoves::FORESTSCURSE || move.id == PBMoves::DEFOG ||
- move.id == PBMoves::GUARDSWAP || move.id == PBMoves::HEALBLOCK ||
- move.id == PBMoves::IMPRISON || move.id == PBMoves::INSTRUCT ||
- move.id == PBMoves::FAIRYLOCK || move.id == PBMoves::LASERFOCUS ||
- move.id == PBMoves::HELPINGHAND || move.id == PBMoves::MAGICROOM ||
- move.id == PBMoves::MAGNETRISE ||
- move.id == PBMoves::LOCKON || move.id == PBMoves::MINDREADER ||
- move.id == PBMoves::MIRACLEEYE || move.id == PBMoves::MUDSPORT ||
- move.id == PBMoves::NIGHTMARE || move.id == PBMoves::ODORSLEUTH ||
- move.id == PBMoves::POWERSPLIT || move.id == PBMoves::POWERSWAP ||
- move.id == PBMoves::GRUDGE || move.id == PBMoves::GUARDSPLIT ||
- move.id == PBMoves::POWERTRICK || move.id == PBMoves::QUICKGUARD ||
- move.id == PBMoves::RECYCLE || move.id == PBMoves::REFLECTTYPE ||
- move.id == PBMoves::ROTOTILLER || move.id == PBMoves::SANDATTACK ||
- move.id == PBMoves::SKILLSWAP || move.id == PBMoves::SNATCH ||
- move.id == PBMoves::MAGICCOAT || move.id == PBMoves::SPEEDSWAP ||
- move.id == PBMoves::SPOTLIGHT ||
- move.id == PBMoves::TEETERDANCE || move.id == PBMoves::WATERSPORT)
- return 5
- elsif (move.id == PBMoves::ACUPRESSURE || move.id == PBMoves::CAMOUFLAGE ||
- move.id == PBMoves::CHARM || move.id == PBMoves::CONFIDE ||
- move.id == PBMoves::DEFENSECURL || move.id == PBMoves::GROWTH ||
- move.id == PBMoves::EMBARGO || move.id == PBMoves::FLASH ||
- move.id == PBMoves::FOCUSENERGY || move.id == PBMoves::GROWL ||
- move.id == PBMoves::HARDEN || move.id == PBMoves::HAZE ||
- move.id == PBMoves::HOWL ||
- move.id == PBMoves::KINESIS || move.id == PBMoves::LEER ||
- move.id == PBMoves::METALSOUND || move.id == PBMoves::NOBLEROAR ||
- move.id == PBMoves::PLAYNICE || move.id == PBMoves::POWDER ||
- move.id == PBMoves::PSYCHUP || move.id == PBMoves::SHARPEN ||
- move.id == PBMoves::SMOKESCREEN || move.id == PBMoves::STRINGSHOT ||
- move.id == PBMoves::SUPERSONIC || move.id == PBMoves::TAILWHIP ||
- move.id == PBMoves::TEARFULLOOK || move.id == PBMoves::TORMENT ||
- move.id == PBMoves::WITHDRAW || move.id == PBMoves::WORKUP)
- return 10
- elsif (move.id == PBMoves::ASSIST || move.id == PBMoves::BABYDOLLEYES ||
- move.id == PBMoves::CAPTIVATE || move.id == PBMoves::COTTONSPORE ||
- move.id == PBMoves::DARKVOID || move.id == PBMoves::AGILITY ||
- move.id == PBMoves::DOUBLETEAM || move.id == PBMoves::EERIEIMPULSE ||
- move.id == PBMoves::FAKETEARS || move.id == PBMoves::FEATHERDANCE ||
- move.id == PBMoves::FLORALHEALING ||
- move.id == PBMoves::HEALPULSE || move.id == PBMoves::HEALINGWISH ||
- move.id == PBMoves::INGRAIN ||
- move.id == PBMoves::LUNARDANCE || move.id == PBMoves::MEFIRST ||
- move.id == PBMoves::MEDITATE || move.id == PBMoves::MIMIC ||
- move.id == PBMoves::POISONPOWDER ||
- move.id == PBMoves::REFRESH || move.id == PBMoves::ROLEPLAY ||
- move.id == PBMoves::SCARYFACE || move.id == PBMoves::SCREECH ||
- move.id == PBMoves::SKETCH ||
- move.id == PBMoves::TICKLE || move.id == PBMoves::CHARGE ||
- move.id == PBMoves::TRICKORTREAT || move.id == PBMoves::VENOMDRENCH ||
- move.id == PBMoves::GEARUP || move.id == PBMoves::MAGNETICFLUX ||
- move.id == PBMoves::SANDSTORM || move.id == PBMoves::HAIL ||
- move.id == PBMoves::SUNNYDAY || move.id == PBMoves::RAINDANCE)
- return 15
- elsif (move.id == PBMoves::AQUARING || move.id == PBMoves::BLOCK ||
- move.id == PBMoves::CONVERSION2 || move.id == PBMoves::ELECTRIFY ||
- move.id == PBMoves::FLATTER || move.id == PBMoves::GASTROACID ||
- move.id == PBMoves::HEARTSWAP || move.id == PBMoves::IONDELUGE ||
- move.id == PBMoves::MEANLOOK || move.id == PBMoves::LOVELYKISS ||
- move.id == PBMoves::METRONOME || move.id == PBMoves::COPYCAT ||
- move.id == PBMoves::MIRRORMOVE || move.id == PBMoves::MIST ||
- move.id == PBMoves::PERISHSONG || move.id == PBMoves::REST ||
- move.id == PBMoves::ROAR || move.id == PBMoves::SIMPLEBEAM ||
- move.id == PBMoves::SPIDERWEB || move.id == PBMoves::FLOWERSHIELD ||
- move.id == PBMoves::SWAGGER || move.id == PBMoves::SWEETKISS ||
- move.id == PBMoves::POISONGAS || move.id == PBMoves::TOXICTHREAD ||
- move.id == PBMoves::TRANSFORM || move.id == PBMoves::WHIRLWIND ||
- move.id == PBMoves::WORRYSEED || move.id == PBMoves::YAWN)
- return 20
- elsif (move.id == PBMoves::AMNESIA || move.id == PBMoves::ATTRACT ||
- move.id == PBMoves::BARRIER || move.id == PBMoves::BELLYDRUM ||
- move.id == PBMoves::CONFUSERAY || move.id == PBMoves::DESTINYBOND ||
- move.id == PBMoves::DETECT || move.id == PBMoves::DISABLE ||
- move.id == PBMoves::ACIDARMOR || move.id == PBMoves::COSMICPOWER ||
- move.id == PBMoves::COTTONGUARD || move.id == PBMoves::DEFENDORDER ||
- move.id == PBMoves::FOLLOWME || move.id == PBMoves::AUTOTOMIZE ||
- move.id == PBMoves::IRONDEFENSE || move.id == PBMoves::MINIMIZE ||
- move.id == PBMoves::PSYCHOSHIFT || move.id == PBMoves::GRAVITY ||
- move.id == PBMoves::RAGEPOWDER || move.id == PBMoves::ROCKPOLISH ||
- move.id == PBMoves::STOCKPILE || move.id == PBMoves::SUBSTITUTE ||
- move.id == PBMoves::SWITCHEROO || move.id == PBMoves::SWALLOW ||
- move.id == PBMoves::TAUNT || move.id == PBMoves::TOPSYTURVY ||
- move.id == PBMoves::TRICK)
- return 25
- elsif (move.id == PBMoves::BATONPASS || move.id == PBMoves::BULKUP ||
- move.id == PBMoves::CALMMIND || move.id == PBMoves::COIL ||
- move.id == PBMoves::CURSE || move.id == PBMoves::ELECTRICTERRAIN ||
- move.id == PBMoves::ENCORE || move.id == PBMoves::SOAK ||
- move.id == PBMoves::LEECHSEED || move.id == PBMoves::MORNINGSUN ||
- move.id == PBMoves::PAINSPLIT || move.id == PBMoves::MILKDRINK ||
- move.id == PBMoves::SHOREUP || move.id == PBMoves::SLACKOFF ||
- move.id == PBMoves::ROOST || move.id == PBMoves::RECOVER ||
- move.id == PBMoves::SYNTHESIS || move.id == PBMoves::WISH ||
- move.id == PBMoves::HEALORDER || move.id == PBMoves::MOONLIGHT ||
- move.id == PBMoves::SOFTBOILED || move.id == PBMoves::STRENGTHSAP ||
- move.id == PBMoves::GRASSYTERRAIN || move.id == PBMoves::MISTYTERRAIN ||
- move.id == PBMoves::NATUREPOWER || move.id == PBMoves::PSYCHICTERRAIN ||
- move.id == PBMoves::PURIFY || move.id == PBMoves::SLEEPTALK ||
- move.id == PBMoves::TRICKROOM || move.id == PBMoves::WONDERROOM)
- return 30
- elsif (move.id == PBMoves::AROMATHERAPY || move.id == PBMoves::BANEFULBUNKER ||
- move.id == PBMoves::HEALBELL ||
- move.id == PBMoves::LIGHTSCREEN || move.id == PBMoves::MATBLOCK ||
- move.id == PBMoves::NASTYPLOT || move.id == PBMoves::REFLECT ||
- move.id == PBMoves::ARENITEWALL || move.id == PBMoves::SPIKES ||
- move.id == PBMoves::STEALTHROCK || move.id == PBMoves::THUNDERWAVE ||
- move.id == PBMoves::WILLOWISP || move.id == PBMoves::TOXICSPIKES ||
- move.id == PBMoves::TOXIC || move.id == PBMoves::GLARE ||
- move.id == PBMoves::SING || move.id == PBMoves::PARTINGSHOT ||
- move.id == PBMoves::GRASSWHISTLE || move.id == PBMoves::WIDEGUARD ||
- move.id == PBMoves::HONECLAWS || move.id == PBMoves::HYPNOSIS ||
- move.id == PBMoves::STUNSPORE || move.id == PBMoves::SLEEPPOWDER ||
- move.id == PBMoves::SWORDSDANCE || move.id == PBMoves::TAILGLOW ||
- move.id == PBMoves::TAILWIND)
- return 35
- elsif (move.id == PBMoves::DRAGONDANCE || move.id == PBMoves::GEOMANCY ||
- move.id == PBMoves::QUIVERDANCE || move.id == PBMoves::SHELLSMASH ||
- move.id == PBMoves::SHIFTGEAR || move.id == PBMoves::DESERTSMARK)
- return 40
- elsif (move.id == PBMoves::AURORAVEIL || move.id == PBMoves::STICKYWEB ||
- move.id == PBMoves::SPORE || move.id == PBMoves::PROTECT ||
- move.id == PBMoves::SPIKYSHIELD || move.id == PBMoves::KINGSSHIELD)
- return 60
- end
- end
- -----------------------------------------------------------
- - Toxic Spikes AI [0x104]
- if attacker.pbOpposingSide.effects[PBEffects::ToxicSpikes]!=2
- if roles.include?("Lead")
- score*=1.4
- end
- 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)))
- score*=1.1
- end
- if attacker.turncount<2
- score*=1.2
- end
- livecount1=0
- for i in pbParty(opponent.index)
- next if i.nil?
- livecount1+=1 if i.hp!=0
- end
- livecount2=0
- for i in pbParty(attacker.index)
- next if i.nil?
- livecount2+=1 if i.hp!=0
- end
- if livecount1>3
- miniscore=(livecount1-1)
- miniscore*=0.2
- score*=miniscore
- else
- score*=0.1
- end
- if attacker.pbOpposingSide.effects[PBEffects::ToxicSpikes]>0
- score*=0.9
- end
- -----------------------------------------------------------
- - Desert's Mark
- when 0x206 # Desert's Mark
- sevar = false
- for i in attacker.moves
- if isConst?(i.type,PBTypes,:GRASS) || isConst?(i.type,PBTypes,:WATER) || isConst?(i.type,PBTypes,:ICE)
- sevar = true
- end
- end
- if sevar
- score*=1.5
- else
- score*=1.1
- end
- if roles.include?("Physical Wall") || roles.include?("Special Wall")
- if attacker.pbHasMove?(getID(PBMoves,:TOXIC))
- if opponent.pbHasType?(:STEEL) || opponent.pbHasType?(:POISON)
- score*=1.5
- end
- else
- score*=1.3
- end
- end
- if roles.include?("Tank")
- score*=1.5
- end
- if opponent.pbHasType?(PBTypes::BUG) || opponent.pbHasType?(PBTypes::FLYING) || opponent.pbHasType?(PBTypes::GRASS)
- score*=1.5
- end
- if skill>=PBTrainerAI.bestSkill
- if @aiMoveMemory[2][opponent.pokemonIndex].length>0
- movecheck=false
- for j in @aiMoveMemory[2][opponent.pokemonIndex]
- movecheck=true if isConst?(j.type,PBTypes,:GROUND)
- end
- if movecheck
- score*=0.5
- else
- score*=1.2
- end
- end
- elsif skill>=PBTrainerAI.highSkill
- if @aiMoveMemory[1].length>0
- movecheck=false
- for j in @aiMoveMemory[2][opponent.pokemonIndex]
- movecheck=true if isConst?(j.type,PBTypes,:GROUND)
- end
- if movecheck
- score*=0.5
- else
- score*=1.2
- end
- end
- elsif skill>=PBTrainerAI.mediumSkill
- if @aiMoveMemory[0].length>0
- movecheck=false
- for j in @aiMoveMemory[2][opponent.pokemonIndex]
- movecheck=true if isConst?(j.type,PBTypes,:GROUND)
- end
- if movecheck
- score*=0.5
- else
- score*=1.2
- end
- end
- end
- if opponent.effects[PBEffects::Substitute]>0
- score*=0
- end
- if opponent.type1==getConst(PBTypes,:GROUND) || opponent.type1==getConst(PBTypes,:GROUND)
- score=0
- end
- # next when goes here
- end
- -----------------------------------------------------------
- Arenite Wall AI
- if attacker.pbOwnSide.effects[PBEffects::AreniteWall]<=0
- if pbWeather==PBWeather::SANDSTORM || (skill>=PBTrainerAI.bestSkill && ($fefieldeffect==12 || $fefieldeffect==20))
- score*=1.5
- if attacker.pbOwnSide.effects[PBEffects::AreniteWall]>0
- score*=0.1
- end
- if attacker.hasWorkingItem(:LIGHTCLAY) || $fefieldeffect==12
- score*=1.5
- end
- -----------------------------------------------------------
- - Ace ["Ace"]
- if theseRoles.include?("Ace") && skill>=PBTrainerAI.bestSkill
- monscore*=0.523
- end
- -----------------------------------------------------------
- - Superpower-Esque move drawbacks [0x3B]
- if livecount>1
- miniscore*=(livecount-1)
- miniscore/=100.0
- miniscore*=0.06
- miniscore=(1-miniscore)
- score*=miniscore
- end
- -----------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement