36 lines
1.3 KiB
C#
36 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using RobotAndDonkey.Game.Board;
|
|
using RobotAndDonkey.Game.Data;
|
|
using RobotAndDonkey.Game.Execution.Results;
|
|
using RobotAndDonkey.Game.GameState;
|
|
using RobotAndDonkey.Game.Intents;
|
|
using RobotAndDonkey.Game.Modifiers;
|
|
using RobotAndDonkey.Game.Pois;
|
|
|
|
namespace RobotAndDonkey.Game.Cards.Patches;
|
|
|
|
public record Stabilize() : PatchCard(ECard.Stabilize, Balancing.Instance.StabilizeCost, Balancing.Instance.CardPlayEnergyCost, ERarity.Legendary)
|
|
{
|
|
protected override void CreateIntents(Cell avatarCell, Avatar avatar, CoreLoop coreLoop, Guid requestId, List<Intent> intents, List<Result> results)
|
|
{
|
|
var tape = coreLoop.GetTapeCards();
|
|
var index = tape.IndexOf(this);
|
|
if (index < 0)
|
|
{
|
|
results.Add(new InvalidInstructionResult(requestId, EInvalidReason.NotFound, this, avatarCell));
|
|
return;
|
|
}
|
|
|
|
var targetIndex = index + 1;
|
|
if (targetIndex >= tape.Count)
|
|
{
|
|
results.Add(new InvalidInstructionResult(requestId, EInvalidReason.OutOfBounds, this, avatarCell));
|
|
return;
|
|
}
|
|
|
|
intents.Add(new ImmunizeCard(this, tape[targetIndex], EModifierId._Invalid, EModifierDuration.ShortTerm));
|
|
}
|
|
|
|
public override string ToolTip => "Temporarily nullifies all modifiers of the next card.";
|
|
} |