ported from perforce
This commit is contained in:
28
RobotAndDonkey.Game/Intents/Reroll.cs
Normal file
28
RobotAndDonkey.Game/Intents/Reroll.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using RobotAndDonkey.Game.Execution;
|
||||
using RobotAndDonkey.Game.Execution.Results;
|
||||
using RobotAndDonkey.Game.GameState;
|
||||
|
||||
namespace RobotAndDonkey.Game.Intents;
|
||||
|
||||
public class Reroll(int energyCost) : Intent(energyCost)
|
||||
{
|
||||
public override void Run(Guid requestId, CoreLoop coreLoop, List<Intent> newIntents, List<Result> results)
|
||||
{
|
||||
coreLoop.RerollPatchDeck();
|
||||
base.Run(requestId, coreLoop, newIntents, results);
|
||||
}
|
||||
|
||||
public override bool IsValid(CoreLoop coreLoop)
|
||||
{
|
||||
if (!base.IsValid(coreLoop))
|
||||
return false;
|
||||
|
||||
return coreLoop.RunPhase == ERunPhase.Improve;
|
||||
}
|
||||
|
||||
public override bool Immune => true;
|
||||
|
||||
public override string ToString() => "Reroll, " + base.ToString();
|
||||
}
|
||||
Reference in New Issue
Block a user