Advanced Strategic Command
Public Member Functions | List of all members
tunitattacksobject Class Reference

#include <attack.h>

Inheritance diagram for tunitattacksobject:
Inheritance graph
[legend]

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. More...
 
ObjectgetTarget ()
 
void visit (FightVisitor &visitor)
 
- Public Member Functions inherited from UnitAttacksSomething
VehiclegetAttackingUnit ()
 
- Public Member Functions inherited from tfight
void calc (void)
 Performs the calculation of the attack. The result is only stored in the av and dv structures and is not written to the map. More...
 
- Public Member Functions inherited from AttackFormula
 AttackFormula (GameMap *gamemap)
 
float strength_experience (int experience)
 
float strength_damage (int damage)
 
float strength_attackbonus (int abonus)
 
float strength_hemming (int ax, int ay, Vehicle *d_eht)
 
float defense_experience (int experience)
 
float defense_defensebonus (int defensebonus)
 
int getIconIndex (int experience, bool offensive)
 
virtual ~AttackFormula ()
 

Additional Inherited Members

- Static Public Member Functions inherited from AttackFormula
static float getHemmingFactor (int relDir)
 
- Public Attributes inherited from tfight
struct tfight::tavalues av
 
struct tfight::tavalues dv
 
- Static Public Attributes inherited from AttackFormula
static const int experienceIcons = 24
 
- Protected Member Functions inherited from UnitAttacksSomething
 UnitAttacksSomething (GameMap *gamemap)
 
- Protected Member Functions inherited from tfight
 tfight (GameMap *gamemap)
 
- Protected Attributes inherited from UnitAttacksSomething
Vehicle_attackingunit
 
- Protected Attributes inherited from tfight
int dist
 
- Protected Attributes inherited from AttackFormula
GameMapgamemap
 

Detailed Description

Definition at line 254 of file attack.h.

Constructor & Destructor Documentation

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.

Parameters
attackingunitthe attacking unit
obj_xthe X coordinate of the object on the map
obj_ythe Y coordinate of the object on the map
weaponThe number of the weapon which the attacking unit attacks with. If it is -1, the best weapon is chosen.

Definition at line 726 of file attack.cpp.

References setup().

Member Function Documentation

int tunitattacksobject::getAttackingPlayer ( )
inlinevirtual

Reimplemented from UnitAttacksSomething.

Definition at line 261 of file attack.h.

References UnitAttacksSomething::_attackingunit, and ContainerBase::getOwner().

int tunitattacksobject::getDefendingPlayer ( )
inlinevirtual

Implements tfight.

Definition at line 265 of file attack.h.

Object* tunitattacksobject::getTarget ( )
inline

Definition at line 280 of file attack.h.

Referenced by GetTargetImage::visit().

void tunitattacksobject::setresult ( const Context context)
virtual
void tunitattacksobject::setup ( Vehicle attackingunit,
int  obj_x,
int  obj_y,
int  weapon 
)
void tunitattacksobject::visit ( FightVisitor visitor)
inlinevirtual

Implements tfight.

Definition at line 284 of file attack.h.

References FightVisitor::visit().


The documentation for this class was generated from the following files: