Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

tunitattacksunit Class Reference

#include <attack.h>

Inheritance diagram for tunitattacksunit:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 tunitattacksunit (Vehicle *&attackingunit, Vehicle *&attackedunit, bool respond=true, int weapon=-1, bool reactionfire=false)
void setup (Vehicle *&attackingunit, Vehicle *&attackedunit, bool respond, int weapon)
void setresult (void)
 Writes the result of the attack calculation to the actual units.
void visit (FightVisitor &visitor)
VehiclegetTarget ()
int getDefendingPlayer ()

Constructor & Destructor Documentation

tunitattacksunit::tunitattacksunit Vehicle *&  attackingunit,
Vehicle *&  attackedunit,
bool  respond = true,
int  weapon = -1,
bool  reactionfire = false
 

Calculates the fight if one unit attacks another units.

Parameters:
respond Does the unit that is being attacked retalliate ?
weapon The number of the weapon which the attacking unit attacks with. If it is -1, the best weapon is chosen.

Definition at line 232 of file attack.cpp.

References setup().


Member Function Documentation

int tunitattacksunit::getDefendingPlayer  )  [inline, virtual]
 

Implements tfight.

Definition at line 164 of file attack.h.

References ContainerBase::getOwner().

Vehicle* tunitattacksunit::getTarget  )  [inline]
 

Definition at line 159 of file attack.h.

Referenced by GetTargetImage::visit().

void tunitattacksunit::setresult void   )  [virtual]
 

Writes the result of the attack calculation to the actual units.

Implements tfight.

Definition at line 368 of file attack.cpp.

References UnitAttacksSomething::_attackingunit, actmap, Vehicle::ammo, tfight::av, tfight::tavalues::damage, ContainerBase::damage, tfight::dv, tfight::tavalues::experience, Vehicle::experience, GameTime::move(), Vehicle::networkid, Vehicle::ReactionFire::nonattackableUnits, Vehicle::postAttack(), Vehicle::reactionfire, GameTime::set(), GameMap::time, GameTime::turn(), tfight::tavalues::weapcount, tfight::tavalues::weapnum, and Vehicle::ReactionFire::weaponShots.

Referenced by trunreplay::execnextreplaymove().

void tunitattacksunit::setup Vehicle *&  attackingunit,
Vehicle *&  attackedunit,
bool  respond,
int  weapon
 

Definition at line 238 of file attack.cpp.

References UnitAttacksSomething::_attackingunit, Vehicle::ammo, tfight::tavalues::armor, tfight::tavalues::attackbonus, attackpossible(), attackpossible2n(), tfight::av, beeline(), chfahrend, chtieffliegend, tfight::tavalues::color, AttackWeap::count, ContainerBase::damage, tfight::tavalues::damage, tfight::tavalues::defensebonus, tfight::dist, tfight::dv, Vehicle::experience, tfight::tavalues::experience, Vehicle::getArmor(), tfield::getattackbonus(), tfield::getdefensebonus(), getfield(), ContainerBase::getMap(), ContainerBase::getOwner(), Vehicle::getPosition(), SingleWeapon::getScalarWeaponType(), Vehicle::getWeapon(), WeapDist::getWeaponStrength(), ContainerBaseType::hasFunction(), tfight::tavalues::height, Vehicle::height, tfight::tavalues::hemming, Vehicletype::initiative, tfight::tavalues::initiative, tfight::tavalues::kamikaze, ContainerBaseType::KamikazeOnly, Vehicletype::movemalustyp, AttackWeap::num, tfight::tavalues::strength, AttackWeap::strength, AttackFormula::strength_hemming(), SingleWeapon::targetingAccuracy, Vehicle::typ, tfight::tavalues::weapcount, tfight::tavalues::weapnum, UnitWeapon::weapon, Vehicletype::weapons, tfight::tavalues::weapontype, Vehicle::weapstrength, Vehicle::xpos, and Vehicle::ypos.

Referenced by tunitattacksunit(), and UnitAttacksUnit_FakeHemming::UnitAttacksUnit_FakeHemming().

void tunitattacksunit::visit FightVisitor visitor  )  [inline, virtual]
 

Implements tfight.

Definition at line 155 of file attack.h.

References FightVisitor::visit().


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 02:21:57 2008 for Advanced Strategic Command by  doxygen 1.4.2