Ace Trainer (Trainer class): Difference between revisions

re-clarified rby code explanation that was lost with deletion of unapproved split page
m (Reverted edits by NARFNra (talk) to last revision by Ht14)
Tag: Rollback
(re-clarified rby code explanation that was lost with deletion of unapproved split page)
Line 182: Line 182:
{{split|{{red link|Ace Trainer (Trainer class)/Trainer list}}|section}}
{{split|{{red link|Ace Trainer (Trainer class)/Trainer list}}|section}}
===Pokémon Red, Blue, and Yellow===
===Pokémon Red, Blue, and Yellow===
For each of their Pokémon, Cooltrainers♂ have two [[X Attack]]s that they have a 25% random chance of using. Cooltrainers♀ will instead switch their Pokémon out if it is under 20% HP, or use a [[Hyper Potion]] once if it's under 10% HP. Although Cooltrainers♀ are meant to only do this 25% of the time, a bug prevents them from using the result of the random number check, and so they will always perform the relevant action if under the given HP conditions. Furthermore, because the AI only switches between the current Pokémon and the next live Pokémon in the party, if a Cooltrainer♀ has two Pokémon that are both under 20% HP, it will switch between them continuously until the HP condition is no longer true.<ref>https://www.youtube.com/watch?v=-r8Ikqo_bus</ref>
In these games a random number is generated every turn, and if it falls within a specific range a checklist is followed to determine whether the Trainer will perform a special action like switching or using an item. The AI check is meant to be performed 25% of the time for both Cooltrainer types. However, the Cooltrainer♀ AI code is bugged and fails to properly handle the random check, meaning that Cooltrainer♀s will ''always'' perform the relevant actions when their individual requirements are fulfilled. The Cooltrainer♂ code does not have this bug, and thus occurs at the proper rate.
 
Cooltrainer♂s have access to two X Attacks, which they will use 25% of the time. Cooltrainer♀s, on the other hand, are coded to check their Pokemon's current HP and perform one of two actions when it's under a certain threshold. If their current Pokemon is under 10% HP, they will use a Hyper Potion. If their Pokemon is '''not''' under 10% HP, but '''is''' under 20% HP, they will instead switch out to the next Pokemon in their party. Because of the aforementioned bug, Cooltrainer♀s will do this continuously so long as the HP condition remains true, which can lead to a Cooltrainer♀ switching two pokemon for each other ad infinitum. <ref>https://www.youtube.com/watch?v=-r8Ikqo_bus</ref>
{{Trainerlist/h|3|red|blue|yellow}}
{{Trainerlist/h|3|red|blue|yellow}}
{{Trainerlist/e|1|[[Celadon Gym|Cooltrainer♀]]}}
{{Trainerlist/e|1|[[Celadon Gym|Cooltrainer♀]]}}
62

edits