UE2:WeaponFire (UT2004)

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 10:11, 23 July 2008 by imported>Wormbo (added native code snippet released by Epic Games)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
UT2004 Object >> WeaponFire
Package: 
Engine

Abstract base class for weapon fire mode implementations.

Properties

Property group 'WeaponFire'

See WeaponFire property group WeaponFire.

Internal variables

bInstantStop

Type: bool


bIsFiring

Type: bool


bNowWaiting

Type: bool


bServerDelayStartFire

Type: bool


bServerDelayStopFire

Type: bool


bTimerLoop

Type: bool


FireCount

Type: int


Instigator

Type: Pawn


Level

Type: LevelInfo


NextFireTime

Type: float


NextTimerPop

Type: float


Owner

Type: Actor


SavedFireProperties

Type: Actor.FireProperties


ServerStartFireTime

Type: float


TimerInterval

Type: float


TransientSoundRadius

Type: float


Default value: 400.0

TransientSoundVolume

Type: float


Default value: 0.5

Enums

ESpreadStyle

SS_None 
SS_Random 
spread is max random angle deviation
SS_Line 
spread is angle between each projectile
SS_Ring 

Functions

Native code

Fire mode updating

void UWeaponFire::ModeTick( FLOAT DeltaSeconds )
{
	guard(UWeaponFire::ModeTick);
	
	if ( !Weapon || Weapon->bDeleteMe || !Instigator || Instigator->bDeleteMe )
		return;
	
	// WeaponFire timer
	if ( TimerInterval != 0.f )
	{
		if ( NextTimerPop < Level->TimeSeconds )
		{
			eventTimer();
			if ( bTimerLoop )
				NextTimerPop = NextTimerPop + TimerInterval;
			else
				TimerInterval = 0.f;
		}
	}
	
	eventModeTick(DeltaSeconds);
	
	FLOAT CurrentTime = Weapon->Level->TimeSeconds;
	
	if ( (bIsFiring && !bFireOnRelease)
		|| ((bInstantStop || !bIsFiring) && bFireOnRelease)
		|| (HoldTime > MaxHoldTime && MaxHoldTime > 0.0f) )
	{
		if (CurrentTime > NextFireTime && (bInstantStop || !bNowWaiting) )
		{
			eventModeDoFire();
			
			if (bWaitForRelease)
				bNowWaiting = true;
		}
	}
	else if (bWaitForRelease && CurrentTime >= NextFireTime)
	{
		bNowWaiting = false;
		
		if (HoldTime == 0.0f)
			eventModeHoldFire();
		
		HoldTime += DeltaSeconds;
	}
	bInstantStop = false;
	unguard;
}

Events

ModeDoFire

event ModeDoFire ()


ModeHoldFire

event ModeHoldFire ()


ModeTick

event ModeTick (float dt)


SetInitialState

simulated event SetInitialState ()


Timer

event Timer ()


Other instance functions

See WeaponFire instance functions.