Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
W
windbot
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
windbot
Commits
702b0932
Commit
702b0932
authored
Aug 20, 2018
by
小张
Committed by
mercury233
Aug 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ExecutorType GoToBattlePhase etc. (#55)
parent
0d0f6f9f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
Game/AI/ExecutorType.cs
Game/AI/ExecutorType.cs
+4
-1
Game/GameAI.cs
Game/GameAI.cs
+20
-0
No files found.
Game/AI/ExecutorType.cs
View file @
702b0932
...
...
@@ -8,6 +8,9 @@
MonsterSet
,
SpellSet
,
Activate
,
SummonOrSet
SummonOrSet
,
GoToBattlePhase
,
GoToMainPhase2
,
GoToEndPhase
}
}
\ No newline at end of file
Game/GameAI.cs
View file @
702b0932
...
...
@@ -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
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment