Skip to content

Commit

Permalink
Fix all errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepyyapril committed Dec 21, 2024
1 parent e061b5e commit 8038c5f
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Linq;
using Content.Client.Chemistry.EntitySystems;
using Content.Server.Chemistry.ReactionEffects;
using Content.Server.EntityEffects.Effects;
using Content.Server.Nutrition.Components;
using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Chemistry.Reaction;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Content.Shared.Chemistry.Reagent;
using Content.Server.Abilities.Psionics;
using Content.Shared.EntityEffects;
using JetBrains.Annotations;
using Robust.Shared.Prototypes;

Expand All @@ -9,19 +9,22 @@ namespace Content.Server.Chemistry.ReagentEffects
/// Rerolls psionics once.
/// </summary>
[UsedImplicitly]
public sealed partial class ChemRemovePsionic : ReagentEffect
public sealed partial class ChemRemovePsionic : EntityEffect
{
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("reagent-effect-guidebook-chem-remove-psionic", ("chance", Probability));

public override void Effect(ReagentEffectArgs args)
public override void Effect(EntityEffectBaseArgs args)
{
if (args.Scale != 1f)
if (args is not EntityEffectReagentArgs effectArgs)
return;

if (effectArgs.Scale != 1f)
return;

var psySys = args.EntityManager.EntitySysManager.GetEntitySystem<PsionicAbilitiesSystem>();

psySys.MindBreak(args.SolutionEntity);
psySys.MindBreak(effectArgs.TargetEntity);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Content.Shared.Chemistry.Reagent;
using Content.Server.Psionics;
using Content.Shared.EntityEffects;
using JetBrains.Annotations;
using Robust.Shared.Prototypes;

Expand All @@ -9,7 +10,7 @@ namespace Content.Server.Chemistry.ReagentEffects
/// Rerolls psionics once.
/// </summary>
[UsedImplicitly]
public sealed partial class ChemRerollPsionic : ReagentEffect
public sealed partial class ChemRerollPsionic : EntityEffect
{
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("reagent-effect-guidebook-chem-reroll-psionic", ("chance", Probability));
Expand All @@ -20,11 +21,13 @@ public sealed partial class ChemRerollPsionic : ReagentEffect
[DataField("bonusMultiplier")]
public float BonusMuliplier = 1f;

public override void Effect(ReagentEffectArgs args)
public override void Effect(EntityEffectBaseArgs args)
{
var psySys = args.EntityManager.EntitySysManager.GetEntitySystem<PsionicsSystem>();
if (args is not EntityEffectReagentArgs _)
return;

psySys.RerollPsionics(args.SolutionEntity, bonusMuliplier: BonusMuliplier);
var psySys = args.EntityManager.EntitySysManager.GetEntitySystem<PsionicsSystem>();
psySys.RerollPsionics(args.TargetEntity, bonusMuliplier: BonusMuliplier);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.EntityEffects;
using Content.Shared.FixedPoint;
using Content.Shared.Popups;
using Robust.Shared.Player;
Expand Down Expand Up @@ -54,14 +55,15 @@ public override void Update(float frameTime)

foreach (var effect in component.UnsafeOilVolumeEffects)
{
effect.Effect(new ReagentEffectArgs(uid,
null,
component.Solution,
proto!,
reagent.Quantity,
EntityManager,
null,
1f));
var effectsArgs = new EntityEffectReagentArgs(uid,
EntityManager,
null,
component.Solution,
reagent.Quantity,
proto!,
null,
1f);
effect.Effect(effectsArgs);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
using Content.Shared.Destructible;
using Content.Shared.DoAfter;
using Content.Shared.DragDrop;
using Content.Shared.EntityEffects;
using Content.Shared.Examine;
using Content.Shared.FixedPoint;
using Content.Shared.Hands.Components;
Expand Down Expand Up @@ -399,12 +400,12 @@ private void OnInitDeepFryer(EntityUid uid, DeepFryerComponent component, Compon
{
//JJ Comment - not sure this works. Need to check if Reagent.ToString is correct.
_prototypeManager.TryIndex<ReagentPrototype>(reagent.Reagent.ToString(), out var proto);
var effectsArgs = new ReagentEffectArgs(uid,
var effectsArgs = new EntityEffectReagentArgs(uid,
EntityManager,
null,
component.Solution,
proto!,
reagent.Quantity,
EntityManager,
proto!,
null,
1f);
foreach (var effect in component.UnsafeOilVolumeEffects)
Expand Down

0 comments on commit 8038c5f

Please sign in to comment.