コード例 #1
0
ファイル: english.py プロジェクト: retooth/shmudder
 def __init__(self):
     Context.__init__(self)
     self.addSemantics("(.+)", choosePassword)
コード例 #2
0
ファイル: english.py プロジェクト: retooth/shmudder
    def __init__ (self):
        Context.__init__(self)        
        self.addSemantics("(east)",walk)
        self.addSemantics("(west)",walk)
        self.addSemantics("(north)",walk)
        self.addSemantics("(south)",walk)
        
        
        
        self.addSemantics("(northeast)",walk)
        self.addSemantics("(northwest)",walk)
        self.addSemantics("(southeast)",walk)
        self.addSemantics("(southwest)",walk)
        
        
        
        self.addSemantics("(up)",walk)
        self.addSemantics("(down)",walk)
        
        ######################################################
        
        self.addSemantics("take (.+)",take)
        self.addSemantics("throw (.+) away",throwAway)
        self.addSemantics("use (.+)",use)
        self.addSemantics("put (.+) away",putAway)
        self.addSemantics("put (.+) in (.+)",putInto)
        self.addSemantics("take (.+) out of (.+)",takeOutOf)
    
        ######################################################
        
        self.addSemantics("inv",showInventory)
        self.addSemantics("info",showInfo)
        
        self.addSemantics("look around",showRoom)
    
        self.addSemantics("examine (.+)",examine)
        self.addSemantics("ex (.+)",examine)
        self.addSemantics("smell (.+)", smell)
        self.addSemantics("touch (.+)", touch)
        self.addSemantics("listen to (.+)", listen)
        self.addSemantics("listen (.+)", listen)
        
        
        self.addSemantics("give ([a-zA-Z]+) ([a-zA-Z]+)",giveTo)
        
        #self.addSemantics("say (.+)",say)
        #self.addSemantics("shout (.+)",shout)
        #self.addSemantics("say (.+) to (.+)",sayTo)
        
        self.addSemantics("sleep",logout)
        
        self.addSemantics("kill (.+)",kill)
        
        self.addSemantics("drink (.+)", drink)
        self.addSemantics("eat (.+)", eat)
        self.addSemantics("draw (.+)", draw)
        self.addSemantics("put (.+) on", putOn)
        self.addSemantics("take (.+) off", takeOff)
        
        self.addSemantics("(n)",walk)
        self.addSemantics("(w)",walk)
        self.addSemantics("(s)",walk)
        self.addSemantics("(e)",walk)
        self.addSemantics("(ne)",walk)
        self.addSemantics("(nw)",walk)
        self.addSemantics("(se)",walk)
        self.addSemantics("(sw)",walk)
        
        
        #################################################################
        
        self.addExceptionHandling(UnknownAction, "What?")
        self.addExceptionHandling(ImpossibleAction, "This is impossible")
        self.addExceptionHandling(ImprovementNotAllowed, "Not enough attribute points")
        self.addExceptionHandling(CharacterNotFound, "Nobody called by this name is here")
        self.addExceptionHandling(NoSuchDirection, "There is no such direction")
        self.addExceptionHandling(AmbigousDirection, "You are not sure, where to go")
        self.addExceptionHandling(DetailNotFound, "You don't see anything like that")
        self.addExceptionHandling(ItemNotFound, "You can't see an item like that")
        self.addExceptionHandling(ItemNotInUse, "You don't use an item like that")
        self.addExceptionHandling(UnusableItem, "You can't use this times")
        self.addExceptionHandling(NotABin, "This is not a bin")
        self.addExceptionHandling(UnsuitableBin, "You can't put that in there")
        self.addExceptionHandling(ItemReceiverNotFound, "Nobody called by this name is here")
        self.addExceptionHandling(UnsuitableItem, "You can't put that in there")
        self.addExceptionHandling(UnsupportedUseAlias, "This is the wrong way to use this item")
        self.addExceptionHandling(UnsupportedUnuseAlias, "You can't put that item away like that")
        self.addExceptionHandling(CantAttackThisCharacter,"You can't attack this character")

        self.addExceptionHandling(Invisible, "This thing is invisible")
        self.addExceptionHandling(NoSound, "You hear no sound")
        self.addExceptionHandling(NoOdor, "It doesn't smell special")
        self.addExceptionHandling(NoFeeling, "It doesn't feel special")
        
        self.addExceptionHandling(UneatableItem, "You can't eat that")
        self.addExceptionHandling(UndrinkableItem, "You can't drink that")
        self.addExceptionHandling(UnwearableItem, "You can't wear that")
コード例 #3
0
ファイル: english.py プロジェクト: retooth/shmudder
 def __init__ (self):
     Context.__init__(self)
     self.addSemantics("(.+)", password)
     self.addExceptionHandling(BadPassword, "Wrong password")
コード例 #4
0
ファイル: english.py プロジェクト: retooth/shmudder
 def __init__(self):
     Context.__init__(self)
     self.addSemantics("([a-zA-Z0-9]+)", chooseName)
     self.addExceptionHandling(PlayerExists, "This name already exists")
     self.addExceptionHandling(UnknownAction, "Player names may only contain letters and numbers")
コード例 #5
0
ファイル: english.py プロジェクト: retooth/shmudder
 def __init__ (self):
     Context.__init__(self)
     self.addSemantics("choose (.+)", chooseCharacter)
     self.addSemantics("info (.+)", showCharacterChoiceInfo)
     self.addExceptionHandling(UnknownAction, "What ?")
     self.addExceptionHandling(UnknownPlayerType, "There is no such character type")
コード例 #6
0
ファイル: english.py プロジェクト: retooth/shmudder
 def __init__ (self):
     Context.__init__(self)
     self.addSemantics("new", register)
     self.addSemantics("(.+)", login)
     self.addExceptionHandling(UnknownPlayer, "Never heard of you. What's your name?")
コード例 #7
0
ファイル: german.py プロジェクト: retooth/shmudder
    def __init__ (self):
        Context.__init__(self)        
        self.addSemantics("(osten)",walk)
        self.addSemantics("(westen)",walk)
        self.addSemantics("(norden)",walk)
        self.addSemantics("(sueden)",walk)
        
        
        self.addSemantics("(nordosten)",walk)
        self.addSemantics("(nordwesten)",walk)
        self.addSemantics("(suedosten)",walk)
        self.addSemantics("(suedwesten)",walk)
        
        self.addSemantics("(hoch)",walk)
        self.addSemantics("(runter)",walk)
        
        ######################################################

        self.addSemantics("nimm (.+) aus (.+)",takeOutOf)        
        self.addSemantics("nimm (.+)",take)
        self.addSemantics("wirf (.+) weg",throwAway)
        self.addSemantics("benutze (.+)",use)
        self.addSemantics("lege (.+) weg",putAway)
        self.addSemantics("stecke (.+) in (.+)",putInto)
    
        ######################################################
        
        self.addSemantics("inv",showInventory)
        self.addSemantics("info",showInfo)
        
        self.addSemantics("schau",showRoom)
    
        self.addSemantics("untersuche (.+)",examine)
        self.addSemantics("unt (.+)",examine)
        self.addSemantics("riech (.+)", smell)
        self.addSemantics("rieche (.+)", smell)
        self.addSemantics("beruehr (.+)", touch)
        self.addSemantics("beruehre (.+)", touch)
        self.addSemantics("hoer (.+)", listen)
        self.addSemantics("hoere (.+)", listen)
        
        self.addSemantics("gib ([a-zA-Z]+) ([a-zA-Z]+)",giveTo)
        
        #self.addSemantics("sag (.+)",say)
        #self.addSemantics("rufe (.+)",shout)
        #self.addSemantics("teile (.+) mit (.+)",sayTo)
        
        self.addSemantics("schlafe ein",logout)
        self.addSemantics("toete (.+)",kill)
        
        self.addSemantics("trinke (.+)", drink)
        self.addSemantics("trink (.+)", drink)
        self.addSemantics("esse (.+)", eat)
        self.addSemantics("iss (.+)", eat)
        self.addSemantics("zuecke (.+)", draw)
        self.addSemantics("ziehe (.+) an", putOn)
        self.addSemantics("zieh (.+) an", putOn)
        self.addSemantics("ziehe (.+) aus", takeOff)
        self.addSemantics("zieh (.+) aus", takeOff)
        
        self.addSemantics("^(no)$",walk)
        self.addSemantics("^(nw)$",walk)
        self.addSemantics("^(so)$",walk)
        self.addSemantics("^(sw)$",walk)
        self.addSemantics("^(o)$",walk)
        self.addSemantics("^(w)$",walk)
        self.addSemantics("^(n)$",walk)
        self.addSemantics("^(s)$",walk)
        
        
        #################################################################
        
        self.addExceptionHandling(UnknownAction, "Wie bitte?")
        self.addExceptionHandling(ImpossibleAction, "Das ist unmoeglich")
        self.addExceptionHandling(ImprovementNotAllowed, "Du hast nicht genuegend Attributpunkte")
        self.addExceptionHandling(CharacterNotFound, "Hier ist niemand der so heisst")
        self.addExceptionHandling(NoSuchDirection, "Es gibt keinen solchen Ausgang")
        self.addExceptionHandling(AmbigousDirection, "Du bist dir nicht sicher, wohin du gehen sollst")
        self.addExceptionHandling(DetailNotFound, "So etwas siehst du nicht")
        self.addExceptionHandling(ItemNotFound, "Hier ist kein derartiger Gegenstand")
        self.addExceptionHandling(ItemNotInUse, "Du benutzt keinen derartigen Gegenstand")
        self.addExceptionHandling(UnusableItem, "Das kannst du nicht benutzen")
        self.addExceptionHandling(NotABin, "Das ist kein Behaelter")
        self.addExceptionHandling(UnsuitableBin, "Das kannst du da nicht hineinstecken")
        self.addExceptionHandling(ItemReceiverNotFound, "Hier ist niemand der so heisst")
        self.addExceptionHandling(UnsuitableItem, "Das kannst du da nicht hineinstecken")
        self.addExceptionHandling(UnsupportedUseAlias, "Das kannst du so nicht benutzen")
        self.addExceptionHandling(UnsupportedUnuseAlias, "Das kannst du so nicht weglegen")
        self.addExceptionHandling(CantAttackThisCharacter,"Du kannst gegen diesen Spieler nicht kaempfen")

        self.addExceptionHandling(Invisible, "Dieses Ding ist unsichtbar")
        self.addExceptionHandling(NoSound, "Du hoerst kein Gerausch")
        self.addExceptionHandling(NoOdor, "Der Gegenstand riecht nach nichts besonderem")
        self.addExceptionHandling(NoFeeling, "Der Gegenstand fuehlt sich nicht besonders an")

        self.addExceptionHandling(UneatableItem, "Das kannst du nicht essen")
        self.addExceptionHandling(UndrinkableItem, "Das kannst du nicht trinken")
        self.addExceptionHandling(UnwearableItem, "Das ist kein Kleidungsstueck")
コード例 #8
0
ファイル: german.py プロジェクト: retooth/shmudder
 def __init__(self):
     Context.__init__(self)
     self.addSemantics("([a-zA-Z0-9]+)", chooseName)
     self.addExceptionHandling(PlayerExists, "Diesen Spieler gibt es bereits")
     self.addExceptionHandling(UnknownAction, "Spielernamen duerfen nur Zahlen und Buchstaben enthalten")
コード例 #9
0
ファイル: german.py プロジェクト: retooth/shmudder
 def __init__ (self):
     Context.__init__(self)
     self.addSemantics("(.+)", password)
     self.addExceptionHandling(BadPassword, "Das Passwort ist falsch")
コード例 #10
0
ファイル: german.py プロジェクト: retooth/shmudder
 def __init__ (self):
     Context.__init__(self)
     self.addSemantics("neu", register)
     self.addSemantics("(.+)", login)
     self.addExceptionHandling(UnknownPlayer, "Nie von dir gehoert ! Wie heisst du ?")
コード例 #11
0
ファイル: german.py プロジェクト: retooth/shmudder
 def __init__ (self):
     Context.__init__(self)
     self.addSemantics("waehle (.+)", chooseCharacter)
     self.addSemantics("info (.+)", showCharacterChoiceInfo)
     self.addExceptionHandling(UnknownAction, "Wie bitte ?")
     self.addExceptionHandling(UnknownPlayerType, "So einen Spielertyp gibt es nicht")