ported from perforce
This commit is contained in:
36
RobotAndDonkey.Game/Cards/Patches/Stabilize.cs
Normal file
36
RobotAndDonkey.Game/Cards/Patches/Stabilize.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
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.";
|
||||
}
|
||||
Reference in New Issue
Block a user