Jump to content

A Suggestion for Improving AI, shown through Cynthia's Battlefield


BluePen

Recommended Posts

I hope this is the right thread to post, if not please do tell me so that I can move it somewhere else.^^

 

Short Description

 

 


Now, this post is a suggestion for improving AI in certain battles such as those against Gym Leader, Elite Four, Champ, or other individuals.

To demonstrate how effective my codes can be, I will resort to Cynthia's Pokémon as she has a very diverse team allowing her to gain momentum whenever she switches out one of her members. And it is this switch mechanic which will be the main focus of my post. Apart from explaining my thought process, I will provide the codes so that you can try them out if you are interested in. But you should do that in a separate file just in case you and/or I did some mistakes.
 

 

 

Codes for AI switching out Pokémon

 

 


If you don't feel like reading through my wall text but want to look at my codes immediately, well, here they are. I should mention, however, that without any explanations you likely won't understand why some Pokémon such as Spiritomb have a high chance to switch out or why Garchomp should switch out if the opponent has the move Extra Sensory as those cases are linked to the battlefield I created specifically for Cynthia. Other then that, I would put those codes in PokeBattle_AI, directly under :

if currentmon.effects[PBEffects::Yawn]>0 && currentmon.status!=PBStatuses::SLEEP
     switchscore+=95   

end 

 

- - -

# Start: Trainer AI: Cynthia
    if $fefieldeffect == 58 && !@doublebattle && @opponent.name == "Cynthia"
      # Spiritomb
      if currentmon.name == "Spiritomb" && currentmon.hp/currentmon.totalhp>(2/5) && 
        currentmon.turncount>0
        switchscore+=160
      end
      if currentmon.name == "Spiritomb" && currentmon.hp/currentmon.totalhp>(2/5) && 
        opponent1.effects[PBEffects::DestinyBond]
        switchscore+=100
      end
      if currentmon.name == "Spiritomb" && currentmon.hp/currentmon.totalhp>(2/5) && 
        opponent1.pbHasType?(:FAIRY)
        switchscore+=100
      end
      if currentmon.name == "Spiritomb" && currentmon.hp/currentmon.totalhp>(2/5) && 
        opponent1.pbHasType?(:DARK) && opponent1.hp/opponent1.totalhp>(11/20)
        switchscore+=100
      end
      if currentmon.name == "Spiritomb" && currentmon.hp/currentmon.totalhp>(2/5) && 
        isConst?(opponent1.species,PBSpecies,:MANDIBUZZ) && opponent1.hp/opponent1.totalhp>(1/8)
        switchscore+=160
      end
      if currentmon.name == "Spiritomb" && currentmon.hp/currentmon.totalhp>(2/5) && 
        isConst?(opponent1.species,PBSpecies,:UMBREON) && opponent1.hp/opponent1.totalhp>(1/8)
        switchscore+=160
      end
      # Lucario
      if currentmon.name == "Lucario" && currentmon.hp/currentmon.totalhp>(2/5) && 
        opponent1.hasWorkingAbility(:BULLETPROOF)
        switchscore+=160
      end
      if currentmon.name == "Lucario" && currentmon.hp/currentmon.totalhp>(2/5) && 
        opponent1.effects[PBEffects::DestinyBond]
        switchscore+=100
      end
      if currentmon.name == "Lucario" && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) < pbRoughStat(opponent1,PBStats::SPEED,skill)
          if opponent1.pbHasType?(:FIRE) ||
            opponent1.pbHasType?(:FIGHTING) ||
            opponent1.pbHasType?(:GROUND)
            switchscore+=160
          end
        end
      end
      if currentmon.name == "Lucario" && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) < pbRoughStat(opponent1,PBStats::SPEED,skill)
          if !opponent1.pbHasType?(:FIRE) && opponent1.pbHasMove?(getID(PBMoves,:OVERHEAT))
            switchscore+=160
          end
        end
      end
      if currentmon.name == "Lucario" && currentmon.hp/currentmon.totalhp<(19/20) && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) < pbRoughStat(opponent1,PBStats::SPEED,skill)
          if !opponent1.pbHasType?(:FIRE) && opponent1.pbHasMove?(getID(PBMoves,:FIREBLAST))
            switchscore+=160
          end
        end
      end
      if currentmon.name == "Lucario" && currentmon.hp/currentmon.totalhp<(3/4) && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) < pbRoughStat(opponent1,PBStats::SPEED,skill)
          if !opponent1.pbHasType?(:FIRE) && opponent1.pbHasMove?(getID(PBMoves,:FLAMETHROWER))
            switchscore+=160
          end
        end
      end
      if currentmon.name == "Lucario" && currentmon.hp/currentmon.totalhp<(9/10) && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) > pbRoughStat(opponent1,PBStats::SPEED,skill)
          if isConst?(opponent1.species,PBSpecies,:BRELOOM) && opponent1.pbHasMove?(getID(PBMoves,:MACHPUNCH)) && opponent1.hasWorkingAbility(:TECHNICIAN)
            if !opponent1.hasWorkingItem(:CHOICEBAND) &&
              !opponent1.hasWorkingItem(:LIFEORB) &&
              !opponent1.hasWorkingItem(:FIGHTINGGEM) &&
              !opponent1.hasWorkingItem(:BLACKBELT) &&
              !opponent1.hasWorkingItem(:FISTPLATE)
              switchscore+=160
            end
          end
        end
      end
      if currentmon.name == "Lucario" && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) > pbRoughStat(opponent1,PBStats::SPEED,skill)
          if isConst?(opponent1.species,PBSpecies,:BRELOOM) && opponent1.pbHasMove?(getID(PBMoves,:MACHPUNCH)) && opponent1.hasWorkingAbility(:TECHNICIAN)
            if opponent1.hasWorkingItem(:CHOICEBAND) ||
              opponent1.hasWorkingItem(:LIFEORB) ||
              opponent1.hasWorkingItem(:FIGHTINGGEM) ||
              opponent1.hasWorkingItem(:BLACKBELT) ||
              opponent1.hasWorkingItem(:FISTPLATE)
              switchscore+=100
            end
          end
        end
      end
      if currentmon.name == "Lucario" && currentmon.hp/currentmon.totalhp<(13/20) && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) > pbRoughStat(opponent1,PBStats::SPEED,skill)
          if isConst?(opponent1.species,PBSpecies,:CONKELDURR) && opponent1.pbHasMove?(getID(PBMoves,:MACHPUNCH))
            if !opponent1.hasWorkingItem(:CHOICEBAND) &&
              !opponent1.hasWorkingItem(:LIFEORB) &&
              !opponent1.hasWorkingItem(:FIGHTINGGEM) &&
              !opponent1.hasWorkingItem(:BLACKBELT) &&
              !opponent1.hasWorkingItem(:FISTPLATE) &&
              !opponent1.hasWorkingAbility(:IRONFIST)
              switchscore+=160
            end
          end
        end
      end
      if currentmon.name == "Lucario" && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) > pbRoughStat(opponent1,PBStats::SPEED,skill)
          if isConst?(opponent1.species,PBSpecies,:CONKELDURR) && opponent1.pbHasMove?(getID(PBMoves,:MACHPUNCH))
            if opponent1.hasWorkingItem(:CHOICEBAND) ||
              opponent1.hasWorkingItem(:LIFEORB) ||
              opponent1.hasWorkingItem(:FIGHTINGGEM) ||
              opponent1.hasWorkingItem(:BLACKBELT) ||
              opponent1.hasWorkingItem(:FISTPLATE)
              switchscore+=160
            end
          end
        end
      end
      if currentmon.name == "Lucario" && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) > pbRoughStat(opponent1,PBStats::SPEED,skill)
          if isConst?(opponent1.species,PBSpecies,:CONKELDURR) && opponent1.pbHasMove?(getID(PBMoves,:MACHPUNCH))
            if opponent1.hasWorkingAbility(:IRONFIST) ||
              opponent1.hasWorkingAbility(:GUTS)
              switchscore+=50
            end
          end
        end
      end
      # Togekiss
      if currentmon.name == "Togekiss" && currentmon.hp/currentmon.totalhp>(2/5) && 
        currentmon.turncount>0
        switchscore+=100
      end
      if currentmon.name == "Togekiss" && currentmon.hp/currentmon.totalhp>(2/5) && 
        opponent1.effects[PBEffects::DestinyBond]
        switchscore+=100
      end
      if currentmon.name == "Togekiss" && currentmon.hp/currentmon.totalhp>(2/5) && currentmon.turncount>0
        if pbRoughStat(currentmon,PBStats::SPEED,skill) < pbRoughStat(opponent1,PBStats::SPEED,skill)
          if opponent1.pbHasMove?(getID(PBMoves,:ICEBEAM)) ||
            opponent1.pbHasMove?(getID(PBMoves,:BLIZZARD)) ||
            opponent1.pbHasMove?(getID(PBMoves,:FREEZEDRY)) ||
            opponent1.pbHasMove?(getID(PBMoves,:ICICLECRASH)) ||
            opponent1.pbHasMove?(getID(PBMoves,:ICEPUNCH)) ||
            opponent1.pbHasMove?(getID(PBMoves,:ICICLESPEAR)) ||
            opponent1.pbHasMove?(getID(PBMoves,:STONEEDGE)) ||
            opponent1.pbHasMove?(getID(PBMoves,:ROCKSLIDE)) ||
            opponent1.pbHasMove?(getID(PBMoves,:ROCKBLAST)) ||
            opponent1.pbHasMove?(getID(PBMoves,:HEADSMASH)) ||
            opponent1.pbHasMove?(getID(PBMoves,:ANCIENTPOWER)) ||
            opponent1.pbHasMove?(getID(PBMoves,:ROCKSLIDE)) ||
            opponent1.pbHasMove?(getID(PBMoves,:POWERGEM)) ||
            opponent1.pbHasMove?(getID(PBMoves,:GUNKSHOT)) ||
            opponent1.pbHasMove?(getID(PBMoves,:SLUDGEBOMB)) ||
            opponent1.pbHasMove?(getID(PBMoves,:SLUDGEWAVE)) ||
            opponent1.pbHasMove?(getID(PBMoves,:POISONJAB)) ||
            opponent1.pbHasMove?(getID(PBMoves,:IRONTAIL)) ||
            opponent1.pbHasMove?(getID(PBMoves,:METEORMASH)) ||
            opponent1.pbHasMove?(getID(PBMoves,:IRONHEAD)) ||
            opponent1.pbHasMove?(getID(PBMoves,:FLASHCANNON)) ||
            opponent1.pbHasMove?(getID(PBMoves,:THUNDER)) ||
            opponent1.pbHasMove?(getID(PBMoves,:THUNDERBOLT)) ||
            opponent1.pbHasMove?(getID(PBMoves,:WILDCHARGE)) ||
            opponent1.pbHasMove?(getID(PBMoves,:THUNDERPUNCH))
            switchscore+=100
          end
        end
      end
      if currentmon.name == "Togekiss" && currentmon.hp/currentmon.totalhp>(2/5) && currentmon.turncount>0
        if pbRoughStat(currentmon,PBStats::SPEED,skill) < pbRoughStat(opponent1,PBStats::SPEED,skill)
          if opponent1.pbHasType?(:ROCK) ||
            opponent1.pbHasType?(:ICE) ||
            opponent1.pbHasType?(:POISON) ||
            opponent1.pbHasType?(:STEEL)
            switchscore+=160
          end
        end
      end
      if currentmon.name == "Togekiss" && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) < pbRoughStat(opponent1,PBStats::SPEED,skill)
          if opponent1.pbHasType?(:ELECTRIC)
            switchscore+=160
          end
        end
      end
      if currentmon.name == "Togekiss" && currentmon.hp/currentmon.totalhp>(2/5) && currentmon.turncount>0
        if isConst?(opponent1.species,PBSpecies,:SCIZOR) && opponent1.pbHasMove?(getID(PBMoves,:BULLETPUNCH))
          switchscore+=100
        end
      end
      # Milotic
      if currentmon.name == "Milotic" && currentmon.hp/currentmon.totalhp>(2/5) && 
        opponent1.effects[PBEffects::DestinyBond]
        switchscore+=100
      end
      if currentmon.name == "Milotic" && currentmon.hp/currentmon.totalhp>(1/2) && 
        opponent1.pbHasType?(:ELECTRIC)
        switchscore+=160
      end
      if currentmon.name == "Milotic" && currentmon.hp/currentmon.totalhp>(1/2) && 
        opponent1.pbHasType?(:GRASS)
        switchscore+=160
      end
      if currentmon.name == "Milotic" && currentmon.hp/currentmon.totalhp>(2/5) && 
        isConst?(opponent1.species,PBSpecies,:VENUSAUR) && opponent1.form==1
        switchscore+=160
      end
      if currentmon.name == "Milotic" && currentmon.hp/currentmon.totalhp>(2/5) && 
        isConst?(opponent1.species,PBSpecies,:TOXAPEX)
        switchscore+=160
      end
      if currentmon.name == "Milotic" && currentmon.hp/currentmon.totalhp>(2/5) && 
        isConst?(opponent1.species,PBSpecies,:TENTACRUEL)
        switchscore+=160
      end
      # Roserade
      if currentmon.name == "Roserade" && currentmon.hp/currentmon.totalhp>(2/5) && 
        currentmon.turncount>0
        switchscore+=100
      end
      if currentmon.name == "Roserade" && currentmon.hp/currentmon.totalhp>(2/5) && 
        opponent1.effects[PBEffects::DestinyBond]
        switchscore+=100
      end
      if currentmon.name == "Roserade" && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) < pbRoughStat(opponent1,PBStats::SPEED,skill)
          if opponent1.pbHasType?(:PSYCHIC) ||
            opponent1.pbHasType?(:FLYING) ||
            opponent1.pbHasType?(:FIRE) ||
            opponent1.pbHasType?(:ICE)
            switchscore+=100
          end
        end
      end
      if currentmon.name == "Roserade" && currentmon.hp/currentmon.totalhp>(1/2) &&
        opponent1.pbHasType?(:PSYCHIC)
        switchscore+=100
      end
      if currentmon.name == "Roserade" && currentmon.hp/currentmon.totalhp>(1/2) && 
        opponent1.pbHasType?(:FLYING)
        switchscore+=100
      end
      if currentmon.name == "Roserade" && currentmon.hp/currentmon.totalhp>(1/2) && 
        opponent1.pbHasType?(:FIRE)
        switchscore+=100
      end
      if currentmon.name == "Roserade" && currentmon.hp/currentmon.totalhp>(1/2) && 
        opponent1.pbHasType?(:ICE)
        switchscore+=100
      end
      if currentmon.name == "Roserade" && currentmon.hp/currentmon.totalhp>(2/5)
        if opponent1.pbHasMove?(getID(PBMoves,:ICESHARD)) && opponent1.pbHasType?(:ICE)
          if opponent1.hasWorkingItem(:CHOICEBAND) ||
            opponent1.hasWorkingItem(:LIFEORB) ||
            opponent1.hasWorkingItem(:ICEGEM) ||
            opponent1.hasWorkingItem(:NEVERMELTICE) ||
            opponent1.hasWorkingItem(:ICICLEPLATE)
            switchscore+=100
          end
        end
      end
      # Garchomp
      if currentmon.name == "Garchomp" && currentmon.hp/currentmon.totalhp>(2/5) && 
        currentmon.turncount>0
        switchscore+=100
      end
      if currentmon.name == "Garchomp" && currentmon.hp/currentmon.totalhp>(2/5) && 
        opponent1.effects[PBEffects::DestinyBond]
        switchscore+=100
      end
      if currentmon.name == "Garchomp" && currentmon.hp/currentmon.totalhp<(17/20) && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) < pbRoughStat(opponent1,PBStats::SPEED,skill)
          if isConst?(opponent1.species,PBSpecies,:GARDEVOIR) && opponent1.form==1
            if opponent1.pbHasMove?(getID(PBMoves,:HYPERVOICE))
              switchscore+=160
            end
          end
        end
      end
      if currentmon.name == "Garchomp" && currentmon.hp/currentmon.totalhp<(3/4) && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) < pbRoughStat(opponent1,PBStats::SPEED,skill)
          if isConst?(opponent1.species,PBSpecies,:GARDEVOIR) && opponent1.form==1
            if opponent1.pbHasMove?(getID(PBMoves,:MOONBLAST))
              switchscore+=160
            end
          end
        end
      end
      if currentmon.name == "Garchomp" && currentmon.hp/currentmon.totalhp<(1/2) && currentmon.hp/currentmon.totalhp>(1/3)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) < pbRoughStat(opponent1,PBStats::SPEED,skill)
          if isConst?(opponent1.species,PBSpecies,:RIBOMBEE) && opponent1.pbHasMove?(getID(PBMoves,:MOONBLAST))
            if !opponent1.hasWorkingItem(:CHOICESPEC) &&
              !opponent1.hasWorkingItem(:LIFEORB) &&
              !opponent1.hasWorkingItem(:PIXIEPLATE) &&
              !opponent1.hasWorkingItem(:FAIRYGEM) &&
              !opponent1.hasWorkingItem(:FAIRIUMZ2)
              switchscore+=160
            end
          end
        end
      end
      if currentmon.name == "Garchomp" && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) < pbRoughStat(opponent1,PBStats::SPEED,skill)
          if opponent1.pbHasMove?(getID(PBMoves,:ICEBEAM)) ||
            opponent1.pbHasMove?(getID(PBMoves,:BLIZZARD)) ||
            opponent1.pbHasMove?(getID(PBMoves,:ICICLECRASH)) ||
            opponent1.pbHasMove?(getID(PBMoves,:ICEPUNCH)) ||
            opponent1.pbHasMove?(getID(PBMoves,:ICICLESPEAR)) ||
            opponent1.pbHasMove?(getID(PBMoves,:DRACOMETEOR)) ||
            opponent1.pbHasMove?(getID(PBMoves,:EXTRASENSORY))
            switchscore+=160
          end
        end
      end
      if currentmon.name == "Garchomp" && currentmon.hp/currentmon.totalhp<(3/4) && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) > pbRoughStat(opponent1,PBStats::SPEED,skill)
          if opponent1.pbHasMove?(getID(PBMoves,:ICESHARD)) && opponent1.pbHasType?(:ICE)
            if opponent1.hasWorkingItem(:CHOICEBAND) ||
              opponent1.hasWorkingItem(:LIFEORB) ||
              opponent1.hasWorkingItem(:ICEGEM) ||
              opponent1.hasWorkingItem(:NEVERMELTICE) ||
              opponent1.hasWorkingItem(:ICICLEPLATE)
              switchscore+=160
            end
          end
        end
      end
      if currentmon.name == "Garchomp" && currentmon.hp/currentmon.totalhp<(1/2) && currentmon.hp/currentmon.totalhp>(1/3)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) > pbRoughStat(opponent1,PBStats::SPEED,skill)
          if opponent1.pbHasMove?(getID(PBMoves,:ICESHARD)) && opponent1.pbHasType?(:ICE)
            if !opponent1.hasWorkingItem(:CHOICEBAND) &&
              !opponent1.hasWorkingItem(:LIFEORB) &&
              !opponent1.hasWorkingItem(:ICEGEM) &&
              !opponent1.hasWorkingItem(:NEVERMELTICE) &&
              !opponent1.hasWorkingItem(:ICICLEPLATE)
              switchscore+=160
            end
          end
        end
      end
      if currentmon.name == "Garchomp" && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) < pbRoughStat(opponent1,PBStats::SPEED,skill)
          if opponent1.pbHasType?(:DRAGON)
            if opponent1.pbHasMove?(getID(PBMoves,:OUTRAGE)) ||
              opponent1.pbHasMove?(getID(PBMoves,:DRAGONRUSH)) ||
              opponent1.pbHasMove?(getID(PBMoves,:DRAGONPULSE))
              switchscore+=160
            end
          end
        end
      end
      if currentmon.name == "Garchomp" && currentmon.hp/currentmon.totalhp<(2/3) && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) < pbRoughStat(opponent1,PBStats::SPEED,skill)
          if opponent1.pbHasMove?(getID(PBMoves,:DRAGONCLAW)) && opponent1.pbHasType?(:DRAGON)
            if !opponent1.hasWorkingItem(:CHOICEBAND) &&
              !opponent1.hasWorkingItem(:LIFEORB) &&
              !opponent1.hasWorkingItem(:DRAGONFANG) &&
              !opponent1.hasWorkingItem(:DRACOPLATE)
              switchscore+=160
            end
          end
        end
      end
      if currentmon.name == "Garchomp" && currentmon.hp/currentmon.totalhp<(3/4) && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) < pbRoughStat(opponent1,PBStats::SPEED,skill)
          if opponent1.pbHasMove?(getID(PBMoves,:DRAGONCLAW)) && opponent1.pbHasType?(:DRAGON)
            if opponent1.hasWorkingItem(:DRACOPLATE) ||
              opponent1.hasWorkingItem(:DRAGONFANG)
              switchscore+=160              
            end
          end
        end
      end
      if currentmon.name == "Garchomp" && currentmon.hp/currentmon.totalhp<(4/5) && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) < pbRoughStat(opponent1,PBStats::SPEED,skill)
          if opponent1.pbHasMove?(getID(PBMoves,:DRAGONCLAW)) && opponent1.pbHasType?(:DRAGON)
            if opponent1.hasWorkingItem(:LIFEORB)
              switchscore+=160              
            end
          end
        end
      end
      if currentmon.name == "Garchomp" && currentmon.hp/currentmon.totalhp<(19/20) && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) < pbRoughStat(opponent1,PBStats::SPEED,skill)
          if opponent1.pbHasMove?(getID(PBMoves,:DRAGONCLAW)) && opponent1.pbHasType?(:DRAGON)
            if opponent1.hasWorkingItem(:CHOICEBAND)
              switchscore+=160
            end
          end
        end
      end
      if currentmon.name == "Garchomp" && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) < pbRoughStat(opponent1,PBStats::SPEED,skill)
          if opponent1.pbHasType?(:DRAGON) && (opponent1.hasWorkingItem(:DRAGONIUMZ2) || opponent1.hasWorkingItem(:DRAGONGEM))
            if opponent1.pbHasMove?(getID(PBMoves,:DRAGONCLAW)) ||
              opponent1.pbHasMove?(getID(PBMoves,:DRAGONRUSH)) ||
              opponent1.pbHasMove?(getID(PBMoves,:OUTRAGE)) ||
              opponent1.pbHasMove?(getID(PBMoves,:DRAGONPULSE)) ||
              opponent1.pbHasMove?(getID(PBMoves,:DRACOMETEOR))
              switchscore+=160
            end
          end
        end
      end
      if currentmon.name == "Garchomp" && currentmon.hp/currentmon.totalhp>(2/5)
        if pbRoughStat(currentmon,PBStats::SPEED,skill) < pbRoughStat(opponent1,PBStats::SPEED,skill)
          if opponent1.hasWorkingItem(:ICIUMZ2) || opponent1.hasWorkingItem(:ICEGEM)
            if opponent1.pbHasMove?(getID(PBMoves,:FREEZEDRY)) ||
              opponent1.pbHasMove?(getID(PBMoves,:ICEBEAM)) ||
              opponent1.pbHasMove?(getID(PBMoves,:BLIZZARD)) ||
              opponent1.pbHasMove?(getID(PBMoves,:ICEPUNCH)) ||
              opponent1.pbHasMove?(getID(PBMoves,:ICICLECRASH))
              switchscore+=160
            end
          end
        end
      end
    end  
    # End
 

 

 

Explanation for Cynthia's AI

 

 


Spiritomb

 

Starting with the second turn, Cynthia will most likely switch out Spiritomb so long its HP is above 40%. This is because I want it to be as annoying as possible. While you will most likely switch out your Pkm as you don't want your Pkm to suffer from Spiritomb's Torment effect and its dangerous moves more than necessary, you will probably send in a Pkm that might hurt Spiritomb badly. So switching out Spiritomb at the same time when you switch out your Pkm will prevent you from getting rid off Spiritomb for the moment.

Now, you might wonder why Spiritomb should not rather switch out if its hp is under 40%. It's because it would be just useless and there's the possibility that you might set up Spikes or Stealth Rock, which would render Spiritomb useless anyway.

 

If you happen to be a Dark of Fairy Pkm, Spiritomb tends to flee from the battle as a Fairy Pkm will most likely carry with it a Fairy move that is effective against Spiritomb, and a Dark Pkm can deal lots of damages to Spiritomb while Spiritomb usually can't do much against Dark Pkm. And if you happen to be Mandibuzz or Umbreon, it will very, very likely flee from the battle because it can't do much against them, and I think you don't want to prolong this battle with some cheap stall strategies.

 

 

Lucario

 

If you have Bulletproof, Lucario will likely switch out as its moves are ineffective against you.

If you are a Fire/Fighting/Ground Pkm that is faster than Lucario, Cynthia will switch out Lucario as well.

 

If you are not a Fire Pkm but carry some strong Fire moves such as Flame Thrower, then Lucario will be switched out depending on its health.

 

If you have Breloom with Technician and Mach Punch, it will get back to Cynthia depending on its health and depending on your item.

The same applies to Conkeldurr.

 

 

Togekiss

 

Togekiss has a high chance to get back to its trainer if it's longer than the first turn because I want it to profit from its Ancient Trait, which gives priority to all of its moves during its first turn.

 

If you are faster than Togekiss and carry with you a move effective against Togekiss, Togekiss will likely free from the battle.

 

If you have a Scizor and if Togekiss is somewhat damaged, it will likely switch out as well because Bullet Punch deals quite a lot of damage to it.

 

 

Milotic

 

Milotic's list is not as long as those of the others—so it's a bit incomplete—, but Cynthia will switch it out if it's facing a Grass or Electric Pkm. If it's Toxapex, Tentacruel, or Mega Venusaur, then it's very likely that it gets back to Cynthia.

 

Roserade

 

Roserade is quite similar to Lucario, so there aren't that many differences between Lucario and Roserade. Instead of fearing Mach Punch, Roserade will fear Ice Shard, though.

 

Garchomp

 

Garchomp on the other hand has a very long list, and that is because as it's Cynthia's strongest Pkm it will likely be your main target because you do not want it to cause much problems to you. Therefore, getting rid off it as soon as possible will make your life easier. Hence why switching out Garchomp as soon and as often as possible will give Cynthia some control over the battle.

When it will likely switch out depends on its health, on your moves, on your Pkm, and on your items.

 

Other then that I made sure that if, for some reasons, you are slower than one of Cynthia's Pkm and if you used Destiny Bond, she will likely switch out her Pkm so that you can't take down the Pkm you want. It's only possible if you are faster than one of them. At least, in theory. I haven't tested out Destiny Bond yet, so I'm not sure if Cynthia will really do as I intended her to do but I sure as hell hope it works.

This code stuffs for AI will be more effective when the AI's team is as diverse as Cynthia's while it might be a little bit difficult for a Mono Team. However, some basics can be included as well, such as deciding if it's worth to switch out a Pkm if it's slower than the opponent. To give an example: I created Karen's team and made sure that if Mega Houndoom is facing a Ground/Fighting/Water/Rock Pkm faster than it, it will likely switch out. So in this case, Karen might send in Spiritomb or Honchkrow.

 

With that said, I should mention that the codes are far from being perfect. I tried out a lof of different scenarios and noticed some oddities. To give an example:

Cynthia had only Choice Scarf Roserade and Life Orb Lucario left, and both of them were on full health. She sent in Roserade while I sent in Choice Scarf Darmanitan. Because my Pkm outspeeds her, this was likely the reason why she called Roserade back and sent in Lucario. Because Lucario won't get any damages if it switches in due to some features I included, it got no damages. Okay, she now knew Darmanitan used Flare Blitz. So, what happened next? I used Flare Blitz again, but this time she called Lucario back and sent in Roserade. And Roserade died.

This is where I didn't really get the AI's decision or it's just me being very critical. It is possible that the AI wanted to see which move Darmanitan would use, which is why the AI called Roserade back and sent in Lucario. And a possible reason why Lucario was then called back might be because of Roserade's special features. If you attack it with a contact move, she will poison you. And on top of that, you will get Rough Skin damage. So, it's possible that the AI wanted to play safe and deal as much damage as possible.

It could also be, however, that due to the way I programmed the AI for Cynthia, she would have kept switching out Roserade and Lucario because both of them are weak to Fire moves and are outsped by Choice Scarf Darmanitan.

Now, this is where I wished, Roserade didn't have a Choice Scarf so that I could verify if one of my two hypothesis is correct.

 

Another odditiy I noticed was when Cynthia had enough Pkm left (four of five, I believe) while I had only one or two left. Her Lucario was on full health and on the field while I had Talonflame, which was weakened by Stealth Rock. I used Flare Blitz, and Cynthia called back Lucario. And now, this is where I expected her to send in Milotic. However, which Pkm did she send in? Roserade. This, I did not understand at first. However, I could only reason that Cynthia can play a lot more risky because she had 4-5 Pkm left while I had only one or two. And then there's the fact that Roserade punishes Pkm using contact moves. It was very interesting to see how after Talonflame used Flare Blitz against Roserade, it died due to recoil, Life Orb, and Roserade's punishing features. Not sure if this is correct, but I wanted to point out all those oddities just to be sure and clarify that my codes for specific trainer battle are far from being perfect. They could, however, serve as a basis or inspiration for you if you want to make battles more interesting and challenging. I'd also like to stress that I'm not an expert on coding stuff and that there are a lot of things I have yet to learn and understand. To give an example: I don't know yet how to force the AI to send in a certain Pkm if a certain Pkm is called back. Other then that, I also have to complete my list. For example:

If you have a Pkm that has Focus Sash or Sturdy, full health, and Counter

If the opponent has enough HP to survive one or two moves that is not Counter

If the opponent happens to have a special move, it will use this special move instead of a physical move to break the Focus Sash/Sturdy and avoid Counter. After that, it will use a physical move.

Best example: Counter Alakazam vs. Fire Blast Alola Muk.

Due to my limited programming skills, I can do that only for certain trainers such as Cynthia instead for the general case. I haven't implemented it yet as all my ideas for Cynthia's battlefield require a lot of time and has yet to be completed and I wanted to share with you my first results at first. But maybe, being aware of some gimmick situations such as Focus Sash + Counter might make you want to write a code that would punish players for using those tactiques.

Anyway, if you managed to go through everything I have written, chapeau!

 

And before I forget, the following codes should work if you copy and implemented them correctly. There is also rooms for improvements as Cynthia's features are incomplete. While I coded some effects for certain Hidden Power, I have yet to do so for many more of them, and this is quite time consuming. I also have yet to include some special effects for moves such as Aura Sphere or Shadow Ball if their special effect in Cynthia's field are activated. Cynthia's field is all about ruins and runes, and part of it is an idea from the Pkm Trading Card Game. Sky Ridge, to be more precise. In Sky Ridge, you have some TMs that will cause certain effects depending on the type of the user and the kind of energy it has. If you use Aura Sphere, it gets additional Fire Type and it becomes stronger. A possible effect I might include could be: Burning the target or raising user's special attack or lowering target's special defense.  However, I have to think about whether or not these effects might be too much.

Another feature I implemented was the Ancient Trait from the ORAS edition. Depending on the Greek's signs such as alpha, beta, etc., a certain Pkm might double its status. Whiscash, for example, would raise its Special Defense to 4 stages if it uses Amnesia. Togekiss, on the other hand, has priority on its first turn. As this list is rather large and needs a lot of time to think about and to implement them, I have only included Pkm such as Togekiss so far, as my main focus was Cynthia's team. Feel free to use these ideas and codes, but make sure to credit them. First of all, without Reborn's resources I would not have been able to do this. And second, Ancient Traits and Sky Ridge come from the Pokémon Trading Card Game. If you think there's something I forgot to mention, let me know. Feel also free to voice your opinion on this post.^^

 
 

 

 

Cynthia's Team in PBS: trainers

 

 


#-------------------
CYNTHIA
Cynthia
6
GARCHOMP,85,GARCHOMPITE,EARTHQUAKE,STEALTHROCK,STONEEDGE,FLAMETHROWER,1,F,0,,JOLLY,31,255,,false,10,1,252,4,0,252,0,0
SPIRITOMB,85,ASSAULTVEST,FOULPLAY,SHADOWBALL,SHADOWSNEAK,SPECTRALTHIEF,0,F,0,shiny,SASSY,31,255,,false,10,1,252,0,4,0,0,252
LUCARIO,85,LIFEORB,AURASPHERE,HIDDENPOWERGRA,DARKPULSE,IRONTAIL,1,M,0,,TIMID,31,255,,false,10,1,0,0,0,252,252,4
TOGEKISS,85,SITRUSBERRY,EXTRASENSORY,WATERPULSE,ROOST,AURASPHERE,1,F,0,,BOLD,31,255,,false,10,1,252,0,236,20,0,0
MILOTIC,85,LEFTOVERS,WATERPULSE,RECOVER,HIDDENPOWERICE,TOXIC,0,F,0,,CALM,31,255,,false,10,1,252,0,0,4,0,252
ROSERADE,85,CHOICESCARF,MAGICALLEAF,SLUDGEBOMB,EXTRASENSORY,HIDDENPOWERFIR,2,F,0,,TIMID,31,255,,false,10,1,0,0,0,252,252,4

 

- - -

I will admit that some move/item/nature/EVs choices might be weird at first glance. I will stress, however, that in most cases they are adjusted to the battlefield I created for Cynthia, and to my battle experiences against the AI.

- Garchomp is sent out first so that it can set up Stealth Rock, thus supporting the rest of the team if they have to rely on an 2HKO or even OHKO.

- This is especially true for Roserade as even without Choice Scarf the AI tends to send out Roserade when Cynthia has only one or two Pkm left. And Roserade needs Choice Scarf so that it can easily sweep your team if you have some fast Pkm. It's also strong enough to threaten your team as it makes good use of the battlefield, which boosts moves such as Magical Leaf and Extra Sensory and gives them an additional type, Electric for the former and Ice for the latter.

- As for Spiritomb, you can change its nature and EVs to make it more bulky on the physical side as it tends to deal with Pkm that are strong on the physical side. You can also change Spectral Thief to Rock Tomb if you want to stay true to the "rules" as Spiritomb cannot learn Marshadow's signature move (even though, it would make perfectly sense for it). Other then that, it's god damn annoying and if you don't watch out, it will easily take down 2-3 of your Pkm. This is because thanks to the runes on Cynthia's battlefield (which is all about ruines and runes), it will get 0,75 less damage (this is as much as the Filter or Solid Rock ability). It will also heal 1/8 of its hp in each round (this is also true for Pkm that are connected to the runes and/or ruins in some way, such as Sigilyph, Golurk, Lucario, Claydol, etc., so you can use this field to your advantage). Its moves are also boosted by 1.3, which is like a free Life Orb bonus. And if you attack Spiritomb, it will Torment you, thus limiting your move choices. And as long as it is on the field and as long as you are under Torment effect, you will loose 1/8 of your hp. Ugh, it's so evil...

- Lucario is a special sweeper because it makes good use of the field. Although it is Timid, it has Iron Tail, which is enough to OHKO every Fairy Pkm weak to Steel, unless you invested some EVs into their Defense. Hidden Power Grass gets boosted by the field and it gets an additional Electric type. So Fire Pkm are one of the few that can switch into its attacks.

- Milotic has a Calm nature as it needs to sponge the many strong special attacks that are boosted by the field. The runes field boosts Psychic moves, Aura moves, and all other moves connected to legendary Pkm or to the environment/theme. Water Pulse gets additonal Electric type while Hidden Power Ice gets additional Fire type.

- Togekiss needs a Sitrus Berry as it won't stay long on the field and it tends to switch into moves when Cynthia switches out one of her other Pkm. A Bold nature allows Togekiss to survive many strong physical attacks, which you might not expect, and retaliate back.

- Last but not least, Garchomp. It has a Mega Stone because champs such as Steve and Diantha have a mega stone as well! And they use it on their strongest Pkm! And as Garchomp is Cynthia's strongest Pkm, it only makes sense for her to mega evolve Garchomp. Garchomp has maximum Speed and HP because I want it to be as fast and as durable as possible. The field boosts Garchomp's power high enough, so it doesn't really need full EVs into its Attack. Under mega evolution it will always land a Crit due to its aggressive nature according to the Pokédex, and the field activates Sand Force. And don't worry, you have enough ways to OHKO Mega Garchomp. Moves such as Extra Sensory or Shadow Ball get additional Ice type and are boosted by the field. And many Pkm can learn Shadow Ball, so Mega Garchomp won't be much of a problem. In my experiences, it is not as dangerous as Spiritomb or Lucario.

 

If you want to increase your chances to win, you need a way to deal with Roserade as ridiculous as it may sound. I suggest a strong Pkm with a Choice Scarf. Make sure it outspeeds Roserade!

I also advise against using Hyper Offensive teams as they tend to be very fragile, and many of Cynthia's Pkm are quite bulky and deal lots of damages. Make sure you are prepared against Spiritomb, otherwise it will turn out to be a catastrophe for you.

Do not assume Cynthia won't switch out her Pkm!!! Because she will often do so as I programmed her that way. But do not rely too much on that fact as the AI has to decide whether or not it is worth to switch out a Pkm. The AI tends to not switch out a Pkm if Cynthia doesn't have many Pkm left or if the Pkm she uses has been switched out once or is somewhat hurt.

Be careful when you want to switch out one of your Pkm as Pkm such as Lucario or Roserade will do lots of damages even against foes resistant to one of their moves. To give an example: Magical Leaf is a 2HKO for Skarmory, Mega Charizard Y, and Talonflame as this move gets additional Electric type. With Stealth Rock on the field you can say good bye to them.

Beware of Togekiss! Due to its Ancient Trait (an idea from the Pokémon Card Game) all of its moves have a priority of 3 when it is its first turn. After that, it looses its priority effect and will have it again when Cynthia switches out Togekiss and uses it later.

If you use your own Garchomp, your life will get a lot easier. First of all, Dragon Rush has perfect accuracy in this field and its a priority move if it is used by non Mega Garchomp and if it is its first turn. Stone Egde has perfect accuracy as well and gets boosted by the field. And if you add Dragonium Z, you can take out 2-3 of Cynthia's Pkm if you are careful.
 

 

 

PBS: trainertypes

 

 


137,CYNTHIA,Champ,21,Battle- Dramatic.mp3,Victory2,,Female,100
 

 

 

Graphic: Character/Battlebacks

 

 


You need to include a character image for Characters and name it trainer137

You also need to include three backgrounds for Battlebacks and name them: battlebgCynthia, enemybaseCynthia, playerbaseCynthia
 

 

 

PokeBattle_Battle:

 

 


Only the codes between --- and --- are relevant for you! I put them under spoiler to make it easier for you to copy.

1) Put under: pri+=1 if isConst?(@battlers.ability,PBAbilities,:GALEWINGS) && @choices[2].type==2 && ((@battlers.hp == @battlers.totalhp) || (($fefieldeffect == 27 || $fefieldeffect == 28) && @weather == PBWeather::STRONGWINDS))

 

 

This here



# Start: Garchomp's Prio Moves
        pri+=1 if isConst?(@battlers.species,PBSpecies,:GARCHOMP) && @battlers.form==0 && 
        @choices[2].type==16 && @choices[2].basedamage==100 && 
        $fefieldeffect == 58 && @battlers.turncount==1
        # Start: Togekiss' Ancient Trait
        pri+=3 if isConst?(@battlers.species,PBSpecies,:TOGEKISS) && $fefieldeffect == 58 && @battlers.turncount==1

 

This will grant Garchomp a Dragon Rush priority on its first turn.

 

 

This will grant Togekiss a priority of 3 on its first turn.

 

2) Directly under: 

when 42 # citynew
                pbApplySceneBG("battlebg","Graphics/Battlebacks/battlebgCityNew.png")
                pbApplySceneBG("playerbase","Graphics/Battlebacks/playerbaseCityNew.png")
                pbApplySceneBG("enemybase","Graphics/Battlebacks/enemybaseCityNew.png")

 

 

 



- - -

when 58 # Cynthia's Room
                pbApplySceneBG("battlebg","Graphics/Battlebacks/battlebgCynthia.png")
                pbApplySceneBG("playerbase","Graphics/Battlebacks/playerbaseCynthia.png")
                pbApplySceneBG("enemybase","Graphics/Battlebacks/enemybaseCynthia.png") 

- - -
 

 

 

3) Directly under:

when 37
      pbDisplay(_INTL("The field became mysterious!"))

 

 



- - -

when 58
      pbDisplay(_INTL("The runes are radiating!")) 

- - -
 

 

 

4) Directly under:

#### AME - 003 - START
    # Field Effects
    endmessage=false
    for i in priority  
      next if i.isFainted?
      case $fefieldeffect
        when 2 # Grassy Field
          next if i.hp<=0   
          if !i.isAirborne? 
            if i.effects[PBEffects::HealBlock]==0 && i.totalhp != i.hp
              pbDisplay(_INTL("The grassy terrain healed the Pokemon on the field.",i.pbThis)) if endmessage == false
              endmessage=true
              hpgain=(i.totalhp/16).floor
              hpgain=(hpgain*1.3).floor if isConst?(i.item,PBItems,:BIGROOT)
              hpgain=i.pbRecoverHP(hpgain,true)
            end
          end

 

 



- - -

when 58 # Cynthia
          next if i.hp<=0   
          if isConst?(i.species,PBSpecies,:SPIRITOMB)
            if i.effects[PBEffects::HealBlock]==0 && i.totalhp != i.hp
              pbDisplay(_INTL("{1} used the runes to heal itself!",i.pbThis)) if endmessage == false
              endmessage=true
              hpgain=(i.totalhp/8).floor
              hpgain=i.pbRecoverHP(hpgain,true)
            end
          end
          if isConst?(i.species,PBSpecies,:LUCARIO)
            if i.effects[PBEffects::HealBlock]==0 && i.totalhp != i.hp
              pbDisplay(_INTL("{1} used the runes to heal itself!",i.pbThis)) if endmessage == false
              endmessage=true
              hpgain=(i.totalhp/8).floor
              hpgain=i.pbRecoverHP(hpgain,true)
            end
          end
          if i.pbOwnSide.effects[PBEffects::LuckyChant]>0
            if i.effects[PBEffects::HealBlock]==0 && i.totalhp != i.hp
              pbDisplay(_INTL("The Lucky Chant unleashed the runes' healing power!",i.pbThis)) if endmessage == false
              endmessage=true
              hpgain=(i.totalhp/16).floor
              hpgain=i.pbRecoverHP(hpgain,true)
            end
          end

- - -
 

 

This will allow Spiritomb and Lucario to heal themselves, and if Lucky Chant is active all of your Pkm will recover 1/16 of their hp so long they are on the field

 

5) Directly under

if i.hasWorkingAbility(:WATERVEIL) && ($fefieldeffect == 21 || 
        $fefieldeffect == 22)
        if i.status>0
              pbDisplay(_INTL("{1}'s Water Veil cured its status problem!",i.pbThis))
          i.status=0
          i.statusCount=0
        end
      end

 

 



- - -

# Spiritomb Status
      if isConst?(i.species,PBSpecies,:SPIRITOMB) && $fefieldeffect == 58
        if i.status>0
          case i.status
            when PBStatuses::SLEEP
              pbDisplay(_INTL("The runes cured {1}'s sleep problem!",i.pbThis))
            when PBStatuses::FROZEN
              pbDisplay(_INTL("The runes cured {1}'s ice problem!",i.pbThis))
            when PBStatuses::BURN
              pbDisplay(_INTL("The runes cured {1}'s burn problem!",i.pbThis))
            when PBStatuses::POISON
              pbDisplay(_INTL("The runes cured {1}'s poison problem!",i.pbThis))
            when PBStatuses::PARALYSIS
              pbDisplay(_INTL("The runes cured {1}'s paralysis problem!",i.pbThis))
          end
          i.status=0
          i.statusCount=0
        end
      end
      
      # Lucario Status
      if isConst?(i.species,PBSpecies,:LUCARIO) && $fefieldeffect == 58
        if i.status>0
          case i.status
            when PBStatuses::SLEEP
              pbDisplay(_INTL("The runes cured {1}'s sleep problem!",i.pbThis))
            when PBStatuses::FROZEN
              pbDisplay(_INTL("The runes cured {1}'s ice problem!",i.pbThis))
            when PBStatuses::BURN
              pbDisplay(_INTL("The runes cured {1}'s burn problem!",i.pbThis))
            when PBStatuses::POISON
              pbDisplay(_INTL("The runes cured {1}'s poison problem!",i.pbThis))
            when PBStatuses::PARALYSIS
              pbDisplay(_INTL("The runes cured {1}'s paralysis problem!",i.pbThis))
          end
          i.status=0
          i.statusCount=0
        end
      end
      
      # Lucky Chant Cure
      if i.pbOwnSide.effects[PBEffects::LuckyChant]>0 && $fefieldeffect == 58
        if i.status>0
          case i.status
            when PBStatuses::SLEEP
              pbDisplay(_INTL("The activated runes cured {1}'s sleep problem!",i.pbThis))
            when PBStatuses::FROZEN
              pbDisplay(_INTL("The activated runes cured {1}'s ice problem!",i.pbThis))
            when PBStatuses::BURN
              pbDisplay(_INTL("The activated runes cured {1}'s burn problem!",i.pbThis))
            when PBStatuses::POISON
              pbDisplay(_INTL("The activated runes cured {1}'s poison problem!",i.pbThis))
            when PBStatuses::PARALYSIS
              pbDisplay(_INTL("The activated runes cured {1}'s paralysis problem!",i.pbThis))
          end
          i.status=0
          i.statusCount=0
        end
      end
      # End

- - -
 

 

This will cure a Pkm from status problems

 

6) Directly under 

# Water Compaction on Water-based Fields
    if i.hasWorkingAbility(:WATERCOMPACTION)
      if $fefieldeffect==8 || $fefieldeffect==21 || $fefieldeffect==22 || 
        $fefieldeffect==26 # Swamp, Water Surface, Underwater, Murkwater
        if !i.pbTooHigh?(PBStats::DEFENSE)
          i.pbIncreaseStatBasic(PBStats::DEFENSE,2)
          pbCommonAnimation("StatUp",i,nil)
          pbDisplay(_INTL("{1}'s Water Compaction sharply raised its defense!",
           i.pbThis))     
         end
       end
     end 

 

 



# Spiritomb's Torment
    if i.effects[PBEffects::Torment] && ($fefieldeffect==57 || $fefieldeffect==58)  && !isConst?(i.ability,PBAbilities,:MAGICGUARD)
      if isConst?(i.pbOpposing1.species,PBSpecies,:SPIRITOMB) || 
         isConst?(i.pbOpposing2.species,PBSpecies,:SPIRITOMB)
        hploss=i.pbReduceHP((i.totalhp/8).floor,true)
        pbDisplay(_INTL("Spiritomb intensified {1}'s pain!",i.pbThis)) if hploss>0
      end
    end
    if i.isFainted?
      return if !i.pbFaint
      next
    end

- - -
 

 

If Spiritomb is on the field and if the opponent is under the effect of Torment, it will loose 1/8 of its hp every round.

 

 
 


- - -

# Start: Garchomp's Prio Moves
        pri+=1 if isConst?(@battlers.species,PBSpecies,:GARCHOMP) && @battlers.form==0 && 
        @choices[2].type==16 && @choices[2].basedamage==100 && 
        $fefieldeffect == 58 && @battlers.turncount==1
        # Start: Togekiss' Ancient Trait
        pri+=3 if isConst?(@battlers.species,PBSpecies,:TOGEKISS) && $fefieldeffect == 58 && @battlers.turncount==1

- - -
 
 

 

PokeBattle_ActualScene

I put the codes under spoiler. There should be two of them under spoiler

1) Directly under 

elsif $feoverride == 42
        backdrop="CityNew"

 

 

 



- - -

elsif $feoverride == 58
        backdrop=="Cynthia" 

- - -
 

 

 

2) Directly under

elsif backdrop=="CityNew"
      fieldbd = 42

 

 

 



- - -

elsif backdrop=="Cynthia"
      fieldbd = 58

- - - 
 

 

 

PokeBattle_ZMoves

Replace

 

 

 



if attacker.hasWorkingAbility(:SANDFORCE) &&
     (@battle.pbWeather==PBWeather::SANDSTORM ||
     $fefieldeffect == 12|| $fefieldeffect == 20) &&
     (isConst?(type,PBTypes,:ROCK) ||
     isConst?(type,PBTypes,:GROUND) ||
     isConst?(type,PBTypes,:STEEL))
      damagemult=(damagemult*1.3).round
    end
 

 

With

 

 

 



if attacker.hasWorkingAbility(:SANDFORCE) &&
     (@battle.pbWeather==PBWeather::SANDSTORM ||
     $fefieldeffect == 12|| $fefieldeffect == 20 || $fefieldeffect == 58) &&
     (isConst?(type,PBTypes,:ROCK) ||
     isConst?(type,PBTypes,:GROUND) ||
     isConst?(type,PBTypes,:STEEL))
      damagemult=(damagemult*1.3).round
    end
 

 

This will activate Sand Force

 

Above

 

 

 



# Guts
    if attacker.hasWorkingAbility(:GUTS) && attacker.status==0 && pbIsPhysical?(type) && $fefieldeffect==56
      atkmult=(atkmult*1.5).round
    end
 

 

Please put this

 

 

 



# Spiritomb
    if isConst?(attacker.species,PBSpecies,:SPIRITOMB) && $fefieldeffect==58
      atkmult=(atkmult*1.3).round
      @battle.pbDisplay(_INTL("The runes provided Spiritomb with some additional power!"))
    end
 

 

This allows you to boost Spiritomb's ZMoves.

 

Replace

 

 

 



if opponent.hasWorkingAbility(:MARVELSCALE) && pbIsPhysical?(type) &&
     (opponent.status>0 || $fefieldeffect == 3 || $fefieldeffect == 9 ||
      $fefieldeffect == 31 || $fefieldeffect == 32 || $fefieldeffect == 34) && !(opponent.moldbroken) 
      defmult=(defmult*1.5).round
    end
 

 

 

With

 

 

 



if opponent.hasWorkingAbility(:MARVELSCALE) && pbIsPhysical?(type) &&
     (opponent.status>0 || $fefieldeffect == 3 || $fefieldeffect == 9 ||
      $fefieldeffect == 31 || $fefieldeffect == 32 || $fefieldeffect == 34 || $fefieldeffect == 58) && !(opponent.moldbroken) 
      defmult=(defmult*1.5).round
    end
    # Start: Marvel Scale blessed by Lucky Chant
    if opponent.hasWorkingAbility(:MARVELSCALE) && pbIsSpecial?(type) &&
      $fefieldeffect == 58 && opponent.pbOwnSide.effects[PBEffects::LuckyChant]>0
      defmult=(defmult*1.5).round
    end  
    # End
 

 

 

If you see this

 

 

 



when 32 # Dragon's Den
        if isConst?(type,PBTypes,:FIRE)
          damage=(damage*1.5).floor
          @battle.pbDisplay(_INTL("The lava's heat boosted the flame!",opponent.pbThis)) if $feshutup2 == 0
          $feshutup2+=1
        end
         if isConst?(type,PBTypes,:ICE) || isConst?(type,PBTypes,:WATER)
          damage=(damage*0.5).floor
          @battle.pbDisplay(_INTL("The lava's heat softened the attack...",opponent.pbThis)) if $feshutup2 == 0
          $feshutup2+=1
        end
        if isConst?(type,PBTypes,:DRAGON)
          damage=(damage*2).floor
          @battle.pbDisplay(_INTL("The draconic energy boosted the attack!",opponent.pbThis)) if $feshutup2 == 0
          $feshutup2+=1
        end
 

 

Put the following codes under it.

 

 

 

 



when 58 # Cynthia's Room
        if isConst?(type,PBTypes,:ROCK)
          damage=(damage*1.5).floor
          @battle.pbDisplay(_INTL("The ruin increased the damage output!",opponent.pbThis)) if $feshutup2 == 0
          $feshutup2+=1
        end
        if isConst?(type,PBTypes,:PSYCHIC)
          damage=(damage*1.5).floor
          @battle.pbDisplay(_INTL("The runes increased the damage output!",opponent.pbThis)) if $feshutup2 == 0
          $feshutup2+=1
        end
        if isConst?(type,PBTypes,:DRAGON)
          damage=(damage*1.5).floor
          @battle.pbDisplay(_INTL("The sacred field increased the damage output!",opponent.pbThis)) if $feshutup2 == 0
          $feshutup2+=1
        end
 

 

Above

 

 

 



if attacker.hasWorkingAbility(:STAKEOUT) && @battle.switchedOut[opponent.index]
      finaldamagemult=(finaldamagemult*2.0).round
    end 
 

 

 

Put this

 

 

 



# Cynthia

if isConst?(opponent.species,PBSpecies,:LUCARIO) && opponent.form==0 && ($fefieldeffect==58)
      finaldamagemult=(finaldamagemult*0.75).round
      @battle.pbDisplay(_INTL("The runes strengthened Lucario's resilience!")) 
    end
    if isConst?(opponent.species,PBSpecies,:LUCARIO) && opponent.form==1 && ($fefieldeffect==58)
      finaldamagemult=(finaldamagemult*0.675).round
      @battle.pbDisplay(_INTL("The runes strengthened Lucario's resilience!")) 
    end

if isConst?(opponent.species,PBSpecies,:SPIRITOMB) && $fefieldeffect==58
      finaldamagemult=(finaldamagemult*0.75).round
      @battle.pbDisplay(_INTL("The runes strengthened Spiritomb's resilience!"))
    end
    if isConst?(opponent.species,PBSpecies,:GARCHOMP) && opponent.form==0 && ($fefieldeffect==58)
      finaldamagemult=(finaldamagemult*0.75).round
      @battle.pbDisplay(_INTL("Garchomp blocked the hit!"))
    end
    if isConst?(opponent.species,PBSpecies,:GARCHOMP) && opponent.form==1 && ($fefieldeffect==58)
      finaldamagemult=(finaldamagemult*0.675).round
      @battle.pbDisplay(_INTL("Mega Garchomp blocked the hit fiercely!"))
    end

# End
 

 

 

PokeBattle_Move

Under

 

 

 



#Telepathy
    if opponent.hasWorkingAbility(:TELEPATHY) && 
     @basedamage>0 &&
     !(opponent.moldbroken)
      partner=attacker.pbPartner
      if opponent.index == partner.index
        # if !@battle.pbIsOpposing?(attacker.index) #If it's your partner
        @battle.pbDisplay(_INTL("{1} avoids attacks by its ally Pokémon!",opponent.pbThis))
        return 0
      end
    end
 

 

 Put this

 

 

 



# Cynthia's Lucario dodges if it switches in
    if isConst?(opponent.species,PBSpecies,:LUCARIO) && $fefieldeffect==58 &&
      @battle.switchedOut[opponent.index]
      @battle.pbDisplay(_INTL("{1} anticipated the attack due to its heightened senses!",opponent.pbThis))
      return 0
    end
 

 

If Lucario switches in, it will receive no damage because the runes increase its aura abilities and its flexibility.

 

If you see this

 

 

 



when 35 # New World
        if (id == PBMoves::DOOMDUMMY)
          typemod2=pbTypeModifier(PBTypes::FIRE,attacker,opponent)
          typemod3= ((typemod*typemod2) * 0.25).ceil
          typemod=typemod3
          typeChange=PBTypes::FIRE
        end
 

 

 

Put the following codes under it

 

 

 



# Start
      when 58 # Cynthia's Room
        if id == PBMoves::MAGICALLEAF
          if !opponent.pbHasType?(:GROUND) && 
            !opponent.hasWorkingAbility(:VOLTABSORB) &&
            !opponent.hasWorkingAbility(:LIGHTNINGROD) &&
            !opponent.hasWorkingAbility(:MOTORDRIVE)
            typemod2=pbTypeModifier(PBTypes::ELECTRIC,attacker,opponent)
            typemod3= ((typemod*typemod2) * 0.25).ceil
            typemod=typemod3
            typeChange=PBTypes::ELECTRIC
          end
        end
        if id == PBMoves::HIDDENPOWERGRA
          if !opponent.pbHasType?(:GROUND) && 
            !opponent.hasWorkingAbility(:VOLTABSORB) &&
            !opponent.hasWorkingAbility(:LIGHTNINGROD) &&
            !opponent.hasWorkingAbility(:MOTORDRIVE)
            typemod2=pbTypeModifier(PBTypes::ELECTRIC,attacker,opponent)
            typemod3= ((typemod*typemod2) * 0.25).ceil
            typemod=typemod3
            typeChange=PBTypes::ELECTRIC
          end 
        end
        if id == PBMoves::WATERPULSE
          if !opponent.pbHasType?(:GROUND) && 
            !opponent.hasWorkingAbility(:VOLTABSORB) &&
            !opponent.hasWorkingAbility(:LIGHTNINGROD) &&
            !opponent.hasWorkingAbility(:MOTORDRIVE)
            typemod2=pbTypeModifier(PBTypes::ELECTRIC,attacker,opponent)
            typemod3= ((typemod*typemod2) * 0.25).ceil
            typemod=typemod3
            typeChange=PBTypes::ELECTRIC
          end 
        end
        if id == PBMoves::MYSTICALFIRE
          typemod2=pbTypeModifier(PBTypes::ICE,attacker,opponent)
          typemod3= ((typemod*typemod2) * 0.25).ceil
          typemod=typemod3
          typeChange=PBTypes::ICE
        end
        if id == PBMoves::EXTRASENSORY
          if !opponent.pbHasType?(:DARK)
            typemod2=pbTypeModifier(PBTypes::ICE,attacker,opponent)
            typemod3= ((typemod*typemod2) * 0.25).ceil
            typemod=typemod3
            typeChange=PBTypes::ICE
          end  
        end
        if id == PBMoves::SHADOWBALL
          if !opponent.pbHasType?(:NORMAL) && 
            !opponent.hasWorkingAbility(:BULLETPROOF)
            typemod2=pbTypeModifier(PBTypes::ICE,attacker,opponent)
            typemod3= ((typemod*typemod2) * 0.25).ceil
            typemod=typemod3
            typeChange=PBTypes::ICE
          end  
        end
        if id == PBMoves::AURASPHERE
          if !opponent.hasWorkingAbility(:FLASHFIRE)
            typemod2=pbTypeModifier(PBTypes::FIRE,attacker,opponent)
            typemod3= ((typemod*typemod2) * 0.25).ceil
            typemod=typemod3
            typeChange=PBTypes::FIRE
          end 
        end
        if id == PBMoves::ANCIENTPOWER
          if !opponent.hasWorkingAbility(:FLASHFIRE)
            typemod2=pbTypeModifier(PBTypes::FIRE,attacker,opponent)
            typemod3= ((typemod*typemod2) * 0.25).ceil
            typemod=typemod3
            typeChange=PBTypes::FIRE
          end 
        end
        if id == PBMoves::HIDDENPOWERICE
          if !opponent.hasWorkingAbility(:FLASHFIRE)
            typemod2=pbTypeModifier(PBTypes::FIRE,attacker,opponent)
            typemod3= ((typemod*typemod2) * 0.25).ceil
            typemod=typemod3
            typeChange=PBTypes::FIRE
          end  
        end
      # End
 

 

This is a gimmick from the Pokémon Trading Card Game, Sky Ridge. Some moves get additional type in Cynthia's field. So it's like Flying Press, only better. For example: Ancient Power becomes a Rock/Fire move. If your opponent has Flashfire, it's only a Rock move. What's also important to mention is the primary type. ExtraSensory is a psychic move. While it gets an additional Ice type, it won't affect a Dark Pokémon.

 

Under: return true if opponent.effects[PBEffects::Telekinesis]>0

 

Put this

 

 

 



return true if isConst?(attacker.species,PBSpecies,:LUCARIO) && ($fefieldeffect == 58)
 

 

Due to increased aura abilities, Lucario's moves have perfect accuracy

 

Above

 

 

 



when 11 # Corrosive Mist Field
      if id == PBMoves::TOXIC
        baseaccuracy=100
      end
 

 

 

Put this

 

 

 



when 58 # Cynthia's Room
      if id == PBMoves::STONEEDGE || id == PBMoves::ROCKSLIDE || id == PBMoves::ROCKCLIMB || id == PBMoves::ROCKTOMB
        baseaccuracy=100
      end
      if id == PBMoves:: WILLOWISP
        if attacker.pbHasType?(:GHOST) ||
          isConst?(attacker.species,PBSpecies,:NINETALES) ||
          isConst?(attacker.species,PBSpecies,:ABSOL)
          baseaccuracy=100
        end
      end
      if id == PBMoves::DRAGONRUSH && attacker.pbHasType?(:DRAGON)
        baseaccuracy=100
      end
 

 

 

If you see this: return true if @function==0xA0 # Frost Breath

 

Put the following codes under it:

 

 

 



return true if isConst?(attacker.species,PBSpecies,:GARCHOMP) && attacker.form==1 && $fefieldeffect==58
 

 

Mega Garchomp will always land a critical hit in this field. That's a reference to the Pokédex, which says that due to its transformation it is enraged

 

Replace

 

 

 



if attacker.hasWorkingAbility(:SANDFORCE) &&
     (@battle.pbWeather==PBWeather::SANDSTORM ||
     $fefieldeffect == 12 || $fefieldeffect == 20) &&
     (isConst?(type,PBTypes,:ROCK) ||
     isConst?(type,PBTypes,:GROUND) ||
     isConst?(type,PBTypes,:STEEL))
      damagemult=(damagemult*1.3).round
    end
 

 

 

With

 

 

 



if attacker.hasWorkingAbility(:SANDFORCE) &&
     (@battle.pbWeather==PBWeather::SANDSTORM ||
     $fefieldeffect == 12 || $fefieldeffect == 20 || $fefieldeffect == 58) &&
     (isConst?(type,PBTypes,:ROCK) ||
     isConst?(type,PBTypes,:GROUND) ||
     isConst?(type,PBTypes,:STEEL))
      damagemult=(damagemult*1.3).round
    end
 

 

 

If you see this

 

 

 



when 16 # Superheated Field
        if (id == PBMoves::SURF || id == PBMoves::MUDDYWATER ||
         id == PBMoves::WATERPLEDGE || id == PBMoves::WATERSPOUT ||
         id == PBMoves::SPARKLINGARIA)
          damagemult=(damagemult*0.625).round
        end
        if (id == PBMoves::SCALD || id == PBMoves::STEAMERUPTION)
        damagemult=(damagemult*1.667).round
        @battle.pbDisplay(_INTL("The field super-heated the attack!",opponent.pbThis)) if $feshutup == 0
          $feshutup+=1
        end
 

 

 

Put the following codes under it

 

 

 



when 58
        if (id == PBMoves::JUDGMENT || id == PBMoves::SACREDFIRE || id == PBMoves::SECRETPOWER)
          damagemult=(damagemult*1.5).round
          @battle.pbDisplay(_INTL("The runes' energy resonated with the attack!",opponent.pbThis)) if $feshutup == 0
          $feshutup+=1
        end
        if (id == PBMoves::DRAGONPULSE || id == PBMoves::DARKPULSE)
          damagemult=(damagemult*1.5).round
          @battle.pbDisplay(_INTL("The runes unleashed the aura!",opponent.pbThis)) if $feshutup == 0
          $feshutup+=1
        end
        if (id == PBMoves::HIDDENPOWER || id == PBMoves::HIDDENPOWERNOR || id == PBMoves::HIDDENPOWERFIR ||
          id == PBMoves::HIDDENPOWERFIG || id == PBMoves::HIDDENPOWERWAT || id == PBMoves::HIDDENPOWERFLY ||
          id == PBMoves::HIDDENPOWERPOI || id == PBMoves::HIDDENPOWERELE ||
          id == PBMoves::HIDDENPOWERGRO || id == PBMoves::HIDDENPOWERPSY || id == PBMoves::HIDDENPOWERROC ||
          id == PBMoves::HIDDENPOWERBUG || id == PBMoves::HIDDENPOWERDRA ||
          id == PBMoves::HIDDENPOWERGHO || id == PBMoves::HIDDENPOWERDAR || id == PBMoves::HIDDENPOWERSTE ||
          id == PBMoves::HIDDENPOWERFAI)
          damagemult=(damagemult*1.5).round
          @battle.pbDisplay(_INTL("The runes' energy resonated with the attack!",opponent.pbThis)) if $feshutup == 0
          $feshutup+=1
        end
        # Magical Leaf: Thunder Force
        if id == PBMoves::MAGICALLEAF
          damagemult=(damagemult*1.5).round
          @battle.pbDisplay(_INTL("The runes' energy resonated with the attack!",opponent.pbThis)) if $feshutup == 0
          @battle.pbDisplay(_INTL("Miracle Sphere Gamma: Thunder Force!",opponent.pbThis)) if $feshutup == 0 &&
          !opponent.pbHasType?(:GROUND) && 
          !opponent.hasWorkingAbility(:VOLTABSORB) &&
          !opponent.hasWorkingAbility(:LIGHTNINGROD) &&
          !opponent.hasWorkingAbility(:MOTORDRIVE)
          $feshutup+=1
        end
        if id == PBMoves::MAGICALLEAF
          if !opponent.pbHasType?(:GROUND) && 
            !opponent.hasWorkingAbility(:VOLTABSORB) &&
            !opponent.hasWorkingAbility(:LIGHTNINGROD) &&
            !opponent.hasWorkingAbility(:MOTORDRIVE)
            damagemult=(damagemult*1.5).round
          end
        end
        # Hiddern Power Grass: Thunder Force
        if id == PBMoves::HIDDENPOWERGRA
          damagemult=(damagemult*1.5).round
          @battle.pbDisplay(_INTL("The runes' energy resonated with the attack!",opponent.pbThis)) if $feshutup == 0
          @battle.pbDisplay(_INTL("Miracle Sphere Gamma: Thunder Force!",opponent.pbThis)) if $feshutup == 0 &&
          !opponent.pbHasType?(:GROUND) && 
          !opponent.hasWorkingAbility(:VOLTABSORB) &&
          !opponent.hasWorkingAbility(:LIGHTNINGROD) &&
          !opponent.hasWorkingAbility(:MOTORDRIVE)
          $feshutup+=1
        end
        if id == PBMoves::HIDDENPOWERGRA
          if !opponent.pbHasType?(:GROUND) && 
            !opponent.hasWorkingAbility(:VOLTABSORB) &&
            !opponent.hasWorkingAbility(:LIGHTNINGROD) &&
            !opponent.hasWorkingAbility(:MOTORDRIVE)
            damagemult=(damagemult*1.5).round
          end
        end
        # Water Pulse: Thunder Force
        if id == PBMoves::WATERPULSE
          damagemult=(damagemult*1.5).round
          @battle.pbDisplay(_INTL("The runes unleashed the aura!",opponent.pbThis)) if $feshutup == 0
          @battle.pbDisplay(_INTL("Miracle Sphere Gamma: Thunder Force!",opponent.pbThis)) if $feshutup == 0 &&
          !opponent.pbHasType?(:GROUND) && 
          !opponent.hasWorkingAbility(:VOLTABSORB) &&
          !opponent.hasWorkingAbility(:LIGHTNINGROD) &&
          !opponent.hasWorkingAbility(:MOTORDRIVE)
          $feshutup+=1
        end
        if id == PBMoves::WATERPULSE
          if !opponent.pbHasType?(:GROUND) && 
            !opponent.hasWorkingAbility(:VOLTABSORB) &&
            !opponent.hasWorkingAbility(:LIGHTNINGROD) &&
            !opponent.hasWorkingAbility(:MOTORDRIVE)
            damagemult=(damagemult*1.5).round
          end 
        end 
        # Mystical Fire: Freezing Force
        if id == PBMoves::MYSTICALFIRE
          damagemult=(damagemult*2.25).round
          @battle.pbDisplay(_INTL("The runes' energy resonated with the attack!",opponent.pbThis)) if $feshutup == 0
          @battle.pbDisplay(_INTL("Miracle Sphere Beta: Freezing Force!",opponent.pbThis)) if $feshutup == 0
          $feshutup+=1
        end
        # Extra Sensory: Freezing Force
        if id == PBMoves::EXTRASENSORY
          if !opponent.pbHasType?(:DARK)
            damagemult=(damagemult*1.5).round
            @battle.pbDisplay(_INTL("Miracle Sphere Beta: Freezing Force!",opponent.pbThis)) if $feshutup == 0
            $feshutup+=1
          end
        end
        # Shadow Ball: Freezing Force
        if id == PBMoves::SHADOWBALL
          if !opponent.pbHasType?(:NORMAL) &&
            !opponent.hasWorkingAbility(:BULLETPROOF)
            damagemult=(damagemult*1.5).round
            @battle.pbDisplay(_INTL("Miracle Sphere Beta: Freezing Force!",opponent.pbThis)) if $feshutup == 0
            $feshutup+=1
          end
        end
        # Hiddern Power Ice: Freezing Force
        if id == PBMoves::HIDDENPOWERICE
          damagemult=(damagemult*1.5).round
          @battle.pbDisplay(_INTL("The runes' energy resonated with the attack!",opponent.pbThis)) if $feshutup == 0
          @battle.pbDisplay(_INTL("Miracle Sphere Beta: Freezing Force!",opponent.pbThis)) if $feshutup == 0 && !opponent.hasWorkingAbility(:FLASHFIRE)
          $feshutup+=1
        end
        if id == PBMoves::HIDDENPOWERICE
          if !opponent.hasWorkingAbility(:FLASHFIRE)
            damagemult=(damagemult*1.5).round
          end 
        end
        # Aurasphere: Fire Force
        if id == PBMoves::AURASPHERE
          damagemult=(damagemult*1.5).round
          @battle.pbDisplay(_INTL("The runes unleashed the aura!",opponent.pbThis)) if $feshutup == 0
          @battle.pbDisplay(_INTL("Miracle Sphere Alpha: Fire Force!",opponent.pbThis)) if $feshutup == 0 && !opponent.hasWorkingAbility(:FLASHFIRE)
          $feshutup+=1
        end
        if id == PBMoves::AURASPHERE
          if !opponent.hasWorkingAbility(:FLASHFIRE)
            damagemult=(damagemult*1.5).round
          end 
        end
        # Ancient Power: Fire Force
        if id == PBMoves::ANCIENTPOWER
          damagemult=(damagemult*1.5).round
          @battle.pbDisplay(_INTL("The runes' energy resonated with the attack!",opponent.pbThis)) if $feshutup == 0
          @battle.pbDisplay(_INTL("Miracle Sphere Alpha: Fire Force!",opponent.pbThis)) if $feshutup == 0 && !opponent.hasWorkingAbility(:FLASHFIRE)
          $feshutup+=1
        end
        if id == PBMoves::ANCIENTPOWER
          if !opponent.hasWorkingAbility(:FLASHFIRE)
            damagemult=(damagemult*1.5).round
          end 
        end
        # End of Spheres
        if (id == PBMoves::PSYSTRIKE || id == PBMoves::AEROBLAST ||
         id == PBMoves::ORIGINPULSE || id == PBMoves::PRECIPICEBLADES ||
         id == PBMoves::DRAGONASCENT || id == PBMoves::DOOMDUMMY ||
         id == PBMoves::MISTBALL || id == PBMoves::LUSTERPURGE ||
         id == PBMoves::PSYCHOBOOST || id == PBMoves::SPACIALREND ||
         id == PBMoves::ROAROFTIME || id == PBMoves::CRUSHGRIP ||
         id == PBMoves::SECRETSWORD || id == PBMoves::RELICSONG ||
         id == PBMoves::HYPERSPACEHOLE || id == PBMoves::LANDSWRATH ||
         id == PBMoves::MOONGEISTBEAM || id == PBMoves::SUNSTEELSTRIKE ||         
         id == PBMoves::PRISMATICLASER || id == PBMoves::FLEURCANNON)
          damagemult=(damagemult*1.3).round
          @battle.pbDisplay(_INTL("The runes' energy resonated with the attack!",opponent.pbThis)) if $feshutup == 0
          $feshutup+=1
        end
 

 

This will boost certain moves.

 

Above

 

 

 



# Guts
    if attacker.hasWorkingAbility(:GUTS) && attacker.status==0 && pbIsPhysical?(type) && $fefieldeffect==56
      atkmult=(atkmult*1.5).round
    end
 

 

 

Put this

 

 

 



# Spiritomb
    if isConst?(attacker.species,PBSpecies,:SPIRITOMB) && $fefieldeffect==58
      atkmult=(atkmult*1.3).round
      @battle.pbDisplay(_INTL("The runes provided Spiritomb with some additional power!"))
    end
 

 

 

Replace

 

 

 



if opponent.hasWorkingAbility(:MARVELSCALE) && pbIsPhysical?(type) &&
     (opponent.status>0 || $fefieldeffect == 3 || $fefieldeffect == 9 ||
      $fefieldeffect == 31 || $fefieldeffect == 32 || $fefieldeffect == 34 || $fefieldeffect == 58) && !(opponent.moldbroken) 
      defmult=(defmult*1.5).round
    end
 

 

 

With

 

 

 



if opponent.hasWorkingAbility(:MARVELSCALE) && pbIsPhysical?(type) &&
     (opponent.status>0 || $fefieldeffect == 3 || $fefieldeffect == 9 ||
      $fefieldeffect == 31 || $fefieldeffect == 32 || $fefieldeffect == 34 || $fefieldeffect == 58) && !(opponent.moldbroken) 
      defmult=(defmult*1.5).round
    end
    # Start: Marvel Scale blessed by Lucky Chant
    if opponent.hasWorkingAbility(:MARVELSCALE) && pbIsSpecial?(type) &&
      $fefieldeffect == 58 && opponent.pbOwnSide.effects[PBEffects::LuckyChant]>0
      defmult=(defmult*1.5).round
    end  
    # End
 

 

Marvel Scale is activated. If Lucky Chant is active, it will boost Special Defense.

 

Under

 

 

 



when 32 # Dragon's Den
        if isConst?(type,PBTypes,:FIRE)
          damage=(damage*1.5).floor
          @battle.pbDisplay(_INTL("The lava's heat boosted the flame!",opponent.pbThis)) if $feshutup2 == 0
          $feshutup2+=1
        end
         if isConst?(type,PBTypes,:ICE) || isConst?(type,PBTypes,:WATER)
          damage=(damage*0.5).floor
          @battle.pbDisplay(_INTL("The lava's heat softened the attack...",opponent.pbThis)) if $feshutup2 == 0
          $feshutup2+=1
        end
        if isConst?(type,PBTypes,:DRAGON)
          damage=(damage*2).floor
          @battle.pbDisplay(_INTL("The draconic energy boosted the attack!",opponent.pbThis)) if $feshutup2 == 0
          $feshutup2+=1
        end
 

 

 

Put this

 

 

 



when 58 # Cynthia's Room
        if isConst?(type,PBTypes,:ROCK)
          if id != PBMoves::HIDDENPOWER &&
            id != PBMoves::HIDDENPOWERROC &&
            id != PBMoves::ANCIENTPOWER &&
            id != PBMoves::JUDGMENT
            damage=(damage*1.5).floor
            @battle.pbDisplay(_INTL("The ruin increased the damage output!",opponent.pbThis)) if $feshutup2 == 0
            $feshutup2+=1
          end  
        end
        if isConst?(type,PBTypes,:PSYCHIC)
          if id != PBMoves::HIDDENPOWER &&
            id != PBMoves::HIDDENPOWERPSY &&
            id != PBMoves::PSYSTRIKE &&
            id != PBMoves::PSYCHOBOOST &&
            id != PBMoves::MISTBALL &&
            id != PBMoves::LUSTERPURGE &&
            id != PBMoves::PRISMATICLASER &&
            id != PBMoves::JUDGMENT &&
            id != PBMoves::HYPERSPACEHOLE
            damage=(damage*1.5).floor
            @battle.pbDisplay(_INTL("The ruins increased the damage output!",opponent.pbThis)) if $feshutup2 == 0
            $feshutup2+=1
          end
        end
        if isConst?(type,PBTypes,:DRAGON)
          if id != PBMoves::ROAROFTIME &&
            id != PBMoves::SPACIALREND &&
            id != PBMoves::JUDGMENT
            damage=(damage*1.3).floor
            @battle.pbDisplay(_INTL("The sacred field increased the damage output!",opponent.pbThis)) if $feshutup2 == 0
            $feshutup2+=1
          end
        end
 

 

This will boost, for example, Psychic moves.

 

Above

 

 

 



if attacker.hasWorkingAbility(:STAKEOUT) && @battle.switchedOut[opponent.index]
      finaldamagemult=(finaldamagemult*2.0).round
    end
 

 

 

Put this

 

 

 



# Cynthia

if isConst?(opponent.species,PBSpecies,:LUCARIO) && opponent.form==0 && ($fefieldeffect==58)
      finaldamagemult=(finaldamagemult*0.75).round
      @battle.pbDisplay(_INTL("The runes strengthened Lucario's resilience!")) 
    end
    if isConst?(opponent.species,PBSpecies,:LUCARIO) && opponent.form==1 && ($fefieldeffect==58)
      finaldamagemult=(finaldamagemult*0.675).round
      @battle.pbDisplay(_INTL("The runes strengthened Lucario's resilience!")) 
    end

if isConst?(opponent.species,PBSpecies,:SPIRITOMB) && $fefieldeffect==58
      finaldamagemult=(finaldamagemult*0.75).round
      @battle.pbDisplay(_INTL("The runes strengthened Spiritomb's resilience!"))
    end
    if isConst?(opponent.species,PBSpecies,:GARCHOMP) && opponent.form==0 && $fefieldeffect==58
      finaldamagemult=(finaldamagemult*0.75).round
      @battle.pbDisplay(_INTL("Garchomp blocked the hit!"))
    end
    if isConst?(opponent.species,PBSpecies,:GARCHOMP) && opponent.form==1 && ($fefieldeffect==58)
      finaldamagemult=(finaldamagemult*0.675).round
      @battle.pbDisplay(_INTL("Mega Garchomp blocked the hit fiercely!"))
    end
    # End
 

 

 

PokeBattle_Battler

If you see this

 

 

 



# Fairy Tale Field Entry
    if $fefieldeffect == 31
      if !pbTooHigh?(PBStats::DEFENSE)
        if (self.hasWorkingAbility(:BATTLEARMOR) || self.hasWorkingAbility(:SHELLARMOR) || self.hasWorkingAbility(:POWEROFALCHEMY)) && onactive
          pbIncreaseStatBasic(PBStats::DEFENSE,1)
          @battle.pbCommonAnimation("StatUp",self,nil)
          @battle.pbDisplay(_INTL("{1}'s shining armor boosted its Defense!",
           pbThis,PBAbilities.getName(ability)))
        end     
        if (self.hasWorkingAbility(:STANCECHANGE)) && onactive
          pbIncreaseStatBasic(PBStats::DEFENSE,1)
        end  
      end
      if !pbTooHigh?(PBStats::SPDEF)
        if (self.hasWorkingAbility(:MAGICGUARD) || self.hasWorkingAbility(:MAGICBOUNCE) || self.hasWorkingAbility(:POWEROFALCHEMY)) && onactive
          pbIncreaseStatBasic(PBStats::SPDEF,1)
          @battle.pbCommonAnimation("StatUp",self,nil)
          @battle.pbDisplay(_INTL("{1}'s magical power boosted its Special Defense!",
           pbThis,PBAbilities.getName(ability)))
        end     
      end
      if !pbTooHigh?(PBStats::SPATK)
        if (self.hasWorkingAbility(:MAGICIAN)) && onactive
          pbIncreaseStatBasic(PBStats::SPATK,1)
          @battle.pbCommonAnimation("StatUp",self,nil)
          @battle.pbDisplay(_INTL("{1}'s magical power boosted its Special Attack!",
           pbThis,PBAbilities.getName(ability)))
        end     
      end
    end
 

 

 

Put this under it

 

 

 



# Cynthia's Room
    if $fefieldeffect == 58
      if !pbTooHigh?(PBStats::DEFENSE)
        if (self.hasWorkingAbility(:BATTLEARMOR) || self.hasWorkingAbility(:SHELLARMOR) || self.hasWorkingAbility(:POWEROFALCHEMY)) && onactive
          pbIncreaseStatBasic(PBStats::DEFENSE,1)
          @battle.pbCommonAnimation("StatUp",self,nil)
          @battle.pbDisplay(_INTL("The runes boosted {1}'s Defense!",
           pbThis))
        end
      end
      if !pbTooHigh?(PBStats::SPDEF)
        if (self.hasWorkingAbility(:MAGICGUARD) || self.hasWorkingAbility(:MAGICBOUNCE)) && onactive
          pbIncreaseStatBasic(PBStats::SPDEF,1)
          @battle.pbCommonAnimation("StatUp",self,nil)
          @battle.pbDisplay(_INTL("The runes boosted {1}'s Special Defense!",
           pbThis))
        end     
      end
      if !pbTooHigh?(PBStats::SPATK)
        if (self.hasWorkingAbility(:MAGICIAN)) && onactive
          pbIncreaseStatBasic(PBStats::SPATK,1)
          @battle.pbCommonAnimation("StatUp",self,nil)
          @battle.pbDisplay(_INTL("The runes boosted {1}'s Special Attack!",
           pbThis))
        end     
      end
    end  
 

 

Rune do not only heal, they also boost your defense, hence why certain abilities get boosted!

 

If you see this

 

 

 



if target.hasWorkingAbility(:TANGLINGHAIR,true) 
          if user.hasWorkingAbility(:CONTRARY)
            user.pbReduceStat(PBStats::SPEED,1,false,nil,nil,true,false,false,false)
            @battle.pbDisplay(_INTL("{1}'s {2} boosted {3}'s Speed!",target.pbThis,PBAbilities.getName(target.ability),user.pbThis(true)))
          elsif user.hasWorkingAbility(:WHITESMOKE) ||
           user.hasWorkingAbility(:CLEARBODY) || user.hasWorkingAbility(:FULLMETALBODY)
            @battle.pbDisplay(_INTL("{1}'s {2} prevents stat loss!",user.pbThis,PBAbilities.getName(user.ability)))
          else
            user.pbReduceStat(PBStats::SPEED,1,false,nil,nil,true,false,false,false)
            @battle.pbDisplay(_INTL("{1}'s {2} lowered {3}'s Speed!",target.pbThis,PBAbilities.getName(target.ability),user.pbThis(true)))
          end
        end        
        eschance = 3
        eschance = 6 if ($fefieldeffect == 19)
        eschance.to_i  
        if target.hasWorkingAbility(:POISONPOINT) &&
         @battle.pbRandom(10) < eschance && user.pbCanPoison?(false)
          user.pbPoison(target)
          @battle.pbDisplay(_INTL("{1}'s {2} poisoned {3}!",target.pbThis,
           PBAbilities.getName(target.ability),user.pbThis(true)))
        end
 

 

 

Put this under it.

 

 

 



# Roserade
        if isConst?(target.species,PBSpecies,:ROSERADE) && $fefieldeffect==58
          if !user.pbHasType?(:POISON) && 
            !user.pbHasType?(:STEEL) &&
            !user.hasWorkingAbility(:IMMUNITY) && 
            user.status != PBStatuses::PARALYSIS && 
            user.status != PBStatuses::POISON &&
            user.status != PBStatuses::SLEEP
            @battle.pbRandom(10) < eschance && user.pbCanPoison?(false)
            user.pbPoison(target)
            @battle.pbDisplay(_INTL("{1}'s thorny whips poisoned {2}!",target.pbThis,user.pbThis(true)))
          end
        end
 

 

Free Poison if you touch Roserade.

 

Above

 

 

 



if target.hasWorkingAbility(:ROUGHSKIN,true) && !user.isFainted? &&
         !user.hasWorkingAbility(:MAGICGUARD)
          @battle.scene.pbDamageAnimation(user,0)
          user.pbReduceHP((user.totalhp/8).floor)
          @battle.pbDisplay(_INTL("{1}'s {2} hurt {3}!",target.pbThis,
           PBAbilities.getName(target.ability),user.pbThis(true)))
        end
 

 

 

Put this

 

 

 



# Cynthia
        if isConst?(target.species,PBSpecies,:LUCARIO) && $fefieldeffect==58 && !user.isFainted? &&
         !user.hasWorkingAbility(:FOREWARN) &&
         !user.hasWorkingAbility(:ANTICIPATION)
         @battle.scene.pbDamageAnimation(user,0)
         user.pbReduceHP((user.totalhp/8).floor)
         @battle.pbDisplay(_INTL("{1} striked back!",target.pbThis))
        end
        if isConst?(target.species,PBSpecies,:ROSERADE) && $fefieldeffect==58 && !user.isFainted? &&
         !user.hasWorkingAbility(:FOREWARN) &&
         !user.hasWorkingAbility(:ANTICIPATION)
         @battle.scene.pbDamageAnimation(user,0)
         user.pbReduceHP((user.totalhp/8).floor)
         @battle.pbDisplay(_INTL("{1} striked back with its thorny whips!",target.pbThis))
        end
        if isConst?(target.species,PBSpecies,:GARCHOMP) && target.form==1 && $fefieldeffect==58 && !user.isFainted? &&
         !user.hasWorkingAbility(:FOREWARN) &&
         !user.hasWorkingAbility(:ANTICIPATION)
         @battle.scene.pbDamageAnimation(user,0)
         user.pbReduceHP((user.totalhp/6).floor)
         @battle.pbDisplay(_INTL("{1} striked back!",target.pbThis))
        end
        # End
 

 

It's like Rough Skin, but if you happen to have Forewarn or Anticipation, you won't receive any damages.

 

Above

 

 

 



if target.hasWorkingAbility(:WEAKARMOR) && move.pbIsPhysical?(movetype)
          if target.pbCanReduceStatStage?(PBStats::DEFENSE,false,true)
            target.pbReduceStatBasic(PBStats::DEFENSE,1)
            @battle.pbCommonAnimation("StatDown",target,nil)
            @battle.pbDisplay(_INTL("{1}'s {2} lowered its Defense!",
             target.pbThis,PBAbilities.getName(target.ability)))
          end
          if target.pbCanIncreaseStatStage?(PBStats::SPEED)
            target.pbIncreaseStatBasic(PBStats::SPEED,2)
            @battle.pbCommonAnimation("StatUp",target,nil)
            @battle.pbDisplay(_INTL("{1}'s {2} sharply raised its Speed!",
             target.pbThis,PBAbilities.getName(target.ability)))
          end
        end
 

 

 

Put this

 

 

 



# Spiritomb
        if isConst?(target.species,PBSpecies,:SPIRITOMB) && ($fefieldeffect == 58)
          if !user.isFainted? && !user.effects[PBEffects::Torment]
            user.effects[PBEffects::Torment]=target.index
            @battle.pbDisplay(_INTL("{1}'s cry tormented {2}!",target.pbThis,user.pbThis(true)))
          end 
        end

# Togekiss
        if isConst?(target.species,PBSpecies,:TOGEKISS) && target.isFainted? && target.pbOwnSide.effects[PBEffects::LuckyChant]==0 && $fefieldeffect == 58
           target.pbOwnSide.effects[PBEffects::LuckyChant]=8
           @battle.pbDisplay(_INTL("{1} blessed the field with a Lucky Chant!",target.pbThis))
        end 
 

 

If you attack Spiritomb, you will be put under the effect of Torment.

If Togekiss faints, it will bless the field with a lucky chant.

 

PokeBattle_AI: Again, I know

Now that you implemented all the features of Cynthia's field, the AI has to know what they all do, otherwise the AI won't fight as effectively as they should. Therefore, it's important to include the following codes. 

 

If you see this

 

 

 



score+=200 if (score>100 && move.priority>0)
 

 

 

Replace it with this.

 

 

 



score+=200 if ((score>100 && move.priority>0)  ||
    (score>100 && $fefieldeffect==58 && isConst?(attacker.species,PBSpecies,:GARCHOMP) && attacker.form==0 && move.id==getID(PBMoves,:DRAGONRUSH) && attacker.turncount==1) ||
    (score>100 && $fefieldeffect==58 && isConst?(attacker.species,PBSpecies,:TOGEKISS) && attacker.turncount==1))
 

 

This makes sure that AI knows that Togekiss and Garchomp have priority during their first turn, which is why Garchomp will most likely use Dragon Rush to finish off a fast, weakened Pkm. While Cynthia's Garchomp doesn't have Dragon Rush, I included this code for consistency, and maybe you want to teach her Garchomp Dragon Rush.

 

Above

 

 

 



when 16 # Superheated Field
          if (move.id == PBMoves::SURF || move.id == PBMoves::MUDDYWATER ||
           move.id == PBMoves::WATERPLEDGE || move.id == PBMoves::WATERSPOUT ||
           move.id == PBMoves::SPARKLINGARIA)
            basedamage=(basedamage*0.625).round
          end
          if (move.id == PBMoves::SCALD || move.id == PBMoves::STEAMERUPTION)
            basedamage=(basedamage*1.667).round
          end
 

 

 

Put this

 

 

 



when 58
          if (move.id == PBMoves::MAGICALLEAF || move.id == PBMoves::ANCIENTPOWER || move.id == PBMoves::JUDGMENT ||
            move.id == PBMoves::SACREDFIRE || move.id == PBMoves::SECRETPOWER)
            basedamage=(basedamage*1.5).round
          end
          if (move.id == PBMoves::AURASPHERE || move.id == PBMoves::DRAGONPULSE ||
            move.id == PBMoves::DARKPULSE || move.id == PBMoves::WATERPULSE)
            basedamage=(basedamage*1.5).round
          end
          if (move.id == PBMoves::HIDDENPOWER || move.id == PBMoves::HIDDENPOWERNOR || move.id == PBMoves::HIDDENPOWERFIR ||
             move.id == PBMoves::HIDDENPOWERFIG || move.id == PBMoves::HIDDENPOWERWAT || move.id == PBMoves::HIDDENPOWERFLY ||
             move.id == PBMoves::HIDDENPOWERGRA || move.id == PBMoves::HIDDENPOWERPOI || move.id == PBMoves::HIDDENPOWERELE ||
             move.id == PBMoves::HIDDENPOWERGRO || move.id == PBMoves::HIDDENPOWERPSY || move.id == PBMoves::HIDDENPOWERROC ||
             move.id == PBMoves::HIDDENPOWERICE || move.id == PBMoves::HIDDENPOWERBUG || move.id == PBMoves::HIDDENPOWERDRA ||
             move.id == PBMoves::HIDDENPOWERGHO || move.id == PBMoves::HIDDENPOWERDAR || move.id == PBMoves::HIDDENPOWERSTE ||
             move.id == PBMoves::HIDDENPOWERFAI)
            basedamage=(basedamage*1.5).round
          end
          # Magical Leaf: Thunder Force
          if move.id == PBMoves::MAGICALLEAF
            if !opponent.pbHasType?(:GROUND) && 
              !opponent.hasWorkingAbility(:VOLTABSORB) &&
              !opponent.hasWorkingAbility(:LIGHTNINGROD) &&
              !opponent.hasWorkingAbility(:MOTORDRIVE)
              basedamage=(basedamage*1.5).round
            end
          end
          # Hidden Power Grass: Thunder Force
          if move.id == PBMoves::HIDDENPOWERGRA
            if !opponent.pbHasType?(:GROUND) && 
              !opponent.hasWorkingAbility(:VOLTABSORB) &&
              !opponent.hasWorkingAbility(:LIGHTNINGROD) &&
              !opponent.hasWorkingAbility(:MOTORDRIVE)
              basedamage=(basedamage*1.5).round
            end
          end
          # Water Pulse: Thunder Force
          if move.id == PBMoves::WATERPULSE
            if !opponent.pbHasType?(:GROUND) && 
              !opponent.hasWorkingAbility(:VOLTABSORB) &&
              !opponent.hasWorkingAbility(:LIGHTNINGROD) &&
              !opponent.hasWorkingAbility(:MOTORDRIVE)
              basedamage=(basedamage*1.5).round
            end
          end
          # Mystical Fire: Freezing Force
          if move.id == PBMoves::MYSTICALFIRE
            basedamage=(basedamage*2.25).round
          end
          # Extra Sensory: Freezing Force
          if move.id == PBMoves::EXTRASENSORY
            if !opponent.pbHasType?(:DARK)
              basedamage=(basedamage*1.5).round
            end
          end
          # Shadow Ball: Freezing Force
          if move.id == PBMoves::SHADOWBALL
            if !opponent.pbHasType?(:NORMAL) && 
              !opponent.hasWorkingAbility(:BULLETPROOF)
              basedamage=(basedamage*1.5).round
            end
          end
          # Hidden Power Ice: Freezing Force
          if move.id == PBMoves::HIDDENPOWERICE
            if !opponent.hasWorkingAbility(:FLASHFIRE)
              basedamage=(basedamage*1.5).round
            end  
          end
          # Aurasphere: Fire Force
          if move.id == PBMoves::AURASPHERE
            if !opponent.hasWorkingAbility(:FLASHFIRE)
              basedamage=(basedamage*1.5).round
            end 
          end
          # Ancient Power: Fire Force
          if move.id == PBMoves::ANCIENTPOWER
            if !opponent.hasWorkingAbility(:FLASHFIRE)
              basedamage=(basedamage*1.5).round
            end 
          end
          # End of Spheres
          if (move.id == PBMoves::PSYSTRIKE || move.id == PBMoves::AEROBLAST ||
            move.id == PBMoves::ORIGINPULSE || move.id == PBMoves::PRECIPICEBLADES ||
            move.id == PBMoves::DRAGONASCENT || move.id == PBMoves::DOOMDUMMY ||
            move.id == PBMoves::MISTBALL || move.id == PBMoves::LUSTERPURGE ||
            move.id == PBMoves::PSYCHOBOOST || move.id == PBMoves::SPACIALREND ||
            move.id == PBMoves::ROAROFTIME || move.id == PBMoves::CRUSHGRIP ||
            move.id == PBMoves::SECRETSWORD || move.id == PBMoves::RELICSONG ||
            move.id == PBMoves::HYPERSPACEHOLE || move.id == PBMoves::LANDSWRATH ||
            move.id == PBMoves::MOONGEISTBEAM || move.id == PBMoves::SUNSTEELSTRIKE ||         
            move.id == PBMoves::PRISMATICLASER || move.id == PBMoves::FLEURCANNON)
            basedamage=(basedamage*1.3).round
          end
 

 

 

Above

 

 

 



# Guts
    if skill>=PBTrainerAI.mediumSkill
      if attacker.hasWorkingAbility(:GUTS) && attacker.status==0 && move.pbIsPhysical?(type) && $fefieldeffect==56
        atk=(atk*1.5).round
      end  
    end
 

 

 

Put this

 

 

 



# Spiritomb
    if skill>=PBTrainerAI.mediumSkill
      if isConst?(attacker.species,PBSpecies,:SPIRITOMB) && $fefieldeffect==58
        atk=(atk*1.3).round
      end
    end
 

 

 

Replace

 

 

 



# Marvel Scale
    if skill>=PBTrainerAI.mediumSkill
      if opponent.hasWorkingAbility(:MARVELSCALE) &&
        move.pbIsPhysical?(type)
        if opponent.status>0   
          defense=(defense*1.5).round
        elsif ($fefieldeffect == 3 || $fefieldeffect == 9 ||
           $fefieldeffect == 31 || $fefieldeffect == 32 || $fefieldeffect == 34) && 
           skill>=PBTrainerAI.bestSkill
          defense=(defense*1.5).round
        end        
      end
    end
 

 

 

With

 

 

 



# Marvel Scale
    if skill>=PBTrainerAI.mediumSkill
      if opponent.hasWorkingAbility(:MARVELSCALE) &&
        move.pbIsPhysical?(type)
        if opponent.status>0   
          defense=(defense*1.5).round
        elsif ($fefieldeffect == 3 || $fefieldeffect == 9 ||
           $fefieldeffect == 31 || $fefieldeffect == 32 || $fefieldeffect == 34 || $fefieldeffect == 58) && 
           skill>=PBTrainerAI.bestSkill
          defense=(defense*1.5).round
        end        
      end
    end
    # Start: Marvel Scale blessed by Lucky Chant
    if skill>=PBTrainerAI.mediumSkill
      if opponent.hasWorkingAbility(:MARVELSCALE) && move.pbIsSpecial?(type) &&
        $fefieldeffect == 58 && opponent.pbOwnSide.effects[PBEffects::LuckyChant]>0
        defense=(defense*1.5).round
      end
    end  
    # End
 

 

 

Above

 

 

 



when 37 # Psychic Terrain
          if isConst?(type,PBTypes,:PSYCHIC)
            isgrounded=move.pbTypeModifier(PBTypes::GROUND,opponent,attacker)
            if isgrounded != 0
              damage=(damage*1.5).floor
            end
          end        
      end      
    end
    if skill>=PBTrainerAI.bestSkill
 

 

 

Put this

 

 

 



when 58 # Cynthia's Room
          if isConst?(type,PBTypes,:ROCK)
            if move.id != PBMoves::HIDDENPOWER &&
              move.id != PBMoves::HIDDENPOWERROC &&
              move.id != PBMoves::ANCIENTPOWER &&
              move.id != PBMoves::JUDGMENT
              damage=(damage*1.5).floor
            end  
          end
          if isConst?(type,PBTypes,:PSYCHIC)
            if move.id != PBMoves::HIDDENPOWER &&
              move.id != PBMoves::HIDDENPOWERPSY &&
              move.id != PBMoves::PSYSTRIKE &&
              move.id != PBMoves::PSYCHOBOOST &&
              move.id != PBMoves::MISTBALL &&
              move.id != PBMoves::LUSTERPURGE &&
              move.id != PBMoves::PRISMATICLASER &&
              move.id != PBMoves::JUDGMENT &&
              move.id != PBMoves::HYPERSPACEHOLE
              damage=(damage*1.5).floor
            end
          end
          if isConst?(type,PBTypes,:DRAGON)
            if move.id != PBMoves::ROAROFTIME &&
              move.id != PBMoves::SPACIALREND &&
              move.id != PBMoves::JUDGMENT
              damage=(damage*1.3).floor
            end
          end
 

 

 

Above

 

 

 



# Stakeout
    if skill>=PBTrainerAI.mediumSkill
      if attacker.hasWorkingAbility(:STAKEOUT) && switchedOut[opponent.index]
        damage=(damage*2.0).round
      end  
    end
 

 

 

Put this

 

 

 



if skill>=PBTrainerAI.mediumSkill
      if isConst?(opponent.species,PBSpecies,:LUCARIO) && opponent.form==0 && ($fefieldeffect==58)
        damage=(damage*0.75).round
      end
    end
    if skill>=PBTrainerAI.mediumSkill
      if isConst?(opponent.species,PBSpecies,:LUCARIO) && opponent.form==1 && ($fefieldeffect==58)
        damage=(damage*0.675).round
      end
    end

if skill>=PBTrainerAI.mediumSkill
      if isConst?(opponent.species,PBSpecies,:SPIRITOMB) && $fefieldeffect==58
        damage=(damage*0.75).round
      end
    end
    if skill>=PBTrainerAI.mediumSkill
      if isConst?(opponent.species,PBSpecies,:GARCHOMP) && opponent.form==0 && $fefieldeffect==58
        damage=(damage*0.75).round
      end
    end
    if skill>=PBTrainerAI.mediumSkill
      if isConst?(opponent.species,PBSpecies,:GARCHOMP) && opponent.form==1 && $fefieldeffect==58
        damage=(damage*0.675).round
      end
    end
    # End
 

 

 

Under

 

 

 



#Telepathy
    if opponent.hasWorkingAbility(:TELEPATHY) && 
     move.basedamage>0 &&
     !(opponent.moldbroken)
      partner=attacker.pbPartner
      if opponent.index == partner.index
        return 0
      end
    end
 

 

 

Put this

 

 

 



# Cynthia's Lucario dodges if it switches in
    if isConst?(opponent.species,PBSpecies,:LUCARIO) && $fefieldeffect==58 &&
      switchedOut[opponent.index]
      return 0
    end
    # End
 

 

 

If you see this: return 3 if move.function==0xA0 # Frost Breath

 

Put the following codes under it

 

 

 



return 3 if isConst?(attacker.species,PBSpecies,:GARCHOMP) && attacker.form==1 && $fefieldeffect==58
 

 

 

If you see this: accuracy=100 if opponent.effects[PBEffects::Telekinesis]>0

 

Put the following codes under it

 

 

 



accuracy=100 if isConst?(attacker.species,PBSpecies,:LUCARIO) && ($fefieldeffect == 58)
 

 

 

Replace this

 

 

 



if restmove || isConst?(mon.ability,PBAbilities,:COMATOSE) || mon.item==getID(PBItems,:TOXICORB) || mon.item==getID(PBItems,:FLAMEORB) || isConst?(mon.ability,PBAbilities,:GUTS) || isConst?(mon.ability,PBAbilities,:QUICKFEET)|| isConst?(mon.ability,PBAbilities,:FLAREBOOST) || isConst?(mon.ability,PBAbilities,:TOXICBOOST) || isConst?(mon.ability,PBAbilities,:NATURALCURE) || isConst?(mon.ability,PBAbilities,:MAGICGUARD) || isConst?(mon.ability,PBAbilities,:MAGICBOUNCE) || (isConst?(mon.ability,PBAbilities,:HYDRATION) && pbWeather==PBWeather::RAINDANCE) 
        monRoles.push("Status Absorber")
      end
 

 

 

With

 

 

 



if restmove || isConst?(mon.ability,PBAbilities,:COMATOSE) || mon.item==getID(PBItems,:TOXICORB) || mon.item==getID(PBItems,:FLAMEORB) || isConst?(mon.ability,PBAbilities,:GUTS) || isConst?(mon.ability,PBAbilities,:QUICKFEET)|| isConst?(mon.ability,PBAbilities,:FLAREBOOST) || isConst?(mon.ability,PBAbilities,:TOXICBOOST) || isConst?(mon.ability,PBAbilities,:NATURALCURE) || isConst?(mon.ability,PBAbilities,:MAGICGUARD) || isConst?(mon.ability,PBAbilities,:MAGICBOUNCE) || (isConst?(mon.ability,PBAbilities,:HYDRATION) && pbWeather==PBWeather::RAINDANCE) ||
        (isConst?(opponent.species,PBSpecies,:LUCARIO) && $fefieldeffect==58) || (isConst?(opponent.species,PBSpecies,:SPIRITOMB) && $fefieldeffect==58)
        monRoles.push("Status Absorber")
      end
 

 

If you use status moves such as Will o Wisp or Thunder Wave, AI will switch out their Pkm and use Lucario or Spiritomb as they get healed by the field.

 

If you see this AGAIN, replace this

 

 

 



f restmove || isConst?(mon.ability,PBAbilities,:COMATOSE) || mon.item==getID(PBItems,:TOXICORB) || mon.item==getID(PBItems,:FLAMEORB) || isConst?(mon.ability,PBAbilities,:GUTS) || isConst?(mon.ability,PBAbilities,:QUICKFEET)|| isConst?(mon.ability,PBAbilities,:FLAREBOOST) || isConst?(mon.ability,PBAbilities,:TOXICBOOST) || isConst?(mon.ability,PBAbilities,:NATURALCURE) || isConst?(mon.ability,PBAbilities,:MAGICGUARD) || isConst?(mon.ability,PBAbilities,:MAGICBOUNCE) || (isConst?(mon.ability,PBAbilities,:HYDRATION) && pbWeather==PBWeather::RAINDANCE) 
        monRoles.push("Status Absorber")
      end
 

 

 

With

 

 

 



if restmove || isConst?(mon.ability,PBAbilities,:COMATOSE) || mon.item==getID(PBItems,:TOXICORB) || mon.item==getID(PBItems,:FLAMEORB) || isConst?(mon.ability,PBAbilities,:GUTS) || isConst?(mon.ability,PBAbilities,:QUICKFEET)|| isConst?(mon.ability,PBAbilities,:FLAREBOOST) || isConst?(mon.ability,PBAbilities,:TOXICBOOST) || isConst?(mon.ability,PBAbilities,:NATURALCURE) || isConst?(mon.ability,PBAbilities,:MAGICGUARD) || isConst?(mon.ability,PBAbilities,:MAGICBOUNCE) || (isConst?(mon.ability,PBAbilities,:HYDRATION) && pbWeather==PBWeather::RAINDANCE) ||
        (isConst?(opponent.species,PBSpecies,:LUCARIO) && $fefieldeffect==58) || (isConst?(opponent.species,PBSpecies,:SPIRITOMB) && $fefieldeffect==58)
        monRoles.push("Status Absorber")
      end
 

 

 

Under

 

 

 



if isConst?(i.item,PBItems,:ROCKYHELMET)
              paincount+=1
            end 
 

 

 

Put this

 

 

 



# Cynthia
            if isConst?(i.species,PBSpecies,:LUCARIO) && $fefieldeffect==58
              paincount+=1
            end
            if isConst?(i.species,PBSpecies,:ROSERADE) && $fefieldeffect==58
              paincount+=1
            end
            if isConst?(i.species,PBSpecies,:GARCHOMP) && i.form==1 && $fefieldeffect==58
              paincount+=1
            end
            # End
 

 

 

 

If you see this AGAIN, then

 

 

 



if isConst?(i.item,PBItems,:ROCKYHELMET)
              paincount+=1
            end  
 

 

 

Put the following codes under it

 

 

 



# Cynthia
            if isConst?(i.species,PBSpecies,:LUCARIO) && $fefieldeffect==58
              paincount+=1
            end
            if isConst?(i.species,PBSpecies,:ROSERADE) && $fefieldeffect==58
              paincount+=1
            end
            if isConst?(i.species,PBSpecies,:GARCHOMP) && i.form==1 && $fefieldeffect==58
              paincount+=1
            end
 

 

 

If you see this

 

 

 



if isConst?(i.ability,PBAbilities,:EFFECTSPORE) || isConst?(i.ability,PBAbilities,:STATIC) || isConst?(i.ability,PBAbilities,:POISONPOINT) || isConst?(i.ability,PBAbilities,:ROUGHSKIN) || isConst?(i.ability,PBAbilities,:IRONBARBS) || isConst?(i.ability,PBAbilities,:FLAMEBODY) || isConst?(i.ability,PBAbilities,:CUTECHARM) || isConst?(i.ability,PBAbilities,:MUMMY) || isConst?(i.ability,PBAbilities,:AFTERMATH) || isConst?(i.ability,PBAbilities,:GOOEY) || (isConst?(i.ability,PBAbilities,:FLUFFY) && (!opponent1.pbHasType?(PBTypes::FIRE) && !opponent2.pbHasType?(PBTypes::FIRE))) 
 

 

 

Replace it with this:

 

 

 



if isConst?(i.ability,PBAbilities,:EFFECTSPORE) || isConst?(i.ability,PBAbilities,:STATIC) || isConst?(i.ability,PBAbilities,:POISONPOINT) || isConst?(i.ability,PBAbilities,:ROUGHSKIN) || isConst?(i.ability,PBAbilities,:IRONBARBS) || isConst?(i.ability,PBAbilities,:FLAMEBODY) || isConst?(i.ability,PBAbilities,:CUTECHARM) || isConst?(i.ability,PBAbilities,:MUMMY) || isConst?(i.ability,PBAbilities,:AFTERMATH) || isConst?(i.ability,PBAbilities,:GOOEY) || (isConst?(i.ability,PBAbilities,:FLUFFY) && (!opponent1.pbHasType?(PBTypes::FIRE) && !opponent2.pbHasType?(PBTypes::FIRE))) ||
         
          (isConst?(i.species,PBSpecies,:LUCARIO) && $fefieldeffect==58) || (isConst?(i.species,PBSpecies,:ROSERADE) && $fefieldeffect==58) || (isConst?(i.species,PBSpecies,:GARCHOMP) && i.form==1 && $fefieldeffect==58)
 

 

 

Under

 

 

 



when 37
            monscore+=25 if i.hasType?(:PSYCHIC)
            monscore+=20 if isConst?(i.ability,PBAbilities,:PUREPOWER)
            monscore+=20 if isConst?(i.ability,PBAbilities,:ANTICIPATION)
            monscore+=50 if isConst?(i.ability,PBAbilities,:TELEPATHY)
 

 

 

Put this

 

 

 



when 58 # Cynthia
            monscore+=25 if i.hasType?(:ROCK)
            monscore+=25 if i.hasType?(:PSYCHIC)
            monscore+=25 if i.hasType?(:DRAGON)
            monscore+=20 if isConst?(i.ability,PBAbilities,:MARVELSCALE)
            monscore+=25 if isConst?(i.ability,PBAbilities,:MAGICIAN)
            monscore+=25 if isConst?(i.ability,PBAbilities,:MAGICGUARD)
            monscore+=25 if isConst?(i.ability,PBAbilities,:MAGICBOUNCE)
            monscore+=25 if isConst?(i.ability,PBAbilities,:BATTLEARMOR)
            monscore+=25 if isConst?(i.ability,PBAbilities,:SHELLARMOR)
            monscore+=30 if isConst?(i.ability,PBAbilities,:SANDFORCE) 
 

 

 

 

Edited by BluePen
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...