本文整理匯總了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" )
示例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" )
示例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, "" )
示例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 + "!!!!" )
示例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