- fix: Holy water fix. (#159)

* - fix: Holy water fix.

* - tweak: Move bible check to CultSystem.

* - tweak: Remove unused.
This commit is contained in:
Aviu00
2024-03-02 18:08:32 +09:00
committed by GitHub
parent 55c0f5052f
commit 3c3c4ed6f0
3 changed files with 31 additions and 6 deletions

View File

@@ -13,7 +13,12 @@ public sealed partial class PuddleSystem
[ValidatePrototypeId<ReagentPrototype>]
private const string Water = "Water";
public static string[] EvaporationReagents = new[] { Water };
// WD EDIT START
[ValidatePrototypeId<ReagentPrototype>]
private const string HolyWater = "Holywater";
public static string[] EvaporationReagents = new[] { Water, HolyWater };
// WD EDIT END
private void OnEvaporationMapInit(Entity<EvaporationComponent> entity, ref MapInitEvent args)
{

View File

@@ -10,6 +10,10 @@ using Content.Server.Hands.Systems;
using Content.Server.Weapons.Ranged.Systems;
using Content.Server._White.Cult.GameRule;
using Content.Server._White.Cult.Runes.Comps;
using Content.Server.Bible.Components;
using Content.Server.Chemistry.Components;
using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Server.Fluids.Components;
using Content.Shared._White.Chaplain;
using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Cuffs.Components;
@@ -64,6 +68,7 @@ public sealed partial class CultSystem : EntitySystem
[Dependency] private readonly FlammableSystem _flammableSystem = default!;
[Dependency] private readonly SharedPullingSystem _pulling = default!;
[Dependency] private readonly SharedCuffableSystem _cuffable = default!;
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
public override void Initialize()
@@ -259,6 +264,14 @@ public sealed partial class CultSystem : EntitySystem
private void TryErase(EntityUid uid, CultRuneBaseComponent component, InteractUsingEvent args)
{
if (TryComp<BibleComponent>(args.Used, out var bible) && HasComp<BibleUserComponent>(args.User))
{
_popupSystem.PopupEntity(Loc.GetString("cult-erased-rune"), args.User, args.User);
_audio.PlayPvs(bible.HealSoundPath, args.User);
EntityManager.DeleteEntity(args.Target);
return;
}
var entityPrototype = _entityManager.GetComponent<MetaDataComponent>(args.Used).EntityPrototype;
if (entityPrototype == null)
@@ -293,7 +306,7 @@ public sealed partial class CultSystem : EntitySystem
if (_doAfterSystem.TryStartDoAfter(argsDoAfterEvent))
{
_popupSystem.PopupEntity(Loc.GetString("cult-started-erasing-rune"), target);
_popupSystem.PopupEntity(Loc.GetString("cult-started-erasing-rune"), args.User, args.User);
}
}
@@ -305,18 +318,20 @@ public sealed partial class CultSystem : EntitySystem
var target = GetEntity(args.TargetEntityId);
_entityManager.DeleteEntity(target);
_popupSystem.PopupEntity(Loc.GetString("cult-erased-rune"), args.User);
_popupSystem.PopupEntity(Loc.GetString("cult-erased-rune"), args.User, args.User);
}
private void HandleCollision(EntityUid uid, CultRuneBaseComponent component, ref StartCollideEvent args)
{
if (!TryComp<SolutionContainerManagerComponent>(args.OtherEntity, out var solution) || solution.Solutions == null)
if (!TryComp<SolutionContainerManagerComponent>(args.OtherEntity, out var solution) ||
!HasComp<VaporComponent>(args.OtherEntity) && !HasComp<SprayComponent>(args.OtherEntity))
{
return;
}
if (solution.Solutions.TryGetValue("vapor", out var vapor) &&
vapor.Contents.Any(x => x.Reagent.Prototype == CultRuleComponent.HolyWaterReagent))
var solutions = _solutionContainerSystem.EnumerateSolutions((args.OtherEntity, solution));
if (solutions.Any(x => x.Solution.Comp.Solution.ContainsPrototype(CultRuleComponent.HolyWaterReagent)))
{
Del(uid);
}

View File

@@ -1008,12 +1008,17 @@
- type: reagent
id: Holywater
name: reagent-name-holywater
parent: BaseDrink
group: Medicine
desc: reagent-desc-holywater
physicalDesc: reagent-physical-desc-holy
flavor: holy
color: "#91C3F7"
metabolisms:
Drink:
effects:
- !type:SatiateThirst
factor: 4
Medicine:
effects:
- !type:HealthChange