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 Rain() : GlitchCard(ECard.Rain) { public override void CreateIntents(Cell? avatarCell, CoreLoop coreLoop, Guid requestId, List intents, List results) { var cells = coreLoop.Board.Cells; foreach (var cell in cells) { if (cell.Type == ECellType.Rocky) { intents.Add(new ModifyCell(cell, EModifierId.Rain, EModifierDuration.Temporary)); } else if (cell.Type == ECellType.Grass) { if (coreLoop.Random.NextSingle() < Balancing.Instance.RainTransformProbability) intents.Add(new ModifyCell(cell, EModifierId.Rain, EModifierDuration.Temporary)); } } } public override string ToolTip => "Increases fertility throughout the map."; public override Modifier[] TooltipModifiers => [new RainModifier(EModifierDuration.Temporary)]; }