|
UFO: Alien Invasion
|

Public Member Functions | |
| void | notifyClientOnStep (const Edict *target, int step) |
| bool | checkExecution (const Edict *target, int step) |
| Check all entities to see whether target has caused reaction fire to resolve. | |
| void | updateAllTargets (const Edict *target) |
| Check whether 'target' has just triggered any new reaction fire. | |
| bool | tryToShoot (Actor *shooter, const Edict *target) |
| Resolve the reaction fire for an entity, this checks that the entity can fire and then takes the shot. | |
| bool | isInWeaponRange (const Actor *shooter, const Edict *target, const fireDef_t *fd) const |
| const fireDef_t * | getFireDef (const Actor *shooter) const |
| Get the fireDef for the RF settings of the shooter. | |
| void | resetTargets (const Edict *shooter) |
| void | notifyClientOnShot (const Edict *target, int tusTarget) |
Private Member Functions | |
| bool | isEnemy (const Actor *shooter, const Edict *target) const |
| Check whether we want to shoot at the target. | |
| bool | canReact (Actor *shooter, const Edict *target) const |
| Check whether shooter can reaction fire at target at all. | |
| bool | canSee (const Actor *shooter, const Edict *target) const |
| Check whether shooter can see his target well enough. | |
| bool | shoot (Actor *shooter, const pos3_t at, shoot_types_t type, fireDefIndex_t firemode) |
| Perform the reaction fire shot. | |
| bool | isPossible (Actor *shooter, const Edict *target) const |
Definition at line 450 of file g_reaction.cpp.
Check whether shooter can reaction fire at target at all.
| [in] | shooter | The entity that might be firing |
| [in] | target | The entity that might be fired at |
Definition at line 716 of file g_reaction.cpp.
References Edict::chr, FiremodeSettings::getFmIdx(), FiremodeSettings::getHand(), Edict::getHandItem(), Edict::getIdNum(), gi, Actor::isDazed(), Actor::isReaction(), character_t::name, Actor::removeReaction(), and character_t::RFmode.
Referenced by isPossible().
Check whether shooter can see his target well enough.
| [in] | shooter | The entity that might be firing |
| [in] | target | The entity that might be fired at |
Definition at line 742 of file g_reaction.cpp.
References ACTOR_VIS_10, G_ActorVis(), G_FrustumVis(), G_IsVisibleForTeam, G_VisCheckDist(), Edict::getTeam(), Edict::origin, and VectorDistSqr.
Referenced by isPossible().
Check all entities to see whether target has caused reaction fire to resolve.
| [in] | target | The entity that might be resolving reaction fire |
| [in] | step | The number of the step in the move we are checking reactions for |
Definition at line 900 of file g_reaction.cpp.
References G_EdictsGetNextLivingActor(), G_ReactionFireGetTUsForItem(), G_ReactionFireNotifyClientRFAborted(), rf, and rft.
Get the fireDef for the RF settings of the shooter.
| [in] | shooter | The reaction firing actor |
Definition at line 475 of file g_reaction.cpp.
References Item::ammoDef(), Edict::chr, Item::getFiredefs(), FiremodeSettings::getFmIdx(), FiremodeSettings::getHand(), Edict::getHandItem(), FiremodeSettings::isSaneFiremode(), Item::isWeapon(), Item::mustReload(), and character_t::RFmode.
Check whether we want to shoot at the target.
| [in] | shooter | The entity that might be firing |
| [in] | target | The entity that might be fired at |
Definition at line 688 of file g_reaction.cpp.
References frand(), G_IsCivilian, G_IsDead, Edict::getTeam(), Edict::isSameTeamAs(), Actor::isShaken(), level, mor_shaken, and Edict::morale.
Referenced by isPossible().
| bool ReactionFire::isInWeaponRange | ( | const Actor * | shooter, |
| const Edict * | target, | ||
| const fireDef_t * | fd ) const |
Definition at line 494 of file g_reaction.cpp.
References Edict::origin, fireDef_t::range, and VectorDist.
Definition at line 678 of file g_reaction.cpp.
References canReact(), canSee(), and isEnemy().
Referenced by tryToShoot(), and updateAllTargets().
Definition at line 882 of file g_reaction.cpp.
References rft.
Definition at line 887 of file g_reaction.cpp.
References rft.
Definition at line 785 of file g_reaction.cpp.
References rft.
|
private |
Perform the reaction fire shot.
| [in] | shooter | The actor that is trying to shoot |
| [in] | at | Position to fire on. |
| [in] | type | What type of shot this is (left, right reaction-left etc...). |
| [in] | firemode | The firemode index of the ammo for the used weapon (objDef.fd[][x]) . |
Definition at line 799 of file g_reaction.cpp.
References shot_mock_t::civilian, shot_mock_t::enemyCount, shot_mock_t::friendCount, G_ClientShoot(), G_IsAlien, Item::getFiredefs(), Edict::getLeftHandItem(), Edict::getPlayer(), Edict::getRightHandItem(), i, IS_SHOT_RIGHT, Actor::isInsane(), Actor::isPanicked(), Actor::isRaged(), Actor::isShaken(), fireDef_t::shots, and type.
Resolve the reaction fire for an entity, this checks that the entity can fire and then takes the shot.
| [in] | shooter | The entity using reaction fire |
| [in] | target | The victim of the reaction fire |
Definition at line 856 of file g_reaction.cpp.
References ACTOR_HAND_LEFT, ACTOR_HAND_RIGHT, Edict::chr, FiremodeSettings::getFmIdx(), FiremodeSettings::getHand(), isPossible(), Edict::pos, Actor::removeShaken(), rf, character_t::RFmode, rft, ST_LEFT_REACTION, ST_NUM_SHOOT_TYPES, ST_RIGHT_REACTION, and type.
Check whether 'target' has just triggered any new reaction fire.
| [in] | target | The entity triggering fire |
Definition at line 767 of file g_reaction.cpp.
References G_EdictsGetNextLivingActor(), G_ReactionFireGetTUsForItem(), isPossible(), and rft.