#include <logic.h>
Public Member Functions | |
| virtual void | action (int action) |
| virtual void | keypress (Common::KeyCode keycode) |
| virtual void | entering () |
| virtual void | tick () |
| virtual bool | isPersisted () const |
Protected Member Functions | |
| void | writeString (const Common::String &msg) |
| void | writeString (const char *format,...) |
| void | resetLine () |
| void | prompt () |
| void | playFX (int num) |
| int | getRandomNumber (int minNumber, int maxNumber) |
| int | getRandomNumber (int maxNumber) |
| void | redrawMap () |
| void | showAttackTile (int x, int y, int tileId) |
| void | redrawStats () |
| void | giveTreasure (int coins, int nameLen) |
| void | combat (Data::Direction direction, int effect) |
| virtual bool | attack (Data::Direction dir) |
| virtual void | endOfTurn () |
| virtual void | updateCreatures () |
| virtual void | castSpellAttack (Data::Direction) |
| virtual void | damage (Data::Direction, int, int, int, int, int) |
| virtual bool | board () |
| virtual bool | cast () |
| virtual bool | climb () |
| virtual bool | drop () |
| virtual bool | enter () |
| virtual bool | fire () |
| virtual bool | get () |
| virtual bool | hyperjump () |
| virtual bool | inform () |
| virtual bool | noise () |
| virtual bool | open () |
| virtual bool | quit () |
| virtual bool | ready () |
| virtual bool | steal () |
| virtual bool | transact () |
| virtual bool | unlock () |
| virtual bool | view () |
| virtual bool | xit () |
| virtual bool | zstats () |
| virtual bool | move (Data::Direction) |
| virtual bool | pass () |
Protected Attributes | |
| int | _weaponDamageScale = 8 |
Base class for gameplay handling logic used by the Commands class to respond to player actions or other miscellaneous keypresses.
|
protected |
Dispatches some text to be shown in the Commands window
|
protected |
Clears the current line of the Commands window, ready for it to be overwritten
|
protected |
Triggers a prompt display in the Commands window
|
protected |
Play a sound effect
|
protected |
Returns a random number
|
protected |
Signal the map to redraw
|
protected |
Has the currently focused map view briefly flash a tile on-screen at a given map position - e.g. a projectile flying towards the player, or a hit flash - pausing before returning. Used for combat animations; see AttackTileMessage
|
protected |
Signal the stats to redraw
|
protected |
Adds coins to the player's purse, capped at 9999, and lists the copper, silver and gold found. When nameLen is the length of a just-shown monster name, the amounts continue on from it; zero means they start a fresh line
|
protected |
Triggers combat action
|
protectedvirtual |
Attack with a weapon
Reimplemented in Ultima::Ultima1::Logic::DungeonLogic, Ultima::Ultima1::Logic::SpaceLogic, and Ultima::Ultima1::Logic::SpaceMapLogic.
|
protectedvirtual |
Handles end of turn logic
Reimplemented in Ultima::Ultima1::Logic::MondainLogic, and Ultima::Ultima1::Logic::SpaceLogic.
|
inlineprotectedvirtual |
Handles updating creatures/NPCs
Reimplemented in Ultima::Ultima1::Logic::CityCastleLogic, Ultima::Ultima1::Logic::DungeonLogic, Ultima::Ultima1::Logic::MondainLogic, Ultima::Ultima1::Logic::OverworldLogic, and Ultima::Ultima1::Logic::SpaceLogic.
|
inlineprotectedvirtual |
Cast spell direction chosen for overworld spells
Reimplemented in Ultima::Ultima1::Logic::MondainLogic, and Ultima::Ultima1::Logic::OverworldLogic.
|
inlineprotectedvirtual |
Resolves a weapon/cannon-fire/spell attack in a given direction - rolls to hit, then applies damage or kills whatever's found there. The city/castle half (CityCastleLogic) attacks an NPC widget; the overworld half (OverworldLogic) attacks a monster entity - dungeons have their own separate attack handling and don't use this
| dir | Direction to attack in |
| effectNum | Sound effect Id to play on a successful hit |
| maxDistance | How far away a target can be and still be hit |
| strike | Amount of damage to inflict |
| hitChance | 1-100 threshold a to-hit roll must be under |
| tileId | Tile Id shown for the weapon/projectile effect |
Reimplemented in Ultima::Ultima1::Logic::CityCastleLogic, Ultima::Ultima1::Logic::MondainLogic, and Ultima::Ultima1::Logic::OverworldLogic.
|
protectedvirtual |
Reimplemented in Ultima::Ultima1::Logic::OverworldLogic.
|
protectedvirtual |
|
protectedvirtual |
Reimplemented in Ultima::Ultima1::Logic::DungeonLogic.
|
protectedvirtual |
Reimplemented in Ultima::Ultima1::Logic::CityCastleLogic.
|
protectedvirtual |
Reimplemented in Ultima::Ultima1::Logic::OverworldLogic.
|
protectedvirtual |
Reimplemented in Ultima::Ultima1::Logic::OverworldLogic, and Ultima::Ultima1::Logic::SpaceCockpitLogic.
|
protectedvirtual |
Reimplemented in Ultima::Ultima1::Logic::CityCastleLogic.
|
protectedvirtual |
Reimplemented in Ultima::Ultima1::Logic::SpaceCockpitLogic, and Ultima::Ultima1::Logic::SpaceMapLogic.
|
protectedvirtual |
Reimplemented in Ultima::Ultima1::Logic::DungeonLogic, and Ultima::Ultima1::Logic::SpaceLogic.
|
protectedvirtual |
Reimplemented in Ultima::Ultima1::Logic::DungeonLogic.
|
protectedvirtual |
Reimplemented in Ultima::Ultima1::Logic::OverworldLogic.
|
protectedvirtual |
Reimplemented in Ultima::Ultima1::Logic::CityCastleLogic.
|
protectedvirtual |
Reimplemented in Ultima::Ultima1::Logic::CityLogic, and Ultima::Ultima1::Logic::CastleLogic.
|
protectedvirtual |
|
protectedvirtual |
Reimplemented in Ultima::Ultima1::Logic::OverworldLogic.
|
inlineprotectedvirtual |
|
virtual |
Reimplemented in Ultima::Ultima1::Logic::SpaceLogic.
|
inlinevirtual |
Reimplemented in Ultima::Ultima1::Logic::SpaceLogic.
|
inlinevirtual |
Called once per game frame for any logic updates
Reimplemented in Ultima::Ultima1::Logic::MondainLogic, Ultima::Ultima1::Logic::SpaceCockpitLogic, and Ultima::Ultima1::Logic::SpaceMapLogic.
|
inlinevirtual |
Returns whether this logic's map can be changed by the player, so its contents have to be kept in savegames
Reimplemented in Ultima::Ultima1::Logic::CityCastleLogic, and Ultima::Ultima1::Logic::MondainLogic.