/// Returns true if this solution entity has an amount of reagent in it within a specified minimum and maximum.
/// </summary>
/// <inheritdoc cref="EntityConditionSystem{T, TCondition}"/>
-public sealed partial class ReagentThresholdEntityConditionSystem : EntityConditionSystem<SolutionComponent, ReagentCondition>
+public sealed partial class ReagentEntityConditionSystem : EntityConditionSystem<SolutionComponent, ReagentCondition>
{
protected override void Condition(Entity<SolutionComponent> entity, ref EntityConditionEvent<ReagentCondition> args)
{
[DataField]
public bool Predicted = true;
- /// <inheritdoc cref="EntityEffect.Scaling"/>
- public override bool Scaling => true;
-
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("entity-effect-guidebook-spawn-entity",
("chance", Probability),
/// </summary>
[DataField(required: true)] public SoundSpecifier Sound = default!;
- public override bool Scaling => true;
-
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("entity-effect-guidebook-area-reaction",
("duration", Duration)
[DataField]
public TimeSpan Duration = TimeSpan.FromSeconds(15);
- public override bool Scaling => true;
-
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("entity-effect-guidebook-emp-reaction-effect", ("chance", Probability));
[DataField]
public float TileBreakScale = 1f;
- public override bool Scaling => true;
-
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("entity-effect-guidebook-explosion", ("chance", Probability));
[DataField]
public SoundSpecifier? Sound = new SoundPathSpecifier("/Audio/Weapons/flash.ogg");
- public override bool Scaling => true;
-
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("entity-effect-guidebook-flash-reaction-effect", ("chance", Probability));
}
/// If true, then it allows the scale multiplier to go above 1.
/// </summary>
[DataField]
- public virtual bool Scaling { get; private set; }
+ public virtual bool Scaling { get; private set; } = true;
// TODO: This should be an entity condition but guidebook relies on it heavily for formatting...
/// <summary>
private void OnReactive(Entity<ReactiveComponent> entity, ref ReactionEntityEvent args)
{
- if (args.Reagent.ReactiveEffects == null || entity.Comp.ReactiveGroups == null)
- return;
-
var scale = args.ReagentQuantity.Quantity.Float();
- foreach (var (key, val) in args.Reagent.ReactiveEffects)
+ if (args.Reagent.ReactiveEffects != null && entity.Comp.ReactiveGroups != null)
{
- if (!val.Methods.Contains(args.Method))
- continue;
+ foreach (var (key, val) in args.Reagent.ReactiveEffects)
+ {
+ if (!val.Methods.Contains(args.Method))
+ continue;
- if (!entity.Comp.ReactiveGroups.TryGetValue(key, out var group))
- continue;
+ if (!entity.Comp.ReactiveGroups.TryGetValue(key, out var group))
+ continue;
- if (!group.Contains(args.Method))
- continue;
+ if (!group.Contains(args.Method))
+ continue;
- ApplyEffects(entity, val.Effects, scale);
+ ApplyEffects(entity, val.Effects, scale);
+ }
}
- if (entity.Comp.Reactions == null)
- return;
-
- foreach (var entry in entity.Comp.Reactions)
+ if (entity.Comp.Reactions != null)
{
- if (!entry.Methods.Contains(args.Method))
- continue;
-
- if (entry.Reagents == null || entry.Reagents.Contains(args.Reagent.ID))
- ApplyEffects(entity, entry.Effects, scale);
+ foreach (var entry in entity.Comp.Reactions)
+ {
+ if (!entry.Methods.Contains(args.Method))
+ continue;
+
+ if (entry.Reagents == null || entry.Reagents.Contains(args.Reagent.ID))
+ ApplyEffects(entity, entry.Effects, scale);
+ }
}
}
methods: [ Touch ]
effects:
- !type:HealthChange
- scaling: true
damage:
groups:
Brute: -0.15
methods: [ Touch ]
effects:
- !type:HealthChange
- scaling: true
damage:
groups:
Brute: -0.25
methods: [ Touch ]
effects:
- !type:HealthChange
- scaling: true
damage:
groups:
Brute: -1
methods: [ Touch ]
effects:
- !type:HealthChange
- scaling: true
damage:
types:
Heat: 1
methods: [ Touch ]
effects:
- !type:HealthChange
- scaling: true
damage:
types:
Heat: 0.05 #Same as slime species
methods: [Touch, Ingestion, Injection]
effects:
- !type:HealthChange
- scaling: true
damage:
types:
Caustic: 1
methods: [ Touch ]
effects:
- !type:HealthChange
- scaling: true
damage:
types:
Blunt: 0.05
methods: [ Touch ]
effects:
- !type:HealthChange
- scaling: true
damage:
types:
Poison: 0.125
methods: [ Touch ]
effects: # TODO: when magic is around - make a milk transformation to a skeleton monster
- !type:HealthChange
- scaling: true
damage:
groups:
Burn: -1 # healing obviously up to discussion
methods: [ Touch ]
effects:
- !type:HealthChange
- scaling: true
damage:
types:
Heat: 0.05
methods: [Touch]
effects:
- !type:HealthChange
- scaling: true
damage:
types:
Heat: 0.5
Gas:
effects:
- !type:HealthChange
- scaling: true
ignoreResistances: true
conditions:
- !type:MetabolizerTypeCondition
- !type:ReagentCondition
reagent: Ammonia
min: 1
- scaling: true
ignoreResistances: true
damage:
groups:
methods: [ Touch ]
effects:
- !type:HealthChange
- scaling: true
ignoreResistances: false
damage:
types:
methods: [ Touch ]
effects:
- !type:HealthChange
- scaling: true
ignoreResistances: false
damage:
types:
Poison:
effects:
- !type:Oxygenate
- scaling: true
conditions:
- !type:MetabolizerTypeCondition
type: [ Human, Animal, Rat, Plant ]
# Convert Oxygen into CO2.
- !type:ModifyLungGas
- scaling: true
conditions:
- !type:MetabolizerTypeCondition
type: [ Vox ]
conditions:
- !type:MetabolizerTypeCondition
type: [ Vox ]
- scaling: true
ignoreResistances: true
damage:
types:
Gas:
effects:
- !type:Oxygenate
- scaling: true
conditions:
- !type:MetabolizerTypeCondition
type: [ Human, Animal, Rat, Plant ]
# Convert Oxygen into CO2.
- !type:ModifyLungGas
- scaling: true
conditions:
- !type:MetabolizerTypeCondition
type: [ Vox ]
conditions:
- !type:MetabolizerTypeCondition
type: [ Vox ]
- scaling: true
ignoreResistances: true
damage:
types:
Gas:
effects:
- !type:HealthChange
- scaling: true
ignoreResistances: true
damage:
types:
Gas:
effects:
- !type:HealthChange
- scaling: true
ignoreResistances: true
damage:
types:
Poison:
effects:
- !type:Oxygenate
- scaling: true
conditions:
- !type:MetabolizerTypeCondition
type: [ Plant ]
- !type:MetabolizerTypeCondition
type: [ Plant, Vox ]
inverted: true
- scaling: true
ignoreResistances: true
damage:
types:
Poison:
0.4
- !type:Oxygenate
- scaling: true
conditions:
- !type:MetabolizerTypeCondition
type: [ Plant ]
Gas:
effects:
- !type:Oxygenate
- scaling: true
conditions:
- !type:MetabolizerTypeCondition
type: [ Plant ]
inverted: true
# Don't want people to get toxin damage from the gas they just
# exhaled, right?
- scaling: true
ignoreResistances: true
damage:
types:
Poison:
0.8
- !type:Oxygenate # carbon dioxide displaces oxygen from the bloodstream, causing asphyxiation
- scaling: true
conditions:
- !type:MetabolizerTypeCondition
type: [ Plant ]
Gas:
effects:
- !type:Oxygenate
- scaling: true
conditions:
- !type:MetabolizerTypeCondition
type: [ Vox, Slime ]
# Converts Nitrogen into Ammonia
- !type:ModifyLungGas
- scaling: true
conditions:
- !type:MetabolizerTypeCondition
type: [ Vox ]
Ammonia: 1.0
Nitrogen: -1.0
- !type:ModifyLungGas
- scaling: true
conditions:
- !type:MetabolizerTypeCondition
type: [ Slime ]
Narcotic:
effects:
- !type:HealthChange
- scaling: true
ignoreResistances: true
damage:
types:
effects:
- !type:HealthChange
minScale: 1
- scaling: true
ignoreResistances: true
damage:
types:
methods: [ Touch ]
effects:
- !type:HealthChange
- scaling: true
ignoreResistances: false
damage:
types:
methods: [ Touch ]
effects:
- !type:HealthChange
- scaling: true
ignoreResistances: false
damage:
types:
- !type:SatiateThirst
factor: -1.5
- !type:HealthChange
- scaling: true
ignoreResistances: true
damage:
types:
methods: [ Touch ]
effects:
- !type:HealthChange
- scaling: true
ignoreResistances: false
damage:
types:
methods: [ Touch ]
effects:
- !type:HealthChange
- scaling: true
ignoreResistances: false
damage:
types: