示例#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);
        }
示例#2
0
 BuffInstance(AbilityEffect originEffect, Buff buff, AbilityCaster caster, EventHandler target, AbilityData data)
 {
     OriginEffect = originEffect;
     Buff         = buff;
     Caster       = caster;
     Target       = target;
     Data         = data;
 }
示例#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);
        }
示例#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);
        }
示例#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;
 }
示例#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);
 }
示例#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;
        }