diff --git a/Content.Client/ADT/Chaplain/EUI/AcceptReligionEui.cs b/Content.Client/ADT/Chaplain/EUI/AcceptReligionEui.cs index 42d974fba95..568996afbab 100644 --- a/Content.Client/ADT/Chaplain/EUI/AcceptReligionEui.cs +++ b/Content.Client/ADT/Chaplain/EUI/AcceptReligionEui.cs @@ -3,7 +3,7 @@ using JetBrains.Annotations; using Robust.Client.Graphics; using Content.Shared.Chaplain; -using Content.Shared.Bible.Components; +using Content.Shared.ADT.Chaplain.Components; namespace Content.Client.Chaplain; diff --git a/Content.Client/ADT/Chaplain/Systems/ChaplainSystem.cs b/Content.Client/ADT/Chaplain/Systems/ChaplainSystem.cs index aa766aa1778..7db971bc5c2 100644 --- a/Content.Client/ADT/Chaplain/Systems/ChaplainSystem.cs +++ b/Content.Client/ADT/Chaplain/Systems/ChaplainSystem.cs @@ -1,4 +1,4 @@ -using Content.Shared.Bible.Components; +using Content.Shared.ADT.Chaplain.Components; using Content.Shared.ADT.Phantom.Components; using Robust.Client.GameObjects; using Robust.Client.Player; diff --git a/Content.Client/ADT/Phantom/Systems/PhantomHudSystem.cs b/Content.Client/ADT/Phantom/Systems/PhantomHudSystem.cs index 24144285162..7e89f6ef2bb 100644 --- a/Content.Client/ADT/Phantom/Systems/PhantomHudSystem.cs +++ b/Content.Client/ADT/Phantom/Systems/PhantomHudSystem.cs @@ -6,7 +6,7 @@ using Content.Client.Overlays; using Content.Shared.Antag; using Robust.Client.Player; -using Content.Shared.Bible.Components; +using Content.Shared.ADT.Chaplain.Components; namespace Content.Client.ADT.Phantom; public sealed class ShowHauntedIconsSystem : EquipmentHudSystem diff --git a/Content.Server/ADT/Chaplain/EUI/AcceptReligionEui.cs b/Content.Server/ADT/Chaplain/EUI/AcceptReligionEui.cs index 91aef1dbe45..dafd27a0675 100644 --- a/Content.Server/ADT/Chaplain/EUI/AcceptReligionEui.cs +++ b/Content.Server/ADT/Chaplain/EUI/AcceptReligionEui.cs @@ -1,7 +1,7 @@ using Content.Server.EUI; using Content.Shared.Chaplain; using Content.Shared.Eui; -using Content.Shared.Bible.Components; +using Content.Shared.ADT.Chaplain.Components; using Content.Server.Bible; namespace Content.Server.Chaplain; diff --git a/Content.Server/ADT/Chaplain/Systems/ChaplainSystem.cs b/Content.Server/ADT/Chaplain/Systems/ChaplainSystem.cs index 55b06cd7e6f..7c54537615a 100644 --- a/Content.Server/ADT/Chaplain/Systems/ChaplainSystem.cs +++ b/Content.Server/ADT/Chaplain/Systems/ChaplainSystem.cs @@ -1,7 +1,7 @@ using Content.Server.Popups; using Content.Shared.ActionBlocker; using Content.Shared.Actions; -using Content.Shared.Bible.Components; +using Content.Shared.ADT.Chaplain.Components; using Content.Shared.Damage; using Content.Shared.IdentityManagement; using Content.Shared.Inventory; diff --git a/Content.Server/ADT/Chaplain/Systems/HolyMelonImmunitySystem.cs b/Content.Server/ADT/Chaplain/Systems/HolyMelonImmunitySystem.cs new file mode 100644 index 00000000000..ced0d53ea5e --- /dev/null +++ b/Content.Server/ADT/Chaplain/Systems/HolyMelonImmunitySystem.cs @@ -0,0 +1,77 @@ +using Content.Shared.ADT.Chaplain.Components; +using Content.Shared.Hands; +using Content.Shared.Hands.Components; +using Content.Shared.Hands.EntitySystems; +using Robust.Shared.GameObjects; + +namespace Content.Server.ADT.Chaplain.Systems; + +/// +/// Система отслеживает предметы с в руках игроков +/// и выдаёт им временный компонент для иммунитета к магии. +/// Иммунитет работает только пока предмет находится в руке. +/// +public sealed class HolyMelonImmunitySystem : EntitySystem +{ + [Dependency] private readonly SharedHandsSystem _hands = default!; + + public override void Initialize() + { + base.Initialize(); + + // Подписываемся на события экипировки/снятия арбуза + SubscribeLocalEvent(OnGotEquippedHand); + SubscribeLocalEvent(OnGotUnequippedHand); + } + + private void OnGotEquippedHand(EntityUid uid, HolyMelonImmunityComponent component, GotEquippedHandEvent args) + { + // НЕ добавляем иммунитет священникам — у них он уже есть врождённый + if (HasComp(args.User)) + return; + + // Добавляем временный маркер иммунитета от арбуза + EnsureComp(args.User); + + // Основной компонент иммунитета (если ещё не добавлен) + EnsureComp(args.User); + } + + private void OnGotUnequippedHand(EntityUid uid, HolyMelonImmunityComponent component, GotUnequippedHandEvent args) + { + // НЕ снимаем иммунитет у священников — у них он врождённый + if (HasComp(args.User)) + return; + + RemoveImmunityIfNoOtherMelons(args.User, uid); + } + + private void RemoveImmunityIfNoOtherMelons(EntityUid holder, EntityUid? excludeItem = null) + { + if (!HasComp(holder)) + return; + + if (!TryComp(holder, out var hands)) + return; + + foreach (var hand in _hands.EnumerateHeld((holder, hands))) + { + // Исключаем предмет, который снимается + if (excludeItem.HasValue && hand == excludeItem.Value) + continue; + + if (HasComp(hand)) + return; + } + + // Нет других арбузов в руках - удаляем временный маркер + RemComp(holder); + + // Удаляем основной компонент иммунитета, только если нет других источников + // (священник имеет ChaplainComponent, который не удаляется) + if (!HasComp(holder)) + { + RemComp(holder); + } + } +} diff --git a/Content.Server/ADT/Chaplain/Systems/MagicProjectileSystem.cs b/Content.Server/ADT/Chaplain/Systems/MagicProjectileSystem.cs new file mode 100644 index 00000000000..44cf77b418c --- /dev/null +++ b/Content.Server/ADT/Chaplain/Systems/MagicProjectileSystem.cs @@ -0,0 +1,32 @@ +using Content.Shared.ADT.Chaplain.Components; +using Robust.Shared.GameObjects; +using Robust.Shared.Physics.Events; + +namespace Content.Server.ADT.Chaplain.Systems; + +/// +/// Система для магических снарядов. Проверяет иммунитет к магии у цели при попадании. +/// Если цель имеет иммунитет, снаряд поглощается без эффекта. +/// +public sealed class MagicProjectileSystem : EntitySystem +{ + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnMagicProjectileStartCollide); + } + + private void OnMagicProjectileStartCollide(EntityUid uid, MagicProjectileComponent component, ref StartCollideEvent args) + { + if (!HasComp(args.OtherEntity)) + return; + + // Цель имеет иммунитет - отменяем столкновение + // Note: StartCollideEvent - readonly struct, не имеет Cancelled + // Просто удаляем снаряд, чтобы он не обрабатывался дальше + + // Удаляем снаряд + QueueDel(uid); + } +} diff --git a/Content.Server/ADT/HWAnomCoreLootbox/HWAnomCoreLootboxSystem.cs b/Content.Server/ADT/HWAnomCoreLootbox/HWAnomCoreLootboxSystem.cs index ead4530781f..eac60d40297 100644 --- a/Content.Server/ADT/HWAnomCoreLootbox/HWAnomCoreLootboxSystem.cs +++ b/Content.Server/ADT/HWAnomCoreLootbox/HWAnomCoreLootboxSystem.cs @@ -4,7 +4,7 @@ using Content.Server.Popups; using Content.Shared.Body.Systems; using Content.Shared.Body.Part; -using Content.Shared.Bible.Components; +using Content.Shared.ADT.Chaplain.Components; using Content.Shared.DoAfter; using Content.Shared.Cargo; using Content.Shared.Database; diff --git a/Content.Server/ADT/Heretic/Abilities/HereticAbilitySystem.Ash.cs b/Content.Server/ADT/Heretic/Abilities/HereticAbilitySystem.Ash.cs index 2d98d770440..4642618bbd8 100644 --- a/Content.Server/ADT/Heretic/Abilities/HereticAbilitySystem.Ash.cs +++ b/Content.Server/ADT/Heretic/Abilities/HereticAbilitySystem.Ash.cs @@ -2,6 +2,7 @@ using System.Threading.Tasks; using Content.Server.Atmos.Components; using Content.Server.Body.Components; +using Content.Shared.ADT.Chaplain.Components; using Content.Shared.Atmos.Components; using Content.Shared.Damage; using Content.Shared.Damage.Components; @@ -100,7 +101,8 @@ private void OnNWRebirth(Entity ent, ref EventHereticNightwatc continue; if ((TryComp(look, out var th) && th.CurrentPath == ent.Comp.CurrentPath) - || HasComp(look)) + || HasComp(look) + || HasComp(look)) continue; if (TryComp(look, out var flam)) diff --git a/Content.Server/ADT/Heretic/Abilities/HereticAbilitySystem.Void.cs b/Content.Server/ADT/Heretic/Abilities/HereticAbilitySystem.Void.cs index 772f0558f25..8ad64e0dcb3 100644 --- a/Content.Server/ADT/Heretic/Abilities/HereticAbilitySystem.Void.cs +++ b/Content.Server/ADT/Heretic/Abilities/HereticAbilitySystem.Void.cs @@ -4,7 +4,7 @@ using Content.Server.Magic; using Content.Server.Temperature.Components; using Content.Shared.ADT.Heretic.Components; -using Content.Shared.Bible.Components; +using Content.Shared.ADT.Chaplain.Components; using Content.Shared.Damage; using Content.Shared.Damage.Components; using Content.Shared.Damage.Prototypes; @@ -77,10 +77,9 @@ private void OnVoidBlink(Entity ent, ref HereticVoidBlinkEvent _aud.PlayPvs(new SoundPathSpecifier("/Audio/Effects/tesla_consume.ogg"), ent); foreach (var pookie in GetNearbyPeople(ent, power)) - if (!HasComp(pookie)) - { - _stun.TryKnockdown(pookie, TimeSpan.FromSeconds(power), true); - } + { + _stun.TryKnockdown(pookie, TimeSpan.FromSeconds(power), true); + } _transform.SetCoordinates(ent, args.Target); @@ -89,11 +88,8 @@ private void OnVoidBlink(Entity ent, ref HereticVoidBlinkEvent foreach (var pookie in GetNearbyPeople(ent, ent.Comp.PathStage / 3f)) { - if (!HasComp(pookie)) - { - _stam.TakeStaminaDamage(pookie, power); - if (condition) _voidcurse.DoCurse(pookie); - } + _stam.TakeStaminaDamage(pookie, power); + if (condition) _voidcurse.DoCurse(pookie); } args.Handled = true; @@ -113,7 +109,7 @@ private void OnVoidPull(Entity ent, ref HereticVoidPullEvent a // damage closest ones foreach (var pookie in topPriority) { - if (!TryComp(pookie, out var dmgComp) || HasComp(pookie)) + if (!TryComp(pookie, out var dmgComp)) continue; // total damage + power divided by all damage types. diff --git a/Content.Server/ADT/Heretic/Abilities/HereticAbilitySystem.cs b/Content.Server/ADT/Heretic/Abilities/HereticAbilitySystem.cs index 8d76a18bf03..f48168d87d1 100644 --- a/Content.Server/ADT/Heretic/Abilities/HereticAbilitySystem.cs +++ b/Content.Server/ADT/Heretic/Abilities/HereticAbilitySystem.cs @@ -12,6 +12,7 @@ using Content.Server.Station.Systems; using Content.Server.Store.Systems; using Content.Server.Temperature.Systems; +using Content.Shared.ADT.Chaplain.Components; using Content.Shared.Actions; using Content.Shared.Body.Systems; using Content.Shared.Chat; @@ -88,7 +89,8 @@ private List GetNearbyPeople(Entity ent, float rang { // ignore heretics with the same path*, affect everyone else if ((TryComp(look, out var th) && th.CurrentPath == ent.Comp.CurrentPath) - || HasComp(look)) + || HasComp(look) + || HasComp(look)) continue; if (!HasComp(look)) diff --git a/Content.Server/ADT/Heretic/EntitySystems/MansusGraspSystem.cs b/Content.Server/ADT/Heretic/EntitySystems/MansusGraspSystem.cs index c4f7da71276..01c584cd992 100644 --- a/Content.Server/ADT/Heretic/EntitySystems/MansusGraspSystem.cs +++ b/Content.Server/ADT/Heretic/EntitySystems/MansusGraspSystem.cs @@ -7,7 +7,7 @@ using Content.Server.Temperature.Components; using Content.Server.Temperature.Systems; using Content.Shared.ADT.Heretic.Components; -using Content.Shared.Bible.Components; +using Content.Shared.ADT.Chaplain.Components; using Content.Shared.Actions; using Content.Shared.Damage; using Content.Shared.Damage.Systems; @@ -88,7 +88,7 @@ private void OnAfterInteract(Entity ent, ref AfterInteract if ((TryComp(args.Target, out var th) && th.CurrentPath == ent.Comp.Path)) return; - if (HasComp(target) && !HasComp(target)) + if (HasComp(target) && !HasComp(target)) { _chat.TrySendInGameICMessage(args.User, Loc.GetString("heretic-speech-mansusgrasp"), InGameICChatType.Speak, false); _audio.PlayPvs(new SoundPathSpecifier("/Audio/Items/welder.ogg"), target); @@ -101,10 +101,10 @@ private void OnAfterInteract(Entity ent, ref AfterInteract // upgraded grasp if (hereticComp.CurrentPath != null) { - if (hereticComp.PathStage >= 2 && !HasComp(target)) + if (hereticComp.PathStage >= 2 && !HasComp(target)) ApplyGraspEffect(args.User, target, hereticComp.CurrentPath!); - if (hereticComp.PathStage >= 4 && HasComp(target) && !HasComp(target)) + if (hereticComp.PathStage >= 4 && HasComp(target) && !HasComp(target)) { var markComp = EnsureComp(target); markComp.Path = hereticComp.CurrentPath; @@ -263,7 +263,7 @@ private void OnInfusedInteract(Entity ent, ref InteractH if (HasComp(target)) { - if (!HasComp(target)) + if (!HasComp(target)) { _audio.PlayPvs(new SoundPathSpecifier("/Audio/Items/welder.ogg"), target); _stun.TryKnockdown(target, TimeSpan.FromSeconds(3f), true); diff --git a/Content.Server/ADT/Magic/ChainFireballSystem.cs b/Content.Server/ADT/Magic/ChainFireballSystem.cs index 5909b28a94e..f2446d1f0dc 100644 --- a/Content.Server/ADT/Magic/ChainFireballSystem.cs +++ b/Content.Server/ADT/Magic/ChainFireballSystem.cs @@ -1,4 +1,5 @@ using Content.Server.Popups; +using Content.Shared.ADT.Chaplain.Components; using Content.Shared.Projectiles; using Content.Shared.StatusEffect; using Content.Shared.Weapons.Ranged.Systems; @@ -30,6 +31,12 @@ private void OnHit(Entity ent, ref ProjectileHitEvent ar if (_random.Prob(ent.Comp.DisappearChance)) return; + if (HasComp(args.Target)) + { + QueueDel(ent); + return; + } + // spawn new fireball on target Spawn(args.Target, ent.Comp.IgnoredTargets); @@ -44,7 +51,8 @@ public bool Spawn(EntityUid source, List ignoredTargets) foreach (var look in lookup) { if (ignoredTargets.Contains(look) - || !HasComp(look)) // ignore non mobs + || !HasComp(look) // ignore non mobs + || HasComp(look)) // иммун к магии continue; mobs.Add(look); diff --git a/Content.Server/ADT/Magic/ImmovableVoidRodSystem.cs b/Content.Server/ADT/Magic/ImmovableVoidRodSystem.cs index 44ebd6c06fe..89475fb9292 100644 --- a/Content.Server/ADT/Magic/ImmovableVoidRodSystem.cs +++ b/Content.Server/ADT/Magic/ImmovableVoidRodSystem.cs @@ -1,5 +1,5 @@ using Content.Server.Heretic.Components; -using Content.Shared.Bible.Components; +using Content.Shared.ADT.Chaplain.Components; using Content.Shared.Heretic; using Content.Shared.Maps; using Content.Shared.Stunnable; @@ -54,7 +54,8 @@ public override void Initialize() private void OnCollide(Entity ent, ref StartCollideEvent args) { if ((TryComp(args.OtherEntity, out var th) && th.CurrentPath == "Void") - || HasComp(args.OtherEntity) || HasComp(args.OtherEntity)) + || HasComp(args.OtherEntity) + || HasComp(args.OtherEntity)) return; var power = 1f; diff --git a/Content.Server/ADT/Phantom/EntitySystems/PhantomSystem.cs b/Content.Server/ADT/Phantom/EntitySystems/PhantomSystem.cs index 5b79f51d05f..0291e072660 100644 --- a/Content.Server/ADT/Phantom/EntitySystems/PhantomSystem.cs +++ b/Content.Server/ADT/Phantom/EntitySystems/PhantomSystem.cs @@ -21,7 +21,7 @@ using Content.Shared.ADT.Phantom.Components; using Content.Shared.ADT.Silicon.Components; using Content.Shared.Alert; -using Content.Shared.Bible.Components; +using Content.Shared.ADT.Chaplain.Components; using Content.Shared.Chat; using Content.Shared.CombatMode; using Content.Shared.Cuffs.Components; @@ -2635,4 +2635,4 @@ public void Blessing(EntityUid uid, PhantomComponent component) } } #endregion -} \ No newline at end of file +} diff --git a/Content.Server/ADT/Poltergeist/Systems/PoltergeistSystem.cs b/Content.Server/ADT/Poltergeist/Systems/PoltergeistSystem.cs index 739e4ee95aa..80aa20f3e55 100644 --- a/Content.Server/ADT/Poltergeist/Systems/PoltergeistSystem.cs +++ b/Content.Server/ADT/Poltergeist/Systems/PoltergeistSystem.cs @@ -7,7 +7,7 @@ using Content.Shared.ADT.GhostInteractions; using Content.Shared.ADT.Poltergeist; using Content.Shared.ADT.Silicon.Components; -using Content.Shared.Bible.Components; +using Content.Shared.ADT.Chaplain.Components; using Content.Shared.Chat; using Content.Shared.IdentityManagement; using Content.Shared.Item; diff --git a/Content.Server/ADT/Revolitionary/EUI/AcceptRevolutionEui.cs b/Content.Server/ADT/Revolitionary/EUI/AcceptRevolutionEui.cs index 8baecebfbfe..eeac9ad3d80 100644 --- a/Content.Server/ADT/Revolitionary/EUI/AcceptRevolutionEui.cs +++ b/Content.Server/ADT/Revolitionary/EUI/AcceptRevolutionEui.cs @@ -1,7 +1,6 @@ using Content.Server.EUI; using Content.Shared.Revolutionary; using Content.Shared.Eui; -using Content.Shared.Bible.Components; using Content.Server.Bible; using Content.Shared.Revolutionary.Components; using Content.Server.GameTicking.Rules; diff --git a/Content.Server/Bible/BibleSystem.cs b/Content.Server/Bible/BibleSystem.cs index 5caeb50d852..d6dbcf46637 100644 --- a/Content.Server/Bible/BibleSystem.cs +++ b/Content.Server/Bible/BibleSystem.cs @@ -3,9 +3,8 @@ using Content.Server.Popups; using Content.Shared.ActionBlocker; using Content.Shared.Actions; -using Content.Shared.Bible; +using Content.Shared.ADT.Chaplain.Components; using Content.Shared.Damage.Systems; -using Content.Shared.Bible.Components; using Content.Shared.Damage; using Content.Shared.Ghost.Roles.Components; using Content.Shared.IdentityManagement; diff --git a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs index 08c897e9580..31f7e2c77b9 100644 --- a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs +++ b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs @@ -1,3 +1,4 @@ +using Content.Shared.ADT.Chaplain.Components; using Content.Shared.Popups; using Content.Shared.Damage; using Content.Shared.Revenant; @@ -104,7 +105,10 @@ private void OnInteract(EntityUid uid, RevenantComponent component, UserActivate return; } - if (!HasComp(target) || !HasComp(target) || HasComp(target)) + if (!HasComp(target) + || !HasComp(target) + || HasComp(target) + || HasComp(target)) // ADT-Tweak return; args.Handled = true; @@ -282,9 +286,15 @@ private void OnDefileAction(EntityUid uid, RevenantComponent component, Revenant var entityStorage = GetEntityQuery(); var items = GetEntityQuery(); var lights = GetEntityQuery(); + var magicImmunity = GetEntityQuery(); // ADT-Tweak foreach (var ent in lookup) { + // ADT-Tweak start + if (magicImmunity.HasComponent(ent)) + continue; + // ADT-Tweak end + //break windows if (tags.HasComponent(ent) && _tag.HasTag(ent, WindowTag)) { @@ -331,11 +341,12 @@ private void OnOverloadLightsAction(EntityUid uid, RevenantComponent component, var xform = Transform(uid); var poweredLights = GetEntityQuery(); var mobState = GetEntityQuery(); + var magicImmunity = GetEntityQuery(); // ADT-Tweak var lookup = _lookup.GetEntitiesInRange(uid, component.OverloadRadius); //TODO: feels like this might be a sin and a half foreach (var ent in lookup) { - if (!mobState.HasComponent(ent) || !_mobState.IsAlive(ent)) + if (!mobState.HasComponent(ent) || !_mobState.IsAlive(ent) || magicImmunity.HasComponent(ent)) // ADT-Tweak continue; var nearbyLights = _lookup.GetEntitiesInRange(ent, component.OverloadZapRadius) @@ -400,6 +411,11 @@ private void OnHysteriaAction(EntityUid uid, RevenantComponent component, Revena foreach (var ent in _lookup.GetEntitiesInRange(uid, component.HysteriaRadius)) { + // ADT-Tweak start + if (HasComp(ent)) + continue; + // ADT-Tweak end + _status.TryAddStatusEffect(ent, TemporaryBlindnessSystem.BlindingStatusEffect, TimeSpan.FromSeconds(3), true); _hallucinations.StartHallucinations(ent, "ADTHallucinations", component.HysteriaDuration, true, component.HysteriaProto); if (!_mind.TryGetMind(ent, out var mindId, out var mind) || !_player.TryGetSessionById(mind.UserId, out var session)) diff --git a/Content.Shared/ADT/Chaplain/Altar/Systems/SacrificeSystem.cs b/Content.Shared/ADT/Chaplain/Altar/Systems/SacrificeSystem.cs index c8ec7646cc4..6efbf15f451 100644 --- a/Content.Shared/ADT/Chaplain/Altar/Systems/SacrificeSystem.cs +++ b/Content.Shared/ADT/Chaplain/Altar/Systems/SacrificeSystem.cs @@ -1,5 +1,5 @@ /// Updated Sacrifice System with guaranteed priority handling -using Content.Shared.Bible.Components; +using Content.Shared.ADT.Chaplain.Components; using Content.Shared.Coordinates.Helpers; using Content.Shared.Interaction; using Content.Shared.Storage; @@ -230,4 +230,4 @@ public SacrificeOption(TransformationData transformation, int times) Times = times; } } -} \ No newline at end of file +} diff --git a/Content.Shared/ADT/Chaplain/Components/ChaplainComponent.cs b/Content.Shared/ADT/Chaplain/Components/ChaplainComponent.cs index 263c01de4b8..07cff51a151 100644 --- a/Content.Shared/ADT/Chaplain/Components/ChaplainComponent.cs +++ b/Content.Shared/ADT/Chaplain/Components/ChaplainComponent.cs @@ -6,7 +6,7 @@ using Content.Shared.Alert; using Robust.Shared.GameStates; // ADT QWERTY's altar update -namespace Content.Shared.Bible.Components; +namespace Content.Shared.ADT.Chaplain.Components; [RegisterComponent, NetworkedComponent] diff --git a/Content.Shared/ADT/Chaplain/Components/HolyMelonImmunityComponent.cs b/Content.Shared/ADT/Chaplain/Components/HolyMelonImmunityComponent.cs new file mode 100644 index 00000000000..933b8179125 --- /dev/null +++ b/Content.Shared/ADT/Chaplain/Components/HolyMelonImmunityComponent.cs @@ -0,0 +1,12 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.ADT.Chaplain.Components; + +/// +/// Компонент для предметов (например, святой арбуз), которые дают иммунитет к магии, +/// когда находятся в руке владельца. +/// +[RegisterComponent, NetworkedComponent] +public sealed partial class HolyMelonImmunityComponent : Component +{ +} diff --git a/Content.Shared/ADT/Chaplain/Components/HolyMelonMagicImmunityComponent.cs b/Content.Shared/ADT/Chaplain/Components/HolyMelonMagicImmunityComponent.cs new file mode 100644 index 00000000000..fb06485ea77 --- /dev/null +++ b/Content.Shared/ADT/Chaplain/Components/HolyMelonMagicImmunityComponent.cs @@ -0,0 +1,12 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.ADT.Chaplain.Components; + +/// +/// Временный маркер иммунитета к магии от святого арбуза. +/// Удаляется при выпуске арбуза из руки. +/// +[RegisterComponent, NetworkedComponent] +public sealed partial class HolyMelonMagicImmunityComponent : Component +{ +} diff --git a/Content.Shared/ADT/Chaplain/Components/MagicImmunityComponent.cs b/Content.Shared/ADT/Chaplain/Components/MagicImmunityComponent.cs new file mode 100644 index 00000000000..1232e20893e --- /dev/null +++ b/Content.Shared/ADT/Chaplain/Components/MagicImmunityComponent.cs @@ -0,0 +1,13 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.ADT.Chaplain.Components; + +/// +/// Компонент, предоставляющий иммунитет к магии. +/// Существа с этим компонентом не могут быть выбраны в качестве цели магических способностей +/// и невосприимчивы к эффектам магии (еретик, ревенант и т.д.). +/// +[RegisterComponent, NetworkedComponent] +public sealed partial class MagicImmunityComponent : Component +{ +} diff --git a/Content.Shared/ADT/Chaplain/Components/MagicProjectileComponent.cs b/Content.Shared/ADT/Chaplain/Components/MagicProjectileComponent.cs new file mode 100644 index 00000000000..f12041c388c --- /dev/null +++ b/Content.Shared/ADT/Chaplain/Components/MagicProjectileComponent.cs @@ -0,0 +1,12 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.ADT.Chaplain.Components; + +/// +/// Компонент для магических снарядов, которые должны проверять иммунитет к магии при попадании. +/// Если цель имеет иммунитет к магии, снаряд поглощается без эффекта. +/// +[RegisterComponent, NetworkedComponent] +public sealed partial class MagicProjectileComponent : Component +{ +} diff --git a/Content.Shared/ADT/Chaplain/SharedChaplain.cs b/Content.Shared/ADT/Chaplain/SharedChaplain.cs index 95f9a1279b2..f4aaee490aa 100644 --- a/Content.Shared/ADT/Chaplain/SharedChaplain.cs +++ b/Content.Shared/ADT/Chaplain/SharedChaplain.cs @@ -2,7 +2,7 @@ using Content.Shared.DoAfter; using Robust.Shared.Serialization; -namespace Content.Shared.Bible.Components; +namespace Content.Shared.ADT.Chaplain.Components; public sealed partial class ChaplainMakeBelieverActionEvent : EntityTargetActionEvent { diff --git a/Content.Shared/Magic/SharedMagicSystem.cs b/Content.Shared/Magic/SharedMagicSystem.cs index 3301180e8af..a977cc553d7 100644 --- a/Content.Shared/Magic/SharedMagicSystem.cs +++ b/Content.Shared/Magic/SharedMagicSystem.cs @@ -1,4 +1,5 @@ using System.Numerics; +using Content.Shared.ADT.Chaplain.Components; using Content.Shared.Body.Components; using Content.Shared.Body.Systems; using Content.Shared.Charges.Components; @@ -295,6 +296,14 @@ private void OnChangeComponentsSpell(ChangeComponentsSpellEvent ev) if (ev.Handled || !PassesSpellPrerequisites(ev.Action, ev.Performer)) return; + // ADT-Tweak start + if (HasComp(ev.Target)) + { + ev.Handled = true; + return; + } + // ADT-Tweak end + ev.Handled = true; RemoveComponents(ev.Target, ev.ToRemove); @@ -327,6 +336,14 @@ public virtual void OnVoidApplause(VoidApplauseSpellEvent ev) if (ev.Handled || !PassesSpellPrerequisites(ev.Action, ev.Performer)) return; + // ADT-Tweak start + if (HasComp(ev.Target)) + { + ev.Handled = true; + return; + } + // ADT-Tweak end + ev.Handled = true; _transform.SwapPositions(ev.Performer, ev.Target); @@ -384,6 +401,14 @@ private void OnSmiteSpell(SmiteSpellEvent ev) if (ev.Handled || !PassesSpellPrerequisites(ev.Action, ev.Performer)) return; + // ADT-Tweak start + if (HasComp(ev.Target)) + { + ev.Handled = true; + return; + } + // ADT-Tweak end + ev.Handled = true; var direction = _transform.GetMapCoordinates(ev.Target, Transform(ev.Target)).Position - _transform.GetMapCoordinates(ev.Performer, Transform(ev.Performer)).Position; diff --git a/Resources/Prototypes/ADT/Heretic/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/ADT/Heretic/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml index 0bd118ac8d7..bfb63d4cb6e 100644 --- a/Resources/Prototypes/ADT/Heretic/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml +++ b/Resources/Prototypes/ADT/Heretic/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml @@ -5,6 +5,7 @@ description: Uh oh. categories: [ HideSpawnMenu ] components: + - type: MagicProjectile # ADT-Tweak - type: ChainFireball - type: Sprite sprite: Objects/Weapons/Guns/Projectiles/magic.rsi diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml index 4fb9be95ae1..a2d26f48b86 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml @@ -2248,6 +2248,7 @@ - type: Tag tags: - Fruit + - type: HolyMelonImmunity # ADT-Tweak - type: entity name: holymelon slice diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/magic.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/magic.yml index a32770e1f8c..68cf017001d 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/magic.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/magic.yml @@ -5,6 +5,7 @@ parent: BulletRocket categories: [ HideSpawnMenu ] components: + - type: MagicProjectile # ADT-Tweak - type: PointLight color: "#E25822" radius: 2.0 @@ -37,6 +38,7 @@ name: dragon's breath description: Try not to get toasted. components: + - type: MagicProjectile # ADT-Tweak - type: PointLight color: "#E25822" radius: 3.0 @@ -87,6 +89,7 @@ parent: ClosetSteelBase categories: [ HideSpawnMenu ] components: + - type: MagicProjectile # ADT-Tweak - type: ResistLocker resistTime: 30 - type: StoreOnCollide @@ -166,6 +169,7 @@ parent: BaseBullet categories: [ HideSpawnMenu ] components: + - type: MagicProjectile # ADT-Tweak - type: Sprite sprite: Objects/Weapons/Guns/Projectiles/magic.rsi layers: @@ -240,6 +244,7 @@ parent: BaseBullet categories: [ HideSpawnMenu ] components: + - type: MagicProjectile # ADT-Tweak - type: Sprite sprite: Objects/Weapons/Guns/Projectiles/magic.rsi layers: @@ -261,6 +266,7 @@ categories: [ HideSpawnMenu ] description: This looks familiar. components: + - type: MagicProjectile # ADT-Tweak - type: Projectile damage: types: @@ -290,6 +296,7 @@ components: - type: Sprite sprite: Structures/Specific/Anomalies/ice_anom.rsi + - type: MagicProjectile # ADT-Tweak - type: Projectile damage: types: diff --git a/Resources/Prototypes/Roles/Jobs/Civilian/chaplain.yml b/Resources/Prototypes/Roles/Jobs/Civilian/chaplain.yml index d21d55718e6..b30bf0d2174 100644 --- a/Resources/Prototypes/Roles/Jobs/Civilian/chaplain.yml +++ b/Resources/Prototypes/Roles/Jobs/Civilian/chaplain.yml @@ -15,6 +15,7 @@ - type: Chaplain # ADT Chaplain statusIcon: ChaplainFaction - type: BibleUser #Lets them heal with bibles + - type: MagicImmunity # ADT-Tweak - type: startingGear