-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgoals.lua
106 lines (96 loc) · 2.32 KB
/
goals.lua
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
local moduleInfo = {
name = "goals",
desc = "module providing goalTypes currently", -- initial temporary version of the module
author = "PepeAmpere",
date = "2018-02-09",
license = "MIT",
}
local goalTypes = {
["captureFlags"] = {
currentFlags = 0,
flagsToWin = 0,
Value = function(p)
return p.currentFlags >= p.flagsToWin
end,
Tooltip = function(p)
if (p.Value(p)) then
return "Goal is completed."
else
return "Goal is not completed."
end
end,
Counter = function(p)
return p.currentFlags .. " / " .. p.flagsToWin
end,
Description = function(p)
return "Capture " .. p.flagsToWin .. " flags."
end,
},
["holdFlags"] = {
remainingTime = hmsf(0,0,0,0),
totalTime = hmsf(0,0,0,0),
totalTimeText = "0 minutes",
flagsToWin = 0,
Value = function(p)
return p.remainingTime <= hmsf(0,0,0,0)
end,
Tooltip = function(p)
if (p.Value(p)) then
return "Goal is completed."
else
return "Goal is not completed."
end
end,
Counter = function(p)
return p.remainingTime:HHMMSSFF(false,true,true,false)
end,
Description = function(p)
return "Hold " .. p.flagsToWin .. " flags for " .. p.totalTimeText .. "."
end,
},
["preventCapturingFlags"] = {
currentFlags = 0,
flagsToWin = 0,
allianceID = -1,
Value = function(p)
return p.currentFlags < p.flagsToWin
end,
Tooltip = function(p)
if (p.Value(p)) then
return "Goal is completed."
else
return "Goal is not completed."
end
end,
Counter = function(p)
return p.currentFlags .. " / " .. p.flagsToWin
end,
Description = function(p)
return "Prevent alliance " .. p.allianceID .. " from capturing " .. p.flagsToWin .. " flags."
end,
},
["preventHoldingFlags"] = {
remainingTime = hmsf(0,0,0,0),
totalTime = hmsf(0,0,0,0),
totalTimeText = "0 minutes",
flagsToWin = 0,
allianceID = -1,
Value = function(p)
return p.remainingTime > hmsf(0,0,0,0)
end,
Tooltip = function(p)
if (p.Value(p)) then
return "Goal is completed."
else
return "Goal is not completed."
end
end,
Counter = function(p)
return p.remainingTime:HHMMSSFF(false,true,true,false)
end,
Description = function(p)
return "Prevent alliance " .. p.allianceID .. " from holding " .. p.flagsToWin .. " flags for " .. p.totalTimeText .. "."
end,
},
}
return goalTypes