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
神之吹息
windbot
Commits
e832e9cc
Commit
e832e9cc
authored
Mar 28, 2024
by
wind2009
Committed by
GitHub
Mar 28, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bot negating Horus monsters' special summoning (#186)
parent
82d8819c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
9 deletions
+38
-9
Game/AI/Decks/DarkMagicianExecutor.cs
Game/AI/Decks/DarkMagicianExecutor.cs
+1
-0
Game/AI/Decks/GrenMajuThunderBoarderExecutor.cs
Game/AI/Decks/GrenMajuThunderBoarderExecutor.cs
+2
-1
Game/AI/Decks/TimeThiefExecutor.cs
Game/AI/Decks/TimeThiefExecutor.cs
+1
-0
Game/AI/DefaultExecutor.cs
Game/AI/DefaultExecutor.cs
+27
-3
Game/ClientCard.cs
Game/ClientCard.cs
+2
-0
Game/GameBehavior.cs
Game/GameBehavior.cs
+5
-5
No files found.
Game/AI/Decks/DarkMagicianExecutor.cs
View file @
e832e9cc
...
...
@@ -496,6 +496,7 @@ namespace WindBot.Game.AI.Decks
{
if
(
Bot
.
LifePoints
>
1500
&&
Duel
.
LastChainPlayer
==
1
)
return
true
;
if
(
DefaultOnlyHorusSpSummoning
())
return
false
;
return
false
;
}
...
...
Game/AI/Decks/GrenMajuThunderBoarderExecutor.cs
View file @
e832e9cc
...
...
@@ -437,6 +437,7 @@ namespace WindBot.Game.AI.Decks
private
bool
ThunderKingRaiOheff
()
{
if
(
DefaultOnlyHorusSpSummoning
())
return
false
;
if
(
Duel
.
SummoningCards
.
Count
>
0
)
{
foreach
(
ClientCard
m
in
Duel
.
SummoningCards
)
...
...
Game/AI/Decks/TimeThiefExecutor.cs
View file @
e832e9cc
...
...
@@ -370,6 +370,7 @@ namespace WindBot.Game.AI.Decks
}
private
bool
ThunderKingRaiOheff
()
{
if
(
DefaultOnlyHorusSpSummoning
())
return
false
;
if
(
Duel
.
SummoningCards
.
Count
>
0
)
{
foreach
(
ClientCard
m
in
Duel
.
SummoningCards
)
...
...
Game/AI/DefaultExecutor.cs
View file @
e832e9cc
...
...
@@ -213,6 +213,7 @@ namespace WindBot.Game.AI
public
const
int
AncientWarriors
=
0x137
;
public
const
int
RescueACE
=
0x18b
;
public
const
int
VanquishSoul
=
0x195
;
public
const
int
Horus
=
0x19d
;
}
protected
DefaultExecutor
(
GameAI
ai
,
Duel
duel
)
...
...
@@ -834,7 +835,7 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultSolemnJudgment
()
{
return
!
Util
.
IsChainTargetOnly
(
Card
)
&&
!(
Duel
.
Player
==
0
&&
Duel
.
LastChainPlayer
==
-
1
)
&&
DefaultTrap
();
return
!
Util
.
IsChainTargetOnly
(
Card
)
&&
!(
Duel
.
Player
==
0
&&
Duel
.
LastChainPlayer
==
-
1
)
&&
!
DefaultOnlyHorusSpSummoning
()
&&
DefaultTrap
();
}
/// <summary>
...
...
@@ -842,7 +843,7 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultSolemnWarning
()
{
return
(
Bot
.
LifePoints
>
2000
)
&&
!(
Duel
.
Player
==
0
&&
Duel
.
LastChainPlayer
==
-
1
)
&&
DefaultTrap
();
return
(
Bot
.
LifePoints
>
2000
)
&&
!(
Duel
.
Player
==
0
&&
Duel
.
LastChainPlayer
==
-
1
)
&&
!
DefaultOnlyHorusSpSummoning
()
&&
DefaultTrap
();
}
/// <summary>
...
...
@@ -850,7 +851,30 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultSolemnStrike
()
{
return
(
Bot
.
LifePoints
>
1500
)
&&
!(
Duel
.
Player
==
0
&&
Duel
.
LastChainPlayer
==
-
1
)
&&
DefaultTrap
();
return
(
Bot
.
LifePoints
>
1500
)
&&
!(
Duel
.
Player
==
0
&&
Duel
.
LastChainPlayer
==
-
1
)
&&
!
DefaultOnlyHorusSpSummoning
()
&&
DefaultTrap
();
}
/// <summary>
/// Check whether only Horus monster is special summoning.
/// If returning true, should not negate the special summon since it can be special summoned again.
/// </summary>
/// <returns></returns>
protected
bool
DefaultOnlyHorusSpSummoning
()
{
if
(
Duel
.
SummoningCards
.
Count
!=
0
)
{
bool
notOnlyHorusFlag
=
false
;
foreach
(
ClientCard
card
in
Duel
.
SummoningCards
)
{
if
(!
card
.
HasSetcode
(
_Setcode
.
Horus
)
||
card
.
LastLocation
!=
CardLocation
.
Grave
)
{
notOnlyHorusFlag
=
true
;
break
;
}
}
return
!
notOnlyHorusFlag
;
}
return
false
;
}
/// <summary>
...
...
Game/ClientCard.cs
View file @
e832e9cc
...
...
@@ -15,6 +15,7 @@ namespace WindBot.Game
public
int
Position
{
get
;
set
;
}
public
int
Sequence
{
get
;
set
;
}
public
CardLocation
Location
{
get
;
set
;
}
public
CardLocation
LastLocation
{
get
;
set
;
}
public
int
Alias
{
get
;
private
set
;
}
public
int
Level
{
get
;
private
set
;
}
public
int
Rank
{
get
;
private
set
;
}
...
...
@@ -70,6 +71,7 @@ namespace WindBot.Game
ActionIndex
=
new
int
[
16
];
ActionActivateIndex
=
new
Dictionary
<
int
,
int
>();
Location
=
loc
;
LastLocation
=
0
;
}
public
void
SetId
(
int
id
)
...
...
Game/GameBehavior.cs
View file @
e832e9cc
...
...
@@ -376,15 +376,10 @@ namespace WindBot.Game
_duel
.
Fields
[
GetLocalPlayer
(
1
)].
Init
(
deck
,
extra
);
// in case of ending duel in chain's solving
_duel
.
LastChainPlayer
=
-
1
;
_duel
.
LastChainLocation
=
0
;
_duel
.
CurrentChain
.
Clear
();
_duel
.
ChainTargets
.
Clear
();
_duel
.
LastChainTargets
.
Clear
();
_duel
.
ChainTargetOnly
.
Clear
();
_duel
.
LastSummonPlayer
=
-
1
;
_duel
.
SummoningCards
.
Clear
();
_duel
.
LastSummonedCards
.
Clear
();
_duel
.
SolvingChainIndex
=
0
;
_duel
.
NegatedChainIndexList
.
Clear
();
...
...
@@ -615,6 +610,10 @@ namespace WindBot.Game
packet
.
ReadInt32
();
// reason
ClientCard
card
=
_duel
.
GetCard
(
previousControler
,
(
CardLocation
)
previousLocation
,
previousSequence
);
if
(
card
!=
null
)
{
card
.
LastLocation
=
(
CardLocation
)
previousLocation
;
}
if
((
previousLocation
&
(
int
)
CardLocation
.
Overlay
)
!=
0
)
{
previousLocation
=
previousLocation
&
0x7f
;
...
...
@@ -803,6 +802,7 @@ namespace WindBot.Game
_duel
.
ChainTargetOnly
.
Clear
();
_duel
.
SolvingChainIndex
=
0
;
_duel
.
NegatedChainIndexList
.
Clear
();
_duel
.
SummoningCards
.
Clear
();
}
private
void
OnCardSorting
(
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