#include <unitWeapons.h>
Public Member Functions | |
Weapon (Entity *ent, UnitAspectType ast, const WeaponType *wType) | |
Weapon (Entity *ent, UnitAspectType ast) | |
void | dealDamageToTarget (Target tgt, double dt) |
void | dealEnemySplashDamageToTarget (Target tgt, double dt, double radius) |
void | dealLineSplashDamageToTarget (Target tgt, double dt, double length, double width) |
void | setTarget () |
Target | getTarget () |
void | takeDamage (double amt) |
void | takeDamage (double amt, double dt) |
virtual void | tick (double dt) |
virtual void | init () |
double | isBeingAttacked () |
void | resetBeingAttack () |
Weapon (Entity *ent, UnitAspectType ast, WeaponType wType) | |
void | dealDamageToTarget (Target tgt, double dt) |
void | setTarget () |
Target | getTarget () |
void | takeDamage (double amt, double dt) |
virtual void | tick (double dt) |
virtual void | init () |
Weapon (Entity *ent, UnitAspectType ast, WeaponType wType) | |
void | dealDamageToTarget (Target tgt, double dt) |
void | setTarget () |
Target | getTarget () |
void | takeDamage (double amt, double dt) |
virtual void | tick (double dt) |
virtual void | init () |
Weapon (Entity *ent, UnitAspectType ast, const WeaponType *wType) | |
Weapon (Entity *ent, UnitAspectType ast) | |
void | dealDamageToTarget (Target tgt, double dt) |
void | dealEnemySplashDamageToTarget (Target tgt, double dt, double radius) |
void | dealLineSplashDamageToTarget (Target tgt, double dt, double length, double width) |
void | setTarget () |
Target | getTarget () |
void | takeDamage (double amt) |
void | takeDamage (double amt, double dt) |
virtual void | tick (double dt) |
virtual void | init () |
double | isBeingAttacked () |
void | resetBeingAttack () |
Weapon (Entity *ent, UnitAspectType ast, WeaponType wType) | |
void | dealDamageToTarget (Target tgt, double dt) |
void | setTarget () |
Target | getTarget () |
void | takeDamage (double amt, double dt) |
virtual void | tick (double dt) |
virtual void | init () |
Public Attributes | |
const WeaponType * | weaponType |
double | damageMultiplier |
double | armor |
DistanceMgr * | distanceMgr |
WeaponMgr * | weaponMgr |
WeaponType | weaponType |
double | damageDone |
double | hitpoints |
DistanceMgr * | distanceMgr |
WeaponMgr * | weaponMgr |
DistanceMgr * | distanceMgr |
WeaponMgr * | weaponMgr |
const WeaponType * | weaponType |
DistanceMgr * | distanceMgr |
WeaponMgr * | weaponMgr |
DistanceMgr * | distanceMgr |
WeaponMgr * | weaponMgr |
Private Member Functions | |
std::vector< Entity * > | getUnitsInRadius (Entity *ent, double radius, bool enemy) |
std::vector < FastEcslent::Entity * > | getUnitsInRectangle (Entity *src, Entity *tgt, double length, double width, bool enemy) |
bool | isPointInRectangle (Ogre::Vector3 sp1, Ogre::Vector3 sp2, Ogre::Vector3 sp3, Ogre::Vector3 sp4, Ogre::Vector3 point) |
double | getAreaTriangle (Ogre::Vector3 tp1, Ogre::Vector3 tp2, Ogre::Vector3 tp3) |
std::vector< Entity * > | getUnitsInRadius (Entity *ent, double radius, bool enemy) |
std::vector < FastEcslent::Entity * > | getUnitsInRectangle (Entity *src, Entity *tgt, double length, double width, bool enemy) |
bool | isPointInRectangle (Ogre::Vector3 sp1, Ogre::Vector3 sp2, Ogre::Vector3 sp3, Ogre::Vector3 sp4, Ogre::Vector3 point) |
double | getAreaTriangle (Ogre::Vector3 tp1, Ogre::Vector3 tp2, Ogre::Vector3 tp3) |
Private Attributes | |
Target | target |
int | STANDSTILL |
int | BEINGATTACKED |
double | m_cooldown |
double | m_beingAttacked |
double | m_onfire |
Definition at line 24 of file unitWeapons.h.
FastEcslent::Weapon::Weapon | ( | Entity * | ent, | |
UnitAspectType | ast, | |||
const WeaponType * | wType | |||
) |
FastEcslent::Weapon::Weapon | ( | Entity * | ent, | |
UnitAspectType | ast | |||
) |
FastEcslent::Weapon::Weapon | ( | Entity * | ent, | |
UnitAspectType | ast, | |||
WeaponType | wType | |||
) |
FastEcslent::Weapon::Weapon | ( | Entity * | ent, | |
UnitAspectType | ast, | |||
WeaponType | wType | |||
) |
FastEcslent::Weapon::Weapon | ( | Entity * | ent, | |
UnitAspectType | ast, | |||
const WeaponType * | wType | |||
) |
FastEcslent::Weapon::Weapon | ( | Entity * | ent, | |
UnitAspectType | ast | |||
) |
FastEcslent::Weapon::Weapon | ( | Entity * | ent, | |
UnitAspectType | ast, | |||
WeaponType | wType | |||
) |
std::vector< FastEcslent::Entity * > FastEcslent::Weapon::getUnitsInRadius | ( | Entity * | ent, | |
double | radius, | |||
bool | enemy | |||
) | [private] |
Definition at line 128 of file unitWeapons.cpp.
References FastEcslent::ALIVE, FastEcslent::Entity::engine, FastEcslent::UnitAspect::entity, FastEcslent::Engine::entityMgr, FastEcslent::EntityMgr::ents, FastEcslent::EntityMgr::nEnts, and FastEcslent::Entity::pos.
Referenced by dealEnemySplashDamageToTarget().
std::vector< FastEcslent::Entity * > FastEcslent::Weapon::getUnitsInRectangle | ( | Entity * | src, | |
Entity * | tgt, | |||
double | length, | |||
double | width, | |||
bool | enemyOnly | |||
) | [private] |
Get entities in Rectangle.
Definition at line 150 of file unitWeapons.cpp.
References FastEcslent::ALIVE, FastEcslent::Entity::engine, FastEcslent::UnitAspect::entity, FastEcslent::Engine::entityMgr, FastEcslent::EntityMgr::nEnts, and FastEcslent::Entity::pos.
Referenced by dealLineSplashDamageToTarget().
bool FastEcslent::Weapon::isPointInRectangle | ( | Ogre::Vector3 | sp1, | |
Ogre::Vector3 | sp2, | |||
Ogre::Vector3 | sp3, | |||
Ogre::Vector3 | sp4, | |||
Ogre::Vector3 | point | |||
) | [private] |
We only consider x & z
Definition at line 188 of file unitWeapons.cpp.
References getAreaTriangle().
double FastEcslent::Weapon::getAreaTriangle | ( | Ogre::Vector3 | tp1, | |
Ogre::Vector3 | tp2, | |||
Ogre::Vector3 | tp3 | |||
) | [private] |
Using Heron's formula to calculate area of the triangle.
Definition at line 205 of file unitWeapons.cpp.
Referenced by isPointInRectangle().
void FastEcslent::Weapon::dealDamageToTarget | ( | Target | tgt, | |
double | dt | |||
) |
Definition at line 71 of file unitWeapons.cpp.
References FastEcslent::WeaponType::damageAmount(), FastEcslent::WeaponType::damageCooldown(), FastEcslent::Target::entity, m_cooldown, m_onfire, STANDSTILL, takeDamage(), FastEcslent::Entity::weapon, and weaponType.
Referenced by tick().
void FastEcslent::Weapon::dealEnemySplashDamageToTarget | ( | Target | tgt, | |
double | dt, | |||
double | radius | |||
) |
deal circle shapedsplash damage in front of the unit, like Hellion in StarCraft 2
Definition at line 79 of file unitWeapons.cpp.
References FastEcslent::WeaponType::damageAmount(), DEBUG, FastEcslent::Target::entity, getUnitsInRadius(), m_cooldown, m_onfire, STANDSTILL, and weaponType.
Referenced by tick().
void FastEcslent::Weapon::dealLineSplashDamageToTarget | ( | Target | tgt, | |
double | dt, | |||
double | length, | |||
double | width | |||
) |
deal line shaped splash damage in front of the unit, like Hellion in StarCraft 2
Definition at line 94 of file unitWeapons.cpp.
References FastEcslent::WeaponType::damageAmount(), DEBUG, FastEcslent::Target::entity, getUnitsInRectangle(), m_cooldown, m_onfire, STANDSTILL, and weaponType.
Referenced by tick().
void FastEcslent::Weapon::setTarget | ( | ) |
Target FastEcslent::Weapon::getTarget | ( | ) |
void FastEcslent::Weapon::takeDamage | ( | double | amt | ) |
Definition at line 108 of file unitWeapons.cpp.
References FastEcslent::ALIVE, armor, BEINGATTACKED, FastEcslent::DYING, FastEcslent::UnitAspect::entity, FastEcslent::Entity::hitpoints, m_beingAttacked, and FastEcslent::Entity::switchState().
Referenced by dealDamageToTarget().
void FastEcslent::Weapon::takeDamage | ( | double | amt, | |
double | dt | |||
) |
Definition at line 118 of file unitWeapons.cpp.
References FastEcslent::ALIVE, armor, FastEcslent::DYING, FastEcslent::UnitAspect::entity, FastEcslent::Entity::hitpoints, and FastEcslent::Entity::switchState().
void FastEcslent::Weapon::tick | ( | double | dt | ) | [virtual] |
Reimplemented from FastEcslent::UnitAspect.
Definition at line 41 of file unitWeapons.cpp.
References FastEcslent::ALIVE, FastEcslent::DistanceMgr::closestEnemy, dealDamageToTarget(), dealEnemySplashDamageToTarget(), dealLineSplashDamageToTarget(), distanceMgr, FastEcslent::ExplosionTypes::Enemy_Line_Splash, FastEcslent::ExplosionTypes::Enemy_Splash, FastEcslent::Entity::engine, FastEcslent::Target::entity, FastEcslent::UnitAspect::entity, FastEcslent::Entity::entityId, FastEcslent::Engine::entityMgr, FastEcslent::Entity::entityState, FastEcslent::EntityMgr::ents, FastEcslent::Identity::id, FastEcslent::WeaponType::innerSplashRadius(), m_beingAttacked, m_cooldown, m_onfire, FastEcslent::Entity::speed, target, and weaponType.
void FastEcslent::Weapon::init | ( | void | ) | [virtual] |
Reimplemented from FastEcslent::UnitAspect.
Definition at line 24 of file unitWeapons.cpp.
References armor, BEINGATTACKED, damageMultiplier, FastEcslent::Engine::distanceMgr, distanceMgr, FastEcslent::Entity::engine, FastEcslent::UnitAspect::entity, FastEcslent::Entity::entityType, FastEcslent::Entity::hitpoints, FastEcslent::WeaponMgr::initArmor, FastEcslent::WeaponMgr::initDamageMultiplier, m_beingAttacked, m_cooldown, m_onfire, FastEcslent::WeaponMgr::maxHitpoints, STANDSTILL, FastEcslent::Engine::weaponMgr, weaponMgr, FastEcslent::WeaponMgr::weaponType, and weaponType.
Referenced by Weapon().
double FastEcslent::Weapon::isBeingAttacked | ( | ) | [inline] |
Definition at line 73 of file unitWeapons.h.
References m_beingAttacked.
Referenced by OgreGFX::GraphicsInteractionManager::copySimState().
void FastEcslent::Weapon::resetBeingAttack | ( | ) | [inline] |
Definition at line 74 of file unitWeapons.h.
References m_beingAttacked.
Referenced by OgreGFX::GraphicsInteractionManager::copySimState().
void FastEcslent::Weapon::dealDamageToTarget | ( | Target | tgt, | |
double | dt | |||
) |
void FastEcslent::Weapon::setTarget | ( | ) |
Target FastEcslent::Weapon::getTarget | ( | ) |
void FastEcslent::Weapon::takeDamage | ( | double | amt, | |
double | dt | |||
) |
virtual void FastEcslent::Weapon::tick | ( | double | dt | ) | [virtual] |
Reimplemented from FastEcslent::UnitAspect.
virtual void FastEcslent::Weapon::init | ( | ) | [virtual] |
Reimplemented from FastEcslent::UnitAspect.
void FastEcslent::Weapon::dealDamageToTarget | ( | Target | tgt, | |
double | dt | |||
) |
void FastEcslent::Weapon::setTarget | ( | ) |
Target FastEcslent::Weapon::getTarget | ( | ) |
void FastEcslent::Weapon::takeDamage | ( | double | amt, | |
double | dt | |||
) |
virtual void FastEcslent::Weapon::tick | ( | double | dt | ) | [virtual] |
Reimplemented from FastEcslent::UnitAspect.
virtual void FastEcslent::Weapon::init | ( | ) | [virtual] |
Reimplemented from FastEcslent::UnitAspect.
std::vector<Entity*> FastEcslent::Weapon::getUnitsInRadius | ( | Entity * | ent, | |
double | radius, | |||
bool | enemy | |||
) | [private] |
std::vector<FastEcslent::Entity*> FastEcslent::Weapon::getUnitsInRectangle | ( | Entity * | src, | |
Entity * | tgt, | |||
double | length, | |||
double | width, | |||
bool | enemy | |||
) | [private] |
bool FastEcslent::Weapon::isPointInRectangle | ( | Ogre::Vector3 | sp1, | |
Ogre::Vector3 | sp2, | |||
Ogre::Vector3 | sp3, | |||
Ogre::Vector3 | sp4, | |||
Ogre::Vector3 | point | |||
) | [private] |
double FastEcslent::Weapon::getAreaTriangle | ( | Ogre::Vector3 | tp1, | |
Ogre::Vector3 | tp2, | |||
Ogre::Vector3 | tp3 | |||
) | [private] |
void FastEcslent::Weapon::dealDamageToTarget | ( | Target | tgt, | |
double | dt | |||
) |
void FastEcslent::Weapon::dealEnemySplashDamageToTarget | ( | Target | tgt, | |
double | dt, | |||
double | radius | |||
) |
deal circle shapedsplash damage in front of the unit, like Hellion in StarCraft 2
void FastEcslent::Weapon::dealLineSplashDamageToTarget | ( | Target | tgt, | |
double | dt, | |||
double | length, | |||
double | width | |||
) |
deal line shaped splash damage in front of the unit, like Hellion in StarCraft 2
void FastEcslent::Weapon::setTarget | ( | ) |
Target FastEcslent::Weapon::getTarget | ( | ) |
void FastEcslent::Weapon::takeDamage | ( | double | amt | ) |
void FastEcslent::Weapon::takeDamage | ( | double | amt, | |
double | dt | |||
) |
virtual void FastEcslent::Weapon::tick | ( | double | dt | ) | [virtual] |
Reimplemented from FastEcslent::UnitAspect.
virtual void FastEcslent::Weapon::init | ( | ) | [virtual] |
Reimplemented from FastEcslent::UnitAspect.
double FastEcslent::Weapon::isBeingAttacked | ( | ) | [inline] |
void FastEcslent::Weapon::resetBeingAttack | ( | ) | [inline] |
void FastEcslent::Weapon::dealDamageToTarget | ( | Target | tgt, | |
double | dt | |||
) |
void FastEcslent::Weapon::setTarget | ( | ) |
Target FastEcslent::Weapon::getTarget | ( | ) |
void FastEcslent::Weapon::takeDamage | ( | double | amt, | |
double | dt | |||
) |
virtual void FastEcslent::Weapon::tick | ( | double | dt | ) | [virtual] |
Reimplemented from FastEcslent::UnitAspect.
virtual void FastEcslent::Weapon::init | ( | ) | [virtual] |
Reimplemented from FastEcslent::UnitAspect.
Target FastEcslent::Weapon::target [private] |
int FastEcslent::Weapon::STANDSTILL [private] |
Definition at line 32 of file unitWeapons.h.
Referenced by dealDamageToTarget(), dealEnemySplashDamageToTarget(), dealLineSplashDamageToTarget(), and init().
int FastEcslent::Weapon::BEINGATTACKED [private] |
double FastEcslent::Weapon::m_cooldown [private] |
Definition at line 34 of file unitWeapons.h.
Referenced by dealDamageToTarget(), dealEnemySplashDamageToTarget(), dealLineSplashDamageToTarget(), init(), and tick().
double FastEcslent::Weapon::m_beingAttacked [private] |
Definition at line 35 of file unitWeapons.h.
Referenced by init(), isBeingAttacked(), resetBeingAttack(), takeDamage(), and tick().
double FastEcslent::Weapon::m_onfire [private] |
Definition at line 37 of file unitWeapons.h.
Referenced by dealDamageToTarget(), dealEnemySplashDamageToTarget(), dealLineSplashDamageToTarget(), init(), and tick().
Definition at line 39 of file unitWeapons.h.
Referenced by dealDamageToTarget(), dealEnemySplashDamageToTarget(), dealLineSplashDamageToTarget(), init(), tick(), and Weapon().
double FastEcslent::Weapon::armor |
Definition at line 29 of file unitWeapons.h.
Definition at line 31 of file unitWeapons.h.
Definition at line 35 of file unitWeapons.h.
Definition at line 38 of file unitWeapons.h.
Definition at line 39 of file unitWeapons.h.
Definition at line 38 of file unitWeapons.h.
Definition at line 39 of file unitWeapons.h.
Definition at line 39 of file unitWeapons.h.
Definition at line 45 of file unitWeapons.h.
Definition at line 46 of file unitWeapons.h.
Definition at line 38 of file unitWeapons.h.
Definition at line 39 of file unitWeapons.h.