Core.Object | +--Engine.Actor | +--Engine.Pickup | +--XIII.XIIIPickup | +--XIII.PhotoPick
Texture
PhotographyMat
Inventory
SpawnCopy(Pawn Other)
//_____________________________________________________________________________ // Either give this inventory to player Other, or spawn a copy // and give it to the player Other, setting up original to be respawned. //
bool
ValidTouch(Actor Other)
00001 //----------------------------------------------------------- 00002 // 00003 //----------------------------------------------------------- 00004 class PhotoPick extends XIIIPickup; 00005 00006 var() Texture PhotographyMat; 00007 00008 //_____________________________________________________________________________ 00009 // Either give this inventory to player Other, or spawn a copy 00010 // and give it to the player Other, setting up original to be respawned. 00011 // 00012 function inventory SpawnCopy( pawn Other ) 00013 { 00014 local inventory Copy; 00015 00016 if ( Inventory != None ) 00017 { 00018 Copy = Inventory; 00019 Inventory = None; 00020 } 00021 else 00022 Copy = spawn(InventoryType,Other,,,rot(0,0,0)); 00023 00024 Copy.GiveTo( Other ); 00025 // ELR for this class modify the copy mesh 00026 // Copy.Mesh = FpsMeshToUse; 00027 00028 if( Level.Game.ShouldRespawn(self) ) 00029 StartSleeping(); 00030 else 00031 { 00032 Photo(Copy).PhotoMat = PhotographyMat; 00033 Copy.Event = Event; 00034 Destroy(); 00035 } 00036 return Copy; 00037 } 00038 00039 //_____________________________________________________________________________ 00040 Auto State Pickup 00041 { 00042 function bool ValidTouch( actor Other ) 00043 { 00044 // make sure its a live player 00045 if ( !Pawn(Other).Controller.bIsPlayer || !Pawn(Other).bCanPickupInventory || (Pawn(Other).Health <= 0) ) 00046 return false; 00047 // make sure not touching through wall 00048 if ( !FastTrace(Other.Location+Pawn(Other).EyeHeight*vect(0,0,1), Location) ) 00049 return false; 00050 if ( bCauseEventOnPick ) 00051 TriggerEvent(Event, self, Pawn(Other)); 00052 return true; 00053 } 00054 } 00055 00056 // DrawType=DT_Mesh 00057 // Mesh=VertMesh'XIIIDeco.photokimM' 00058 00059 00060 defaultproperties 00061 { 00062 InventoryType=Class'XIII.Photo' 00063 PickupMessage="PHOTOGRAPH" 00064 PickupSound=Sound'XIIIsound.Items.GiletPick1' 00065 StaticMesh=StaticMesh'MeshObjetsPickup.photokim' 00066 MessageClass=Class'XIII.XIIIImportantItemMessage' 00067 }