XIII
Class XIIIDecoPickup

source: C:\XIII\XIII\Classes\XIIIDecoPickup.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Pickup
         |
         +--XIII.XIIIDecoPickup
Direct Known Subclasses:AshTrayDecoPick, BarSitDecoPick, BouteilleDeco, BrikDecoPick, BroomDecoPick, ChaiseDeco, CueDecoPick, DartDecoPick, GlassShardDeco, PhoneDecoPick, ShovelSandDeco, ShovelSnowDeco, WBallDecoPick

class XIIIDecoPickup
extends Engine.Pickup

//----------------------------------------------------------- // //-----------------------------------------------------------
Variables
 class DestroyedSFX
 sound hExplo

States
Pickup
State Pickup Function Summary
 bool ValidTouch(Actor Other)
     
    /* ValidTouch()
    Validate touch (if valid return true to let other pick me up and trigger event).
    */



Source Code


00001	//-----------------------------------------------------------
00002	//
00003	//-----------------------------------------------------------
00004	class XIIIDecoPickup extends Pickup
00005	  abstract;
00006	
00007	var class<Emitter> DestroyedSFX;
00008	var sound hExplo;
00009	
00010	//_____________________________________________________________________________
00011	event ParseDynamicLoading(LevelInfo MyLI)
00012	{
00013	    Log("ParseDynamicLoading Actor="$self);
00014	    class<Weapon>(default.InventoryType).Static.StaticParseDynamicLoading(MyLI);
00015	//    MyLI.ForcedMeshes[MyLI.ForcedMeshes.Length] = mesh(DynamicLoadObject(class<XIIIWeapon>(default.InventoryType).default.MeshName, class'mesh'));
00016	}
00017	
00018	//_____________________________________________________________________________
00019	event Landed(Vector HitNormal)
00020	{
00021	    Setcollision(true,true,true);
00022	    GotoState('Pickup');
00023	}
00024	
00025	//_____________________________________________________________________________
00026	function TakeDamage( int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType)
00027	{
00028	//    Log("Spawning "$DestroyedSFX);
00029	    if ( DestroyedSFX != none )
00030	      Spawn(DestroyedSFX, self,,location);
00031	    PlaySound(hExplo,0,1,0);
00032	    Destroy();
00033	}
00034	
00035	//_____________________________________________________________________________
00036	// ELR don't pick upon touch any of these (sub) classes
00037	auto state Pickup
00038	{
00039	    /* ValidTouch()
00040	    Validate touch (if valid return true to let other pick me up and trigger event).
00041	    */
00042	    function bool ValidTouch( actor Other )
00043	    {
00044	      // make sure its a live player
00045	      if ( (Pawn(Other) == None) || !Pawn(Other).bCanPickupInventory || (Pawn(Other).Health <= 0) )
00046	        return false;
00047	
00048	      // make sure not touching through wall
00049	      // ELR take EyeHeight into account
00050	      if ( !FastTrace(Other.Location+Pawn(Other).EyeHeight*vect(0,0,1), Location) )
00051	        return false;
00052	
00053	      // Only pick this if controller is picking up
00054	      if ( !XIIIPlayerController(Pawn(Other).Controller).bPickingUp || (XIIIPlayerController(Pawn(Other).Controller).MyInteraction.TargetActor != self) )
00055	        return false;
00056	
00057	      // make sure game will let player pick me up
00058	      if( Level.Game.PickupQuery(Pawn(Other), self) )
00059	      {
00060	        TriggerEvent(Event, self, Pawn(Other));
00061	        return true;
00062	      }
00063	      return false;
00064	    }
00065	}
00066	
00067	
00068	defaultproperties
00069	{
00070	     DestroyedSFX=Class'XIII.DecoThrowShardImpactEmitter'
00071	     PickupMessage=""
00072	     bBlockActors=True
00073	     bBlockPlayers=True
00074	     bCanShootThroughWithRayCastingWeapon=False
00075	     bCanShootThroughWithProjectileWeapon=False
00076	     DrawType=DT_StaticMesh
00077	     MessageClass=Class'XIII.XIIIPickupMessage'
00078	}

End Source Code