about summary refs log tree commit diff stats
path: root/apworld/client/vendor/uuid.gd
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-10-06 14:22:10 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2025-10-06 14:22:10 -0400
commit239cd63658fcefcdf8531f8fa2fab2d5f1209d81 (patch)
tree2fd06de6e4ae0ee20374f5115f0791324a26ba5b /apworld/client/vendor/uuid.gd
parent2b0b477dcd7a12202ae13d24cde4ba3171ee7edf (diff)
downloadlingo2-archipelago-239cd63658fcefcdf8531f8fa2fab2d5f1209d81.tar.gz
lingo2-archipelago-239cd63658fcefcdf8531f8fa2fab2d5f1209d81.tar.bz2
lingo2-archipelago-239cd63658fcefcdf8531f8fa2fab2d5f1209d81.zip
Error when no progression
Diffstat (limited to 'apworld/client/vendor/uuid.gd')
0 files changed, 0 insertions, 0 deletions
y Rauchenberger <fefferburbia@gmail.com> 2021-02-15 12:05:18 -0500 Added camera shake to lightning event' href='/tanetane/commit/src/effect_system.h?id=d1235174157bd498d0c148325d7c8066e3ab6ac7'>d123517 ^
7e3b59b ^





ce0628c ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94



                                

                   























                                                                    





                                                             




                                                                       













                                                                              



                                                                          





                                                                                        














                                




                                    





                                   


                                                           
#ifndef EFFECT_SYSTEM_H_0B497B39
#define EFFECT_SYSTEM_H_0B497B39

#include "system.h"
#include "timer.h"
#include "vector.h"

class Game;

class EffectSystem : public System {
public:

  static constexpr SystemKey Key = SystemKey::Effect;

  explicit EffectSystem(Game& game) : game_(game) {}

  void tick(double dt) override;

  /* Commands */

  // Fades the entire screen in or out
  // - length is in milliseconds
  // - amount is [0,1]
  void fadeScreen(int length, double amount);

  // Fades just the map, leaving the sprites, messages, etc unfaded.
  // - length is in milliseconds
  // - amount is [0,1]
  void fadeMap(int length, double amount);

  // Shakes the viewport by 1 tile in both directions.
  // - period is in milliseconds, it's actually a half period
  void shakeCamera(int period);

  void stopShakingCamera();

  // Hides or reveals the screen using a circle transition.
  // - length is the time in milliseconds
  // - amount is [0,1], where 0 is fully revealed and 1 is fully hidden
  void circleTransition(int length, double amount);

  /* Information */

  bool isScreenFaded() const { return screenFade_ > 0.0; }

  double getScreenFadeProgress() const { return screenFade_; }

  bool isScreenFadeComplete() const { return screenFade_ == screenFadeDest_; }

  bool isMapFaded() const { return mapFade_ > 0.0; }

  double getMapFadeProgress() const { return mapFade_; }

  bool isMapFadeComplete() const { return mapFade_ == mapFadeDest_; }

  const vec2i& getCameraShakeOffset() const { return cameraShakeOffset_; }

  bool isCameraShaking() const { return cameraShaking_; }

  bool isCircleTransitionActive() const { return circleEffect_ > 0.0; }

  double getCircleTransitionProgress() const { return circleEffect_; }

  bool isCircleTransitionComplete() const { return circleEffect_ == circleEffectDest_; }

private:

  Game& game_;

  double screenFade_ = 0.0;
  double screenFadeDest_ = 0.0;
  double screenFadeStart_ = 0.0;
  double screenFadeLength_ = 0;
  double screenFadeThus_ = 0;

  double mapFade_ = 0.0;
  double mapFadeDest_ = 0.0;
  double mapFadeStart_ = 0.0;
  double mapFadeLength_ = 0.0;
  double mapFadeThus_ = 0.0;

  bool cameraShaking_ = false;
  vec2i cameraShakeOffset_ { 0, 0 };
  bool cameraShakeOn_ = false;
  Timer cameraShakeTimer_ { 0 };

  double circleEffect_ = 0.0;
  double circleEffectDest_ = 0.0;
  double circleEffectStart_ = 0.0;
  double circleEffectLength_ = 0.0;
  double circleEffectThus_ = 0.0;
};

#endif /* end of include guard: EFFECT_SYSTEM_H_0B497B39 */