//TOURIST
//-------------------------------------------
//Level       Abillity
//1			Use Technological Items, Use Poison, Backstab
//2			Mobility
//3			n/a
//4			n/a
//5			Improvised Weapons
//6			n/a
//7     n/a
//8     Cartography
//9     n/a
//10    n/a
//11    Lucky
//12    n/a
//13    n/a
//14    Backpacker
//15    n/a
//-----------------------------------------------------------------------------
//Carography skill
tmpx = selflevel
tmpy = 6            //Need level 8
IfXIsMoreThanY
  ShowMap
  ShowYouAreHere
  
//-------------------------------------------
//To Silly To Die skill
IfKilled
  tmpx = selflevel
  tmpy = 8            //Need level 10
  IfXIsMoreThanY
    tmpx = rand % 100
    tmpy = selflevel          //% chance equal to level
    IfXIsLessThanY
      SetTargetToSelf
      RespawnTarget
      tmpargument = 1
      SendMessage
      tmpargument = 11
      PlayFullSound
      
//-----------------------------------------------------------------------------
//Invoke Lucky skill if enough xp gained
SetTargetToSelf
tmpx = selflevel
tmpy = 7                //Need level 9
IfXIsMoreThanY
  tmpargument = 0
  IfContentIs
    SetOwnerToTarget
    EnchantTarget		//Give the special bonus
    tmpargument = 1
    SetContent

//-----------------------------------------------------------------------------
//Improvised weapons skill
tmpx = selflevel
tmpy = 3            //Need level 5
IfXIsMoreThanY
  IfScoredAHit
    SetTargetToLastItemUsed
      tmpdistance = 0
      tmpargument = [PLUN]      //Toilet plunger
      IfTargetHasID
        tmpdistance = 1
      tmpargument = [SHOV]      //Shovel
      IfTargetHasID
        tmpdistance = 1
      tmpargument = [TORC]      //Torch
      IfTargetHasID
        tmpdistance = 1
      tmpargument = [CROW]      //Crowbar
      IfTargetHasID
        tmpdistance = 1
        
      //Check if we used a valid weapon
      tmpturn = 0
      IfDistanceIsMoreThanTurn
        SetTargetToWhoeverWasHit
        tmpargument = 60*selflevel    // 0.25 damage bonus per level
        DamageTarget

//-----------------------------------------------------------------------------
//Auto jump over corpses (Mobility skill)
tmpx = selflevel
tmpy = 1          //Need level 2
IfXIsLessThanY
  DoNothing
Else
  IfBumped
    SetTargetToWhoeverBumped
    IfTargetIsAlive
      DoNothing
    Else
      tmpargument = LATCHJUMP
      PressLatchButton

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


//------------------------------------------------------------------------------
// ZZ> Yell at player
IfTooMuchBaggage
  tmpargument = 7
  SendMessageNear
  tmpargument = 7
  PlaySound
  tmpargument = 50
  SetReloadTime

//------------------------------------------------------------------------------
// ZZ> Scream and shout
IfUsed
  tmpargument = rand & 1 + 8
  PlaySound

//------------------------------------------------------------------------------
// ZZ> Handle being bored by cheering or sneezing
IfBored
  tmpargument = ACTIONMC
  DoAction
    tmpargument = 6
    SendMessageNear
    tmpargument = 10
    PlaySound

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

  // Drop goodies
  tmpx = selflevel
  tmpy = 13           //Level 14 and above is immune to this
  IfXIsLessThanY
    tmpargument = 1+selflevel*selflevel*100
    DropMoney
    DropKeys

  // Make the character body
  tmpargument = 45
  SetBumpHeight

   //Redo the Lucky skill when respawned
  UndoEnchant
  tmpargument = 0
  SetContent

//------------------------------------------------------------------------------
// ZZ> For helper AIs
IfLeaderKilled
  BecomeLeader

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

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