public void ApplySelfTeleportEnablerEffect(TimeSpan duration) { var effect = EffectHandler.GetEffectsByType(EffectType.effect_teleport_self_enabler).FirstOrDefault(); if (effect != null) { EffectHandler.Remove(effect); } var builder = NewEffectBuilder().SetType(EffectType.effect_teleport_self_enabler).WithDuration(duration); ApplyEffect(builder); }
private void RefreshEffectBonus() { var siteInfo = GetIntrusionSiteInfo(); var currentEffect = EffectHandler.GetEffectsByCategory(EffectCategory.effcat_intrusion_effect).FirstOrDefault(); if (currentEffect != null) { var threshold = GetEffectBonusStabilityThreshold(currentEffect.Type); if (siteInfo.Stability < threshold) { EffectHandler.Remove(currentEffect); Logger.Info($"Intrusion outpost effect removed. outpost = {Eid} effecttype = {currentEffect.Type}"); } } var corporationEid = siteInfo.Owner ?? 0L; if (corporationEid == 0L) { return; } EffectHandler.RemoveEffectsByCategory(EffectCategory.effcat_intrusion_effect); if (siteInfo.ActiveEffect != EffectType.undefined) { var threshold = GetEffectBonusStabilityThreshold(siteInfo.ActiveEffect); if (siteInfo.Stability < threshold) { return; } var builder = NewEffectBuilder().SetType(siteInfo.ActiveEffect).SetOwnerToSource().WithCorporationEid(corporationEid); ApplyEffect(builder); } }