Exemple #1
0
        public override void ApplyBase(IStatContainer stats, IEventContainer events)
        {
            events.GetEvent(EventInfo.Identifier).Event.OnExecute += Explode;

            _damageMult = stats.AddStat(ExplosionDamageFactorInfo, DamageFactorBase * Coeffecient);
            _range      = stats.AddStat(ExplosionRangeInfo, RangeBase);
        }
Exemple #2
0
 public override void RemoveStack(IStatContainer stats, IEventContainer events)
 {
     foreach (Element element in Stats)
     {
         stats.RemoveStatElement(element.Info.Identifier, element);
     }
 }
Exemple #3
0
 public override void ApplyStack(IStatContainer stats, IEventContainer events)
 {
     foreach (Element element in Stats)
     {
         stats.AddStatElement(element.Info.Identifier, new StatElement(element, element.Value * Coeffecient));
     }
 }
Exemple #4
0
        public override void RemoveEffect(IModdable target)
        {
            IStatContainer container = target as IStatContainer;
            Stat           stat      = container.GetStat(Identifier);

            switch (Type)
            {
            case StatType.Additive:
                stat.RemoveAdditive(this);
                break;

            case StatType.Multiplicative:
                stat.RemoveMultiplicative(this);
                break;
            }
        }
Exemple #5
0
        public override void ApplyEffect(IModdable target)
        {
            _target = target;
            IStatContainer container = target as IStatContainer;
            Stat           stat      = container.GetStat(Identifier);

            //TODO: Consider having StatType be a member of Stat instead of StatMod, then handling how to add the stat in Stat.
            switch (Type)
            {
            case StatType.Additive:
                stat.AddAdditive(Value.Get() * Coeffecient.Get(), this);
                break;

            case StatType.Multiplicative:
                stat.AddMultiplicative(Value.Get() * Coeffecient.Get(), this);
                break;
            }
        }
Exemple #6
0
 public abstract void RemoveStack(IStatContainer stats, IEventContainer events);
Exemple #7
0
 public abstract void ApplyStack(IStatContainer stats, IEventContainer events);
Exemple #8
0
 public override void RemoveStack(IStatContainer stats, IEventContainer events)
 {
     stats.RemoveStatElement(ExplosionDamageFactorInfo.Identifier, this);
     stats.RemoveStatElement(ExplosionRangeInfo.Identifier, this);
 }
Exemple #9
0
 public override void RemoveBase(IStatContainer stats, IEventContainer events)
 {
     events.GetEvent(EventInfo.Identifier).Event.OnExecute -= Explode;
 }
Exemple #10
0
 public override void ApplyStack(IStatContainer stats, IEventContainer events)
 {
     stats.AddStatElement(ExplosionDamageFactorInfo.Identifier, new StatElement(this, DamageFactorStack * Coeffecient));
     stats.AddStatElement(ExplosionRangeInfo.Identifier, new StatElement(this, RangeStack));
 }
Exemple #11
0
 public ModContainer(IStatContainer stats, IEventContainer events)
 {
     _stats  = stats;
     _events = events;
 }