35 std::optional<EntityID>
target
42 std::cerr <<
"FATAL: homing projectile created without target.\n"
43 <<
"We could potentially implement this to home on the closest Player / Enemy object,\n"
44 <<
"But this isn't implemented yet.\n";
68 std::optional<ServerSFX> destroy_sound,
Options&& options);
84 std::optional<ServerSFX> destroy_sound;
92 inline static const float H_MULT = 0.4;
93 inline static const float V_MULT = 0.1;
113 inline static const float H_MULT = 0.55f;
120 const float clear_model_nudge = 1.5f;
122 case Direction::LEFT:
127 case Direction::RIGHT:
137 case Direction::DOWN:
Definition: projectile.hpp:110
Direction dir
Definition: projectile.hpp:144
static const float V_MULT
Definition: projectile.hpp:114
Arrow(glm::vec3 corner, glm::vec3 facing, Direction dir)
Definition: projectile.hpp:116
static const int DAMAGE
Definition: projectile.hpp:112
static const float H_MULT
Definition: projectile.hpp:113
Definition: projectile.hpp:89
static const float H_MULT
Definition: projectile.hpp:92
static const float HOMING_STRENGTH
Definition: projectile.hpp:94
HomingFireball(glm::vec3 corner, glm::vec3 facing, std::optional< EntityID > target)
Definition: projectile.hpp:97
static const int DAMAGE
Definition: projectile.hpp:91
static const float V_MULT
Definition: projectile.hpp:93
static const int HOMING_DURATION_TICKS
Definition: projectile.hpp:95
Definition: object.hpp:95
ObjectType type
Identifies this object's type (derived class)
Definition: object.hpp:118
Physics physics
Object's Physics-related properties.
Definition: object.hpp:123
Definition: projectile.hpp:20
virtual SharedObject toShared() override
Generates a SharedObject representation of this object.
Definition: projectile.cpp:113
void doCollision(Object *other, ServerGameState &state) override
Code to run when this object collides with another.
Definition: projectile.cpp:47
bool doTick(ServerGameState &state)
handle homing trajectory updates
Definition: projectile.cpp:19
The ServerGameState class contains all abstract game state data and logic for a single game state ins...
Definition: servergamestate.hpp:43
Representation of the Object class used by ServerGameState, containing exactly the subset of Object d...
Definition: sharedobject.hpp:302
Definition: projectile.hpp:147
static const float H_MULT
Definition: projectile.hpp:150
SpellType sType
Definition: projectile.hpp:154
SpellOrb(glm::vec3 corner, glm::vec3 facing, SpellType type)
Definition: projectile.hpp:156
static const float HOMING_STRENGTH
Definition: projectile.hpp:152
static const float V_MULT
Definition: projectile.hpp:151
static const int DAMAGE
Definition: projectile.hpp:149
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glad.h:1531
GLenum target
Definition: glad.h:2538
Direction
Definition: object.hpp:198
ModelType
Enumeration of every render model in the game.
Definition: sharedmodel.hpp:6
ServerSFX
Definition: soundtype.hpp:38
SpellType
Definition: spell.hpp:10
SharedPhysics shared
Shared physics properties (needed by both the server and the client)
Definition: object.hpp:50
bool feels_gravity
true if the object that contains this Physics struct feels gravity and false otherwise
Definition: object.hpp:63
Definition: point_light.hpp:5
Struct for options to configure the projectile.
Definition: projectile.hpp:23
bool isSpell
Definition: projectile.hpp:49
std::optional< EntityID > target
Definition: projectile.hpp:56
float v_mult
Definition: projectile.hpp:51
Options(bool isSpell, int damage, float h_mult, float v_mult, bool homing, float homing_strength, int homing_duration, std::optional< EntityID > target)
Definition: projectile.hpp:33
float h_mult
Definition: projectile.hpp:50
int homing_duration
Definition: projectile.hpp:55
int damage
Definition: projectile.hpp:52
float homing_strength
Definition: projectile.hpp:54
bool homing
Definition: projectile.hpp:53
glm::vec3 facing
3-D vector that denotes this object's facing direction.
Definition: sharedobject.hpp:189
glm::vec3 corner
3-D vector that denotes this object's bottom left corner (min x and z coordinates).
Definition: sharedobject.hpp:184
glm::vec3 dimensions
3-D vector that defines a rectangular prism which outlines the object that contains this SharedPhysic...
Definition: sharedobject.hpp:197