ScummVM API documentation
Ultima::Ultima1::Widgets::Person Class Reference

#include <person.h>

Inheritance diagram for Ultima::Ultima1::Widgets::Person:
Ultima::Ultima1::Widgets::UrbanWidget Ultima::Shared::Maps::Creature Ultima::Shared::Maps::MapWidget Ultima::Shared::MessageTarget Ultima::Shared::BaseObject Ultima::Ultima1::Widgets::Bard Ultima::Ultima1::Widgets::Guard Ultima::Ultima1::Widgets::King Ultima::Ultima1::Widgets::Merchant Ultima::Ultima1::Widgets::UrbanPlayer Ultima::Ultima1::Widgets::Wench Ultima::Ultima1::Widgets::MerchantArmor Ultima::Ultima1::Widgets::MerchantArmour Ultima::Ultima1::Widgets::MerchantGrocer Ultima::Ultima1::Widgets::MerchantMagic Ultima::Ultima1::Widgets::MerchantTavern Ultima::Ultima1::Widgets::MerchantTransport Ultima::Ultima1::Widgets::MerchantWeapons Ultima::Ultima1::Widgets::Princess

Public Member Functions

 Person (Ultima1Game *game, Maps::MapBase *map, uint tileNum, int hitPoints)
 
 Person (Ultima1Game *game, Maps::MapBase *map, uint tileNum)
 
void synchronize (Common::Serializer &s) override
 
virtual void talk ()
 
bool subtractHitPoints (uint amount) override
 
- Public Member Functions inherited from Ultima::Ultima1::Widgets::UrbanWidget
 UrbanWidget (Shared::Game *game, Shared::Maps::MapBase *map, uint tileNum)
 
 ~UrbanWidget () override
 
uint getTileNum () const override
 
CanMove canMoveTo (const Point &destPos) override
 
void synchronize (Common::Serializer &s) override
 
- Public Member Functions inherited from Ultima::Shared::Maps::MapWidget
 MapWidget (Game *game, MapBase *map)
 
 MapWidget (Game *game, MapBase *map, const Point &pt, Direction dir=DIR_NONE)
 
 MapWidget (Game *game, MapBase *map, const Common::String &name, const Point &pt, Direction dir=DIR_NONE)
 
 ~MapWidget () override
 
virtual const char * getClassName () const
 
void addInfoMsg (const Common::String &text, bool newLine=true, bool replaceLine=false)
 
virtual bool isBlocking () const
 
virtual void update (bool isPreUpdate)
 
virtual void moveTo (const Point &destPos, Direction dir=DIR_NONE)
 
- Public Member Functions inherited from Ultima::Shared::BaseObject
virtual ::Ultima::Shared::ClassDef getType () const
 
bool isInstanceOf (const ClassDef &classDef) const
 
- Public Member Functions inherited from Ultima::Shared::Maps::Creature
 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
 

Public Attributes

 CLASSDEF
 
- Public Attributes inherited from Ultima::Shared::Maps::MapWidget
Point _position
 
Direction _direction
 
Common::String _name
 
 CLASSDEF
 
- Public Attributes inherited from Ultima::Shared::MessageTarget
 CLASSDEF
 

Protected Member Functions

bool areGuardsHostile () const
 
int getRandomDelta () const
 
Point getRandomMoveDelta () const
 
- Protected Member Functions inherited from Ultima::Ultima1::Widgets::UrbanWidget
bool moveBy (const Point &delta)
 
- Protected Member Functions inherited from Ultima::Shared::MessageTarget
virtual const Ultima::Shared::MSGMAPgetMessageMap () const
 
- Protected Member Functions inherited from Ultima::Shared::Maps::Creature
virtual uint attackDistance () const
 
virtual void movement ()
 
virtual void attackParty ()
 

Protected Attributes

Ultima1Game_game
 
Maps::MapBase_map
 
- Protected Attributes inherited from Ultima::Ultima1::Widgets::UrbanWidget
 CLASSDEF
 
- Protected Attributes inherited from Ultima::Shared::Maps::MapWidget
Game_game
 
MapBase_map
 
- Protected Attributes inherited from Ultima::Shared::Maps::Creature
int _hitPoints
 
bool _isAttacking
 

Additional Inherited Members

- Public Types inherited from Ultima::Shared::Maps::MapWidget
enum  CanMove { UNSET = 0, YES = 1, NO = 2 }
 
- Static Public Member Functions inherited from Ultima::Shared::Maps::MapWidget
static Direction directionFromKey (Common::KeyCode keycode)
 
- Static Public Member Functions inherited from Ultima::Shared::BaseObject
::Ultima::Shared::ClassDef type ()
 
- Static Protected Member Functions inherited from Ultima::Shared::MessageTarget
static const Ultima::Shared::MSGMAPgetThisMessageMap ()
 

Detailed Description

Base class for NPC creatures

Constructor & Destructor Documentation

◆ Person() [1/2]

Ultima::Ultima1::Widgets::Person::Person ( Ultima1Game game,
Maps::MapBase map,
uint  tileNum,
int  hitPoints 
)
inline

Constructor

◆ Person() [2/2]

Ultima::Ultima1::Widgets::Person::Person ( Ultima1Game game,
Maps::MapBase map,
uint  tileNum 
)
inline

Constructor

Member Function Documentation

◆ areGuardsHostile()

bool Ultima::Ultima1::Widgets::Person::areGuardsHostile ( ) const
protected

Returns true if the guards are currently hostile

◆ getRandomDelta()

int Ultima::Ultima1::Widgets::Person::getRandomDelta ( ) const
protected

Returns a random movement delta of -1, 0, or 1

◆ getRandomMoveDelta()

Point Ultima::Ultima1::Widgets::Person::getRandomMoveDelta ( ) const
inlineprotected

Returns a random movement delta

◆ synchronize()

void Ultima::Ultima1::Widgets::Person::synchronize ( Common::Serializer s)
overridevirtual

Handles loading and saving data

Reimplemented from Ultima::Shared::Maps::MapWidget.

◆ talk()

◆ subtractHitPoints()

bool Ultima::Ultima1::Widgets::Person::subtractHitPoints ( uint  amount)
overridevirtual

Removes hit points from a creature

Parameters
amountAmount to remove
Returns
Returns true if kills the creature

Reimplemented from Ultima::Shared::Maps::Creature.

Reimplemented in Ultima::Ultima1::Widgets::Princess.


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