Mild Entity Effect/Condition Cleanup (#41059)

* Commit

* ploop

* borger

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
Princess Cheeseballs
2025-10-23 16:35:59 -07:00
committed by GitHub
parent 3ff86e794e
commit d4a32ce502
22 changed files with 42 additions and 41 deletions

View File

@@ -1,6 +1,6 @@
using Content.Server.Explosion.EntitySystems;
using Content.Shared.EntityEffects;
using Content.Shared.EntityEffects.Effects.Transform;
using Content.Shared.EntityEffects.Effects;
using Content.Shared.Explosion.Components;
namespace Content.Server.EntityEffects.Effects;
@@ -9,11 +9,11 @@ namespace Content.Server.EntityEffects.Effects;
/// Makes this entity explode using its <see cref="ExplosiveComponent"/>.
/// </summary>
/// <inheritdoc cref="EntityEffectSystem{T,TEffect}"/>
public sealed partial class ExplodeEntityEffectSystem : EntityEffectSystem<ExplosiveComponent, ExplodeEffect>
public sealed partial class ExplodeEntityEffectSystem : EntityEffectSystem<ExplosiveComponent, Explode>
{
[Dependency] private readonly ExplosionSystem _explosion = default!;
protected override void Effect(Entity<ExplosiveComponent> entity, ref EntityEffectEvent<ExplodeEffect> args)
protected override void Effect(Entity<ExplosiveComponent> entity, ref EntityEffectEvent<Explode> args)
{
_explosion.TriggerExplosive(entity, entity, args.Effect.Delete, args.Effect.Intensity, args.Effect.Radius, args.User);
}

View File

@@ -1,6 +1,6 @@
using Content.Server.Explosion.EntitySystems;
using Content.Shared.EntityEffects;
using Content.Shared.EntityEffects.Effects.Transform;
using ExplosionEffect = Content.Shared.EntityEffects.Effects.Transform.Explosion;
namespace Content.Server.EntityEffects.Effects.Transform;

View File

@@ -6,5 +6,5 @@ namespace Content.Shared.EntityConditions.Conditions.Body;
public sealed partial class BreathingCondition : EntityConditionBase<BreathingCondition>
{
public override string EntityConditionGuidebookText(IPrototypeManager prototype) =>
Loc.GetString("reagent-effect-condition-guidebook-breathing", ("isBreathing", !Inverted));
Loc.GetString("entity-condition-guidebook-breathing", ("isBreathing", !Inverted));
}

View File

@@ -29,5 +29,5 @@ public sealed partial class HungerCondition : EntityConditionBase<HungerConditio
public float Max = float.PositiveInfinity;
public override string EntityConditionGuidebookText(IPrototypeManager prototype) =>
Loc.GetString("reagent-effect-condition-guidebook-total-hunger", ("max", float.IsPositiveInfinity(Max) ? int.MaxValue : Max), ("min", Min));
Loc.GetString("entity-condition-guidebook-total-hunger", ("max", float.IsPositiveInfinity(Max) ? int.MaxValue : Max), ("min", Min));
}

View File

@@ -19,5 +19,5 @@ public sealed partial class InternalsOnEntityConditionSystem : EntityConditionSy
public sealed partial class InternalsCondition : EntityConditionBase<InternalsCondition>
{
public override string EntityConditionGuidebookText(IPrototypeManager prototype) =>
Loc.GetString("reagent-effect-condition-guidebook-internals", ("usingInternals", !Inverted));
Loc.GetString("entity-condition-guidebook-internals", ("usingInternals", !Inverted));
}

View File

@@ -24,7 +24,7 @@ public sealed partial class MetabolizerTypeCondition : EntityConditionBase<Metab
var names = ContentLocalizationManager.FormatListToOr(typeList);
return Loc.GetString("reagent-effect-condition-guidebook-organ-type",
return Loc.GetString("entity-condition-guidebook-organ-type",
("name", names),
("shouldhave", !Inverted));
}

View File

@@ -24,5 +24,5 @@ public sealed partial class MobStateCondition : EntityConditionBase<MobStateCond
public MobState Mobstate = MobState.Alive;
public override string EntityConditionGuidebookText(IPrototypeManager prototype) =>
Loc.GetString("reagent-effect-condition-guidebook-mob-state-condition", ("state", Mobstate));
Loc.GetString("entity-condition-guidebook-mob-state-condition", ("state", Mobstate));
}

View File

@@ -31,7 +31,7 @@ public sealed partial class DamageGroupCondition : EntityConditionBase<DamageGro
public ProtoId<DamageGroupPrototype> DamageGroup;
public override string EntityConditionGuidebookText(IPrototypeManager prototype) =>
Loc.GetString("reagent-effect-condition-guidebook-group-damage",
Loc.GetString("entity-condition-guidebook-group-damage",
("max", Max == FixedPoint2.MaxValue ? int.MaxValue : Max.Float()),
("min", Min.Float()),
("type", prototype.Index(DamageGroup).LocalizedName));

View File

@@ -31,7 +31,7 @@ public sealed partial class DamageTypeCondition : EntityConditionBase<DamageType
public ProtoId<DamageTypePrototype> DamageType;
public override string EntityConditionGuidebookText(IPrototypeManager prototype) =>
Loc.GetString("reagent-effect-condition-guidebook-type-damage",
Loc.GetString("entity-condition-guidebook-type-damage",
("max", Max == FixedPoint2.MaxValue ? int.MaxValue : Max.Float()),
("min", Min.Float()),
("type", prototype.Index(DamageType).LocalizedName));

View File

@@ -54,6 +54,6 @@ public sealed partial class JobCondition : EntityConditionBase<JobCondition>
public override string EntityConditionGuidebookText(IPrototypeManager prototype)
{
var localizedNames = Jobs.Select(jobId => prototype.Index(jobId).LocalizedName).ToList();
return Loc.GetString("reagent-effect-condition-guidebook-job-condition", ("job", ContentLocalizationManager.FormatListToOr(localizedNames)));
return Loc.GetString("entity-condition-guidebook-job-condition", ("job", ContentLocalizationManager.FormatListToOr(localizedNames)));
}
}

View File

@@ -36,8 +36,8 @@ public sealed partial class ReagentCondition : EntityConditionBase<ReagentCondit
if (!prototype.Resolve(Reagent, out var reagentProto))
return String.Empty;
return Loc.GetString("reagent-effect-condition-guidebook-reagent-threshold",
("reagent", reagentProto.LocalizedName ?? Loc.GetString("reagent-effect-condition-guidebook-this-reagent")),
return Loc.GetString("entity-condition-guidebook-reagent-threshold",
("reagent", reagentProto.LocalizedName),
("max", Max == FixedPoint2.MaxValue ? int.MaxValue : Max.Float()),
("min", Min.Float()));
}

View File

@@ -38,6 +38,6 @@ public sealed partial class AllTagsCondition : EntityConditionBase<AllTagsCondit
var names = ContentLocalizationManager.FormatList(tagList);
return Loc.GetString("reagent-effect-condition-guidebook-has-tag", ("tag", names), ("invert", Inverted));
return Loc.GetString("entity-condition-guidebook-has-tag", ("tag", names), ("invert", Inverted));
}
}

View File

@@ -38,6 +38,6 @@ public sealed partial class AnyTagCondition : EntityConditionBase<AnyTagConditio
var names = ContentLocalizationManager.FormatListToOr(tagList);
return Loc.GetString("reagent-effect-condition-guidebook-has-tag", ("tag", names), ("invert", Inverted));
return Loc.GetString("entity-condition-guidebook-has-tag", ("tag", names), ("invert", Inverted));
}
}

View File

@@ -24,5 +24,5 @@ public sealed partial class TagCondition : EntityConditionBase<TagCondition>
public ProtoId<TagPrototype> Tag;
public override string EntityConditionGuidebookText(IPrototypeManager prototype) =>
Loc.GetString("reagent-effect-condition-guidebook-has-tag", ("tag", Tag), ("invert", Inverted));
Loc.GetString("entity-condition-guidebook-has-tag", ("tag", Tag), ("invert", Inverted));
}

View File

@@ -46,7 +46,7 @@ public sealed partial class TemperatureCondition : EntityConditionBase<Temperatu
public float Max = float.PositiveInfinity;
public override string EntityConditionGuidebookText(IPrototypeManager prototype) =>
Loc.GetString("reagent-effect-condition-guidebook-body-temperature",
Loc.GetString("entity-condition-guidebook-body-temperature",
("max", float.IsPositiveInfinity(Max) ? (float) int.MaxValue : Max),
("min", Min));
}

View File

@@ -27,7 +27,7 @@ public sealed partial class TotalDamageCondition : EntityConditionBase<TotalDama
public FixedPoint2 Min = FixedPoint2.Zero;
public override string EntityConditionGuidebookText(IPrototypeManager prototype) =>
Loc.GetString("reagent-effect-condition-guidebook-total-damage",
Loc.GetString("entity-condition-guidebook-total-damage",
("max", Max == FixedPoint2.MaxValue ? int.MaxValue : Max.Float()),
("min", Min.Float()));
}

View File

@@ -1,11 +1,12 @@
using Content.Shared.Database;
using Content.Shared.EntityEffects.Effects.Transform;
using Robust.Shared.Prototypes;
namespace Content.Shared.EntityEffects.Effects.Transform;
namespace Content.Shared.EntityEffects.Effects;
/// <inheritdoc cref="EntityEffect"/>
/// <seealso cref="ExplosionEffect">
public sealed partial class ExplodeEffect : EntityEffectBase<ExplodeEffect>
/// <seealso cref="Explosion"/>
public sealed partial class Explode : EntityEffectBase<Explode>
{
/// <summary>
/// Optional override for the explosion intensity.

View File

@@ -5,8 +5,8 @@ using Robust.Shared.Prototypes;
namespace Content.Shared.EntityEffects.Effects.Transform;
/// <inheritdoc cref="EntityEffect"/>
/// <seealso cref="ExplodeEffect">
public sealed partial class ExplosionEffect : EntityEffectBase<ExplosionEffect>
/// <seealso cref="Explode"/>
public sealed partial class Explosion : EntityEffectBase<Explosion>
{
/// <summary>
/// The type of explosion. Determines damage types and tile break chance scaling.

View File

@@ -1,4 +1,4 @@
reagent-effect-condition-guidebook-total-damage =
entity-condition-guidebook-total-damage =
{ $max ->
[2147483648] it has at least {NATURALFIXED($min, 2)} total damage
*[other] { $min ->
@@ -7,7 +7,7 @@ reagent-effect-condition-guidebook-total-damage =
}
}
reagent-effect-condition-guidebook-type-damage =
entity-condition-guidebook-type-damage =
{ $max ->
[2147483648] it has at least {NATURALFIXED($min, 2)} of {$type} damage
*[other] { $min ->
@@ -16,7 +16,7 @@ reagent-effect-condition-guidebook-type-damage =
}
}
reagent-effect-condition-guidebook-group-damage =
entity-condition-guidebook-group-damage =
{ $max ->
[2147483648] it has at least {NATURALFIXED($min, 2)} of {$type} damage.
*[other] { $min ->
@@ -25,7 +25,7 @@ reagent-effect-condition-guidebook-group-damage =
}
}
reagent-effect-condition-guidebook-total-hunger =
entity-condition-guidebook-total-hunger =
{ $max ->
[2147483648] the target has at least {NATURALFIXED($min, 2)} total hunger
*[other] { $min ->
@@ -34,7 +34,7 @@ reagent-effect-condition-guidebook-total-hunger =
}
}
reagent-effect-condition-guidebook-reagent-threshold =
entity-condition-guidebook-reagent-threshold =
{ $max ->
[2147483648] there's at least {NATURALFIXED($min, 2)}u of {$reagent}
*[other] { $min ->
@@ -43,13 +43,13 @@ reagent-effect-condition-guidebook-reagent-threshold =
}
}
reagent-effect-condition-guidebook-mob-state-condition =
entity-condition-guidebook-mob-state-condition =
the mob is { $state }
reagent-effect-condition-guidebook-job-condition =
entity-condition-guidebook-job-condition =
the target's job is { $job }
reagent-effect-condition-guidebook-solution-temperature =
entity-condition-guidebook-solution-temperature =
the solution's temperature is { $max ->
[2147483648] at least {NATURALFIXED($min, 2)}k
*[other] { $min ->
@@ -58,7 +58,7 @@ reagent-effect-condition-guidebook-solution-temperature =
}
}
reagent-effect-condition-guidebook-body-temperature =
entity-condition-guidebook-body-temperature =
the body's temperature is { $max ->
[2147483648] at least {NATURALFIXED($min, 2)}k
*[other] { $min ->
@@ -67,27 +67,27 @@ reagent-effect-condition-guidebook-body-temperature =
}
}
reagent-effect-condition-guidebook-organ-type =
entity-condition-guidebook-organ-type =
the metabolizing organ { $shouldhave ->
[true] is
*[false] is not
} {INDEFINITE($name)} {$name} organ
reagent-effect-condition-guidebook-has-tag =
entity-condition-guidebook-has-tag =
the target { $invert ->
[true] does not have
*[false] has
} the tag {$tag}
reagent-effect-condition-guidebook-this-reagent = this reagent
entity-condition-guidebook-this-reagent = this reagent
reagent-effect-condition-guidebook-breathing =
entity-condition-guidebook-breathing =
the metabolizer is { $isBreathing ->
[true] breathing normally
*[false] suffocating
}
reagent-effect-condition-guidebook-internals =
entity-condition-guidebook-internals =
the metabolizer is { $usingInternals ->
[true] using internals
*[false] breathing atmospheric air

View File

@@ -111,7 +111,7 @@
Potassium:
amount: 1
effects:
- !type:ExplosionEffect
- !type:Explosion
explosionType: Default
intensityPerUnit: 0.25
maxTotalIntensity: 100

View File

@@ -208,7 +208,7 @@
JuiceThatMakesYouHew:
amount: 1
effects:
- !type:ExplosionEffect
- !type:Explosion
explosionType: Radioactive
maxIntensity: 200
intensityPerUnit: 2

View File

@@ -39,7 +39,7 @@
Fluorine:
amount: 3
effects:
- !type:ExplosionEffect
- !type:Explosion
explosionType: Default # 15 damage per intensity.
maxIntensity: 200
intensityPerUnit: 5