Move entity effects definitions to shared (#35614)
* Move entity effects to shared * relocate spawning to server * Generic version of EntityEffect for just raising event. * genericise everything * oops forgot to push you * some condensation * finish rebas * unwhite the space * oops forgot nuke * bad rebase fix * useless annotations begone --------- Co-authored-by: EmoGarbage404 <retron404@gmail.com>
This commit is contained in:
committed by
GitHub
parent
7ba81173bd
commit
bf41de18aa
@@ -0,0 +1,39 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.EntityEffects.EffectConditions;
|
||||
|
||||
/// <summary>
|
||||
/// Requires the solution to be above or below a certain temperature.
|
||||
/// Used for things like explosives.
|
||||
/// </summary>
|
||||
public sealed partial class SolutionTemperature : EntityEffectCondition
|
||||
{
|
||||
[DataField]
|
||||
public float Min = 0.0f;
|
||||
|
||||
[DataField]
|
||||
public float Max = float.PositiveInfinity;
|
||||
public override bool Condition(EntityEffectBaseArgs args)
|
||||
{
|
||||
if (args is EntityEffectReagentArgs reagentArgs)
|
||||
{
|
||||
if (reagentArgs.Source == null)
|
||||
return false;
|
||||
if (reagentArgs.Source.Temperature < Min)
|
||||
return false;
|
||||
if (reagentArgs.Source.Temperature > Max)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// TODO: Someone needs to figure out how to do this for non-reagent effects.
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override string GuidebookExplanation(IPrototypeManager prototype)
|
||||
{
|
||||
return Loc.GetString("reagent-effect-condition-guidebook-solution-temperature",
|
||||
("max", float.IsPositiveInfinity(Max) ? (float) int.MaxValue : Max),
|
||||
("min", Min));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user