34 lines
1.2 KiB
C#
34 lines
1.2 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;
|
|
|
|
namespace RobotAndDonkey.Game.Cards.Glitches;
|
|
|
|
public record Drought() : GlitchCard(ECard.Drought)
|
|
{
|
|
public override void CreateIntents(Cell? avatarCell, CoreLoop coreLoop, Guid requestId, List<Intent> intents, List<Result> results)
|
|
{
|
|
var cells = coreLoop.Board.Cells;
|
|
foreach (var cell in cells)
|
|
{
|
|
if (cell.Type == ECellType.Fertile)
|
|
{
|
|
intents.Add(new ModifyCell(cell, EModifierId.Drought, EModifierDuration.Temporary));
|
|
}
|
|
else if (cell.Type == ECellType.Grass)
|
|
{
|
|
if (coreLoop.Random.NextSingle() < Balancing.Instance.DroughtTransformProbability)
|
|
intents.Add(new ModifyCell(cell, EModifierId.Drought, EModifierDuration.Temporary));
|
|
}
|
|
}
|
|
}
|
|
|
|
public override string ToolTip => "Fertility in the land is drastically reduced.";
|
|
|
|
public override Modifier[] TooltipModifiers => [new DroughtModifier(EModifierDuration.Temporary)];
|
|
} |