public void Deactivate(Unit unit) { if (Ability == UnitAbilities.Stimpack) { AbilityDeActivateService.DeactivateStimpack(this, unit); } else if (Ability == UnitAbilities.Suicide) { AbilityDeActivateService.DeactivateSuicide(this, unit); } else if (Ability == UnitAbilities.ConcussiveShellsModifier) { AbilityDeActivateService.DeactivateConcussiveShellsModifier(this, unit); } else if (Ability == UnitAbilities.PsionicTransfer) { AbilityDeActivateService.DeactivatePsionicTransfer(this, unit); } else if (Ability == UnitAbilities.GuardianShield) { AbilityDeActivateService.DeactivateGuardianShield(this, unit); } else if (Ability == UnitAbilities.GuardianShieldMitigation) { AbilityDeActivateService.DeactivateGuardianShieldMitigation(this, unit); } else if (Ability == UnitAbilities.GuardianShieldAttacModifier) { AbilityDeActivateService.DeactivateGuardianShieldAttacModifier(this, unit); } else if (Ability == UnitAbilities.LifeTime) { AbilityDeActivateService.DeactivateLifeTime(this, unit); } else if (Ability == UnitAbilities.Charge) { AbilityDeActivateService.DeactivateCharge(this, unit); } else if (Ability == UnitAbilities.SunderingImpact) { AbilityDeActivateService.DeactivateSunderingImpact(this, unit); } // remove if not in init unit this.Cooldown = AbilityPool.Abilities.SingleOrDefault(x => x.Ability == this.Ability).Cooldown; if (UnitPool.Units.SingleOrDefault(x => x.Name == unit.Name) != null && UnitPool.Units.SingleOrDefault(x => x.Name == unit.Name).Abilities.SingleOrDefault(y => y.Ability == this.Ability) == null) { unit.Abilities.Remove(this); } }
public void Activate(Unit unit, Unit vs, Battlefield battlefield, List <Unit> enemies, List <Unit> allies = null) { if (Ability == UnitAbilities.Stimpack) { AbilityDeActivateService.ActivateStimpack(this, unit, battlefield); } else if (Ability == UnitAbilities.Suicide) { AbilityDeActivateService.ActivateSuicide(this, unit); } else if (Ability == UnitAbilities.SuicideOnDeath) { AbilityDeActivateService.ActivateSuicideOnDeath(this, unit, battlefield, enemies); } else if (Ability == UnitAbilities.ConcussiveShells) { AbilityDeActivateService.ActivateConcussiveShells(unit); } else if (Ability == UnitAbilities.KD8Charge) { AbilityDeActivateService.ActivateKD8Charge(this, unit, vs, battlefield, enemies); } else if (Ability == UnitAbilities.KnockBack) { AbilityDeActivateService.ActivateKnockBack(this, unit, vs, battlefield, enemies); } else if (Ability == UnitAbilities.Blink) { AbilityDeActivateService.ActivateBlink(this, unit, vs, battlefield, enemies); } else if (Ability == UnitAbilities.PsionicTransfer) { AbilityDeActivateService.ActivatePsionicTransfer(this, unit, vs, battlefield, enemies); } else if (Ability == UnitAbilities.ResonatingGlaives) { AbilityDeActivateService.ActivateResonatingGlaives(this, unit, vs, battlefield, enemies); } else if (Ability == UnitAbilities.GuardianShield) { AbilityDeActivateService.ActivateGuardianShield(this, unit, vs, battlefield, enemies); } else if (Ability == UnitAbilities.GuardianShieldMitigation) { AbilityDeActivateService.ActivateGuardianShieldMitigation(this, unit, vs, battlefield, enemies); } else if (Ability == UnitAbilities.GuardianShieldAttacModifier) { AbilityDeActivateService.ActivateGuardianShieldAttacModifier(this, unit, vs, battlefield, enemies); } else if (Ability == UnitAbilities.Haluzination) { AbilityDeActivateService.ActivateHaluzination(this, unit, vs, battlefield, enemies); } else if (Ability == UnitAbilities.Transfusion) { AbilityDeActivateService.ActivateTransfusion(this, unit, vs, battlefield, enemies, allies); } else if (Ability == UnitAbilities.Charge) { AbilityDeActivateService.ActivateCharge(this, unit, vs, battlefield); } else if (Ability == UnitAbilities.SunderingImpact) { AbilityDeActivateService.ActivateSunderingImpact(this, unit, vs, battlefield); } // ?? this.Duration = AbilityPool.Abilities.SingleOrDefault(x => x.Ability == this.Ability).Duration; }