Exemplo n.º 1
0
        public static BuffInstance ApplyBuff(AbilityEffect origin, Buff buff, AbilityCaster caster, EventHandler target, AbilityData data)
        {
            BuffInstance buffInst = new BuffInstance(origin, buff, caster, target, data);

            buffInst.Start();
            return(buffInst);
        }
Exemplo n.º 2
0
 BuffInstance(AbilityEffect originEffect, Buff buff, AbilityCaster caster, EventHandler target, AbilityData data)
 {
     OriginEffect = originEffect;
     Buff         = buff;
     Caster       = caster;
     Target       = target;
     Data         = data;
 }
Exemplo n.º 3
0
        public static AttackInstance Attack(AbilityEffect origin, AbilityCaster attacker, EventHandler target,
                                            float amount, DamageType type, AbilitySFXPool sfx)
        {
            AttackInstance atkInst = new AttackInstance(origin, attacker, target, amount, type, sfx);

            atkInst.Execute();
            return(atkInst);
        }
Exemplo n.º 4
0
        public static DamageInstance Damage(AbilityEffect origin, AbilityCaster dealer, EventHandler target,
                                            float amount, DamageType type, bool isCrit = false, bool isDefended = false)
        {
            DamageInstance dmgInst = new DamageInstance(origin, dealer, target,
                                                        amount, type, isCrit, isDefended);

            dmgInst.Deal();
            return(dmgInst);
        }
Exemplo n.º 5
0
 DamageInstance(AbilityEffect origin, AbilityCaster dealer, EventHandler target,
                float amount, DamageType type, bool isCrit, bool isDefended)
 {
     OriginEffect = origin;
     Dealer       = dealer;
     Target       = target;
     Amount       = amount;
     Type         = type;
     IsCrit       = isCrit;
     IsDefended   = isDefended;
 }
Exemplo n.º 6
0
 public void Apply(AbilityEffect origin, AbilityCaster caster, EventHandler target, AbilityData data)
 {
     if (!_doesStack)
     {
         BuffInstance existingBuff = target.Buffs.FirstOrDefault(
             (buffInst) => buffInst.Caster == caster && buffInst.Buff == this);
         if (existingBuff != null)
         {
             existingBuff.Remove();
         }
     }
     BuffInstance.ApplyBuff(origin, this, caster, target, data);
 }
Exemplo n.º 7
0
        AttackInstance(AbilityEffect origin, AbilityCaster attacker, EventHandler target,
                       float amount, DamageType type, AbilitySFXPool sfx)
        {
            OriginEffect = origin;
            Attacker     = attacker;
            Target       = target;
            Damage       = amount;
            Type         = type;
            SFX          = sfx;

            HitChance      = 1f;
            IsHit          = true;
            CritChance     = attacker.CritChance;
            CritMultiplier = attacker.CritMultiplier;
        }