-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathrules.lua
73 lines (60 loc) · 1.63 KB
/
rules.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
local IngameState = require("ingameState")
local Rules = {}
Rules.__index = Rules
function Rules.create()
local self = setmetatable({}, Rules)
self.eventTime = {}
self:setDefaults()
return self
end
function Rules:setDefaults()
-- Round time in minutes
self.roundtime = 180
-- Number of entities pr. minute
self.frequency = 100
-- Percentage of entities that are enemies
self.enemyperc = 6
-- Percentage of entities that are golden ducks
self.goldperc = 6
-- Percentage of entities that are pink ducks
self.pinkperc = 4
-- Number of arrows per player
self.maxarrows = 4
-- Time arrows stay before they disappear
self.arrowtime = 10
-- Predators eat ducks
self.predatorseat = true
-- Mini games enabled
self.minigames = true
-- Duck rush multiplier
self.rushfrequency = 1000
self.eventTime[IngameState.EVENT_RUSH] = 15
self.eventTime[IngameState.EVENT_PREDRUSH] = 15
self.eventTime[IngameState.EVENT_FREEZE] = 5
self.eventTime[IngameState.EVENT_SWITCH] = 0
self.eventTime[IngameState.EVENT_PREDATORS] = 0
self.eventTime[IngameState.EVENT_VACUUM] = 0
self.eventTime[IngameState.EVENT_SPEEDUP] = 10
self.eventTime[IngameState.EVENT_SLOWDOWN] = 10
-- Gold duck bonus
self.goldbonus = 25
-- Pink duck bonus
self.pinkbonus = 10
-- Event prizes
self.duckdashprize = 50
self.escapeprize = 50
end
function Rules:save()
local strdata = TSerial.pack(self)
love.filesystem.write("rules", strdata)
end
function Rules:load()
if love.filesystem.exists("rules") then
local strdata = love.filesystem.read("rules")
local data = TSerial.unpack(strdata)
for i,v in pairs(data) do
self[i] = v
end
end
end
return Rules