Пример #1
0
        public void TryToApplyDebuff(ICharacter target, DebuffResistance type, int applyChance)
        {
            var result = new BoolConsolidator();

            target.FireApplyingDebuffEvent(result);
            if (!result.Result())
            {
                return;
            }

            if (!target.Stats.TryToApplyDebuf(type, applyChance))
            {
                return;
            }

            IAffliction affl    = null;
            var         afflFac = Model.AfflictionFactory;

            switch (type)
            {
            case DebuffResistance.PSN:
                affl = afflFac.GetAffliction("Poison");
                target.AddAffliction("PSN");
                break;

            case DebuffResistance.PAR:
                affl = afflFac.GetAffliction("Paralyze");
                target.AddAffliction("PAR");
                break;

            case DebuffResistance.DTH:
                affl = afflFac.GetAffliction("InstaDeath");
                target.AddAffliction("DTH");
                break;

            case DebuffResistance.SIL:
                affl = afflFac.GetAffliction("Silence");
                target.AddAffliction("SIL");
                break;
            }

            if (affl == null)
            {
                return;
            }

            affl.AttachTo(target);
            _charAfflDictionary.GetOrCreate(target).Add(affl);
        }
Пример #2
0
        public double GetTotalStat(DebuffResistance stat)
        {
            var s = this[stat];

            return((s.Base() + s.ItemModifiers()) * s.BattleMod());
        }
Пример #3
0
 public SingleStat this[DebuffResistance stat]
 {
     get { return(_stats[stat.AsInt()]); }
     set { _stats[stat.AsInt()] = value; }
 }
Пример #4
0
        public bool TryToApplyDebuf(DebuffResistance type, int successChance)
        {
            var resistance = GetTotalStat(type) * 3;

            return(RHelper.RollPercentage((int)(successChance - resistance)));
        }
Пример #5
0
 public static double TotalStat(this ICharacter character, DebuffResistance stat)
 {
     return(character.Stats.GetTotalStat(stat));
 }
Пример #6
0
 protected void TryToApplyDebuff(DebuffResistance type, int applyChance)
 {
     TryToApplyDebuff(Target, type, applyChance);
 }
Пример #7
0
 protected void TryToApplyDebuff(ICharacter target, DebuffResistance type, int applyChance)
 {
     ScriptHelper.TryToApplyDebuff(target, type, applyChance);
 }
Пример #8
0
 public static int AsInt(this DebuffResistance stat)
 {
     return((int)stat);
 }