Resistance by Type?

+
Resistance by Type?

The only vaguely code-y language I can comfortably understand is xml, so bear with me on this

I'm chipping away at this task of adding a new gear set (really just for my own fun, but I guess if you're curious message me*), and I'm wondering if there's a fairly digestible way of doing any of the following:

- Providing ranged combat buffs for a set of armor (specifically critical hit chance and/or critical hit damage); I'm also happy to attach these stats to the set's crossbow, but still I'll need some pointers for that, too, since the crossbow xml seems oddly stripped down and inflexible for my knowledge at least
- Providing type-specific resistance buffs for a set of armor that are more narrow than 'elemental' and 'rending' (like the basic set protects you better against beasts, enhanced against cursed, or whatever)

Bonus to ye who can guide me to a way of making Geralt more susceptible to bleeding effects while wearing this particular armor (it's super lightweight and agility-oriented so that might be a nice touch)

Thanks if you can, buds



*If whoever it is ends up spending a good chunk of resources on helping with this I'll of course be happy to publish it so you can share your efforts
 
Last edited:
For the ranged combat buff, the simplest thing would be to add critical hit chance and damage to the crossbow itself. Those stats will only take effect while the crossbow is being used, so in effect it is a ranged-only buff.

You can add critical_hit_chance and critical_hit_damage_bonus to the <ability> section of your crossbow, simply copy those lines from somewhere else, even a different xml, and adapt them to your needs.

If I understand your second idea, you want the armor to protect against specific/individual monster types. To accomplish that you'll be digging into a script called damageManagerProcessor.ws. There is a section that calculates your damage resistance %. Here, you will be helped by researching the 'protective coating' skill effect, which is very similar to what you want to happen. Crack open geralt_skills.xml and check out protective coating, look at its code name. It will be something like 'alchemy_15'. In the script, the name would be 'S_Alchemy_s15', and if you search for it you will find the location where the effect is implemented. You would need to adapt the implementation of 'protective coating' into your own idea: substituting a check for a custom tag on your chest slot armor, instead of the canuseskill check. The custom tag is something you can create in the <tags> section where you created your armor in the xml. If you want each piece to contribute to this species-specific protection, you would check each armor slot for your tag, or try to implement an automatic count by mimicking the set bonus system. But this is getting a little complex - I think it's doable but would take a minute to iron out.

Bleeding vulnerability might be as simple as giving the armor a value like "-0.5" for bleeding resistance, a negative value.
 
Do you think it's possible to give those ranged buffs to the armor? The idea is hopefully to encourage more ranged combat at every level; to make the critical effects viable in the current system, with the knowledge I have, I'd have to either remove the crossbow leveling, which would interfere with using every other crossbow, or set the new crossbow's attack power multiplier to something that keeps you from using it until later than I'm hoping to allow. (Or maybe force the level just for this crossbow? I don't know how to do this properly, but maybe add to the end of gameParams something like if (item is this new crossbow) level = 3? Or something?)

[Aside, wow I hadn't looked at the crossbow xml in a few weeks and forgot that critical effects were already standard stuff. ooOOOps]
 
Last edited:
It's entirely possible to make the armor increase ranged damage, but it might be difficult to display that information in-game. The method that comes to mind is having a tag on the armor that you check for in the damage formula where damage bonuses and tallied up. Something like if(rangedattack && playerattacker && itemhastag(getiteminslot(ees_chest), 'customTag')) then increase the damage bonus by 1.0 (100% bonus to base damage). I think something like that could work, but it wouldn't be displayed as a stat on your gear. You will be needing to make custom strings for this project, so maybe you can can substitute the basic 'armor' description for something unique that relays the information about the ranges danage buff. Look to Aerondight or other unique swords with their own description to see how to do that.

As for an alternate item level for your crossbow, I think you can definitely do that. At the bottom of gameParams I think, turn the crossbow item section into an if/else: use 'if' to check for your crossbow tag and assign it whatever item level you want, then 'else' runs the default checks for attack power.

 
Top Bottom