Ischaldirh wrote
Is there a way to specify if an *item* is resistant to a type of damage, without transferring that resistance to someone wearing the item?
Technically yes although it's going to start getting pretty complicated.
We'd need to change some code to allow items to calculate their own resistance when they take damage first - currently they don't reduce the damage they take by any means, because their "take damage" code doesn't check for resistance to certain damage types.
All they do currently with respect to damage types is check whether they
can be broken - only physical, sound, acid and energy damage can break an item.
(Of course there's also separate code for checking whether an item bursts into flames when it takes fire damage)
As for making sure the player doesn't inherit the resistance... hrmm that's going to be quite a bit more difficult because the GetTotalResistance() code for a humanoid character
always takes into account the armor or items the player is wearing on the bodypart that's taken the hit.
I'd have to have a think about it, currently the only thing jumping to mind is having some kind of unique flag or value in the script file that alerts the code that this items needs a fat boost to resistance against a given damage type when it gets hit, completely separate from its innate damage resistance.
Something like this:
helmet
{
CONFIG SOUNDPROOF
{
BitmapPos = 64, 64;
Possibility = 5;
MainMaterialConfig = { 7, STEEL, METEORIC_STEEL, DRAGON_HIDE, ARCANITE, MITHRIL, OCTIRON, ADAMANT; }
MaterialConfigChances = { 7, 100, 25, 25, 25, 25, 10, 5; }
HelmetBitmapPos = 112, 496;
Adjective = "soundproof";
SoundResistance = 0;
SelfishSoundResistance = 100;
}
}
Where the above "soundproof" helmet has 0 sound resistance that would be passed on to the player, but 100 for itself that would be taken into account when it gets hit by an enner beast scream.
i.e. The helmet
itself is soundproof...