about summary refs log tree commit diff stats
path: root/data/maps/the_gallery/rooms/Back Room.txtpb
blob: 74d5304f8866d6d52a4cd30fd68f304de6f4ae61 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
name: "Back Room"
panels {
  name: "UNYIELDING"
  path: "Panels/entry_2"
  clue: ""
  answer: "jab"
  symbols: QUESTION
}
panels {
  name: "TREE"
  path: "Panels/entry_3"
  clue: ""
  answer: "icy"
  symbols: QUESTION
}
# Not sure whether the two paintings in here should be randomized, since they're hints.
ude "Panel.h" #include "Random.h" struct PuzzleSymbols { std::map<int, std::vector<std::pair<int, int>>> symbols; std::vector<std::pair<int, int>>& operator[](int symbolType) { return symbols[symbolType]; } int style; int getNum(int symbolType) { int total = 0; for (auto& pair : symbols[symbolType]) total += pair.second; return total; } bool any(int symbolType) { return symbols[symbolType].size() > 0; } int popRandomSymbol() { std::vector<int> types; for (auto& pair : symbols) if (pair.second.size() > 0 && pair.first != Decoration::Start && pair.first != Decoration::Exit && pair.first != Decoration::Gap && pair.first != Decoration::Eraser) types.push_back(pair.first); int randType = types[Random::rand() % types.size()]; int randIndex = Random::rand() % symbols[randType].size(); while (symbols[randType][randIndex].second == 0 || symbols[randType][randIndex].second >= 25) { randType = types[Random::rand() % types.size()]; randIndex = Random::rand() % symbols[randType].size(); } symbols[randType][randIndex].second--; return symbols[randType][randIndex].first; } PuzzleSymbols(std::vector<std::pair<int, int>> symbolVec) { for (std::pair<int, int> s : symbolVec) { if (s.first == Decoration::Gap || s.first == Decoration::Start || s.first == Decoration::Exit) symbols[s.first].push_back(s); else if (s.first & Decoration::Dot) symbols[Decoration::Dot].push_back(s); else symbols[s.first & 0x700].push_back(s); } style = 0; if (any(Decoration::Dot)) style |= Panel::Style::HAS_DOTS; if (any(Decoration::Stone)) style |= Panel::Style::HAS_STONES; if (any(Decoration::Star)) style |= Panel::Style::HAS_STARS; if (any(Decoration::Poly)) style |= Panel::Style::HAS_SHAPERS; if (any(Decoration::Triangle)) style |= Panel::Style::HAS_TRIANGLES; if (any(Decoration::Arrow)) style |= Panel::Style::HAS_TRIANGLES; } }; #endif /* end of include guard: PUZZLESYMBOLS_H_9DD95900 */