Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

attack.h File Reference

Interface for all the fighting routines of ASC. More...

#include "typen.h"
#include "vehicletype.h"
#include "vehicle.h"
#include "buildings.h"
#include "objects.h"
#include "explosivemines.h"

Include dependency graph for attack.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef AttackWeappattackweap

Functions

pattackweap attackpossible (const Vehicle *attacker, int x, int y)
 Is attacker able to attack anything in field x/y ?
bool attackpossible2u (const Vehicle *attacker, const Vehicle *target, pattackweap attackweap=NULL, int targetheight=-1)
 Is attacker able to attack target ? Distance is not evaluated.
bool attackpossible28 (const Vehicle *attacker, const Vehicle *target, pattackweap attackweap=NULL, int targetHeight=-1)
 Is attacker able to attack target ? Distance is assumed one field.
bool attackpossible2n (const Vehicle *attacker, const Vehicle *target, pattackweap attackweap=NULL)
 Is attacker able to attack target ? Actual distance used.
bool vehicleplattfahrbar (const Vehicle *vehicle, const tfield *field)
 Can the vehicle drive across the field and destroy any unit there by moving over them?


Detailed Description

Interface for all the fighting routines of ASC.

Definition in file attack.h.


Typedef Documentation

typedef class AttackWeap* pattackweap
 

Definition at line 289 of file attack.h.


Function Documentation

pattackweap attackpossible const Vehicle attacker,
int  x,
int  y
 

Is attacker able to attack anything in field x/y ?

Definition at line 742 of file attack.cpp.

References actmap, Vehicle::ammo, attackpossible2n(), beeline(), AttackWeap::building, tfield::building, BuildingType::buildingheight, cmm_building, ContainerBase::color, UnitWeapon::count, cwbombn, cwcannonn, cwcruisemissile, cwlargemissilen, cwlasern, cwsmallmissilen, cwtorpedon, SingleWeapon::efficiency, fieldvisiblenow(), getfield(), getheightdelta(), ContainerBase::getOwner(), GameMap::getPlayer(), SingleWeapon::getScalarWeaponType(), Vehicle::height, log2(), SingleWeapon::mindistance, AttackWeap::object, tfield::objects, SingleWeapon::shootable(), SingleWeapon::sourceheight, SingleWeapon::targ, SingleWeapon::targetingAccuracy, Building::typ, Vehicle::typ, tfield::vehicle, UnitWeapon::weapon, Vehicletype::weapons, Vehicle::weapstrength, Vehicle::xpos, GameMap::xsize, Vehicle::ypos, and GameMap::ysize.

Referenced by tsearchreactionfireingunits::attack(), tunitattacksunit::setup(), tunitattacksbuilding::setup(), and tunitattacksobject::setup().

bool attackpossible28 const Vehicle attacker,
const Vehicle target,
pattackweap  attackweap = NULL,
int  targetHeight = -1
 

Is attacker able to attack target ? Distance is assumed one field.

The distance is assumed to be 1 field. The routine is used for the movement routines for example, because units moving next to enemies get a movement malus. Does not evaluate any diplomatic states

Parameters:
attacker the attacking unit
target the unit that is being attacked
attackweap if != NULL, detailed information about the weapons which can perform the attack are written to attackweap
targetHeight if != -1 , assume the target unit was on this height (bitmapped!)

Definition at line 888 of file attack.cpp.

References Vehicle::ammo, UnitWeapon::count, AttackWeap::count, SingleWeapon::efficiency, getheightdelta(), SingleWeapon::getScalarWeaponType(), Vehicle::height, log2(), SingleWeapon::mindistance, minmalq, Vehicletype::movemalustyp, AttackWeap::num, SingleWeapon::offensive(), SingleWeapon::shootable(), SingleWeapon::sourceheight, AttackWeap::strength, SingleWeapon::targ, AttackWeap::target, SingleWeapon::targetingAccuracy, AttackWeap::typ, Vehicle::typ, AttackWeap::vehicle, UnitWeapon::weapon, Vehicletype::weapons, and Vehicle::weapstrength.

Referenced by calcMoveMalus(), and fieldAccessible().

bool attackpossible2n const Vehicle attacker,
const Vehicle target,
pattackweap  attackweap = NULL
 

Is attacker able to attack target ? Actual distance used.

Parameters:
attacker the attacking unit
target the unit that is being attacked
attackweap if != NULL, detailed information about the weapons which can perform the attack are written to attackweap

Definition at line 934 of file attack.cpp.

References actmap, Vehicle::ammo, Vehicle::attacked, beeline(), UnitWeapon::count, AttackWeap::count, SingleWeapon::efficiency, getheightdelta(), ContainerBase::getOwner(), SingleWeapon::getScalarWeaponType(), Vehicle::ReactionFire::getStatus(), Vehicle::hasMoved(), Vehicle::height, log2(), SingleWeapon::mindistance, Vehicletype::movemalustyp, AttackWeap::num, SingleWeapon::offensive(), GameMap::player, Vehicle::reactionfire, Vehicle::ReactionFire::ready, SingleWeapon::shootable(), SingleWeapon::sourceheight, AttackWeap::strength, SingleWeapon::targ, AttackWeap::target, SingleWeapon::targetingAccuracy, AttackWeap::typ, Vehicle::typ, AttackWeap::vehicle, Vehicletype::wait, UnitWeapon::weapon, Vehicletype::weapons, and Vehicle::weapstrength.

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

bool attackpossible2u const Vehicle attacker,
const Vehicle target,
pattackweap  attackweap = NULL,
int  targetheight = -1
 

Is attacker able to attack target ? Distance is not evaluated.

The distance is not evaluated. The routine is used for the movement routines for example, because the current distance of units A and B is not relevant for the check whether unit A can move across the field where B is standing.

Parameters:
attacker the attacking unit
target the unit that is being attacked
attackweap if != NULL, detailed information about the weapons which can perform the attack are written to attackweap
targetHeight if != -1 , assume the target unit was on this height (bitmapped!)

Definition at line 842 of file attack.cpp.

References actmap, Vehicle::ammo, UnitWeapon::count, AttackWeap::count, SingleWeapon::efficiency, getheightdelta(), ContainerBase::getOwner(), SingleWeapon::getScalarWeaponType(), Vehicle::height, log2(), Vehicletype::movemalustyp, AttackWeap::num, SingleWeapon::offensive(), GameMap::player, SingleWeapon::shootable(), SingleWeapon::sourceheight, AttackWeap::strength, SingleWeapon::targ, AttackWeap::target, SingleWeapon::targetingAccuracy, AttackWeap::typ, Vehicle::typ, AttackWeap::vehicle, UnitWeapon::weapon, Vehicletype::weapons, and Vehicle::weapstrength.

bool vehicleplattfahrbar const Vehicle vehicle,
const tfield field
 

Can the vehicle drive across the field and destroy any unit there by moving over them?

Definition at line 980 of file attack.cpp.

Referenced by fieldAccessible().


Generated on Tue Jun 24 01:31:52 2008 for Advanced Strategic Command by  doxygen 1.4.2