28 lines
647 B
Ucode
28 lines
647 B
Ucode
// Toggles weapon's flashligh on / off
|
|
// Current weapon must have flashlight attached (Single, Shotgun etc.)
|
|
|
|
class ACTION_Flashlight extends ScriptedAction;
|
|
|
|
function bool InitActionFor(ScriptedController C)
|
|
{
|
|
local KFWeapon Weapon;
|
|
|
|
if ( (C.Pawn == None) || (C.Pawn.Weapon == None) )
|
|
return false;
|
|
|
|
Weapon = KFWeapon(C.Pawn.Weapon);
|
|
if ( Weapon == none || !Weapon.bTorchEnabled ) {
|
|
log(C.Pawn.Tag @ "trying to use flashlight on" @ C.Pawn.Weapon);
|
|
return false;
|
|
}
|
|
|
|
Weapon.LightFire();
|
|
Weapon.AdjustLightGraphic();
|
|
return false;
|
|
}
|
|
|
|
defaultproperties
|
|
{
|
|
ActionString="toggle weapon's flashlight"
|
|
}
|