Re: Porting ToME2 to the T4 engine
Posted: Mon Nov 28, 2016 2:47 am
And here I was thinking this one would be such a quick and simple one… 
Release 0.2.4 "It's a Trap!"
This release is mostly about traps, and things related to traps. Which actually covers a lot more ground than I was expecting:
In addition, by executive fiat I have ruthlessly excised the purely cosmetic Traps of Aging, Growing, Shrinking, Femininity, Masculinity and Neutrality.
"Oh, now you think of this, genius?"
*sigh* Well, this wouldn't have helped you, Gathraka, because it's a completely different system, but yes, I don't think there's any point in any characters in the T2 module having to go through what you want through with that Trap of Neutrality back in T2 proper.
*blink* "…O-kaay, I think I understood about half of that."
"Meh, don't sweat it, orc babe. See, the trick when Dude starts goin' on about that whole parallel perpendicular business is to just, like, let it wash over you, y'know? It's like, 'confusion is the mind killer' and all that junk. Or maybe it's that hobbit farmer dude's mushrooms that's the mind killer, I can never remember…"
"Thank you, oh wise and eloquent sage. That makes things ever so much clearer."
"No prob'. Glad to be of help."
*facepalm* "Seriously, can I at least wound him a little?"
Okay, break it up, you two. You see what I have to put up with…
Any-way, this release also includes the usual batch of bugfixes:
And as always, the .team file for the release is available from my site, along with the Subversion repo and WebSVN front-end thereto.
Next up, barring requests, I'm thinking alchemy… maybe antimagic?

Release 0.2.4 "It's a Trap!"
This release is mostly about traps, and things related to traps. Which actually covers a lot more ground than I was expecting:
- Chests have traps, so they're now implemented.
- Scrolls of Trap Creation and the Create Traps NPC spell now live up to their names.
- And as long as I was in the neighborhod of NPC spells, I picked off a few more unimplemented ones: Teleport Away, Teleport Level, Darkness, Cause Amnesia, Mind Blast, Brain Smash and Drain Mana.
- Disarming traps is also important, of course, so we implement various disarming spells and items, as well as T2's 'D'isarm command, mapped to shift-D by default.
- Known traps will block running and moving by default; the latter can be changed via the "Automatically disarm traps" option, which will attempt to disarm a known trap when you walk on it.
- Some traps apply timed effects that do damage (notably the Poison Needle Trap), so we tweak the message on damage dealing so that we get, for instance, "Poison from Poison Needle Trap hits player for 1 poison damage."
- Some traps paralyze, so finally got around to implementing the "Paralyzed" temporary effect and the related PARALYZE damage type. This includes T2's hack of having paralysis attacks do a point of actual damage if you're already paralyzed, to prevent Floating eyes from becoming a perma-paralysis trap.
- The Trapping ability is now implemented, allowing the player to use trap kits to set traps for monsters. And as a neat use of the T-Engine's flexibility, if you have the Trapping ability, the object descriptions of wands, staffs, rods, potions and scrolls that can be used in trap kits will include a description of what they do in that capacity.
- Interestingly, wands and staffs don't actually appear to do anything when loaded into trap kits, at least not in the v2.3.9 code I've got or the C++ rewrite AnonymousHero's got going. I suppose I could take a stab at trying to decipher the commented-out partial implementation that's there, but I'm not sure where they were going with it; for now, we punt and only allow rods to be used in a Device Trap Set.
- In my first-pass implementation of archery, I hadn't implemented critical ranged hits or ammo slay/brand flags; since some trap kits use those, I figured I ought to cover that for this pass.
- Some scrolls that can be used in trap kits weren't implemented yet, so I implemented them while I was setting up their trap effects: Summon Monster, Summon Undead, Darkness, Dispel Undead, Genocide and Mass Genocide.
- And speaking of genocide, implementing those scrolls gave me the infrastructure I need to implement the Udun Genocide spell (and thereby Staffs of Genocide), a couple genocide-activating artifacts, and genocide/mass-genocide junkarts.
- For traps that you actually want to trigger, like Acquirement traps, T2 has a command to deliberately walk onto and trigger a known trap. I don't recall what key it was bound to, so I've mapped it to ctrl-shift-D by default.
- Speaking of Acquirement Traps, implementing them gave me the infrastructure I needed to implement Scrolls of Acquirement and *Acquirement* (which, amusingly, can also be used in trap kits) and junkarts that activate for acquirement.
- Similarly, implementing the Earthquake Trap gave me the infrastructure I needed to implement the Shake and Horns of Ylmir spells, the Earthquake randart power (
yeah, surprised me too) and weapons of Earthquakes.
- And getting weapons of Earthquakes right led to a massive rearchitecting of how weapon flags like IMPACT for earthquakes are handled internally, allowing me to also implement Chaotic and Vampiric weapons.
- And as long as I was in the neighborhood of weapon flag handling, I fiddled a bit with how weapon slays and brands are handled, allowing me to implement the Poison Hands temporary effect from the Poison Blood spell.
- Earthquake handling checks for the Wraith Form effect to see if it needs to knock the player out of the way of falling rocks, so that effect is now (mostly, I think) implemented and lets the player pass through walls.
- And since Spectral weapons are a primary source of the Wraith Form effect, I finally figured out how to implement egos that confer an activation.

"Oh, now you think of this, genius?"
*sigh* Well, this wouldn't have helped you, Gathraka, because it's a completely different system, but yes, I don't think there's any point in any characters in the T2 module having to go through what you want through with that Trap of Neutrality back in T2 proper.
*blink* "…O-kaay, I think I understood about half of that."
"Meh, don't sweat it, orc babe. See, the trick when Dude starts goin' on about that whole parallel perpendicular business is to just, like, let it wash over you, y'know? It's like, 'confusion is the mind killer' and all that junk. Or maybe it's that hobbit farmer dude's mushrooms that's the mind killer, I can never remember…"

"No prob'. Glad to be of help."
*facepalm* "Seriously, can I at least wound him a little?"
Okay, break it up, you two. You see what I have to put up with…

- As I discovered while testing stat reduction traps, I had forgotten to implement the orange coloring for temporarily reduced stats. [I had remembered to do it in the character sheet dialog, but apparently I had gotten it wrong there.
]
- I don't think I had properly implemented learning the "flavor" of stacks of scrolls/potions/etc. on identify/use.
- Apparently monsters that were supposed to drop guaranteed good/great items weren't reliably doing so. We Apologize for the Inconvenience.™
- Fates to find an object or monster on a level would, I think, have broken badly…
- Related to the damage source description tweaks above, it's lucky no one ever got down to starving, because it was badly broken.
- So I was supposed to be scaling down initial monster generation on small levels. We Apologized for the Overwhelming Deadliness.™
- Staffs of Summon are supposed to summon hostile monsters, not friendly ones.
- I think Actor:resolveLevel() was leveling up the level-0 townsfolk to level 1, making them that much tougher. Poor Steven Aus…
- Worse, if I'm reading this right, the 'add_levels' field in Actor filters both requests an out-of-depth monster and levels the monster up even further. That gets used in vaults and orc/troll/etc. pits, so that would be very bad.
Needless to say, I've nipped that in the bud. I hope.
- Testing of stat-draining traps revealed that I was botching stat reduction.
- Was also getting Potions of Self Knowledge and related effects wrong.
- Another :talentDialog()-related glitch would have prevented Scrolls of Artifact Creation from successfully prompting you for a name for your new artifact.
- And more generally dialog-related, right-clicking on a temporary effect marker to cancel it early wasn't working, nor did the message-log dialog (bound to Ctrl-M by default).
- Implemented the Melkor prayer functionality of summoning friendly undead/demons when you get knocked below 25% max life, and auto-applying the Curse spell as appropriate.
- Implemented a few more spells and staff/devices: Summon Animal (which is how I found those leveling bugs above…), Elemental Minion, Staffs of Mana and the Golden Horn of the Thunderlords. Oh, and Wands/Staffs of Nothing.
- Since I was in the neighborhood implementing other junkart activations, I also covered level-teleport junkarts.
- Timed Roots now properly prevents you from moving, taking stairs, teleporting or using a void jumpgate.
- You now have a much lower chance of unlocking a door if you're blind, confused or hallucinating.
- Never got around to implementing object price modifications for egos and flags and stuff before. Done now.
And as always, the .team file for the release is available from my site, along with the Subversion repo and WebSVN front-end thereto.
Next up, barring requests, I'm thinking alchemy… maybe antimagic?