how did you set that up to where it only gets called in immunity cases? and where in fight.c did you stick it? lol
It's been a while, and it was somewhat onerous. There are (were?) arrays for all the damage severity messages for each type (things like "decimates", "mutilates", "destroys" the victim) in const.c, so start there and see if you can follow how that works before tinkering with it.
What I basically changed was to add a damage type between "misses" and "barely scratches", for example, so you have misses/doesn't even scratch/barely scratches/etc.
From there, you have to somehow flag damages so you can purposely retrieve the "immunity" message vs. any other array position. If you look in the new_dam_message( ) I think you can find the section where it figures out which severity of damage message to pull from the array. There should be a comment to the effect of "get the damage index" and after that, "Lookup the damage message" in there somewhere. You can see the if/else-if logic for figuring out when to get the "miss" text and when to fetch some kind of hit. I think what I did was pass a special value to the damage message function, something like dam = -1, so that I could force it to pick out a specific immunity message (say, array position 1, whereas miss is array position 0).
Hopefully that helps? There's more to it, but that's probably too implementation specific and not likely to help you. But for the general idea of how to do this, that's where you want to start. It was a very messy thing but as I said, it was worth the hassle to finally work it out. There might be a better way too, but you'll have to start from the same place regardless, so hopefully this helps?