about summary refs log tree commit diff stats
path: root/Source/Randomizer.h
diff options
context:
space:
mode:
authorjbzdarkid <jbzdarkid@gmail.com>2018-10-28 15:44:50 -0700
committerjbzdarkid <jbzdarkid@gmail.com>2018-10-28 15:44:50 -0700
commitd99313f4e4fdf5103c5f149e2d54dbf6e4fcc3f2 (patch)
tree6700a1094c3d42812f1bdca64d7df3dbc07fce37 /Source/Randomizer.h
parent5fb764e4b5cd603c63e638f912a4c39772db8480 (diff)
downloadwitness-tutorializer-d99313f4e4fdf5103c5f149e2d54dbf6e4fcc3f2.tar.gz
witness-tutorializer-d99313f4e4fdf5103c5f149e2d54dbf6e4fcc3f2.tar.bz2
witness-tutorializer-d99313f4e4fdf5103c5f149e2d54dbf6e4fcc3f2.zip
Fix treehouse pivots, jungle + monastery randomization, add final pillars randomization
Diffstat (limited to 'Source/Randomizer.h')
-rw-r--r--Source/Randomizer.h168
1 files changed, 16 insertions, 152 deletions
diff --git a/Source/Randomizer.h b/Source/Randomizer.h index 6615e31..861f5a2 100644 --- a/Source/Randomizer.h +++ b/Source/Randomizer.h
@@ -1,159 +1,23 @@
1#pragma once 1#pragma once
2#include "Memory.h" 2#include "RandomizerCore.h"
3
4// #define GLOBALS 0x5B28C0
5#define GLOBALS 0x62A080
6
7__declspec(selectany) int SWAP_NONE = 0x0;
8__declspec(selectany) int SWAP_TARGETS = 0x1;
9__declspec(selectany) int SWAP_LINES = 0x2;
10__declspec(selectany) int SWAP_STYLE = 0x4;
11 3
12class Randomizer { 4class Randomizer {
13public: 5public:
14 Randomizer(); 6 void Randomize();
15
16 void Randomize(int seed);
17
18 void Randomize(std::vector<int>& panels, int flags);
19 void RandomizeRange(std::vector<int> &panels, int flags, size_t startIndex, size_t endIndex);
20 void SwapPanels(int panel1, int panel2, int flags);
21 void ReassignTargets(const std::vector<int>& panels, const std::vector<int>& order);
22
23 template <class T>
24 std::vector<T> ReadPanelData(int panel, int offset, size_t size) {
25 return _memory.ReadData<T>({GLOBALS, 0x18, panel*8, offset}, size);
26 }
27
28 template <class T>
29 void WritePanelData(int panel, int offset, const std::vector<T>& data) {
30 _memory.WriteData<T>({GLOBALS, 0x18, panel*8, offset}, data);
31 }
32 7
33private: 8private:
34 Memory _memory = Memory("witness64_d3d11.exe"); 9 RandomizerCore _core;
10 void RandomizeTutorial();
11 void RandomizeSymmetry();
12 void RandomizeDesert();
13 void RandomizeQuarry();
14 void RandomizeTreehouse();
15 void RandomizeKeep();
16 void RandomizeShadows();
17 void RandomizeTown();
18 void RandomizeMonastery();
19 void RandomizeBunker();
20 void RandomizeJungle();
21 void RandomizeSwamp();
22 void RandomizeMountain();
35}; 23};
36
37#if GLOBALS == 0x5B28C0
38#define PATH_COLOR 0xC8
39#define REFLECTION_PATH_COLOR 0xD8
40#define DOT_COLOR 0xF8
41#define ACTIVE_COLOR 0x108
42#define BACKGROUND_REGION_COLOR 0x118
43#define SUCCESS_COLOR_A 0x128
44#define SUCCESS_COLOR_B 0x138
45#define STROBE_COLOR_A 0x148
46#define STROBE_COLOR_B 0x158
47#define ERROR_COLOR 0x168
48#define PATTERN_POINT_COLOR 0x188
49#define PATTERN_POINT_COLOR_A 0x198
50#define PATTERN_POINT_COLOR_B 0x1A8
51#define SYMBOL_A 0x1B8
52#define SYMBOL_B 0x1C8
53#define SYMBOL_C 0x1D8
54#define SYMBOL_D 0x1E8
55#define SYMBOL_E 0x1F8
56#define PUSH_SYMBOL_COLORS 0x208
57#define OUTER_BACKGROUND 0x20C
58#define OUTER_BACKGROUND_MODE 0x21C
59#define TRACED_EDGES 0x230
60#define AUDIO_PREFIX 0x278
61#define POWER 0x2A8
62#define TARGET 0x2BC
63#define IS_CYLINDER 0x2FC
64#define CYLINDER_Z0 0x300
65#define CYLINDER_Z1 0x304
66#define CYLINDER_RADIUS 0x308
67#define CURSOR_SPEED_SCALE 0x358
68#define SPECULAR_ADD 0x398
69#define SPECULAR_POWER 0x39C
70#define PATH_WIDTH_SCALE 0x3A4
71#define STARTPOINT_SCALE 0x3A8
72#define NUM_DOTS 0x3B8
73#define NUM_CONNECTIONS 0x3BC
74#define MAX_BROADCAST_DISTANCE 0x3C0
75#define DOT_POSITIONS 0x3C8
76#define DOT_FLAGS 0x3D0
77#define DOT_CONNECTION_A 0x3D8
78#define DOT_CONNECTION_B 0x3E0
79#define DECORATIONS 0x420
80#define DECORATION_FLAGS 0x428
81#define DECORATION_COLORS 0x430
82#define NUM_DECORATIONS 0x438
83#define REFLECTION_DATA 0x440
84#define GRID_SIZE_X 0x448
85#define GRID_SIZE_Y 0x44C
86#define STYLE_FLAGS 0x450
87#define SEQUENCE_LEN 0x45C
88#define SEQUENCE 0x460
89#define DOT_SEQUENCE_LEN 0x468
90#define DOT_SEQUENCE 0x470
91#define DOT_SEQUENCE_LEN_REFLECTION 0x478
92#define DOT_SEQUENCE_REFLECTION 0x480
93#define NUM_COLORED_REGIONS 0x4A0
94#define COLORED_REGIONS 0x4A8
95#define PANEL_TARGET 0x4B0
96#define SPECULAR_TEXTURE 0x4D8
97#define CABLE_TARGET_2 0xD8
98#elif GLOBALS == 0x62A080
99#define PATH_COLOR 0xC0
100#define REFLECTION_PATH_COLOR 0xD0
101#define DOT_COLOR 0xF0
102#define ACTIVE_COLOR 0x100
103#define BACKGROUND_REGION_COLOR 0x110
104#define SUCCESS_COLOR_A 0x120
105#define SUCCESS_COLOR_B 0x130
106#define STROBE_COLOR_A 0x140
107#define STROBE_COLOR_B 0x150
108#define ERROR_COLOR 0x160
109#define PATTERN_POINT_COLOR 0x180
110#define PATTERN_POINT_COLOR_A 0x190
111#define PATTERN_POINT_COLOR_B 0x1A0
112#define SYMBOL_A 0x1B0
113#define SYMBOL_B 0x1C0
114#define SYMBOL_C 0x1D0
115#define SYMBOL_D 0x1E0
116#define SYMBOL_E 0x1F0
117#define PUSH_SYMBOL_COLORS 0x200
118#define OUTER_BACKGROUND 0x204
119#define OUTER_BACKGROUND_MODE 0x214
120#define TRACED_EDGES 0x228
121#define AUDIO_PREFIX 0x270
122#define POWER 0x2A0
123#define TARGET 0x2B4
124#define IS_CYLINDER 0x2F4
125#define CYLINDER_Z0 0x2F8
126#define CYLINDER_Z1 0x2FC
127#define CYLINDER_RADIUS 0x300
128#define CURSOR_SPEED_SCALE 0x350
129#define SPECULAR_ADD 0x38C
130#define SPECULAR_POWER 0x390
131#define PATH_WIDTH_SCALE 0x39C
132#define STARTPOINT_SCALE 0x3A0
133#define NUM_DOTS 0x3B4
134#define NUM_CONNECTIONS 0x3B8
135#define MAX_BROADCAST_DISTANCE 0x3BC
136#define DOT_POSITIONS 0x3C0
137#define DOT_FLAGS 0x3C8
138#define DOT_CONNECTION_A 0x3D0
139#define DOT_CONNECTION_B 0x3D8
140#define DECORATIONS 0x418
141#define DECORATION_FLAGS 0x420
142#define DECORATION_COLORS 0x428
143#define NUM_DECORATIONS 0x430
144#define REFLECTION_DATA 0x438
145#define GRID_SIZE_X 0x440
146#define GRID_SIZE_Y 0x444
147#define STYLE_FLAGS 0x448
148#define SEQUENCE_LEN 0x454
149#define SEQUENCE 0x458
150#define DOT_SEQUENCE_LEN 0x460
151#define DOT_SEQUENCE 0x468
152#define DOT_SEQUENCE_LEN_REFLECTION 0x470
153#define DOT_SEQUENCE_REFLECTION 0x478
154#define NUM_COLORED_REGIONS 0x498
155#define COLORED_REGIONS 0x4A0
156#define PANEL_TARGET 0x4A8
157#define SPECULAR_TEXTURE 0x4D0
158#define CABLE_TARGET_2 0xD0
159#endif \ No newline at end of file