當前位置: 首頁>>代碼示例>>Python>>正文


Python BetterMUD.room方法代碼示例

本文整理匯總了Python中BetterMUD.room方法的典型用法代碼示例。如果您正苦於以下問題:Python BetterMUD.room方法的具體用法?Python BetterMUD.room怎麽用?Python BetterMUD.room使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BetterMUD的用法示例。


在下文中一共展示了BetterMUD.room方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: Run

# 需要導入模塊: import BetterMUD [as 別名]
# 或者: from BetterMUD import room [as 別名]
    def Run( self, args ):
        if not args: raise PythonCommand.UsageError

        me = BetterMUD.character( self.me )
        r = BetterMUD.room( me.Room() )
        m = BetterMUD.character( FindTarget( r.SeekCharacter, r.IsValidCharacter, r.CurrentCharacter, args ) )
        m.DoAction( "do", 0, 0, me.ID(), 0, "list" )
開發者ID:JaguarMantid,項目名稱:bettermud,代碼行數:9,代碼來源:usercommands.py

示例2: Run

# 需要導入模塊: import BetterMUD [as 別名]
# 或者: from BetterMUD import room [as 別名]
    def Run( self, args ):
        if not args: raise PythonCommand.UsageError

        me = BetterMUD.character( self.me )
        r = BetterMUD.room( me.Room() )

        # find the name:
        id = FindTarget( r.SeekCharacter, r.IsValidCharacter, r.CurrentCharacter, args )
        c = BetterMUD.character( id )
        name = c.Name()

        self.mud.AddActionAbsolute( 0, "addlogic", 0, id, 0, 0, "superglue" )
        self.mud.AddActionAbsolute( 0, "vision", r.ID(), 0, 0, 0, "<#FF0000>OMG!!! " + me.Name() + " just SUPERGLUED " + name + " to the floor!!!!!" )
        self.mud.AddActionRelative( 20000, "messagelogic", 0, id, 0, 0, "superglue remove" )
開發者ID:JaguarMantid,項目名稱:bettermud,代碼行數:16,代碼來源:spells.py

示例3: Run

# 需要導入模塊: import BetterMUD [as 別名]
# 或者: from BetterMUD import room [as 別名]
    def Run( self, args ):
        if not args: raise PythonCommand.UsageError

        me = BetterMUD.character( self.me )
        room = BetterMUD.room( me.Room() )
        room.SeekCharacter( args )
        if room.IsValidCharacter():
            character = room.CurrentCharacter()
        else:
            me.DoAction( "error", 0, 0, 0, 0, "Cannot find character: " + args )
            return

        c = BetterMUD.character( character )
        me.DoAction( "announce", 0, 0, 0, 0, "Destroying Character: " + c.Name() )
        self.mud.AddActionAbsolute( 0, "destroycharacter", character, 0, 0, 0, "" )
開發者ID:JaguarMantid,項目名稱:bettermud,代碼行數:17,代碼來源:admincommands.py

示例4: Run

# 需要導入模塊: import BetterMUD [as 別名]
# 或者: from BetterMUD import room [as 別名]
    def Run( self, args ):
        me = BetterMUD.character( self.me )
        r = BetterMUD.room( me.Room() )

        # find the name:
        if not args:
            name = "himself"
        else:
            r.SeekCharacter( args )
            if not r.IsValidCharacter():
                me.DoAction( "error", 0, 0, 0, 0, "Cannot find character: " + args )
                return
            id = r.CurrentCharacter()
            c = BetterMUD.character( id )
            name = c.Name()

        self.mud.AddActionAbsolute( 0, "vision", r.ID(), 0, 0, 0, "<#00FF00>OMG!!! " + me.Name() + " just threw a huge <#FFFF00>CUSTARD PIE<#00FF00> at " + name + "!!!!" )
開發者ID:JaguarMantid,項目名稱:bettermud,代碼行數:19,代碼來源:actions.py

示例5: Run

# 需要導入模塊: import BetterMUD [as 別名]
# 或者: from BetterMUD import room [as 別名]
    def Run( self, action, arg1, arg2, arg3, arg4, data ):
        me = BetterMUD.character( self.me )

        # Attack anyone who enters the room
        if action == "enterroom":
            if arg1 != self.me:
                self.mud.AddActionAbsolute( 0, "do", 0, me.ID(), arg1, 0, "initattack" )
            return


        # you killed someone find another target!
        if action == "do" and data == "killed":
            r = BetterMUD.room( me.Room() )
            r.BeginCharacter()
            while r.IsValidCharacter():
                if r.CurrentCharacter() != arg3:    # make sure you don't re-attack the character you just killed!
                    self.mud.AddActionAbsolute( 0, "do", 0, me.ID(), r.CurrentCharacter(), 0, "initattack" )
                    return
                r.NextCharacter()
            return
開發者ID:JaguarMantid,項目名稱:bettermud,代碼行數:22,代碼來源:combat.py


注:本文中的BetterMUD.room方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。