Item Class Reference

#include <Item.h>

Inheritance diagram for Item:

Object Container Egg GlobEgg MonsterEgg Actor TeleportEgg MainActor List of all members.

Public Types

 FLG_DISPOSABLE = 0x0002
 FLG_OWNED = 0x0004
 FLG_CONTAINED = 0x0008
 FLG_INVISIBLE = 0x0010
 FLG_FLIPPED = 0x0020
 FLG_IN_NPC_LIST = 0x0040
 FLG_FAST_ONLY = 0x0080
 FLG_GUMP_OPEN = 0x0100
 FLG_EQUIPPED = 0x0200
 FLG_BOUNCING = 0x0400
 FLG_ETHEREAL = 0x0800
 FLG_HANGING = 0x1000
 FLG_FASTAREA = 0x2000
 FLG_LOW_FRICTION = 0x4000
 EXT_FIXED = 0x0001
 EXT_INCURMAP = 0x0002
 EXT_LERP_NOPREV = 0x0008
 EXT_HIGHLIGHT = 0x0010
 EXT_CAMERA = 0x0020
 EXT_SPRITE = 0x0040
 EXT_TRANSPARENT = 0x0080
 EXT_PERMANENT_NPC = 0x0100
enum  statusflags {
  FLG_DISPOSABLE = 0x0002, FLG_OWNED = 0x0004, FLG_CONTAINED = 0x0008, FLG_INVISIBLE = 0x0010,
  FLG_FLIPPED = 0x0020, FLG_IN_NPC_LIST = 0x0040, FLG_FAST_ONLY = 0x0080, FLG_GUMP_OPEN = 0x0100,
  FLG_EQUIPPED = 0x0200, FLG_BOUNCING = 0x0400, FLG_ETHEREAL = 0x0800, FLG_HANGING = 0x1000,
  FLG_FASTAREA = 0x2000, FLG_LOW_FRICTION = 0x4000
}
enum  extflags {
  EXT_FIXED = 0x0001, EXT_INCURMAP = 0x0002, EXT_LERP_NOPREV = 0x0008, EXT_HIGHLIGHT = 0x0010,
  EXT_CAMERA = 0x0020, EXT_SPRITE = 0x0040, EXT_TRANSPARENT = 0x0080, EXT_PERMANENT_NPC = 0x0100
}

Public Member Functions

 Item ()
virtual ~Item ()
 ENABLE_RUNTIME_CLASSTYPE ()
ObjId getParent () const
void setParent (ObjId p)
ContainergetParentAsContainer () const
ItemgetTopItem ()
void setLocation (sint32 x, sint32 y, sint32 z)
void move (sint32 x, sint32 y, sint32 z)
bool moveToContainer (Container *container, bool checkwghtvol=false)
void moveToEtherealVoid ()
void returnFromEtherealVoid ()
void movedByPlayer ()
void getLocationAbsolute (sint32 &x, sint32 &y, sint32 &z) const
void getLocation (sint32 &x, sint32 &y, sint32 &z) const
sint32 getZ () const
void setZ (sint32 z_)
void getGumpLocation (sint32 &x, sint32 &y) const
void setGumpLocation (sint32 x, sint32 y)
void randomGumpLocation ()
void getCentre (sint32 &x, sint32 &y, sint32 &z) const
void getFootpadWorld (sint32 &x, sint32 &y, sint32 &z) const
void getFootpadData (sint32 &x, sint32 &y, sint32 &z) const
Pentagram::Box getWorldBox () const
uint16 getFlags () const
void setFlag (uint32 mask)
virtual void setFlagRecursively (uint32 mask)
void clearFlag (uint32 mask)
void setExtFlags (uint32 f)
uint32 getExtFlags () const
void setExtFlag (uint32 mask)
void clearExtFlag (uint32 mask)
uint32 getShape () const
void setShape (uint32 shape_)
uint32 getFrame () const
void setFrame (uint32 frame_)
uint16 getQuality () const
void setQuality (uint16 quality_)
uint16 getNpcNum () const
void setNpcNum (uint16 npcnum_)
uint16 getMapNum () const
void setMapNum (uint16 mapnum_)
ShapeInfogetShapeInfo () const
ShapeInfogetShapeInfoFromGameInstance () const
ShapegetShapeObject () const
uint16 getFamily ()
bool canMergeWith (Item *other)
ObjId getGump ()
void clearGump ()
ObjId openGump (uint32 gumpshape)
void closeGump ()
virtual void destroy (bool delnow=false)
bool overlaps (Item &item2) const
bool overlapsxy (Item &item2) const
bool isOn (Item &item2) const
bool canExistAt (sint32 x, sint32 y, sint32 z, bool needsupport=false) const
int getDirToItemCentre (Item &item2) const
int getRange (Item &item2, bool checkz=false) const
bool canReach (Item *other, int range, sint32 x=0, sint32 y=0, sint32 z=0)
sint32 collideMove (sint32 x, sint32 y, sint32 z, bool teleport, bool force, ObjId *hititem=0)
sint32 ascend (int delta)
void fall ()
void grab ()
void hurl (int xs, int ys, int zs, int grav)
void setGravityPID (ProcId pid)
ProcId getGravityPID () const
virtual GravityProcessensureGravityProcess ()
virtual uint32 getWeight ()
virtual uint32 getTotalWeight ()
virtual uint32 getVolume ()
void explode ()
virtual uint16 getDamageType ()
virtual void receiveHit (ObjId other, int dir, int damage, uint16 type)
unsigned int countNearby (uint32 shape, uint16 range)
bool canDrag ()
int getThrowRange ()
bool checkLoopScript (const uint8 *script, uint32 scriptsize)
uint32 callUsecodeEvent_look ()
uint32 callUsecodeEvent_use ()
uint32 callUsecodeEvent_anim ()
uint32 callUsecodeEvent_cachein ()
uint32 callUsecodeEvent_hit (ObjId hitted, sint16 hitforce)
uint32 callUsecodeEvent_gotHit (ObjId hitter, sint16 hitforce)
uint32 callUsecodeEvent_hatch ()
uint32 callUsecodeEvent_schedule (uint32 time)
uint32 callUsecodeEvent_release ()
uint32 callUsecodeEvent_combine ()
uint32 callUsecodeEvent_enterFastArea ()
uint32 callUsecodeEvent_leaveFastArea ()
uint32 callUsecodeEvent_cast (uint16 unk)
uint32 callUsecodeEvent_justMoved ()
uint32 callUsecodeEvent_AvatarStoleSomething (uint16 unk)
uint32 callUsecodeEvent_guardianBark (sint16 unk)
uint32 use ()
void getLerped (sint32 &x, sint32 &y, sint32 &z) const
void doLerp (sint32 factor)
void setupLerp (sint32 gametick)
virtual void enterFastArea ()
virtual void leaveFastArea ()
virtual void dumpInfo ()
bool loadData (IDataSource *ids, uint32 version)
 INTRINSIC (I_touch)
 INTRINSIC (I_getX)
 INTRINSIC (I_getY)
 INTRINSIC (I_getZ)
 INTRINSIC (I_getCX)
 INTRINSIC (I_getCY)
 INTRINSIC (I_getCZ)
 INTRINSIC (I_getPoint)
 INTRINSIC (I_getShape)
 INTRINSIC (I_setShape)
 INTRINSIC (I_getFrame)
 INTRINSIC (I_setFrame)
 INTRINSIC (I_getQuality)
 INTRINSIC (I_getUnkEggType)
 INTRINSIC (I_getQuantity)
 INTRINSIC (I_getContainer)
 INTRINSIC (I_getRootContainer)
 INTRINSIC (I_getQ)
 INTRINSIC (I_getQHi)
 INTRINSIC (I_getQLo)
 INTRINSIC (I_setQ)
 INTRINSIC (I_setQHi)
 INTRINSIC (I_setQLo)
 INTRINSIC (I_setQuality)
 INTRINSIC (I_setQuantity)
 INTRINSIC (I_getFamily)
 INTRINSIC (I_getTypeFlag)
 INTRINSIC (I_getStatus)
 INTRINSIC (I_orStatus)
 INTRINSIC (I_andStatus)
 INTRINSIC (I_getFootpadData)
 INTRINSIC (I_overlaps)
 INTRINSIC (I_overlapsXY)
 INTRINSIC (I_isOn)
 INTRINSIC (I_ascend)
 INTRINSIC (I_getWeight)
 INTRINSIC (I_getWeightIncludingContents)
 INTRINSIC (I_getVolume)
 INTRINSIC (I_bark)
 INTRINSIC (I_getMapArray)
 INTRINSIC (I_setMapArray)
 INTRINSIC (I_getNpcNum)
 INTRINSIC (I_getDirToCoords)
 INTRINSIC (I_getDirFromCoords)
 INTRINSIC (I_getDirToItem)
 INTRINSIC (I_getDirFromItem)
 INTRINSIC (I_look)
 INTRINSIC (I_use)
 INTRINSIC (I_gotHit)
 INTRINSIC (I_enterFastArea)
 INTRINSIC (I_ask)
 INTRINSIC (I_getSliderInput)
 INTRINSIC (I_openGump)
 INTRINSIC (I_closeGump)
 INTRINSIC (I_create)
 INTRINSIC (I_legalCreateAtPoint)
 INTRINSIC (I_legalCreateAtCoords)
 INTRINSIC (I_legalCreateInCont)
 INTRINSIC (I_push)
 INTRINSIC (I_pop)
 INTRINSIC (I_popToCoords)
 INTRINSIC (I_popToContainer)
 INTRINSIC (I_popToEnd)
 INTRINSIC (I_destroy)
 INTRINSIC (I_move)
 INTRINSIC (I_legalMoveToPoint)
 INTRINSIC (I_legalMoveToContainer)
 INTRINSIC (I_hurl)
 INTRINSIC (I_shoot)
 INTRINSIC (I_fall)
 INTRINSIC (I_grab)
 INTRINSIC (I_igniteChaos)
 INTRINSIC (I_getFamilyOfType)
 INTRINSIC (I_getEtherealTop)
 INTRINSIC (I_guardianBark)
 INTRINSIC (I_getSurfaceWeight)
 INTRINSIC (I_isExplosive)
 INTRINSIC (I_receiveHit)
 INTRINSIC (I_explode)
 INTRINSIC (I_canReach)
 INTRINSIC (I_getRange)
 INTRINSIC (I_isCrusTypeNPC)

Protected Member Functions

virtual void saveData (ODataSource *ods)

Protected Attributes

uint32 frame
sint32 x
sint32 y
sint32 z
uint16 flags
uint16 quality
uint16 npcnum
uint16 mapnum
uint32 extendedflags
ObjId parent
ShapecachedShape
ShapeInfocachedShapeInfo
Lerped l_prev
Lerped l_next
sint32 ix
sint32 iy
sint32 iz
ObjId gump
ProcId gravitypid

Private Member Functions

uint32 callUsecodeEvent (uint32 event, const uint8 *args=0, int argsize=0)
void animateItem ()

Private Attributes

uint32 shape
sint32 last_setup

Friends

class ItemFactory

Classes

struct  Lerped

Detailed Description

Definition at line 34 of file Item.h.


Member Enumeration Documentation

enum Item::extflags

Enumerator:
EXT_FIXED  Item came from FIXED.
EXT_INCURMAP  Item is in a CurrentMap display list.
EXT_LERP_NOPREV  Item can't be lerped this frame.
EXT_HIGHLIGHT  Item should be Painted highlighted.
EXT_CAMERA  Item is being followed by the camera.
EXT_SPRITE  Item is a sprite.
EXT_TRANSPARENT  Item should be painted transparent.
EXT_PERMANENT_NPC  Item is a permanent NPC.

Definition at line 541 of file Item.h.

enum Item::statusflags

Enumerator:
FLG_DISPOSABLE  Item is discarded on map change.
FLG_OWNED  Item is owned by avatar.
FLG_CONTAINED  Item is in a container.
FLG_INVISIBLE  Item is invisible.
FLG_FLIPPED  Item is flipped horizontally.
FLG_IN_NPC_LIST  Item is a NPC.
FLG_FAST_ONLY  Item is discarded when leaving fast area.
FLG_GUMP_OPEN  Item has a gump open.
FLG_EQUIPPED  Item is equipped.
FLG_BOUNCING  Item has bounced.
FLG_ETHEREAL  Item is in the ethereal list.
FLG_HANGING  Item is suspended in the air.
FLG_FASTAREA  Item is in the fast area.
FLG_LOW_FRICTION  Item has low friction.

Definition at line 524 of file Item.h.


Constructor & Destructor Documentation

Item::Item (  ) 

Definition at line 68 of file Item.cpp.

Item::~Item (  )  [virtual]

Definition at line 79 of file Item.cpp.


Member Function Documentation

void Item::animateItem (  )  [private]

Animate the item (called by setupLerp).

Definition at line 1263 of file Item.cpp.

References ShapeInfo::animdata, ShapeInfo::animtype, callUsecodeEvent_anim(), frame, Shape::frameCount(), getShapeInfo(), getShapeObject(), last_setup, Object::objid, and pout.

Referenced by setupLerp().

sint32 Item::ascend ( int  delta  ) 

Make the item move up (delta>0) or down (delta<0), including any items on top of it

Parameters:
delta distance in Z-direction to move
Returns:
0-0x4000 representing how far it got. 0 = didn't move 0x4000 = reached destination

Definition at line 1443 of file Item.cpp.

References collideMove(), World::get_instance(), World::getCurrentMap(), getItem(), getLocation(), UCList::getSize(), UCList::getuint16(), ix, iy, iz, moveToEtherealVoid(), and CurrentMap::surfaceSearch().

uint32 Item::callUsecodeEvent ( uint32  event,
const uint8 args = 0,
int  argsize = 0 
) [private]

Call a Usecode Event. Use the separate functions instead!

Definition at line 1028 of file Item.cpp.

References Object::callUsecode(), EXT_PERMANENT_NPC, extendedflags, flags, FLG_FAST_ONLY, Usecode::get_class_event(), UCMachine::get_instance(), GameData::get_instance(), getFamily(), GameData::getMainUsecode(), Object::objid, pout, quality, ShapeInfo::SF_UNKEGG, and shape.

Referenced by callUsecodeEvent_anim(), callUsecodeEvent_AvatarStoleSomething(), callUsecodeEvent_cachein(), callUsecodeEvent_cast(), callUsecodeEvent_combine(), callUsecodeEvent_enterFastArea(), callUsecodeEvent_guardianBark(), callUsecodeEvent_hatch(), callUsecodeEvent_justMoved(), callUsecodeEvent_leaveFastArea(), callUsecodeEvent_look(), callUsecodeEvent_release(), callUsecodeEvent_schedule(), and callUsecodeEvent_use().

uint32 Item::callUsecodeEvent_anim (  ) 

Definition at line 1079 of file Item.cpp.

References callUsecodeEvent().

Referenced by animateItem().

uint32 Item::callUsecodeEvent_AvatarStoleSomething ( uint16  unk  ) 

Definition at line 1149 of file Item.cpp.

References BaseUCStack::access(), callUsecodeEvent(), and BaseUCStack::push2().

Referenced by movedByPlayer().

uint32 Item::callUsecodeEvent_cachein (  ) 

Definition at line 1084 of file Item.cpp.

References callUsecodeEvent().

Referenced by StartU8Process::run().

uint32 Item::callUsecodeEvent_cast ( uint16  unk  ) 

Definition at line 1137 of file Item.cpp.

References BaseUCStack::access(), callUsecodeEvent(), and BaseUCStack::push2().

Referenced by Actor::setInCombat().

uint32 Item::callUsecodeEvent_combine (  ) 

Definition at line 1122 of file Item.cpp.

References callUsecodeEvent().

Referenced by Actor::giveTreasure(), and SplitItemProcess::run().

uint32 Item::callUsecodeEvent_enterFastArea (  ) 

Definition at line 1127 of file Item.cpp.

References callUsecodeEvent().

Referenced by enterFastArea().

uint32 Item::callUsecodeEvent_gotHit ( ObjId  hitter,
sint16  hitforce 
)

uint32 Item::callUsecodeEvent_guardianBark ( sint16  unk  ) 

Definition at line 1156 of file Item.cpp.

References BaseUCStack::access(), callUsecodeEvent(), and BaseUCStack::push2().

uint32 Item::callUsecodeEvent_hatch (  ) 

Definition at line 1105 of file Item.cpp.

References callUsecodeEvent().

Referenced by Egg::hatch().

uint32 Item::callUsecodeEvent_hit ( ObjId  hitted,
sint16  hitforce 
)

Referenced by collideMove().

uint32 Item::callUsecodeEvent_justMoved (  ) 

Definition at line 1144 of file Item.cpp.

References callUsecodeEvent().

Referenced by move(), and moveToContainer().

uint32 Item::callUsecodeEvent_leaveFastArea (  ) 

Definition at line 1132 of file Item.cpp.

References callUsecodeEvent().

Referenced by leaveFastArea().

uint32 Item::callUsecodeEvent_look (  ) 

Definition at line 1069 of file Item.cpp.

References callUsecodeEvent().

Referenced by GameMapGump::OnMouseClick(), and ContainerGump::OnMouseClick().

uint32 Item::callUsecodeEvent_release (  ) 

Definition at line 1117 of file Item.cpp.

References callUsecodeEvent().

Referenced by collideMove(), and grab().

uint32 Item::callUsecodeEvent_schedule ( uint32  time  ) 

Definition at line 1110 of file Item.cpp.

References BaseUCStack::access(), callUsecodeEvent(), and BaseUCStack::push4().

Referenced by SchedulerProcess::run(), and Actor::schedule().

uint32 Item::callUsecodeEvent_use (  ) 

Definition at line 1074 of file Item.cpp.

References callUsecodeEvent().

Referenced by MainActor::ConCmd_useBackpack(), MainActor::ConCmd_useInventory(), MiniStatsGump::OnMouseDouble(), use(), and MainActor::useInventoryItem().

bool Item::canDrag (  ) 

can this item be dragged?

Definition at line 1638 of file Item.cpp.

References getShapeInfo(), ShapeInfo::is_fixed(), Actor::isDead(), and ShapeInfo::weight.

Referenced by getThrowRange(), and GameMapGump::StartDraggingItem().

bool Item::canExistAt ( sint32  x,
sint32  y,
sint32  z,
bool  needsupport = false 
) const

Check if this item can exist at the given coordinates.

Definition at line 540 of file Item.cpp.

References World::get_instance(), World::getCurrentMap(), Object::getObjId(), getShape(), and CurrentMap::isValidPosition().

Referenced by ActorAnimProcess::doSpecial(), GameMapGump::DraggingItem(), and MonsterEgg::hatch().

bool Item::canMergeWith ( Item other  ) 

Check if we can merge with another item.

Definition at line 1778 of file Item.cpp.

References GameInfo::GAME_U8, CoreApp::get_instance(), getFamily(), getFrame(), Object::getObjId(), getShape(), ShapeInfo::SF_QUANTITY, and ShapeInfo::SF_REAGENT.

Referenced by ContainerGump::DropItem().

bool Item::canReach ( Item other,
int  range,
sint32  x = 0,
sint32  y = 0,
sint32  z = 0 
)

Check if this item can reach another item. (This includes LoS.)

Parameters:
other item to be reached
range range
x x coordinate of other to use, If zero, use real coords.
y y coordinate of other to use
z z coordinate of other to use.

Definition at line 1697 of file Item.cpp.

References checkLineOfSightCollisions(), World::get_instance(), World::getCurrentMap(), getFootpadWorld(), getLocationAbsolute(), Object::getObjId(), getTopItem(), Object::objid, ShapeInfo::SI_SOLID, and CurrentMap::sweepTest().

Referenced by GameMapGump::DraggingItem(), ContainerGump::DraggingItem(), GameMapGump::DropItem(), GameMapGump::OnMouseDouble(), ContainerGump::OnMouseDouble(), GameMapGump::StartDraggingItem(), and ContainerGump::StartDraggingItem().

bool Item::checkLoopScript ( const uint8 script,
uint32  scriptsize 
)

Check this Item against the given loopscript

Parameters:
script The loopscript to run
scriptsize The size (in bytes) of the loopscript
Returns:
true if the item matches, false otherwise

check for i out of bounds

check for i out of bounds

check for i out of bounds

Definition at line 655 of file Item.cpp.

References getFamily(), getFlags(), getFrame(), getNpcNum(), getQuality(), getShape(), perr, BaseUCStack::pop2(), and BaseUCStack::push2().

Referenced by UCMachine::execProcess().

void Item::clearExtFlag ( uint32  mask  )  [inline]

Clear the extendedflags set in the given mask.

Definition at line 143 of file Item.h.

References extendedflags.

Referenced by CurrentMap::removeItemFromList(), and CameraProcess::terminate().

void Item::clearFlag ( uint32  mask  )  [inline]

Clear the flags set in the given mask.

Definition at line 131 of file Item.h.

References flags.

Referenced by GameMapGump::ConCmd_dumpMap(), Actor::setEquip(), GravityProcess::terminate(), and AnimationTracker::updateActorFlags().

void Item::clearGump (  ) 

Call this to notify the Item's open Gump has closed.

Definition at line 1437 of file Item.cpp.

References flags, FLG_GUMP_OPEN, and gump.

Referenced by PaperdollGump::Close(), ContainerGump::Close(), and closeGump().

void Item::closeGump (  ) 

Close this Item's gump, if any.

Definition at line 1423 of file Item.cpp.

References clearGump(), Gump::Close(), flags, FLG_GUMP_OPEN, GUIApp::get_instance(), GUIApp::getGump(), and gump.

Referenced by ResurrectionProcess::run(), and use().

sint32 Item::collideMove ( sint32  x,
sint32  y,
sint32  z,
bool  teleport,
bool  force,
ObjId hititem = 0 
)

Move the object to (x,y,z) colliding with objects in the way.

Parameters:
teleport move without colliding with objects between source and destination
force force the object to get to the destination without being blocked by solid objects
hititem if non-NULL, this is set to (one of) the item(s) blocking the movement, or to zero if nothing blocked it
Returns:
0-0x4000 representing how far it got. 0 = didn't move 0x4000 = reached destination
Note:
This can destroy the object

Definition at line 833 of file Item.cpp.

References callUsecodeEvent_hit(), callUsecodeEvent_release(), EXT_HIGHLIGHT, flags, Kernel::get_instance(), World::get_instance(), GUIApp::get_instance(), World::getCurrentMap(), getFootpadWorld(), getItem(), getLocation(), Kernel::getProcess(), getShapeInfo(), GUIApp::isShowTouchingItems(), move(), Object::objid, parent, pout, setExtFlag(), CurrentMap::sweepTest(), and Process::waitFor().

Referenced by ascend(), GameMapGump::DropItem(), leaveFastArea(), QuickAvatarMoverProcess::run(), MissileProcess::run(), GravityProcess::run(), FireballProcess::run(), and ActorAnimProcess::run().

unsigned int Item::countNearby ( uint32  shape,
uint16  range 
)

count nearby objects of a given shape

Definition at line 1017 of file Item.cpp.

References CurrentMap::areaSearch(), World::get_instance(), World::getCurrentMap(), and UCList::getSize().

Referenced by ActorAnimProcess::doSpecial().

void Item::destroy ( bool  delnow = false  )  [virtual]

Destroy self.

! need to make sure this works for equipped items too...

Reimplemented in Container.

Definition at line 1181 of file Item.cpp.

References Kernel::addProcess(), Object::clearObjId(), World::etherealRemove(), EXT_CAMERA, EXT_INCURMAP, extendedflags, flags, FLG_ETHEREAL, Kernel::get_instance(), World::get_instance(), World::getCurrentMap(), getParentAsContainer(), Object::objid, parent, Container::removeItem(), CurrentMap::removeItemFromList(), CameraProcess::SetCameraProcess(), x, and y.

Referenced by Container::destroy(), ContainerGump::DropItem(), explode(), FireballProcess::explode(), leaveFastArea(), SplitItemProcess::run(), World::switchMap(), and SpriteProcess::~SpriteProcess().

void Item::doLerp ( sint32  factor  )  [inline]

Do lerping for an in between frame (0-256) The result can be retrieved with getLerped(x,y,z)

Parameters:
factor The lerp factor: 0 is start of move, 256 is end of move

Definition at line 345 of file Item.h.

References ix, iy, iz, l_next, l_prev, Item::Lerped::x, Item::Lerped::y, and Item::Lerped::z.

Referenced by GameMapGump::GetLocationOfItem().

void Item::dumpInfo (  )  [virtual]

dump some info about this item to pout

Reimplemented from Object.

Reimplemented in Actor, Container, and Egg.

Definition at line 84 of file Item.cpp.

References getExtFlags(), getFlags(), getFrame(), getGumpLocation(), getMapNum(), getNpcNum(), Object::getObjId(), getQuality(), getShape(), parent, pout, x, y, and z.

Referenced by Egg::dumpInfo(), Container::dumpInfo(), GameMapGump::OnMouseClick(), ContainerGump::OnMouseClick(), GameMapGump::OnMouseDouble(), ContainerGump::OnMouseDouble(), TargetGump::OnMouseUp(), and Pathfinder::pathfind().

Item::ENABLE_RUNTIME_CLASSTYPE (  ) 

Reimplemented from Object.

Reimplemented in Actor, MainActor, Container, Egg, GlobEgg, MonsterEgg, and TeleportEgg.

GravityProcess * Item::ensureGravityProcess (  )  [virtual]

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

Reimplemented in MainActor.

Definition at line 1499 of file Item.cpp.

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

Referenced by fall(), and hurl().

void Item::enterFastArea (  )  [virtual]

The item has entered the fast area.

! HACK to get rid of endless SFX loops

Reimplemented in GlobEgg.

Definition at line 1333 of file Item.cpp.

References callUsecodeEvent_enterFastArea(), flags, FLG_FASTAREA, Actor::isDead(), and shape.

Referenced by GlobEgg::enterFastArea(), move(), and moveToContainer().

void Item::explode (  ) 

explode

! constants

CHECKME: 128?

! CHECKME

Definition at line 1565 of file Item.cpp.

References Kernel::addProcess(), CurrentMap::areaSearch(), destroy(), WeaponInfo::DMG_BLUNT, WeaponInfo::DMG_FIRE, World::get_instance(), AudioProcess::get_instance(), Kernel::get_instance(), Get_WorldDirection(), World::getCurrentMap(), getItem(), getLocation(), getRange(), UCList::getSize(), UCList::getuint16(), ix, iy, iz, AudioProcess::playSFX(), x, y, and z.

Referenced by ActorAnimProcess::doSpecial().

void Item::fall (  ) 

Make the item fall down. This creates a GravityProcess to do the actual work if the Item doesn't already have one.

! constant

Definition at line 1514 of file Item.cpp.

References ensureGravityProcess(), flags, FLG_HANGING, getShapeInfo(), and GravityProcess::setGravity().

Referenced by GameMapGump::DropItem(), grab(), MissileProcess::run(), and ActorAnimProcess::run().

void Item::getCentre ( sint32 x,
sint32 y,
sint32 z 
) const

Get the world coordinates of the Item's centre. Undefined if the Item is contained or equipped.

Definition at line 447 of file Item.cpp.

References flags, FLG_FLIPPED, getShapeInfo(), ShapeInfo::x, x, y, ShapeInfo::y, ShapeInfo::z, and z.

Referenced by getDirToItemCentre(), AvatarMoverProcess::jump(), and Pathfinder::setTarget().

uint16 Item::getDamageType (  )  [virtual]

get the damage type this object does when hitting something

Reimplemented in Actor, and MainActor.

Definition at line 1599 of file Item.cpp.

References WeaponInfo::damage_type, getShapeInfo(), and ShapeInfo::weaponinfo.

Referenced by Actor::receiveHit().

int Item::getDirToItemCentre ( Item item2  )  const

Get direction from centre to another item's centre. Undefined if either item is contained or equipped.

Definition at line 549 of file Item.cpp.

References Get_WorldDirection(), getCentre(), ix, iy, and iz.

Referenced by PathfindingState::checkHit(), CombatProcess::getTargetDirection(), GrantPeaceProcess::run(), and FireballProcess::run().

uint32 Item::getExtFlags (  )  const [inline]

Get extendedflags.

Definition at line 137 of file Item.h.

References extendedflags.

Referenced by ItemSorter::AddItem(), ContainerGump::DropItem(), dumpInfo(), and CameraProcess::ItemMoved().

uint16 Item::getFamily (  ) 

Get the family of the shape number of this Item. (This is a member of the ShapeInfo object.)

Definition at line 611 of file Item.cpp.

References ShapeInfo::family, and getShapeInfo().

Referenced by callUsecodeEvent(), canMergeWith(), and checkLoopScript().

uint16 Item::getFlags (  )  const [inline]

Get flags.

Definition at line 123 of file Item.h.

References flags.

Referenced by ItemSorter::AddItem(), checkLoopScript(), GameMapGump::ConCmd_dumpMap(), PaperdollGump::DraggingItem(), GameMapGump::DraggingItem(), ContainerGump::DraggingItem(), ContainerGump::DropItem(), dumpInfo(), ContainerGump::getTargetContainer(), getVolume(), AnimationTracker::init(), ActorAnimProcess::init(), PathfindingState::load(), ResurrectionProcess::run(), PathfinderProcess::run(), CombatProcess::run(), ActorAnimProcess::run(), AnimationTracker::step(), and use().

void Item::getFootpadData ( sint32 x,
sint32 y,
sint32 z 
) const [inline]

Get the size of this item's 3D bounding box, scaled as in the datafiles (i.e., the dimensions are not in the same unit as world coordinates!)

Definition at line 560 of file Item.h.

References flags, FLG_FLIPPED, getShapeInfo(), ShapeInfo::x, ShapeInfo::y, and ShapeInfo::z.

void Item::getFootpadWorld ( sint32 x,
sint32 y,
sint32 z 
) const [inline]

Get the size of this item's 3D bounding box, in world coordinates.

Definition at line 575 of file Item.h.

References flags, FLG_FLIPPED, getShapeInfo(), ShapeInfo::x, ShapeInfo::y, and ShapeInfo::z.

Referenced by CurrentMap::areaSearch(), canReach(), PathfindingState::checkItem(), collideMove(), drawbox(), CameraProcess::FindRoof(), getRange(), getWorldBox(), Pathfinder::init(), isOn(), MissileTracker::isPathClear(), overlaps(), overlapsxy(), GameMapGump::PaintThis(), QuickAvatarMoverProcess::run(), GravityProcess::run(), EggHatcherProcess::run(), MiniMapGump::sampleAtPoint(), CurrentMap::scanForValidPosition(), AnimationTracker::step(), CurrentMap::surfaceSearch(), GameMapGump::TraceCoordinates(), CurrentMap::traceTopItem(), and Actor::tryAnim().

uint32 Item::getFrame (  )  const [inline]

Get this Item's frame number.

Definition at line 153 of file Item.h.

References frame.

Referenced by ItemSorter::AddItem(), canMergeWith(), checkLoopScript(), PaperdollGump::DraggingItem(), GameMapGump::DraggingItem(), ContainerGump::DraggingItem(), ContainerGump::DropItem(), dumpInfo(), MainActor::getDamageAmount(), MiniMapGump::sampleAtPoint(), PaperdollGump::StartDraggingItem(), U8Game::writeSaveInfo(), and RemorseGame::writeSaveInfo().

ProcId Item::getGravityPID (  )  const [inline]

Get the PID of the GravityProcess for this Item (or 0).

Definition at line 276 of file Item.h.

References gravitypid.

Referenced by AvatarMoverProcess::run().

ObjId Item::getGump (  )  [inline]

Get the open ContainerGump for this Item, if any. (NULL if not open.).

Definition at line 197 of file Item.h.

References gump.

Referenced by ItemRelativeGump::GetItemLocation(), and MiniStatsGump::OnMouseDouble().

void Item::getGumpLocation ( sint32 x,
sint32 y 
) const

Get this Item's location in a ContainerGump. Undefined if the Item is not in a Container.

Definition at line 423 of file Item.cpp.

References parent, and y.

Referenced by dumpInfo(), and ContainerGump::getItemCoords().

void Item::getLerped ( sint32 x,
sint32 y,
sint32 z 
) const [inline]

Get lerped location.

Definition at line 339 of file Item.h.

References ix, iy, and iz.

Referenced by ItemSorter::AddItem(), and GameMapGump::GetLocationOfItem().

void Item::getLocation ( sint32 x,
sint32 y,
sint32 z 
) const [inline]

Get this Item's location. Note that this does not return 'usable' coordinates if the Item is contained or equipped.

Definition at line 589 of file Item.h.

References x, y, and z.

Referenced by CurrentMap::addItem(), CurrentMap::addItemToEnd(), ascend(), CameraProcess::CameraProcess(), collideMove(), MainActor::ConCmd_mark(), ActorAnimProcess::doHitSpecial(), ActorAnimProcess::doSpecial(), GameMapGump::DraggingItem(), drawbox(), GameMapGump::DropItem(), explode(), CameraProcess::GetCameraLocation(), CameraProcess::GetLerped(), AnimationTracker::init(), isOn(), MissileTracker::isPathClear(), CameraProcess::ItemMoved(), PathfindingState::load(), MissileTracker::MissileTracker(), GameMapGump::OnMouseClick(), GameMapGump::OnMouseDouble(), overlaps(), overlapsxy(), MiniMapGump::PaintThis(), GameMapGump::PaintThis(), PathfinderProcess::PathfinderProcess(), Actor::receiveHit(), CurrentMap::removeItem(), StartU8Process::run(), QuickAvatarMoverProcess::run(), PathfinderProcess::run(), LoiterProcess::run(), GravityProcess::run(), FireballProcess::run(), EggHatcherProcess::run(), ActorAnimProcess::run(), MiniMapGump::sampleAtPoint(), MainActor::teleport(), GameMapGump::TraceCoordinates(), CurrentMap::traceTopItem(), World::worldStats(), U8Game::writeSaveInfo(), and RemorseGame::writeSaveInfo().

void Item::getLocationAbsolute ( sint32 x,
sint32 y,
sint32 z 
) const

Get the location of the top-most container this Item is in, or this Item's location if not in a container.

Definition at line 407 of file Item.cpp.

References getLocationAbsolute(), getParentAsContainer(), parent, x, y, and z.

Referenced by CurrentMap::areaSearch(), AudioProcess::calculateSoundVolume(), canReach(), PathfindingState::checkItem(), getLocationAbsolute(), getRange(), FireballProcess::run(), and CurrentMap::surfaceSearch().

uint16 Item::getMapNum (  )  const [inline]

Get the 'MapNum' of this Item. Note that this can represent various things depending on the family of this Item.

Definition at line 174 of file Item.h.

References mapnum.

Referenced by MainActor::ConCmd_mark(), MainActor::ConCmd_teleport(), Actor::createActor(), ActorAnimProcess::doSpecial(), ContainerGump::DropItem(), dumpInfo(), CameraProcess::GetCameraLocation(), MonsterEgg::hatch(), U8Game::startGame(), MainActor::teleport(), CombatProcess::waitForTarget(), World::worldStats(), U8Game::writeSaveInfo(), and RemorseGame::writeSaveInfo().

uint16 Item::getNpcNum (  )  const [inline]

Get the 'NpcNum' of this Item. Note that this can represent various things depending on the family of this Item.

Definition at line 166 of file Item.h.

References npcnum.

Referenced by checkLoopScript(), ContainerGump::DropItem(), and dumpInfo().

ObjId Item::getParent (  )  const [inline]

Get the Container this Item is in, if any. (0 if not in a Container).

Definition at line 46 of file Item.h.

References parent.

Referenced by Container::addItem(), Container::CanAddItem(), ContainerGump::DropItem(), leaveFastArea(), MissileTracker::MissileTracker(), ObjectManager::reset(), and ObjectManager::save().

Container * Item::getParentAsContainer (  )  const

Get the Container this Item is in, if any. (NULL if not in a Container).

Definition at line 104 of file Item.cpp.

References getContainer(), Object::getObjId(), parent, and perr.

Referenced by Container::CanAddItem(), destroy(), ItemRelativeGump::GetItemLocation(), ContainerGump::GetItemLocation(), getLocationAbsolute(), PaperdollGump::GetLocationOfItem(), GameMapGump::GetLocationOfItem(), ContainerGump::GetLocationOfItem(), getTopItem(), move(), moveToContainer(), moveToEtherealVoid(), Container::removeContents(), returnFromEtherealVoid(), and Pathfinder::setTarget().

uint16 Item::getQuality (  )  const [inline]

Get this Item's quality (a.k.a. 'Q').

Definition at line 159 of file Item.h.

References quality.

Referenced by checkLoopScript(), ContainerGump::DropItem(), dumpInfo(), getVolume(), getWeight(), and SplitItemProcess::run().

int Item::getRange ( Item item2,
bool  checkz = false 
) const

get 'distance' to other item. This is the maximum of the differences between the x, y (and possibly z) coordinates of the items.

Definition at line 560 of file Item.cpp.

References getFootpadWorld(), and getLocationAbsolute().

Referenced by ActorAnimProcess::doSpecial(), explode(), and AmbushProcess::run().

uint32 Item::getShape (  )  const [inline]

Get this Item's shape number.

Definition at line 146 of file Item.h.

References shape.

Referenced by ItemSorter::AddItem(), Container::CanAddItem(), canExistAt(), canMergeWith(), checkLoopScript(), ActorAnimProcess::doHitSpecial(), ActorAnimProcess::doSpecial(), PaperdollGump::DraggingItem(), GameMapGump::DraggingItem(), ContainerGump::DraggingItem(), ContainerGump::DropItem(), dumpInfo(), PaperdollGump::GetLocationOfItem(), Container::getTotalWeight(), AnimationTracker::init(), CombatProcess::isValidTarget(), ResurrectionProcess::run(), ActorAnimProcess::run(), Actor::setEquip(), PaperdollGump::StartDraggingItem(), U8Game::writeSaveInfo(), and RemorseGame::writeSaveInfo().

ShapeInfo * Item::getShapeInfo (  )  const [inline]

Get the ShapeInfo object for this Item. (The pointer will be cached.).

Definition at line 553 of file Item.h.

References cachedShapeInfo, and getShapeInfoFromGameInstance().

Referenced by ItemSorter::AddItem(), animateItem(), canDrag(), collideMove(), Actor::die(), PaperdollGump::DraggingItem(), PaperdollGump::DropItem(), ContainerGump::DropItem(), fall(), Actor::getArmourClass(), MainActor::getAttackingDex(), Container::getCapacity(), getCentre(), MainActor::getDamageAmount(), Actor::getDamageAmount(), MainActor::getDamageType(), getDamageType(), Actor::getDamageType(), MainActor::getDefendingDex(), Actor::getDefenseType(), getFamily(), getFootpadData(), getFootpadWorld(), ItemRelativeGump::GetItemLocation(), ContainerGump::GetItemLocation(), ContainerGump::getTargetContainer(), getVolume(), MainActor::getWeaponOverlay(), getWeight(), Actor::giveTreasure(), CombatProcess::inAttackRange(), MissileTracker::isPathClear(), AvatarMoverProcess::jump(), leaveFastArea(), Actor::loadMonsterStats(), SplitItemProcess::run(), QuickAvatarMoverProcess::run(), GravityProcess::run(), CurrentMap::scanForValidPosition(), Actor::setEquip(), SplitItemProcess::SplitItemProcess(), AnimationTracker::step(), and CombatProcess::waitForTarget().

ShapeInfo * Item::getShapeInfoFromGameInstance (  )  const

Get the ShapeInfo object for this Item from the game instance.

Definition at line 600 of file Item.cpp.

References GameData::get_instance(), GameData::getMainShapes(), MainShapeArchive::getShapeInfo(), and shape.

Referenced by getShapeInfo().

Shape * Item::getShapeObject (  )  const

Get the Shape object for this Item. (The pointer will be cached.).

Definition at line 605 of file Item.cpp.

References cachedShape, GameData::get_instance(), GameData::getMainShapes(), ShapeArchive::getShape(), and shape.

Referenced by ItemSorter::AddItem(), animateItem(), MiniMapGump::sampleAtPoint(), and PaperdollGump::StartDraggingItem().

int Item::getThrowRange (  ) 

how far can this item be thrown?

Returns:
range, or 0 if item can't be thrown

Definition at line 1655 of file Item.cpp.

References canDrag(), getMainActor(), Actor::getStr(), and getTotalWeight().

Referenced by GameMapGump::DraggingItem().

Item * Item::getTopItem (  ) 

Get the top-most Container this Item is in, or the Item itself if not in a container

Definition at line 119 of file Item.cpp.

References getParentAsContainer(), and parent.

Referenced by Container::CanAddItem(), and canReach().

uint32 Item::getTotalWeight (  )  [virtual]

Get the weight of this Item and its contents, if any.

Reimplemented in Container.

Definition at line 630 of file Item.cpp.

References getWeight().

Referenced by Container::CanAddItem(), GameMapGump::DraggingItem(), GameMapGump::DropItem(), getThrowRange(), and Container::getTotalWeight().

uint32 Item::getVolume (  )  [virtual]

Get the volume this item takes up in a container.

Definition at line 635 of file Item.cpp.

References FLG_INVISIBLE, getFlags(), getQuality(), getShapeInfo(), ShapeInfo::SF_CONTAINER, ShapeInfo::SF_QUANTITY, ShapeInfo::SF_REAGENT, and ShapeInfo::volume.

Referenced by Container::CanAddItem().

uint32 Item::getWeight (  )  [virtual]

Get the weight of this Item.

Definition at line 616 of file Item.cpp.

References getQuality(), getShapeInfo(), ShapeInfo::SF_QUANTITY, ShapeInfo::SF_REAGENT, and ShapeInfo::weight.

Referenced by getTotalWeight().

Pentagram::Box Item::getWorldBox (  )  const

Get the Box this item occupies in the world. Undef if item is contained.

Definition at line 465 of file Item.cpp.

References getFootpadWorld(), x, y, and z.

Referenced by AnimationTracker::checkWeaponHit().

sint32 Item::getZ (  )  const

Get this Item's Z coordinate.

Definition at line 402 of file Item.cpp.

References z.

Referenced by PaperdollGump::GetLocationOfItem(), GravityProcess::init(), GameMapGump::PaintThis(), GravityProcess::run(), Pathfinder::setTarget(), and GravityProcess::terminate().

void Item::grab (  ) 

Make any items on top of this Item fall down and notify any supporting items that we're gone by calling the 'release' event. Note that this Item has to be moved away right after calling grab(), since otherwise the items will immediately hit this Item again.

Definition at line 1525 of file Item.cpp.

References callUsecodeEvent_release(), fall(), UCList::free(), World::get_instance(), World::getCurrentMap(), getItem(), UCList::getSize(), UCList::getuint16(), and CurrentMap::surfaceSearch().

Referenced by GameMapGump::StopDraggingItem().

void Item::hurl ( int  xs,
int  ys,
int  zs,
int  grav 
)

Hurl the item in the given direction.

Definition at line 1557 of file Item.cpp.

References ensureGravityProcess(), GravityProcess::move(), and GravityProcess::setGravity().

Referenced by MissileTracker::launchItem(), and ActorAnimProcess::run().

Item::INTRINSIC ( I_isCrusTypeNPC   ) 

Item::INTRINSIC ( I_getRange   ) 

Item::INTRINSIC ( I_canReach   ) 

Item::INTRINSIC ( I_explode   ) 

Item::INTRINSIC ( I_receiveHit   ) 

Item::INTRINSIC ( I_isExplosive   ) 

Item::INTRINSIC ( I_getSurfaceWeight   ) 

Item::INTRINSIC ( I_guardianBark   ) 

Item::INTRINSIC ( I_getEtherealTop   ) 

Item::INTRINSIC ( I_getFamilyOfType   ) 

Item::INTRINSIC ( I_igniteChaos   ) 

Item::INTRINSIC ( I_grab   ) 

Item::INTRINSIC ( I_fall   ) 

Item::INTRINSIC ( I_shoot   ) 

Item::INTRINSIC ( I_hurl   ) 

Item::INTRINSIC ( I_legalMoveToContainer   ) 

Item::INTRINSIC ( I_legalMoveToPoint   ) 

Item::INTRINSIC ( I_move   ) 

Item::INTRINSIC ( I_destroy   ) 

Item::INTRINSIC ( I_popToEnd   ) 

Item::INTRINSIC ( I_popToContainer   ) 

Item::INTRINSIC ( I_popToCoords   ) 

Item::INTRINSIC ( I_pop   ) 

Item::INTRINSIC ( I_push   ) 

Item::INTRINSIC ( I_legalCreateInCont   ) 

Item::INTRINSIC ( I_legalCreateAtCoords   ) 

Item::INTRINSIC ( I_legalCreateAtPoint   ) 

Item::INTRINSIC ( I_create   ) 

Item::INTRINSIC ( I_closeGump   ) 

Item::INTRINSIC ( I_openGump   ) 

Item::INTRINSIC ( I_getSliderInput   ) 

Item::INTRINSIC ( I_ask   ) 

Item::INTRINSIC ( I_enterFastArea   ) 

Item::INTRINSIC ( I_gotHit   ) 

Item::INTRINSIC ( I_use   ) 

Item::INTRINSIC ( I_look   ) 

Item::INTRINSIC ( I_getDirFromItem   ) 

Item::INTRINSIC ( I_getDirToItem   ) 

Item::INTRINSIC ( I_getDirFromCoords   ) 

Item::INTRINSIC ( I_getDirToCoords   ) 

Item::INTRINSIC ( I_getNpcNum   ) 

Item::INTRINSIC ( I_setMapArray   ) 

Item::INTRINSIC ( I_getMapArray   ) 

Item::INTRINSIC ( I_bark   ) 

Item::INTRINSIC ( I_getVolume   ) 

Item::INTRINSIC ( I_getWeightIncludingContents   ) 

Item::INTRINSIC ( I_getWeight   ) 

Item::INTRINSIC ( I_ascend   ) 

Item::INTRINSIC ( I_isOn   ) 

Item::INTRINSIC ( I_overlapsXY   ) 

Item::INTRINSIC ( I_overlaps   ) 

Item::INTRINSIC ( I_getFootpadData   ) 

Item::INTRINSIC ( I_andStatus   ) 

Item::INTRINSIC ( I_orStatus   ) 

Item::INTRINSIC ( I_getStatus   ) 

Item::INTRINSIC ( I_getTypeFlag   ) 

Item::INTRINSIC ( I_getFamily   ) 

Item::INTRINSIC ( I_setQuantity   ) 

Item::INTRINSIC ( I_setQuality   ) 

Item::INTRINSIC ( I_setQLo   ) 

Item::INTRINSIC ( I_setQHi   ) 

Item::INTRINSIC ( I_setQ   ) 

Item::INTRINSIC ( I_getQLo   ) 

Item::INTRINSIC ( I_getQHi   ) 

Item::INTRINSIC ( I_getQ   ) 

Item::INTRINSIC ( I_getRootContainer   ) 

Item::INTRINSIC ( I_getContainer   ) 

Item::INTRINSIC ( I_getQuantity   ) 

Item::INTRINSIC ( I_getUnkEggType   ) 

Item::INTRINSIC ( I_getQuality   ) 

Item::INTRINSIC ( I_setFrame   ) 

Item::INTRINSIC ( I_getFrame   ) 

Item::INTRINSIC ( I_setShape   ) 

Item::INTRINSIC ( I_getShape   ) 

Item::INTRINSIC ( I_getPoint   ) 

Item::INTRINSIC ( I_getCZ   ) 

Item::INTRINSIC ( I_getCY   ) 

Item::INTRINSIC ( I_getCX   ) 

Item::INTRINSIC ( I_getZ   ) 

Item::INTRINSIC ( I_getY   ) 

Item::INTRINSIC ( I_getX   ) 

Item::INTRINSIC ( I_touch   ) 

bool Item::isOn ( Item item2  )  const

Check if this item is on top another item.

Definition at line 517 of file Item.cpp.

References getFootpadWorld(), and getLocation().

void Item::leaveFastArea (  )  [virtual]

The item has left the fast area

Note:
This can destroy the object

Reimplemented in Egg.

Definition at line 1354 of file Item.cpp.

References callUsecodeEvent_leaveFastArea(), Gump::Close(), collideMove(), destroy(), Container::destroyContents(), flags, FLG_FAST_ONLY, FLG_GUMP_OPEN, Kernel::get_instance(), GUIApp::get_instance(), GUIApp::getGump(), getParent(), Kernel::getProcess(), getShapeInfo(), gravitypid, gump, parent, Process::terminateDeferred(), x, and y.

Referenced by Egg::leaveFastArea(), move(), moveToContainer(), and CurrentMap::unsetChunkFast().

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

Reimplemented from Object.

Reimplemented in Actor, MainActor, Container, Egg, GlobEgg, MonsterEgg, and TeleportEgg.

Definition at line 1840 of file Item.cpp.

References CurrentMap::addItem(), EXT_INCURMAP, extendedflags, flags, FLG_CONTAINED, FLG_EQUIPPED, FLG_ETHEREAL, frame, World::get_instance(), World::getCurrentMap(), Object::getObjId(), gravitypid, gump, Object::loadData(), mapnum, npcnum, parent, quality, shape, x, y, and z.

Referenced by MonsterEgg::loadData(), GlobEgg::loadData(), Egg::loadData(), and Container::loadData().

void Item::move ( sint32  x,
sint32  y,
sint32  z 
)

Move an item. This moves an item to the new location, and updates CurrentMap and fastArea if necessary.

Definition at line 139 of file Item.cpp.

References CurrentMap::addItem(), CurrentMap::addItemToEnd(), callUsecodeEvent_justMoved(), enterFastArea(), World::etherealRemove(), EXT_CAMERA, EXT_INCURMAP, EXT_LERP_NOPREV, extendedflags, flags, FLG_CONTAINED, FLG_DISPOSABLE, FLG_EQUIPPED, FLG_ETHEREAL, FLG_FAST_ONLY, FLG_FASTAREA, World::get_instance(), CameraProcess::GetCameraProcess(), CurrentMap::getChunkSize(), World::getCurrentMap(), Object::getObjId(), getParentAsContainer(), CurrentMap::isChunkFast(), CameraProcess::ItemMoved(), leaveFastArea(), Object::objid, parent, perr, CurrentMap::removeItem(), Container::removeItem(), x, y, and z.

Referenced by collideMove(), Actor::die(), ActorAnimProcess::doSpecial(), GameMapGump::DropItem(), GlobEgg::enterFastArea(), MonsterEgg::hatch(), SpriteProcess::init(), returnFromEtherealVoid(), GravityProcess::run(), FireballProcess::run(), CreateItemProcess::run(), and Actor::teleport().

void Item::movedByPlayer (  ) 

Check if moving this item is stealing; call AvatarStoleSomething if so.

Definition at line 381 of file Item.cpp.

References CurrentMap::areaSearch(), callUsecodeEvent_AvatarStoleSomething(), flags, FLG_OWNED, World::get_instance(), getActor(), World::getCurrentMap(), getItem(), Object::getObjId(), UCList::getSize(), and UCList::getuint16().

Referenced by GUIApp::stopDragging().

bool Item::moveToContainer ( Container container,
bool  checkwghtvol = false 
)

Move an item. This moves an item to a container and updates CurrentMap and fastArea if necessary.

Parameters:
container The container this item should be placed in
Returns:
true if item was moved, false if failed

Definition at line 237 of file Item.cpp.

References Container::addItem(), callUsecodeEvent_justMoved(), Container::CanAddItem(), enterFastArea(), World::etherealRemove(), EXT_INCURMAP, EXT_LERP_NOPREV, extendedflags, flags, FLG_CONTAINED, FLG_EQUIPPED, FLG_ETHEREAL, FLG_FASTAREA, FLG_GUMP_OPEN, FLG_OWNED, World::get_instance(), World::getCurrentMap(), Object::getObjId(), getParentAsContainer(), leaveFastArea(), Object::objid, parent, perr, CurrentMap::removeItem(), Container::removeItem(), setFlagRecursively(), x, y, and z.

Referenced by U8Game::ConCmd_cheatEquip(), U8Game::ConCmd_cheatItems(), PaperdollGump::DropItem(), GameMapGump::DropItem(), ContainerGump::DropItem(), Actor::giveTreasure(), returnFromEtherealVoid(), Actor::setEquip(), and U8Game::startGame().

void Item::moveToEtherealVoid (  ) 

Move an item to the Ethereal Void.

Definition at line 332 of file Item.cpp.

References World::etherealPush(), EXT_INCURMAP, extendedflags, flags, FLG_CONTAINED, FLG_EQUIPPED, FLG_ETHEREAL, World::get_instance(), World::getCurrentMap(), Object::getObjId(), getParentAsContainer(), Object::objid, parent, perr, CurrentMap::removeItem(), and Container::removeItem().

Referenced by ascend(), and Actor::teleport().

uint16 Item::openGump ( uint32  gumpshape  ) 

Open a gump with the given shape for this Item.

! constant

!TODO: clean up the way this is set ! having the itemarea associated with the shape through the ! GumpShapeFlex maybe

Definition at line 1396 of file Item.cpp.

References Gump::FLAG_DRAGGABLE, Gump::FLAG_ITEM_DEPENDENT, flags, FLG_GUMP_OPEN, GameData::get_instance(), GameData::getGumps(), Object::getObjId(), ShapeArchive::getShape(), gump, ContainerGump::InitGump(), Object::objid, ContainerGump::setItemArea(), and shape.

Referenced by use().

bool Item::overlaps ( Item item2  )  const

Check if this item overlaps another item in 3D world-space.

Definition at line 472 of file Item.cpp.

References getFootpadWorld(), and getLocation().

bool Item::overlapsxy ( Item item2  )  const

Check if this item overlaps another item in the xy dims in 3D space.

Definition at line 496 of file Item.cpp.

References getFootpadWorld(), and getLocation().

void Item::randomGumpLocation (  ) 

Randomize the Item's location in a ContainerGump. Effectively this sets the coordinates to (255,255) and lets the ContainerGump randomize the position when it is next opened.

Definition at line 438 of file Item.cpp.

References parent, and y.

Referenced by U8Game::ConCmd_cheatItems(), PaperdollGump::DropItem(), GameMapGump::DropItem(), ContainerGump::DropItem(), and Actor::giveTreasure().

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

receive a hit

Parameters:
other The item delivering the hit
dir The direction the hit is coming from (or inverse? CHECKME!)
damage The force of the hit. Zero for default
type The type of damage done. Zero for default

Referenced by ActorAnimProcess::run().

void Item::returnFromEtherealVoid (  ) 

Move an item out of the Ethereal Void to where it originally was.

Definition at line 359 of file Item.cpp.

References flags, FLG_CONTAINED, FLG_EQUIPPED, FLG_ETHEREAL, Object::getObjId(), getParentAsContainer(), move(), moveToContainer(), perr, x, y, and z.

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

save the actual Item data

Reimplemented from Object.

Reimplemented in Actor, MainActor, Container, Egg, GlobEgg, MonsterEgg, and TeleportEgg.

Definition at line 1818 of file Item.cpp.

References extendedflags, flags, FLG_CONTAINED, FLG_EQUIPPED, FLG_ETHEREAL, frame, Object::getObjId(), gravitypid, gump, mapnum, npcnum, parent, quality, Object::saveData(), shape, ODataSource::write2(), x, y, and z.

Referenced by MonsterEgg::saveData(), GlobEgg::saveData(), Egg::saveData(), and Container::saveData().

void Item::setExtFlag ( uint32  mask  )  [inline]

Set the extendedflags set in the given mask.

Definition at line 140 of file Item.h.

References extendedflags.

Referenced by CurrentMap::addItem(), CurrentMap::addItemToEnd(), CameraProcess::CameraProcess(), collideMove(), and GameMapGump::OnMouseClick().

void Item::setExtFlags ( uint32  f  )  [inline]

Set extendedflags.

Definition at line 134 of file Item.h.

References extendedflags.

void Item::setFlag ( uint32  mask  )  [inline]

Set the flags set in the given mask.

Definition at line 126 of file Item.h.

References flags.

Referenced by GameMapGump::ConCmd_dumpMap(), Actor::createActor(), ActorAnimProcess::doSpecial(), Actor::setEquip(), setFlagRecursively(), Container::setFlagRecursively(), and AnimationTracker::updateActorFlags().

virtual void Item::setFlagRecursively ( uint32  mask  )  [inline, virtual]

Reimplemented in Container.

Definition at line 128 of file Item.h.

References setFlag().

Referenced by moveToContainer().

void Item::setFrame ( uint32  frame_  )  [inline]

Set this Item's frame number.

Definition at line 156 of file Item.h.

References frame.

Referenced by SpriteProcess::run(), GrantPeaceProcess::run(), FireballProcess::run(), and ActorAnimProcess::run().

void Item::setGravityPID ( ProcId  pid  )  [inline]

Set the PID of the GravityProcess for this Item.

Definition at line 273 of file Item.h.

References gravitypid.

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

void Item::setGumpLocation ( sint32  x,
sint32  y 
)

Set the Item's location in a ContainerGump. NOP if the Item is not in a Container.

Definition at line 431 of file Item.cpp.

References parent, and y.

Referenced by U8Game::ConCmd_cheatItems(), ContainerGump::DropItem(), and ContainerGump::getItemCoords().

void Item::setLocation ( sint32  x,
sint32  y,
sint32  z 
)

Set item location. This strictly sets the location, and does not even update CurrentMap

Definition at line 132 of file Item.cpp.

References x, y, and z.

Referenced by Map::loadFixed(), Map::loadFixedFormatObjects(), World::loadItemCachNPCData(), and RemorseGame::startGame().

void Item::setMapNum ( uint16  mapnum_  )  [inline]

Set the 'NpcNum' of this Item. Note that this can represent various things depending on the family of this Item.

Definition at line 178 of file Item.h.

References mapnum.

Referenced by Actor::createActor(), MonsterEgg::hatch(), MainActor::teleport(), and Actor::teleport().

void Item::setNpcNum ( uint16  npcnum_  )  [inline]

Set the 'NpcNum' of this Item. Note that this can represent various things depending on the family of this Item.

Definition at line 170 of file Item.h.

References npcnum.

Referenced by Actor::createActor(), and MonsterEgg::hatch().

void Item::setParent ( ObjId  p  )  [inline]

Set the parent container of this item.

Definition at line 49 of file Item.h.

References parent.

void Item::setQuality ( uint16  quality_  )  [inline]

Set this Item's quality (a.k.a 'Q');.

Definition at line 162 of file Item.h.

References quality.

Referenced by SplitItemProcess::run().

void Item::setShape ( uint32  shape_  )  [inline]

Set this Item's shape number.

Definition at line 149 of file Item.h.

References cachedShape, cachedShapeInfo, and shape.

Referenced by ItemFactory::createActor(), and ItemFactory::createItem().

void Item::setupLerp ( sint32  gametick  ) 

Setup the lerped info for this gametick and animate the item.

Definition at line 1216 of file Item.cpp.

References animateItem(), EXT_LERP_NOPREV, extendedflags, flags, FLG_CONTAINED, frame, Item::Lerped::frame, ix, iy, iz, l_next, l_prev, last_setup, Object::objid, shape, Item::Lerped::shape, x, Item::Lerped::x, Item::Lerped::y, y, z, and Item::Lerped::z.

Referenced by GameMapGump::GetLocationOfItem().

void Item::setZ ( sint32  z_  )  [inline]

Set this Item's Z coordinate.

Definition at line 93 of file Item.h.

References z.

Referenced by Actor::setEquip().

uint32 Item::use (  ) 

Definition at line 1163 of file Item.cpp.

References callUsecodeEvent_use(), closeGump(), FLG_GUMP_OPEN, getFlags(), Actor::isDead(), and openGump().

Referenced by ContainerGump::OnMouseDouble().


Friends And Related Function Documentation

friend class ItemFactory [friend]

Reimplemented in Container, Egg, GlobEgg, MonsterEgg, and TeleportEgg.

Definition at line 36 of file Item.h.


Member Data Documentation

Shape* Item::cachedShape [mutable, protected]

Definition at line 492 of file Item.h.

Referenced by getShapeObject(), and setShape().

ShapeInfo* Item::cachedShapeInfo [mutable, protected]

Definition at line 493 of file Item.h.

Referenced by getShapeInfo(), and setShape().

uint32 Item::extendedflags [protected]

Definition at line 488 of file Item.h.

Referenced by callUsecodeEvent(), clearExtFlag(), ItemFactory::createActor(), ItemFactory::createItem(), destroy(), getExtFlags(), loadData(), move(), moveToContainer(), moveToEtherealVoid(), saveData(), setExtFlag(), setExtFlags(), and setupLerp().

uint16 Item::flags [protected]

Definition at line 483 of file Item.h.

Referenced by callUsecodeEvent(), clearFlag(), clearGump(), closeGump(), collideMove(), ItemFactory::createActor(), ItemFactory::createItem(), destroy(), enterFastArea(), GlobEgg::enterFastArea(), fall(), getCentre(), getFlags(), getFootpadData(), getFootpadWorld(), leaveFastArea(), loadData(), move(), movedByPlayer(), moveToContainer(), moveToEtherealVoid(), openGump(), returnFromEtherealVoid(), saveData(), setFlag(), and setupLerp().

uint32 Item::frame [protected]

Definition at line 480 of file Item.h.

Referenced by animateItem(), ItemFactory::createActor(), ItemFactory::createItem(), MainActor::getArmourClass(), MainActor::getDefenseType(), getFrame(), MainActor::getWeaponOverlay(), Actor::giveTreasure(), TeleportEgg::isTeleporter(), loadData(), saveData(), setFrame(), and setupLerp().

ProcId Item::gravitypid [protected]

Definition at line 507 of file Item.h.

Referenced by MainActor::ensureGravityProcess(), ensureGravityProcess(), getGravityPID(), leaveFastArea(), loadData(), saveData(), and setGravityPID().

ObjId Item::gump [protected]

Definition at line 506 of file Item.h.

Referenced by clearGump(), closeGump(), getGump(), leaveFastArea(), loadData(), openGump(), and saveData().

sint32 Item::ix [protected]

Definition at line 504 of file Item.h.

Referenced by ascend(), doLerp(), explode(), getDirToItemCentre(), getLerped(), and setupLerp().

sint32 Item::iy [protected]

Definition at line 504 of file Item.h.

Referenced by ascend(), doLerp(), explode(), getDirToItemCentre(), getLerped(), and setupLerp().

sint32 Item::iz [protected]

Definition at line 504 of file Item.h.

Referenced by ascend(), doLerp(), explode(), getDirToItemCentre(), getLerped(), and setupLerp().

Lerped Item::l_next [protected]

Definition at line 503 of file Item.h.

Referenced by doLerp(), and setupLerp().

Lerped Item::l_prev [protected]

Definition at line 502 of file Item.h.

Referenced by doLerp(), and setupLerp().

sint32 Item::last_setup [private]

The gametick setupLerp was last called on.

Definition at line 518 of file Item.h.

Referenced by animateItem(), and setupLerp().

uint16 Item::mapnum [protected]

Definition at line 486 of file Item.h.

Referenced by ItemFactory::createActor(), ItemFactory::createItem(), MonsterEgg::getActivity(), getMapNum(), TeleportEgg::hatch(), loadData(), saveData(), and setMapNum().

uint16 Item::npcnum [protected]

Definition at line 485 of file Item.h.

Referenced by ItemFactory::createActor(), ItemFactory::createItem(), getNpcNum(), Egg::getXRange(), Egg::getYRange(), loadData(), saveData(), setNpcNum(), Egg::setXRange(), and Egg::setYRange().

ObjId Item::parent [protected]

Definition at line 490 of file Item.h.

Referenced by collideMove(), destroy(), dumpInfo(), getGumpLocation(), getLocationAbsolute(), getParent(), getParentAsContainer(), getTopItem(), leaveFastArea(), loadData(), move(), moveToContainer(), moveToEtherealVoid(), randomGumpLocation(), Container::removeContents(), saveData(), setGumpLocation(), and setParent().

uint16 Item::quality [protected]

Definition at line 484 of file Item.h.

Referenced by callUsecodeEvent(), ItemFactory::createActor(), ItemFactory::createItem(), GlobEgg::enterFastArea(), MonsterEgg::getMonsterShape(), MonsterEgg::getProb(), getQuality(), TeleportEgg::getTeleportId(), Actor::giveTreasure(), loadData(), saveData(), and setQuality().

uint32 Item::shape [private]

Definition at line 477 of file Item.h.

Referenced by callUsecodeEvent(), enterFastArea(), getShape(), getShapeInfoFromGameInstance(), getShapeObject(), Actor::giveTreasure(), MonsterEgg::hatch(), loadData(), openGump(), saveData(), setShape(), and setupLerp().

sint32 Item::x [protected]

Definition at line 482 of file Item.h.

Referenced by MainActor::ConCmd_mark(), destroy(), Actor::die(), dumpInfo(), GlobEgg::enterFastArea(), explode(), getCentre(), getLocation(), getLocationAbsolute(), getWorldBox(), MonsterEgg::hatch(), leaveFastArea(), loadData(), move(), moveToContainer(), Actor::receiveHit(), Container::removeContents(), returnFromEtherealVoid(), saveData(), setLocation(), setupLerp(), MainActor::teleport(), and Actor::teleport().

sint32 Item::y [protected]

Definition at line 482 of file Item.h.

Referenced by MainActor::ConCmd_mark(), destroy(), Actor::die(), dumpInfo(), GlobEgg::enterFastArea(), explode(), getCentre(), getGumpLocation(), getLocation(), getLocationAbsolute(), getWorldBox(), MonsterEgg::hatch(), leaveFastArea(), loadData(), move(), moveToContainer(), randomGumpLocation(), Actor::receiveHit(), Container::removeContents(), returnFromEtherealVoid(), saveData(), setGumpLocation(), setLocation(), setupLerp(), MainActor::teleport(), and Actor::teleport().

sint32 Item::z [protected]

Definition at line 482 of file Item.h.

Referenced by MainActor::ConCmd_mark(), Actor::die(), dumpInfo(), GlobEgg::enterFastArea(), explode(), getCentre(), getLocation(), getLocationAbsolute(), getWorldBox(), getZ(), MonsterEgg::hatch(), loadData(), move(), moveToContainer(), Actor::receiveHit(), Container::removeContents(), returnFromEtherealVoid(), saveData(), setLocation(), setupLerp(), setZ(), MainActor::teleport(), and Actor::teleport().


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