-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDestroySave.cpp
80 lines (64 loc) · 1.76 KB
/
DestroySave.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
#include "stdafx.h"
#include "DestroySave.h"
#include "AchievementSystem.h"
DestroySave::DestroySave()
{
}
DestroySave::~DestroySave()
{
}
void DestroySave::ParseLine(const ArgScript::Line& line)
{
if (Simulator::IsSpaceGame()) //If we're in the space stage... (adventures do not count)
{
}
else {
App::ConsolePrintF("Save File Erased.");
return;
}
//AchievementSystemA.SecretPhrase = true;
PropertyListPtr sillyPropList;
ResourceKey imgKey;
//Gets the achievment spacetool
auto inventory = SimulatorSpaceGame.GetPlayerInventory();
if (inventory->GetTool({ id("ach_core_sec"), 0, 0 }) != nullptr) {
App::ConsolePrintF("Achievement already achieved.");
return;
}
if (PropManager.GetPropertyList(0xf3e2a175, 0x30608f0b, sillyPropList))
{
LocalizedString toolName;
LocalizedString toolDesc;
if (App::Property::GetText(sillyPropList.get(), 0x3068D95D, toolName) && (App::Property::GetText(sillyPropList.get(), 0x04CAD19B, toolDesc)))
{
string16 achName;
string16 achDesc;
achName.assign_convert(toolName.GetText());
achDesc.assign_convert(toolDesc.GetText());
//App::ConsolePrintF("sex");
if (App::Property::GetKey(sillyPropList.get(), 0x3068D95C, imgKey))
{
ImagePtr img;
if (UTFWin::Image::GetImage(imgKey, img))
{
// App::ConsolePrintF("autism");
AchievementSystemA.Achieve(achName, achDesc, img);
cSpaceToolDataPtr tool;
ToolManager.LoadTool({ id("ach_core_sec"), 0, 0 }, tool);
inventory->AddItem(tool.get());
}
}
}
}
// This method is called when your cheat is invoked.
// Put your cheat code here.
}
const char* DestroySave::GetDescription(ArgScript::DescriptionMode mode) const
{
if (mode == ArgScript::DescriptionMode::Basic) {
return "";
}
else {
return "...";
}
}