Adds metabolism effects to pretty much every chem already in the game (#5349)
* pass 1 * a little more reagent effect for breakfast * move lots of stuff around * implements all medicines * implement all cleaning & elements * implement toxins/pyrotechnic * p * linter fixies * fixes + narcotic balancing * fix and standardize * reviews * things
This commit is contained in:
37
Content.Server/Chemistry/ReagentEffects/PopupMessage.cs
Normal file
37
Content.Server/Chemistry/ReagentEffects/PopupMessage.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.Popups;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
namespace Content.Server.Chemistry.ReagentEffects
|
||||
{
|
||||
public class PopupMessage : ReagentEffect
|
||||
{
|
||||
[DataField("messages", required: true)]
|
||||
public string[] Messages = default!;
|
||||
|
||||
[DataField("type")]
|
||||
public PopupType Type = PopupType.Local;
|
||||
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
var popupSys = args.EntityManager.EntitySysManager.GetEntitySystem<SharedPopupSystem>();
|
||||
var random = IoCManager.Resolve<IRobustRandom>();
|
||||
|
||||
var msg = random.Pick(Messages);
|
||||
if (Type == PopupType.Local)
|
||||
popupSys.PopupEntity(Loc.GetString(msg), args.SolutionEntity, Filter.Entities(args.SolutionEntity));
|
||||
else if (Type == PopupType.Pvs)
|
||||
popupSys.PopupEntity(Loc.GetString(msg), args.SolutionEntity, Filter.Pvs(args.SolutionEntity));
|
||||
}
|
||||
}
|
||||
|
||||
public enum PopupType
|
||||
{
|
||||
Pvs,
|
||||
Local
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user