]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add haloperidol, potassium iodide (#27454)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Fri, 2 Aug 2024 17:12:08 +0000 (19:12 +0200)
committerGitHub <noreply@github.com>
Fri, 2 Aug 2024 17:12:08 +0000 (03:12 +1000)
* add haloperidol, potassium iodide

* review fixes

* review and tuning

* shader review

* use timespan and AutoPausedField

26 files changed:
Content.Client/Drowsiness/DrowsinessOverlay.cs [new file with mode: 0644]
Content.Client/Drowsiness/DrowsinessSystem.cs [new file with mode: 0644]
Content.Server/Drowsiness/DrowsinessSystem.cs [new file with mode: 0644]
Content.Server/Radiation/Components/RadiationProtectionComponent.cs [new file with mode: 0644]
Content.Server/Radiation/Systems/RadiationProtectionSystem.cs [new file with mode: 0644]
Content.Shared/Damage/Components/DamageProtectionBuffComponent.cs [new file with mode: 0644]
Content.Shared/Damage/Systems/DamageProtectionBuffSystem.cs [new file with mode: 0644]
Content.Shared/Drowsiness/DrowsinessComponent.cs [new file with mode: 0644]
Content.Shared/Drowsiness/DrowsinessSystem.cs [new file with mode: 0644]
Resources/Locale/en-US/guidebook/chemistry/statuseffects.ftl
Resources/Locale/en-US/reagents/meta/medicine.ftl
Resources/Prototypes/Catalog/Fills/Items/firstaidkits.yml
Resources/Prototypes/Damage/modifier_sets.yml
Resources/Prototypes/Entities/Mobs/NPCs/simplemob.yml
Resources/Prototypes/Entities/Mobs/Species/base.yml
Resources/Prototypes/Entities/Objects/Specific/Medical/healing.yml
Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml
Resources/Prototypes/Reagents/Consumable/Drink/drinks.yml
Resources/Prototypes/Reagents/Consumable/Drink/soda.yml
Resources/Prototypes/Reagents/medicine.yml
Resources/Prototypes/Reagents/narcotics.yml
Resources/Prototypes/Reagents/toxins.yml
Resources/Prototypes/Recipes/Reactions/medicine.yml
Resources/Prototypes/Shaders/shaders.yml
Resources/Prototypes/status_effects.yml
Resources/Textures/Shaders/radial_blur.swsl [new file with mode: 0644]

diff --git a/Content.Client/Drowsiness/DrowsinessOverlay.cs b/Content.Client/Drowsiness/DrowsinessOverlay.cs
new file mode 100644 (file)
index 0000000..a316f31
--- /dev/null
@@ -0,0 +1,80 @@
+using Content.Shared.Drowsiness;
+using Content.Shared.StatusEffect;
+using Robust.Client.Graphics;
+using Robust.Client.Player;
+using Robust.Shared.Enums;
+using Robust.Shared.Prototypes;
+using Robust.Shared.Timing;
+
+namespace Content.Client.Drowsiness;
+
+public sealed class DrowsinessOverlay : Overlay
+{
+    [Dependency] private readonly IEntityManager _entityManager = default!;
+    [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
+    [Dependency] private readonly IPlayerManager _playerManager = default!;
+    [Dependency] private readonly IEntitySystemManager _sysMan = default!;
+    [Dependency] private readonly IGameTiming _timing = default!;
+
+    public override OverlaySpace Space => OverlaySpace.WorldSpace;
+    public override bool RequestScreenTexture => true;
+    private readonly ShaderInstance _drowsinessShader;
+
+    public float CurrentPower = 0.0f;
+
+    private const float PowerDivisor = 250.0f;
+    private const float Intensity = 0.2f; // for adjusting the visual scale
+    private float _visualScale = 0; // between 0 and 1
+
+    public DrowsinessOverlay()
+    {
+        IoCManager.InjectDependencies(this);
+        _drowsinessShader = _prototypeManager.Index<ShaderPrototype>("Drowsiness").InstanceUnique();
+    }
+
+    protected override void FrameUpdate(FrameEventArgs args)
+    {
+        var playerEntity = _playerManager.LocalEntity;
+
+        if (playerEntity == null)
+            return;
+
+        if (!_entityManager.HasComponent<DrowsinessComponent>(playerEntity)
+            || !_entityManager.TryGetComponent<StatusEffectsComponent>(playerEntity, out var status))
+            return;
+
+        var statusSys = _sysMan.GetEntitySystem<StatusEffectsSystem>();
+        if (!statusSys.TryGetTime(playerEntity.Value, SharedDrowsinessSystem.DrowsinessKey, out var time, status))
+            return;
+
+        var curTime = _timing.CurTime;
+        var timeLeft = (float)(time.Value.Item2 - curTime).TotalSeconds;
+
+        CurrentPower += 8f * (0.5f * timeLeft - CurrentPower) * args.DeltaSeconds / (timeLeft + 1);
+    }
+
+    protected override bool BeforeDraw(in OverlayDrawArgs args)
+    {
+        if (!_entityManager.TryGetComponent(_playerManager.LocalEntity, out EyeComponent? eyeComp))
+            return false;
+
+        if (args.Viewport.Eye != eyeComp.Eye)
+            return false;
+
+        _visualScale = Math.Clamp(CurrentPower / PowerDivisor, 0.0f, 1.0f);
+        return _visualScale > 0;
+    }
+
+    protected override void Draw(in OverlayDrawArgs args)
+    {
+        if (ScreenTexture == null)
+            return;
+
+        var handle = args.WorldHandle;
+        _drowsinessShader.SetParameter("SCREEN_TEXTURE", ScreenTexture);
+        _drowsinessShader.SetParameter("Strength", _visualScale * Intensity);
+        handle.UseShader(_drowsinessShader);
+        handle.DrawRect(args.WorldBounds, Color.White);
+        handle.UseShader(null);
+    }
+}
diff --git a/Content.Client/Drowsiness/DrowsinessSystem.cs b/Content.Client/Drowsiness/DrowsinessSystem.cs
new file mode 100644 (file)
index 0000000..bc8862b
--- /dev/null
@@ -0,0 +1,53 @@
+using Content.Shared.Drowsiness;
+using Robust.Client.Graphics;
+using Robust.Client.Player;
+using Robust.Shared.Player;
+
+namespace Content.Client.Drowsiness;
+
+public sealed class DrowsinessSystem : SharedDrowsinessSystem
+{
+    [Dependency] private readonly IPlayerManager _player = default!;
+    [Dependency] private readonly IOverlayManager _overlayMan = default!;
+
+    private DrowsinessOverlay _overlay = default!;
+
+    public override void Initialize()
+    {
+        base.Initialize();
+
+        SubscribeLocalEvent<DrowsinessComponent, ComponentInit>(OnDrowsinessInit);
+        SubscribeLocalEvent<DrowsinessComponent, ComponentShutdown>(OnDrowsinessShutdown);
+
+        SubscribeLocalEvent<DrowsinessComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
+        SubscribeLocalEvent<DrowsinessComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
+
+        _overlay = new();
+    }
+
+    private void OnPlayerAttached(EntityUid uid, DrowsinessComponent component, LocalPlayerAttachedEvent args)
+    {
+        _overlayMan.AddOverlay(_overlay);
+    }
+
+    private void OnPlayerDetached(EntityUid uid, DrowsinessComponent component, LocalPlayerDetachedEvent args)
+    {
+        _overlay.CurrentPower = 0;
+        _overlayMan.RemoveOverlay(_overlay);
+    }
+
+    private void OnDrowsinessInit(EntityUid uid, DrowsinessComponent component, ComponentInit args)
+    {
+        if (_player.LocalEntity == uid)
+            _overlayMan.AddOverlay(_overlay);
+    }
+
+    private void OnDrowsinessShutdown(EntityUid uid, DrowsinessComponent component, ComponentShutdown args)
+    {
+        if (_player.LocalEntity == uid)
+        {
+            _overlay.CurrentPower = 0;
+            _overlayMan.RemoveOverlay(_overlay);
+        }
+    }
+}
diff --git a/Content.Server/Drowsiness/DrowsinessSystem.cs b/Content.Server/Drowsiness/DrowsinessSystem.cs
new file mode 100644 (file)
index 0000000..2511bc7
--- /dev/null
@@ -0,0 +1,50 @@
+using Content.Shared.Bed.Sleep;
+using Content.Shared.Drowsiness;
+using Content.Shared.StatusEffect;
+using Robust.Shared.Random;
+using Robust.Shared.Timing;
+
+namespace Content.Server.Drowsiness;
+
+public sealed class DrowsinessSystem : SharedDrowsinessSystem
+{
+    [ValidatePrototypeId<StatusEffectPrototype>]
+    private const string SleepKey = "ForcedSleep"; // Same one used by N2O and other sleep chems.
+
+    [Dependency] private readonly IGameTiming _timing = default!;
+    [Dependency] private readonly IRobustRandom _random = default!;
+    [Dependency] private readonly StatusEffectsSystem _statusEffects = default!;
+
+    /// <inheritdoc/>
+    public override void Initialize()
+    {
+        SubscribeLocalEvent<DrowsinessComponent, ComponentStartup>(OnInit);
+    }
+
+    private void OnInit(EntityUid uid, DrowsinessComponent component, ComponentStartup args)
+    {
+        component.NextIncidentTime = _timing.CurTime + TimeSpan.FromSeconds(_random.NextFloat(component.TimeBetweenIncidents.X, component.TimeBetweenIncidents.Y));
+    }
+    public override void Update(float frameTime)
+    {
+        base.Update(frameTime);
+
+        var query = EntityQueryEnumerator<DrowsinessComponent>();
+        while (query.MoveNext(out var uid, out var component))
+        {
+            if (_timing.CurTime < component.NextIncidentTime)
+                continue;
+
+            // Set the new time.
+            component.NextIncidentTime = _timing.CurTime + TimeSpan.FromSeconds(_random.NextFloat(component.TimeBetweenIncidents.X, component.TimeBetweenIncidents.Y));
+
+            // sleep duration
+            var duration = TimeSpan.FromSeconds(_random.NextFloat(component.DurationOfIncident.X, component.DurationOfIncident.Y));
+
+            // Make sure the sleep time doesn't cut into the time to next incident.
+            component.NextIncidentTime += duration;
+
+            _statusEffects.TryAddStatusEffect<ForcedSleepingComponent>(uid, SleepKey, duration, false);
+        }
+    }
+}
diff --git a/Content.Server/Radiation/Components/RadiationProtectionComponent.cs b/Content.Server/Radiation/Components/RadiationProtectionComponent.cs
new file mode 100644 (file)
index 0000000..44b11af
--- /dev/null
@@ -0,0 +1,18 @@
+using Robust.Shared.Prototypes;
+using Content.Shared.Damage.Prototypes;
+
+namespace Content.Server.Radiation.Components;
+
+/// <summary>
+///     Exists for use as a status effect.
+///     Adds the DamageProtectionBuffComponent to the entity and adds the specified DamageModifierSet to its list of modifiers.
+/// </summary>
+[RegisterComponent]
+public sealed partial class RadiationProtectionComponent : Component
+{
+    /// <summary>
+    ///     The radiation damage modifier for entities with this component.
+    /// </summary>
+    [DataField("modifier")]
+    public ProtoId<DamageModifierSetPrototype> RadiationProtectionModifierSetId = "PotassiumIodide";
+}
diff --git a/Content.Server/Radiation/Systems/RadiationProtectionSystem.cs b/Content.Server/Radiation/Systems/RadiationProtectionSystem.cs
new file mode 100644 (file)
index 0000000..5222c31
--- /dev/null
@@ -0,0 +1,38 @@
+using Content.Server.Radiation.Components;
+using Content.Shared.Damage.Components;
+using Robust.Shared.Prototypes;
+
+namespace Content.Server.Radiation.EntitySystems;
+
+public sealed class RadiationProtectionSystem : EntitySystem
+{
+    [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
+
+    public override void Initialize()
+    {
+        base.Initialize();
+        SubscribeLocalEvent<RadiationProtectionComponent, ComponentInit>(OnInit);
+        SubscribeLocalEvent<RadiationProtectionComponent, ComponentShutdown>(OnShutdown);
+    }
+
+    private void OnInit(EntityUid uid, RadiationProtectionComponent component, ComponentInit args)
+    {
+        if (!_prototypeManager.TryIndex(component.RadiationProtectionModifierSetId, out var modifier))
+            return;
+        var buffComp = EnsureComp<DamageProtectionBuffComponent>(uid);
+        // add the damage modifier if it isn't in the dict yet
+        if (!buffComp.Modifiers.ContainsKey(component.RadiationProtectionModifierSetId))
+            buffComp.Modifiers.Add(component.RadiationProtectionModifierSetId, modifier);
+    }
+
+    private void OnShutdown(EntityUid uid, RadiationProtectionComponent component, ComponentShutdown args)
+    {
+        if (!TryComp<DamageProtectionBuffComponent>(uid, out var buffComp))
+            return;
+        // remove the damage modifier from the dict
+        buffComp.Modifiers.Remove(component.RadiationProtectionModifierSetId);
+        // if the dict is empty now, remove the buff component
+        if (buffComp.Modifiers.Count == 0)
+            RemComp<DamageProtectionBuffComponent>(uid);
+    }
+}
diff --git a/Content.Shared/Damage/Components/DamageProtectionBuffComponent.cs b/Content.Shared/Damage/Components/DamageProtectionBuffComponent.cs
new file mode 100644 (file)
index 0000000..99b055a
--- /dev/null
@@ -0,0 +1,17 @@
+using Content.Shared.Damage.Prototypes;
+using Robust.Shared.GameStates;
+
+namespace Content.Shared.Damage.Components;
+
+/// <summary>
+///     Applies the specified DamageModifierSets when the entity takes damage.
+/// </summary>
+[RegisterComponent, NetworkedComponent]
+public sealed partial class DamageProtectionBuffComponent : Component
+{
+    /// <summary>
+    ///     The damage modifiers for entities with this component.
+    /// </summary>
+    [DataField]
+    public Dictionary<string, DamageModifierSetPrototype> Modifiers = new();
+}
diff --git a/Content.Shared/Damage/Systems/DamageProtectionBuffSystem.cs b/Content.Shared/Damage/Systems/DamageProtectionBuffSystem.cs
new file mode 100644 (file)
index 0000000..bbb7bfd
--- /dev/null
@@ -0,0 +1,19 @@
+using Content.Shared.Damage.Components;
+
+namespace Content.Shared.Damage.Systems;
+
+public sealed class DamageProtectionBuffSystem : EntitySystem
+{
+    public override void Initialize()
+    {
+        base.Initialize();
+
+        SubscribeLocalEvent<DamageProtectionBuffComponent, DamageModifyEvent>(OnDamageModify);
+    }
+
+    private void OnDamageModify(EntityUid uid, DamageProtectionBuffComponent component, DamageModifyEvent args)
+    {
+        foreach (var modifier in component.Modifiers.Values)
+            args.Damage = DamageSpecifier.ApplyModifierSet(args.Damage, modifier);
+    }
+}
diff --git a/Content.Shared/Drowsiness/DrowsinessComponent.cs b/Content.Shared/Drowsiness/DrowsinessComponent.cs
new file mode 100644 (file)
index 0000000..7e170ed
--- /dev/null
@@ -0,0 +1,28 @@
+using System.Numerics;
+using Robust.Shared.GameStates;
+using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
+
+namespace Content.Shared.Drowsiness;
+
+/// <summary>
+///     Exists for use as a status effect. Adds a shader to the client that scales with the effect duration.
+/// </summary>
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
+public sealed partial class DrowsinessComponent : Component
+{
+    /// <summary>
+    /// The random time between sleeping incidents, (min, max).
+    /// </summary>
+    [DataField(required: true)]
+    public Vector2 TimeBetweenIncidents = new Vector2(5f, 60f);
+
+    /// <summary>
+    /// The duration of sleeping incidents, (min, max).
+    /// </summary>
+    [DataField(required: true)]
+    public Vector2 DurationOfIncident = new Vector2(2, 5);
+
+    [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
+    public TimeSpan NextIncidentTime = TimeSpan.Zero;
+}
diff --git a/Content.Shared/Drowsiness/DrowsinessSystem.cs b/Content.Shared/Drowsiness/DrowsinessSystem.cs
new file mode 100644 (file)
index 0000000..97d7c09
--- /dev/null
@@ -0,0 +1,9 @@
+using Content.Shared.StatusEffect;
+
+namespace Content.Shared.Drowsiness;
+
+public abstract class SharedDrowsinessSystem : EntitySystem
+{
+    [ValidatePrototypeId<StatusEffectPrototype>]
+    public const string DrowsinessKey = "Drowsiness";
+}
index 3db8a3c5b0e0887bdbf9c9f8e86bf484af38ced7..9a8f2f6c8a34def5cf1f5f327e15d9e97d9a01a3 100644 (file)
@@ -11,3 +11,5 @@ reagent-effect-status-effect-PressureImmunity = pressure immunity
 reagent-effect-status-effect-Pacified = combat pacification
 reagent-effect-status-effect-RatvarianLanguage = ratvarian language patterns
 reagent-effect-status-effect-StaminaModifier = modified stamina
+reagent-effect-status-effect-RadiationProtection = radiation protection
+reagent-effect-status-effect-Drowsiness = drowsiness
index a84e8315fdad2301ec479cab25685bf3cc7f7e1f..1e34411efbb2562634e713408ba06eb74a3b489f 100644 (file)
@@ -141,3 +141,9 @@ reagent-desc-mannitol = Efficiently restores brain damage.
 
 reagent-name-psicodine = psicodine
 reagent-desc-psicodine = Suppresses anxiety and other various forms of mental distress. Overdose causes hallucinations and minor toxin damage.
+
+reagent-name-potassium-iodide = potassium iodide
+reagent-desc-potassium-iodide = Will reduce the damaging effects of radiation by 90%. Prophylactic use only.
+
+reagent-name-haloperidol = haloperidol
+reagent-desc-haloperidol = Removes most stimulating and hallucinogenic drugs. Reduces druggy effects and jitteriness. Causes drowsiness.
index 6400dce5b6abf9842784eb48c1be3ad6e772a537..e54010429f53cbd74d5eef2fef236f172718bd03 100644 (file)
@@ -71,7 +71,7 @@
     contents:
       - id: SyringePhalanximine
       - id: RadAutoInjector
-      - id: EmergencyMedipen
+      - id: PillCanisterPotassiumIodide
       - id: PillCanisterHyronalin
 
 - type: entity
index 02223b6a9febcab2eb21a70c6821248d7ebcd2d7..671e9d80eac0d6957e8042cabad54dfb33f0a210 100644 (file)
     Cellular: 0.0
     Heat: 2.5
     Caustic: 0.0
+
+# protects against radiation
+- type: damageModifierSet
+  id: PotassiumIodide
+  coefficients:
+    Radiation: 0.1
index 4936d883e578c17659a00a45a40bd1f94e896eeb..41545aef89430bdb84381ddf58308952d17921bf 100644 (file)
@@ -26,6 +26,8 @@
     - TemporaryBlindness
     - Pacified
     - Flashed
+    - RadiationProtection
+    - Drowsiness
   - type: Buckle
   - type: StandingState
   - type: Tag
     baseDecayRate: 0.04
   - type: StatusEffects
     allowed:
-      - Stun
-      - KnockedDown
-      - SlowedDown
-      - Stutter
-      - Electrocution
-      - ForcedSleep
-      - TemporaryBlindness
-      - Pacified
-      - StaminaModifier
-      - Flashed
+    - Stun
+    - KnockedDown
+    - SlowedDown
+    - Stutter
+    - Electrocution
+    - ForcedSleep
+    - TemporaryBlindness
+    - Pacified
+    - StaminaModifier
+    - Flashed
+    - RadiationProtection
+    - Drowsiness
   - type: Bloodstream
     bloodMaxVolume: 150
   - type: MobPrice
index d20ae2ff17a07b235da3b83d9880d12074cc693b..99aa2d4bc8feba2c1e914a59d71a9a9fa1f8d2d1 100644 (file)
     - Pacified
     - StaminaModifier
     - Flashed
+    - RadiationProtection
+    - Drowsiness
   - type: Body
     prototype: Human
     requiredLegs: 2
       groups:
         Brute: -0.07
   - type: Fingerprint
-
   - type: Blindable
   # Other
   - type: Temperature
index d83a292ebee28fa1b54076aa3b09c221ec8f5104..989fd577059915dbb04ecc29bff0e10e40356828 100644 (file)
     - id: PillHyronalin
       amount: 5
 
+- type: entity
+  name: pill
+  suffix: Potassium iodide 10u
+  parent: Pill
+  id: PillPotassiumIodide
+  components:
+  - type: Pill
+    pillType: 8
+  - type: Sprite
+    state: pill9
+  - type: Label
+    currentLabel: potassium iodide 10u
+  - type: SolutionContainerManager
+    solutions:
+      food:
+        maxVol: 20
+        reagents:
+        - ReagentId: PotassiumIodide
+          Quantity: 10
+
+- type: entity
+  name: pill canister
+  parent: PillCanister
+  id: PillCanisterPotassiumIodide
+  suffix: Potassium iodide 10u, 5
+  components:
+  - type: Label
+    currentLabel: potassium iodide 10u
+  - type: StorageFill
+    contents:
+    - id: PillPotassiumIodide
+      amount: 5
+
 - type: entity
   name: pill
   suffix: Iron 10u
       prob: 0.10
       maxAmount: 7
       orGroup: RandomPill
+    - id: PillPotassiumIodide
+      prob: 0.10
+      maxAmount: 7
+      orGroup: RandomPill
     - id: PillIron
       prob: 0.10
       maxAmount: 7
index 8028b6376c8896f64c85579987a1711258580f68..1aa03bf4c93661edab9a92ee8362aed947a52e1c 100644 (file)
         - !type:AdjustReagent
           reagent: Theobromine
           amount: 0.05
+        - !type:GenericStatusEffect
+          key: Drowsiness
+          time: 1.0
+          type: Remove
   fizziness: 0.25
 
 - type: reagent
         - !type:AdjustReagent
           reagent: Theobromine
           amount: 0.05
+        - !type:GenericStatusEffect
+          key: Drowsiness
+          time: 1.0
+          type: Remove
   fizziness: 0.15
 
 - type: reagent
         - !type:AdjustReagent
           reagent: Theobromine
           amount: 0.05
+        - !type:GenericStatusEffect
+          key: Drowsiness
+          time: 1.0
+          type: Remove
   fizziness: 0.15
 
 - type: reagent
         - !type:AdjustReagent
           reagent: Theobromine
           amount: 0.05
+        - !type:GenericStatusEffect
+          key: Drowsiness
+          time: 1.0
+          type: Remove
   fizziness: 0.25
 
 - type: reagent
         - !type:AdjustReagent
           reagent: Theobromine
           amount: 0.05
+        - !type:GenericStatusEffect
+          key: Drowsiness
+          time: 1.0
+          type: Remove
   fizziness: 0.15
 
 - type: reagent
         - !type:AdjustReagent
           reagent: Theobromine
           amount: 0.05
+        - !type:GenericStatusEffect
+          key: Drowsiness
+          time: 1.0
+          type: Remove
   fizziness: 0.25
index 52a01d973f64d22900edaac92ce7514046d2dd06..3f9fb7b53d289ff3ff8be55ee12e2d02d4ea0ae1 100644 (file)
       effects:
       - !type:SatiateThirst
         factor: 2
+      - !type:GenericStatusEffect
+        key: Drowsiness
+        time: 2.0
+        type: Remove
       - !type:AdjustReagent
         reagent: Theobromine
         amount: 0.05
   metamorphicMaxFillLevels: 1
   metamorphicFillBaseName: fill-
   metamorphicChangeColor: false
+  metabolisms:
+    Drink:
+      effects:
+      - !type:SatiateThirst
+        factor: 2
+      - !type:GenericStatusEffect
+        key: Drowsiness
+        time: 2.0
+        type: Remove
 
 - type: reagent
   id: GreenTea
   metamorphicMaxFillLevels: 5
   metamorphicFillBaseName: fill-
   metamorphicChangeColor: false
+  metabolisms:
+    Drink:
+      effects:
+      - !type:SatiateThirst
+        factor: 2
+      - !type:GenericStatusEffect
+        key: Drowsiness
+        time: 2.0
+        type: Remove
 
 - type: reagent
   id: IcedGreenTea
       effects:
       - !type:SatiateThirst
         factor: 6
+      - !type:GenericStatusEffect
+        key: Drowsiness
+        time: 3.0
+        type: Remove
     Poison:
       effects:
       - !type:HealthChange
   metamorphicMaxFillLevels: 1
   metamorphicFillBaseName: fill-
   metamorphicChangeColor: false
+  metabolisms:
+    Drink:
+      effects:
+      - !type:SatiateThirst
+        factor: 2
+      - !type:GenericStatusEffect
+        key: Drowsiness
+        time: 2.0
+        type: Remove
 
 - type: reagent
   id: Tea
index d78b0351cee8180bae23ee3623381ef169c5a759..49290677a1e95d02df904eae9dad5152c359fbdf 100644 (file)
   metamorphicMaxFillLevels: 5
   metamorphicFillBaseName: fill-
   metamorphicChangeColor: false
+  metabolisms:
+    Drink:
+      effects:
+      - !type:SatiateThirst
+        factor: 2
+      - !type:GenericStatusEffect
+        key: Drowsiness
+        time: 1.0
+        type: Remove
 
 - type: reagent
   id: RoyRogers
       effects:
       - !type:SatiateThirst
         factor: 2
+      - !type:GenericStatusEffect
+        key: Drowsiness
+        time: 2.0
+        type: Remove
       - !type:AdjustReagent
         reagent: Theobromine
         amount: 0.1
index ad0d39a134603a501e4bca43c7a3b968ef3b2edf..4dcef67f77dd8972cafad069525e3ff6f055216b 100644 (file)
       - !type:GenericStatusEffect
         key: Stutter
         component: StutteringAccent
+      - !type:GenericStatusEffect
+        key: Drowsiness
+        time: 10
+        type: Remove
       - !type:ResetNarcolepsy
         conditions:
         - !type:ReagentThreshold
   metabolisms:
     Medicine:
       effects:
+      - !type:GenericStatusEffect
+        key: Drowsiness
+        time: 10
+        type: Remove
       - !type:ResetNarcolepsy
         conditions:
         - !type:ReagentThreshold
         - "psicodine-effect-anxieties-wash-away"
         - "psicodine-effect-at-peace"
         probability: 0.2
+
+- type: reagent
+  id: PotassiumIodide
+  name: reagent-name-potassium-iodide
+  group: Medicine
+  desc: reagent-desc-potassium-iodide
+  physicalDesc: reagent-physical-desc-grainy
+  flavor: medicine
+  color: "#baa15d"
+  metabolisms:
+    Medicine:
+      effects:
+      - !type:GenericStatusEffect
+        key: RadiationProtection
+        component: RadiationProtection
+        time: 2
+        type: Add
+        refresh: false
+      - !type:HealthChange
+        conditions:
+          - !type:ReagentThreshold
+            min: 20
+        damage:
+          types:
+            Poison: 1
+
+- type: reagent
+  id: Haloperidol
+  name: reagent-name-haloperidol
+  group: Medicine
+  desc: reagent-desc-haloperidol
+  physicalDesc: reagent-physical-desc-crystalline
+  flavor: medicine
+  color: "#27870a"
+  metabolisms:
+    Medicine:
+      effects:
+      - !type:Emote
+        emote: Yawn
+        showInChat: true
+        probability: 0.1
+      - !type:GenericStatusEffect
+        key: Drowsiness
+        component: Drowsiness
+        time: 4
+        type: Add
+        refresh: false
+      - !type:GenericStatusEffect
+        key: Jitter
+        time: 4.0
+        type: Remove
+      - !type:GenericStatusEffect
+        key: SeeingRainbows
+        time: 10.0
+        type: Remove
+      - !type:AdjustReagent
+        reagent: Desoxyephedrine
+        amount: -3.0
+      - !type:AdjustReagent
+        reagent: Ephedrine
+        amount: -3.0
+      - !type:AdjustReagent
+        reagent: Stimulants
+        amount: -3.0
+      - !type:AdjustReagent
+        reagent: THC
+        amount: -3.0
+      - !type:AdjustReagent
+        reagent: SpaceDrugs
+        amount: -3.0
+      - !type:AdjustReagent
+        reagent: Bananadine
+        amount: -3.0
+      - !type:AdjustReagent
+        reagent: SpaceGlue
+        amount: -3.0
+      - !type:AdjustReagent
+        reagent: MindbreakerToxin
+        amount: -3.0
index bf311f23e7bea00a39092a15675ba7dc3a1a0a7e..8e73eb139556ec6d6d001b446d1fe00243cde8a4 100644 (file)
         key: KnockedDown
         time: 3
         type: Remove
+      - !type:GenericStatusEffect
+        conditions:
+        - !type:ReagentThreshold
+          reagent: Haloperidol
+          max: 0.01
+        key: Drowsiness
+        time: 10
+        type: Remove
     Medicine:
       effects:
       - !type:ResetNarcolepsy
         key: KnockedDown
         time: 1
         type: Remove
+      - !type:GenericStatusEffect
+        conditions:
+        - !type:ReagentThreshold
+          reagent: Haloperidol
+          max: 0.01
+        key: Drowsiness
+        time: 10
+        type: Remove
       - !type:PopupMessage
         visualType: Medium
         messages: ["ephedrine-effect-tight-pain", "ephedrine-effect-heart-pounds"]
         key: ForcedSleep
         time: 3
         type: Remove
+      - !type:GenericStatusEffect
+        conditions:
+        - !type:ReagentThreshold
+          reagent: Haloperidol
+          max: 0.01
+        key: Drowsiness
+        time: 10
+        type: Remove
     Medicine:
       metabolismRate: 1.0
       effects:
index 7f4ebc1a75176b898cb084f46421d3e05e5cf378..a83836c5ffd67a55127740e3f23eee084417369c 100644 (file)
   metabolisms:
     Poison:
       effects:
+      - !type:Emote
+        emote: Yawn
+        showInChat: true
+        probability: 0.1
       - !type:MovespeedModifier
         walkSpeedModifier: 0.65
         sprintSpeedModifier: 0.65
       - !type:GenericStatusEffect
-        conditions:
-        - !type:ReagentThreshold
-          reagent: ChloralHydrate
-          min: 10
-        key: ForcedSleep
-        component: ForcedSleeping
-        refresh: false
+        key: Drowsiness
+        component: Drowsiness
+        time: 4
         type: Add
+        refresh: false
       - !type:HealthChange
         conditions:
         - !type:ReagentThreshold
index 2e9b1d4f854fa66218001ab33969558b9eefacfb..a99015fe90be4019f42b580520101e106ef88a31 100644 (file)
       catalyst: true
   products:
     Happiness: 4
+
+- type: reaction
+  id: PotassiumIodide
+  reactants:
+    Potassium:
+      amount: 1
+    Iodine:
+      amount: 1
+  products:
+    PotassiumIodide: 2
+
+- type: reaction
+  id: Haloperidol
+  reactants:
+    Aluminium:
+      amount: 1
+    Chlorine:
+      amount: 1
+    Fluorine:
+      amount: 1
+    Oil:
+      amount: 1
+    PotassiumIodide:
+      amount: 1
+  products:
+    Haloperidol: 5
index e286dcb7a4197c18e78044f4c55db0718c85fa70..136821efbb8411d5426a9da1a77b6fda55b30011 100644 (file)
   kind: source
   path: "/Textures/Shaders/drunk.swsl"
 
+- type: shader
+  id: Drowsiness
+  kind: source
+  path: "/Textures/Shaders/radial_blur.swsl"
+
 - type: shader
   id: Texture
   kind: source
index 27609b1bb542c9a39c3de2df419e04630beb38d9..96379323fd1c688af23f4d4e4297948343ff7524 100644 (file)
@@ -62,3 +62,9 @@
 
 - type: statusEffect
   id: Flashed
+
+- type: statusEffect
+  id: RadiationProtection
+
+- type: statusEffect
+  id: Drowsiness #blurs your vision and makes you randomly fall asleep
diff --git a/Resources/Textures/Shaders/radial_blur.swsl b/Resources/Textures/Shaders/radial_blur.swsl
new file mode 100644 (file)
index 0000000..f3224ce
--- /dev/null
@@ -0,0 +1,14 @@
+uniform sampler2D SCREEN_TEXTURE;
+uniform highp float Strength;
+const highp int SampleCount = 10; // a higher number makes the shader look better, but has a big performance impact
+
+// a simple radial blur
+void fragment() {
+    highp vec2 uv = FRAGCOORD.xy * SCREEN_PIXEL_SIZE.xy;
+    highp vec2 direction = vec2(0.5, 0.5) - uv;
+    for (int i=1; i <= SampleCount; i++)
+    {
+        COLOR += zTextureSpec(SCREEN_TEXTURE, uv + float(i) * Strength / float(SampleCount) * direction);
+    }
+    COLOR = COLOR / float(SampleCount);
+}