ScummVM API documentation
Ultima::Ultima1::Logic::SpaceLogic Class Reference

#include <space_logic.h>

Inheritance diagram for Ultima::Ultima1::Logic::SpaceLogic:
Ultima::Ultima1::Logic::Logic Ultima::Ultima1::Logic::SpaceCockpitLogic Ultima::Ultima1::Logic::SpaceMapLogic

Public Member Functions

void entering () override
 
void keypress (Common::KeyCode keycode) override
 
- Public Member Functions inherited from Ultima::Ultima1::Logic::Logic
virtual void action (int action)
 
virtual void keypress (Common::KeyCode keycode)
 
virtual void entering ()
 
virtual void tick ()
 
virtual bool isPersisted () const
 

Protected Member Functions

int shipFuel () const
 
void subtractFuel (int amount)
 
int shipShields () const
 
void subtractShields (int amount)
 
void death ()
 
void updateCreatures () override
 
void endOfTurn () override
 
bool inform () override
 
bool attack (Data::Direction dir) override
 
bool cast () override
 
bool climb () override
 
bool quit () override
 
bool ready () override
 
- Protected Member Functions inherited from Ultima::Ultima1::Logic::Logic
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 ()
 

Additional Inherited Members

- Protected Attributes inherited from Ultima::Ultima1::Logic::Logic
int _weaponDamageScale = 8
 

Detailed Description

Shared base for the two outer-space modes. Outer space has two quite different play views - the overhead sector map (SpaceMapLogic) and the first-person cockpit (SpaceCockpitLogic) - swapped with the View command. This holds what's common to both: entering(), the fuel accessors, and the many commands that just say "<X>?" in either mode

Member Function Documentation

◆ shipFuel()

int Ultima::Ultima1::Logic::SpaceLogic::shipFuel ( ) const
protected

Fuel remaining in the ship the player is currently flying (getShipFuel)

◆ subtractFuel()

void Ultima::Ultima1::Logic::SpaceLogic::subtractFuel ( int  amount)
protected

Burns fuel from the current ship, clamped at zero (subtractFuel)

◆ shipShields()

int Ultima::Ultima1::Logic::SpaceLogic::shipShields ( ) const
protected

Shields remaining in the ship the player is currently flying (getShipShields)

◆ subtractShields()

void Ultima::Ultima1::Logic::SpaceLogic::subtractShields ( int  amount)
protected

Drains shields from the current ship, clamped at zero (subtractShields)

◆ death()

void Ultima::Ultima1::Logic::SpaceLogic::death ( )
protected

Shows the SpaceDead view (death). The caller is expected to have already written the reason for death to the commands area first

◆ updateCreatures()

void Ultima::Ultima1::Logic::SpaceLogic::updateCreatures ( )
inlineoverrideprotectedvirtual

Handles updating creatures/NPCs

Reimplemented from Ultima::Ultima1::Logic::Logic.

◆ endOfTurn()

void Ultima::Ultima1::Logic::SpaceLogic::endOfTurn ( )
overrideprotectedvirtual

Space has no land-style turn (no food upkeep, no creature phase) - a command just refreshes the display

Reimplemented from Ultima::Ultima1::Logic::Logic.

◆ inform()

bool Ultima::Ultima1::Logic::SpaceLogic::inform ( )
overrideprotectedvirtual

Inform - the animated sector scan of the galaxy (works in either view)

Reimplemented from Ultima::Ultima1::Logic::Logic.

◆ attack()

bool Ultima::Ultima1::Logic::SpaceLogic::attack ( Data::Direction  dir)
overrideprotectedvirtual

Attack with a weapon

Reimplemented from Ultima::Ultima1::Logic::Logic.

Reimplemented in Ultima::Ultima1::Logic::SpaceMapLogic.

◆ cast()

bool Ultima::Ultima1::Logic::SpaceLogic::cast ( )
overrideprotectedvirtual

Reimplemented from Ultima::Ultima1::Logic::Logic.

◆ climb()

bool Ultima::Ultima1::Logic::SpaceLogic::climb ( )
overrideprotectedvirtual

Reimplemented from Ultima::Ultima1::Logic::Logic.

◆ quit()

bool Ultima::Ultima1::Logic::SpaceLogic::quit ( )
overrideprotectedvirtual

Reimplemented from Ultima::Ultima1::Logic::Logic.

◆ ready()

bool Ultima::Ultima1::Logic::SpaceLogic::ready ( )
overrideprotectedvirtual

Reimplemented from Ultima::Ultima1::Logic::Logic.

◆ entering()

void Ultima::Ultima1::Logic::SpaceLogic::entering ( )
overridevirtual

Sets up the whole space encounter: rolls the galaxy, drops the player at the station sector flying the shuttle. Deliberately on the base class - it's only ever called on the SpaceMapLogic that take-off loads, but conceptually it belongs to "entering space", not to the overhead view specifically

Reimplemented from Ultima::Ultima1::Logic::Logic.

◆ keypress()

void Ultima::Ultima1::Logic::SpaceLogic::keypress ( Common::KeyCode  keycode)
overridevirtual

Any unmapped key is just "Huh?" (overridden by SpaceCockpitLogic for the speed number keys)

Reimplemented from Ultima::Ultima1::Logic::Logic.


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