From dadff67f74aa9d8837902064c44cdd3a4df4b0bc Mon Sep 17 00:00:00 2001 From: skizzerz Date: Wed, 3 Jun 2015 10:50:32 -0500 Subject: [PATCH] Guardian modifications Modify game over messages to read better Modify win conds to remove unneeded ones and to also add in some "nobody wins" conds that happen due to MAD or stalemates. --- src/settings.py | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/settings.py b/src/settings.py index 2d9c8a6..e233f01 100644 --- a/src/settings.py +++ b/src/settings.py @@ -918,29 +918,31 @@ class GuardianMode(GameMode): lguardians = len(var.list_players(["guardian angel", "bodyguard"])) if lpl < 1: - evt.data["winner"] = "none" - evt.data["message"] = "Game over! The wolves and the villagers have killed each other off! Nobody wins." - - elif not lguardians and lwolves > lpl // 2: + # handled by default win cond checking + return + elif not lguardians and lwolves > lpl / 2: evt.data["winner"] = "wolves" - evt.data["message"] = ("Game over! There are more wolves than remaining villagers! The village " + - "doesn't have anyone left to save them, and the wolves eat up everyone left.") - - elif not lguardians and lwolves == lpl // 2: + evt.data["message"] = ("Game over! There are more wolves than uninjured villagers. With the ancestral " + + "guardians dead, the wolves overpower the defenseless villagers and win.") + elif not lguardians and lwolves == lpl / 2: evt.data["winner"] = "wolves" - evt.data["message"] = ("Game over! There as many wolves as villagers! With no defensive power left, " + - "the wolves easily dispatch all the remaining villagers") - - elif not lrealwolves: + evt.data["message"] = ("Game over! There are the same number of wolves as uninjured villagers. With the ancestral " + + "guardians dead, the wolves overpower the defenseless villagers and win.") + elif not lrealwolves and lguardians: evt.data["winner"] = "villagers" evt.data["message"] = ("Game over! All the wolves are dead! The remaining villagers throw a party in honor " + "of the guardian angels that watched over the village, and live happily ever after.") - - elif not lguardians: - evt.data["winner"] = "wolves" - evt.data["message"] = ("Game over! The villagers have lost all their defensive power! The wolves " + - "overpower the villagers and win.") - + elif not lrealwolves and not lguardians: + evt.data["winner"] = "none" + evt.data["message"] = ("Game over! The remaining villagers managed to destroy the wolves, however the guardians " + + "that used to watch over the village are nowhere to be found. The village lives on in an " + + "uneasy peace, not knowing when they will be destroyed completely now that they are " + + "defenseless. Nobody wins.") + elif lwolves == lguardians and lpl - lwolves - lguardians == 0: + evt.data["winner"] = "none" + evt.data["message"] = ("Game over! The guardians, angered by the loss of everyone they were meant to guard, " + + "engage the wolves in battle and mutually assured destruction. After the dust settles " + + "the village is completely dead, and nobody wins.") else: evt.data["winner"] = None