On ne tranche pas les Metzthernets.
This commit is contained in:
parent
889fa1020e
commit
79191a406e
2 changed files with 19 additions and 15 deletions
32
roulette.py
32
roulette.py
|
@ -176,22 +176,26 @@ def cheat(player_id, target_id):
|
||||||
success = random.choice([True, False])
|
success = random.choice([True, False])
|
||||||
with open(IMMUNITY_FILE, 'r') as f:
|
with open(IMMUNITY_FILE, 'r') as f:
|
||||||
immunity = f.read()
|
immunity = f.read()
|
||||||
try:
|
with open(ASSHOLES_FILE, 'r') as f:
|
||||||
ok = [line.strip().partition(' ') for line in immunity]
|
assholes = f.read()
|
||||||
ok = [get_player_from_full_name(names[0], names[2])['id'] for names in ok]
|
ok = [line.split(' ') for line in immunity.split('\n') if line]
|
||||||
|
ok = [get_player_from_full_name(names[0], names[1])['id'] for names in ok]
|
||||||
|
|
||||||
ko = [line.strip().partition(' ') for line in ASSHOLES]
|
ko_names = [line.split(' ') for line in assholes.split('\n') if line]
|
||||||
ko = [get_player_from_full_name(names[0], names[2])['id'] for names in ko]
|
ko = []
|
||||||
|
for names in ko_names:
|
||||||
|
p = get_player_from_full_name(names[0], names[1])
|
||||||
|
if p:
|
||||||
|
ko.append(p['id'])
|
||||||
|
if target_id in ko:
|
||||||
|
success = True
|
||||||
|
elif player_id in ko:
|
||||||
|
success = False
|
||||||
|
elif target_id in ok:
|
||||||
|
success = False
|
||||||
|
elif player_id in ok:
|
||||||
|
success = True
|
||||||
|
|
||||||
if target_id in ko:
|
|
||||||
success = True
|
|
||||||
elif player_id in ko:
|
|
||||||
success = False
|
|
||||||
elif target_id in ok:
|
|
||||||
success = False
|
|
||||||
|
|
||||||
except TypeError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
return success
|
return success
|
||||||
|
|
||||||
|
|
2
state
2
state
|
@ -1 +1 @@
|
||||||
up
|
up precampagne !!
|
||||||
|
|
Loading…
Reference in a new issue