-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoctor_state.röd
41 lines (40 loc) · 1.03 KB
/
doctor_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["DOCTOR"] = "TOWN"
}
record DoctorState(session) : State(session) {
name : string = "DOCTOR HEALS"
function pushDoctor {
session.pushPlayers | { push p for p if [ p.role = "DOCTOR" ] }
}
function gmText {
return `It's night. The doctor wakes up and heals.`
}
function killTexts {
return "Select target.", "The person you choose cannot die during this night."
}
function onIntro {
player := self.pushDoctor()
if [ player.state = "DEAD" ] do
session.broadcasts += "The doctor is dead."
session.substate = "END"
return
done
session.broadcasts += "The doctor wakes up."
player.state = "KILL"
session.substate = "KILL"
}
function onKill player, target {
return FALSE unless [ player.role = "DOCTOR" and player.state = "KILL" ]
session.heal_list += target
session.substate = "OUTRO"
player.state = "WAIT"
return TRUE
}
function onOutro {
player := self.pushDoctor()
player.state = "SLEEP"
session.broadcasts += "The doctor sleeps."
session.substate = "END"
}
}