about summary refs log tree commit diff stats
path: root/data/maps/the_symbolic/rooms/Red Room.txtpb
blob: e3b1104ba2936833f8ffaf5099dad4a4e12755b5 (plain) (blame)
1
2
3
4
5
6
7
8
name: "Red Room"
panels {
  name: "SYNONYM"
  path: "Panels/Prequel/panel_2"
  clue: "synonym"
  answer: "antonym"
  symbols: SUN
}
ing.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#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 */