-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcPasswords.cpp
165 lines (143 loc) · 5.18 KB
/
cPasswords.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
///////////////////////////////////////////////////////
//*-------------------------------------------------*//
//| Part of Project One (https://www.maus-games.at) |//
//*-------------------------------------------------*//
//| Copyright (c) 2010 Martin Mauersics |//
//| Released under the zlib License |//
//*-------------------------------------------------*//
///////////////////////////////////////////////////////
#include "main.h"
coreBool g_bCheatP1 = false;
// ****************************************************************
//
coreBool ApplyPassword(const coreChar* pcText)
{
coreBool bRestart = false;
//
ASSERT(pcText)
const coreUint64 iHash = coreHashXXH64(pcText);
//
switch(iHash)
{
// ZINNOBER red
case 18123262277673915876u:
{
for(coreUintW i = 0u; i < SAVE_MISSIONS; ++i) g_pSave->EditProgress()->aiAdvance[i] = MAX(g_pSave->EditProgress()->aiAdvance[i], 7u);
ADD_BIT_EX(g_pSave->EditProgress()->aiState, STATE_FULL_ACCESS)
}
break;
// INDIGO blue
case 13535575702665342035u:
{
std::memset(g_pSave->EditProgress()->aiFragment, 1, sizeof(g_pSave->EditProgress()->aiFragment));
}
break;
// SEPIA brown
case 4083581750562567063u:
{
g_pSave->EditProgress()->bFirstPlay = true;
g_pSave->EditProgress()->aiAdvance[0] = 0u;
REMOVE_BIT_EX(g_pSave->EditProgress()->aiState, STATE_STORY_VIRIDO)
REMOVE_BIT_EX(g_pSave->EditProgress()->aiState, STATE_STORY_NEVO)
REMOVE_BIT_EX(g_pSave->EditProgress()->aiState, STATE_STORY_HARENA)
REMOVE_BIT_EX(g_pSave->EditProgress()->aiState, STATE_STORY_RUTILUS)
REMOVE_BIT_EX(g_pSave->EditProgress()->aiState, STATE_STORY_GELU)
REMOVE_BIT_EX(g_pSave->EditProgress()->aiState, STATE_STORY_CALOR)
REMOVE_BIT_EX(g_pSave->EditProgress()->aiState, STATE_STORY_MUSCUS)
bRestart = true;
}
break;
// SAFRAN orange
case 12809514335711897236u:
{
if(!HAS_BIT_EX(g_pSave->EditProgress()->aiUnlock, UNLOCK_MIRRORMODE))
{
ADD_BIT_EX(g_pSave->EditProgress()->aiNew, NEW_MAIN_CONFIG)
ADD_BIT_EX(g_pSave->EditProgress()->aiNew, NEW_CONFIG_GAME)
ADD_BIT_EX(g_pSave->EditProgress()->aiNew, NEW_CONFIG_MIRRORMODE)
}
ADD_BIT_EX(g_pSave->EditProgress()->aiUnlock, UNLOCK_MIRRORMODE)
}
break;
// FUCHSIN pink
case 17376649531488240964u:
{
if(!HAS_BIT_EX(g_pSave->EditProgress()->aiUnlock, UNLOCK_GAMESPEEDUP))
{
ADD_BIT_EX(g_pSave->EditProgress()->aiNew, NEW_MAIN_START)
ADD_BIT_EX(g_pSave->EditProgress()->aiNew, NEW_ARMORY_GAMESPEED)
}
ADD_BIT_EX(g_pSave->EditProgress()->aiUnlock, UNLOCK_GAMESPEEDUP)
}
break;
// GAMBOGE yellow
case 14976658933825851731u:
{
if(!HAS_BIT_EX(g_pSave->EditProgress()->aiUnlock, UNLOCK_POWERSHIELD))
{
ADD_BIT_EX(g_pSave->EditProgress()->aiNew, NEW_MAIN_START)
ADD_BIT_EX(g_pSave->EditProgress()->aiNew, NEW_ARMORY_SHIELD)
}
ADD_BIT_EX(g_pSave->EditProgress()->aiUnlock, UNLOCK_POWERSHIELD)
}
break;
// ISABELLINE white
case 9718367774700741137u:
{
if(!HAS_BIT_EX(g_pSave->EditProgress()->aiUnlock, UNLOCK_MUSICBOX))
{
ADD_BIT_EX(g_pSave->EditProgress()->aiNew, NEW_EXTRA_MUSICBOX) // # only
}
ADD_BIT_EX(g_pSave->EditProgress()->aiUnlock, UNLOCK_MUSICBOX)
}
break;
// MAUVE purple
case 11137863330129252440u:
{
if(!HAS_BIT_EX(g_pSave->EditProgress()->aiUnlock, UNLOCK_WEAPON_PULSE))
{
ADD_BIT_EX(g_pSave->EditProgress()->aiNew, NEW_MAIN_START)
ADD_BIT_EX(g_pSave->EditProgress()->aiNew, NEW_ARMORY_WEAPON)
}
ADD_BIT_EX(g_pSave->EditProgress()->aiUnlock, UNLOCK_WEAPON_PULSE)
}
break;
// JADE green
case 2924535458287069379u:
{
if(!HAS_BIT_EX(g_pSave->EditProgress()->aiUnlock, UNLOCK_WEAPON_WAVE))
{
ADD_BIT_EX(g_pSave->EditProgress()->aiNew, NEW_MAIN_START)
ADD_BIT_EX(g_pSave->EditProgress()->aiNew, NEW_ARMORY_WEAPON)
}
ADD_BIT_EX(g_pSave->EditProgress()->aiUnlock, UNLOCK_WEAPON_WAVE)
}
break;
// OBSIDIAN black
case 4726416556452842970u:
{
std::memset(g_pSave->EditProgress()->aiUnlock, 0, sizeof(g_pSave->EditProgress()->aiUnlock));
bRestart = true;
}
break;
// SELADON green
case 2162088830537969827u:
{
g_bCheatP1 = true;
}
break;
default:
// password not valid
return false;
}
//
if(bRestart)
{
g_pMenu->GetMsgBox()->ShowInformation(Core::Language->GetString("INFORMATION_RESTART"), []()
{
Core::Restart();
});
}
// password valid
return true;
}