NerdanelVampire: It occurred me that in Zothiqband I have both ghoul player characters and a wide variety of plant monsters. I had forked the hunger subsystem already, initially to make the ghouls like the taste of fresh and especially rotten meat, and decided to implement plant remains so that the ghouls could hate those. Then I started thinking that I might want to make different races vegetarian, carnivorous, or omnivorous in order to differentiate between them better. Long story short, it turned out out that corpses are still mainly in C, and I can't add easily a new type of corpse drop. (I suppose I could do something with the DO_DROP_CORPSE hook, but that would be unaesthetic hackery, and I hope something better comes along.)
Well, you can take this post as a suggestion on what to luafy.
NeilStevens: E-Team already has its own custom monster drops. You can do it two ways: on monster creation give them inventory, or on monster death drop an item where the monster died.
What's 'unaesthetic' about hooks?
BucketMan: Since you're already forked the hunger subsystem, Wouldn't it be easier to assign flags to the monster races and use food.eat_corpse() to check r_info[] for those flags when eating? Something along the lines of:
local race = r_info[get_flag(obj, FLAG_MONSTER_IDX) + 1]
if has_flag(race, FLAG_I_AM_A_PLANT) and (player_is_a_ghoul) then
message("Ohhh!!! Icky horrible vegetables! Yuck!")
kill_player("being a vegetarian")
end
NerdanelVampire: It's usability really. I made the vegetable corpses different color from meat corpses so that the player can distinguish between them at a glance. Otherwise if the player hasn't been paying attention and sees the corpse of, say, "Thuloneah, the last lover of Adompha" it's far from obvious that she is classed as a plant.
In hook usage being unaesthetic, it wouldn't in general circumstances, but here I would have to do something like interrupting the creation of a corpse and replacing it with another object - an ugly hack if there's one. I'd much rather edit the corpse creation in the first place.
And well, even I myself realize that I'm tweaking small details (like this and the wonderful new drug use messages you might want to try when the next version gets released) when there are much bigger problems in Zothiqband.
BucketMan: No, I understand completely. Dragonball T has grandiose, home-brewed systems for dialogue, magic, technology, etc...but really it's the small things that give me the most joy. Like the Japanese baths that scold you for not showering first, and cats that say "Feed me! Pet me! Love me!"
Let's see...what if you built your own corpse creation system? Replace all the pre-defined DROP_CORPSE flags with your own: ZOTH_DROP_CORPSE and then use a generic MONSTER_DEATH hook to check for it and create the appropriate corpse for any monster type.
NerdanelVampire: That sounds a good idea. Yes, it's been really vastly more fun making sure that drug messages are interesting than trying to figure out why tunneling still doesn't work even though I have the subsystem working without error messages, even though there isn't much of a good reason to do drugs (I intend to eventually have some evil god like drug use, but I don't have any gods yet...) and tunneling has long been a thorn in the side of playability. I still don't understand the T-Engine that well, but I guess I never will if I don't try something a bit harder.
ToME Wiki