Fix nightmare not tracking paths correctly and fix joining deadchat

This commit is contained in:
skizzerz 2015-10-31 22:46:01 -05:00
parent e0cd6e577d
commit ac1bfb778f
2 changed files with 25 additions and 1 deletions

View File

@ -905,12 +905,18 @@ class SleepyMode(GameMode):
if ("correct" in self.on_path or self.step == 0) and self.correct[self.step] == "n": if ("correct" in self.on_path or self.step == 0) and self.correct[self.step] == "n":
self.on_path.add("correct") self.on_path.add("correct")
advance = True advance = True
else:
self.on_path.discard("correct")
if ("fake1" in self.on_path or self.step == 0) and self.fake1[self.step] == "n": if ("fake1" in self.on_path or self.step == 0) and self.fake1[self.step] == "n":
self.on_path.add("fake1") self.on_path.add("fake1")
advance = True advance = True
else:
self.on_path.discard("fake1")
if ("fake2" in self.on_path or self.step == 0) and self.fake2[self.step] == "n": if ("fake2" in self.on_path or self.step == 0) and self.fake2[self.step] == "n":
self.on_path.add("fake2") self.on_path.add("fake2")
advance = True advance = True
else:
self.on_path.discard("fake2")
if advance: if advance:
self.step += 1 self.step += 1
self.prev_direction = "n" self.prev_direction = "n"
@ -931,12 +937,18 @@ class SleepyMode(GameMode):
if ("correct" in self.on_path or self.step == 0) and self.correct[self.step] == "e": if ("correct" in self.on_path or self.step == 0) and self.correct[self.step] == "e":
self.on_path.add("correct") self.on_path.add("correct")
advance = True advance = True
else:
self.on_path.discard("correct")
if ("fake1" in self.on_path or self.step == 0) and self.fake1[self.step] == "e": if ("fake1" in self.on_path or self.step == 0) and self.fake1[self.step] == "e":
self.on_path.add("fake1") self.on_path.add("fake1")
advance = True advance = True
else:
self.on_path.discard("fake1")
if ("fake2" in self.on_path or self.step == 0) and self.fake2[self.step] == "e": if ("fake2" in self.on_path or self.step == 0) and self.fake2[self.step] == "e":
self.on_path.add("fake2") self.on_path.add("fake2")
advance = True advance = True
else:
self.on_path.discard("fake2")
if advance: if advance:
self.step += 1 self.step += 1
self.prev_direction = "e" self.prev_direction = "e"
@ -957,12 +969,18 @@ class SleepyMode(GameMode):
if ("correct" in self.on_path or self.step == 0) and self.correct[self.step] == "s": if ("correct" in self.on_path or self.step == 0) and self.correct[self.step] == "s":
self.on_path.add("correct") self.on_path.add("correct")
advance = True advance = True
else:
self.on_path.discard("correct")
if ("fake1" in self.on_path or self.step == 0) and self.fake1[self.step] == "s": if ("fake1" in self.on_path or self.step == 0) and self.fake1[self.step] == "s":
self.on_path.add("fake1") self.on_path.add("fake1")
advance = True advance = True
else:
self.on_path.discard("fake1")
if ("fake2" in self.on_path or self.step == 0) and self.fake2[self.step] == "s": if ("fake2" in self.on_path or self.step == 0) and self.fake2[self.step] == "s":
self.on_path.add("fake2") self.on_path.add("fake2")
advance = True advance = True
else:
self.on_path.discard("fake2")
if advance: if advance:
self.step += 1 self.step += 1
self.prev_direction = "s" self.prev_direction = "s"
@ -983,12 +1001,18 @@ class SleepyMode(GameMode):
if ("correct" in self.on_path or self.step == 0) and self.correct[self.step] == "w": if ("correct" in self.on_path or self.step == 0) and self.correct[self.step] == "w":
self.on_path.add("correct") self.on_path.add("correct")
advance = True advance = True
else:
self.on_path.discard("correct")
if ("fake1" in self.on_path or self.step == 0) and self.fake1[self.step] == "w": if ("fake1" in self.on_path or self.step == 0) and self.fake1[self.step] == "w":
self.on_path.add("fake1") self.on_path.add("fake1")
advance = True advance = True
else:
self.on_path.discard("fake1")
if ("fake2" in self.on_path or self.step == 0) and self.fake2[self.step] == "w": if ("fake2" in self.on_path or self.step == 0) and self.fake2[self.step] == "w":
self.on_path.add("fake2") self.on_path.add("fake2")
advance = True advance = True
else:
self.on_path.discard("fake2")
if advance: if advance:
self.step += 1 self.step += 1
self.prev_direction = "w" self.prev_direction = "w"

View File

@ -3162,7 +3162,7 @@ def del_player(cli, nick, forced_death=False, devoice=True, end_game=True, death
var.DEAD.add(nick) var.DEAD.add(nick)
ret = not chk_win(cli, end_game) ret = not chk_win(cli, end_game)
# only join to deadchat if the game isn't about to end # only join to deadchat if the game isn't about to end
if ismain and not ret: if ismain and ret:
join_deadchat(cli, *deadchat) join_deadchat(cli, *deadchat)
del deadchat[:] del deadchat[:]
if var.PHASE in ("night", "day") and ret: if var.PHASE in ("night", "day") and ret: