#include <CombatProcess.h>
Inheritance diagram for CombatProcess:
Public Member Functions | |
CombatProcess () | |
CombatProcess (Actor *actor) | |
ENABLE_RUNTIME_CLASSTYPE () | |
virtual bool | run (const uint32 framenum) |
virtual void | terminate () |
ObjId | getTarget () |
void | setTarget (ObjId target_) |
ObjId | seekTarget () |
virtual void | dumpInfo () |
bool | loadData (IDataSource *ids, uint32 version) |
Protected Types | |
CM_WAITING = 0 | |
CM_PATHFINDING | |
CM_ATTACKING | |
enum | CombatMode { CM_WAITING = 0, CM_PATHFINDING, CM_ATTACKING } |
Protected Member Functions | |
virtual void | saveData (ODataSource *ods) |
bool | isValidTarget (Actor *target) |
bool | isEnemy (Actor *target) |
bool | inAttackRange () |
int | getTargetDirection () |
void | turnToDirection (int direction) |
void | waitForTarget () |
Protected Attributes | |
ObjId | target |
ObjId | fixedTarget |
enum CombatProcess::CombatMode | combatmode |
Definition at line 26 of file CombatProcess.h.
enum CombatProcess::CombatMode [protected] |
CombatProcess::CombatProcess | ( | ) |
Definition at line 44 of file CombatProcess.cpp.
CombatProcess::CombatProcess | ( | Actor * | actor | ) |
Definition at line 49 of file CombatProcess.cpp.
References CM_WAITING, combatmode, fixedTarget, Object::getObjId(), Process::item_num, target, and Process::type.
void CombatProcess::dumpInfo | ( | ) | [virtual] |
dump some info about this process to pout
Reimplemented from Process.
Definition at line 330 of file CombatProcess.cpp.
References Process::dumpInfo(), pout, and target.
CombatProcess::ENABLE_RUNTIME_CLASSTYPE | ( | ) |
Reimplemented from Process.
ObjId CombatProcess::getTarget | ( | ) |
Definition at line 157 of file CombatProcess.cpp.
References getActor(), isValidTarget(), and target.
Referenced by ActorAnimProcess::doSpecial().
int CombatProcess::getTargetDirection | ( | ) | [protected] |
Definition at line 241 of file CombatProcess.cpp.
References getActor(), Item::getDirToItemCentre(), Process::item_num, and target.
Referenced by run().
bool CombatProcess::inAttackRange | ( | ) | [protected] |
Definition at line 279 of file CombatProcess.cpp.
References Animation::attack, getActor(), Actor::getDir(), Item::getShapeInfo(), AnimationTracker::hitSomething(), AnimationTracker::init(), Process::item_num, ShapeInfo::monsterinfo, MonsterInfo::ranged, AnimationTracker::step(), and target.
Referenced by run().
bool CombatProcess::isEnemy | ( | Actor * | target | ) | [protected] |
Definition at line 202 of file CombatProcess.cpp.
References getActor(), Actor::getEnemyAlignment(), Process::item_num, and target.
Referenced by seekTarget().
bool CombatProcess::isValidTarget | ( | Actor * | target | ) | [protected] |
Definition at line 176 of file CombatProcess.cpp.
References Actor::ACT_FEIGNDEATH, WeaponInfo::DMG_UNDEAD, Item::FLG_FASTAREA, getActor(), Actor::getDefenseType(), Item::getShape(), Process::item_num, and target.
Referenced by getTarget(), run(), and seekTarget().
bool CombatProcess::loadData | ( | IDataSource * | ids, | |
uint32 | version | |||
) |
load Process data
Reimplemented from Process.
Definition at line 345 of file CombatProcess.cpp.
References combatmode, fixedTarget, Process::loadData(), and target.
bool CombatProcess::run | ( | const uint32 | framenum | ) | [virtual] |
Implements Process.
Definition at line 69 of file CombatProcess.cpp.
References Kernel::addProcess(), Animation::attack, CM_ATTACKING, CM_PATHFINDING, CM_WAITING, combatmode, Actor::doAnim(), Item::FLG_FASTAREA, Kernel::get_instance(), getActor(), Actor::getDex(), Actor::getDir(), Item::getFlags(), getTargetDirection(), Actor::hasAnim(), Animation::idle1, Animation::idle2, inAttackRange(), isValidTarget(), Process::item_num, pout, seekTarget(), target, turnToDirection(), Process::waitFor(), and waitForTarget().
void CombatProcess::saveData | ( | ODataSource * | ods | ) | [protected, virtual] |
save the Process data
Reimplemented from Process.
Definition at line 336 of file CombatProcess.cpp.
References combatmode, fixedTarget, Process::saveData(), target, ODataSource::write1(), and ODataSource::write2().
ObjId CombatProcess::seekTarget | ( | ) |
Definition at line 212 of file CombatProcess.cpp.
References CurrentMap::areaSearch(), fixedTarget, World::get_instance(), getActor(), World::getCurrentMap(), UCList::getSize(), UCList::getuint16(), isEnemy(), isValidTarget(), and Process::item_num.
Referenced by run(), and AmbushProcess::run().
void CombatProcess::setTarget | ( | ObjId | target_ | ) |
Definition at line 167 of file CombatProcess.cpp.
References fixedTarget, and target.
Referenced by ActorAnimProcess::doSpecial(), and Actor::receiveHit().
void CombatProcess::terminate | ( | ) | [virtual] |
terminate the process. This wakes up all processes waiting for it.
Reimplemented from Process.
Definition at line 60 of file CombatProcess.cpp.
References Actor::ACT_INCOMBAT, Actor::clearActorFlag(), getActor(), Process::item_num, and Process::terminate().
Referenced by Actor::clearInCombat().
void CombatProcess::turnToDirection | ( | int | direction | ) | [protected] |
Definition at line 249 of file CombatProcess.cpp.
References Animation::combatStand, Actor::doAnim(), Kernel::get_instance(), getActor(), Actor::getDir(), Kernel::getProcess(), Process::item_num, Animation::step, and Process::waitFor().
Referenced by run().
void CombatProcess::waitForTarget | ( | ) | [protected] |
Definition at line 303 of file CombatProcess.cpp.
References Kernel::addProcess(), Actor::doAnim(), Kernel::get_instance(), getActor(), Item::getMapNum(), Kernel::getProcess(), Item::getShapeInfo(), Process::item_num, ShapeInfo::monsterinfo, MonsterInfo::shifter, and Process::waitFor().
Referenced by run().
enum CombatProcess::CombatMode CombatProcess::combatmode [protected] |
Referenced by CombatProcess(), loadData(), run(), and saveData().
ObjId CombatProcess::fixedTarget [protected] |
Definition at line 58 of file CombatProcess.h.
Referenced by CombatProcess(), loadData(), saveData(), seekTarget(), and setTarget().
ObjId CombatProcess::target [protected] |
Definition at line 57 of file CombatProcess.h.
Referenced by CombatProcess(), dumpInfo(), getTarget(), getTargetDirection(), inAttackRange(), isEnemy(), isValidTarget(), loadData(), run(), saveData(), and setTarget().