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

Public Member Functions | |
| int | getAttackingPlayer () |
| int | getDefendingPlayer () |
| tunitattacksbuilding (Vehicle *attackingunit, int x, int y, int weapon=-1) | |
| void | setup (Vehicle *attackingunit, int x, int y, int weapon) |
| void | setresult (const Context &context) |
| Writes the result of the attack calculation to the actual units. | |
| void | visit (FightVisitor &visitor) |
| Building * | getTarget () |
Definition at line 177 of file attack.h.
| tunitattacksbuilding::tunitattacksbuilding | ( | Vehicle * | attackingunit, | |
| int | x, | |||
| int | y, | |||
| int | weapon = -1 | |||
| ) |
Calculates the fight if one unit attacks the building at coordinate x/y.
| weapon | The number of the weapon which the attacking unit attacks with. If it is -1, the best weapon is chosen. |
Definition at line 439 of file attack.cpp.
References setup().
| int tunitattacksbuilding::getAttackingPlayer | ( | ) | [inline, virtual] |
Reimplemented from UnitAttacksSomething.
Definition at line 182 of file attack.h.
References UnitAttacksSomething::_attackingunit, and ContainerBase::getOwner().
| int tunitattacksbuilding::getDefendingPlayer | ( | ) | [inline, virtual] |
| void tunitattacksbuilding::setup | ( | Vehicle * | attackingunit, | |
| int | x, | |||
| int | y, | |||
| int | weapon | |||
| ) |
Definition at line 446 of file attack.cpp.
References UnitAttacksSomething::_attackingunit, attackpossible(), beeline(), AttackWeap::count, tfight::dist, GameMap::getField(), ContainerBase::getMap(), AttackWeap::num, AttackWeap::strength, Vehicle::xpos, and Vehicle::ypos.
Referenced by tunitattacksbuilding().
| void tunitattacksbuilding::setresult | ( | const Context & | context | ) | [virtual] |
Writes the result of the attack calculation to the actual units.
Implements tfight.
Definition at line 524 of file attack.cpp.
References UnitAttacksSomething::_attackingunit, Vehicle::ammo, tfight::av, ActionRegistry::ConsumeAmmo, ContainerBase::damage, tfight::tavalues::damage, tfight::dv, GameAction::execute(), Building::getPosition(), SingleWeapon::getScalarWeaponType(), ActionRegistry::InflictDamage, Vehicle::postAttack(), Vehicle::typ, tfight::tavalues::weapcount, tfight::tavalues::weapnum, UnitWeapon::weapon, and VehicleType::weapons.
Referenced by trunreplay::execnextreplaymove().
| void tunitattacksbuilding::visit | ( | FightVisitor & | visitor | ) | [inline, virtual] |
| Building* tunitattacksbuilding::getTarget | ( | ) | [inline] |
1.5.1