ported from perforce
This commit is contained in:
24
RobotAndDonkey.Game/Modifiers/AnalystModifier.cs
Normal file
24
RobotAndDonkey.Game/Modifiers/AnalystModifier.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using RobotAndDonkey.Game.Data;
|
||||
using RobotAndDonkey.Game.Execution.Results;
|
||||
using RobotAndDonkey.Game.GameState;
|
||||
using RobotAndDonkey.Game.Intents;
|
||||
|
||||
namespace RobotAndDonkey.Game.Modifiers;
|
||||
|
||||
public record AnalystModifier() : Modifier(EModifierKind.Robot, EModifierId.Analytic, EModifierDuration.Permanent)
|
||||
{
|
||||
protected override AnalystModifier CreateInstance() => new();
|
||||
|
||||
public override void Before(Guid requestId, ReadOnlySpan<Intent> intents, CoreLoop coreLoop, Entity owner, List<Intent> newIntents, List<Result> results)
|
||||
{
|
||||
for (var i = 0; i < intents.Length; i++)
|
||||
{
|
||||
if (intents[i] is DeferGlitch deferGlitch && coreLoop.DeferGlitchCount == 0)
|
||||
deferGlitch.EnergyCost += Balancing.Instance.AnalysisEnergyDelta;
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToolTip => $"Reduces the energy cost for deferring a glitch by {Balancing.Instance.AnalysisEnergyDelta}";
|
||||
}
|
||||
Reference in New Issue
Block a user