rott/kf_sources/KFMod/Classes/KFGrabbable.uc
2026-07-14 20:27:09 +07:00

67 lines
1.8 KiB
Ucode

//=============================================================================
// KF Use Trigger. Now with bigger messages, and Refire delays for human users.
// This shit's used for Doors in Killing Floor.
// By: Alex
//=============================================================================
class KFGrabbable extends UseTrigger;
var bool bUsed;
var float LastMessageTimer;
var() sound PickupSound;
/*
function bool SelfTriggered()
{
return true;
} */
function UsedBy( Pawn user )
{
local Controller C;
if( !bUsed )
{
if( KFHumanPawn(user) != none )
{
For ( C=Level.ControllerList; C!=None; C=C.NextController )
{
if( KFPlayerController(C) != none )
{
KFPlayerController(C).ClientPickedup(self);
}
}
}
PlaySound( PickupSound,SLOT_Interact );
TriggerEvent(Event, self, user);
bUsed = true;
bHidden = true;
}
}
// Modded to account for...Zombies, and the Sealing (removal) of the Door Movers.
function Touch( Actor Other )
{
if( Pawn(Other)==None || Pawn(Other).Health <= 0 )
Return;
// Send a string message to the toucher.
if(PlayerController(Pawn(Other).Controller)!=none && bUsed == false)
{
if( LastMessageTimer<Level.TimeSeconds && Message!="" )
{
LastMessageTimer = Level.TimeSeconds+0.6;
if ( InStr(Message, "USE") != -1 )
{
PlayerController(Pawn(Other).Controller).ReceiveLocalizedMessage(class'KFMod.WaitingMessage', 7);
}
}
}
}
defaultproperties
{
bUsed = false
Message="Press USE to pick up Z.E.D. gun piece"
PickupSound=Sound'KF_InventorySnd.Ammo_GenericPickup'
RemoteRole=ROLE_SimulatedProxy
}