//This function makes an item fall to the floor when spawned
IfSpawned				//
  tmpargument = ACTIONJB		  //
  DoAction				  //
  KeepAction				  //
  MakeCrushValid
  
IfCrushed
  tmpx = selfx
  tmpy = selfy
  tmpdistance = selfz
  tmpargument = 15
  SpawnExactParticle
  SpawnExactParticle
  SpawnExactParticle
  SpawnExactParticle
  GoPoof
  tmpargument = 1
  SendMessageNear
  
IfDropped				// Make it lie on floor
  KeepAction				  //
  tmpargument = 3			  //
  PlaySound				  //
  
IfGrabbed				// Tell them what they've won...
  SetTargetToWhoeverIsHolding		  //
  IfTargetIsAPlayer			  //
    tmpargument = 0			  //
    SendMessageNear			  //
    
IfHitGround				// Make a sound
  tmpargument = 1			  //
  PlaySound				  //
  
IfNotDropped
  SetTargetToWhoeverIsHolding
  tmpargument = 2
  SendMessageNear
  
IfTakenOut
  tmpargument = 2
  PlaySound
  SetTargetToWhoeverIsHolding
  IfTargetIsAPlayer
    tmpargument = 4
    SendMessageNear
    
//IfNotPutAway
//  SetTargetToWhoeverIsHolding
//  tmpargument = 3         //No longer needed, this is handled by the sourcecode now...
//  SendMessageNear

//Automatically attack closest lifeform  
IfTimeOut

  tmpargument = rand & 15 + 20
  SetTime
  
  SetTargetToNearestLifeform
    tmpx = targetdistance
    tmpy = 150
    IfXIsLessThanY
      SetTargetToWhoeverIsHolding
        IfHeldInLeftHand
          tmpargument = ACTIONTA		//Thrust left
        Else
          tmpargument = ACTIONTC		//Thrust right
        TargetDoAction
  
End					// All done
