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
Tang Xinwei
windbot
Commits
7eb0f1e9
Commit
7eb0f1e9
authored
Jul 28, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix sync not working under some situation
parent
7b46ed23
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
15 deletions
+10
-15
Game/AI/Decks/BlueEyesExecutor.cs
Game/AI/Decks/BlueEyesExecutor.cs
+6
-3
Game/ClientCard.cs
Game/ClientCard.cs
+1
-0
Game/GameBehavior.cs
Game/GameBehavior.cs
+3
-12
No files found.
Game/AI/Decks/BlueEyesExecutor.cs
View file @
7eb0f1e9
...
...
@@ -180,7 +180,7 @@ namespace MycardBot.Game.AI.Decks
public
override
IList
<
ClientCard
>
OnSelectSum
(
IList
<
ClientCard
>
cards
,
int
sum
,
int
min
,
int
max
)
{
Logger
.
DebugWriteLine
(
cards
.
Count
+
" sync "
+
sum
);
//
Logger.DebugWriteLine(cards.Count + " sync " + sum);
IList
<
ClientCard
>
selected
=
new
List
<
ClientCard
>();
int
trysum
=
0
;
if
(
使用过的青眼亚白龙
.
Count
>
0
&&
cards
.
IndexOf
(
使用过的青眼亚白龙
[
0
])>
0
)
...
...
@@ -193,7 +193,7 @@ namespace MycardBot.Game.AI.Decks
trysum
=
card
.
Level
;
if
(
trysum
==
sum
)
{
Logger
.
DebugWriteLine
(
trysum
+
" dselected "
+
sum
);
Logger
.
DebugWriteLine
(
"直接选择了"
+
card
.
Name
);
return
selected
;
}
}
...
...
@@ -203,15 +203,18 @@ namespace MycardBot.Game.AI.Decks
Logger
.
DebugWriteLine
(
"同调素材可以选择: "
+
card
.
Name
);
if
(
card
.
Level
==
sum
)
{
Logger
.
DebugWriteLine
(
"直接选择了"
+
card
.
Name
);
return
new
[]
{
card
};
}
// try level add
if
(
trysum
+
card
.
Level
>
sum
)
{
Logger
.
DebugWriteLine
(
"跳过了"
+
card
.
Name
);
continue
;
}
selected
.
Add
(
card
);
trysum
+=
card
.
Level
;
Logger
.
DebugWriteLine
(
"添加"
+
card
.
Name
);
Logger
.
DebugWriteLine
(
trysum
+
" selected "
+
sum
);
if
(
trysum
==
sum
)
{
...
...
@@ -229,7 +232,7 @@ namespace MycardBot.Game.AI.Decks
// try level sub
selected2
.
Remove
(
card
);
trysum
-=
card
.
Level
;
Logger
.
DebugWriteLine
(
card
.
Id
+
""
);
Logger
.
DebugWriteLine
(
"排除"
+
card
.
Name
);
Logger
.
DebugWriteLine
(
trysum
+
" selected2 "
+
sum
);
if
(
trysum
==
sum
)
{
...
...
Game/ClientCard.cs
View file @
7eb0f1e9
...
...
@@ -29,6 +29,7 @@ namespace WindBot.Game
public
int
Owner
{
get
;
private
set
;
}
public
int
Controller
{
get
;
private
set
;
}
public
int
Disabled
{
get
;
private
set
;
}
public
int
SelectSeq
{
get
;
set
;
}
public
int
[]
ActionIndex
{
get
;
set
;
}
public
IDictionary
<
int
,
int
>
ActionActivateIndex
{
get
;
private
set
;
}
...
...
Game/GameBehavior.cs
View file @
7eb0f1e9
...
...
@@ -895,6 +895,7 @@ namespace WindBot.Game
{
if
(
cardId
!=
0
&&
card
.
Id
!=
cardId
)
card
.
SetId
(
cardId
);
card
.
SelectSeq
=
i
;
}
if
(
j
==
0
)
mandatoryCards
.
Add
(
card
);
...
...
@@ -915,23 +916,13 @@ namespace WindBot.Game
int
index
=
0
;
result
[
index
++]
=
(
byte
)(
mandatoryCards
.
Count
+
selected
.
Count
);
while
(
index
<
mandatoryCards
.
Count
)
while
(
index
<
=
mandatoryCards
.
Count
)
{
result
[
index
++]
=
0
;
}
for
(
int
i
=
0
;
i
<
selected
.
Count
;
++
i
)
{
int
id
=
0
;
for
(
int
j
=
0
;
j
<
cards
.
Count
;
++
j
)
{
if
(
cards
[
j
]
==
null
)
continue
;
if
(
cards
[
j
].
Equals
(
selected
[
i
]))
{
id
=
j
;
break
;
}
}
result
[
index
++]
=
(
byte
)
id
;
result
[
index
++]
=
(
byte
)
selected
[
i
].
SelectSeq
;
}
BinaryWriter
reply
=
GamePacketFactory
.
Create
(
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