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

Public Member Functions | |
| int | getAttackingPlayer () |
| int | getDefendingPlayer () |
| tunitattacksobject (Vehicle *attackingunit, int obj_x, int obj_y, int weapon=-1) | |
| void | setup (Vehicle *attackingunit, int obj_x, int obj_y, int weapon) |
| void | setresult (const Context &context) |
| Writes the result of the attack calculation to the actual units. | |
| Object * | getTarget () |
| void | visit (FightVisitor &visitor) |
Definition at line 251 of file attack.h.
| tunitattacksobject::tunitattacksobject | ( | Vehicle * | attackingunit, | |
| int | obj_x, | |||
| int | obj_y, | |||
| int | weapon = -1 | |||
| ) |
Calculates the fight if one unit attacks the objects at coordinate x/y.
| attackingunit | the attacking unit | |
| obj_x | the X coordinate of the object on the map | |
| obj_y | the Y coordinate of the object on the map | |
| weapon | The number of the weapon which the attacking unit attacks with. If it is -1, the best weapon is chosen. |
Definition at line 654 of file attack.cpp.
References setup().
| int tunitattacksobject::getAttackingPlayer | ( | ) | [inline, virtual] |
Reimplemented from UnitAttacksSomething.
Definition at line 258 of file attack.h.
References UnitAttacksSomething::_attackingunit, and ContainerBase::getOwner().
| int tunitattacksobject::getDefendingPlayer | ( | ) | [inline, virtual] |
| void tunitattacksobject::setup | ( | Vehicle * | attackingunit, | |
| int | obj_x, | |||
| int | obj_y, | |||
| int | weapon | |||
| ) |
Definition at line 660 of file attack.cpp.
References UnitAttacksSomething::_attackingunit, attackpossible(), beeline(), AttackWeap::count, tfight::dist, GameMap::getField(), ContainerBase::getMap(), AttackWeap::num, MapField::objects, AttackWeap::strength, Vehicle::xpos, and Vehicle::ypos.
Referenced by tunitattacksobject().
| void tunitattacksobject::setresult | ( | const Context & | context | ) | [virtual] |
Writes the result of the attack calculation to the actual units.
Implements tfight.
Definition at line 742 of file attack.cpp.
References UnitAttacksSomething::_attackingunit, Vehicle::ammo, tfight::av, ActionRegistry::ChangeObjectProperty, ActionRegistry::ConsumeAmmo, ChangeObjectProperty::Damage, ContainerBase::damage, tfight::tavalues::damage, tfight::dv, GameAction::execute(), ContainerBase::getMap(), SingleWeapon::getScalarWeaponType(), ObjectType::id, ActionRegistry::InflictDamage, Vehicle::postAttack(), ActionRegistry::RemoveObject, Object::typ, Vehicle::typ, tfight::tavalues::weapcount, tfight::tavalues::weapnum, UnitWeapon::weapon, and VehicleType::weapons.
Referenced by trunreplay::execnextreplaymove().
| Object* tunitattacksobject::getTarget | ( | ) | [inline] |
| void tunitattacksobject::visit | ( | FightVisitor & | visitor | ) | [inline, virtual] |
1.5.1