Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
DungeonMaster Class Reference

#include <dungeonmaster.hpp>

Inheritance diagram for DungeonMaster:
Creature Object

Public Member Functions

 DungeonMaster (glm::vec3 corner, glm::vec3 facing)
 
 ~DungeonMaster ()
 
virtual SharedObject toShared () override
 Generates a SharedObject representation of this object. More...
 
int getPlacedTraps ()
 get the number of traps the DM currently has placed More...
 
void setPlacedTraps (int placedTraps)
 set the number of traps the DM currently has placed More...
 
void useMana (int mana)
 For lightning and light-cut usage. More...
 
void manaRegen ()
 mana regeneration function More...
 
void setParalysis (bool isParalyzed, double paralysis_duration)
 Sets the whether the DungeonMaster is paralyzed. If isParalyzed is true, then this sets the paralysis duration and marks the timestamp for the paralysis start event. More...
 
bool isParalyzed () const
 Getter for whether the DungeonMaster is paralyzed. More...
 
double getParalysisDuration () const
 Getter for the DungeonMaster's paralysis duration. (this value should be ignored if the DungeonMaster's paralyzed boolean is false) More...
 
std::chrono::time_point< std::chrono::system_clock > getParalysisStartTime () const
 Getter for the timestamp of the last time the DungeonMaster was paralyzed. More...
 
- Public Member Functions inherited from Creature
 Creature (ObjectType type, glm::vec3 corner, glm::vec3 facing, ModelType modelType, SharedStats &&stats)
 
virtual ~Creature ()
 
virtual SharedObject toShared () override
 Generates a SharedObject representation of this object. More...
 
- Public Member Functions inherited from Object
 Object (ObjectType type, Physics physics, ModelType modelType)
 
virtual ~Object ()
 
void setModel (ModelType type)
 Sets this Object's model and initializes its dimensions to the given model's default dimensions. More...
 
virtual SharedObject toShared ()
 Generates a SharedObject representation of this object. More...
 
virtual void doCollision (Object *other, ServerGameState &state)
 Code to run when this object collides with another. More...
 
std::string to_string (unsigned int tab_offset)
 
std::string to_string ()
 

Data Fields

SharedTrapInventory sharedTrapInventory
 
SharedDMInfo dmInfo
 
Weaponlightning
 The DM's lightning weapon. More...
 
- Data Fields inherited from Creature
SharedStats stats
 
SharedStatuses statuses
 
- Data Fields inherited from Object
EntityID globalID {}
 Unique object ID (used to index into the ServerGameState::objects vector) More...
 
SpecificID typeID {}
 Type-specific Object ID (used to index into the type-specific objects vector in ServerGameState) More...
 
MovableID movableID {}
 Movable ID (used to index into the movable objects vector in ServerGameState) More...
 
ObjectType type
 Identifies this object's type (derived class) More...
 
Physics physics
 Object's Physics-related properties. More...
 
ModelType modelType
 Object's render model type (specifies this Object's render model to the client) More...
 
AnimState animState
 Object's animation state and current action. For non-animated objects, this defaults as AnimState::IdleAnim. More...
 
bool is_sprinting
 used to determine if the player is sprinting for animation purposes More...
 
std::vector< glm::ivec2 > gridCellPositions
 Vector of (x, y) positions of GridCells currently occupied by this object. More...
 
float distance_moved
 Distance moved, for use in deciding when to play footsteps IMPORTANT: reset every time a footstep sound is performed for objects that play foosteps. More...
 

Additional Inherited Members

- Static Public Attributes inherited from Object
static std::unordered_map< ModelType, glm::vec3 > models
 Maps from ModelType to a model's dimensions as read from the model files. (At present, these values are hard-coded in object.cpp) More...
 

Constructor & Destructor Documentation

◆ DungeonMaster()

DungeonMaster::DungeonMaster ( glm::vec3  corner,
glm::vec3  facing 
)

◆ ~DungeonMaster()

DungeonMaster::~DungeonMaster ( )

Member Function Documentation

◆ getParalysisDuration()

double DungeonMaster::getParalysisDuration ( ) const

Getter for the DungeonMaster's paralysis duration. (this value should be ignored if the DungeonMaster's paralyzed boolean is false)

Returns
double representing the number of seconds that the DungeonMaster should be paralyzed since the paralysis_start_time timestamp.

◆ getParalysisStartTime()

std::chrono::time_point< std::chrono::system_clock > DungeonMaster::getParalysisStartTime ( ) const

Getter for the timestamp of the last time the DungeonMaster was paralyzed.

Returns
std::chrono::time_point<std::chrono::system_clock> timestamp of the last time the DungeonMaster became paralyzed.

◆ getPlacedTraps()

int DungeonMaster::getPlacedTraps ( )

get the number of traps the DM currently has placed

◆ isParalyzed()

bool DungeonMaster::isParalyzed ( ) const

Getter for whether the DungeonMaster is paralyzed.

Returns
true if the DungeonMaster is paralyzed and false otherwise.

◆ manaRegen()

void DungeonMaster::manaRegen ( )

mana regeneration function

◆ setParalysis()

void DungeonMaster::setParalysis ( bool  isParalyzed,
double  paralysis_duration 
)

Sets the whether the DungeonMaster is paralyzed. If isParalyzed is true, then this sets the paralysis duration and marks the timestamp for the paralysis start event.

Parameters
isParalyzedWhether the DungeonMaster should now be paralyzed.
paralysis_durationHow long the DungeonMaster should be paralyzed for (ignored if isParalyzed is false)

◆ setPlacedTraps()

void DungeonMaster::setPlacedTraps ( int  placedTraps)

set the number of traps the DM currently has placed

Parameters
placedTrapsthe number of traps the DM has placed

◆ toShared()

SharedObject DungeonMaster::toShared ( )
overridevirtual

Generates a SharedObject representation of this object.

Returns
A SharedObject representation of this object.

Reimplemented from Creature.

◆ useMana()

void DungeonMaster::useMana ( int  mana)

For lightning and light-cut usage.

Parameters
manathe amount of mana the specific DM action takes

Field Documentation

◆ dmInfo

SharedDMInfo DungeonMaster::dmInfo

◆ lightning

Weapon* DungeonMaster::lightning

The DM's lightning weapon.

◆ sharedTrapInventory

SharedTrapInventory DungeonMaster::sharedTrapInventory

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