Botpack
Class UT_JumpBoots

source: e:\games\UnrealTournament\Botpack\Classes\UT_Jumpboots.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Inventory
         |
         +--Engine.Pickup
            |
            +--Botpack.TournamentPickup
               |
               +--Botpack.UT_JumpBoots
Direct Known Subclasses:None

class UT_JumpBoots
extends Botpack.TournamentPickup

//============================================================================= // UT_jumpBoots //=============================================================================
Variables
 int TimeCharge

States
DeActivated, Activated

Function Summary
 void OwnerJumped()
 void PickupFunction(Pawn Other)
 void ResetOwner()
 void Timer()


State DeActivated Function Summary


State Activated Function Summary
 void endstate()



Source Code


00001	//=============================================================================
00002	// UT_jumpBoots
00003	//=============================================================================
00004	class UT_JumpBoots extends TournamentPickup;
00005	
00006	#exec AUDIO IMPORT FILE="..\UnrealShare\Sounds\Pickups\BOOTSA1.WAV" NAME="BootSnd" GROUP="Pickups"
00007	
00008	#exec TEXTURE IMPORT NAME=I_Boots FILE=TEXTURES\HUD\i_Boots.PCX GROUP="Icons" MIPS=OFF
00009	
00010	#exec MESH IMPORT MESH=jboot ANIVFILE=MODELS\boots_a.3D DATAFILE=MODELS\boots_d.3D
00011	#exec MESH ORIGIN MESH=jboot X=0 Y=0 Z=-70 YAW=64
00012	#exec MESH SEQUENCE MESH=jboot SEQ=All    STARTFRAME=0   NUMFRAMES=1
00013	#exec MESH SEQUENCE MESH=jboot SEQ=Still  STARTFRAME=0   NUMFRAMES=1
00014	#exec TEXTURE IMPORT NAME=Jlboot2 FILE=MODELS\boots.PCX GROUP=Skins LODSET=2
00015	#exec MESHMAP SCALE MESHMAP=jboot X=0.045 Y=0.045 Z=0.09
00016	#exec MESHMAP SETTEXTURE MESHMAP=jboot NUM=1 TEXTURE=Jlboot2
00017	
00018	var int TimeCharge;
00019	
00020	function PickupFunction(Pawn Other)
00021	{
00022		TimeCharge = 0;
00023		SetTimer(1.0, True);
00024	}
00025	
00026	function ResetOwner()
00027	{
00028		local pawn P;
00029	
00030		P = Pawn(Owner);
00031		P.JumpZ = P.Default.JumpZ * Level.Game.PlayerJumpZScaling();
00032		if ( Level.Game.IsA('DeathMatchPlus') )
00033			P.AirControl = DeathMatchPlus(Level.Game).AirControl;
00034		else
00035			P.AirControl = P.Default.AirControl;
00036		P.bCountJumps = False;
00037	}
00038	
00039	function OwnerJumped()
00040	{
00041		if ( !Pawn(Owner).bIsWalking )
00042		{
00043			TimeCharge=0;
00044			if ( Charge <= 0 ) 
00045			{
00046				if ( Owner != None )
00047				{
00048					Owner.PlaySound(DeActivateSound);
00049					ResetOwner();						
00050				}		
00051				UsedUp();
00052			}
00053			else
00054				Owner.PlaySound(sound'BootJmp');						
00055			Charge -= 1;
00056		}
00057		if( Inventory != None )
00058			Inventory.OwnerJumped();
00059	
00060	}
00061	
00062	function Timer()
00063	{
00064		if ( Charge <= 0 ) 
00065		{
00066			if ( Owner != None )
00067			{
00068				if ( Owner.Physics == PHYS_Falling )
00069				{
00070					SetTimer(0.3, true);
00071					return;
00072				}
00073				Owner.PlaySound(DeActivateSound);
00074				ResetOwner();						
00075			}		
00076			UsedUp();
00077			return;
00078		}
00079	
00080		if ( !Pawn(Owner).bAutoActivate )
00081		{	
00082			TimeCharge++;
00083			if (TimeCharge>20)
00084			{
00085				OwnerJumped();
00086				TimeCharge = 0;
00087			}
00088		}
00089	}
00090	
00091	state Activated
00092	{
00093		function endstate()
00094		{
00095			ResetOwner();
00096			bActive = false;		
00097		}
00098	Begin:
00099		Pawn(Owner).bCountJumps = True;
00100		Pawn(Owner).AirControl = 1.0;
00101		Pawn(Owner).JumpZ = Pawn(Owner).Default.JumpZ * 3;
00102		Owner.PlaySound(ActivateSound);		
00103	}
00104	
00105	state DeActivated
00106	{
00107	Begin:		
00108	}
00109	
00110	defaultproperties
00111	{
00112	     ExpireMessage="The AntiGrav Boots have drained."
00113	     bAutoActivate=True
00114	     bActivatable=True
00115	     bDisplayableInv=True
00116	     PickupMessage="You picked up the AntiGrav boots."
00117	     ItemName="AntiGrav Boots"
00118	     RespawnTime=30.000000
00119	     PickupViewMesh=LodMesh'Botpack.jboot'
00120	     Charge=3
00121	     MaxDesireability=0.500000
00122	     PickupSound=Sound'UnrealShare.Pickups.GenPickSnd'
00123	     ActivateSound=Sound'Botpack.Pickups.BootSnd'
00124	     Icon=Texture'UnrealI.Icons.I_Boots'
00125	     RemoteRole=ROLE_DumbProxy
00126	     Mesh=LodMesh'Botpack.jboot'
00127	     AmbientGlow=64
00128	     CollisionRadius=22.000000
00129	     CollisionHeight=14.000000
00130	}

End Source Code