-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnight_actions.rb
More file actions
36 lines (27 loc) · 1.04 KB
/
night_actions.rb
File metadata and controls
36 lines (27 loc) · 1.04 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
class Night < Phase
ACTIONS = {
investigate: proc do |investigator, investigated|
@player_status[investigator] ||= {}
unless @player_status[investigator][:investigating]
at_end do
if @player_status[investigator][:investigating].is_a? Mafia
investigator.send("#{investigated} is a Mafia!")
else
investigator.send("#{investigated} is not a Mafia!")
end
end
end
@player_status[investigator][:investigating] = investigated
investigator.send("You aim your efforts at finding out more about #{investigated}.")
end,
mafia_kill: proc do |killer, killee|
@player_status[killer] ||= {}
@player_status[killer][:mafia_kill_vote] = killee
killer.send("@RYou are plotting to kill #{killee}.@d")
send_all(Mafia, "@R<Mafia>@d #{killer} votes to kill #{killee}")
end,
mafia_chat: proc do |speaker, message|
send_all(Mafia, "@R<Mafia chat> @c#{speaker}@d: #{message}")
end
}
end