#Addition - Hit Chance Stat (Requested by Dolmek)

1 messages · Page 1 of 1 (latest)

cerulean blaze
#

CombatManager.cs

Line 1552 after EXECUTE_PROJECTILE_ABILITY_HIT function add:

        public bool CheckHitChance(CombatEntity caster)
        {
            if (!caster.IsPlayer()) return true;
            var rdmHitChance = Random.Range(0f, 100f);
            float hitChance = CombatUtilities.GetTotalOfStatType(caster, RPGStat.STAT_TYPE.HIT_CHANCE);
            if (float.IsNaN(hitChance))
            {
                return true;
            }
            if (rdmHitChance <= hitChance)
                return true;
            else
                return false;
        }

Line 1573 after if (targetEntity.IsDead() || targetEntity.IsImmune()) return; add:

            if (!CheckHitChance(casterInfo)) return;

Line 1644 after if (thornDamage == 0) return; add

            if (!CheckHitChance(casterInfo)) return;

Line 1785 after

                    if (!targetEntity.IsImmune())
                    {

add :

                        if (!CheckHitChance(casterInfo)) break;

RPGStat.cs

Line 154 -
Change line to this: (need new comma after Vitality_bonus

        VITALITY_BONUS,
        HIT_CHANCE
#

Addition - Hit Chance Stat (Requested by Dolmek)