Actor Class Reference

#include <Actor.h>

Inheritance diagram for Actor:

Container Item Object MainActor List of all members.

Public Types

 ACT_INVINCIBLE = 0x000001
 ACT_ASCENDING = 0x000002
 ACT_DESCENDING = 0x000004
 ACT_ANIMLOCK = 0x000008
 ACT_FIRSTSTEP = 0x000400
 ACT_INCOMBAT = 0x000800
 ACT_DEAD = 0x001000
 ACT_COMBATRUN = 0x008000
 ACT_AIRWALK = 0x010000
 ACT_IMMORTAL = 0x040000
 ACT_WITHSTANDDEATH = 0x080000
 ACT_FEIGNDEATH = 0x100000
 ACT_STUNNED = 0x200000
 ACT_POISONED = 0x400000
 ACT_PATHFINDING = 0x800000
enum  ActorFlags {
  ACT_INVINCIBLE = 0x000001, ACT_ASCENDING = 0x000002, ACT_DESCENDING = 0x000004, ACT_ANIMLOCK = 0x000008,
  ACT_FIRSTSTEP = 0x000400, ACT_INCOMBAT = 0x000800, ACT_DEAD = 0x001000, ACT_COMBATRUN = 0x008000,
  ACT_AIRWALK = 0x010000, ACT_IMMORTAL = 0x040000, ACT_WITHSTANDDEATH = 0x080000, ACT_FEIGNDEATH = 0x100000,
  ACT_STUNNED = 0x200000, ACT_POISONED = 0x400000, ACT_PATHFINDING = 0x800000
}

Public Member Functions

 Actor ()
 ~Actor ()
sint16 getStr () const
void setStr (sint16 str)
sint16 getDex () const
void setDex (sint16 dex)
sint16 getInt () const
void setInt (sint16 int_)
uint16 getHP () const
void setHP (uint16 hp)
sint16 getMana () const
void setMana (sint16 mp)
sint16 getMaxMana () const
uint16 getMaxHP () const
bool isDead () const
bool isInCombat () const
void toggleInCombat ()
CombatProcessgetCombatProcess ()
virtual void setInCombat ()
virtual void clearInCombat ()
uint16 getAlignment () const
void setAlignment (uint16 a)
uint16 getEnemyAlignment () const
void setEnemyAlignment (uint16 a)
Animation::Sequence getLastAnim () const
void setLastAnim (Animation::Sequence anim)
uint16 getDir () const
void setDir (uint16 dir)
sint32 getFallStart () const
void setFallStart (sint32 z)
void setUnk0C (uint8 b)
uint32 getActorFlags () const
void setActorFlag (uint32 mask)
void clearActorFlag (uint32 mask)
bool loadMonsterStats ()
bool giveTreasure ()
virtual void teleport (int mapnum, sint32 x, sint32 y, sint32 z)
virtual bool removeItem (Item *item)
uint16 schedule (uint32 time)
bool setEquip (Item *item, bool checkwghtvol=false)
uint16 getEquip (uint32 type)
virtual uint32 getArmourClass ()
virtual uint16 getDefenseType ()
virtual sint16 getAttackingDex ()
virtual sint16 getDefendingDex ()
virtual uint16 getDamageType ()
virtual int getDamageAmount ()
int calculateAttackDamage (uint16 other, int damage, uint16 type)
virtual void receiveHit (uint16 other, int dir, int damage, uint16 type)
virtual ProcId die (uint16 damageType)
void killAllButCombatProcesses ()
ProcId killAllButFallAnims (bool death)
bool areEnemiesNear ()
uint16 cSetActivity (int activity)
uint16 doAnim (Animation::Sequence anim, int dir, unsigned int steps=0)
bool hasAnim (Animation::Sequence anim)
Animation::Result tryAnim (Animation::Sequence anim, int dir, unsigned int steps=0, PathfindingState *state=0)
virtual uint16 assignObjId ()
virtual void dumpInfo ()
bool loadData (IDataSource *ids, uint32 version)
 ENABLE_RUNTIME_CLASSTYPE ()
 INTRINSIC (I_isNPC)
 INTRINSIC (I_getDir)
 INTRINSIC (I_getLastAnimSet)
 INTRINSIC (I_pathfindToItem)
 INTRINSIC (I_pathfindToPoint)
 INTRINSIC (I_getStr)
 INTRINSIC (I_getDex)
 INTRINSIC (I_getInt)
 INTRINSIC (I_getHp)
 INTRINSIC (I_getMana)
 INTRINSIC (I_getAlignment)
 INTRINSIC (I_getEnemyAlignment)
 INTRINSIC (I_setStr)
 INTRINSIC (I_setDex)
 INTRINSIC (I_setInt)
 INTRINSIC (I_setHp)
 INTRINSIC (I_setMana)
 INTRINSIC (I_setAlignment)
 INTRINSIC (I_setEnemyAlignment)
 INTRINSIC (I_getMap)
 INTRINSIC (I_teleport)
 INTRINSIC (I_doAnim)
 INTRINSIC (I_isInCombat)
 INTRINSIC (I_setInCombat)
 INTRINSIC (I_clrInCombat)
 INTRINSIC (I_setTarget)
 INTRINSIC (I_getTarget)
 INTRINSIC (I_isEnemy)
 INTRINSIC (I_isDead)
 INTRINSIC (I_setDead)
 INTRINSIC (I_clrDead)
 INTRINSIC (I_isImmortal)
 INTRINSIC (I_setImmortal)
 INTRINSIC (I_clrImmortal)
 INTRINSIC (I_isWithstandDeath)
 INTRINSIC (I_setWithstandDeath)
 INTRINSIC (I_clrWithstandDeath)
 INTRINSIC (I_isFeignDeath)
 INTRINSIC (I_setFeignDeath)
 INTRINSIC (I_clrFeignDeath)
 INTRINSIC (I_areEnemiesNear)
 INTRINSIC (I_isBusy)
 INTRINSIC (I_createActor)
 INTRINSIC (I_cSetActivity)
 INTRINSIC (I_setAirWalkEnabled)
 INTRINSIC (I_getAirWalkEnabled)
 INTRINSIC (I_schedule)
 INTRINSIC (I_getEquip)
 INTRINSIC (I_setEquip)

Static Public Member Functions

static ActorcreateActor (uint32 shape, uint32 frame)

Protected Member Functions

virtual void saveData (ODataSource *ods)

Protected Attributes

sint16 strength
sint16 dexterity
sint16 intelligence
uint16 hitpoints
sint16 mana
uint16 alignment
uint16 enemyalignment
Animation::Sequence lastanim
uint16 animframe
uint16 direction
sint32 fallstart
uint8 unk0C
uint32 actorflags

Friends

class ActorAnimProcess
class AnimationTracker

Detailed Description

Definition at line 30 of file Actor.h.


Member Enumeration Documentation

enum Actor::ActorFlags

Enumerator:
ACT_INVINCIBLE 
ACT_ASCENDING 
ACT_DESCENDING 
ACT_ANIMLOCK 
ACT_FIRSTSTEP 
ACT_INCOMBAT 
ACT_DEAD 
ACT_COMBATRUN 
ACT_AIRWALK 
ACT_IMMORTAL 
ACT_WITHSTANDDEATH 
ACT_FEIGNDEATH 
ACT_STUNNED 
ACT_POISONED 
ACT_PATHFINDING 

Definition at line 215 of file Actor.h.


Constructor & Destructor Documentation

Actor::Actor (  ) 

Definition at line 59 of file Actor.cpp.

Actor::~Actor (  ) 

Definition at line 68 of file Actor.cpp.


Member Function Documentation

bool Actor::areEnemiesNear (  ) 

check if NPCs are near which are in combat mode and hostile

Definition at line 1055 of file Actor.cpp.

References ACT_DEAD, ACT_FEIGNDEATH, ACT_INCOMBAT, CurrentMap::areaSearch(), World::get_instance(), getActor(), World::getCurrentMap(), UCList::getSize(), and UCList::getuint16().

uint16 Actor::assignObjId (  )  [virtual]

Assign self and contents an objID

Returns:
the assiged ID

Reimplemented from Container.

Definition at line 73 of file Actor.cpp.

References ObjectManager::assignActorObjId(), Container::contents, ObjectManager::get_instance(), and Object::objid.

Referenced by ItemFactory::createActor().

int Actor::calculateAttackDamage ( uint16  other,
int  damage,
uint16  type 
)

calculate the damage an attack against this Actor does.

Parameters:
other the attacker (can be zero)
damage base damage
type damage type
Returns:
the amount of damage to be applied. Zero if attack missed.

Definition at line 906 of file Actor.cpp.

References MainActor::accumulateDex(), ACT_STUNNED, WeaponInfo::DMG_BLADE, WeaponInfo::DMG_FIRE, WeaponInfo::DMG_MAGIC, WeaponInfo::DMG_PIERCE, WeaponInfo::DMG_SLAYER, WeaponInfo::DMG_UNDEAD, getActor(), getActorFlags(), getArmourClass(), getAttackingDex(), getDefendingDex(), getDefenseType(), getLastAnim(), getMainActor(), getStr(), Animation::startBlock, and Animation::stopBlock.

Referenced by receiveHit().

void Actor::clearActorFlag ( uint32  mask  )  [inline]

Definition at line 78 of file Actor.h.

References actorflags.

Referenced by MainActor::clearInCombat(), clearInCombat(), MainActor::ConCmd_toggleInvincibility(), die(), AvatarMoverProcess::handleNormalMode(), World::loadItemCachNPCData(), receiveHit(), ResurrectionProcess::run(), ClearFeignDeathProcess::run(), PathfinderProcess::terminate(), CombatProcess::terminate(), ActorAnimProcess::terminate(), and AnimationTracker::updateActorFlags().

void Actor::clearInCombat (  )  [virtual]

Reimplemented in MainActor.

Definition at line 1045 of file Actor.cpp.

References ACT_INCOMBAT, actorflags, clearActorFlag(), getCombatProcess(), and CombatProcess::terminate().

Referenced by toggleInCombat().

Actor * Actor::createActor ( uint32  shape,
uint32  frame 
) [static]

create an actor, assign objid, make it ethereal and load monster stats.

Definition at line 1093 of file Actor.cpp.

References ItemFactory::createActor(), World::etherealPush(), Item::FLG_ETHEREAL, Item::FLG_IN_NPC_LIST, World::get_instance(), getMainActor(), Item::getMapNum(), Object::getObjId(), loadMonsterStats(), perr, Item::setFlag(), Item::setMapNum(), and Item::setNpcNum().

Referenced by ActorAnimProcess::doSpecial().

uint16 Actor::cSetActivity ( int  activity  ) 

starts an activity

Returns:
processID of process handling the activity or zero

Definition at line 540 of file Actor.cpp.

References Kernel::addProcess(), doAnim(), Kernel::get_instance(), perr, setInCombat(), and Animation::stand.

Referenced by MonsterEgg::hatch().

ProcId Actor::die ( uint16  damageType  )  [virtual]

die

Parameters:
damageType damage type that caused the death
Returns:
the process ID of the death animation

Reimplemented in MainActor.

Definition at line 755 of file Actor.cpp.

References ACT_DEAD, ACT_INCOMBAT, Kernel::addProcess(), clearActorFlag(), ItemFactory::createItem(), Container::destroyContents(), Animation::die, WeaponInfo::DMG_FIRE, doAnim(), MonsterInfo::explode, Item::FLG_FAST_ONLY, Shape::frameCount(), GameData::get_instance(), MusicProcess::get_instance(), Kernel::get_instance(), getAlignment(), getDir(), getEnemyAlignment(), getMainActor(), GameData::getMainShapes(), Object::getObjId(), Kernel::getProcess(), ShapeArchive::getShape(), Item::getShapeInfo(), giveTreasure(), isInCombat(), killAllButFallAnims(), Kernel::killProcesses(), ShapeInfo::monsterinfo, Item::move(), MusicProcess::playCombatMusic(), pout, MusicProcess::queueMusic(), MonsterInfo::resurrection, setActorFlag(), setHP(), Animation::standUp, Process::waitFor(), Item::x, Item::y, and Item::z.

Referenced by MainActor::die(), and receiveHit().

uint16 Actor::doAnim ( Animation::Sequence  anim,
int  dir,
unsigned int  steps = 0 
)

run the given animation

Returns:
the PID of the ActorAnimProcess

Definition at line 451 of file Actor.cpp.

References ActorAnimProcess, Kernel::addProcess(), Kernel::get_instance(), perr, and tryAnim().

Referenced by AvatarMoverProcess::checkTurn(), cSetActivity(), die(), ActorAnimProcess::doSpecial(), GameMapGump::DropItem(), AvatarMoverProcess::handleCombatMode(), AvatarMoverProcess::handleHangingMode(), AvatarMoverProcess::handleNormalMode(), AvatarMoverProcess::jump(), receiveHit(), PathfinderProcess::run(), LoiterProcess::run(), CombatProcess::run(), AvatarGravityProcess::run(), ActorBarkNotifyProcess::run(), AvatarMoverProcess::step(), GravityProcess::terminate(), CombatProcess::turnToDirection(), AvatarMoverProcess::turnToDirection(), and CombatProcess::waitForTarget().

void Actor::dumpInfo (  )  [virtual]

dump some info about this item to pout

Reimplemented from Container.

Definition at line 1118 of file Actor.cpp.

References actorflags, dexterity, Container::dumpInfo(), getAlignment(), getArmourClass(), getDefenseType(), getEnemyAlignment(), hitpoints, intelligence, mana, pout, and strength.

Referenced by AnimationTracker::checkWeaponHit().

Actor::ENABLE_RUNTIME_CLASSTYPE (  ) 

Reimplemented from Container.

Reimplemented in MainActor.

uint32 Actor::getActorFlags (  )  const [inline]

Definition at line 76 of file Actor.h.

References actorflags.

Referenced by calculateAttackDamage(), AvatarMoverProcess::checkTurn(), MainActor::ConCmd_toggleInvincibility(), ActorAnimProcess::doHitSpecial(), AnimAction::getAnimRange(), AvatarMoverProcess::handleNormalMode(), AnimationTracker::init(), ActorAnimProcess::init(), AvatarMoverProcess::jump(), PathfindingState::load(), MenuGump::OnKeyDown(), MusicProcess::playMusic(), receiveHit(), PathfinderProcess::run(), AvatarMoverProcess::run(), AvatarDeathProcess::run(), GUIApp::saveGame(), MenuGump::selectEntry(), and AvatarMoverProcess::turnToDirection().

uint16 Actor::getAlignment (  )  const [inline]

Definition at line 63 of file Actor.h.

References alignment.

Referenced by die(), and dumpInfo().

uint32 Actor::getArmourClass (  )  [virtual]

Reimplemented in MainActor.

Definition at line 562 of file Actor.cpp.

References MonsterInfo::armour_class, Item::getShapeInfo(), and ShapeInfo::monsterinfo.

Referenced by calculateAttackDamage(), dumpInfo(), and PaperdollGump::PaintStats().

sint16 Actor::getAttackingDex (  )  [virtual]

Reimplemented in MainActor.

Definition at line 585 of file Actor.cpp.

References getDex().

Referenced by calculateAttackDamage().

CombatProcess * Actor::getCombatProcess (  ) 

Definition at line 1013 of file Actor.cpp.

References Kernel::findProcess(), Kernel::get_instance(), and Object::objid.

Referenced by clearInCombat(), ActorAnimProcess::doSpecial(), receiveHit(), AmbushProcess::run(), and setInCombat().

int Actor::getDamageAmount (  )  [virtual]

Reimplemented in MainActor.

Definition at line 600 of file Actor.cpp.

References Item::getShapeInfo(), max(), MonsterInfo::max_dmg, min(), MonsterInfo::min_dmg, and ShapeInfo::monsterinfo.

Referenced by receiveHit().

uint16 Actor::getDamageType (  )  [virtual]

get the damage type this object does when hitting something

Reimplemented from Item.

Reimplemented in MainActor.

Definition at line 590 of file Actor.cpp.

References MonsterInfo::damage_type, WeaponInfo::DMG_NORMAL, Item::getShapeInfo(), and ShapeInfo::monsterinfo.

Referenced by MainActor::getDamageType().

sint16 Actor::getDefendingDex (  )  [virtual]

Reimplemented in MainActor.

Definition at line 580 of file Actor.cpp.

References getDex().

Referenced by calculateAttackDamage().

uint16 Actor::getDefenseType (  )  [virtual]

Reimplemented in MainActor.

Definition at line 571 of file Actor.cpp.

References MonsterInfo::defense_type, Item::getShapeInfo(), and ShapeInfo::monsterinfo.

Referenced by calculateAttackDamage(), dumpInfo(), and CombatProcess::isValidTarget().

sint16 Actor::getDex (  )  const [inline]

Definition at line 40 of file Actor.h.

References dexterity.

Referenced by AvatarMoverProcess::canAttack(), GameMapGump::DropItem(), MainActor::getAttackingDex(), getAttackingDex(), MainActor::getDefendingDex(), getDefendingDex(), PaperdollGump::PaintStats(), CombatProcess::run(), U8Game::writeSaveInfo(), and RemorseGame::writeSaveInfo().

uint16 Actor::getDir (  )  const [inline]

Definition at line 70 of file Actor.h.

References direction.

Referenced by AvatarMoverProcess::checkTurn(), die(), ActorAnimProcess::doSpecial(), AnimAction::getAnimRange(), AvatarMoverProcess::handleCombatMode(), AvatarMoverProcess::handleNormalMode(), CombatProcess::inAttackRange(), ActorAnimProcess::init(), PathfindingState::load(), CombatProcess::run(), AvatarGravityProcess::run(), GravityProcess::terminate(), tryAnim(), CombatProcess::turnToDirection(), and AvatarMoverProcess::turnToDirection().

uint16 Actor::getEnemyAlignment (  )  const [inline]

Definition at line 65 of file Actor.h.

References enemyalignment.

Referenced by die(), dumpInfo(), and CombatProcess::isEnemy().

uint16 Actor::getEquip ( uint32  type  ) 

Definition at line 402 of file Actor.cpp.

References Container::contents, and Item::FLG_EQUIPPED.

Referenced by Container::CanAddItem(), U8Game::ConCmd_cheatEquip(), U8Game::ConCmd_cheatItems(), MainActor::ConCmd_useBackpack(), ActorAnimProcess::doHitSpecial(), ActorAnimProcess::doSpecial(), PaperdollGump::DraggingItem(), GameMapGump::DraggingItem(), PaperdollGump::DropItem(), GameMapGump::DropItem(), MainActor::getAttackingDex(), MainActor::getDamageAmount(), MainActor::getDamageType(), MainActor::getDefendingDex(), MainActor::getWeaponOverlay(), PaperdollGump::PaintThis(), PaperdollGump::TraceObjId(), U8Game::writeSaveInfo(), and RemorseGame::writeSaveInfo().

sint32 Actor::getFallStart (  )  const [inline]

Definition at line 72 of file Actor.h.

References fallstart.

Referenced by GravityProcess::run(), and GravityProcess::terminate().

uint16 Actor::getHP (  )  const [inline]

Definition at line 44 of file Actor.h.

References hitpoints.

Referenced by HealProcess::feedAvatar(), PaperdollGump::PaintStats(), MiniStatsGump::PaintThis(), HealProcess::run(), GravityProcess::terminate(), U8Game::writeSaveInfo(), and RemorseGame::writeSaveInfo().

sint16 Actor::getInt (  )  const [inline]

Definition at line 42 of file Actor.h.

References intelligence.

Referenced by getMaxMana(), PaperdollGump::PaintStats(), U8Game::writeSaveInfo(), and RemorseGame::writeSaveInfo().

Animation::Sequence Actor::getLastAnim (  )  const [inline]

Definition at line 68 of file Actor.h.

References lastanim.

Referenced by calculateAttackDamage(), AvatarMoverProcess::checkTurn(), AnimAction::getAnimRange(), MainActor::getDamageAmount(), AvatarMoverProcess::handleCombatMode(), AvatarMoverProcess::handleNormalMode(), PathfindingState::load(), receiveHit(), AvatarMoverProcess::run(), AvatarGravityProcess::run(), ActorBarkNotifyProcess::run(), AvatarMoverProcess::step(), and GravityProcess::terminate().

sint16 Actor::getMana (  )  const [inline]

Definition at line 46 of file Actor.h.

References mana.

Referenced by PaperdollGump::PaintStats(), MiniStatsGump::PaintThis(), HealProcess::run(), U8Game::writeSaveInfo(), and RemorseGame::writeSaveInfo().

uint16 Actor::getMaxHP (  )  const

Definition at line 92 of file Actor.cpp.

References getStr().

Referenced by MainActor::ConCmd_heal(), MainActor::ConCmd_maxstats(), HealProcess::feedAvatar(), MiniStatsGump::PaintThis(), receiveHit(), U8Game::writeSaveInfo(), and RemorseGame::writeSaveInfo().

sint16 Actor::getMaxMana (  )  const

Definition at line 87 of file Actor.cpp.

References getInt().

Referenced by MainActor::ConCmd_heal(), MainActor::ConCmd_maxstats(), MiniStatsGump::PaintThis(), U8Game::writeSaveInfo(), and RemorseGame::writeSaveInfo().

sint16 Actor::getStr (  )  const [inline]

Definition at line 38 of file Actor.h.

References strength.

Referenced by calculateAttackDamage(), Container::CanAddItem(), GameMapGump::DraggingItem(), GameMapGump::DropItem(), MainActor::getDamageAmount(), getMaxHP(), Item::getThrowRange(), AvatarMoverProcess::jump(), PaperdollGump::PaintStats(), U8Game::writeSaveInfo(), and RemorseGame::writeSaveInfo().

bool Actor::giveTreasure (  ) 

add treasure according to the TreasureInfo in the MonsterInfo

Returns:
true if a MonsterInfo struct was found, false otherwise

Definition at line 126 of file Actor.cpp.

References Item::callUsecodeEvent_combine(), ItemFactory::createItem(), Item::FLG_DISPOSABLE, Item::frame, World::get_instance(), GameData::get_instance(), Pentagram::Archive::getCount(), World::getCurrentMap(), GameData::getMainShapes(), CurrentMap::getNum(), MainShapeArchive::getShapeInfo(), Item::getShapeInfo(), ShapeInfo::hasQuantity(), ShapeInfo::monsterinfo, Item::moveToContainer(), n, perr, pout, Item::quality, Item::randomGumpLocation(), Item::shape, MonsterInfo::treasure, WeaponInfo::treasure_chance, and ShapeInfo::weaponinfo.

Referenced by die().

bool Actor::hasAnim ( Animation::Sequence  anim  ) 

check if this actor has a specific animation

Definition at line 471 of file Actor.cpp.

References AnimationTracker::init().

Referenced by LoiterProcess::run(), CombatProcess::run(), and ActorBarkNotifyProcess::run().

Actor::INTRINSIC ( I_setEquip   ) 

Actor::INTRINSIC ( I_getEquip   ) 

Actor::INTRINSIC ( I_schedule   ) 

Actor::INTRINSIC ( I_getAirWalkEnabled   ) 

Actor::INTRINSIC ( I_setAirWalkEnabled   ) 

Actor::INTRINSIC ( I_cSetActivity   ) 

Actor::INTRINSIC ( I_createActor   ) 

Actor::INTRINSIC ( I_isBusy   ) 

Actor::INTRINSIC ( I_areEnemiesNear   ) 

Actor::INTRINSIC ( I_clrFeignDeath   ) 

Actor::INTRINSIC ( I_setFeignDeath   ) 

Actor::INTRINSIC ( I_isFeignDeath   ) 

Actor::INTRINSIC ( I_clrWithstandDeath   ) 

Actor::INTRINSIC ( I_setWithstandDeath   ) 

Actor::INTRINSIC ( I_isWithstandDeath   ) 

Actor::INTRINSIC ( I_clrImmortal   ) 

Actor::INTRINSIC ( I_setImmortal   ) 

Actor::INTRINSIC ( I_isImmortal   ) 

Actor::INTRINSIC ( I_clrDead   ) 

Actor::INTRINSIC ( I_setDead   ) 

Actor::INTRINSIC ( I_isDead   ) 

Actor::INTRINSIC ( I_isEnemy   ) 

Actor::INTRINSIC ( I_getTarget   ) 

Actor::INTRINSIC ( I_setTarget   ) 

Actor::INTRINSIC ( I_clrInCombat   ) 

Actor::INTRINSIC ( I_setInCombat   ) 

Actor::INTRINSIC ( I_isInCombat   ) 

Actor::INTRINSIC ( I_doAnim   ) 

Actor::INTRINSIC ( I_teleport   ) 

Actor::INTRINSIC ( I_getMap   ) 

Actor::INTRINSIC ( I_setEnemyAlignment   ) 

Actor::INTRINSIC ( I_setAlignment   ) 

Actor::INTRINSIC ( I_setMana   ) 

Actor::INTRINSIC ( I_setHp   ) 

Actor::INTRINSIC ( I_setInt   ) 

Actor::INTRINSIC ( I_setDex   ) 

Actor::INTRINSIC ( I_setStr   ) 

Actor::INTRINSIC ( I_getEnemyAlignment   ) 

Actor::INTRINSIC ( I_getAlignment   ) 

Actor::INTRINSIC ( I_getMana   ) 

Actor::INTRINSIC ( I_getHp   ) 

Actor::INTRINSIC ( I_getInt   ) 

Actor::INTRINSIC ( I_getDex   ) 

Actor::INTRINSIC ( I_getStr   ) 

Actor::INTRINSIC ( I_pathfindToPoint   ) 

Actor::INTRINSIC ( I_pathfindToItem   ) 

Actor::INTRINSIC ( I_getLastAnimSet   ) 

Actor::INTRINSIC ( I_getDir   ) 

Actor::INTRINSIC ( I_isNPC   ) 

bool Actor::isDead (  )  const [inline]

Definition at line 52 of file Actor.h.

References ACT_DEAD, and actorflags.

Referenced by Item::canDrag(), Item::enterFastArea(), HealProcess::feedAvatar(), receiveHit(), ResurrectionProcess::run(), LoiterProcess::run(), HealProcess::run(), ActorBarkNotifyProcess::run(), schedule(), GravityProcess::terminate(), and Item::use().

bool Actor::isInCombat (  )  const [inline]

Definition at line 54 of file Actor.h.

References ACT_INCOMBAT, and actorflags.

Referenced by AvatarMoverProcess::checkTurn(), die(), Pathfinder::expandNode(), GUIApp::getMouseFrame(), MainActor::getWeaponOverlay(), AvatarMoverProcess::handleNormalMode(), PathfindingState::load(), GameMapGump::OnMouseClick(), GameMapGump::OnMouseDouble(), MusicProcess::playMusic(), receiveHit(), PathfinderProcess::run(), AvatarMoverProcess::run(), GravityProcess::terminate(), toggleInCombat(), and AvatarMoverProcess::turnToDirection().

void Actor::killAllButCombatProcesses (  ) 

kill all processes except those related to combat

Definition at line 845 of file Actor.cpp.

References Kernel::get_instance(), Kernel::getProcessBeginIterator(), Kernel::getProcessEndIterator(), and Object::objid.

Referenced by killAllButFallAnims().

ProcId Actor::killAllButFallAnims ( bool  death  ) 

kill all animation processes except those related to dying/falling

Returns:
PID of animprocess doing the falling (or getting up)

Definition at line 866 of file Actor.cpp.

References Animation::die, Kernel::get_instance(), Kernel::getProcessBeginIterator(), Kernel::getProcessEndIterator(), killAllButCombatProcesses(), Kernel::killProcessesNotOfType(), Object::objid, and Animation::standUp.

Referenced by die(), and receiveHit().

bool Actor::loadData ( IDataSource ids,
uint32  version 
)

Reimplemented from Container.

Reimplemented in MainActor.

Definition at line 1148 of file Actor.cpp.

References actorflags, alignment, animframe, dexterity, direction, enemyalignment, fallstart, hitpoints, intelligence, lastanim, Container::loadData(), mana, strength, and unk0C.

Referenced by MainActor::loadData().

bool Actor::loadMonsterStats (  ) 

set stats from MonsterInfo (hp, dex, alignment, enemyalignment)

Returns:
true if a MonsterInfo struct was found, false otherwise

Definition at line 97 of file Actor.cpp.

References MonsterInfo::alignment, alignment, Item::getShapeInfo(), MonsterInfo::max_dex, MonsterInfo::max_hp, MonsterInfo::min_dex, MonsterInfo::min_hp, ShapeInfo::monsterinfo, setAlignment(), setDex(), setEnemyAlignment(), and setHP().

Referenced by createActor(), MonsterEgg::hatch(), and ResurrectionProcess::run().

void Actor::receiveHit ( uint16  other,
int  dir,
int  damage,
uint16  type 
) [virtual]

receive a hit

Parameters:
damage base damage (or zero to use attacker's default damage)
type damage type (or zero to use attacker's default type)

Reimplemented in MainActor.

Definition at line 617 of file Actor.cpp.

References MainActor::accumulateStr(), ACT_IMMORTAL, ACT_INVINCIBLE, ACT_WITHSTANDDEATH, Kernel::addProcess(), calculateAttackDamage(), clearActorFlag(), Animation::combatStand, die(), WeaponInfo::DMG_FALLING, doAnim(), Animation::fallBackwards, AudioProcess::get_instance(), Kernel::get_instance(), getActor(), getActorFlags(), getCombatProcess(), getDamageAmount(), Item::getDamageType(), getItem(), getLastAnim(), Item::getLocation(), getMainActor(), getMaxHP(), Object::getObjId(), Kernel::getProcess(), hitpoints, isDead(), isInCombat(), Animation::kick, killAllButFallAnims(), Object::objid, AudioProcess::playSFX(), pout, setHP(), setInCombat(), CombatProcess::setTarget(), Animation::stand, Animation::startBlock, Animation::stopBlock, Animation::stumbleBackwards, Process::waitFor(), Item::x, Item::y, and Item::z.

Referenced by MainActor::receiveHit(), GrantPeaceProcess::run(), FireballProcess::run(), and GravityProcess::terminate().

bool Actor::removeItem ( Item item  )  [virtual]

Remove an item from the container. This does NOT update item.

Parameters:
item The item to remove
Returns:
true if succesful, false if item wasn't in container

Reimplemented from Container.

Definition at line 362 of file Actor.cpp.

References Item::FLG_EQUIPPED, and Container::removeItem().

void Actor::saveData ( ODataSource ods  )  [protected, virtual]

save Container data

Reimplemented from Container.

Reimplemented in MainActor.

Definition at line 1130 of file Actor.cpp.

References actorflags, alignment, animframe, dexterity, direction, enemyalignment, fallstart, hitpoints, intelligence, lastanim, mana, Container::saveData(), strength, unk0C, ODataSource::write1(), ODataSource::write2(), and ODataSource::write4().

Referenced by MainActor::saveData().

uint16 Actor::schedule ( uint32  time  ) 

Returns:
the PID of the spawned usecode process if any (otherwise 0)

Definition at line 1082 of file Actor.cpp.

References Item::callUsecodeEvent_schedule(), and isDead().

Referenced by CurrentMap::loadMap().

void Actor::setActorFlag ( uint32  mask  )  [inline]

Definition at line 77 of file Actor.h.

References actorflags.

Referenced by MainActor::ConCmd_toggleInvincibility(), die(), ActorAnimProcess::doSpecial(), AvatarMoverProcess::handleCombatMode(), ActorAnimProcess::init(), World::loadItemCachNPCData(), PathfinderProcess::PathfinderProcess(), MainActor::setInCombat(), setInCombat(), and AnimationTracker::updateActorFlags().

void Actor::setAlignment ( uint16  a  )  [inline]

Definition at line 64 of file Actor.h.

References alignment.

Referenced by World::loadItemCachNPCData(), and loadMonsterStats().

void Actor::setDex ( sint16  dex  )  [inline]

Definition at line 41 of file Actor.h.

References dexterity.

Referenced by MainActor::ConCmd_maxstats(), World::loadItemCachNPCData(), and loadMonsterStats().

void Actor::setDir ( uint16  dir  )  [inline]

Definition at line 71 of file Actor.h.

References direction.

Referenced by World::loadItemCachNPCData().

void Actor::setEnemyAlignment ( uint16  a  )  [inline]

Definition at line 66 of file Actor.h.

References enemyalignment.

Referenced by World::loadItemCachNPCData(), and loadMonsterStats().

bool Actor::setEquip ( Item item,
bool  checkwghtvol = false 
)

Definition at line 371 of file Actor.cpp.

References Item::clearFlag(), Container::contents, ShapeInfo::equiptype, Item::FLG_CONTAINED, Item::FLG_EQUIPPED, Object::getObjId(), Item::getShape(), Item::getShapeInfo(), Item::moveToContainer(), ShapeInfo::SE_NONE, Item::setFlag(), and Item::setZ().

Referenced by U8Game::ConCmd_cheatEquip().

void Actor::setFallStart ( sint32  z  )  [inline]

Definition at line 73 of file Actor.h.

References fallstart.

Referenced by GravityProcess::init(), and GravityProcess::run().

void Actor::setHP ( uint16  hp  )  [inline]

Definition at line 45 of file Actor.h.

References hitpoints.

Referenced by MainActor::ConCmd_heal(), MainActor::ConCmd_maxstats(), die(), HealProcess::feedAvatar(), World::loadItemCachNPCData(), loadMonsterStats(), receiveHit(), and HealProcess::run().

void Actor::setInCombat (  )  [virtual]

Reimplemented in MainActor.

Definition at line 1023 of file Actor.cpp.

References ACT_INCOMBAT, actorflags, Kernel::addProcess(), Item::callUsecodeEvent_cast(), Kernel::get_instance(), getCombatProcess(), Object::getObjId(), Kernel::killProcesses(), setActorFlag(), and Process::waitFor().

Referenced by cSetActivity(), ActorAnimProcess::doSpecial(), receiveHit(), ResurrectionProcess::run(), and toggleInCombat().

void Actor::setInt ( sint16  int_  )  [inline]

Definition at line 43 of file Actor.h.

References intelligence.

Referenced by MainActor::ConCmd_maxstats(), and World::loadItemCachNPCData().

void Actor::setLastAnim ( Animation::Sequence  anim  )  [inline]

Definition at line 69 of file Actor.h.

References lastanim.

Referenced by World::loadItemCachNPCData().

void Actor::setMana ( sint16  mp  )  [inline]

Definition at line 47 of file Actor.h.

References mana.

Referenced by MainActor::ConCmd_heal(), MainActor::ConCmd_maxstats(), World::loadItemCachNPCData(), and HealProcess::run().

void Actor::setStr ( sint16  str  )  [inline]

Definition at line 39 of file Actor.h.

References strength.

Referenced by MainActor::ConCmd_maxstats(), and World::loadItemCachNPCData().

void Actor::setUnk0C ( uint8  b  )  [inline]

Definition at line 74 of file Actor.h.

References unk0C.

Referenced by World::loadItemCachNPCData().

void Actor::teleport ( int  mapnum,
sint32  x,
sint32  y,
sint32  z 
) [virtual]

Reimplemented in MainActor.

Definition at line 422 of file Actor.cpp.

References World::etherealRemove(), World::get_instance(), Object::getObjId(), Item::move(), Item::moveToEtherealVoid(), Object::objid, perr, Item::setMapNum(), Item::x, Item::y, and Item::z.

Referenced by MainActor::teleport().

void Actor::toggleInCombat (  )  [inline]

Definition at line 55 of file Actor.h.

References clearInCombat(), isInCombat(), and setInCombat().

Referenced by MainActor::ConCmd_toggleCombat(), AvatarMoverProcess::handleCombatMode(), and AvatarMoverProcess::handleNormalMode().

Animation::Result Actor::tryAnim ( Animation::Sequence  anim,
int  dir,
unsigned int  steps = 0,
PathfindingState state = 0 
)

check if the given animation can be done from the location in state, without walking into things. If state is non-zero, and successful, state will be updated to after the animation. If unsuccessful, the contents of state are undefined.

Parameters:
anim Action to try
dir direction to walk in
state the state to start from, or 0 to use the current state

Definition at line 478 of file Actor.cpp.

References AnimAction::AAF_UNSTOPPABLE, Animation::END_OFF_LAND, Animation::FAILURE, AnimAction::flags, World::get_instance(), AnimationTracker::getAnimAction(), World::getCurrentMap(), getDir(), Item::getFootpadWorld(), getItem(), Object::getObjId(), AnimationTracker::getPosition(), UCList::getSize(), UCList::getuint16(), AnimationTracker::init(), AnimationTracker::isBlocked(), AnimationTracker::isUnsupported(), AnimationTracker::step(), Animation::SUCCESS, CurrentMap::surfaceSearch(), and AnimationTracker::updateState().

Referenced by doAnim(), AvatarMoverProcess::handleHangingMode(), AvatarMoverProcess::handleNormalMode(), PathfinderProcess::run(), AvatarGravityProcess::run(), and AvatarMoverProcess::step().


Friends And Related Function Documentation

friend class ActorAnimProcess [friend]

Definition at line 32 of file Actor.h.

Referenced by doAnim().

friend class AnimationTracker [friend]

Definition at line 33 of file Actor.h.


Member Data Documentation

uint32 Actor::actorflags [protected]

Definition at line 253 of file Actor.h.

Referenced by clearActorFlag(), clearInCombat(), dumpInfo(), getActorFlags(), isDead(), isInCombat(), loadData(), saveData(), setActorFlag(), and setInCombat().

uint16 Actor::alignment [protected]

Definition at line 244 of file Actor.h.

Referenced by getAlignment(), loadData(), loadMonsterStats(), saveData(), and setAlignment().

uint16 Actor::animframe [protected]

Definition at line 247 of file Actor.h.

Referenced by MainActor::getWeaponOverlay(), loadData(), saveData(), and AnimationTracker::updateActorFlags().

sint16 Actor::dexterity [protected]

Definition at line 239 of file Actor.h.

Referenced by MainActor::accumulateDex(), dumpInfo(), getDex(), loadData(), saveData(), and setDex().

uint16 Actor::direction [protected]

Definition at line 248 of file Actor.h.

Referenced by getDir(), MainActor::getWeaponOverlay(), ActorAnimProcess::init(), loadData(), saveData(), and setDir().

uint16 Actor::enemyalignment [protected]

Definition at line 244 of file Actor.h.

Referenced by getEnemyAlignment(), loadData(), saveData(), and setEnemyAlignment().

sint32 Actor::fallstart [protected]

Definition at line 250 of file Actor.h.

Referenced by getFallStart(), loadData(), saveData(), and setFallStart().

uint16 Actor::hitpoints [protected]

Definition at line 241 of file Actor.h.

Referenced by dumpInfo(), getHP(), loadData(), receiveHit(), saveData(), and setHP().

sint16 Actor::intelligence [protected]

Definition at line 240 of file Actor.h.

Referenced by MainActor::accumulateInt(), dumpInfo(), getInt(), loadData(), saveData(), and setInt().

Animation::Sequence Actor::lastanim [protected]

Definition at line 246 of file Actor.h.

Referenced by getLastAnim(), MainActor::getWeaponOverlay(), ActorAnimProcess::init(), loadData(), saveData(), and setLastAnim().

sint16 Actor::mana [protected]

Definition at line 242 of file Actor.h.

Referenced by dumpInfo(), getMana(), loadData(), saveData(), and setMana().

sint16 Actor::strength [protected]

Definition at line 238 of file Actor.h.

Referenced by MainActor::accumulateStr(), dumpInfo(), getStr(), loadData(), saveData(), and setStr().

uint8 Actor::unk0C [protected]

Definition at line 251 of file Actor.h.

Referenced by loadData(), saveData(), and setUnk0C().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 22:28:35 2007 for pentagram by  doxygen 1.4.7