-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStatistics.cs
More file actions
119 lines (91 loc) · 3.5 KB
/
Statistics.cs
File metadata and controls
119 lines (91 loc) · 3.5 KB
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
using watabou.utils;
namespace spdd
{
// hero ½½·Ô¸¶´Ù ÀúÀåµÊ
public class Statistics
{
public static int goldCollected;
public static int deepestFloor;
public static int enemiesSlain;
public static int foodEaten;
public static int potionsCooked;
public static int piranhasKilled;
public static int ankhsUsed;
//used for hero unlock badges
public static int upgradesUsed;
public static int sneakAttacks;
public static int thrownAssists;
public static int spawnersAlive;
public static float duration;
public static bool qualifiedForNoKilling;
public static bool completedWithNoKilling;
public static bool amuletObtained;
public static void Reset()
{
goldCollected = 0;
deepestFloor = 0;
enemiesSlain = 0;
foodEaten = 0;
potionsCooked = 0;
piranhasKilled = 0;
ankhsUsed = 0;
upgradesUsed = 0;
sneakAttacks = 0;
thrownAssists = 0;
spawnersAlive = 0;
duration = 0;
qualifiedForNoKilling = false;
amuletObtained = false;
}
private const string GOLD = "score";
private const string DEEPEST = "maxDepth";
private const string SLAIN = "enemiesSlain";
private const string FOOD = "foodEaten";
private const string ALCHEMY = "potionsCooked";
private const string PIRANHAS = "priranhas";
private const string ANKHS = "ankhsUsed";
private const string UPGRADES = "upgradesUsed";
private const string SNEAKS = "sneakAttacks";
private const string THROWN = "thrownAssists";
private const string SPAWNERS = "spawnersAlive";
private const string DURATION = "duration";
private const string AMULET = "amuletObtained";
public static void StoreInBundle(Bundle bundle)
{
bundle.Put(GOLD, goldCollected);
bundle.Put(DEEPEST, deepestFloor);
bundle.Put(SLAIN, enemiesSlain);
bundle.Put(FOOD, foodEaten);
bundle.Put(ALCHEMY, potionsCooked);
bundle.Put(PIRANHAS, piranhasKilled);
bundle.Put(ANKHS, ankhsUsed);
bundle.Put(UPGRADES, upgradesUsed);
bundle.Put(SNEAKS, sneakAttacks);
bundle.Put(THROWN, thrownAssists);
bundle.Put(SPAWNERS, spawnersAlive);
bundle.Put(DURATION, duration);
bundle.Put(AMULET, amuletObtained);
}
public static void RestoreFromBundle(Bundle bundle)
{
goldCollected = bundle.GetInt(GOLD);
deepestFloor = bundle.GetInt(DEEPEST);
enemiesSlain = bundle.GetInt(SLAIN);
foodEaten = bundle.GetInt(FOOD);
potionsCooked = bundle.GetInt(ALCHEMY);
piranhasKilled = bundle.GetInt(PIRANHAS);
ankhsUsed = bundle.GetInt(ANKHS);
upgradesUsed = bundle.GetInt(UPGRADES);
sneakAttacks = bundle.GetInt(SNEAKS);
thrownAssists = bundle.GetInt(THROWN);
spawnersAlive = bundle.GetInt(SPAWNERS);
duration = bundle.GetFloat(DURATION);
amuletObtained = bundle.GetBoolean(AMULET);
}
public static void Preview(GamesInProgress.Info info, Bundle bundle)
{
info.goldCollected = bundle.GetInt(GOLD);
info.maxDepth = bundle.GetInt(DEEPEST);
}
}
}