Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
fireballtrap.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <chrono>
8
12class FireballTrap: public Trap {
13public:
18 FireballTrap(glm::vec3 corner, Direction dir);
19
20 const static std::chrono::seconds TIME_UNTIL_RESET; // how long from initial activation until it can activate again
21 const static int SHOOT_DIST; // how many grid cells away it can shoot you from
22
23 bool shouldTrigger(ServerGameState& state) override;
24 void trigger(ServerGameState& state) override;
25
26 bool shouldReset(ServerGameState& state) override;
27 void reset(ServerGameState& state) override;
28
29 void doCollision(Object* other, ServerGameState& state) override;
30
31private:
32 std::chrono::time_point<std::chrono::system_clock> shoot_time;
33
35
41 float canSee(Object* object, ServerGameState* state);
42};
Definition: fireballtrap.hpp:12
static const std::chrono::seconds TIME_UNTIL_RESET
Definition: fireballtrap.hpp:20
void reset(ServerGameState &state) override
Definition: fireballtrap.cpp:97
void trigger(ServerGameState &state) override
Definition: fireballtrap.cpp:62
bool shouldReset(ServerGameState &state) override
Definition: fireballtrap.cpp:92
static const int SHOOT_DIST
Definition: fireballtrap.hpp:21
bool shouldTrigger(ServerGameState &state) override
Definition: fireballtrap.cpp:24
void doCollision(Object *other, ServerGameState &state) override
Code to run when this object collides with another.
Definition: fireballtrap.cpp:101
Definition: object.hpp:95
The ServerGameState class contains all abstract game state data and logic for a single game state ins...
Definition: servergamestate.hpp:43
Definition: trap.hpp:9
GLenum target
Definition: glad.h:2538
Direction
Definition: object.hpp:198
uint32_t EntityID
Global Object ID (when the server or client references an object with a particular EntityID,...
Definition: typedefs.hpp:9