Test every day
UnderworldEnabled work, with the next two situations where a character is sent to
- Your corpse is burned while you’re still online and with positive karma
- Your corpse is burned while you’re still online and of Evil alignment, and fail a constitution saving throw
So we need the character to be killed, and then have their corpse burn. Time to pull out an old
Kesmai mainstay, naphtha. In the game, it came in ceramic bottles and always ignited when the
bottle was thrown (I guess it’s assumed there is always a spark nearby to ignite it). The game also
didn’t care if you threw something along an unreasonable path, so
throw bottle north south is a
valid way to break a bottle at your feet.
416 417 418 419 420 421 422 423 424 425 426 427 428 429
Nothing too interesting here, and it works. As always, there is the negative test as well (where
UnderworldEnabled is false). For the “You’re evil and you fail a constitution throw” case, I
set the character’s constitution to 1 to guarantee failure.
1 2 3
Tackle a TODO every other day
# TODO - verify combat damage in-game?
To verify the display of combat damage in the game itself, we’ll need to set up some actual combat. Since I don’t intend to abuse the innocent Test Dog, let’s spawn in some wolves.
364 365 366 367 368 369 370 371 372 373 374 375 376
As usual, the work involved was more research than code. Using wolves was a bit of a cheat, since the spawn will actually be “3 wolves”, identified as such until they are in the same cell as the player; then the display changes to three “wolf” lines, and my “wait for wolf” code is satisfied. I did get to simplify the database push a bit by writing this little piece of code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
As long as my hashes represent all required values, I can use that to convert them to SQL INSERT statements. I’m sure it’ll get a little more complicated over time, but it sufficed from the spawn zone entry.
And I can even refactor all of the existing database code to use this method.
- Spoiler: Erlang chat server example