minor fixes for wordrun

Help returns correct title of the game;
Alternative command .add is being ignored when counting valid words;
Typos
This commit is contained in:
ThomasWeis
2022-04-21 05:37:22 +02:00
parent 02308bf5d7
commit b5ae7ddc29

View File

@@ -12,7 +12,7 @@ class WordRunObserver(PrivMsgObserverPrototype):
@staticmethod @staticmethod
def help(): def help():
return 'hangman game' return 'wordrun game'
def __init__(self): def __init__(self):
super().__init__() super().__init__()
@@ -35,7 +35,7 @@ class WordRunObserver(PrivMsgObserverPrototype):
def add(self, data, connection): def add(self, data, connection):
if self.gamestatus == 0: if self.gamestatus == 0:
connection.send_channel("Es läuft derzeit kein Wordrun, bitte einen neuen mit .begin <Silbe> oder .end <silbe> erstellen!") connection.send_channel("Es läuft derzeit kein Wordrun, bitte einen neuen mit .begin <Silbe> oder .end <Silbe> erstellen!")
return return
if self.gamestatus == 1 or self.gamestatus == 2: if self.gamestatus == 1 or self.gamestatus == 2:
self.check_word(data["nick"], data['message'], connection) self.check_word(data["nick"], data['message'], connection)
@@ -56,7 +56,7 @@ class WordRunObserver(PrivMsgObserverPrototype):
def check_word(self,player , message, connection): def check_word(self,player , message, connection):
for word in message.split(): for word in message.split():
if word == '.a': if word == '.a' or word == '.add':
continue continue
if self.gamestatus == 1: if self.gamestatus == 1:
if word.upper().startswith(self.syllable.upper()): if word.upper().startswith(self.syllable.upper()):