Good question, in order to move item definitions out to json files, we needed to get rid of the old enums, because there’s no good way to have enum-like things in the json files. So what we have now is strings acting as flags. This has some tradeoffs:
GOOD:
You can just add any arbitrary string as a new flag. (unlimited number of different flags)
There is no limit on the number of flags you can add to an item.
NEUTRAL:
You still need to add code to handle new flags to the code.
BAD:
The game doesn’t check whether you’ve typoed the string.
There’s no natural place to define all the flags in one place.
Really good news:
We should be able to work around both of the bad aspects by adding a “flag_list” module in the code that just checks that when a flag is used it’s one of the existing ones. This also gives us a natural place to stick a short description of said flag.
RE: attack type flags, this was something I added very recently, I rejiggered the “your weapon gets stuck in the %s, but you pull it out” mechanic a bit to take weapon attack type into account instead of just using some weird heuristics. I established 5 classes of cutting weapons, “Slice”, “Stab”, “Spear”, “Chop”, and “Improvised”* in ascending order of “stuck-ness”. “Slice” (currently only the katana, but it’s not intended to be exclusive) sticks the least, “Stab” and “Spear” (spears, stabby knives and swords) stick 2x more than “Slicing”, “Chop” (axes, broadswords, etc) sticks another 2x more, and “Improvised” (tools like shovels and a few others) sticks 2x more still.
Severity of sticking is adjusted by the ratio of cutting/bashing damage, so if you throw a point of cutting damage in with 20 points of bashing damage, it won’t make it crazy susceptable to sticking.
Sticking is also reduced by higher skill with the appropriate weapon type.
It could probably still use some more tweaking, but I think it’s better than the previous system already.
*There’s no “Improvised” tag, but the category is applied to any weapon that has cutting damage and none of the other flags.