#include <Weapon.h>
Inherits MemoryPoolObject, and Snapshot.
Public Member Functions | |
| Bool | fireWeapon (const Object *source, Object *target, ObjectID *projectileID=NULL) |
| Bool | fireWeapon (const Object *source, const Coord3D *pos, ObjectID *projectileID=NULL) |
| void | fireProjectileDetonationWeapon (const Object *source, Object *target, WeaponBonusConditionFlags extraBonusFlags, Bool inflictDamage=TRUE) |
| void | fireProjectileDetonationWeapon (const Object *source, const Coord3D *pos, WeaponBonusConditionFlags extraBonusFlags, Bool inflictDamage=TRUE) |
| void | preFireWeapon (const Object *source, const Object *victim) |
| Object * | forceFireWeapon (const Object *source, const Coord3D *pos) |
| Real | estimateWeaponDamage (const Object *source, const Object *target) |
| Real | estimateWeaponDamage (const Object *source, const Coord3D *pos) |
| void | onWeaponBonusChange (const Object *source) |
| Our Object's weapon bonus changed, so we need to update to reflect that instead of waiting. | |
| Bool | isWithinAttackRange (const Object *source, const Object *target) const |
| Bool | isWithinAttackRange (const Object *source, const Coord3D *pos) const |
| Bool | isTooClose (const Object *source, const Object *target) const |
| Bool | isTooClose (const Object *source, const Coord3D *pos) const |
| Bool | isGoalPosWithinAttackRange (const Object *source, const Coord3D *goalPos, const Object *target, const Coord3D *targetPos) const |
| Bool | isSourceObjectWithGoalPositionWithinAttackRange (const Object *source, const Coord3D *goalPos, const Object *target, const Coord3D *targetPos) const |
| Bool | computeApproachTarget (const Object *source, const Object *target, const Coord3D *pos, Real angleOffset, Coord3D &approachTargetPos) const |
| void | loadAmmoNow (const Object *source) |
| void | reloadAmmo (const Object *source) |
| WeaponStatus | getStatus () const |
| UnsignedInt | getPossibleNextShotFrame () const |
| Some AI needs to know when the soonest I can possibly next shoot. Bonuses have been figured into this number already. | |
| UnsignedInt | getPreAttackFinishedFrame () const |
| UnsignedInt | getLastReloadStartedFrame () const |
| Real | getPercentReadyToFire () const |
| void | setPossibleNextShotFrame (UnsignedInt frameNum) |
| void | setPreAttackFinishedFrame (UnsignedInt frameNum) |
| void | setLastReloadStartedFrame (UnsignedInt frameNum) |
| void | transferNextShotStatsFrom (const Weapon &weapon) |
| Real | getAttackRange (const Object *source) const |
| Real | getAttackDistance (const Object *source, const Object *victim, const Coord3D *victimPos) const |
| void | newProjectileFired (const Object *sourceObj, const Object *projectile, const Object *victimObj, const Coord3D *victimPos) |
| I just made this projectile and may need to keep track of it. | |
| Bool | isLaser () const |
| void | createLaser (const Object *sourceObj, const Object *victimObj, const Coord3D *victimPos) |
| const WeaponTemplate * | getTemplate () const |
| WeaponSlotType | getWeaponSlot () const |
| AsciiString | getName () const |
| UnsignedInt | getLastShotFrame () const |
| frame a shot was last fired on | |
| UnsignedInt | getRemainingAmmo () const |
| WeaponReloadType | getReloadType () const |
| Bool | getAutoReloadsClip () const |
| Real | getAimDelta () const |
| Real | getScatterRadius () const |
| Real | getScatterTargetScalar () const |
| Int | getAntiMask () const |
| Bool | isCapableOfFollowingWaypoint () const |
| Int | getContinuousFireOneShotsNeeded () const |
| Int | getContinuousFireTwoShotsNeeded () const |
| UnsignedInt | getContinuousFireCoastFrames () const |
| UnsignedInt | getAutoReloadWhenIdleFrames () const |
| const AudioEventRTS & | getFireSound () const |
| UnsignedInt | getFireSoundLoopTime () const |
| DamageType | getDamageType () const |
| DeathType | getDeathType () const |
| Real | getContinueAttackRange () const |
| Bool | isShowsAmmoPips () const |
| Int | getClipSize () const |
| Bool | isContactWeapon () const |
| Int | getClipReloadTime (const Object *source) const |
| Real | getPrimaryDamageRadius (const Object *source) const |
| Int | getPreAttackDelay (const Object *source, const Object *victim) const |
| Bool | isDamageWeapon () const |
| Bool | isPitchLimited () const |
| Bool | isWithinTargetPitch (const Object *source, const Object *victim) const |
| void | setLeechRangeActive (Bool active) |
| Bool | hasLeechRange () const |
| void | setMaxShotCount (Int maxShots) |
| Int | getMaxShotCount () const |
| Bool | isClearFiringLineOfSightTerrain (const Object *source, const Object *victim) const |
| Bool | isClearFiringLineOfSightTerrain (const Object *source, const Coord3D &victimPos) const |
| Bool | isClearGoalFiringLineOfSightTerrain (const Object *source, const Coord3D &goalPos, const Object *victim) const |
| Bool | isClearGoalFiringLineOfSightTerrain (const Object *source, const Coord3D &goalPos, const Coord3D &victimPos) const |
| void | setClipPercentFull (Real percent, Bool allowReduction) |
| UnsignedInt | getSuspendFXFrame (void) const |
Public Member Functions inherited from MemoryPoolObject | |
| void | deleteInstance () |
Public Member Functions inherited from Snapshot | |
| Snapshot (void) | |
| ~Snapshot (void) | |
Static Public Member Functions | |
| static void | calcProjectileLaunchPosition (const Object *launcher, WeaponSlotType wslot, Int specificBarrelToUse, Matrix3D &worldTransform, Coord3D &worldPos) |
| static void | positionProjectileForLaunch (Object *projectile, const Object *launcher, WeaponSlotType wslot, Int specificBarrelToUse) |
Protected Member Functions | |
| virtual void | crc (Xfer *xfer) |
| run the "light" crc check on this data structure | |
| virtual void | xfer (Xfer *xfer) |
| virtual void | loadPostProcess (void) |
| Weapon (const WeaponTemplate *tmpl, WeaponSlotType wslot) | |
| Bool | privateFireWeapon (const Object *sourceObj, Object *victimObj, const Coord3D *victimPos, Bool isProjectileDetonation, Bool ignoreRanges, WeaponBonusConditionFlags extraBonusFlags, ObjectID *projectileID, Bool inflictDamage) |
| Real | estimateWeaponDamage (const Object *sourceObj, const Object *victimObj, const Coord3D *victimPos) |
| void | reloadWithBonus (const Object *source, const WeaponBonus &bonus, Bool loadInstantly) |
| void | processRequestAssistance (const Object *requestingObject, Object *victimObject) |
| Weapons can call for extra attacks from nearby objects. | |
| void | getFiringLineOfSightOrigin (const Object *source, Coord3D &origin) const |
| void | computeBonus (const Object *source, WeaponBonusConditionFlags extraBonusFlags, WeaponBonus &bonus) const |
| void | rebuildScatterTargets () |
Protected Member Functions inherited from MemoryPoolObject | |
| virtual | ~MemoryPoolObject () |
| void * | operator new (size_t s) |
| void | operator delete (void *p) |
| virtual MemoryPool * | getObjectMemoryPool ()=0 |
Friends | |
| class | WeaponStore |
|
protected |
Definition at line 1748 of file Weapon.cpp.
|
static |
Definition at line 2937 of file Weapon.cpp.
| Bool Weapon::computeApproachTarget | ( | const Object * | source, |
| const Object * | target, | ||
| const Coord3D * | pos, | ||
| Real | angleOffset, | ||
| Coord3D & | approachTargetPos ) const |
Compute a target position from which 'source' can target 'target'. Note that this doesn't guarantee that source can actually move to the location, it just guarantees that the target position is plausibly within attack range. returns TRUE if the source's current pos is already close enough (in which case that current pos is stuffed into the return arg).
Definition at line 2001 of file Weapon.cpp.
|
protected |
Definition at line 1821 of file Weapon.cpp.
|
protectedvirtual |
run the "light" crc check on this data structure
Implements Snapshot.
Definition at line 3161 of file Weapon.cpp.
| void Weapon::createLaser | ( | const Object * | sourceObj, |
| const Object * | victimObj, | ||
| const Coord3D * | victimPos ) |
Definition at line 2442 of file Weapon.cpp.
return the estimate damage that would be done to the given target, taking bonuses, armor, etc into account. (this isn't guaranteed to be 100% accurate; it is intended to be used to decide which weapon should be used when a unit has multiple weapons.) Note that it DOES NOT take weapon range into account – it ASSUMES that the victim is within range!
|
protected |
Definition at line 2395 of file Weapon.cpp.
| void Weapon::fireProjectileDetonationWeapon | ( | const Object * | source, |
| const Coord3D * | pos, | ||
| WeaponBonusConditionFlags | extraBonusFlags, | ||
| Bool | inflictDamage = TRUE ) |
Definition at line 2738 of file Weapon.cpp.
| void Weapon::fireProjectileDetonationWeapon | ( | const Object * | source, |
| Object * | target, | ||
| WeaponBonusConditionFlags | extraBonusFlags, | ||
| Bool | inflictDamage = TRUE ) |
Definition at line 2731 of file Weapon.cpp.
| Bool Weapon::fireWeapon | ( | const Object * | source, |
| const Coord3D * | pos, | ||
| ObjectID * | projectileID = NULL ) |
Definition at line 2724 of file Weapon.cpp.
Definition at line 2716 of file Weapon.cpp.
Definition at line 2747 of file Weapon.cpp.
| Real Weapon::getAttackDistance | ( | const Object * | source, |
| const Object * | victim, | ||
| const Coord3D * | victimPos ) const |
Definition at line 2376 of file Weapon.cpp.
Definition at line 2360 of file Weapon.cpp.
|
inline |
Definition at line 1861 of file Weapon.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 3058 of file Weapon.cpp.
|
inline |
|
inline |
|
inline |
| Real Weapon::getPercentReadyToFire | ( | ) | const |
Definition at line 2315 of file Weapon.cpp.
|
inline |
Definition at line 2844 of file Weapon.cpp.
|
inline |
Definition at line 2805 of file Weapon.cpp.
|
inline |
|
inline |
| WeaponStatus Weapon::getStatus | ( | ) | const |
Definition at line 2760 of file Weapon.cpp.
|
inline |
|
inline |
|
inline |
| Bool Weapon::isClearFiringLineOfSightTerrain | ( | const Object * | source, |
| const Coord3D & | victimPos ) const |
Definition at line 3107 of file Weapon.cpp.
Definition at line 3090 of file Weapon.cpp.
| Bool Weapon::isClearGoalFiringLineOfSightTerrain | ( | const Object * | source, |
| const Coord3D & | goalPos, | ||
| const Coord3D & | victimPos ) const |
Determine whether if source was at goalPos whether it would have clear line of sight.
Definition at line 3134 of file Weapon.cpp.
| Bool Weapon::isClearGoalFiringLineOfSightTerrain | ( | const Object * | source, |
| const Coord3D & | goalPos, | ||
| const Object * | victim ) const |
Determine whether if source was at goalPos whether it would have clear line of sight.
Definition at line 3120 of file Weapon.cpp.
| Bool Weapon::isDamageWeapon | ( | ) | const |
Definition at line 2813 of file Weapon.cpp.
| Bool Weapon::isGoalPosWithinAttackRange | ( | const Object * | source, |
| const Coord3D * | goalPos, | ||
| const Object * | target, | ||
| const Coord3D * | targetPos ) const |
Definition at line 2265 of file Weapon.cpp.
| Bool Weapon::isSourceObjectWithGoalPositionWithinAttackRange | ( | const Object * | source, |
| const Coord3D * | goalPos, | ||
| const Object * | target, | ||
| const Coord3D * | targetPos ) const |
Definition at line 2134 of file Weapon.cpp.
Definition at line 2250 of file Weapon.cpp.
Definition at line 2235 of file Weapon.cpp.
Definition at line 2159 of file Weapon.cpp.
return true if the target is within attack range, false otherwise.
Definition at line 2176 of file Weapon.cpp.
Definition at line 2779 of file Weapon.cpp.
| void Weapon::loadAmmoNow | ( | const Object * | source | ) |
note that "load" makes the ammo instantly available, while "reload" keeps the weapon in the RELOADING state until the clip-reload-time is up. Normally you should use "load" only for newly-created units, who presumably come into existence with fully loaded weapons.
Definition at line 1844 of file Weapon.cpp.
|
protectedvirtual |
| void Weapon::newProjectileFired | ( | const Object * | sourceObj, |
| const Object * | projectile, | ||
| const Object * | victimObj, | ||
| const Coord3D * | victimPos ) |
I just made this projectile and may need to keep track of it.
Definition at line 2412 of file Weapon.cpp.
| void Weapon::onWeaponBonusChange | ( | const Object * | source | ) |
Our Object's weapon bonus changed, so we need to update to reflect that instead of waiting.
Definition at line 1959 of file Weapon.cpp.
|
static |
Definition at line 3020 of file Weapon.cpp.
Definition at line 2701 of file Weapon.cpp.
|
protected |
Definition at line 2481 of file Weapon.cpp.
|
protected |
Weapons can call for extra attacks from nearby objects.
Definition at line 2920 of file Weapon.cpp.
|
protected |
Definition at line 1888 of file Weapon.cpp.
| void Weapon::reloadAmmo | ( | const Object * | source | ) |
Definition at line 1852 of file Weapon.cpp.
|
protected |
Definition at line 1901 of file Weapon.cpp.
special purpose call for jets in airfields: directly set the ammoinclip to a certain percentage full (note that percent=1.0 is full, NOT percent=100.0!). this will end up with status as READY_TO_FIRE or OUT_OF_AMMO, but never RELOADING_CLIP!
Definition at line 1869 of file Weapon.cpp.
|
inline |
|
inline |
|
inline |
| void Weapon::transferNextShotStatsFrom | ( | const Weapon & | weapon | ) |
Definition at line 3151 of file Weapon.cpp.
|
protectedvirtual |
Xfer Version Info: 1: Initial version
Implements Snapshot.
Definition at line 3365 of file Weapon.cpp.
|
friend |