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
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
MyCard
windbot
Commits
b9f20076
Commit
b9f20076
authored
Feb 14, 2026
by
wind2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add player hint
parent
d70c30ec
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
71 additions
and
5 deletions
+71
-5
.gitignore
.gitignore
+1
-0
Game/AI/DefaultExecutor.cs
Game/AI/DefaultExecutor.cs
+13
-1
Game/AI/Executor.cs
Game/AI/Executor.cs
+12
-1
Game/ClientField.cs
Game/ClientField.cs
+3
-0
Game/GameAI.cs
Game/GameAI.cs
+12
-1
Game/GameBehavior.cs
Game/GameBehavior.cs
+15
-1
WindBot.csproj
WindBot.csproj
+2
-1
YGOSharp.OCGWrapper.Enums/PlayerHintType.cs
YGOSharp.OCGWrapper.Enums/PlayerHintType.cs
+13
-0
No files found.
.gitignore
View file @
b9f20076
...
...
@@ -6,6 +6,7 @@
*.user
*.sln.docstates
.vs/
.vscode/
# Build results
...
...
Game/AI/DefaultExecutor.cs
View file @
b9f20076
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
YGOSharp.OCGWrapper.Enums
;
...
...
@@ -578,6 +578,18 @@ namespace WindBot.Game.AI
return
null
;
}
public
override
void
OnPlayerHint
(
int
player
,
int
hintType
,
int
description
)
{
base
.
OnPlayerHint
(
player
,
hintType
,
description
);
if
(
player
!=
0
&&
player
!=
1
)
return
;
ClientField
field
=
(
player
==
0
)
?
Bot
:
Enemy
;
if
(
hintType
==
(
int
)
PlayerHintType
.
DescAdd
)
field
.
HintDescriptions
.
Add
(
description
);
else
if
(
hintType
==
(
int
)
PlayerHintType
.
DescRemove
)
field
.
HintDescriptions
.
Remove
(
description
);
}
public
override
void
OnReceivingAnnouce
(
int
player
,
int
data
)
{
if
(
player
==
1
&&
data
==
Util
.
GetStringId
(
_CardId
.
LightningStorm
,
0
)
||
data
==
Util
.
GetStringId
(
_CardId
.
LightningStorm
,
1
))
...
...
Game/AI/Executor.cs
View file @
b9f20076
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
YGOSharp.OCGWrapper.Enums
;
...
...
@@ -121,6 +121,17 @@ namespace WindBot.Game.AI
// Some AI need do something on draw
}
/// <summary>
/// Called when a PlayerHint is received (e.g. effect description add/remove; can be used to track "once per turn" usage).
/// </summary>
/// <param name="player">Player index</param>
/// <param name="hintType">Hint type, see PlayerHintType (DescAdd=6, DescRemove=7)</param>
/// <param name="description">Effect description id (peffect->description)</param>
public
virtual
void
OnPlayerHint
(
int
player
,
int
hintType
,
int
description
)
{
// For overriding
}
public
virtual
void
OnMove
(
ClientCard
card
,
int
previousControler
,
int
previousLocation
,
int
currentControler
,
int
currentLocation
)
{
// Some AI need do something on card's moving
...
...
Game/ClientField.cs
View file @
b9f20076
...
...
@@ -19,6 +19,8 @@ namespace WindBot.Game
public
ClientCard
BattlingMonster
;
public
bool
UnderAttack
;
public
HashSet
<
int
>
HintDescriptions
{
get
;
private
set
;
}
public
ClientField
()
{
}
...
...
@@ -32,6 +34,7 @@ namespace WindBot.Game
Banished
=
new
List
<
ClientCard
>();
Deck
=
new
List
<
ClientCard
>();
ExtraDeck
=
new
List
<
ClientCard
>();
HintDescriptions
=
new
HashSet
<
int
>();
for
(
int
i
=
0
;
i
<
deck
;
++
i
)
Deck
.
Add
(
new
ClientCard
(
0
,
CardLocation
.
Deck
,
-
1
));
...
...
Game/GameAI.cs
View file @
b9f20076
using
System.Linq
;
using
System.Linq
;
using
System.Collections.Generic
;
using
System.Threading
;
using
WindBot.Game.AI
;
...
...
@@ -185,6 +185,17 @@ namespace WindBot.Game
CheckSurrender
();
}
/// <summary>
/// Called when a PlayerHint message is received (e.g. effect description add/remove hints).
/// </summary>
/// <param name="player">Player index</param>
/// <param name="hintType">Hint type, see PlayerHintType (DescAdd=6, DescRemove=7)</param>
/// <param name="description">Effect description id (peffect->description)</param>
public
void
OnPlayerHint
(
int
player
,
int
hintType
,
int
description
)
{
Executor
.
OnPlayerHint
(
player
,
hintType
,
description
);
}
/// <summary>
/// Called when receiving annouce
/// </summary>
...
...
Game/GameBehavior.cs
View file @
b9f20076
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
...
...
@@ -151,6 +151,7 @@ namespace WindBot.Game
_messages
.
Add
(
GameMessage
.
FlipSummoning
,
OnSummoning
);
_messages
.
Add
(
GameMessage
.
FlipSummoned
,
OnSummoned
);
_messages
.
Add
(
GameMessage
.
ConfirmCards
,
OnConfirmCards
);
_messages
.
Add
(
GameMessage
.
PlayerHint
,
OnPlayerHint
);
}
private
void
OnJoinGame
(
BinaryReader
packet
)
...
...
@@ -2015,5 +2016,18 @@ namespace WindBot.Game
Logger
.
WriteLine
(
"(Confirm "
+
player
.
ToString
()
+
"'s "
+
(
CardLocation
)
loc
+
" card: "
+
(
card
.
Name
??
"UnKnowCard"
)
+
")"
);
}
}
/// <summary>
/// Handles PlayerHint message. Protocol: player(buffer8), hintType(buffer8), description(buffer32).
/// hintType values: PlayerHintType (e.g. PHINT_DESC_ADD=6, PHINT_DESC_REMOVE=7).
/// </summary>
private
void
OnPlayerHint
(
BinaryReader
packet
)
{
int
player
=
packet
.
ReadByte
();
int
hintType
=
packet
.
ReadByte
();
int
description
=
packet
.
ReadInt32
();
Logger
.
DebugWriteLine
(
"PlayerHint received: player="
+
player
+
", hintType="
+
hintType
+
" ("
+
(
PlayerHintType
)
hintType
+
"), description="
+
description
);
_ai
.
OnPlayerHint
(
player
,
hintType
,
description
);
}
}
}
WindBot.csproj
View file @
b9f20076
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"12.0"
DefaultTargets=
"Build"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<Import
Project=
"$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
Condition=
"Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"
/>
<PropertyGroup>
...
...
@@ -181,6 +181,7 @@
<Compile
Include=
"YGOSharp.OCGWrapper.Enums\CardType.cs"
/>
<Compile
Include=
"YGOSharp.OCGWrapper.Enums\DuelPhase.cs"
/>
<Compile
Include=
"YGOSharp.OCGWrapper.Enums\GameMessage.cs"
/>
<Compile
Include=
"YGOSharp.OCGWrapper.Enums\PlayerHintType.cs"
/>
<Compile
Include=
"YGOSharp.OCGWrapper.Enums\Query.cs"
/>
<Compile
Include=
"YGOSharp.OCGWrapper\Card.cs"
/>
<Compile
Include=
"YGOSharp.OCGWrapper\CardsManager.cs"
/>
...
...
YGOSharp.OCGWrapper.Enums/PlayerHintType.cs
0 → 100644
View file @
b9f20076
namespace
YGOSharp.OCGWrapper.Enums
{
/// <summary>
/// Hint type for PlayerHint message (matches PHINT constants in core).
/// </summary>
public
enum
PlayerHintType
{
/// <summary>Add effect description hint</summary>
DescAdd
=
6
,
/// <summary>Remove effect description hint</summary>
DescRemove
=
7
}
}
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