Remove duplicate holy water (#4)
This commit is contained in:
@@ -35,7 +35,7 @@ public sealed partial class CultRuleComponent : Component
|
|||||||
[DataField("eyeColor")]
|
[DataField("eyeColor")]
|
||||||
public static Color EyeColor = Color.FromHex("#f80000");
|
public static Color EyeColor = Color.FromHex("#f80000");
|
||||||
|
|
||||||
public static string HolyWaterReagent = "HolyWater";
|
public static string HolyWaterReagent = "Holywater";
|
||||||
|
|
||||||
[DataField("redEyeThreshold")]
|
[DataField("redEyeThreshold")]
|
||||||
public static int ReadEyeThreshold = 5;
|
public static int ReadEyeThreshold = 5;
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
namespace Content.Server._White.Cult.HolyWater;
|
|
||||||
|
|
||||||
[RegisterComponent]
|
|
||||||
public sealed partial class BibleWaterConvertComponent : Component
|
|
||||||
{
|
|
||||||
[DataField("convertedId"), ViewVariables(VVAccess.ReadWrite)]
|
|
||||||
public string ConvertedId = "Water";
|
|
||||||
|
|
||||||
[DataField("ConvertedToId"), ViewVariables(VVAccess.ReadWrite)]
|
|
||||||
public string ConvertedToId = "HolyWater";
|
|
||||||
}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
using System.Linq;
|
|
||||||
using Content.Server.Stunnable;
|
|
||||||
using Content.Shared.Chemistry.Components.SolutionManager;
|
|
||||||
using Content.Shared.Interaction;
|
|
||||||
using Content.Shared.Mobs.Components;
|
|
||||||
using Content.Shared.Popups;
|
|
||||||
using Robust.Server.Audio;
|
|
||||||
using Robust.Server.GameObjects;
|
|
||||||
|
|
||||||
namespace Content.Server._White.Cult.HolyWater;
|
|
||||||
|
|
||||||
public sealed class HolyWaterSystem : EntitySystem
|
|
||||||
{
|
|
||||||
[Dependency] private readonly StunSystem _stun = default!;
|
|
||||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
|
||||||
[Dependency] private readonly AudioSystem _audio = default!;
|
|
||||||
|
|
||||||
public override void Initialize()
|
|
||||||
{
|
|
||||||
base.Initialize();
|
|
||||||
|
|
||||||
SubscribeLocalEvent<BibleWaterConvertComponent, AfterInteractEvent>(OnBibleInteract);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnBibleInteract(EntityUid uid, BibleWaterConvertComponent component, AfterInteractEvent args)
|
|
||||||
{
|
|
||||||
if (HasComp<MobStateComponent>(uid))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!TryComp<SolutionContainerManagerComponent>(args.Target, out var container))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (container.Solutions != null)
|
|
||||||
{
|
|
||||||
foreach (var solution in container.Solutions.Values.Where(solution =>
|
|
||||||
solution.ContainsReagent(component.ConvertedId, null)))
|
|
||||||
{
|
|
||||||
foreach (var reagent in solution.Contents)
|
|
||||||
{
|
|
||||||
if (reagent.Reagent.Prototype != component.ConvertedId)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var amount = reagent.Quantity;
|
|
||||||
|
|
||||||
solution.RemoveReagent(reagent.Reagent.Prototype, reagent.Quantity);
|
|
||||||
solution.AddReagent(component.ConvertedToId, amount);
|
|
||||||
|
|
||||||
if (args.Target == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
_popup.PopupEntity(Loc.GetString("holy-water-converted"), args.Target.Value, args.User);
|
|
||||||
_audio.PlayPvs("/Audio/Effects/holy.ogg", args.Target.Value);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -311,7 +311,9 @@ public sealed partial class CultSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (solution.Solutions.TryGetValue("vapor", out var vapor) && vapor.Contents.Any(x => x.Reagent.Prototype == "HolyWater"))
|
|
||||||
|
if (solution.Solutions.TryGetValue("vapor", out var vapor) &&
|
||||||
|
vapor.Contents.Any(x => x.Reagent.Prototype == CultRuleComponent.HolyWaterReagent))
|
||||||
{
|
{
|
||||||
Del(uid);
|
Del(uid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -457,20 +457,3 @@
|
|||||||
effects:
|
effects:
|
||||||
- !type:SatiateThirst
|
- !type:SatiateThirst
|
||||||
factor: 0.6
|
factor: 0.6
|
||||||
|
|
||||||
#WD start
|
|
||||||
- type: reagent
|
|
||||||
id: HolyWater
|
|
||||||
name: reagent-name-holy-water
|
|
||||||
parent: Water
|
|
||||||
desc: reagent-desc-holy-water
|
|
||||||
metabolisms:
|
|
||||||
Drink:
|
|
||||||
effects:
|
|
||||||
- !type:SatiateThirst
|
|
||||||
factor: 4
|
|
||||||
- !type:DeconvertCultist
|
|
||||||
conditions:
|
|
||||||
- !type:ReagentThreshold
|
|
||||||
min: 25
|
|
||||||
#WD end
|
|
||||||
|
|||||||
@@ -1017,7 +1017,7 @@
|
|||||||
Medicine:
|
Medicine:
|
||||||
effects:
|
effects:
|
||||||
- !type:HealthChange
|
- !type:HealthChange
|
||||||
condition:
|
conditions:
|
||||||
- !type:TotalDamage
|
- !type:TotalDamage
|
||||||
max: 50
|
max: 50
|
||||||
damage:
|
damage:
|
||||||
@@ -1027,6 +1027,10 @@
|
|||||||
Heat: -0.2
|
Heat: -0.2
|
||||||
Shock: -0.2
|
Shock: -0.2
|
||||||
Cold: -0.2
|
Cold: -0.2
|
||||||
|
- !type:DeconvertCultist
|
||||||
|
conditions:
|
||||||
|
- !type:ReagentThreshold
|
||||||
|
min: 15
|
||||||
|
|
||||||
- type: reagent
|
- type: reagent
|
||||||
id: Pyrazine
|
id: Pyrazine
|
||||||
|
|||||||
Reference in New Issue
Block a user