On ne tranche pas les Metzthernets.

This commit is contained in:
Klafyvel 2018-01-13 13:27:27 +01:00 committed by root
parent 889fa1020e
commit 79191a406e
2 changed files with 19 additions and 15 deletions

View file

@ -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 = [get_player_from_full_name(names[0], names[2])['id'] for names in ko]
ko_names = [line.split(' ') for line in assholes.split('\n') if line]
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: if target_id in ko:
success = True success = True
elif player_id in ko: elif player_id in ko:
success = False success = False
elif target_id in ok: elif target_id in ok:
success = False success = False
elif player_id in ok:
success = True
except TypeError:
pass
return success return success

2
state
View file

@ -1 +1 @@
up up precampagne !!