#include <attack.h>
Inheritance diagram for tunitattacksunit:

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) |
| Vehicle * | getTarget () |
| int | getDefendingPlayer () |
Definition at line 140 of file attack.h.
| tunitattacksunit::tunitattacksunit | ( | Vehicle *& | attackingunit, | |
| Vehicle *& | attackedunit, | |||
| bool | respond = true, |
|||
| int | weapon = -1, |
|||
| bool | reactionfire = false | |||
| ) |
Calculates the fight if one unit attacks another units.
| 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().
| 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] |
| Vehicle* tunitattacksunit::getTarget | ( | ) | [inline] |
| int tunitattacksunit::getDefendingPlayer | ( | ) | [inline, virtual] |
1.5.1