#include <AvatarMoverProcess.h>
Inheritance diagram for AvatarMoverProcess:
Public Member Functions | |
AvatarMoverProcess () | |
virtual | ~AvatarMoverProcess () |
ENABLE_RUNTIME_CLASSTYPE () | |
virtual bool | run (const uint32 framenum) |
void | OnMouseDown (int button, int mx, int my) |
void | OnMouseUp (int button) |
bool | loadData (IDataSource *ids, uint32 version) |
Protected Member Functions | |
virtual void | saveData (ODataSource *ods) |
bool | handleHangingMode (const uint32 framenum) |
bool | handleCombatMode (const uint32 framenum) |
bool | handleNormalMode (const uint32 framenum) |
void | step (Animation::Sequence action, int direction, bool adjusted=false) |
void | jump (Animation::Sequence action, int direction) |
void | turnToDirection (int direction) |
bool | checkTurn (int direction, bool moving) |
bool | canAttack () |
Protected Attributes | |
uint32 | lastframe |
uint32 | lastAttack |
sint32 | idleTime |
Animation::Sequence | lastHeadShakeAnim |
MButton | mouseButton [2] |
Definition at line 26 of file AvatarMoverProcess.h.
AvatarMoverProcess::AvatarMoverProcess | ( | ) |
Definition at line 44 of file AvatarMoverProcess.cpp.
References MButton::curDown, idleTime, lastAttack, MButton::lastDown, lastframe, lastHeadShakeAnim, Animation::lookLeft, MBS_HANDLED, MBS_RELHANDLED, mouseButton, MButton::state, and Process::type.
AvatarMoverProcess::~AvatarMoverProcess | ( | ) | [virtual] |
Definition at line 60 of file AvatarMoverProcess.cpp.
bool AvatarMoverProcess::canAttack | ( | ) | [protected] |
Definition at line 818 of file AvatarMoverProcess.cpp.
References Actor::getDex(), getMainActor(), lastAttack, and lastframe.
Referenced by handleCombatMode().
bool AvatarMoverProcess::checkTurn | ( | int | direction, | |
bool | moving | |||
) | [protected] |
Definition at line 783 of file AvatarMoverProcess.cpp.
References Actor::ACT_COMBATRUN, Animation::combatStand, Actor::doAnim(), Actor::getActorFlags(), Actor::getDir(), Actor::getLastAnim(), getMainActor(), Actor::isInCombat(), Animation::run, turnToDirection(), Process::waitFor(), and Animation::walk.
Referenced by handleCombatMode(), handleNormalMode(), and step().
AvatarMoverProcess::ENABLE_RUNTIME_CLASSTYPE | ( | ) |
Reimplemented from Process.
bool AvatarMoverProcess::handleCombatMode | ( | const uint32 | framenum | ) | [protected] |
Definition at line 146 of file AvatarMoverProcess.cpp.
References MainActor::accumulateDex(), MainActor::accumulateStr(), Actor::ACT_COMBATRUN, Animation::advance, Animation::attack, canAttack(), checkTurn(), Animation::checkWeapon(), Animation::combatStand, Animation::die, Actor::doAnim(), DOUBLE_CLICK_TIMEOUT, Animation::fallBackwards, MusicProcess::get_instance(), GUIApp::get_instance(), GUIApp::getDesktopGump(), Actor::getDir(), Actor::getLastAnim(), getMainActor(), GUIApp::getMouseCoords(), GUIApp::getMouseDirection(), GUIApp::getMouseLength(), idleTime, GUIApp::isAvatarInStasis(), Animation::kick, lastAttack, MButton::lastDown, MBS_DOWN, MBS_HANDLED, MBS_RELHANDLED, mouseButton, MusicProcess::playCombatMusic(), Animation::readyWeapon, Animation::retreat, Animation::run, Actor::setActorFlag(), Animation::standUp, Animation::startBlock, MButton::state, Animation::stopBlock, Actor::toggleInCombat(), Gump::TraceObjId(), Animation::unreadyWeapon, Process::waitFor(), and Animation::walk.
Referenced by run().
bool AvatarMoverProcess::handleHangingMode | ( | const uint32 | framenum | ) | [protected] |
Definition at line 98 of file AvatarMoverProcess.cpp.
References Animation::climb40, Actor::doAnim(), DOUBLE_CLICK_TIMEOUT, MainActor::ensureGravityProcess(), GUIApp::get_instance(), getMainActor(), idleTime, GUIApp::isAvatarInStasis(), MButton::lastDown, MBS_DOWN, MBS_HANDLED, MBS_RELHANDLED, mouseButton, MButton::state, Animation::SUCCESS, GravityProcess::terminate(), Actor::tryAnim(), and Process::waitFor().
Referenced by run().
bool AvatarMoverProcess::handleNormalMode | ( | const uint32 | framenum | ) | [protected] |
Definition at line 330 of file AvatarMoverProcess.cpp.
References MainActor::accumulateDex(), MainActor::accumulateStr(), Actor::ACT_COMBATRUN, checkTurn(), Animation::checkWeapon(), Actor::clearActorFlag(), Animation::climb16, Animation::climb72, MButton::curDown, Animation::die, Actor::doAnim(), DOUBLE_CLICK_TIMEOUT, Animation::fallBackwards, Kernel::get_instance(), GUIApp::get_instance(), Actor::getActorFlags(), GUIApp::getDesktopGump(), Actor::getDir(), Actor::getLastAnim(), getMainActor(), GUIApp::getMouseCoords(), GUIApp::getMouseDirection(), GUIApp::getMouseLength(), Kernel::getProcess(), idleTime, GUIApp::isAvatarInStasis(), Animation::isCombatAnim(), Actor::isInCombat(), jump(), Animation::jump, Animation::jumpUp, MButton::lastDown, lastHeadShakeAnim, Animation::lookLeft, Animation::lookRight, MBS_DOWN, MBS_HANDLED, MBS_RELHANDLED, mouseButton, pout, Animation::readyWeapon, Animation::run, Animation::runningJump, Animation::stand, Animation::standUp, MButton::state, step(), Animation::step, Animation::SUCCESS, Actor::toggleInCombat(), Gump::TraceObjId(), Actor::tryAnim(), Animation::unreadyWeapon, Process::waitFor(), and Animation::walk.
Referenced by run().
void AvatarMoverProcess::jump | ( | Animation::Sequence | action, | |
int | direction | |||
) | [protected] |
Definition at line 676 of file AvatarMoverProcess.cpp.
References Actor::ACT_AIRWALK, Animation::airwalkJump, Actor::doAnim(), SettingManager::get(), Kernel::get_instance(), SettingManager::get_instance(), GUIApp::get_instance(), Actor::getActorFlags(), Item::getCentre(), GUIApp::getGameMapGump(), getItem(), getMainActor(), GUIApp::getMouseCoords(), Item::getShapeInfo(), Actor::getStr(), ShapeInfo::is_land(), Animation::jump, Animation::jumpUp, Animation::runningJump, Gump::ScreenSpaceToGump(), Animation::shakeHead, GameMapGump::TraceCoordinates(), and Process::waitFor().
Referenced by handleNormalMode().
bool AvatarMoverProcess::loadData | ( | IDataSource * | ids, | |
uint32 | version | |||
) |
load Process data
Reimplemented from Process.
Definition at line 876 of file AvatarMoverProcess.cpp.
References idleTime, lastAttack, lastHeadShakeAnim, and Process::loadData().
void AvatarMoverProcess::OnMouseDown | ( | int | button, | |
int | mx, | |||
int | my | |||
) |
Definition at line 824 of file AvatarMoverProcess.cpp.
References BUTTON_LEFT, BUTTON_RIGHT, MButton::curDown, MButton::lastDown, MBS_DOWN, MBS_HANDLED, mouseButton, and MButton::state.
Referenced by GameMapGump::OnMouseDown().
void AvatarMoverProcess::OnMouseUp | ( | int | button | ) |
Definition at line 850 of file AvatarMoverProcess.cpp.
References BUTTON_LEFT, BUTTON_RIGHT, MBS_DOWN, MBS_RELHANDLED, mouseButton, and MButton::state.
Referenced by GameMapGump::OnMouseUp().
bool AvatarMoverProcess::run | ( | const uint32 | framenum | ) | [virtual] |
Implements Process.
Definition at line 65 of file AvatarMoverProcess.cpp.
References Actor::ACT_COMBATRUN, Kernel::get_instance(), Actor::getActorFlags(), Item::getGravityPID(), Actor::getLastAnim(), getMainActor(), handleCombatMode(), handleHangingMode(), handleNormalMode(), Animation::hang, idleTime, Actor::isInCombat(), and lastframe.
void AvatarMoverProcess::saveData | ( | ODataSource * | ods | ) | [protected, virtual] |
save the Process data
Reimplemented from Process.
Definition at line 867 of file AvatarMoverProcess.cpp.
References idleTime, lastAttack, lastHeadShakeAnim, Process::saveData(), ODataSource::write2(), and ODataSource::write4().
void AvatarMoverProcess::step | ( | Animation::Sequence | action, | |
int | direction, | |||
bool | adjusted = false | |||
) | [protected] |
Definition at line 606 of file AvatarMoverProcess.cpp.
References checkTurn(), Animation::checkWeapon(), Actor::doAnim(), Animation::END_OFF_LAND, Animation::FAILURE, Actor::getLastAnim(), getMainActor(), Animation::keepBalance, Animation::run, Animation::stand, Animation::step, Actor::tryAnim(), Process::waitFor(), and Animation::walk.
Referenced by handleNormalMode(), and turnToDirection().
void AvatarMoverProcess::turnToDirection | ( | int | direction | ) | [protected] |
Definition at line 733 of file AvatarMoverProcess.cpp.
References Actor::ACT_COMBATRUN, Animation::combatStand, Actor::doAnim(), Kernel::get_instance(), Actor::getActorFlags(), Actor::getDir(), getMainActor(), Kernel::getProcess(), Actor::isInCombat(), Animation::lookLeft, Animation::lookRight, Animation::stand, step(), and Process::waitFor().
Referenced by checkTurn().
sint32 AvatarMoverProcess::idleTime [protected] |
Definition at line 60 of file AvatarMoverProcess.h.
Referenced by AvatarMoverProcess(), handleCombatMode(), handleHangingMode(), handleNormalMode(), loadData(), run(), and saveData().
uint32 AvatarMoverProcess::lastAttack [protected] |
Definition at line 57 of file AvatarMoverProcess.h.
Referenced by AvatarMoverProcess(), canAttack(), handleCombatMode(), loadData(), and saveData().
uint32 AvatarMoverProcess::lastframe [protected] |
Definition at line 54 of file AvatarMoverProcess.h.
Referenced by AvatarMoverProcess(), canAttack(), and run().
Definition at line 61 of file AvatarMoverProcess.h.
Referenced by AvatarMoverProcess(), handleNormalMode(), loadData(), and saveData().
MButton AvatarMoverProcess::mouseButton[2] [protected] |
Definition at line 63 of file AvatarMoverProcess.h.
Referenced by AvatarMoverProcess(), handleCombatMode(), handleHangingMode(), handleNormalMode(), OnMouseDown(), and OnMouseUp().