public void SetAC(IIsVictim isVictim, IACAlterer acAlterer)
        {
            if (AC == 0)
            {
                Debug.LogError("AC was not set in Inspector");
            }

            acAlterer.AddACMod(isVictim, AC);
        }
Esempio n. 2
0
        public void SetAC(IIsVictim isVictim, IACAlterer acAlterer)
        {
            Equipment   equipment   = gameObject.GetComponent <Equipment>();
            ArmorObject armorObject = equipment.MyArmor;
            int         mod         = armorObject.BaseAC;

            IHasStats hasStats = gameObject.GetComponent <HasStats>();
            int       dexMod   = hasStats.GetStatMod(StatsType.Dexterity);

            if (armorObject.HasMaxDexMod && (dexMod > armorObject.MaxDexMod))
            {
                dexMod = armorObject.MaxDexMod;
            }

            mod += dexMod;

            acAlterer.AddACMod(isVictim, mod);
        }