Иконка ресурса

Weakness Type FIX 2024-06-04

Нет прав для скачивания
  • Автор Автор Horyon
  • Дата создания Дата создания
Mobius based fix for weakness type.

Fixed issue:

If u have a bonus atk for some kind of mob lets say FAIRY. Dont matter if mob are fairy or not, he will have the weakness with value 0 add, so u will add the atk bonus VS 0 defence fairy.

Correct way: Fairy vs Fairy
Wrong: Fairy vs Undead

The fix dont add wrong weakness with 0 value to mobs, fixing mob receiving dmg from other race types weakness.

Ty for @Salty Mike and @Gaikotsu for assistence.

OBS: I forget put this also. Change this lines in Formulas.java
Java:
public static double calcWeaknessBonus(Creature attacker, Creature target, TraitType traitType)
    {
        double result = 1;
      
        for (TraitType trait : TraitType.getAllWeakness())
        {
            if (traitType == trait && target.getStat().hasDefenceTrait(trait) && attacker.getStat().hasAttackTrait(trait) && !target.getStat().isInvulnerableTrait(traitType))
            {
                result *= Math.max(attacker.getStat().getAttackTrait(trait) - target.getStat().getDefenceTrait(trait), 0.05);
                break;
            }
        }
      
        return result;
    }

Like for pass.
  • Мне нравится
Реакции: mamcy, Gigi и jocker23
Назад
Сверху Снизу