//MONK abilities
//Stunning fist
//Unarmed attack damage
//Flaming fist?                 TODO
//Monk's Curse?                 TODO
//Damage resistance
//Deflect enemy missiles        TODO (parry unarmed)
//Movement speed
//EVIL resistance
//Magic Resistance at level 10  TODO

//-----------------------------------------------------------------------------
//Speed increases with level
tmpargument = selflevel * 5 + 100
SetSpeedPercent

//-----------------------------------------------------------------------------
//Unarmed damage depending on level
IfUsed

  //Level 15+ damage
  tmpx = selflevel
  tmpy = 14
  IfXIsEqualToY
    tmpargument = 0
    
  //Level 12 damage
  Else
    tmpx = selflevel
    tmpy = 11
    IfXIsMoreThanY
      tmpargument = 1
      
  //Level 9 damage
    Else
      tmpx = selflevel
      tmpy = 8
      IfXIsEqualToY
        tmpargument = 2
        
  //Level 6 damage
      Else
        tmpx = selflevel
        tmpy = 5
        IfXIsEqualToY
          tmpargument = 3
          
  //Level 3 damage
        Else
          tmpx = selflevel
          tmpy = 2
          IfXIsEqualToY
            tmpargument = 4
          
  //Level 1 damage
          Else
            tmpargument = 5

//-----------------------------------------------------------------------------
//Stunning attack
IfUnarmed
  IfScoredAHit
    tmpx = selflevel
    tmpy = rand % 20
    IfXIsMoreThanY
      SetTargetToWhoeverAttacked
      tmpargument = selflevel > 2 + 1       //1 second + 1 for every 4 levels
      DazeTarget
      GrogTarget
      
      //Message             //TODO: sound effect!
      tmpargument = 6
      tmpdistance = 3
      tmpturn = BLUE
      DrawBillboard

//-----------------------------------------------------------------------------
//Damage resistance by level
tmpargument = selflevel * 50
SetDamageThreshold

//-----------------------------------------------------------------------------
//Gong sound
IfCleanedUp
  tmpargument = 2
  PlayFullSound

//------------------------------------------------------------------------------
//Scream and shout
IfUsed
  tmpargument = 10      //TODO add variation
  PlaySound

//------------------------------------------------------------------------------
//Handle being bored by cheering or sneezing
IfBored
  tmpargument = rand & 1 + 8
  PlaySound
  SendMessageNear
  tmpargument = ACTIONMC
  DoAction

//------------------------------------------------------------------------------
//Handle death by sending a message and other stuff
IfKilled
  tmpargument = 6
  PlaySound
  tmpargument = 3
  IfArmorIs
    tmpargument = MESSAGECOSTUME
  Else
    tmpargument = MESSAGEDEATH
  IfTargetIsOnSameTeam
    tmpargument = MESSAGEFRAG
    IfTargetIsSelf
      tmpargument = MESSAGEACCIDENT
  SendMessage

  // Drop goodies
  tmpargument = 1+selflevel*selflevel*100
  DropMoney
  DropKeys

  // Make the character body
  tmpargument = 45
  SetBumpHeight

//------------------------------------------------------------------------------
//For helper AIs
IfLeaderKilled
  BecomeLeader

//------------------------------------------------------------------------------
//Handle being attacked by blocking or countering or running away
IfAttacked
  // Pick either 0 or 7, Parry or Combat
  SetTargetToWhoeverAttacked
  IfTargetIsOnSameTeam
    tmpargument = 3
    PlaySound
    tmpargument = MESSAGEOUCH
    SendMessageNear
  Else
    tmpargument = rand & 1 + 4
    PlaySound

//------------------------------------------------------------------------------
//Handle having too much in inventory
IfTooMuchBaggage
  tmpargument = 1
  SendMessageNear
  tmpargument = 7
  PlaySound
  tmpargument = 50
  SetReloadTime

//------------------------------------------------------------------------------
End
//------------------------------------------------------------------------------
