//THIS CREDIT CARD JUST EXIST IN THE STARTER MODULE
//IT NEVER SNAPS SO THAT IT MAKES SURE THE STARTER MODULE IS
//ALWAYS BEATABLE AND TURNS INTO A NORMAL CREDIT CARD

//ZZ> This function makes an item fall to the floor when spawned
IfSpawned				//
  tmpargument = ACTIONJB		  //
  DoAction				  //
  KeepAction				  //
  
  //Reset difficulity counter
  tmpargument = 0
  SetContent

IfGrabbed
  SetTargetToWhoeverIsHolding		  //
  IfTargetIsAPlayer			  //
    tmpargument = 0			  //
    SendMessageNear			  //

IfUsed
  tmpargument = 50                //1 second cooldown
  SetReloadTime
  
  //Set default message
  tmpargument = 2
  SetState
    
  SetTargetToWhoeverIsHolding
  tmpargument = [TOUR]
  IfTargetHasID
    tmpargument = 1       //Tourists get special message
    SetState
        
    tmpargument = [LOCK]
    tmpdistance = 14                    // Items, Friends, and Enemies
    SetTargetToWideBlahID
      tmpx = targetdistance
      tmpy = 128
      IfXIsLessThanY
        IfFacingTarget
          GetTargetState
          tmpx = tmpargument
          tmpy = 0
          IfXIsEqualToY
            SetOldTarget
            SetTargetToWhoeverIsHolding
            tmpargument = ACTIONMG
            TargetDoAction
            
            //So that message does not appear
            tmpargument = 1
            SetState
            
            tmpx = targetdex > 7   //2% per dex
            tmpy = rand % 100 + selfcontent       //Gets harder each time failed
            //tmpargument = 6
            //SendMessage             //Uncomment for see the actual % results ingame
            IfXIsMoreThanY
              
              //Award some xp
              tmpargument = 20
              tmpdistance = EXPROLEPLAY
              GiveExperienceToTarget
              
              //Open it up!
              SetTargetToOldTarget
              tmpargument = 491 // The special unlock order
              OrderTarget
              
              //This turns it into a real breakable credit card
              SetTargetToSelf
              tmpargument = 51
              ChangeTargetClass
              
              //Tell it was a success!
              tmpargument = 1
              PlaySound
              tmpargument = 3       //Set message
              SetState
              
            Else
              tmpargument = 4     //Need more practice
              SetState            //Set message
              tmpargument = 2
              PlaySound
              
  //Display whatever message we have prepeared
  tmpargument = selfstate
  SendMessage

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

End					// All done
