ported from perforce
This commit is contained in:
34
RobotAndDonkey.Game/Cards/Patches/EMField.cs
Normal file
34
RobotAndDonkey.Game/Cards/Patches/EMField.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
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 EMField() : PatchCard(ECard.EMField, Balancing.Instance.EMFieldCost, Balancing.Instance.CardPlayEnergyCost, ERarity.Uncommon)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
for (int i = index + 1; i < tape.Count; ++i)
|
||||
{
|
||||
intents.Add(new ImmunizeCard(this, tape[i], EModifierId.Corrupt, EModifierDuration.Temporary));
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToolTip => "Instructions on tape become #Immune to the effects of corrupt";
|
||||
|
||||
public override Modifier[] TooltipModifiers => [new CorruptCardModifier(EModifierDuration.Temporary)];
|
||||
}
|
||||
Reference in New Issue
Block a user