Skip to content

Instantly share code, notes, and snippets.

@technillogue
Created September 23, 2012 20:27
Show Gist options
  • Save technillogue/3772946 to your computer and use it in GitHub Desktop.
Save technillogue/3772946 to your computer and use it in GitHub Desktop.
def move_exec(self):
being = self.actor
dest = self.args["go where"]
loc = being.location
if dest in loc.links.values():
loc.beings.remove(being)
dest.beings.append(being)
being.location = dest
print(being.name, "has moved too", dest.name)
if being.name is config.name:
print(dest.info)
else:
print("Bad location")
move = Action(
"move",
{"exec": move_exec, "choosen": lambda a: None},
{"speed": 1, "type": "move"},
argsinfo={"go where": "self.being.location.links"}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment