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 (const Context &context)
 Writes the result of the attack calculation to the actual units.
void visit (FightVisitor &visitor)
VehiclegetTarget ()
int getDefendingPlayer ()

Detailed Description

Definition at line 140 of file attack.h.


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 241 of file attack.cpp.

References setup().


Member Function Documentation

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

Definition at line 248 of file attack.cpp.

References UnitAttacksSomething::_attackingunit, attackpossible(), beeline(), AttackWeap::count, tfight::dist, AttackWeap::strength, Vehicle::xpos, and Vehicle::ypos.

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

void tunitattacksunit::setresult ( const Context context  )  [virtual]

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

Implements tfight.

Definition at line 385 of file attack.cpp.

References UnitAttacksSomething::_attackingunit, Vehicle::ammo, tfight::av, ActionRegistry::ChangeUnitProperty, ActionRegistry::ConsumeAmmo, ContainerBase::damage, tfight::tavalues::damage, tfight::dv, GameAction::execute(), tfight::tavalues::experience, ChangeUnitProperty::Experience, ContainerBase::getMap(), SingleWeapon::getScalarWeaponType(), ActionRegistry::InflictDamage, log(), Vehicle::networkid, Vehicle::postAttack(), ActionRegistry::RegisterUnitRFTarget, Vehicle::typ, tfight::tavalues::weapcount, tfight::tavalues::weapnum, UnitWeapon::weapon, and VehicleType::weapons.

Referenced by trunreplay::execnextreplaymove().

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

Implements tfight.

Definition at line 161 of file attack.h.

References FightVisitor::visit().

Vehicle* tunitattacksunit::getTarget (  )  [inline]

Definition at line 165 of file attack.h.

Referenced by GetTargetImage::visit().

int tunitattacksunit::getDefendingPlayer (  )  [inline, virtual]

Implements tfight.

Definition at line 170 of file attack.h.

References ContainerBase::getOwner().


The documentation for this class was generated from the following files:
Generated on Mon May 21 01:47:58 2012 for Advanced Strategic Command by  doxygen 1.5.1