ScummVM API documentation
Ultima::Ultima4::CombatController Class Reference

#include <combat_controller.h>

Inheritance diagram for Ultima::Ultima4::CombatController:
Ultima::Ultima4::Controller Ultima::Ultima4::Observer< Party *, PartyEvent &> Ultima::Ultima4::TurnCompleter Ultima::Ultima4::CampController Ultima::Ultima4::InnController

Public Member Functions

 CombatController (CombatMap *m)
 
 CombatController (MapId id)
 
bool isCombatController () const override
 
void setActive () override
 
bool isCamping () const
 
bool isWinOrLose () const
 
Direction getExitDir () const
 
byte getFocus () const
 
CombatMapgetMap () const
 
CreaturegetCreature () const
 
PartyMemberVectorgetParty ()
 
PartyMembergetCurrentPlayer ()
 
void setExitDir (Direction d)
 
void setCreature (Creature *)
 
void setWinOrLose (bool worl=true)
 
void showCombatMessage (bool show=true)
 
virtual void init (Creature *m)
 
void initDungeonRoom (int room, Direction from)
 
void applyCreatureTileEffects ()
 
virtual void begin ()
 
virtual void end (bool adjustKarma)
 
void fillCreatureTable (const Creature *creature)
 
int initialNumberOfCreatures (const Creature *creature) const
 
bool isWon () const
 
bool isLost () const
 
void moveCreatures ()
 
void placeCreatures ()
 
void placePartyMembers ()
 
bool setActivePlayer (int player)
 
bool attackHit (Creature *attacker, Creature *defender)
 
virtual void awardLoot ()
 
void attack (Direction dir=DIR_NONE, int distance=0)
 
bool attackAt (const Coords &coords, PartyMember *attacker, int dir, int range, int distance)
 
bool rangedAttack (const Coords &coords, Creature *attacker)
 
void rangedMiss (const Coords &coords, Creature *attacker)
 
bool returnWeaponToOwner (const Coords &coords, int distance, int dir, const Weapon *weapon)
 
void keybinder (KeybindingAction action) override
 
void finishTurn () override
 
void movePartyMember (MoveEvent &event)
 
void update (Party *party, PartyEvent &event) override
 
- Public Member Functions inherited from Ultima::Ultima4::Controller
 Controller (int timerInterval=1)
 
bool notifyKeyPressed (int key)
 
bool notifyMousePress (const Common::Point &mousePos)
 
int getTimerInterval ()
 
virtual bool keyPressed (int key)
 
virtual bool mousePressed (const Common::Point &mousePos)
 
virtual void timerFired ()
 
bool shouldQuit () const
 
- Public Member Functions inherited from Ultima::Ultima4::TurnCompleter
virtual void finishTurnAfterCombatEnds ()
 

Static Public Member Functions

static void attackFlash (const Coords &coords, MapTile tile, int timeFactor)
 
static void attackFlash (const Coords &coords, const Common::String &tilename, int timeFactor)
 
static void doScreenAnimationsWhilePausing (int timeFactor)
 
- Static Public Member Functions inherited from Ultima::Ultima4::Controller
static void timerCallback (void *data)
 

Protected Attributes

CombatMap_map
 
PartyMemberVector _party
 
byte _focus
 
const Creature_creatureTable [16]
 
Creature_creature
 
bool _camping
 
bool _forceStandardEncounterSize
 
bool _placePartyOnMap
 
bool _placeCreaturesOnMap
 
bool _winOrLose
 
bool _showMessage
 
Direction _exitDir
 

Detailed Description

Member Function Documentation

◆ setActive()

void Ultima::Ultima4::CombatController::setActive ( )
overridevirtual

Called when a controller is made active

Reimplemented from Ultima::Ultima4::Controller.

◆ init()

virtual void Ultima::Ultima4::CombatController::init ( Creature m)
virtual

Initializes the combat controller with combat information

Reimplemented in Ultima::Ultima4::CampController.

◆ initDungeonRoom()

void Ultima::Ultima4::CombatController::initDungeonRoom ( int  room,
Direction  from 
)

Initializes dungeon room combat

◆ applyCreatureTileEffects()

void Ultima::Ultima4::CombatController::applyCreatureTileEffects ( )

Apply tile effects to all creatures depending on what they're standing on

◆ begin()

virtual void Ultima::Ultima4::CombatController::begin ( )
virtual

◆ fillCreatureTable()

void Ultima::Ultima4::CombatController::fillCreatureTable ( const Creature creature)

Fills the combat creature table with the creatures that the party will be facing. The creature table only contains which creatures will be encountered and where they are placed (by position in the table). Information like hit points and creature status will be created when the creature is actually placed

◆ initialNumberOfCreatures()

int Ultima::Ultima4::CombatController::initialNumberOfCreatures ( const Creature creature) const

Generate the number of creatures in a group.

◆ isWon()

bool Ultima::Ultima4::CombatController::isWon ( ) const

Returns true if the player has won.

◆ isLost()

bool Ultima::Ultima4::CombatController::isLost ( ) const

Returns true if the player has lost.

◆ moveCreatures()

void Ultima::Ultima4::CombatController::moveCreatures ( )

Performs all of the creature's actions

◆ placeCreatures()

void Ultima::Ultima4::CombatController::placeCreatures ( )

Places creatures on the map from the creature table and from the creature_start coords

◆ placePartyMembers()

void Ultima::Ultima4::CombatController::placePartyMembers ( )

Places the party members on the map

◆ setActivePlayer()

bool Ultima::Ultima4::CombatController::setActivePlayer ( int  player)

Sets the active player for combat, showing which weapon they're weilding, etc.

◆ attackFlash()

static void Ultima::Ultima4::CombatController::attackFlash ( const Coords coords,
MapTile  tile,
int  timeFactor 
)
static

Static member functions

◆ keybinder()

void Ultima::Ultima4::CombatController::keybinder ( KeybindingAction  action)
overridevirtual

Handles keybinder actions

Reimplemented from Ultima::Ultima4::Controller.

◆ movePartyMember()

void Ultima::Ultima4::CombatController::movePartyMember ( MoveEvent event)

Move a party member during combat and display the appropriate messages


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