//-----------------------------------------------------------------------------------
//Egoboo only supports 4 different skins, so I use a trick here to make a fifth
IfSpawned
  tmpargument = 0
  IfContentIs
    tmpargument = 2		//This is blue (water palace)
    SetRedShift
    SetGreenShift

  //Make sure it's down
  tmpargument = ACTIONMJ		    
  DoAction				    
    KeepAction			      // Make it stay on last frame
    tmpargument = 30			      
    SetBumpHeight	

  //Content decides which type button it is and which spork
  GetContent		//0 is water, 1 is sand, 2 is ash,
  SetState		//3 is shadow, while 4 is Ice


//-----------------------------------------------------------------------------------
//This function makes the button open the passage
tmpx = 20				// Threshold weight
tmpy = weight				// Weight of characters on top
IfXIsLessThanY				// Open it
  SetTargetToWhoeverBumped		  

  IfStateIs0
    tmpargument = [SPOW]	//Water spork
  IfStateIs1
    tmpargument = [SPOS]	//Sand
  IfStateIs2
    tmpargument = [SPOA]	//Ash
  IfStateIs3
    tmpargument = [SPOD]	//Shadow
  IfStateIs4
    tmpargument = [SPOI]	//Ice

  IfTargetCanOpenStuff
    CostTargetItemID			  // Check for Spork type
      tmpargument = [SPOR]
      IssueOrder
      tmpargument = 10
      tmpdistance = EXPSECRET
      GiveExperienceToTarget
      tmpargument = 5			      
      SendMessageNear				//Tell them it's in place
      tmpargument = ACTIONMG		    
      DoAction				    		      
      KeepAction			      // Make it stay on last frame
      tmpargument = 0			      
      SetBumpHeight
      tmpargument = 55			//Spawn a fake spork
      tmpx = selfx
      tmpy = selfy
      tmpdistance = selfz
      SpawnExactCharacterXYZ      		      	  
      tmpargument = selfstate		//Set the skin for the spawned spork
      SetChildState	
      tmpdistance = selfz + 50		//Do some shiny effects
      tmpx = selfx
      tmpy = selfy
      SpawnExactParticle
      SpawnExactParticle
      SpawnExactParticle
      PlaySound
    Else
      IfTimeOut				//Tell what is missing
        tmpargument = selfstate
        SendMessageNear
        tmpargument = 100
        SetTime

End					// Finished with this character
