mirror of
https://github.com/spiffcode/hostile-takeover.git
synced 2026-04-25 04:05:08 -06:00
virtual GetIdleCountdown()
GetIdleCountdown() is now virtual as art2432 needs certain units to have different idle countdowns
This commit is contained in:
parent
278aecfb70
commit
aa342e4b7f
@ -100,6 +100,11 @@ void LRInfantryGob::Idle()
|
||||
}
|
||||
}
|
||||
|
||||
int LRInfantryGob::GetIdleCountdown()
|
||||
{
|
||||
return (GetRandom() % 100) + 50; // somewhere between 8 & 12 seconds
|
||||
}
|
||||
|
||||
int LRInfantryGob::ProcessStateMachineMessage(State st, Message *pmsg)
|
||||
{
|
||||
BeginStateMachine
|
||||
|
||||
@ -50,8 +50,6 @@ int g_mpDirToDy[8] = { -1, -1, 0, 1, 1, 1, 0, -1 };
|
||||
AnimationData *g_panidMoveTarget;
|
||||
static AnimationData *s_panidVehicleExplosion;
|
||||
|
||||
#define GetIdleCountdown() ((GetRandom() % 50) + 50) // somewhere between 4 & 8 seconds
|
||||
|
||||
const int kcFireCountdown = 6; // 6 updates (~.5 secs)
|
||||
|
||||
Path *MobileUnitGob::s_apathCached[kcPathsCache];
|
||||
@ -723,6 +721,11 @@ bool MobileUnitGob::IsAttackPointWithinFiringRangeOfTarget(UnitGob *puntTarget)
|
||||
return IsTargetWithinRange(&wptAttack, puntTarget, m_pmuntc->tcFiringRange);
|
||||
}
|
||||
|
||||
int MobileUnitGob::GetIdleCountdown()
|
||||
{
|
||||
return (GetRandom() % 50) + 50; // somewhere between 4 & 8 seconds
|
||||
}
|
||||
|
||||
// TUNE:
|
||||
|
||||
const TCoord ktcVicinity = 5;
|
||||
|
||||
@ -99,6 +99,11 @@ void SRInfantryGob::Idle()
|
||||
}
|
||||
}
|
||||
|
||||
int SRInfantryGob::GetIdleCountdown()
|
||||
{
|
||||
return (GetRandom() % 100) + 50; // somewhere between 8 & 12 seconds
|
||||
}
|
||||
|
||||
int SRInfantryGob::ProcessStateMachineMessage(State st, Message *pmsg)
|
||||
{
|
||||
BeginStateMachine
|
||||
|
||||
10
game/ht.h
10
game/ht.h
@ -6691,6 +6691,8 @@ public:
|
||||
bool IsMobile() secUnitGob;
|
||||
bool IsStandingOnActivator() secUnitGob;
|
||||
|
||||
virtual int GetIdleCountdown() secUnitGob;
|
||||
|
||||
bool HasAttackTarget() {
|
||||
return m_gidTarget != kgidNull;
|
||||
}
|
||||
@ -7024,6 +7026,10 @@ public:
|
||||
virtual bool Fire(UnitGob *puntTarget, WCoord wx, WCoord wy, WCoord wdx, WCoord wdy) secInfantryGob;
|
||||
virtual void Idle() secInfantryGob;
|
||||
|
||||
// MobileUnitGob overrides
|
||||
|
||||
virtual int GetIdleCountdown() secInfantryGob;
|
||||
|
||||
// StateMachine methods
|
||||
|
||||
virtual int ProcessStateMachineMessage(State st, Message *pmsg) secInfantryGob;
|
||||
@ -7044,6 +7050,10 @@ public:
|
||||
virtual bool Fire(UnitGob *puntTarget, WCoord wx, WCoord wy, WCoord wdx, WCoord wdy) secInfantryGob;
|
||||
virtual void Idle() secInfantryGob;
|
||||
|
||||
// MobileUnitGob overrides
|
||||
|
||||
virtual int GetIdleCountdown() secInfantryGob;
|
||||
|
||||
// StateMachine methods
|
||||
|
||||
virtual int ProcessStateMachineMessage(State st, Message *pmsg) secInfantryGob;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user