-
Notifications
You must be signed in to change notification settings - Fork 0
/
killer_state.röd
41 lines (40 loc) · 1.01 KB
/
killer_state.röd
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
{
/* Role Party */
roles["KILLER"] = "KILLER"
}
record KillerState(session) : State(session) {
name : string = "KILLER KILLS"
function pushKiller {
session.pushPlayers | { push p for p if [ p.role = "KILLER" ] }
}
function gmText {
return `It's night. The killer wakes up and kills.`
}
function killTexts {
return "Select target.", "The selected person will be killed."
}
function onIntro {
killer := self.pushKiller()
if [ killer.state = "DEAD" ] do
session.broadcasts += "The killer is dead."
session.substate = "END"
return
done
session.broadcasts += "The killer wakes up."
killer.state = "KILL"
session.substate = "KILL"
}
function onKill player, target {
return FALSE unless [ player.role = "KILLER" and player.state = "KILL" ]
session.kill_list += target
session.substate = "OUTRO"
player.state = "WAIT"
return TRUE
}
function onOutro {
killer := self.pushKiller()
killer.state = "SLEEP"
session.broadcasts += "The killer sleeps."
session.substate = "END"
}
}