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
644d1b8e
Commit
644d1b8e
authored
Jun 20, 2025
by
mercury233
Committed by
mercury233
Jun 29, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update OnSelectChain
parent
57e404ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
Game/GameAI.cs
Game/GameAI.cs
+12
-3
Game/GameBehavior.cs
Game/GameBehavior.cs
+7
-3
No files found.
Game/GameAI.cs
View file @
644d1b8e
...
...
@@ -360,7 +360,7 @@ namespace WindBot.Game
/// <param name="forced">You can't return -1 if this param is true.</param>
/// <param name="timing">Current hint timing</param>
/// <returns>Index of the activated card or -1.</returns>
public
int
OnSelectChain
(
IList
<
ClientCard
>
cards
,
IList
<
int
>
descs
,
bool
forced
,
int
timing
=
-
1
)
public
int
OnSelectChain
(
IList
<
ClientCard
>
cards
,
IList
<
int
>
descs
,
IList
<
bool
>
forces
,
int
timing
=
-
1
)
{
Executor
.
OnSelectChain
(
cards
);
foreach
(
CardExecutor
exec
in
Executor
.
Executors
)
...
...
@@ -375,8 +375,17 @@ namespace WindBot.Game
}
}
}
// If we're forced to chain, we chain the first card. However don't do anything.
return
forced
?
0
:
-
1
;
for
(
int
i
=
0
;
i
<
forces
.
Count
;
++
i
)
{
if
(
forces
[
i
])
{
// If the card is forced, we have to activate it.
_dialogs
.
SendChaining
(
cards
[
i
].
Name
);
return
i
;
}
}
// Don't do anything.
return
-
1
;
}
/// <summary>
...
...
Game/GameBehavior.cs
View file @
644d1b8e
...
...
@@ -1172,16 +1172,19 @@ namespace WindBot.Game
packet
.
ReadByte
();
// player
int
count
=
packet
.
ReadByte
();
packet
.
ReadByte
();
// specount
bool
forced
=
packet
.
ReadByte
()
!=
0
;
int
hint1
=
packet
.
ReadInt32
();
// hint1
int
hint2
=
packet
.
ReadInt32
();
// hint2
// TODO: use ChainInfo?
IList
<
ClientCard
>
cards
=
new
List
<
ClientCard
>();
IList
<
int
>
descs
=
new
List
<
int
>();
IList
<
bool
>
forces
=
new
List
<
bool
>();
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
packet
.
ReadByte
();
// flag
bool
forced
=
packet
.
ReadByte
()
!=
0
;
int
id
=
packet
.
ReadInt32
();
int
con
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
loc
=
packet
.
ReadByte
();
...
...
@@ -1200,6 +1203,7 @@ namespace WindBot.Game
cards
.
Add
(
card
);
descs
.
Add
(
desc
);
forces
.
Add
(
forced
);
}
if
(
cards
.
Count
==
0
)
...
...
@@ -1208,13 +1212,13 @@ namespace WindBot.Game
return
;
}
if
(
cards
.
Count
==
1
&&
force
d
)
if
(
cards
.
Count
==
1
&&
force
s
[
0
]
)
{
Connection
.
Send
(
CtosMessage
.
Response
,
0
);
return
;
}
Connection
.
Send
(
CtosMessage
.
Response
,
_ai
.
OnSelectChain
(
cards
,
descs
,
force
d
,
hint1
|
hint2
));
Connection
.
Send
(
CtosMessage
.
Response
,
_ai
.
OnSelectChain
(
cards
,
descs
,
force
s
,
hint1
|
hint2
));
}
private
void
OnSelectCounter
(
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