Commit 702b0932 authored by 小张's avatar 小张 Committed by mercury233

Add ExecutorType GoToBattlePhase etc. (#55)

parent 0d0f6f9f
......@@ -8,6 +8,9 @@
MonsterSet,
SpellSet,
Activate,
SummonOrSet
SummonOrSet,
GoToBattlePhase,
GoToMainPhase2,
GoToEndPhase
}
}
\ No newline at end of file
......@@ -143,6 +143,14 @@ namespace WindBot.Game
Executor.SetBattle(battle);
foreach (CardExecutor exec in Executor.Executors)
{
if (exec.Type == ExecutorType.GoToMainPhase2 && battle.CanMainPhaseTwo && exec.Func()) // check if should enter main phase 2 directly
{
return ToMainPhase2();
}
if (exec.Type == ExecutorType.GoToEndPhase && battle.CanEndPhase && exec.Func()) // check if should enter end phase directly
{
return ToEndPhase();
}
for (int i = 0; i < battle.ActivableCards.Count; ++i)
{
ClientCard card = battle.ActivableCards[i];
......@@ -383,6 +391,18 @@ namespace WindBot.Game
Executor.SetMain(main);
foreach (CardExecutor exec in Executor.Executors)
{
if (exec.Type == ExecutorType.GoToEndPhase && main.CanEndPhase && exec.Func()) // check if should enter end phase directly
{
_dialogs.SendEndTurn();
return new MainPhaseAction(MainPhaseAction.MainAction.ToEndPhase);
}
if (exec.Type==ExecutorType.GoToBattlePhase && main.CanBattlePhase && exec.Func()) // check if should enter battle phase directly
{
return new MainPhaseAction(MainPhaseAction.MainAction.ToBattlePhase);
}
// NOTICE: GoToBattlePhase and GoToEndPhase has no "card" can be accessed to ShouldExecute(), so instead use exec.Func() to check ...
// enter end phase and enter battle pahse is in higher priority.
for (int i = 0; i < main.ActivableCards.Count; ++i)
{
ClientCard card = main.ActivableCards[i];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment