//--------------------------------------------------------------------------------
//Check if the attacker batters away your shield
//Base chance +2% per holder strength -4% per attacker
IfHeld
  SetTargetToWhoeverIsHolding       //Folks with the shield profiency have always 100%
  tmpargument = [SOLD]
  IfTargetHasID
    IfHolderBlocked
      tmpargument = targetreloadtime + 40
      SetTargetReloadTime
  Else
    IfHolderBlocked
      tmpx = targetstr > 6
      SetTargetToWhoeverIsHolding
      tmpy = targetstr > 7
      tmpx = rand % 100 + tmpx 
      tmpy = 70 + tmpy            //70% block rate
      IfXIsMoreThanY
        tmpargument = 40    //0.80 seconds
        SetReloadTime       //is how long it takes to raise shield again
        tmpargument = 1
        PlaySound           //Play clong
      Else
        IfHolderBlocked      //So that the target becomes the attacker again
          tmpargument = targetreloadtime + 40
          SetTargetReloadTime

//--------------------------------------------------------------------------------
//This function makes an item fall to the floor when spawned
IfSpawned
  tmpargument = ACTIONJB
  DoAction
  KeepAction
  MakeCrushValid

//--------------------------------------------------------------------------------
//Say oops, that's kursed
IfNotDropped
  SetTargetToWhoeverIsHolding
  tmpargument = 2
  SendMessageNear
//IfNotPutAway
//  tmpargument = 3         //No longer needed, this is handled by the sourcecode now...
//  SendMessageNear
  
//--------------------------------------------------------------------------------
//Crushed in a closed passage
IfCrushed
  tmpx = selfx
  tmpy = selfy
  tmpdistance = selfz
  tmpargument = 0
  SpawnExactParticle
  SpawnExactParticle
  SpawnExactParticle
  SpawnExactParticle
  GoPoof
  tmpargument = 1
  SendMessageNear

//--------------------------------------------------------------------------------
//Make it lie on floor
IfDropped				
  KeepAction

//--------------------------------------------------------------------------------
//Tell them what they've won...
IfGrabbed				
  SetTargetToWhoeverIsHolding
  IfTargetIsAPlayer
    tmpargument = 0
    SendMessageNear

//--------------------------------------------------------------------------------
//Make a sound
IfHitGround				
  tmpargument = 0
  PlaySound  

//--------------------------------------------------------------------------------
End					// All done
//--------------------------------------------------------------------------------
