diff --git a/Content.Shared/Body/Systems/SharedBloodstreamSystem.cs b/Content.Shared/Body/Systems/SharedBloodstreamSystem.cs index 5f3794acd2..e86fd0c06b 100644 --- a/Content.Shared/Body/Systems/SharedBloodstreamSystem.cs +++ b/Content.Shared/Body/Systems/SharedBloodstreamSystem.cs @@ -1,4 +1,3 @@ -using System.Linq; using Content.Shared.Alert; using Content.Shared.Body.Components; using Content.Shared.Body.Events; @@ -71,49 +70,41 @@ public abstract class SharedBloodstreamSystem : EntitySystem bloodstream.NextUpdate += bloodstream.AdjustedUpdateInterval; DirtyField(uid, bloodstream, nameof(BloodstreamComponent.NextUpdate)); // needs to be dirtied on the client so it can be rerolled during prediction - if (!SolutionContainer.ResolveSolution(uid, bloodstream.BloodSolutionName, ref bloodstream.BloodSolution, out var bloodSolution)) + if (!SolutionContainer.ResolveSolution(uid, bloodstream.BloodSolutionName, ref bloodstream.BloodSolution)) continue; // Blood level regulation. Must be alive. - TryRegulateBloodLevel(uid, bloodstream.BloodRefreshAmount); - - // Removes blood from the bloodstream based on bleed amount (bleed rate) - // as well as stop their bleeding to a certain extent. - if (bloodstream.BleedAmount > 0) + if (!_mobStateSystem.IsDead(uid)) { - var ev = new BleedModifierEvent(bloodstream.BleedAmount, bloodstream.BleedReductionAmount); - RaiseLocalEvent(uid, ref ev); + TryRegulateBloodLevel(uid, bloodstream.BloodRefreshAmount); - // Blood is removed from the bloodstream at a 1-1 rate with the bleed amount - TryBleedOut((uid, bloodstream), ev.BleedAmount); + TickBleed((uid, bloodstream)); - // Bleed rate is reduced by the bleed reduction amount in the bloodstream component. - TryModifyBleedAmount((uid, bloodstream), -ev.BleedReductionAmount); + // deal bloodloss damage if their blood level is below a threshold. + var bloodPercentage = GetBloodLevel(uid); + if (bloodPercentage < bloodstream.BloodlossThreshold) + { + // bloodloss damage is based on the base value, and modified by how low your blood level is. + var amt = bloodstream.BloodlossDamage / (0.1f + bloodPercentage); + + _damageableSystem.TryChangeDamage(uid, amt, ignoreResistances: false, interruptsDoAfters: false); + + // Apply dizziness as a symptom of bloodloss. + // The effect is applied in a way that it will never be cleared without being healthy. + // Multiplying by 2 is arbitrary but works for this case, it just prevents the time from running out + _status.TrySetStatusEffectDuration(uid, Bloodloss); + } + else + { + // If they're healthy, we'll try and heal some bloodloss instead. + _damageableSystem.TryChangeDamage(uid, bloodstream.BloodlossHealDamage * bloodPercentage, ignoreResistances: true, interruptsDoAfters: false); + + _status.TryRemoveStatusEffect(uid, Bloodloss); + } } - - // deal bloodloss damage if their blood level is below a threshold. - var bloodPercentage = GetBloodLevel(uid); - if (bloodPercentage < bloodstream.BloodlossThreshold && !_mobStateSystem.IsDead(uid)) + else { - // bloodloss damage is based on the base value, and modified by how low your blood level is. - var amt = bloodstream.BloodlossDamage / (0.1f + bloodPercentage); - - _damageableSystem.TryChangeDamage(uid, amt, ignoreResistances: false, interruptsDoAfters: false); - - // Apply dizziness as a symptom of bloodloss. - // The effect is applied in a way that it will never be cleared without being healthy. - // Multiplying by 2 is arbitrary but works for this case, it just prevents the time from running out - _status.TrySetStatusEffectDuration(uid, Bloodloss); - } - else if (!_mobStateSystem.IsDead(uid)) - { - // If they're healthy, we'll try and heal some bloodloss instead. - _damageableSystem.TryChangeDamage( - uid, - bloodstream.BloodlossHealDamage * bloodPercentage, - ignoreResistances: true, interruptsDoAfters: false); - - _status.TryRemoveStatusEffect(uid, Bloodloss); + TickBleed((uid, bloodstream)); } } } @@ -437,6 +428,23 @@ public abstract class SharedBloodstreamSystem : EntitySystem return true; } + public void TickBleed(Entity entity) + { + // Removes blood from the bloodstream based on bleed amount (bleed rate) + // as well as stop their bleeding to a certain extent. + if (entity.Comp.BleedAmount <= 0) + return; + + var ev = new BleedModifierEvent(entity.Comp.BleedAmount, entity.Comp.BleedReductionAmount); + RaiseLocalEvent(entity, ref ev); + + // Blood is removed from the bloodstream at a 1-1 rate with the bleed amount + TryBleedOut(entity.AsNullable(), ev.BleedAmount); + + // Bleed rate is reduced by the bleed reduction amount in the bloodstream component. + TryModifyBleedAmount(entity.AsNullable(), -ev.BleedReductionAmount); + } + /// /// Removes blood by spilling out the bloodstream. /// diff --git a/Content.Shared/Magic/SharedMagicSystem.cs b/Content.Shared/Magic/SharedMagicSystem.cs index 3301180e8a..7fb13ff866 100644 --- a/Content.Shared/Magic/SharedMagicSystem.cs +++ b/Content.Shared/Magic/SharedMagicSystem.cs @@ -284,7 +284,7 @@ public abstract class SharedMagicSystem : EntitySystem var ent = Spawn(ev.Prototype, fromMap); var direction = _transform.ToMapCoordinates(toCoords).Position - fromMap.Position; - _gunSystem.ShootProjectile(ent, direction, userVelocity, ev.Performer, ev.Performer); + _gunSystem.ShootProjectile(ent, direction, userVelocity, ev.Performer, ev.Performer, 25f); } // End Projectile Spells #endregion diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Basic/base_pka.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Basic/base_pka.yml index 3107a50cfc..52e033f2f9 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Basic/base_pka.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Basic/base_pka.yml @@ -24,6 +24,7 @@ - SemiAuto soundGunshot: path: /Audio/Weapons/Guns/Gunshots/kinetic_accel.ogg + projectileSpeed: 25 - type: AmmoCounter - type: Appearance - type: GenericVisualizer diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Basic/staves.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Basic/staves.yml index ffe8af3e0f..8e021e6c67 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Basic/staves.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Basic/staves.yml @@ -14,6 +14,7 @@ - type: Gun soundGunshot: path: /Audio/Weapons/Guns/Gunshots/Magic/staff_healing.ogg + projectileSpeed: 25 - type: BasicEntityAmmoProvider proto: ProjectileHealingBolt capacity: 10 @@ -34,6 +35,7 @@ - type: Gun soundGunshot: path: /Audio/Weapons/Guns/Gunshots/Magic/staff_door.ogg + projectileSpeed: 25 - type: BasicEntityAmmoProvider proto: ProjectilePolyboltDoor capacity: 10 diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Basic/wands.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Basic/wands.yml index d3745288f6..d27e648b95 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Basic/wands.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Basic/wands.yml @@ -11,6 +11,7 @@ - type: Gun soundGunshot: path: /Audio/Weapons/Guns/Gunshots/Magic/staff_animation.ogg + projectileSpeed: 25 - type: BasicEntityAmmoProvider proto: ProjectilePolyboltCarp capacity: 5 @@ -52,6 +53,7 @@ fireRate: 0.25 soundGunshot: path: /Audio/Magic/fireball.ogg + projectileSpeed: 25 - type: BasicEntityAmmoProvider proto: ProjectileFireball capacity: 5 @@ -72,6 +74,7 @@ - type: Gun soundGunshot: path: /Audio/Weapons/Guns/Gunshots/Magic/staff_animation.ogg + projectileSpeed: 25 - type: BasicEntityAmmoProvider proto: ProjectileLocker capacity: 5 @@ -107,6 +110,7 @@ - type: Gun soundGunshot: path: /Audio/Weapons/Guns/Gunshots/mateba.ogg # PUNCH + projectileSpeed: 25 - type: BasicEntityAmmoProvider proto: BulletInstakillMagic capacity: 3 @@ -126,6 +130,7 @@ - type: Gun soundGunshot: path: /Audio/Weapons/Guns/Gunshots/Magic/staff_door.ogg + projectileSpeed: 25 - type: BasicEntityAmmoProvider proto: ProjectilePolyboltDoor capacity: 10 diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml index 9e4a1a644d..e06c59536d 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml @@ -633,6 +633,7 @@ fireRate: 0.5 soundGunshot: path: /Audio/Weapons/Guns/Gunshots/taser.ogg + projectileSpeed: 25 - type: BatteryAmmoProvider proto: BulletTaser fireCost: 200 @@ -985,7 +986,7 @@ components: - type: BatterySelfRecharger autoRechargeRate: 30 - # "remove" wield bonus and penalty so borgs can use it + # "remove" wield bonus and penalty so borgs can use it - type: GunWieldBonus minAngle: 0 maxAngle: 0 diff --git a/Resources/Prototypes/Recipes/Reactions/cleaning.yml b/Resources/Prototypes/Recipes/Reactions/cleaning.yml index 079e1bf747..f3440b6efd 100644 --- a/Resources/Prototypes/Recipes/Reactions/cleaning.yml +++ b/Resources/Prototypes/Recipes/Reactions/cleaning.yml @@ -12,6 +12,8 @@ - type: reaction id: AmmoniaFromBlood + requiredMixerCategories: + - Stir # prevents evaporating vox blood, TODO: make it react only X units per second; make bloodstream an open thermal system minTemp: 370 reactants: AmmoniaBlood: