about summary refs log tree commit diff stats
path: root/data/maps/the_double_sided
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-08-20 15:43:00 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2025-08-20 15:43:00 -0400
commit1c11f117ffc28372362fb9081a71e5d4d50b538f (patch)
tree3d102d7d249375b1dc9ff3ab5f04706b56f6e501 /data/maps/the_double_sided
parentbcf503855107404ab3c8e0a7edd750c2720f8024 (diff)
downloadlingo2-archipelago-1c11f117ffc28372362fb9081a71e5d4d50b538f.tar.gz
lingo2-archipelago-1c11f117ffc28372362fb9081a71e5d4d50b538f.tar.bz2
lingo2-archipelago-1c11f117ffc28372362fb9081a71e5d4d50b538f.zip
Implemented complete_at=1 in the apworld
Diffstat (limited to 'data/maps/the_double_sided')
0 files changed, 0 insertions, 0 deletions
ight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.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 MESSAGE_SYSTEM_H_DE10D011
#define MESSAGE_SYSTEM_H_DE10D011

#include <list>
#include <string_view>
#include <string>
#include "system.h"
#include "timer.h"

class Game;

enum class SpeakerType {
  None,
  Man,
  Woman,
  Boy,
  Girl,
  Nonhuman
};

struct MessageLine {
  std::string text;
  int charsRevealed = 0;
  bool pause = false;
  bool isChoice = false;
  int choicePos[2] = {-1, -1};
  bool bulleted = false;
};

class MessageSystem : public System {
public:

  static constexpr SystemKey Key = SystemKey::Message;

  MessageSystem(Game& game) : game_(game) {}

  void tick(double dt) override;

  // Commands

  void displayCutsceneBars();

  void hideCutsceneBars();

  // Adds text to the message queue. Separate lines with \n.
  // \f is a special character -- put it after a \n to indicate that a button
  // press is required to advance text.
  void displayMessage(
    std::string_view msg,
    std::string speakerName = "",
    SpeakerType speakerType = SpeakerType::None);

  void showChoice(std::string choice1, std::string choice2);

  void advanceText();

  void selectFirstChoice();

  void selectSecondChoice();

  // Info

  double getCutsceneBarsProgress() const;

  const std::list<MessageLine>& getLines() const { return linesToShow_; }

  bool isMessageActive() const { return !linesToShow_.empty(); }

  const std::string& getSpeaker() const { return speakerName_; }

  bool isNextArrowShowing() const { return showNextArrow_; }

  int getNextArrowBob() const { return nextArrowBobPos_; }

  bool isChoiceActive() const { return isMessageActive() && linesToShow_.back().isChoice; }

  int getChoiceSelection() const { return choiceSelection_; }

private:

  enum class BarsState {
    Closed,
    Opening,
    Open,
    Closing
  };

  Game& game_;
  BarsState barsState_ = BarsState::Closed;
  double accum_ = 0.0;
  double length_ = 1000.0/8;
  SpeakerType speaker_ = SpeakerType::None;
  std::string speakerName_;
  std::list<MessageLine> lines_;
  std::list<MessageLine> linesToShow_;
  Timer textAdvTimer_ { 15 };
  bool showNextArrow_ = false;
  int nextArrowBobPos_ = 0;
  bool nextArrowBobDown_ = true;
  Timer nextArrowBobTimer_ { 125 };
  int choiceSelection_ = 0;
};

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