Forget about hit chance

Discuss modding questions and implementation details.
Post Reply
User avatar
Liebranca
Posts: 2
Joined: Mon Nov 05, 2018 10:00 am

Forget about hit chance

Post by Liebranca »

Hey people,

I reckon the title says it all; I want to bypass dicerolls -- have hit chance default to 100% and call it a day
This means replacing the formula with a constant and either disposing of the 97% cap or turning it up to a hundred
Now, I happen to be a programmer but I don't think that's even necessary here. This is just tweaking values
So if anyone can tell me which files I want to be looking at, that'd be great

Cheers
What a fool you are, I'm a god! How can you kill a god? What a grand and intoxicating innocence!

User avatar
pango
Posts: 3347
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Forget about hit chance

Post by pango »

Hi Liebranca,
After some searching, my best bet would be
https://github.com/Interkarma/daggerfal ... er.cs#L757
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Forget about hit chance

Post by Hazelnut »

Yeah mods can override most of the combat formula, I added that for InconsolableCellist a while back as he plans to do a combat tuning mod.

I'm really not sure why you would want to remove hit chance completely however, since DF is an RPG and not a action combat game. Success of actions in RPGs should always be based on the character skill, with player making decisions about what actions to take. (e.g. retreat, but at a speed based on character stats) Anyway, you can make it work however you want and should be able to tune damage etc to compensate for 100% hit chances.

An example of overriding one of the formula can be found in the Archaeologists mod on my github.

Code: Select all

        // Override default formula
        FormulaHelper.formula_1pe_1sk.Add("CalculateEnemyPacification", CalculateEnemyPacification);

        private static bool CalculateEnemyPacification(PlayerEntity player, DFCareer.Skills languageSkill)
        {
               Debug.Log("Pacification override!");
        }
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Liebranca
Posts: 2
Joined: Mon Nov 05, 2018 10:00 am

Re: Forget about hit chance

Post by Liebranca »

Lovely, thank you both. I'll see what I come up with.
What a fool you are, I'm a god! How can you kill a god? What a grand and intoxicating innocence!

User avatar
mtrredux
Posts: 26
Joined: Sun Aug 19, 2018 11:40 am

Re: Forget about hit chance

Post by mtrredux »

Hazelnut wrote: Mon Nov 05, 2018 1:27 pm Yeah mods can override most of the combat formula, I added that for InconsolableCellist a while back as he plans to do a combat tuning mod.

I'm really not sure why you would want to remove hit chance completely however, since DF is an RPG and not a action combat game. Success of actions in RPGs should always be based on the character skill, with player making decisions about what actions to take. (e.g. retreat, but at a speed based on character stats) Anyway, you can make it work however you want and should be able to tune damage etc to compensate for 100% hit chances.
There was a mod for morrowind that gave 100% hit chance but made damage variable based on skill.

That would a mix between action and RPG RNG

Post Reply