New Projectile Effect:Temperature Change (#31004)
* bah * all done, thanks slarti * makes the watcher do the thing * Update TemperatureSystem.cs Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com> * changes something --------- Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
using Content.Server.Temperature.Systems;
|
||||||
|
using Content.Server.Temperature.Components;
|
||||||
|
using Content.Shared.Temperature;
|
||||||
|
|
||||||
|
namespace Content.Server.Temperature.Components;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Put this component on a projectile that you would like to change the temperature on whatever it hits.
|
||||||
|
/// </summary>
|
||||||
|
[RegisterComponent, Access(typeof(TemperatureSystem))]
|
||||||
|
public sealed partial class ChangeTemperatureOnCollideComponent : Component
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The amount it changes the target's temperature by. In Joules.
|
||||||
|
/// </summary>
|
||||||
|
[DataField]
|
||||||
|
public float Heat = 0f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// If this heat change ignores heat resistance or not.
|
||||||
|
/// </summary>
|
||||||
|
[DataField]
|
||||||
|
public bool IgnoreHeatResistance = true;
|
||||||
|
}
|
||||||
@@ -12,6 +12,8 @@ using Content.Shared.Rejuvenate;
|
|||||||
using Content.Shared.Temperature;
|
using Content.Shared.Temperature;
|
||||||
using Robust.Shared.Physics.Components;
|
using Robust.Shared.Physics.Components;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
|
using Robust.Shared.Physics.Events;
|
||||||
|
using Content.Shared.Projectiles;
|
||||||
|
|
||||||
namespace Content.Server.Temperature.Systems;
|
namespace Content.Server.Temperature.Systems;
|
||||||
|
|
||||||
@@ -21,6 +23,7 @@ public sealed class TemperatureSystem : EntitySystem
|
|||||||
[Dependency] private readonly AtmosphereSystem _atmosphere = default!;
|
[Dependency] private readonly AtmosphereSystem _atmosphere = default!;
|
||||||
[Dependency] private readonly DamageableSystem _damageable = default!;
|
[Dependency] private readonly DamageableSystem _damageable = default!;
|
||||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||||
|
[Dependency] private readonly TemperatureSystem _temperature = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// All the components that will have their damage updated at the end of the tick.
|
/// All the components that will have their damage updated at the end of the tick.
|
||||||
@@ -47,6 +50,8 @@ public sealed class TemperatureSystem : EntitySystem
|
|||||||
|
|
||||||
SubscribeLocalEvent<InternalTemperatureComponent, MapInitEvent>(OnInit);
|
SubscribeLocalEvent<InternalTemperatureComponent, MapInitEvent>(OnInit);
|
||||||
|
|
||||||
|
SubscribeLocalEvent<ChangeTemperatureOnCollideComponent, ProjectileHitEvent>(ChangeTemperatureOnCollide);
|
||||||
|
|
||||||
// Allows overriding thresholds based on the parent's thresholds.
|
// Allows overriding thresholds based on the parent's thresholds.
|
||||||
SubscribeLocalEvent<TemperatureComponent, EntParentChangedMessage>(OnParentChange);
|
SubscribeLocalEvent<TemperatureComponent, EntParentChangedMessage>(OnParentChange);
|
||||||
SubscribeLocalEvent<ContainerTemperatureDamageThresholdsComponent, ComponentStartup>(
|
SubscribeLocalEvent<ContainerTemperatureDamageThresholdsComponent, ComponentStartup>(
|
||||||
@@ -300,6 +305,11 @@ public sealed class TemperatureSystem : EntitySystem
|
|||||||
args.Args.TemperatureDelta *= ev.Coefficient;
|
args.Args.TemperatureDelta *= ev.Coefficient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ChangeTemperatureOnCollide(Entity<ChangeTemperatureOnCollideComponent> ent, ref ProjectileHitEvent args)
|
||||||
|
{
|
||||||
|
_temperature.ChangeHeat(args.Target, ent.Comp.Heat, ent.Comp.IgnoreHeatResistance);// adjust the temperature
|
||||||
|
}
|
||||||
|
|
||||||
private void OnParentChange(EntityUid uid, TemperatureComponent component,
|
private void OnParentChange(EntityUid uid, TemperatureComponent component,
|
||||||
ref EntParentChangedMessage args)
|
ref EntParentChangedMessage args)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -345,16 +345,16 @@
|
|||||||
mask:
|
mask:
|
||||||
- Opaque
|
- Opaque
|
||||||
fly-by: *flybyfixture
|
fly-by: *flybyfixture
|
||||||
- type: StaminaDamageOnCollide
|
|
||||||
damage: 40
|
|
||||||
- type: Projectile
|
- type: Projectile
|
||||||
# soundHit: Waiting on serv3
|
# soundHit: Waiting on serv3
|
||||||
impactEffect: BulletImpactEffectDisabler
|
impactEffect: BulletImpactEffectDisabler
|
||||||
damage:
|
damage:
|
||||||
types:
|
types:
|
||||||
Cold: 10
|
Cold: 0
|
||||||
- type: TimedDespawn
|
- type: TimedDespawn
|
||||||
lifetime: 3
|
lifetime: 3
|
||||||
|
- type: ChangeTemperatureOnCollide
|
||||||
|
heat: -50000
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: magmawing watcher bolt
|
name: magmawing watcher bolt
|
||||||
@@ -373,7 +373,9 @@
|
|||||||
impactEffect: BulletImpactEffectOrangeDisabler
|
impactEffect: BulletImpactEffectOrangeDisabler
|
||||||
damage:
|
damage:
|
||||||
types:
|
types:
|
||||||
Heat: 10
|
Heat: 0
|
||||||
|
- type: ChangeTemperatureOnCollide
|
||||||
|
heat: 50000
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: BulletKinetic
|
id: BulletKinetic
|
||||||
|
|||||||
Reference in New Issue
Block a user