ScummVM API documentation
Ultima::Shared::Maps::Creature Class Reference

#include <creature.h>

Inheritance diagram for Ultima::Shared::Maps::Creature:
Ultima::Shared::Maps::DungeonCreature Ultima::Ultima1::Widgets::OverworldMonster Ultima::Ultima1::Widgets::Person Ultima::Ultima1::Widgets::DungeonMonster Ultima::Ultima1::Widgets::EnemyVessel Ultima::Ultima1::Widgets::Bard Ultima::Ultima1::Widgets::Guard Ultima::Ultima1::Widgets::King Ultima::Ultima1::Widgets::Merchant Ultima::Ultima1::Widgets::UrbanPlayer Ultima::Ultima1::Widgets::Wench

Public Member Functions

 Creature (Game *game, MapBase *)
 
 Creature (Game *game, MapBase *, int hitPoints)
 
virtual ~Creature ()
 
void synchronize (Common::Serializer &s)
 
virtual void update (bool isPreUpdate)
 
bool isDead () const
 
virtual bool subtractHitPoints (uint amount)
 

Protected Member Functions

virtual uint attackDistance () const
 
virtual void movement ()
 
virtual void attackParty ()
 

Protected Attributes

int _hitPoints
 
bool _isAttacking
 

Detailed Description

Base class for creatures that can be killed

Constructor & Destructor Documentation

◆ Creature()

Ultima::Shared::Maps::Creature::Creature ( Game game,
MapBase  
)
inline

Constructor

◆ ~Creature()

virtual Ultima::Shared::Maps::Creature::~Creature ( )
inlinevirtual

Destructor

Member Function Documentation

◆ attackDistance()

virtual uint Ultima::Shared::Maps::Creature::attackDistance ( ) const
inlineprotectedvirtual

Returns either the maximum attack distance for a monster, or 0 if the monster is beyond that distance from the player

Reimplemented in Ultima::Ultima1::Widgets::OverworldMonster, and Ultima::Ultima1::Widgets::Guard.

◆ movement()

◆ attackParty()

virtual void Ultima::Shared::Maps::Creature::attackParty ( )
inlineprotectedvirtual

◆ synchronize()

void Ultima::Shared::Maps::Creature::synchronize ( Common::Serializer s)

Handles loading and saving games

◆ update()

virtual void Ultima::Shared::Maps::Creature::update ( bool  isPreUpdate)
virtual

Called to update the widget at the end of a turn

Parameters
isPreUpdateUpdate is called twice in succession during the end of turn update. Once with true for all widgets, then with it false

Reimplemented in Ultima::Ultima1::Widgets::DungeonMonster.

◆ isDead()

bool Ultima::Shared::Maps::Creature::isDead ( ) const
inline

True true if the creature is dead

◆ subtractHitPoints()

virtual bool Ultima::Shared::Maps::Creature::subtractHitPoints ( uint  amount)
virtual

Removes hit points from a creature

Parameters
amountAmount to remove
Returns
Returns true if kills the creature

Reimplemented in Ultima::Ultima1::Widgets::Person, Ultima::Ultima1::Widgets::Bard, Ultima::Ultima1::Widgets::King, and Ultima::Ultima1::Widgets::Princess.


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