ported from perforce

This commit is contained in:
2026-04-19 00:43:27 +02:00
commit 6c0c33f5d4
700 changed files with 19735 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using RobotAndDonkey.Game.Board;
using RobotAndDonkey.Game.Data;
using RobotAndDonkey.Game.Execution.Results;
using RobotAndDonkey.Game.GameState;
using RobotAndDonkey.Game.Intents;
using RobotAndDonkey.Game.Pois;
namespace RobotAndDonkey.Game.Modifiers;
public record RangerFertileRestModifier() : Modifier(EModifierKind.Robot, EModifierId.RangerFertileRest, EModifierDuration.Permanent)
{
protected override RangerFertileRestModifier CreateInstance() => new();
public override void Before(Guid requestId, ReadOnlySpan<Intent> intents, CoreLoop coreLoop, Entity owner, List<Intent> newIntents, List<Result> results)
{
var avatarCell = coreLoop.Board.Cells.First(c => c.Poi is Avatar);
if (avatarCell.Type != ECellType.Fertile)
return;
foreach (var intent in intents)
{
if (intent is ModifyCurrency { Delta.Energy: > 0 })
{
newIntents.Add(new ModifyCurrency(new(Balancing.Instance.RangerFertileRestEnergyDelta, 0, 0, 0, 0, 0)));
break;
}
}
}
public override string ToolTip => $"Replenishes an extra {Balancing.Instance.RangerFertileRestEnergyDelta} energy when resting on fertile ground";
}