ScummVM API documentation
Ultima::Ultima8::Item Class Reference
Inheritance diagram for Ultima::Ultima8::Item:
Ultima::Ultima8::Object Ultima::Ultima8::Container Ultima::Ultima8::Egg Ultima::Ultima8::GlobEgg Ultima::Ultima8::MonsterEgg Ultima::Ultima8::Actor Ultima::Ultima8::TeleportEgg Ultima::Ultima8::MainActor

Classes

struct  Lerped
 

Public Types

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, FLG_BROKEN = 0x8000
}
 
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,
  EXT_TARGET = 0x0200, EXT_FEMALE = 0x8000
}
 

Public Member Functions

ObjId getParent () const
 Get the Container this Item is in, if any. (0 if not in a Container)
 
void setParent (ObjId p)
 Set the parent container of this item.
 
ContainergetParentAsContainer () const
 Get the Container this Item is in, if any. (NULL if not in a Container)
 
ContainergetRootContainer () const
 Get the top-most Container this Item is in, if any. (NULL if not in a Container)
 
const ItemgetTopItem () const
 
void setLocation (int32 x, int32 y, int32 z)
 
void setLocation (const Point3 &pt)
 
virtual void move (int32 x, int32 y, int32 z)
 
void move (const Point3 &pt)
 Move, but with a point struct.
 
bool moveToContainer (Container *container, bool checkwghtvol=false)
 
void moveToEtherealVoid ()
 Move an item to the Ethereal Void.
 
void returnFromEtherealVoid ()
 Move an item out of the Ethereal Void to where it originally was.
 
void movedByPlayer ()
 Check if moving this item is stealing; call AvatarStoleSomething if so.
 
Point3 getLocationAbsolute () const
 
Point3 getLocation () const
 
int32 getZ () const
 Get this Item's Z coordinate.
 
void setZ (int32 z)
 Set this Item's Z coordinate.
 
void getGumpLocation (int32 &x, int32 &y) const
 
void setGumpLocation (int32 x, int32 y)
 
void randomGumpLocation ()
 
Point3 getCentre () const
 
void getFootpadWorld (int32 &x, int32 &y, int32 &z) const
 Get the size of this item's 3D bounding box, in world coordinates.
 
void getFootpadData (int32 &x, int32 &y, int32 &z) const
 
Box getWorldBox () const
 Get the Box this item occupies in the world. Undef if item is contained.
 
uint16 getFlags () const
 Get all flags.
 
bool hasFlags (uint16 flags) const
 Does this item have any of the given flags mask set.
 
void setFlag (uint32 mask)
 Set the flags set in the given mask.
 
virtual void setFlagRecursively (uint32 mask)
 
void clearFlag (uint32 mask)
 Clear the flags set in the given mask.
 
void setExtFlags (uint32 f)
 Set _extendedFlags.
 
uint32 getExtFlags () const
 Get _extendedFlags.
 
bool hasExtFlags (uint32 flags) const
 Does item have any of the given extended flags.
 
void setExtFlag (uint32 mask)
 Set the _extendedFlags set in the given mask.
 
void clearExtFlag (uint32 mask)
 Clear the _extendedFlags set in the given mask.
 
uint32 getShape () const
 Get this Item's shape number.
 
void setShape (uint32 shape)
 Set this Item's shape number.
 
uint32 getFrame () const
 Get this Item's frame number.
 
void setFrame (uint32 frame)
 Set this Item's frame number.
 
uint16 getQuality () const
 Get this Item's quality (a.k.a. 'Q')
 
void setQuality (uint16 quality)
 Set this Item's quality (a.k.a 'Q');.
 
uint16 getNpcNum () const
 
void setNpcNum (uint16 npcnum)
 
uint16 getMapNum () const
 
void setMapNum (uint16 mapnum)
 
const ShapeInfogetShapeInfo () const
 Get the ShapeInfo object for this Item. (The pointer will be cached.)
 
virtual const ShapeInfogetShapeInfoFromGameInstance () const
 Get the ShapeInfo object for this Item from the game instance.
 
const ShapegetShapeObject () const
 Get the Shape object for this Item. (The pointer will be cached.)
 
uint16 getFamily () const
 
bool canMergeWith (const Item *other) const
 Check if we can merge with another item.
 
ObjId getGump () const
 Get the open ContainerGump for this Item, if any. (NULL if not open.)
 
void clearGump ()
 Call this to notify the Item's open Gump has closed.
 
ObjId openGump (uint32 gumpshape)
 Open a gump with the given shape for this Item.
 
void closeGump ()
 Close this Item's gump, if any.
 
ProcId bark (const Std::string &msg, ObjId id=0)
 
void clearBark ()
 Call this to notify the Item's open bark has closed.
 
void closeBark ()
 Close this Item's bark, if any.
 
virtual void destroy (bool delnow=false)
 Destroy self.
 
bool overlaps (const Item &item2) const
 Check if this item overlaps another item in 3D world-space.
 
bool overlapsxy (const Item &item2) const
 Check if this item overlaps another item in the xy dims in 3D space.
 
bool isOn (const Item &item2) const
 Check if this item is on top of another item.
 
bool isCompletelyOn (const Item &item2) const
 Check if this item is on completely on top of another item.
 
bool isCentreOn (const Item &item2) const
 Check if the centre of this item is on top of another item.
 
bool isOnScreen () const
 Check if the item is currently entirely visible on screen.
 
bool isPartlyOnScreen () const
 Check if the item is currently partly visible on screen.
 
bool canExistAt (int32 x, int32 y, int32 z, bool needsupport=false) const
 Check if this item can exist at the given coordinates.
 
bool canExistAt (const Point3 &pt, bool needsupport=false) const
 
Direction getDirToItemCentre (const Item &item2) const
 
Direction getDirToItemCentre (const Point3 &pt) const
 Same as above, but from a fixed point.
 
int getRange (const Item &item2, bool checkz=false) const
 
int getRangeIfVisible (const Item &item2) const
 get 'distance' to other item if it's visible (ie, there's nothing blocking the path)
 
bool canReach (const Item *other, int range, int32 x=0, int32 y=0, int32 z=0) const
 
virtual int32 collideMove (int32 x, int32 y, int32 z, bool teleport, bool force, ObjId *hititem=0, uint8 *dirs=0)
 
int32 ascend (int delta)
 
void fall ()
 
void grab ()
 
void hurl (int xs, int ys, int zs, int grav)
 Hurl the item in the given direction.
 
void setGravityPID (ProcId pid)
 Set the PID of the GravityProcess for this Item. There should be only one.
 
ProcId getGravityPID () const
 Get the PID of the GravityProcess for this Item (or 0)
 
virtual GravityProcessensureGravityProcess ()
 Get the GravityProcess of this Item, creating it if necessary.
 
virtual uint32 getWeight () const
 Get the weight of this Item.
 
virtual uint32 getTotalWeight () const
 Get the weight of this Item and its contents, if any.
 
virtual uint32 getVolume () const
 Get the volume this item takes up in a container.
 
void explode (int explosion_type, bool destroy_item, bool cause_damage=true)
 
virtual uint16 getDamageType () const
 get the damage type this object does when hitting something
 
virtual void receiveHit (ObjId other, Direction dir, int damage, uint16 type)
 
uint16 fireWeapon (int32 x, int32 y, int32 z, Direction dir, int firetype, bool findtarget)
 fire the given weapon type in the given direction from location x, y, z.
 
uint16 fireDistance (const Item *other, Direction dir, int16 xoff, int16 yoff, int16 zoff) const
 
uint8 getDamagePoints () const
 get damage points, used in Crusader for item damage.
 
void setDamagePoints (uint8 points)
 set damage points, used in Crusader for item damage.
 
int32 getTargetZRelativeToAttackerZ (int32 attackerz) const
 
unsigned int countNearby (uint32 shape, uint16 range) const
 count nearby objects of a given shape
 
bool canDrag () const
 can this item be dragged?
 
int getThrowRange () const
 
bool checkLoopScript (const uint8 *script, uint32 scriptsize) const
 
uint32 callUsecodeEvent_look ()
 
uint32 callUsecodeEvent_use ()
 
uint32 callUsecodeEvent_anim ()
 
uint32 callUsecodeEvent_cachein ()
 
uint32 callUsecodeEvent_hit (ObjId hitted, int16 hitforce)
 
uint32 callUsecodeEvent_gotHit (ObjId hitter, int16 hitforce)
 
uint32 callUsecodeEvent_hatch ()
 
uint32 callUsecodeEvent_schedule (uint32 time)
 
uint32 callUsecodeEvent_release ()
 
uint32 callUsecodeEvent_equip ()
 
uint32 callUsecodeEvent_equipWithParam (ObjId param)
 
uint32 callUsecodeEvent_unequip ()
 
uint32 callUsecodeEvent_unequipWithParam (ObjId param)
 
uint32 callUsecodeEvent_combine ()
 
uint32 callUsecodeEvent_calledFromAnim ()
 
uint32 callUsecodeEvent_enterFastArea ()
 
uint32 callUsecodeEvent_leaveFastArea ()
 
uint32 callUsecodeEvent_cast (uint16 unk)
 
uint32 callUsecodeEvent_justMoved ()
 
uint32 callUsecodeEvent_AvatarStoleSomething (uint16 unk)
 
uint32 callUsecodeEvent_guardianBark (int16 unk)
 
uint32 callUsecodeEvent_unhatch ()
 
uint32 use ()
 
Point3 getLerped () const
 Get lerped location.
 
void doLerp (int32 factor)
 
void setupLerp (int32 gametick)
 Setup the lerped info for this gametick and animate the item.
 
virtual uint32 enterFastArea ()
 The item has entered the fast area.
 
virtual void leaveFastArea ()
 
Common::String dumpInfo () const override
 dump some info about this item to a string
 
bool loadData (Common::ReadStream *rs, uint32 version)
 
void saveData (Common::WriteStream *ws) override
 
 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_setUnkEggType)
 
 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_setQAndCombine)
 
 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_isCompletelyOn)
 
 INTRINSIC (I_isCentreOn)
 
 INTRINSIC (I_isInNpc)
 
 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_setNpcNum)
 
 INTRINSIC (I_getDirToCoords)
 
 INTRINSIC (I_getDirFromCoords)
 
 INTRINSIC (I_getDirToItem)
 
 INTRINSIC (I_getDirFromItem)
 
 INTRINSIC (I_getDirFromTo16)
 
 INTRINSIC (I_getClosestDirectionInRange)
 
 INTRINSIC (I_look)
 
 INTRINSIC (I_use)
 
 INTRINSIC (I_gotHit)
 
 INTRINSIC (I_enterFastArea)
 
 INTRINSIC (I_cast)
 
 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_getRangeIfVisible)
 
 INTRINSIC (I_isCrusTypeNPC)
 
 INTRINSIC (I_setBroken)
 
 INTRINSIC (I_inFastArea)
 
 INTRINSIC (I_equip)
 
 INTRINSIC (I_unequip)
 
 INTRINSIC (I_avatarStoleSomething)
 
 INTRINSIC (I_isPartlyOnScreen)
 
 INTRINSIC (I_fireWeapon)
 
 INTRINSIC (I_fireDistance)
 
- Public Member Functions inherited from Ultima::Ultima8::Object
ObjId getObjId () const
 get this Object's objID
 
virtual ObjId assignObjId ()
 
virtual void clearObjId ()
 Clear objID of self and contents (if any)
 
ProcId callUsecode (uint16 classid, uint16 offset, const uint8 *args=0, int argsize=0)
 
bool loadData (Common::ReadStream *rs, uint32 version)
 

Static Public Attributes

static const int MAX_QUANTITY = 666
 

Protected Member Functions

bool isRobotCru () const
 True if this is a Robot shape (in a fixed list)
 
int scaleReceivedDamageCru (int damage, uint16 type) const
 

Protected Attributes

uint32 _frame
 
int32 _x
 
int32 _y
 
int32 _z
 
uint16 _flags
 
uint16 _quality
 
uint16 _npcNum
 
uint16 _mapNum
 
uint32 _extendedFlags
 
ObjId _parent
 
const Shape_cachedShape
 
const ShapeInfo_cachedShapeInfo
 
Lerped _lPrev
 
Lerped _lNext
 
int32 _ix
 
int32 _iy
 
int32 _iz
 
ObjId _gump
 
ObjId _bark
 
ProcId _gravityPid
 
uint8 _damagePoints
 
- Protected Attributes inherited from Ultima::Ultima8::Object
ObjId _objId
 

Member Enumeration Documentation

◆ 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 - confirmed same meaning in crusader.

FLG_HANGING 

Item is suspended in the air.

FLG_FASTAREA 

Item is in the fast area.

FLG_LOW_FRICTION 

Item has low friction.

FLG_BROKEN 

Item is broken - Crusader only - broken items are not targetable.

◆ 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.

EXT_TARGET 

Item is the current reticle target in Crusader.

EXT_FEMALE 

Item is Crusader Female NPC (controls sfx)

Member Function Documentation

◆ getTopItem()

const Item* Ultima::Ultima8::Item::getTopItem ( ) const

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

◆ setLocation()

void Ultima::Ultima8::Item::setLocation ( int32  x,
int32  y,
int32  z 
)

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

◆ move()

virtual void Ultima::Ultima8::Item::move ( int32  x,
int32  y,
int32  z 
)
virtual

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

Reimplemented in Ultima::Ultima8::MainActor.

◆ moveToContainer()

bool Ultima::Ultima8::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
containerThe container this item should be placed in
Returns
true if item was moved, false if failed

◆ getLocationAbsolute()

Point3 Ultima::Ultima8::Item::getLocationAbsolute ( ) const

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

◆ getLocation()

Point3 Ultima::Ultima8::Item::getLocation ( ) const
inline

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

◆ getGumpLocation()

void Ultima::Ultima8::Item::getGumpLocation ( int32 &  x,
int32 &  y 
) const

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

◆ setGumpLocation()

void Ultima::Ultima8::Item::setGumpLocation ( int32  x,
int32  y 
)

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

◆ randomGumpLocation()

void Ultima::Ultima8::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.

◆ getCentre()

Point3 Ultima::Ultima8::Item::getCentre ( ) const

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

◆ getFootpadData()

void Ultima::Ultima8::Item::getFootpadData ( int32 &  x,
int32 &  y,
int32 &  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!)

◆ getNpcNum()

uint16 Ultima::Ultima8::Item::getNpcNum ( ) const
inline

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

◆ setNpcNum()

void Ultima::Ultima8::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.

◆ getMapNum()

uint16 Ultima::Ultima8::Item::getMapNum ( ) const
inline

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

◆ setMapNum()

void Ultima::Ultima8::Item::setMapNum ( uint16  mapnum)
inline

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

◆ getFamily()

uint16 Ultima::Ultima8::Item::getFamily ( ) const

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

◆ getDirToItemCentre()

Direction Ultima::Ultima8::Item::getDirToItemCentre ( const Item item2) const

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

◆ getRange()

int Ultima::Ultima8::Item::getRange ( const 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.

◆ canReach()

bool Ultima::Ultima8::Item::canReach ( const Item other,
int  range,
int32  x = 0,
int32  y = 0,
int32  z = 0 
) const

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

Parameters
otheritem to be reached
rangerange
xx coordinate of other to use, If zero, use real coords.
yy coordinate of other to use
zz coordinate of other to use.

◆ collideMove()

virtual int32 Ultima::Ultima8::Item::collideMove ( int32  x,
int32  y,
int32  z,
bool  teleport,
bool  force,
ObjId *  hititem = 0,
uint8 *  dirs = 0 
)
virtual

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

Parameters
teleportmove without colliding with objects between source and destination
forceforce the object to get to the destination without being blocked by solid objects
hititemif non-NULL, this is set to (one of) the item(s) blocking the movement, or to zero if nothing blocked it
dirsif non-NULL, this is set to a bitmask of the x/y/z
Returns
0-0x4000 representing how far it got. 0 = didn't move 0x4000 = reached destination
Note
This can destroy the object

Reimplemented in Ultima::Ultima8::Actor.

◆ ascend()

int32 Ultima::Ultima8::Item::ascend ( int  delta)

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

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

◆ fall()

void Ultima::Ultima8::Item::fall ( )

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

◆ grab()

void Ultima::Ultima8::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.

◆ explode()

void Ultima::Ultima8::Item::explode ( int  explosion_type,
bool  destroy_item,
bool  cause_damage = true 
)

explode with explosion type (0,1,2), whether to destroy the item, and whether to cause splash damage.

◆ receiveHit()

virtual void Ultima::Ultima8::Item::receiveHit ( ObjId  other,
Direction  dir,
int  damage,
uint16  type 
)
virtual

receive a hit

Parameters
otherThe item delivering the hit
dirThe direction the hit is coming from (or inverse? CHECKME!)
damageThe force of the hit. Zero for default
typeThe type of damage done. Zero for default

Reimplemented in Ultima::Ultima8::Actor.

◆ fireDistance()

uint16 Ultima::Ultima8::Item::fireDistance ( const Item other,
Direction  dir,
int16  xoff,
int16  yoff,
int16  zoff 
) const

get the distance (in map tiles) if we were to fire in this direction to "other" and could hit, otherwise return 0.

◆ getTargetZRelativeToAttackerZ()

int32 Ultima::Ultima8::Item::getTargetZRelativeToAttackerZ ( int32  attackerz) const

Get the right Z which an attacker should aim for, given the attacker's z. (Crusader only)

◆ getThrowRange()

int Ultima::Ultima8::Item::getThrowRange ( ) const

how far can this item be thrown?

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

◆ checkLoopScript()

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

Check this Item against the given loopscript

Parameters
scriptThe loopscript to run
scriptsizeThe size (in bytes) of the loopscript
Returns
true if the item matches, false otherwise

◆ doLerp()

void Ultima::Ultima8::Item::doLerp ( int32  factor)
inline

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

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

◆ leaveFastArea()

virtual void Ultima::Ultima8::Item::leaveFastArea ( )
virtual

The item has left the fast area

Note
This can destroy the object

Reimplemented in Ultima::Ultima8::Egg.

◆ scaleReceivedDamageCru()

int Ultima::Ultima8::Item::scaleReceivedDamageCru ( int  damage,
uint16  type 
) const
protected

Scale a received damage value based on the current difficulty level and the type of object this is.


The documentation for this class was generated from the following file: