Interkarma / daggerfall-unity

Open source recreation of Daggerfall in the Unity engine
http://www.dfworkshop.net
MIT License
2.65k stars 326 forks source link

Breton's magicka resist does not show in history. #2660

Open fartingporkchop opened 1 month ago

fartingporkchop commented 1 month ago

Describe the issue

Creating a character, Breton's magic resistance does not show in class history summary. A Nord's frost resistance, and High Elf's immune to paralysis does show when checking history. Bretons might not have magic resistance like they should?

To Reproduce Create a Breton character fully, then check in-game. Magic resistance does not show. Create a Nord character fully, then check in-game. Frost resistance shows in history. Same with High Elf, Paralysis immunity shows in history.

Save file doesn't show magic resistance either as a flag, which it does for Nords and High Elves abilities. Is the Breton's resistance hard coded elsewhere or not active?

Expected behavior

Breton's magic resistance should behave like the Nord's and High Elf's resistance. Otherwise, it should be like in DosBox where these resistances do not show up in the history for all races.

Screenshots and Logs

n/a

Desktop (please complete the following information):

Additional context

No mods.

KABoissonneault commented 1 month ago

Seems like the Racial part was added by @numidium in https://github.com/Interkarma/daggerfall-unity/commit/42eed869702b8277cade12488780873ec6ece3cd

From the message, the intent was to show the racial bonuses from vampirism and lycanthropy, but it seems the Nord and High Elf data also have these flags, and it gets picked up by this code.

Because the race flags are not used by FormulaHelper.SavingThrow, I'm tempted to just remove the elemental resistance lines entirely. It's not useful info with the base game data. The Racial Special Ability lines can be kept, since those are actually relevant to vampirism/lycanthropy

We could potentially make FormulaHelper.SavingThrow use the flags, except that won't cover the Breton, which does not have the flag in the DF data.

image

numidium commented 1 week ago

From the message, the intent was to show the racial bonuses from vampirism and lycanthropy...

Sorry, I could have worded that better. If I remember correctly, at the time I wanted to cover all the racial bonuses and I put the text there to say that it includes vampirism/lycanthropy in addition to all the base races.

I'm noticing that ResistanceFlags isn't used anywhere mechanically. In fact, the only race that has its ResistanceFlags set in RaceTemplate.cs is Nord (Frost). Bretons don't have ResistanceFlags set in RaceTemplate.

I noticed that the Nord frost resistance and Breton magic resistances are applied directly in FormulaHelper.cs at line 1512. We could refactor this to check for racial resistance flags instead of checking against the player's race directly like it currently does.

In that case, we would have to add a line to RaceTemplate.cs to set the resistance flag for Magic for Bretons. Then in FormulaHelper we simply check against all the resistance flags.

numidium commented 1 week ago

I've been thinking... my PR makes it so that FormulaHelper reads from the RaceTemplate. However, the resistances have only ever been applied to the player from what I can see. Do we want them applied to Breton and Nord enemies, too?

KABoissonneault commented 1 week ago

I don't think it should be done for enemies, that goes into mod territory. Without mods, all enemies look too generic to tell by glance what race they are (I know in practice, it would be "always Breton in High Rock, always Redguard in Hammerfell"). For the most part, they are raceless. Do you know of any other feature that changes based on class enemy race? Maybe the hurt groans, but I can't even remember how to re-enable that feature.

In my opinion, leave it to combat mods running separate graphics per enemy race. It's easy for them to do.

numidium commented 1 week ago

Do you know of any other feature that changes based on class enemy race? Maybe the hurt groans,

Yeah, now that I've examined the code, it seems that humanoid enemy NPCs are actually raceless. They just have a random race chosen for pain sounds in EnemySounds. Scratch that.