diff --git a/Content.Server/Atmos/Miasma/MiasmaSystem.cs b/Content.Server/Atmos/Miasma/MiasmaSystem.cs index e189984a12..211c353538 100644 --- a/Content.Server/Atmos/Miasma/MiasmaSystem.cs +++ b/Content.Server/Atmos/Miasma/MiasmaSystem.cs @@ -4,7 +4,10 @@ using Content.Shared.Atmos; using Content.Server.Atmos.EntitySystems; using Content.Server.Temperature.Components; using Content.Server.Body.Components; +using Content.Server.Popups; +using Content.Shared.Examine; using Robust.Shared.Containers; +using Robust.Shared.Player; namespace Content.Server.Atmos.Miasma { @@ -13,6 +16,8 @@ namespace Content.Server.Atmos.Miasma [Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!; [Dependency] private readonly DamageableSystem _damageableSystem = default!; + [Dependency] private readonly PopupSystem _popupSystem = default!; + public override void Update(float frameTime) { base.Update(frameTime); @@ -35,8 +40,8 @@ namespace Content.Server.Atmos.Miasma perishable.RotAccumulator -= 1f; DamageSpecifier damage = new(); - damage.DamageDict.Add("Blunt", 0.25); // Slowly accumulate enough to gib after like half an hour - damage.DamageDict.Add("Cellular", 0.25); // Cloning rework might use this eventually + damage.DamageDict.Add("Blunt", 0.3); // Slowly accumulate enough to gib after like half an hour + damage.DamageDict.Add("Cellular", 0.3); // Cloning rework might use this eventually _damageableSystem.TryChangeDamage(perishable.Owner, damage, true, true); @@ -56,6 +61,7 @@ namespace Content.Server.Atmos.Miasma base.Initialize(); SubscribeLocalEvent(OnMobStateChanged); SubscribeLocalEvent(OnGibbed); + SubscribeLocalEvent(OnExamined); SubscribeLocalEvent(OnEntInserted); SubscribeLocalEvent(OnEntRemoved); } @@ -71,10 +77,24 @@ namespace Content.Server.Atmos.Miasma if (!TryComp(uid, out var physics)) return; + if (component.DeathAccumulator <= component.RotAfter.TotalSeconds) + return; + var molsToDump = (component.MolsPerSecondPerUnitMass * physics.FixturesMass) * component.DeathAccumulator; var tileMix = _atmosphereSystem.GetTileMixture(Transform(uid).Coordinates); if (tileMix != null) tileMix.AdjustMoles(Gas.Miasma, molsToDump); + + foreach (var part in args.GibbedParts) + { + EntityManager.QueueDeleteEntity(part); + } + } + + private void OnExamined(EntityUid uid, PerishableComponent component, ExaminedEvent args) + { + if (component.DeathAccumulator >= component.RotAfter.TotalSeconds) + args.PushMarkup(Loc.GetString("miasma-rotting")); } private void OnEntInserted(EntityUid uid, AntiRottingContainerComponent component, EntInsertedIntoContainerMessage args) diff --git a/Content.Server/Atmos/Miasma/PerishableComponent.cs b/Content.Server/Atmos/Miasma/PerishableComponent.cs index de8c45b9ca..252c23f200 100644 --- a/Content.Server/Atmos/Miasma/PerishableComponent.cs +++ b/Content.Server/Atmos/Miasma/PerishableComponent.cs @@ -23,7 +23,7 @@ namespace Content.Server.Atmos.Miasma /// /// When DeathAccumulator is greater than this, start rotting. /// - public TimeSpan RotAfter = TimeSpan.FromMinutes(3); + public TimeSpan RotAfter = TimeSpan.FromMinutes(5); /// /// Gasses are released every second. @@ -32,11 +32,10 @@ namespace Content.Server.Atmos.Miasma public float RotAccumulator = 0f; /// - /// How many moles of gas released per second, adjusted for mass. - /// Humans have a mass of 70. I am aiming for ten mols a minute, so - /// 1/6 of a minute, divided by 70 as a baseline. + /// How many moles of gas released per second, per unit of mass. /// [ViewVariables(VVAccess.ReadWrite)] - public float MolsPerSecondPerUnitMass = 0.0025f; + [DataField("molsPerSecondPerUnitMass")] + public float MolsPerSecondPerUnitMass = 0.0035f; } } diff --git a/Resources/Locale/en-US/disease/miasma.ftl b/Resources/Locale/en-US/disease/miasma.ftl new file mode 100644 index 0000000000..ae64119e3c --- /dev/null +++ b/Resources/Locale/en-US/disease/miasma.ftl @@ -0,0 +1,2 @@ +miasma-smell = Something smells foul! +miasma-rotting = [color=orange]It's rotting![/color] diff --git a/Resources/Prototypes/Atmospherics/gases.yml b/Resources/Prototypes/Atmospherics/gases.yml index bb2bbe5675..6e3f4dfe43 100644 --- a/Resources/Prototypes/Atmospherics/gases.yml +++ b/Resources/Prototypes/Atmospherics/gases.yml @@ -67,4 +67,4 @@ gasOverlaySprite: /Textures/Effects/atmospherics.rsi gasOverlayState: miasma color: 56941E - reagent: Miasma \ No newline at end of file + reagent: Miasma diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index 6b76b05b15..e3962d3525 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -24,7 +24,7 @@ - shape: !type:PhysShapeCircle radius: 0.25 - mass: 5 + mass: 2 mask: - FlyingMobMask layer: @@ -88,7 +88,7 @@ - shape: !type:PhysShapeCircle radius: 0.1 - mass: 5 + mass: 1 mask: - FlyingMobMask layer: @@ -158,6 +158,16 @@ - map: ["enum.DamageStateVisualLayers.Base"] state: chicken-0 sprite: Mobs/Animals/chicken.rsi + - type: Fixtures + fixtures: + - shape: + !type:PhysShapeCircle + radius: 0.35 + mass: 3 + mask: + - MobMask + layer: + - MobLayer - type: Appearance - type: DamageStateVisuals states: @@ -192,6 +202,16 @@ - map: ["enum.DamageStateVisualLayers.Base"] state: duck-0 sprite: Mobs/Animals/duck.rsi + - type: Fixtures + fixtures: + - shape: + !type:PhysShapeCircle + radius: 0.35 + mass: 2 #They actually are pretty light, I looked it up + mask: + - MobMask + layer: + - MobLayer - type: Appearance - type: DamageStateVisuals states: @@ -279,7 +299,7 @@ - shape: !type:PhysShapeCircle radius: 0.2 - mass: 5 + mass: 1 mask: - FlyingMobMask layer: @@ -330,7 +350,7 @@ - shape: !type:PhysShapeCircle radius: 0.40 - mass: 45 + mass: 700 mask: - MobMask layer: @@ -390,7 +410,7 @@ - shape: !type:PhysShapeCircle radius: 0.35 - mass: 5 + mass: 2 mask: - MobMask layer: @@ -427,6 +447,16 @@ - map: ["enum.DamageStateVisualLayers.Base"] state: goat sprite: Mobs/Animals/goat.rsi + - type: Fixtures + fixtures: + - shape: + !type:PhysShapeCircle + radius: 0.35 + mass: 60 + mask: + - MobMask + layer: + - MobLayer - type: Appearance - type: DamageStateVisuals states: @@ -476,6 +506,16 @@ state: goose sprite: Mobs/Animals/goose.rsi - type: Appearance + - type: Fixtures + fixtures: + - shape: + !type:PhysShapeCircle + radius: 0.35 + mass: 10 + mask: + - MobMask + layer: + - MobLayer - type: DamageStateVisuals states: Alive: @@ -516,7 +556,7 @@ - shape: !type:PhysShapeCircle radius: 0.48 - mass: 60 + mass: 150 mask: - MobMask layer: @@ -553,17 +593,17 @@ - map: ["enum.DamageStateVisualLayers.Base"] state: kangaroo sprite: Mobs/Animals/kangaroo.rsi - - type: Physics - type: Fixtures fixtures: - shape: !type:PhysShapeCircle - radius: 0.25 - mass: 60 + radius: 0.35 + mass: 50 mask: - MobMask layer: - MobLayer + - type: Physics - type: Appearance - type: DamageStateVisuals states: @@ -627,6 +667,16 @@ flavorKind: primate - type: Inventory templateId: monkey + - type: Fixtures + fixtures: + - shape: + !type:PhysShapeCircle + radius: 0.35 + mass: 30 + mask: + - MobMask + layer: + - MobLayer - type: Strippable - type: UserInterface interfaces: @@ -898,7 +948,7 @@ - shape: !type:PhysShapeCircle radius: 0.2 - mass: 5 + mass: 1 mask: - MobMask layer: @@ -944,7 +994,7 @@ - shape: !type:PhysShapeCircle radius: 0.2 - mass: 2 + mass: 1 mask: - SmallMobMask layer: @@ -993,7 +1043,7 @@ - shape: !type:PhysShapeCircle radius: 0.25 - mass: 5 + mass: 2 mask: - FlyingMobMask layer: @@ -1091,7 +1141,7 @@ - shape: !type:PhysShapeCircle radius: 0.25 - mass: 10 + mass: 5 mask: - MobMask layer: @@ -1149,7 +1199,7 @@ - shape: !type:PhysShapeCircle radius: 0.25 - mass: 8 + mass: 2 mask: - SmallMobMask layer: @@ -1199,7 +1249,7 @@ - shape: !type:PhysShapeCircle radius: 0.35 - mass: 25 + mass: 50 mask: - MobMask layer: @@ -1384,7 +1434,7 @@ - shape: !type:PhysShapeCircle radius: 0.35 - mass: 20 + mass: 20 #They actually are pretty light, I looked it up mask: - MobMask layer: diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/bear.yml b/Resources/Prototypes/Entities/Mobs/NPCs/bear.yml index 200b7a9ca9..ba9af548d0 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/bear.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/bear.yml @@ -22,7 +22,7 @@ - shape: !type:PhysShapeCircle radius: 0.5 - mass: 100 + mass: 320 mask: - MobMask layer: diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml b/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml index 34b9eda4eb..d9382cc82e 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml @@ -28,7 +28,7 @@ - shape: !type:PhysShapeCircle radius: 0.40 - mass: 20 + mass: 40 mask: - MobMask layer: diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/mimic.yml b/Resources/Prototypes/Entities/Mobs/NPCs/mimic.yml index ad63d17a8a..0fec7f1e9d 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/mimic.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/mimic.yml @@ -28,7 +28,7 @@ - shape: !type:PhysShapeAabb bounds: "-0.35,-0.35,0.35,0.35" - mass: 100 + mass: 500 mask: - MobMask layer: diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml b/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml index cfb97fcbc7..c2a1d97ece 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml @@ -19,7 +19,7 @@ - shape: !type:PhysShapeCircle radius: 0.35 - mass: 20 + mass: 12 mask: - MobMask layer: @@ -243,7 +243,7 @@ - shape: !type:PhysShapeCircle radius: 0.35 - mass: 20 + mass: 5 mask: - MobMask layer: @@ -380,6 +380,16 @@ parent: MobCatCaracal description: He out here. components: + - type: Fixtures + fixtures: + - shape: + !type:PhysShapeCircle + radius: 0.35 + mass: 15 + mask: + - MobMask + layer: + - MobLayer - type: Grammar attributes: gender: male @@ -405,7 +415,7 @@ - shape: !type:PhysShapeCircle radius: 0.35 - mass: 20 + mass: 6 mask: - MobMask layer: @@ -451,7 +461,7 @@ - shape: !type:PhysShapeCircle radius: 0.35 - mass: 20 + mass: 2 mask: - MobMask layer: @@ -508,7 +518,7 @@ - shape: !type:PhysShapeCircle radius: 0.35 - mass: 20 + mass: 5 mask: - MobMask layer: @@ -554,7 +564,7 @@ - shape: !type:PhysShapeCircle radius: 0.35 - mass: 20 + mass: 8 mask: - MobMask layer: diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml b/Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml index 97af3b220a..3e30f9b6fe 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml @@ -153,7 +153,7 @@ - shape: !type:PhysShapeCircle radius: 0.2 - mass: 10 + mass: 4 #Bulky by mouse standards... mask: - SmallMobMask layer: diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml b/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml index c9d241d9a2..b9f9c1905f 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml @@ -32,7 +32,7 @@ - shape: !type:PhysShapeCircle radius: 0.25 - mass: 120 + mass: 200 mask: - MobMask layer: @@ -93,8 +93,10 @@ tags: - CannotSuicide - DoorBumpOpener - - FootstepSound + - FootstepSound - type: NoSlip + - type: Perishable #Ummmm the acid kills a lot of the bacteria or something + molsPerSecondPerUnitMass: 0.0005 - type: entity name: Praetorian @@ -120,7 +122,7 @@ - shape: !type:PhysShapeCircle radius: 0.45 - mass: 120 + mass: 250 mask: - MobMask layer: @@ -153,7 +155,7 @@ - shape: !type:PhysShapeCircle radius: 0.45 - mass: 120 + mass: 200 mask: - MobMask layer: @@ -191,7 +193,7 @@ - shape: !type:PhysShapeCircle radius: 0.45 - mass: 120 + mass: 10000 mask: - MobMask layer: @@ -229,7 +231,7 @@ - shape: !type:PhysShapeCircle radius: 0.45 - mass: 120 + mass: 600 mask: - MobMask layer: @@ -267,7 +269,7 @@ - shape: !type:PhysShapeCircle radius: 0.45 - mass: 120 + mass: 150 mask: - MobMask layer: @@ -307,7 +309,7 @@ - shape: !type:PhysShapeCircle radius: 0.45 - mass: 120 + mass: 150 mask: - MobMask layer: @@ -365,6 +367,16 @@ solution: melee - type: SolutionTransfer maxTransferAmount: 3 + - type: Fixtures + fixtures: + - shape: + !type:PhysShapeCircle + radius: 0.35 + mass: 10 + mask: + - MobMask + layer: + - MobLayer - type: entity name: space adder diff --git a/Resources/Prototypes/Reagents/gases.yml b/Resources/Prototypes/Reagents/gases.yml index 85985e965e..5eaa92088c 100644 --- a/Resources/Prototypes/Reagents/gases.yml +++ b/Resources/Prototypes/Reagents/gases.yml @@ -198,6 +198,14 @@ - !type:ReagentThreshold reagent: Miasma min: 0.8 + - !type:PopupMessage + type: Local + messages: [ "miasma-smell" ] + probability: 0.1 + conditions: + - !type:ReagentThreshold + reagent: Miasma + min: 0.25 - !type:HealthChange conditions: - !type:OrganType