Refactors radiation (#2009)
* Work on refactoring radiation. * mmmm grayons * fixes * Now you can specify whether the pulse will decay or not * whoops * Move IRadiationAct to shared, make DamageableComponent implement it instead and add metallic resistances to walls * General improvements, send draw and decay with state. Rename DPS to RadsPerSecond * E N T I T Y C O O R D I N A T E S * Entity coordinates goood * Remove unused using statements * resistances: metallicResistances * - type: Breakable moment Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
2927ab5cd1
commit
6ec2939f15
@@ -6,19 +6,35 @@ using Robust.Shared.GameObjects;
|
||||
namespace Content.Client.GameObjects.Components.StationEvents
|
||||
{
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(SharedRadiationPulseComponent))]
|
||||
public sealed class RadiationPulseComponent : SharedRadiationPulseComponent
|
||||
{
|
||||
public TimeSpan EndTime { get; private set; }
|
||||
|
||||
private bool _draw;
|
||||
private bool _decay;
|
||||
private float _radsPerSecond;
|
||||
private float _range;
|
||||
private TimeSpan _endTime;
|
||||
|
||||
public override float RadsPerSecond => _radsPerSecond;
|
||||
public override float Range => _range;
|
||||
public override TimeSpan EndTime => _endTime;
|
||||
public override bool Draw => _draw;
|
||||
public override bool Decay => _decay;
|
||||
|
||||
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
|
||||
{
|
||||
base.HandleComponentState(curState, nextState);
|
||||
if (!(curState is RadiationPulseMessage state))
|
||||
|
||||
if (!(curState is RadiationPulseState state))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EndTime = state.EndTime;
|
||||
_radsPerSecond = state.RadsPerSecond;
|
||||
_range = state.Range;
|
||||
_draw = state.Draw;
|
||||
_decay = state.Decay;
|
||||
_endTime = state.EndTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user