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 » Mon Nov 05, 2018 11:53 am

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: 285
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Forget about hit chance

Post by pango » Mon Nov 05, 2018 12:52 pm

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

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

Re: Forget about hit chance

Post by Hazelnut » 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.

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!");
        }

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

Re: Forget about hit chance

Post by Liebranca » Mon Nov 05, 2018 3:01 pm

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!

Post Reply