//============================================================================= // TriggerInvCheck. //============================================================================= class TriggerInvCheck expands Trigger; //This Trigger will only trigger if the triggering player has the item in its inventory. var() class CheckInventory; var bool bItemFound; function Touch( actor Other ) { if ( IsRelevant( Other ) ) { if ( Other.IsA('PlayerPawn')) { CheckItem(PlayerPawn(Other), CheckInventory); } if (!bItemFound) return; if ( ReTriggerDelay > 0 ) { if ( Level.TimeSeconds - TriggerTime < ReTriggerDelay ) return; TriggerTime = Level.TimeSeconds; } // Broadcast the Trigger message to all matching actors. TriggerEvent(Event,Other,Other.Instigator); if ( Other.IsA('Pawn') && (Pawn(Other).SpecialGoal == self) ) Pawn(Other).SpecialGoal = None; if ( Len(Message)>0 ) // Send a string message to the toucher. Other.Instigator.ClientMessage( Message ); if ( bTriggerOnceOnly ) // Ignore future touches. SetCollision(False); else if ( RepeatTriggerTime > 0 ) SetTimer(RepeatTriggerTime, false); } } function CheckItem(Pawn Other, class InventoryName) { local Pickup A; A = Pickup(Other.FindInventoryType(InventoryName)); if ( A != None ) { bItemFound=true; } else { bItemFound=false; } } defaultproperties { }