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
nanahira
windbot
Commits
fce2d82b
Commit
fce2d82b
authored
Jun 18, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:moecube/windbot
parents
d561ae5f
49f09bc4
Pipeline
#13898
passed with stages
in 2 minutes and 31 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
Game/GameBehavior.cs
Game/GameBehavior.cs
+32
-0
No files found.
Game/GameBehavior.cs
View file @
fce2d82b
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Text.RegularExpressions
;
using
WindBot.Game.AI
;
using
YGOSharp.Network
;
...
...
@@ -105,6 +106,7 @@ namespace WindBot.Game
_messages
.
Add
(
GameMessage
.
ShuffleHand
,
OnShuffleHand
);
_messages
.
Add
(
GameMessage
.
ShuffleExtra
,
OnShuffleExtra
);
_messages
.
Add
(
GameMessage
.
ShuffleSetCard
,
OnShuffleSetCard
);
_messages
.
Add
(
GameMessage
.
SwapGraveDeck
,
OnSwapGraveDeck
);
_messages
.
Add
(
GameMessage
.
TagSwap
,
OnTagSwap
);
_messages
.
Add
(
GameMessage
.
NewTurn
,
OnNewTurn
);
_messages
.
Add
(
GameMessage
.
NewPhase
,
OnNewPhase
);
...
...
@@ -491,6 +493,36 @@ namespace WindBot.Game
}
}
private
void
OnSwapGraveDeck
(
BinaryReader
packet
)
{
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
IList
<
ClientCard
>
tmpDeckList
=
_duel
.
Fields
[
player
].
Deck
.
ToList
();
_duel
.
Fields
[
player
].
Deck
.
Clear
();
int
seq
=
0
;
foreach
(
var
card
in
_duel
.
Fields
[
player
].
Graveyard
)
{
if
(
card
.
IsExtraCard
())
{
_duel
.
Fields
[
player
].
ExtraDeck
.
Add
(
card
);
card
.
Location
=
CardLocation
.
Extra
;
card
.
Position
=
(
int
)
CardPosition
.
FaceDown
;
// TODO: face-up P cards
}
else
{
_duel
.
Fields
[
player
].
Deck
.
Add
(
card
);
card
.
Location
=
CardLocation
.
Deck
;
card
.
Sequence
=
seq
++;
}
}
_duel
.
Fields
[
player
].
Graveyard
.
Clear
();
foreach
(
var
card
in
tmpDeckList
)
{
_duel
.
Fields
[
player
].
Graveyard
.
Add
(
card
);
card
.
Location
=
CardLocation
.
Grave
;
}
}
private
void
OnTagSwap
(
BinaryReader
packet
)
{
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
...
...
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