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
List
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
HiiragiGuardians
windbot
Commits
eb222c82
Commit
eb222c82
authored
Nov 08, 2020
by
wind2009
Committed by
mercury233
Jan 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make OnAnnounceCard overrideable
parent
87e802b1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
8 deletions
+39
-8
Game/AI/Decks/WitchcraftExecutor.cs
Game/AI/Decks/WitchcraftExecutor.cs
+13
-4
Game/AI/Executor.cs
Game/AI/Executor.cs
+13
-0
Game/GameAI.cs
Game/GameAI.cs
+5
-3
Game/GameBehavior.cs
Game/GameBehavior.cs
+8
-1
No files found.
Game/AI/Decks/WitchcraftExecutor.cs
View file @
eb222c82
...
...
@@ -271,6 +271,7 @@ namespace WindBot.Game.AI.Decks
public
override
void
OnNewTurn
()
{
CrossoutDesignatorTarget
=
0
;
PSYOmega_count
=
0
;
MadameVerreGainedATK
=
false
;
summoned
=
false
;
enemy_activate_MaxxC
=
false
;
...
...
@@ -283,8 +284,7 @@ namespace WindBot.Game.AI.Decks
FirstCheckSS
.
Clear
();
UseSSEffect
.
Clear
();
ActivatedCards
.
Clear
();
int
PSYOmega_count
=
0
;
// CalledbytheGrave refrest
// CalledbytheGrave refresh
List
<
int
>
key_list
=
CalledbytheGraveCount
.
Keys
.
ToList
();
foreach
(
int
dic
in
key_list
)
{
...
...
@@ -438,6 +438,17 @@ namespace WindBot.Game.AI.Decks
return
base
.
OnSelectPosition
(
cardId
,
positions
);
}
/// <summary>
/// Override for CrossoutDesignator
/// </summary>
/// <param name="opcodes">Operation codes for limitation.</param>
/// <param name="preAnnouced">Card's id prepared to annouce.</param>
/// <returns>Card's id to annouce.</returns>
public
override
int
OnAnnounceCard
(
IList
<
int
>
opcodes
,
int
preAnnouced
)
{
return
base
.
OnAnnounceCard
(
opcodes
,
preAnnouced
);
}
// shuffle List<ClientCard>
public
List
<
ClientCard
>
CardListShuffle
(
List
<
ClientCard
>
list
)
{
...
...
@@ -976,8 +987,6 @@ namespace WindBot.Game.AI.Decks
// check
bool
have_FiveRainbow
=
false
;
List
<
ClientCard
>
list
=
new
List
<
ClientCard
>();
ClientCard
l
=
null
;
ClientCard
r
=
null
;
if
(
Duel
.
IsNewRule
||
Duel
.
IsNewRule2020
)
{
list
.
Add
(
Enemy
.
SpellZone
[
0
]);
...
...
Game/AI/Executor.cs
View file @
eb222c82
...
...
@@ -188,6 +188,19 @@ namespace WindBot.Game.AI
return
false
;
}
/// <summary>
/// Called when bot is going to annouce a card, to check whether it's legel(to avoid error)
/// For full implement of opcodes, see ygopro-core/playerop.cpp#is_declarable
/// </summary>
/// <param name="opcodes">Operation codes for limitation.</param>
/// <param name="preAnnouced">Card's id prepared to annouce.</param>
/// <returns>Card's id to annouce.</returns>
public
virtual
int
OnAnnounceCard
(
IList
<
int
>
opcodes
,
int
preAnnouced
)
{
// For overriding
return
preAnnouced
;
}
public
void
SetMain
(
MainPhase
main
)
{
Main
=
main
;
...
...
Game/GameAI.cs
View file @
eb222c82
...
...
@@ -734,12 +734,14 @@ namespace WindBot.Game
/// <summary>
/// Called when the AI has to declare a card.
/// </summary>
/// <param name="opcodes">Operation lists.</param>
/// <returns>Id of the selected card.</returns>
public
int
OnAnnounceCard
()
public
int
OnAnnounceCard
(
IList
<
int
>
opcodes
)
{
if
(
m_announce
==
0
)
return
89631139
;
// Blue-eyes white dragon
return
m_announce
;
m_announce
=
89631139
;
// Blue-eyes white dragon
return
Executor
.
OnAnnounceCard
(
opcodes
,
m_announce
);
}
// _ Others functions _
...
...
Game/GameBehavior.cs
View file @
eb222c82
...
...
@@ -1441,8 +1441,15 @@ namespace WindBot.Game
private
void
OnAnnounceCard
(
BinaryReader
packet
)
{
IList
<
int
>
opcodes
=
new
List
<
int
>();
packet
.
ReadByte
();
// player
int
count
=
packet
.
ReadByte
();
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
opcodes
.
Add
(
packet
.
ReadInt32
());
}
// not fully implemented
Connection
.
Send
(
CtosMessage
.
Response
,
_ai
.
OnAnnounceCard
());
Connection
.
Send
(
CtosMessage
.
Response
,
_ai
.
OnAnnounceCard
(
opcodes
));
}
private
void
OnAnnounceNumber
(
BinaryReader
packet
)
...
...
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