-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCommands.h
143 lines (115 loc) · 6.54 KB
/
Commands.h
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
#pragma once
#include "ICommand.h"
#include "virtools/CKAll.h"
#include <map>
class CommandBML : public ICommand {
public:
virtual std::string GetName() override { return "bml"; };
virtual std::string GetAlias() override { return ""; };
virtual std::string GetDescription() override { return "Show Information about Ballance Mod Loader."; };
virtual bool IsCheat() override { return false; };
virtual void Execute(IBML* bml, const std::vector<std::string>& args) override;
virtual const std::vector<std::string> GetTabCompletion(IBML* bml, const std::vector<std::string>& args) override { return std::vector<std::string>(); };
};
class CommandHelp : public ICommand {
public:
virtual std::string GetName() override { return "help"; };
virtual std::string GetAlias() override { return "?"; };
virtual std::string GetDescription() override { return "Show Help Information about Existing Commands."; };
virtual bool IsCheat() override { return false; };
virtual void Execute(IBML* bml, const std::vector<std::string>& args) override;
virtual const std::vector<std::string> GetTabCompletion(IBML* bml, const std::vector<std::string>& args) override { return std::vector<std::string>(); };
};
class CommandCheat : public ICommand {
public:
virtual std::string GetName() override { return "cheat"; };
virtual std::string GetAlias() override { return ""; };
virtual std::string GetDescription() override { return "Enable or Disable Cheat Mode."; };
virtual bool IsCheat() override { return false; };
virtual void Execute(IBML* bml, const std::vector<std::string>& args) override;
virtual const std::vector<std::string> GetTabCompletion(IBML* bml, const std::vector<std::string>& args) override {
return args.size() == 2 ? std::vector<std::string>({ "true", "false" }) : std::vector<std::string>();
};
};
class CommandClear : public ICommand {
virtual std::string GetName() override { return "clear"; };
virtual std::string GetAlias() override { return ""; };
virtual std::string GetDescription() override { return "Clear the Console."; };
virtual bool IsCheat() override { return false; };
virtual void Execute(IBML* bml, const std::vector<std::string>& args) override;
virtual const std::vector<std::string> GetTabCompletion(IBML* bml, const std::vector<std::string>& args) override { return std::vector<std::string>(); };
};
class CommandScore : public ICommand {
virtual std::string GetName() override { return "score"; };
virtual std::string GetAlias() override { return ""; };
virtual std::string GetDescription() override { return "Manage Ingame Score."; };
virtual bool IsCheat() override { return true; };
virtual void Execute(IBML* bml, const std::vector<std::string>& args) override;
virtual const std::vector<std::string> GetTabCompletion(IBML* bml, const std::vector<std::string>& args) override {
return args.size() == 2 ? std::vector<std::string>({ "add", "sub", "set" }) : std::vector<std::string>();
};
private:
CKDataArray* m_energy = nullptr;
};
class CommandSpeed : public ICommand {
virtual std::string GetName() override { return "speed"; };
virtual std::string GetAlias() override { return ""; };
virtual std::string GetDescription() override { return "Change Realtime Ball Speed."; };
virtual bool IsCheat() override { return true; };
virtual void Execute(IBML* bml, const std::vector<std::string>& args) override;
virtual const std::vector<std::string> GetTabCompletion(IBML* bml, const std::vector<std::string>& args) override { return std::vector<std::string>(); };
private:
CKDataArray* m_curLevel = nullptr, * m_phyBall = nullptr;
CKParameter* m_force = nullptr;
std::map<std::string, float> m_forces;
};
class CommandKill : public ICommand {
virtual std::string GetName() override { return "kill"; };
virtual std::string GetAlias() override { return ""; };
virtual std::string GetDescription() override { return "Suicide."; };
virtual bool IsCheat() override { return false; };
virtual void Execute(IBML* bml, const std::vector<std::string>& args) override;
virtual const std::vector<std::string> GetTabCompletion(IBML* bml, const std::vector<std::string>& args) override { return std::vector<std::string>(); };
private:
CKBehavior* m_deactBall = nullptr;
};
class CommandSetSpawn : public ICommand {
virtual std::string GetName() override { return "spawn"; };
virtual std::string GetAlias() override { return ""; };
virtual std::string GetDescription() override { return "Set Ball Spawn Point to Current Position."; };
virtual bool IsCheat() override { return true; };
virtual void Execute(IBML* bml, const std::vector<std::string>& args) override;
virtual const std::vector<std::string> GetTabCompletion(IBML* bml, const std::vector<std::string>& args) override { return std::vector<std::string>(); };
private:
CKDataArray* m_curLevel;
};
class CommandSector : public ICommand {
virtual std::string GetName() override { return "sector"; };
virtual std::string GetAlias() override { return ""; };
virtual std::string GetDescription() override { return "Start playing specified sector."; };
virtual bool IsCheat() override { return true; };
virtual void Execute(IBML* bml, const std::vector<std::string>& args) override;
virtual const std::vector<std::string> GetTabCompletion(IBML* bml, const std::vector<std::string>& args) override { return std::vector<std::string>(); };
void ResetBall(IBML* bml, CKContext* ctx);
private:
CKDataArray* m_curLevel, * m_checkpoints, * m_resetpoints, * m_ingameParam;
CKParameter* m_curSector;
};
class CommandWatermark : public ICommand {
virtual std::string GetName() override { return "watermark"; };
virtual std::string GetAlias() override { return ""; };
virtual std::string GetDescription() override { return "Enable or Disable the BML watermark."; };
virtual bool IsCheat() override { return false; };
virtual void Execute(IBML* bml, const std::vector<std::string>& args) override;
virtual const std::vector<std::string> GetTabCompletion(IBML* bml, const std::vector<std::string>& args) override {
return args.size() == 2 ? std::vector<std::string>({ "true", "false" }) : std::vector<std::string>();
};
};
class CommandWin : public ICommand {
virtual std::string GetName() override { return "win"; };
virtual std::string GetAlias() override { return ""; };
virtual std::string GetDescription() override { return "Finish this Level."; };
virtual bool IsCheat() override { return true; };
virtual void Execute(IBML* bml, const std::vector<std::string>& args) override;
virtual const std::vector<std::string> GetTabCompletion(IBML* bml, const std::vector<std::string>& args) override { return std::vector<std::string>(); };
};