rename c and id to c1 and c2 in editor.py

This commit is contained in:
Pavel 2021-10-16 12:10:19 +02:00
parent 8961333c6d
commit 9a57494881
1 changed files with 6 additions and 6 deletions

View File

@ -268,20 +268,20 @@ def en_avant(l):
for k in range(1, len(l)):
xr = int(min(state[0], l[k][0]))
yr = int(min(state[1], l[k][1]))
c = map[xr + yr * 146]
id = map[int(l[k][0]) + int(l[k][1]) * 146]
if c == 1 or id == 1 or ((c == 3 or id == 3) and not state[6]): break
d = hypot(l[k][0]- state[0], l[k][1] - state[1]) * (.2 + ((c == 5) and .1 or (c == 4) and .2 or (c == 2) and .3))
c1 = map[xr + yr * 146]
c2 = map[int(l[k][0]) + int(l[k][1]) * 146]
if c1 == 1 or c2 == 1 or ((c1 == 3 or c2 == 3) and not state[6]): break
d = hypot(l[k][0]- state[0], l[k][1] - state[1]) * (.2 + ((c1 == 5) and .1 or (c1 == 4) and .2 or (c1 == 2) and .3))
state[3] -= d # score
state[4] -= d # life
state[0:2] = l[k][0:2]
if c == 7 and not(xr in state[7]):
if c1 == 7 and not(xr in state[7]):
if state[4] >= 100:
state[4] = max(state[4] - 100, 0)
state[3] += 100
state[5] += 1
state[7].append(xr)
if c == 6 and xr != state[8]:
if c1 == 6 and xr != state[8]:
if not state[6] and len(state[7]) >= 9:
state[6] = 1
elif state[5]: