20 #include "character.h"
21 #include "components/cardboard_player.h"
22 #include "components/drip_and_vanish.h"
23 #include "components/player_character.h"
24 #include "components/scene_object.h"
25 #include "components/shakeable_prop.h"
26 #include "corgi/entity.h"
27 #include "corgi/entity_manager.h"
28 #include "game_camera.h"
29 #include "motive/engine.h"
30 #include "motive/processor.h"
31 #include "motive/util.h"
32 #include "particles.h"
40 class SceneDescription;
45 struct CharacterArrangement;
48 class MultiplayerDirector;
52 virtual corgi::EntityRef CreateEntityFromData(
53 const void* data, corgi::EntityManager* entity_manager);
58 enum AnalyticsMode { kNoAnalytics, kTrackAnalytics };
64 bool IsGameOver()
const;
68 void Reset(AnalyticsMode analytics_mode);
72 void AdvanceFrame(WorldTime delta_time, pindrop::AudioEngine* audio_engine);
76 void PreGameLogging()
const;
77 void PostGameLogging()
const;
83 motive::Angle AngleBetweenCharacters(CharacterId source_id,
84 CharacterId target_id)
const;
87 motive::Angle TargetFaceAngle(CharacterId
id)
const;
90 uint16_t CharacterState(CharacterId
id)
const;
93 uint32_t AllLogicalInputs()
const;
98 int NumActiveCharacters(
bool human_only =
false)
const;
102 void DetermineWinnersAndLosers();
107 bool IsImmobile(CharacterId
id)
const;
110 const GameCamera& camera()
const {
return camera_; }
111 mathfu::mat4 CameraMatrix()
const;
113 std::vector<std::unique_ptr<Character>>& characters() {
return characters_; }
114 const std::vector<std::unique_ptr<Character>>& characters()
const {
118 std::vector<std::unique_ptr<AirbornePie>>& pies() {
return pies_; }
119 const std::vector<std::unique_ptr<AirbornePie>>& pies()
const {
123 const CharacterArrangement& arrangement()
const {
return *arrangement_; }
125 WorldTime time()
const {
return time_; }
127 void set_config(
const Config* config) { config_ = config; }
129 void set_cardboard_config(
const Config* config) {
130 cardboard_config_ = config;
133 motive::MotiveEngine& engine() {
return engine_; }
138 void EnterJoiningMode();
140 WorldTime GetAnimationTime(
const Character& character)
const;
146 multiplayer_director_ = director;
149 void set_is_multiscreen(
bool b) { is_multiscreen_ = b; }
150 bool is_multiscreen()
const {
return is_multiscreen_; }
152 void set_is_in_cardboard(
bool b) { is_in_cardboard_ = b; }
153 bool is_in_cardboard()
const {
return is_in_cardboard_; }
155 void set_use_undistort_rendering(
bool b) { use_undistort_rendering_ = b; }
156 bool use_undistort_rendering() {
return use_undistort_rendering_; }
159 void ProcessSounds(pindrop::AudioEngine* audio_engine,
160 const Character& character, WorldTime delta_time)
const;
161 void CreatePie(CharacterId original_source_id, CharacterId source_id,
162 CharacterId target_id, CharacterHealth original_damage,
163 CharacterHealth damage);
164 float CalculatePieYRotation(CharacterId source_id,
165 CharacterId target_id)
const;
166 CharacterId DetermineDeflectionTarget(
const ReceivedPie& pie)
const;
167 void ProcessEvent(pindrop::AudioEngine* audio_engine,
Character* character,
168 unsigned int event,
const EventData& event_data);
172 uint16_t renderable_id,
173 const mathfu::mat4& character_matrix,
174 int num_accessories,
int damage,
176 void ProcessConditionalEvents(pindrop::AudioEngine* audio_engine,
177 Character* character, EventData* event_data);
178 void ProcessEvents(pindrop::AudioEngine* audio_engine,
Character* character,
179 EventData* data, WorldTime delta_time);
181 CharacterId CalculateCharacterTarget(CharacterId
id)
const;
182 float CalculateCharacterFacingAngleVelocity(
const Character* character,
183 WorldTime delta_time)
const;
184 int RequestedTurn(CharacterId
id)
const;
185 motive::Angle TiltTowardsStageFront(
const motive::Angle angle)
const;
186 motive::Angle TiltCharacterAwayFromCamera(CharacterId
id,
187 const motive::Angle angle)
const;
188 motive::TwitchDirection FakeResponseToTurn(CharacterId
id)
const;
190 void CreatePieSplatter(pindrop::AudioEngine* audio_engine,
192 void CreateJoinConfettiBurst(
const Character& character);
193 void SpawnParticles(
const mathfu::vec3& position,
const ParticleDef* def,
194 const int particle_count,
195 const mathfu::vec4& base_tint = mathfu::vec4(1, 1, 1, 1));
196 void ShakeProps(
float percent,
const mathfu::vec3& damage_position);
197 void AddSplatterToProp(corgi::EntityRef prop);
203 int countdown_timer_;
206 std::vector<std::unique_ptr<Character>> characters_;
207 std::vector<std::unique_ptr<AirbornePie>> pies_;
208 motive::MotiveEngine engine_;
209 const Config* config_;
210 const CharacterArrangement* arrangement_;
212 AnalyticsMode analytics_mode_;
215 corgi::EntityManager entity_manager_;
234 bool is_multiscreen_;
236 const Config* cardboard_config_;
238 bool is_in_cardboard_;
240 bool use_undistort_rendering_;
246 #endif // GAME_STATE_H_
Definition: scene_object.h:189
Definition: scene_description.h:60
Definition: character.h:55
Definition: game_camera.h:26
Definition: drip_and_vanish.h:38
Definition: game_state.h:56
Definition: player_character.h:43
Definition: game_state.h:50
Definition: particles.h:130
Definition: cardboard_player.h:38
Definition: game_camera.h:51
Definition: multiplayer_director.h:42
Definition: character.h:207
Definition: shakeable_prop.h:38