A Subtle Change Makes for Not So Subtle Possibilities

Off and on, I work on HamQuest.

I decided to keep going with the SilverLight version, and to heck with android.

I’ve been tinkering with a great many of the parts of the game.

Mostly, it deal with offloading things into classes that get loaded into descriptors using reflection.

A recent example of this is that I added properties to the player that allow the handling of command keys.

Before that, there were only six in-game commands:

Arrow keys: move

Tab: switch fight modes

Y: invoke the Amulet of Yendor

I wanted to add a “rest” feature.

Pressing the space bar would have some effects:

  1. Healing (health++)
  2. Use up a full turn of the player (light source duration –)
  3. Increment the wandering monster check for a wandering monster in the room (it should not be without risk to rest in a dungeon)

And naturally, there is a limitation on when a player can rest. The room must have no creatures lurking within it.

Since I already had the one-off “Y” command, I figured I’d put it into the same area, when I realized I should offload it to a class that gets loaded as a part of the configuration.

So, now the configuration has the following added to it:

<key-handlers type=”TagSet”>
<amulet-of-yendor-key-handler type=”AmuletOfYendorKeyHandler”/>
<rest-key-handler type=”PlayerRestKeyHandler”/>

I have two parts to this. One, a “TagSet” (i.e. a HashSet<string>) that specifies all of the actual key handlers, and two, the individual key handlers, which use reflection to load into the descriptor.

After putting this in, I realized something…

I have basically made magic spells and special commands to use items possible and infinitely expandable.

And that is when the full realization hit me.

I’m not making a casual roguelike exploring a maze game anymore.

I’m making a casual roguelike exploring a maze game kit.

And I’ve been doing this for some time.

If I wanted to, I could make the “E” key eat ham, the “D” key drink a potion, and all the other roguelike baggage.

Which I do not wish to do for hamquest itself, because the roots of the game are simple controls.

I could add a macguffin item, like mushrooms, to use a “spell components” that power scrolls that do things like banish monsters.

And I could do this WITHOUT recompiling the engine.

Or at least, I’m close to doing so.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s