Chris H wrote:
What I'd like are macro commands that take a particular creature and let you directly edit its location or let you remove or create creatures. Next time I'm in the code, I'll see if I can make some new macro commands that make this a little easier.
However this would still be limited to a creature somewhat nearby on the same map as the player -- it's limited to being able to manipulate what's already in memory.
That would be very cool!
If you also had a step macro that a creature could execute each turn, along with the ability for that macro to manipulate a few of the creature's internal states, you would be able to add an enormous amount of flexibility.
For example, let's say the macro had access to the following variables:
CRX, CRY - creature's location in the current room
CRHP - creature's current hit points
CRACT - variable that is optionally set by the macro to tell the creature what to do, sort of a reverse version of LASTMOV:
0 - allow the creature to do whatever it normally would
1/2/3/4 - move N/S/E/W
5 - attack with melee weapon (if possible)
6 - attack with distance weapon (if possible)
So, before the macro runs for a given creature, CRX and CRY would be set to its current location, and CRHP would be set to its current HP. After the macro runs, changes in CRX, CRY and CRHP would propagate back to the creature, and CRACT would be consulted to determine if the macro had decided to override the creature's normal action.
This would allow implementation of things like:
- creatures that cast spells on the player
- creatures that cast spells to heal themselves
- creatures that have limited ammo for a distance weapon
- creatures that teleport around the room (by changing CRX/CRY)
- creatures that follow designated patrol paths (like guards)
You probably wouldn't go to this level of complexity for *most* creatures, but for higher-level monsters or boss fights it might be interesting.
If you added to this the ability to create/delete creatures, you might also be able to implement simple party members/allies that followed you from room to room and helped you fight, cast healing spells, etc.