ported from perforce
This commit is contained in:
34
RobotAndDonkey.Game/Cards/Glitches/Rain.cs
Normal file
34
RobotAndDonkey.Game/Cards/Glitches/Rain.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;
|
||||
|
||||
namespace RobotAndDonkey.Game.Cards.Glitches;
|
||||
|
||||
public record Rain() : GlitchCard(ECard.Rain)
|
||||
{
|
||||
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.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)];
|
||||
}
|
||||
Reference in New Issue
Block a user