Idea: add "invoke" command which takes an object in the game and a string, and attempts to call the string as a method of the object.
Currently, if there is (say) an orc in the room and you want to call a function (like die()) on the orc, you have to do some crazy thing like execute "self.cons.write(self.location.contents)" and get the ID of the orc and then call execute "Thing.ID_dict['<orc_id>'].die()"
It would be much nicer to just type invoke orc die() or invoke orc.die(), and have the Parser figure out the orc object and call the appropriate function.
Idea: add "invoke" command which takes an object in the game and a string, and attempts to call the string as a method of the object.
Currently, if there is (say) an orc in the room and you want to call a function (like
die()
) on the orc, you have to do some crazy thing likeexecute "self.cons.write(self.location.contents)"
and get the ID of the orc and then callexecute "Thing.ID_dict['<orc_id>'].die()"
It would be much nicer to just type
invoke orc die()
orinvoke orc.die()
, and have the Parser figure out theorc
object and call the appropriate function.