UFO: Alien Invasion
|
A table with all the relations between all shooters and all their targets. More...
Public Member Functions | |
void | init () |
Initialize the reaction fire table for all entities. More... | |
void | add (const Edict *shooter, const Edict *target, const int tusForShot) |
Add a reaction fire target for the given shooter. More... | |
void | remove (const Edict *shooter, const Edict *target) |
Remove a reaction fire target for the given shooter. More... | |
bool | hasExpired (const Edict *shooter, const Edict *target, const int tusTarget) |
Check if the given shooter is ready to reaction fire at the given target. More... | |
int | getTriggerTUs (const Edict *shooter, const Edict *target) |
Check if the given shooter is ready to reaction fire at the given target. More... | |
void | advance (const Edict *shooter, const int tusShot) |
Increase the triggertime for the next RF shot for all targets of the shooter (after a reaction fire). More... | |
void | reset () |
Reset the target count in the reaction fire table for all entities. More... | |
void | notifyClientMove (const Edict *target, int step, bool startMove) |
void | notifyClientOnStep (const Edict *target, int step) |
void | create (const Edict *shooter) |
Create a table of reaction fire targets for the given edict. More... | |
void | destroy (const Edict *shooter) |
Destroys the table of reaction fire targets for the given edict. More... | |
void | resetTargetList (const Edict *shooter) |
void | notifyClientOnShot (const Edict *target, int step) |
void | notifyClientRFAborted (const Edict *shooter, const Edict *target, int step) |
Private Member Functions | |
ReactionFireTargetList * | find (const Edict *shooter) |
Find the given edict's table of reaction fire targets. More... | |
Private Attributes | |
ReactionFireTargetList | rfData [MAX_RF_DATA] |
A table with all the relations between all shooters and all their targets.
Definition at line 121 of file g_reaction.cpp.
Add a reaction fire target for the given shooter.
[in] | shooter | The reaction firing actor |
[in] | target | The potential reaction fire victim |
[in] | tusForShot | The TUs needed for the shot |
Definition at line 293 of file g_reaction.cpp.
References Com_Printf(), ReactionFireTargetList::count, find(), G_EventReactionFireAddTarget(), G_IsAlien, G_IsCivilian, i, MAX_RF_TARGETS, Edict::moveinfo, Edict::number, moveinfo_s::steps, ReactionFireTarget::target, ReactionFireTargetList::targets, ReactionFireTarget::triggerTUs, and Edict::TU.
Referenced by ReactionFire::updateAllTargets().
Increase the triggertime for the next RF shot for all targets of the shooter (after a reaction fire).
[in] | shooter | The reaction firing actor |
[in] | tusShot | The TUs the shooter will need for the next shot |
Definition at line 413 of file g_reaction.cpp.
References ReactionFireTargetList::count, find(), i, ReactionFireTargetList::targets, and ReactionFireTarget::triggerTUs.
Referenced by ReactionFire::checkExecution(), and G_ReactionFirePreShot().
Create a table of reaction fire targets for the given edict.
[in] | shooter | The reaction firing actor |
Definition at line 253 of file g_reaction.cpp.
References ReactionFireTargetList::entnum, find(), Edict::getIdNum(), gi, i, MAX_RF_DATA, RF_NO_ENTNUM, and rfData.
Referenced by G_ReactionFireTargetsCreate().
Destroys the table of reaction fire targets for the given edict.
[in] | shooter | The reaction firing actor |
Definition at line 275 of file g_reaction.cpp.
References find(), gi, and ReactionFireTargetList::init().
Referenced by G_ReactionFireTargetsDestroy().
|
private |
Find the given edict's table of reaction fire targets.
[in] | shooter | The reaction firing actor |
Definition at line 237 of file g_reaction.cpp.
References ReactionFireTargetList::entnum, Edict::getIdNum(), i, MAX_RF_DATA, and rfData.
Referenced by add(), advance(), create(), destroy(), getTriggerTUs(), hasExpired(), notifyClientRFAborted(), remove(), and resetTargetList().
Check if the given shooter is ready to reaction fire at the given target.
[in] | shooter | The reaction firing actor |
[in] | target | The potential reaction fire victim |
Definition at line 364 of file g_reaction.cpp.
References ReactionFireTargetList::count, find(), i, ReactionFireTarget::target, ReactionFireTargetList::targets, and ReactionFireTarget::triggerTUs.
bool ReactionFireTargets::hasExpired | ( | const Edict * | shooter, |
const Edict * | target, | ||
const int | tusTarget | ||
) |
Check if the given shooter is ready to reaction fire at the given target.
[in] | shooter | The reaction firing actor |
[in] | target | The potential reaction fire victim |
[in] | tusTarget | The TUs the target will need for the shot, 0 for just moving |
Definition at line 389 of file g_reaction.cpp.
References ReactionFireTargetList::count, find(), i, ReactionFireTarget::target, ReactionFireTargetList::targets, ReactionFireTarget::triggerTUs, and Edict::TU.
Referenced by ReactionFire::checkExecution(), and G_ReactionFirePreShot().
Initialize the reaction fire table for all entities.
Definition at line 149 of file g_reaction.cpp.
References i, ReactionFireTargetList::init(), MAX_RF_DATA, and rfData.
Referenced by G_ReactionFireTargetsInit().
Definition at line 200 of file g_reaction.cpp.
References ReactionFireTargetList::count, ReactionFireTargetList::entnum, G_EdictsGetByNum(), G_EventReactionFireAddTarget(), G_EventReactionFireRemoveTarget(), i, MAX_RF_DATA, RF_NO_ENTNUM, rfData, ReactionFireTarget::target, ReactionFireTargetList::targets, ReactionFireTarget::triggerTUs, and Edict::TU.
Referenced by G_ReactionFireNotifyClientEndMove(), G_ReactionFireNotifyClientEndShot(), G_ReactionFireNotifyClientStartMove(), and G_ReactionFireNotifyClientStartShot().
Definition at line 183 of file g_reaction.cpp.
References ReactionFireTargetList::count, ReactionFireTargetList::entnum, G_EdictsGetByNum(), G_EventReactionFireTargetUpdate(), i, MAX_RF_DATA, MAX_ROUTE, RF_NO_ENTNUM, rfData, ReactionFireTarget::target, ReactionFireTargetList::targets, ReactionFireTarget::triggerTUs, and Edict::TU.
Referenced by ReactionFire::notifyClientOnShot().
Definition at line 166 of file g_reaction.cpp.
References ReactionFireTargetList::count, ReactionFireTargetList::entnum, G_EdictsGetByNum(), G_EventReactionFireTargetUpdate(), i, MAX_RF_DATA, RF_NO_ENTNUM, rfData, ReactionFireTarget::target, ReactionFireTargetList::targets, ReactionFireTarget::triggerTUs, and Edict::TU.
Referenced by ReactionFire::notifyClientOnStep().
void ReactionFireTargets::notifyClientRFAborted | ( | const Edict * | shooter, |
const Edict * | target, | ||
int | step | ||
) |
Definition at line 220 of file g_reaction.cpp.
References ReactionFireTargetList::count, find(), G_EventReactionFireAbortShot(), i, ReactionFireTarget::target, and ReactionFireTargetList::targets.
Referenced by G_ReactionFireNotifyClientRFAborted().
Remove a reaction fire target for the given shooter.
[in] | shooter | The reaction firing actor |
[in] | target | The potential reaction fire victim |
Definition at line 323 of file g_reaction.cpp.
References Com_Printf(), ReactionFireTargetList::count, find(), G_EventReactionFireRemoveTarget(), G_IsAlien, G_IsCivilian, i, Edict::moveinfo, Edict::number, moveinfo_s::steps, ReactionFireTarget::target, ReactionFireTargetList::targets, and ReactionFireTarget::triggerTUs.
Referenced by ReactionFire::tryToShoot(), and ReactionFire::updateAllTargets().
Reset the target count in the reaction fire table for all entities.
Definition at line 159 of file g_reaction.cpp.
References i, MAX_RF_DATA, ReactionFireTargetList::reset(), and rfData.
Referenced by G_ReactionFireOnEndTurn().
Definition at line 349 of file g_reaction.cpp.
References ReactionFireTargetList::count, find(), i, ReactionFireTargetList::reset(), ReactionFireTarget::target, and ReactionFireTargetList::targets.
Referenced by ReactionFire::resetTargets().
|
private |
Definition at line 140 of file g_reaction.cpp.
Referenced by create(), find(), init(), notifyClientMove(), notifyClientOnShot(), notifyClientOnStep(), and reset().