What exactly are you trying to make happen? You say you're trying to make this trainer Terastallize, but nothing in your script is forcing this to occur. It seems like you're just conpletely relying on the AI to do so, which isn't particularly reliable. It's likely that the trainer isnt Terastallizing simply because they don't think it's worth Terastallizing.
Turn on battle logging and see what the AI is thinking. It should display their Tera logic.
Ok so I readjusted the script to force the terastallization of a specific pokemon, however it looks like i found the real problem.
I turned on battle logging and tested different revisions of my script for a while, and
I discovered that the trainer will ONLY terastallize if the ace pokemon is the last one remaining (in double battles).
No terastallizing happened when the ace pokemon was battling alongside another pokemon.
My goal is to get the trainer to terastallize their Ace pokemon (
in a double battle) once it's out and after they select a
move regardless how many pokemon are remaining on the trainer's team.
This is the revised script (
it only works if the ace pokemon is the last one remaining):
#-----------------------------------------------------------------------------
# Battle vs Lacey.
#-----------------------------------------------------------------------------
BATTLE_LACEY = {
"RoundStartCommand_foe" => {
"speech" => ["I'll be facing you with my usual party as a member of the Elite Four."]
},
"UserMoveEffective_foe" => {
"speech" => ["It's a rock-solid stratregy to go after weaknesses...", "which is why I'll be turning it right back at you!"]
},
"UserDealtCriticalHit" => {
"speech" => [:Opposing, "Why did you have to land that kind of hit? Now that's just not right!"]
},
"AfterLastSwitchIn_EXCADRILL" => {
"Terastallize" => [:true]
},
"BeforeTerastallize_EXCADRILL" => {
"speech" => ["All eyes on our great big Terastal heart! Time to get even cuter and cuter!"]
},
"BeforeTeraMove_EXCADRILL" => {
"speech" => ["Get'em, Excadrill! Let's send them flying with your adorable destructive force!"]
},
"LastUserHPHalf_EXCADRILL" => {
"speech" => ["No point in letting this drag on... Behold, the power to overwhelm everything!"]
},
}
end