generated from Nemesis/Exemple
horloge +/-
This commit is contained in:
parent
fe4bb415b6
commit
ca91297400
1 changed files with 5 additions and 5 deletions
10
asmodee.py
10
asmodee.py
|
@ -1046,12 +1046,12 @@ def horloge(room, event): # Gestion des horloges PBTA
|
|||
clock[room.room_id, ' '.join(args[0:-1])] = nv
|
||||
elif (len(args) >= 2 and (args[len(args)-1][:1] == "+" or args[len(args)-1][:1] == "-")):
|
||||
nv = 0
|
||||
hor = ' '.join(args[0:-1]
|
||||
if (room.room_id, hor in clock):
|
||||
nv = clock[room.room_id, hor)]
|
||||
hor = ' '.join(args[0:-1])
|
||||
if ((room.room_id, hor) in clock):
|
||||
nv = clock[room.room_id, hor]
|
||||
val = 0
|
||||
if (args[len(args)-1][1:].isnumeric()):
|
||||
val = args[len(args)-1][1:]
|
||||
val = int(args[len(args)-1][1:])
|
||||
if (args[len(args)-1][:1] == "+"):
|
||||
nv = nv + val
|
||||
if (nv > 6):
|
||||
|
@ -1060,7 +1060,7 @@ def horloge(room, event): # Gestion des horloges PBTA
|
|||
nv = nv - val
|
||||
if (nv < 0):
|
||||
nv = 0
|
||||
clock[room.room_id, hor)] = nv
|
||||
clock[room.room_id, hor] = nv
|
||||
elif (len(args) >= 2 and args[0] == "del"):
|
||||
# Supprime une horloge
|
||||
args.pop(0)
|
||||
|
|
Loading…
Reference in a new issue