24 lines
619 B
Ucode
24 lines
619 B
Ucode
// Same as ACTION_IfMonsterHasEnemy, but can be used with any Pawn (e.g. NPC)
|
|
class ACTION_IfHasEnemy extends ScriptedAction;
|
|
|
|
var(Action) float MaxDistance;
|
|
|
|
function ProceedToNextAction( ScriptedController C )
|
|
{
|
|
C.ActionNum += 1;
|
|
|
|
if ( C.Enemy != none && (C.Enemy.bDeleteMe || C.Enemy.Health <= 0) )
|
|
C.Enemy = none;
|
|
if ( C.Enemy == None || (MaxDistance > 0 && vsize(C.Pawn.Location - C.Enemy.Location) > MaxDistance + C.Enemy.CollisionRadius) )
|
|
ProceedToSectionEnd( C );
|
|
}
|
|
|
|
function bool StartsSection()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
defaultproperties
|
|
{
|
|
}
|