MainActor Class Reference

#include <MainActor.h>

Inheritance diagram for MainActor:

Actor Container Item Object List of all members.

Public Member Functions

 MainActor ()
virtual ~MainActor ()
virtual bool CanAddItem (Item *item, bool checkwghtvol=false)
virtual bool addItem (Item *item, bool checkwghtvol=false)
virtual void teleport (int mapnum, sint32 x, sint32 y, sint32 z)
void teleport (int mapnum, int teleport_id)
bool hasJustTeleported () const
void setJustTeleported (bool t)
void accumulateStr (int n)
void accumulateDex (int n)
void accumulateInt (int n)
virtual GravityProcessensureGravityProcess ()
virtual uint32 getArmourClass ()
virtual uint16 getDefenseType ()
virtual sint16 getAttackingDex ()
virtual sint16 getDefendingDex ()
virtual uint16 getDamageType ()
virtual int getDamageAmount ()
virtual void receiveHit (uint16 other, int dir, int damage, uint16 type)
virtual void setInCombat ()
virtual void clearInCombat ()
virtual ProcId die (uint16 DamageType)
std::string getName ()
void setName (std::string name_)
bool loadData (IDataSource *ids, uint32 version)
 ENABLE_RUNTIME_CLASSTYPE ()
 INTRINSIC (I_teleportToEgg)
 INTRINSIC (I_accumulateStrength)
 INTRINSIC (I_accumulateDexterity)
 INTRINSIC (I_accumulateIntelligence)
 INTRINSIC (I_clrAvatarInCombat)
 INTRINSIC (I_setAvatarInCombat)
 INTRINSIC (I_isAvatarInCombat)
void getWeaponOverlay (const WeaponOverlayFrame *&frame, uint32 &shape)

Static Public Member Functions

static void ConCmd_teleport (const Console::ArgvType &argv)
static void ConCmd_mark (const Console::ArgvType &argv)
static void ConCmd_recall (const Console::ArgvType &argv)
static void ConCmd_listmarks (const Console::ArgvType &argv)
static void ConCmd_name (const Console::ArgvType &argv)
static void ConCmd_maxstats (const Console::ArgvType &argv)
static void ConCmd_heal (const Console::ArgvType &argv)
static void ConCmd_toggleInvincibility (const Console::ArgvType &argv)
static void ConCmd_useBackpack (const Console::ArgvType &argv)
static void ConCmd_useInventory (const Console::ArgvType &argv)
static void ConCmd_useRecall (const Console::ArgvType &argv)
static void ConCmd_useBedroll (const Console::ArgvType &argv)
static void ConCmd_useKeyring (const Console::ArgvType &argv)
static void ConCmd_toggleCombat (const Console::ArgvType &argv)

Protected Member Functions

virtual void saveData (ODataSource *ods)
void useInventoryItem (uint32 shapenum)

Protected Attributes

bool justTeleported
int accumStr
int accumDex
int accumInt
std::string name

Detailed Description

Definition at line 26 of file MainActor.h.


Constructor & Destructor Documentation

MainActor::MainActor (  ) 

Definition at line 51 of file MainActor.cpp.

MainActor::~MainActor (  )  [virtual]

Definition at line 57 of file MainActor.cpp.


Member Function Documentation

void MainActor::accumulateDex ( int  n  ) 

accumulate a little bit of dexterity. When you reach 650 you gain one dex. point. (There's a chance you gain dex. sooner)

! constant

! constant

Definition at line 488 of file MainActor.cpp.

References accumDex, Actor::dexterity, AudioProcess::get_instance(), AudioProcess::playSFX(), and pout.

Referenced by Actor::calculateAttackDamage(), AvatarMoverProcess::handleCombatMode(), and AvatarMoverProcess::handleNormalMode().

void MainActor::accumulateInt ( int  n  ) 

accumulate a little bit of intelligence. When you reach 650 you gain one int. point. (There's a chance you gain int. sooner)

! constant

! constant

Definition at line 503 of file MainActor.cpp.

References accumInt, AudioProcess::get_instance(), Actor::intelligence, AudioProcess::playSFX(), and pout.

void MainActor::accumulateStr ( int  n  ) 

accumulate a little bit of strength. When you reach 650 you gain one strength point. (There's a chance you gain strength sooner)

! constant

! constant

Definition at line 473 of file MainActor.cpp.

References accumStr, AudioProcess::get_instance(), AudioProcess::playSFX(), pout, and Actor::strength.

Referenced by AvatarMoverProcess::handleCombatMode(), AvatarMoverProcess::handleNormalMode(), and Actor::receiveHit().

bool MainActor::addItem ( Item item,
bool  checkwghtvol = false 
) [virtual]

Add an item to the container. This does NOT update item.

Parameters:
item The item to add
checkwghtvol Need to check weight and volume?
Returns:
true if item was added, false if failed

Reimplemented from Container.

Definition at line 106 of file MainActor.cpp.

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

bool MainActor::CanAddItem ( Item item,
bool  checkwghtvol = false 
) [virtual]

Check if an item can be added to the container

Parameters:
item The item to check
checkwghtvol Need to check weight and volume?
Returns:
true if item can be added, false if not

Reimplemented from Container.

Definition at line 77 of file MainActor.cpp.

References Container::CanAddItem(), Container::contents, Object::objid, and ShapeInfo::SE_NONE.

void MainActor::clearInCombat (  )  [virtual]

Reimplemented from Actor.

Definition at line 318 of file MainActor.cpp.

References Actor::ACT_INCOMBAT, Actor::clearActorFlag(), MusicProcess::get_instance(), and MusicProcess::restoreMusic().

void MainActor::ConCmd_heal ( const Console::ArgvType argv  )  [static]

"heal" console command

Definition at line 464 of file MainActor.cpp.

References getMainActor(), Actor::getMaxHP(), Actor::getMaxMana(), Actor::setHP(), and Actor::setMana().

Referenced by GUIApp::shutdownGame(), and GUIApp::startupGame().

void MainActor::ConCmd_listmarks ( const Console::ArgvType argv  )  [static]

"listmarks" console command

Definition at line 437 of file MainActor.cpp.

References SettingManager::get_instance(), SettingManager::listDataKeys(), and pout.

Referenced by GUIApp::shutdownGame(), and GUIApp::startupGame().

void MainActor::ConCmd_mark ( const Console::ArgvType argv  )  [static]

"mark" console command

! FIXME: clean this up

Definition at line 388 of file MainActor.cpp.

References SettingManager::get_instance(), Item::getLocation(), getMainActor(), Item::getMapNum(), pout, SettingManager::set(), SettingManager::write(), Item::x, Item::y, and Item::z.

Referenced by GUIApp::shutdownGame(), and GUIApp::startupGame().

void MainActor::ConCmd_maxstats ( const Console::ArgvType argv  )  [static]

"maxstats" console command

Definition at line 449 of file MainActor.cpp.

References AudioProcess::get_instance(), getMainActor(), Actor::getMaxHP(), Actor::getMaxMana(), AudioProcess::playSFX(), Actor::setDex(), Actor::setHP(), Actor::setInt(), Actor::setMana(), and Actor::setStr().

Referenced by GUIApp::shutdownGame(), and GUIApp::startupGame().

void MainActor::ConCmd_name ( const Console::ArgvType argv  )  [static]

"Name" console command

Definition at line 645 of file MainActor.cpp.

References getMainActor(), getName(), pout, and setName().

Referenced by GUIApp::shutdownGame(), and GUIApp::startupGame().

void MainActor::ConCmd_recall ( const Console::ArgvType argv  )  [static]

"recall" console command

Definition at line 411 of file MainActor.cpp.

References SettingManager::get(), SettingManager::get_instance(), getMainActor(), n, pout, and teleport().

Referenced by GUIApp::shutdownGame(), and GUIApp::startupGame().

void MainActor::ConCmd_teleport ( const Console::ArgvType argv  )  [static]

"teleport" console command

Definition at line 352 of file MainActor.cpp.

References getMainActor(), Item::getMapNum(), pout, and teleport().

Referenced by GUIApp::shutdownGame(), and GUIApp::startupGame().

void MainActor::ConCmd_toggleCombat ( const Console::ArgvType argv  )  [static]

"toggleCombat" console command

Definition at line 715 of file MainActor.cpp.

References GUIApp::get_instance(), getMainActor(), pout, and Actor::toggleInCombat().

Referenced by GUIApp::shutdownGame(), and GUIApp::startupGame().

void MainActor::ConCmd_toggleInvincibility ( const Console::ArgvType argv  )  [static]

"toggleInvincibility" console command

Definition at line 726 of file MainActor.cpp.

References Actor::ACT_INVINCIBLE, Actor::clearActorFlag(), Actor::getActorFlags(), getMainActor(), pout, and Actor::setActorFlag().

Referenced by GUIApp::shutdownGame(), and GUIApp::startupGame().

void MainActor::ConCmd_useBackpack ( const Console::ArgvType argv  )  [static]

"useBackpack" console command

Definition at line 654 of file MainActor.cpp.

References Item::callUsecodeEvent_use(), GUIApp::get_instance(), Actor::getEquip(), getItem(), getMainActor(), and pout.

Referenced by GUIApp::shutdownGame(), and GUIApp::startupGame().

void MainActor::ConCmd_useBedroll ( const Console::ArgvType argv  )  [static]

"useBedroll" console command

Definition at line 703 of file MainActor.cpp.

References getMainActor(), and useInventoryItem().

Referenced by GUIApp::shutdownGame(), and GUIApp::startupGame().

void MainActor::ConCmd_useInventory ( const Console::ArgvType argv  )  [static]

"useInventory" console command

Definition at line 667 of file MainActor.cpp.

References Item::callUsecodeEvent_use(), GUIApp::get_instance(), getMainActor(), and pout.

Referenced by GUIApp::shutdownGame(), and GUIApp::startupGame().

void MainActor::ConCmd_useKeyring ( const Console::ArgvType argv  )  [static]

"useKeyring" console command

Definition at line 709 of file MainActor.cpp.

References getMainActor(), and useInventoryItem().

Referenced by GUIApp::shutdownGame(), and GUIApp::startupGame().

void MainActor::ConCmd_useRecall ( const Console::ArgvType argv  )  [static]

"useRecall" console command

Definition at line 697 of file MainActor.cpp.

References getMainActor(), and useInventoryItem().

Referenced by GUIApp::shutdownGame(), and GUIApp::startupGame().

ProcId MainActor::die ( uint16  DamageType  )  [virtual]

die

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

Reimplemented from Actor.

Definition at line 324 of file MainActor.cpp.

References Kernel::addProcess(), Actor::die(), Kernel::get_instance(), GUIApp::get_instance(), Kernel::getProcess(), GUIApp::setAvatarInStasis(), and Process::waitFor().

MainActor::ENABLE_RUNTIME_CLASSTYPE (  ) 

Reimplemented from Actor.

GravityProcess * MainActor::ensureGravityProcess (  )  [virtual]

Get the GravityProcess of this Item, creating it if necessary.

Reimplemented from Item.

Definition at line 62 of file MainActor.cpp.

References Kernel::addProcess(), Kernel::get_instance(), Kernel::getProcess(), Item::gravitypid, and GravityProcess::init().

Referenced by AvatarMoverProcess::handleHangingMode().

uint32 MainActor::getArmourClass (  )  [virtual]

Reimplemented from Actor.

Definition at line 190 of file MainActor.cpp.

References WeaponInfo::armour_bonus, ArmourInfo::armour_class, ShapeInfo::armourinfo, Container::contents, Item::frame, and ShapeInfo::weaponinfo.

Referenced by U8Game::writeSaveInfo(), and RemorseGame::writeSaveInfo().

sint16 MainActor::getAttackingDex (  )  [virtual]

Reimplemented from Actor.

Definition at line 226 of file MainActor.cpp.

References WeaponInfo::dex_attack_bonus, Actor::getDex(), Actor::getEquip(), getItem(), Item::getShapeInfo(), ShapeInfo::SE_WEAPON, and ShapeInfo::weaponinfo.

int MainActor::getDamageAmount (  )  [virtual]

Reimplemented from Actor.

Definition at line 256 of file MainActor.cpp.

References ShapeInfo::armourinfo, WeaponInfo::base_damage, WeaponInfo::damage_modifier, Actor::getEquip(), Item::getFrame(), getItem(), Actor::getLastAnim(), Item::getShapeInfo(), Actor::getStr(), Animation::kick, ArmourInfo::kick_attack_bonus, ShapeInfo::SE_LEGS, ShapeInfo::SE_WEAPON, and ShapeInfo::weaponinfo.

uint16 MainActor::getDamageType (  )  [virtual]

get the damage type this object does when hitting something

Reimplemented from Actor.

Definition at line 240 of file MainActor.cpp.

References WeaponInfo::damage_type, Actor::getDamageType(), Actor::getEquip(), getItem(), Item::getShapeInfo(), ShapeInfo::SE_WEAPON, and ShapeInfo::weaponinfo.

sint16 MainActor::getDefendingDex (  )  [virtual]

Reimplemented from Actor.

Definition at line 210 of file MainActor.cpp.

References WeaponInfo::dex_defend_bonus, Actor::getDex(), Actor::getEquip(), getItem(), Item::getShapeInfo(), ShapeInfo::SE_WEAPON, and ShapeInfo::weaponinfo.

uint16 MainActor::getDefenseType (  )  [virtual]

Reimplemented from Actor.

Definition at line 173 of file MainActor.cpp.

References ShapeInfo::armourinfo, Container::contents, ArmourInfo::defense_type, and Item::frame.

std::string MainActor::getName (  )  [inline]

Definition at line 76 of file MainActor.h.

References name.

Referenced by ConCmd_name(), MenuGump::InitGump(), U8Game::writeSaveInfo(), and RemorseGame::writeSaveInfo().

void MainActor::getWeaponOverlay ( const WeaponOverlayFrame *&  frame,
uint32 shape 
)

Definition at line 518 of file MainActor.cpp.

References Actor::animframe, Actor::direction, Item::frame, GameData::get_instance(), Actor::getEquip(), getItem(), WpnOvlayDat::getOverlayFrame(), Item::getShapeInfo(), GameData::getWeaponOverlay(), Actor::isInCombat(), Actor::lastanim, WeaponInfo::overlay_shape, WeaponInfo::overlay_type, ShapeInfo::SE_WEAPON, Animation::unreadyWeapon, and ShapeInfo::weaponinfo.

Referenced by ItemSorter::PaintSortItem().

bool MainActor::hasJustTeleported (  )  const [inline]

Definition at line 43 of file MainActor.h.

References justTeleported.

Referenced by EggHatcherProcess::run().

MainActor::INTRINSIC ( I_isAvatarInCombat   ) 

MainActor::INTRINSIC ( I_setAvatarInCombat   ) 

MainActor::INTRINSIC ( I_clrAvatarInCombat   ) 

MainActor::INTRINSIC ( I_accumulateIntelligence   ) 

MainActor::INTRINSIC ( I_accumulateDexterity   ) 

MainActor::INTRINSIC ( I_accumulateStrength   ) 

MainActor::INTRINSIC ( I_teleportToEgg   ) 

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

Reimplemented from Actor.

Definition at line 560 of file MainActor.cpp.

References accumDex, accumInt, accumStr, justTeleported, Actor::loadData(), and name.

void MainActor::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 from Actor.

Definition at line 301 of file MainActor.cpp.

References Actor::receiveHit().

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

save Container data

Reimplemented from Actor.

Definition at line 545 of file MainActor.cpp.

References accumDex, accumInt, accumStr, justTeleported, name, Actor::saveData(), ODataSource::write1(), and ODataSource::write4().

void MainActor::setInCombat (  )  [virtual]

Reimplemented from Actor.

Definition at line 312 of file MainActor.cpp.

References Actor::ACT_INCOMBAT, MusicProcess::get_instance(), MusicProcess::playCombatMusic(), and Actor::setActorFlag().

void MainActor::setJustTeleported ( bool  t  )  [inline]

Definition at line 44 of file MainActor.h.

References justTeleported.

Referenced by EggHatcherProcess::run().

void MainActor::setName ( std::string  name_  )  [inline]

Definition at line 77 of file MainActor.h.

References name.

Referenced by MenuGump::ChildNotify(), ConCmd_name(), and U8Game::startGame().

void MainActor::teleport ( int  mapnum,
int  teleport_id 
)

teleport to a teleport-destination egg

Parameters:
mapnum The map to teleport to
teleport_id The ID of the egg to teleport to

Definition at line 135 of file MainActor.cpp.

References Egg::dumpInfo(), CurrentMap::findDestination(), World::get_instance(), World::getCurrentMap(), Item::getLocation(), Item::getMapNum(), justTeleported, perr, pout, Item::setMapNum(), World::switchMap(), Actor::teleport(), teleport(), Item::x, Item::y, and Item::z.

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

teleport to the given location on the given map

Reimplemented from Actor.

Definition at line 118 of file MainActor.cpp.

References World::get_instance(), justTeleported, perr, World::switchMap(), and Actor::teleport().

Referenced by ConCmd_recall(), ConCmd_teleport(), TeleportEgg::hatch(), TeleportToEggProcess::run(), and teleport().

void MainActor::useInventoryItem ( uint32  shapenum  )  [protected]

Definition at line 678 of file MainActor.cpp.

References Item::callUsecodeEvent_use(), Container::containerSearch(), GUIApp::get_instance(), getItem(), UCList::getSize(), UCList::getuint16(), Object::objid, and pout.

Referenced by ConCmd_useBedroll(), ConCmd_useKeyring(), and ConCmd_useRecall().


Member Data Documentation

int MainActor::accumDex [protected]

Definition at line 136 of file MainActor.h.

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

int MainActor::accumInt [protected]

Definition at line 137 of file MainActor.h.

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

int MainActor::accumStr [protected]

Definition at line 135 of file MainActor.h.

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

bool MainActor::justTeleported [protected]

Definition at line 133 of file MainActor.h.

Referenced by hasJustTeleported(), loadData(), saveData(), setJustTeleported(), and teleport().

std::string MainActor::name [protected]

Definition at line 139 of file MainActor.h.

Referenced by getName(), loadData(), saveData(), and setName().


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