from dataclasses import dataclass from Options import PerGameCommonOptions, Toggle, Choice, DefaultOnToggle, Range class ShuffleDoors(DefaultOnToggle): """If enabled, most doors will open from receiving an item rather than fulfilling the in-game requirements.""" display_name = "Shuffle Doors" class ShuffleControlCenterColors(Toggle): """ Some doors open after solving the COLOR panel in the Control Center. If this option is enabled, these doors will instead open upon receiving an item. """ display_name = "Shuffle Control Center Colors" class ShuffleGalleryPaintings(Toggle): """If enabled, gallery paintings will appear from receiving an item rather than by triggering them normally.""" display_name = "Shuffle Gallery Paintings" class ShuffleLetters(Choice): """ Controls how letter unlocks are handled. Note that H1, I1, N1, and T1 will always be present at their vanilla locations in the starting room, even if letters are shuffled remotely. - **Vanilla**: All letters will be present at their vanilla locations. - **Unlocked**: Players will start with their keyboards fully unlocked. - **Progressive**: Two items will be added to the pool for every letter (one for H, I, N, and T). Receiving the first item gives you the corresponding level 1 letter, and the second item gives you the corresponding level 2 letter. - **Vanilla Cyan**: Players will start with all level 1 (purple) letters unlocked. Level 2 (cyan) letters will be present at their vanilla locations. - **Item Cyan**: Players will start with all level 1 (purple) letters unlocked. One item will be added to the pool for every level 2 (cyan) letter. """ display_name = "Shuffle Letters" option_vanilla = 0 option_unlocked = 1 option_progressive = 2 option_vanilla_cyan = 3 option_item_cyan = 4 class ShuffleSymbols(Toggle): """ If enabled, 19 items will be added to the pool, representing the different symbols that can appear on a panel. Players will be prevented from solving puzzles with symbols on them until all of the required symbols are unlocked. """ display_name = "Shuffle Symbols" class ShuffleWorldports(Toggle): """ Randomizes the connections between maps. This affects worldports only, which are the loading zones you walk into in order to change maps. This does not affect paintings, panels that teleport you, or certain other special connections like the one between The Shop and Control Center. Connections that depend on placing letters in keyholders are also currently not shuffled. NOTE: It is highly recommended that you turn on Shuffle Control Center Colors when using Shuffle Worldports. Not doing so runs the risk of creating an unfinishable seed. """ display_name = "Shuffle Worldports" class KeyholderSanity(Toggle): """ If enabled, 26 locations will be created for placing each key into its respective Green Ending keyholder. NOTE: This does not apply to the two disappearing keyholders in The Congruent, as they are not part of Green Ending. """ display_name = "Keyholder Sanity" class CyanDoorBehavior(Choice): """ Cyan-colored doors usually only open upon unlocking double letters. Some panels also only appear upon unlocking double letters. This option determines how these unlocks should behave. - **Collect H2**: In the base game, H2 is the first double letter you are intended to collect, so cyan doors only open when you collect the H2 pickup in The Repetitive. Collecting the actual pickup is still required even with remote letter shuffle enabled. - **Any Double Letter**: Cyan doors will open when you have unlocked any cyan letter on your keyboard. In letter shuffle, this means receiving a cyan letter, not picking up a cyan letter collectable. - **Item**: Cyan doors will be grouped together in a single item. Note that some cyan doors are impacted by door shuffle (e.g. the entrance to The Tower). When door shuffle is enabled, these doors won't be affected by the value of this option. """ display_name = "Cyan Door Behavior" option_collect_h2 = 0 option_any_double_letter = 1 option_item = 2 class DaedalusRoofAccess(Toggle): """ If enabled, the player will be logically expected to be able to go from the castle entrance to any part of Daedalus that is open to the air. If disabled, the player will only be expected to be able to enter the castle, the moat, Icarus, and the area at the bottom of the stairs. Invisible walls that become opaque as you approach them are added to the level to prevent the player from accidentally breaking logic. """ display_name = "Allow Daedalus Roof Access" class StrictPurpleEnding(DefaultOnToggle): """ If enabled, the player will be required to have all purple (level 1) letters in order to get Purple Ending. Otherwise, some of the letters may be skippable depending on the other options. """ display_name = "Strict Purple Ending" class StrictCyanEnding(DefaultOnToggle): """ If enabled, the player will be required to have all cyan (level 2) letters in order to get Cyan Ending. Otherwise, at least J2, Q2, and V2 are skippable. Others may also be skippable depending on the options chosen. """ display_name = "Strict Cyan Ending" class VictoryCondition(Choice): """ This option determines what your goal is. - **Gray Ending** (The Colorful) - **Purple Ending** (The Sun Temple). This ordinarily requires all level 1 (purple) letters. - **Mint Ending** (typing EXIT into the keyholders in Control Center) - **Black Ending** (The Graveyard) - **Blue Ending** (The Words) - **Cyan Ending** (The Parthenon). This ordinarily requires almost all level 2 (cyan) letters. - **Red Ending** (The Tower) - **Plum Ending** (The Wondrous / The Door) - **Orange Ending** (the castle in Daedalus) - **Gold Ending** (The Gold). This involves going through the color rooms in Daedalus. - **Yellow Ending** (The Gallery). This requires unlocking all gallery paintings. - **Green Ending** (The Ancient). This requires filling all keyholders with specific letters. - **White Ending** (Control Center). This combines every other ending. """ display_name = "Victory Condition" option_gray_ending = 0 option_purple
#ifndef TOOLS_DATAPACKER_CONTAINER_H_
#define TOOLS_DATAPACKER_CONTAINER_H_

#include <cstdint>
#include <map>
#include <optional>
#include <string>

#include "proto/data.pb.h"

namespace com::fourisland::lingo2_archipelago {

class Container {
 public:
  uint64_t FindOrAddMap(std::string map_name);

  uint64_t FindOrAddRoom(std::optional<std::string> map_name,
                         std::string room_name,
                         std::optional<std::string> map_fallback);

  uint64_t FindOrAddPainting(std::optional<std::string> map_name,
                             std::optional<std::string> room_name,
                             std::string painting_name,
                             std::optional<std::string> map_fallback,
                             std::optional<std::string> room_fallback);

  uint64_t FindOrAddPort(std::optional<std::string> map_name,
                         std::optional<std::string> room_name,
                         std::string port_name,
                         std::optional<std::string> map_fallback,
                         std::optional<std::string> room_fallback);

  uint64_t FindOrAddPanel(std::optional<std::string> map_name,
                          std::optional<std::string> room_name,
                          std::string panel_name,
                          std::optional<std::string> map_fallback,
                          std::optional<std::string> room_fallback);

  uint64_t FindOrAddLetter(std::string key, bool level2);

  uint64_t FindLetterByName(std::string letter_name);

  uint64_t FindOrAddEnding(std::string ending_name);

  uint64_t FindOrAddMastery(std::optional<std::string> map_name,
                            std::optional<std::string> room_name,
                            std::string mastery_name,
                            std::optional<std::string> map_fallback,
                            std::optional<std::string> room_fallback);

  uint64_t FindOrAddKeyholder(std::optional<std::string> map_name,
                              std::optional<std::string> room_name,
                              std::string keyholder_name,
                              std::optional<std::string> map_fallback,
                              std::optional<std::string> room_fallback);

  uint64_t FindOrAddDoor(std::optional<std::string> map_name,
                         std::string door_name,
                         std::optional<std::string> map_fallback);

  void AddConnection(const Connection& connection);

  uint64_t FindOrAddProgressive(std::string prog_name);

  uint64_t FindOrAddDoorGroup(std::string group_name);

  AllObjects& all_objects() { return all_objects_; }

 private:
  AllObjects all_objects_;

  std::map<std::string, uint64_t> map_id_by_name_;
  std::map<std::string, std::map<std::string, uint64_t>>
      room_id_by_map_room_names_;
  std::map<std::string, std::map<std::string, std::map<std::string, uint64_t>>>
      painting_id_by_map_room_painting_names_;
  std::map<std::string, std::map<std::string, std::map<std::string, uint64_t>>>
      port_id_by_map_room_port_names_;
  std::map<std::string, std::map<std::string, std::map<std::string, uint64_t>>>
      panel_id_by_map_room_panel_names_;
  std::map<std::string, uint64_t> letter_id_by_name_;
  std::map<std::string, std::map<std::string, std::map<std::string, uint64_t>>>
      mastery_id_by_map_room_mastery_names_;
  std::map<std::string, std::map<std::string, std::map<std::string, uint64_t>>>
      keyholder_id_by_map_room_keyholder_names_;
  std::map<std::string, std::map<std::string, uint64_t>>
      door_id_by_map_door_names_;
  std::map<std::string, uint64_t> ending_id_by_name_;
  std::map<std::string, uint64_t> progressive_id_by_name_;
  std::map<std::string, uint64_t> door_group_id_by_name_;
};

}  // namespace com::fourisland::lingo2_archipelago

#endif /* TOOLS_DATAPACKER_CONTAINER_H_ */