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
2241def4
Commit
2241def4
authored
Jan 19, 2016
by
IceYGO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix synchro summoning, not working since v1338
parent
5723de5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
21 deletions
+31
-21
Game/GameBehavior.cs
Game/GameBehavior.cs
+31
-21
No files found.
Game/GameBehavior.cs
View file @
2241def4
...
@@ -826,37 +826,47 @@ namespace WindBot.Game
...
@@ -826,37 +826,47 @@ namespace WindBot.Game
int
sumval
=
packet
.
ReadInt32
();
int
sumval
=
packet
.
ReadInt32
();
int
min
=
packet
.
ReadByte
();
int
min
=
packet
.
ReadByte
();
int
max
=
packet
.
ReadByte
();
int
max
=
packet
.
ReadByte
();
// TODO mandatory cards
IList
<
ClientCard
>
mandatoryCards
=
new
List
<
ClientCard
>();
int
count
=
packet
.
ReadByte
();
packet
.
ReadBytes
(
count
*
11
);
IList
<
ClientCard
>
cards
=
new
List
<
ClientCard
>();
IList
<
ClientCard
>
cards
=
new
List
<
ClientCard
>();
count
=
packet
.
ReadByte
();
for
(
int
i
=
0
;
i
<
count
;
++
i
)
for
(
int
j
=
0
;
j
<
2
;
++
j
)
{
{
int
cardId
=
packet
.
ReadInt32
();
int
count
=
packet
.
ReadByte
();
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
for
(
int
i
=
0
;
i
<
count
;
++
i
)
CardLocation
loc
=
(
CardLocation
)
packet
.
ReadByte
();
int
seq
=
packet
.
ReadByte
();
ClientCard
card
=
_duel
.
GetCard
(
player
,
loc
,
seq
);
if
(
card
!=
null
)
{
{
if
(
cardId
!=
0
&&
card
.
Id
!=
cardId
)
int
cardId
=
packet
.
ReadInt32
();
card
.
SetId
(
cardId
);
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
cards
.
Add
(
card
);
CardLocation
loc
=
(
CardLocation
)
packet
.
ReadByte
();
int
seq
=
packet
.
ReadByte
();
ClientCard
card
=
_duel
.
GetCard
(
player
,
loc
,
seq
);
if
(
card
!=
null
)
{
if
(
cardId
!=
0
&&
card
.
Id
!=
cardId
)
card
.
SetId
(
cardId
);
}
if
(
j
==
0
)
mandatoryCards
.
Add
(
card
);
else
cards
.
Add
(
card
);
packet
.
ReadInt32
();
}
}
packet
.
ReadInt32
();
}
}
IList
<
ClientCard
>
selected
=
_ai
.
OnSelectSum
(
cards
,
sumval
,
min
,
max
);
IList
<
ClientCard
>
selected
=
_ai
.
OnSelectSum
(
cards
,
sumval
,
min
,
max
);
byte
[]
result
=
new
byte
[
selected
.
Count
+
1
];
byte
[]
result
=
new
byte
[
mandatoryCards
.
Count
+
selected
.
Count
+
1
];
result
[
0
]
=
(
byte
)
selected
.
Count
;
int
index
=
0
;
result
[
index
++]
=
(
byte
)(
mandatoryCards
.
Count
+
selected
.
Count
);
while
(
index
<
mandatoryCards
.
Count
)
{
result
[
index
++]
=
0
;
}
for
(
int
i
=
0
;
i
<
selected
.
Count
;
++
i
)
for
(
int
i
=
0
;
i
<
selected
.
Count
;
++
i
)
{
{
int
id
=
0
;
int
id
=
0
;
for
(
int
j
=
0
;
j
<
count
;
++
j
)
for
(
int
j
=
0
;
j
<
c
ards
.
C
ount
;
++
j
)
{
{
if
(
cards
[
j
]
==
null
)
continue
;
if
(
cards
[
j
]
==
null
)
continue
;
if
(
cards
[
j
].
Equals
(
selected
[
i
]))
if
(
cards
[
j
].
Equals
(
selected
[
i
]))
...
@@ -865,7 +875,7 @@ namespace WindBot.Game
...
@@ -865,7 +875,7 @@ namespace WindBot.Game
break
;
break
;
}
}
}
}
result
[
i
+
1
]
=
(
byte
)
id
;
result
[
i
ndex
++
]
=
(
byte
)
id
;
}
}
GamePacketWriter
reply
=
new
GamePacketWriter
(
CtosMessage
.
Response
);
GamePacketWriter
reply
=
new
GamePacketWriter
(
CtosMessage
.
Response
);
...
...
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