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

#include <dungeon_monster.h>

Inheritance diagram for Ultima::Ultima1::Widgets::DungeonMonster:
Ultima::Ultima1::Widgets::DungeonWidget Ultima::Shared::Maps::DungeonCreature Ultima::Shared::Maps::DungeonWidget Ultima::Shared::Maps::Creature Ultima::Shared::Maps::MapWidget Ultima::Shared::MessageTarget Ultima::Shared::BaseObject

Public Member Functions

 DungeonMonster (Ultima1Game *game, Maps::MapBase *map, DungeonWidgetId monsterId, int hitPoints, const Point &pt)
 
 DungeonMonster (Ultima1Game *game, Maps::MapBase *map)
 
 ~DungeonMonster () override
 
DungeonWidgetId id () const
 
bool isBlockingView () const override
 
void synchronize (Common::Serializer &s) override
 
void draw (Shared::DungeonSurface &s, uint distance) override
 
void update (bool isPreUpdate) override
 
CanMove canMoveTo (const Point &destPos) override
 
void attackParty () override
 
void attackMonster (uint effectNum, uint agility, uint damage)
 
- Public Member Functions inherited from Ultima::Ultima1::Widgets::DungeonWidget
 DungeonWidget (Ultima1Game *game, Maps::MapBase *map, DungeonWidgetId widgetId, const Point &pt)
 
 DungeonWidget (Ultima1Game *game, Maps::MapBase *map)
 
void draw (Shared::DungeonSurface &s, uint distance) override
 
- Public Member Functions inherited from Ultima::Shared::Maps::DungeonWidget
 DungeonWidget (Game *game, Maps::MapBase *map)
 
 DungeonWidget (Game *game, Maps::MapBase *map, const Point &pt, Direction dir=DIR_NONE)
 
 DungeonWidget (Game *game, Maps::MapBase *map, const Common::String &name, const Point &pt, Direction dir=DIR_NONE)
 
 ~DungeonWidget () 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 uint getTileNum () const
 
virtual bool isBlocking () const
 
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::DungeonCreature
 DungeonCreature (Game *game, MapBase *map)
 
 DungeonCreature (Game *game, MapBase *map, int hitPoints)
 
 ~DungeonCreature () override
 
- 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)
 
bool isDead () const
 
virtual bool subtractHitPoints (uint amount)
 

Static Public Member Functions

static Shared::Maps::MapWidget::CanMove canMoveTo (Shared::Maps::MapBase *map, MapWidget *widget, const Point &destPos)
 
- Static Public Member Functions inherited from Ultima::Ultima1::Widgets::DungeonWidget
static void drawWidget (Graphics::ManagedSurface &s, DungeonWidgetId widgetId, uint distance, byte color)
 
- 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 ()
 

Protected Member Functions

void movement () override
 
- Protected Member Functions inherited from Ultima::Ultima1::Widgets::DungeonWidget
Ultima1GamegetGame () const
 
Maps::MapBasegetMap () const
 
- 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
 

Additional Inherited Members

- Public Types inherited from Ultima::Shared::Maps::MapWidget
enum  CanMove { UNSET = 0, YES = 1, NO = 2 }
 
- Public Attributes inherited from Ultima::Ultima1::Widgets::DungeonWidget
Common::String _name
 
- Public Attributes inherited from Ultima::Shared::Maps::MapWidget
Point _position
 
Direction _direction
 
Common::String _name
 
 CLASSDEF
 
- Public Attributes inherited from Ultima::Shared::MessageTarget
 CLASSDEF
 
- Static Protected Member Functions inherited from Ultima::Shared::MessageTarget
static const Ultima::Shared::MSGMAPgetThisMessageMap ()
 
- Protected Attributes inherited from Ultima::Ultima1::Widgets::DungeonWidget
DungeonWidgetId _widgetId
 
- Protected Attributes inherited from Ultima::Shared::Maps::MapWidget
Game_game
 
MapBase_map
 
- Protected Attributes inherited from Ultima::Shared::Maps::Creature
int _hitPoints
 
bool _isAttacking
 

Detailed Description

Implements monsters within the dungeons

Constructor & Destructor Documentation

◆ DungeonMonster() [1/2]

Ultima::Ultima1::Widgets::DungeonMonster::DungeonMonster ( Ultima1Game game,
Maps::MapBase map,
DungeonWidgetId  monsterId,
int  hitPoints,
const Point pt 
)

Constructor

◆ DungeonMonster() [2/2]

Ultima::Ultima1::Widgets::DungeonMonster::DungeonMonster ( Ultima1Game game,
Maps::MapBase map 
)

Constructor

◆ ~DungeonMonster()

Ultima::Ultima1::Widgets::DungeonMonster::~DungeonMonster ( )
inlineoverride

Destructor

Member Function Documentation

◆ movement()

void Ultima::Ultima1::Widgets::DungeonMonster::movement ( )
overrideprotectedvirtual

Handles moving creatures

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

◆ canMoveTo() [1/2]

static Shared::Maps::MapWidget::CanMove Ultima::Ultima1::Widgets::DungeonMonster::canMoveTo ( Shared::Maps::MapBase map,
MapWidget widget,
const Point destPos 
)
static

Returns true if the given widget can move to a given position on the map

◆ id()

DungeonWidgetId Ultima::Ultima1::Widgets::DungeonMonster::id ( ) const
inline

Returns the monster's type

◆ isBlockingView()

bool Ultima::Ultima1::Widgets::DungeonMonster::isBlockingView ( ) const
overridevirtual

Returns true if a monster blocks the background behind him

Implements Ultima::Shared::Maps::DungeonCreature.

◆ synchronize()

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

Handles loading and saving games

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

◆ draw()

void Ultima::Ultima1::Widgets::DungeonMonster::draw ( Shared::DungeonSurface s,
uint  distance 
)
overridevirtual

Draw a monster

Implements Ultima::Shared::Maps::DungeonCreature.

◆ update()

void Ultima::Ultima1::Widgets::DungeonMonster::update ( bool  isPreUpdate)
overridevirtual

Called to update the widget at the end of a turn

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

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

◆ canMoveTo() [2/2]

CanMove Ultima::Ultima1::Widgets::DungeonMonster::canMoveTo ( const Point destPos)
overridevirtual

Returns true if the given widget can move to a given position on the map

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

◆ attackParty()

void Ultima::Ultima1::Widgets::DungeonMonster::attackParty ( )
overridevirtual

Handles attacking the player

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

◆ attackMonster()

void Ultima::Ultima1::Widgets::DungeonMonster::attackMonster ( uint  effectNum,
uint  agility,
uint  damage 
)

Handles the player attacking the monster


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