UnrealShare
Class RocketCan

source: e:\games\UnrealTournament\UnrealShare\Classes\RocketCan.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Inventory
         |
         +--Engine.Pickup
            |
            +--Engine.Ammo
               |
               +--UnrealShare.RocketCan
Direct Known Subclasses:None

class RocketCan
extends Engine.Ammo

//============================================================================= // RocketCan. //=============================================================================
Variables
 bool bOpened

States
Pickup
State Pickup Function Summary
 void Landed(vector HitNormal)
 void Touch(Actor Other)



Source Code


00001	//=============================================================================
00002	// RocketCan.
00003	//=============================================================================
00004	class RocketCan extends Ammo;
00005	
00006	#exec AUDIO IMPORT FILE="Sounds\Pickups\AMMOPUP1.WAV" NAME="AmmoSnd"       GROUP="Pickups"
00007	
00008	#exec TEXTURE IMPORT NAME=I_RocketAmmo FILE=TEXTURES\HUD\i_rcan.PCX GROUP="Icons" MIPS=OFF
00009	
00010	#exec MESH IMPORT MESH=RocketCanMesh ANIVFILE=MODELS\pshell_a.3D DATAFILE=MODELS\pshell_d.3D LODSTYLE=8 LODFRAME=9
00011	#exec MESH LODPARAMS MESH=RocketCanMesh ZDISP=500.0
00012	#exec MESH ORIGIN MESH=RocketCanMesh X=0 Y=0 Z=-15 YAW=0
00013	#exec MESH SEQUENCE MESH=RocketCanMesh SEQ=All    STARTFRAME=0  NUMFRAMES=10
00014	#exec MESH SEQUENCE MESH=RocketCanMesh SEQ=Open   STARTFRAME=0  NUMFRAMES=10
00015	#exec TEXTURE IMPORT NAME=JRocketCan1 FILE=MODELS\RocketCn.PCX GROUP="Skins"
00016	#exec MESHMAP SCALE MESHMAP=RocketCanMesh X=0.06 Y=0.06 Z=0.12
00017	#exec MESHMAP SETTEXTURE MESHMAP=RocketCanMesh NUM=1 TEXTURE=JRocketCan1 TLOD=5
00018	
00019	var bool bOpened;
00020	
00021	auto state Pickup
00022	{
00023		function Touch( Actor Other )
00024		{
00025			local Vector Dist2D;
00026	
00027			if ( bOpened )
00028			{
00029				Super.Touch(Other);
00030				return;
00031			}	
00032			if ( (Pawn(Other) == None) || !Pawn(Other).bIsPlayer )
00033				return;
00034			Dist2D = Other.Location - Location;
00035			Dist2D.Z = 0;
00036			if ( VSize(Dist2D) <= 48.0 )
00037				Super.Touch(Other);
00038			else if ( !bOpened )
00039			{
00040				SetCollisionSize(27.0, CollisionHeight);
00041				SetLocation(Location); //to force untouch
00042				bOpened = true;
00043				PlayAnim('Open', 0.1);
00044			}
00045		}
00046	
00047		function Landed(vector HitNormal)
00048		{
00049			Super.Landed(HitNormal);
00050			if ( !bOpened )
00051			{
00052				bCollideWorld = false;
00053				SetCollisionSize(172,CollisionHeight);
00054			}
00055		}
00056	}
00057	
00058	defaultproperties
00059	{
00060	     AmmoAmount=12
00061	     MaxAmmo=48
00062	     UsedInWeaponSlot(5)=1
00063	     PickupMessage="You picked up 12 Eightballs"
00064	     PickupViewMesh=LodMesh'UnrealShare.RocketCanMesh'
00065	     MaxDesireability=0.300000
00066	     PickupSound=Sound'UnrealShare.Pickups.AmmoSnd'
00067	     Icon=Texture'UnrealShare.Icons.I_RocketAmmo'
00068	     Physics=PHYS_Falling
00069	     Mesh=LodMesh'UnrealShare.RocketCanMesh'
00070	     CollisionRadius=27.000000
00071	     CollisionHeight=12.000000
00072	     bCollideActors=True
00073	}

End Source Code