Example #1
0
 def run(self, actor, where):
     """
     :type actor: mudslingcore.objects.Player
     :type where: mudsling.objects.Object
     """
     if actor.is_possessing and actor.possessing.is_valid(LocatedObject):
         #: :type: mudsling.objects.Object
         obj = actor.possessing
         plugins = self.game.plugins.enabled_plugins()
         if where is None and 'myobjs' in plugins:
             from myobjs import MyObjCharacter
             #: :type: MyObjCharacter
             char = obj
             if char.isa(MyObjCharacter) and char.has_myobj('place'):
                 place = char.get_myobj('place')
                 if self.game.db.is_valid(place, LocatedObject):
                     where = place
         if where is None:
             actor.msg(self.syntax_help())
             return
         if not obj.allows(actor, 'move'):
             actor.tell("{yYou are not allowed to move {c", obj, "{y.")
             return
         misc.teleport_object(obj, where)
     else:
         m = "You are not attached to a valid object with location."
         raise self._err(m)
Example #2
0
 def run(self, actor, where):
     """
     :type actor: mudslingcore.objects.Player
     :type where: mudsling.objects.Object
     """
     if actor.is_possessing and actor.possessing.is_valid(LocatedObject):
         #: :type: mudsling.objects.Object
         obj = actor.possessing
         plugins = self.game.plugins.enabled_plugins()
         if where is None and 'myobjs' in plugins:
             from myobjs import MyObjCharacter
             #: :type: MyObjCharacter
             char = obj
             if char.isa(MyObjCharacter) and char.has_myobj('place'):
                 place = char.get_myobj('place')
                 if self.game.db.is_valid(place, LocatedObject):
                     where = place
         if where is None:
             actor.msg(self.syntax_help())
             return
         if not obj.allows(actor, 'move'):
             actor.tell("{yYou are not allowed to move {c", obj, "{y.")
             return
         misc.teleport_object(obj, where)
     else:
         m = "You are not attached to a valid object with location."
         raise self._err(m)
Example #3
0
 def run(self, this, actor, args):
     """
     :type this: mudslingcore.objects.Player
     :type actor: mudslingcore.objects.Player
     :type args: dict
     """
     obj, where = (args['what'], args['where'])
     if not obj.allows(actor, 'move'):
         actor.tell("{yYou are not allowed to move {c", obj, "{y.")
         return
     misc.teleport_object(obj, where)
     msg_key = 'teleport' if obj.location == where else 'teleport_failed'
     actor.direct_message(msg_key, recipients=(actor, obj),
                          actor=actor, obj=obj, where=where)
Example #4
0
 def run(self, this, actor, args):
     """
     :type this: mudslingcore.objects.Player
     :type actor: mudslingcore.objects.Player
     :type args: dict
     """
     obj, where = (args['what'], args['where'])
     if not obj.allows(actor, 'move'):
         actor.tell("{yYou are not allowed to move {c", obj, "{y.")
         return
     misc.teleport_object(obj, where)
     msg_key = 'teleport' if obj.location == where else 'teleport_failed'
     actor.direct_message(msg_key,
                          recipients=(actor, obj),
                          actor=actor,
                          obj=obj,
                          where=where)