35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# File 'lib/cinch/plugins/roulette.rb', line 35
def rr(m)
@shells[m.channel] = 6 if @shells[m.channel].nil?
@shot[m.channel] = rand(1..@shells[m.channel]) if @shot[m.channel].nil?
shooter = m.user.nick
lines = '=' * 10
puts "#{lines}\nShells left: #{@shells[m.channel]}"
puts "Hot shot: #{@shot[m.channel]}\n#{lines}"
if @shot[m.channel] == @shells[m.channel]
@shells[m.channel] = 6
@shot[m.channel] = rand(1..@shells[m.channel])
m.reply 'Bang!'
m.channel.kick(shooter, 'Bad luck, you\'re dead!')
sleep(2)
m.action_reply 'reloads the revolver and spins the chamber!'
else
m.reply 'Click!'
@shells[m.channel] -= 1
end
end
|