Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.70 KB | None | 0 0
  1. IMMUNITE = 20
  2. DEPLACEMENT_FELIN = 22
  3. PIQURE_MOTIVANTE = 27
  4. INVISIBILITE = 72
  5. FLAMME = 455
  6. INVULNERABLE_TAG = "Invulnerable"
  7.  
  8. def init(monster):
  9.     monster.AI.AddTag(INVULNERABLE_TAG, '3')
  10.     pass
  11.  
  12. def onPerformAI(monster):
  13.     phase1(monster)
  14.  
  15.     doBoost(monster)
  16.     monster.AI.MoveNeightboorUntilCanHit()
  17.     doAttack(monster)
  18.     pass
  19.  
  20. def onEndTurn(monster):
  21.  
  22.     pass
  23.  
  24. def onTakingDamages(monster, damages):
  25.     if(monster.AI.HasTag(INVULNERABLE_TAG)): #If is in invulnerability state
  26.         monster.AI.FightMessage("<b>@name@</b> est <b>" + INVULNERABLE_TAG + "</b> pour le moment")
  27.         return 0
  28.         pass
  29.     return damages
  30.     pass
  31.  
  32. def onHeal(monster):
  33.  
  34.     pass
  35.  
  36. def onPush(monster):
  37.  
  38.     pass
  39.  
  40.  
  41. # Custom Monster Method
  42.  
  43. def doBoost(monster):
  44.     monster.AI.CastOnMe(DEPLACEMENT_FELIN)
  45.     monster.AI.CastOnMe(PIQURE_MOTIVANTE)
  46.     if(not monster.AI.HasTag(INVULNERABLE_TAG)):
  47.         monster.AI.CastOnMe(IMMUNITE)
  48.         pass
  49.     pass
  50.  
  51. def doAttack(monster):
  52.     fighter = monster.AI.GetNearestFighter()
  53.     if(monster.AI.CanReachAttack(FLAMME, fighter.CellID)):
  54.         monster.AI.CastMax(FLAMME, fighter.CellID)
  55.         pass
  56.     monster.AI.CastOnMe(INVISIBILITE)
  57.     pass
  58.  
  59. def phase1(monster):
  60.     if(monster.AI.HasTag(INVULNERABLE_TAG)):
  61.         monster.AI.SetTag(INVULNERABLE_TAG, str(int(monster.AI.GetTag(INVULNERABLE_TAG)) - 1))
  62.         if(int(monster.AI.GetTag(INVULNERABLE_TAG)) == 0):
  63.             monster.AI.DeleteTag(INVULNERABLE_TAG)
  64.             monster.AI.FightMessage("<b>@name@</b> est desormais <b>Vulnerable</b>")
  65.             monster.AI.SetApparance(10, 999)
  66.             monster.AI.ResetCooldowns()
  67.             pass
  68.         else:
  69.             monster.AI.FightMessage("<b>@name@</b> est <b>" + INVULNERABLE_TAG + "</b> pour encore <b>" + monster.AI.GetTag(INVULNERABLE_TAG) + "</b> tour(s)")
  70.             pass
  71.         pass
  72.     pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement