Advertisement
PikalaxALT

Check flags for switch and move use

Sep 13th, 2015
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.03 KB | None | 0 0
  1. def CanSwitch(mon_idx):
  2.     if TrappedStatus[mon_idx]:return False
  3.     if Battler[1 - mon_idx].Ability == "Shadow Tag":return False
  4.     if (Battler[1 - mon_idx].Ability == "Arena Trap") && (("Flying" not in Battler[mon_idx].Type) || (Battler[mon_idx].Ability != "Levitate") || ("Magnet Rise" not Battler[mon_idx].Substatus) || ("Gravity" in FieldEffects)):return False
  5.     return True
  6.  
  7. def CanUseMove(mon_idx, move_idx):
  8.     if Battler[mon_idx].Moves[move_idx].PP == 0:return False
  9.     if ("Disabled" in Battler[mon_idx].Substatus) && (move_idx == LockedMove[mon_idx]):return False
  10.     if ("Encore" in Battler[mon_idx].Substatus) && (move_idx != LockedMove[mon_idx]):return False
  11.     if ("Taunt" in Battler[mon_idx].Substatus) && (Battler[mon_idx].Moves[move_idx].Type2 == "Status"):return False
  12.     if ("Torment" in Battler[mon_idx].Substatus) && (Battler[mon_idx].LastMove == move_idx):return False
  13.     if ("Imprison" in Battler[mon_idx].Substatus) && (Battler[mon_idx].Moves[move_idx].Name in [x.Name for x in Battler[1 - mon_idx].Moves]):return False
  14.     return True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement