Gen7Data/Scripts/Pokemon/PreventFoeRunning.as

20 lines
592 B
ActionScript

namespace Gen7 {
[Pokemon effect=PreventFoeRunning]
shared class PreventFoeRunningEffect : PkmnScript {
Pokemon@[] _trappedOpponents;
void PreventOpponentRunAway(FleeTurnChoice@ choice, bool &inout o) override {
for(uint i = 0; i < _trappedOpponents.length; i++)
{
if (_trappedOpponents[i] is choice.User){
o = true;
break;
}
}
}
void SetLockedOpponent(Pokemon@ opponent){
_trappedOpponents.insertLast(opponent);
}
}
}