Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
enerdhil authored Feb 9, 2017
2 parents de02ecf + cab079c commit bd88ff1
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions modules/roulette/roulette.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Russian Roulette
# By: Louis <louis@ne02ptzero.me>
# Cool modifications by truly yours, Noich

import random
import time
Expand All @@ -11,14 +10,11 @@ def command(self):
"command": {
"rinit": {
"function": self.init,

"usage": "rinit players bullets",

"help": "Init the Russian Roulette"
},
"rstart": {
"function": self.start,
"usage": "rstart",
"help": "Start even if not enough people"
},
"rjoin": {
"function": self.join,
"usage": "rjoin",
Expand All @@ -28,15 +24,10 @@ def command(self):
"function": self.shot,
"usage": "rshot",
"help": "Shot yourself, or not."
},
"rpass": {
"function": self.passTheGun,
"usage": "rpass",
"help": "Pass the gun"
}
}
}
self.users = []
self.users = {}
self.onGame = 0
self.count = 0
self.base = 3
Expand All @@ -45,6 +36,7 @@ def command(self):

def init(self, Morphux, infos):
if (self.onGame == 0):

Morphux.sendMessage(infos['nick'] + " just started the Russian Roulette ! Type !rjoin if you want to die :)")
if len(infos['args']) > 0:
if infos['args'][0].isdigit() == True and int(infos['args'][0]) > 0:
Expand All @@ -53,17 +45,18 @@ def init(self, Morphux, infos):
if infos['args'][1].isdigit == True and int(infos['args'][1]) > 0:
self.bullet = int(infos['args'][1])
self.users.append(infos['nick'])

self.onGame = 1
self.count = 1
elif (self.onGame == 1):
Morphux.sendMessage("Game Already launched, type !rjoin", infos['nick'])
Morphux.sendMessage("Game Already launch, type !rjoin", infos['nick'])
else:
Morphux.sendMessage("Already IG", infos['nick'])

def join(self, Morphux, infos):
if (self.onGame == 1):
if (infos['nick'] not in self.users):
self.users.append(infos['nick'])
self.users[self.count] = infos['nick']
self.count += 1
if (self.count != self.base):
Morphux.sendMessage("<- BALLS HERE, need "+ str(self.base - self.count) +" more fools !", infos['nick'])
Expand All @@ -84,6 +77,7 @@ def start(self, Morphux, infos):
self.count = 0
Morphux.sendMessage("Your turn, type !rshot", self.users[self.count])
if self.onGame == 0:

Morphux.sendMessage("Init the roulette first !", infos['nick'])

def shot(self, Morphux, infos):
Expand All @@ -93,14 +87,15 @@ def shot(self, Morphux, infos):
else:
bullet = random.randint(1, self.bullet)
if (bullet == 1):
Morphux.sendMessage("SO BAD IT HURTS", infos['nick'])
Morphux.sendMessage("Ur so lucky.", infos['nick'])
time.sleep(0.5)
Morphux.sendMessage("JUST KIDDING U DED", infos['nick'])
self.onGame = 0
self.base = 3
self.bullet = 6
self.count = 0
self.users = []
Morphux.kick(infos['nick'], "You shoot me down, bang bang")
else:
Morphux.sendMessage("Ur so lucky.", infos['nick'])
self.bullet -= 1
Morphux.sendMessage("Ur so lucky. " + str(self.bullet) + " bullets left", infos['nick'])

Expand Down

0 comments on commit bd88ff1

Please sign in to comment.