-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathcheat.cpp
79 lines (65 loc) · 1.85 KB
/
cheat.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
#include "cheat.h"
#include "player.h"
#include "keys.h"
#include "tools.h"
#include <QtMath>
extern Player player;
extern Tools tools;
extern Keys keys;
extern int mode;
void Cheat::slotCheatHp() { // Cheat: Hp+100
player.SetHp(player.GetHp() + 100);
emit change();
}
void Cheat::slotCheatAttack() { // Cheat: Attack+3
player.SetAttack(player.GetAttack() + 3);
emit change();
}
void Cheat::slotCheatDefend() { // Cheat: Defend+2
player.SetDefend(player.GetDefend() + 2);
emit change();
}
void Cheat::slotCheatMoney() { // Cheat: Money+50
player.SetMoney(player.GetMoney() + 50);
emit change();
}
void Cheat::slotCheatLevel() { // Cheat: Level+1, Hp+10, Attack+1, Defend+1
player.LevelUp();
emit change();
}
void Cheat::slotCheatRedKey() { // Cheat: RedKey+1
keys.SetRed(keys.GetRed() + 1);
emit change();
}
void Cheat::slotCheatBlueKey() { // Cheat: BlueKey+1
keys.SetBlue(keys.GetBlue() + 1);
emit change();
}
void Cheat::slotCheatYellowKey() { // Cheat: YellowKey+1
keys.SetYellow(keys.GetYellow() + 1);
emit change();
}
void Cheat::slotCheatBook() { // Cheat: Book
tools.SetBook(1 - tools.GetBook());
emit change();
}
void Cheat::slotCheatSword() { // Cheat: Sword
tools.SetSword(1 - tools.GetSword());
if (tools.GetSword())
player.SetAttack(player.GetAttack() + 10);
else
player.SetAttack(player.GetAttack() - 10);
emit change();
}
void Cheat::slotCheatShield() { // Cheat: Shield
tools.SetShield(1 - tools.GetShield());
if (tools.GetShield())
player.SetDefend(player.GetDefend() + 8);
else
player.SetDefend(player.GetDefend() - 8);
emit change();
}
void Cheat::slotCheatMode() { // Cheat: God mode
mode = -mode;
emit change();
}