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
HiiragiGuardians
windbot
Commits
ec7935f7
Commit
ec7935f7
authored
Jun 08, 2025
by
wind2009
Committed by
GitHub
Jun 08, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ChainInfo (#210)
parent
9c19a04f
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
176 additions
and
44 deletions
+176
-44
Game/AI/Decks/AlbazExecutor.cs
Game/AI/Decks/AlbazExecutor.cs
+8
-8
Game/AI/Decks/DogmatikaExecutor.cs
Game/AI/Decks/DogmatikaExecutor.cs
+3
-3
Game/AI/Decks/ExosisterExecutor.cs
Game/AI/Decks/ExosisterExecutor.cs
+3
-3
Game/AI/Decks/LabrynthExecutor.cs
Game/AI/Decks/LabrynthExecutor.cs
+3
-3
Game/AI/Decks/RyzealExecutor.cs
Game/AI/Decks/RyzealExecutor.cs
+43
-18
Game/AI/Decks/SwordsoulExecutor.cs
Game/AI/Decks/SwordsoulExecutor.cs
+3
-3
Game/AI/Decks/WitchcraftExecutor.cs
Game/AI/Decks/WitchcraftExecutor.cs
+6
-6
Game/ChainInfo.cs
Game/ChainInfo.cs
+93
-0
Game/Duel.cs
Game/Duel.cs
+8
-0
Game/GameBehavior.cs
Game/GameBehavior.cs
+5
-0
WindBot.csproj
WindBot.csproj
+1
-0
No files found.
Game/AI/Decks/AlbazExecutor.cs
View file @
ec7935f7
...
@@ -2186,7 +2186,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -2186,7 +2186,7 @@ namespace WindBot.Game.AI.Decks
public
override
int
OnSelectOption
(
IList
<
int
>
options
)
public
override
int
OnSelectOption
(
IList
<
int
>
options
)
{
{
C
lientCard
currentSolvingChain
=
Duel
.
GetCurrentSolvingChainCard
();
C
hainInfo
currentSolvingChain
=
Duel
.
GetCurrentSolvingChainInfo
();
if
(
currentSolvingChain
!=
null
)
if
(
currentSolvingChain
!=
null
)
{
{
// 1190=Add to Hand, 1152=Special Summon
// 1190=Add to Hand, 1152=Special Summon
...
@@ -2246,8 +2246,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -2246,8 +2246,8 @@ namespace WindBot.Game.AI.Decks
public
override
int
OnSelectPlace
(
int
cardId
,
int
player
,
CardLocation
location
,
int
available
)
public
override
int
OnSelectPlace
(
int
cardId
,
int
player
,
CardLocation
location
,
int
available
)
{
{
C
lientCard
currentSovingChain
=
Duel
.
GetCurrentSolvingChainCard
();
C
hainInfo
currentSovingChain
=
Duel
.
GetCurrentSolvingChainInfo
();
if
(
currentSovingChain
!=
null
&&
currentSovingChain
.
Controll
er
==
0
&&
currentSovingChain
.
IsCode
(
CardId
.
SprindTheIrondashDragon
))
if
(
currentSovingChain
!=
null
&&
currentSovingChain
.
ActivatePlay
er
==
0
&&
currentSovingChain
.
IsCode
(
CardId
.
SprindTheIrondashDragon
))
{
{
return
SprindTheIrondashDragonMoveZone
(
available
,
null
);
return
SprindTheIrondashDragonMoveZone
(
available
,
null
);
}
}
...
@@ -2435,21 +2435,21 @@ namespace WindBot.Game.AI.Decks
...
@@ -2435,21 +2435,21 @@ namespace WindBot.Game.AI.Decks
public
override
void
OnChainSolved
(
int
chainIndex
)
public
override
void
OnChainSolved
(
int
chainIndex
)
{
{
C
lientCard
currentCard
=
Duel
.
GetCurrentSolvingChainCard
();
C
hainInfo
currentCard
=
Duel
.
GetCurrentSolvingChainInfo
();
if
(
currentCard
!=
null
)
if
(
currentCard
!=
null
)
{
{
// if activation is negated, it can activate again.
// if activation is negated, it can activate again.
if
(
currentCard
.
Controll
er
==
0
)
if
(
currentCard
.
ActivatePlay
er
==
0
)
{
{
List
<
int
>
activateCheck
=
new
List
<
int
>
{
CardId
.
NadirServant
,
CardId
.
FusionDeployment
,
CardId
.
BrandedFusion
,
CardId
.
BrandedInRed
};
List
<
int
>
activateCheck
=
new
List
<
int
>
{
CardId
.
NadirServant
,
CardId
.
FusionDeployment
,
CardId
.
BrandedFusion
,
CardId
.
BrandedInRed
};
if
(
currentCard
.
IsCode
(
activateCheck
))
if
(
currentCard
.
IsCode
(
activateCheck
))
{
{
activatedCardIdList
.
Add
(
currentCard
.
Id
);
activatedCardIdList
.
Add
(
currentCard
.
Activate
Id
);
}
}
}
}
if
(!
Duel
.
IsCurrentSolvingChainNegated
())
if
(!
Duel
.
IsCurrentSolvingChainNegated
())
{
{
if
(
currentCard
.
Controll
er
==
1
)
if
(
currentCard
.
ActivatePlay
er
==
1
)
{
{
if
(
currentCard
.
IsCode
(
_CardId
.
MaxxC
))
if
(
currentCard
.
IsCode
(
_CardId
.
MaxxC
))
enemyActivateMaxxC
=
true
;
enemyActivateMaxxC
=
true
;
...
@@ -2458,7 +2458,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -2458,7 +2458,7 @@ namespace WindBot.Game.AI.Decks
if
(
currentCard
.
IsCode
(
CardId
.
DimensionShifter
))
if
(
currentCard
.
IsCode
(
CardId
.
DimensionShifter
))
dimensionShifterCount
=
2
;
dimensionShifterCount
=
2
;
}
}
if
(
currentCard
.
Controll
er
==
0
&&
currentCard
.
IsCode
(
CardId
.
NadirServant
))
if
(
currentCard
.
ActivatePlay
er
==
0
&&
currentCard
.
IsCode
(
CardId
.
NadirServant
))
{
{
nadirActivated
=
true
;
nadirActivated
=
true
;
}
}
...
...
Game/AI/Decks/DogmatikaExecutor.cs
View file @
ec7935f7
...
@@ -1153,8 +1153,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -1153,8 +1153,8 @@ namespace WindBot.Game.AI.Decks
public
override
void
OnChainSolved
(
int
chainIndex
)
public
override
void
OnChainSolved
(
int
chainIndex
)
{
{
C
lientCard
currentCard
=
Duel
.
GetCurrentSolvingChainCard
();
C
hainInfo
currentCard
=
Duel
.
GetCurrentSolvingChainInfo
();
if
(
currentCard
!=
null
&&
!
Duel
.
IsCurrentSolvingChainNegated
()
&&
currentCard
.
Controll
er
==
1
)
if
(
currentCard
!=
null
&&
!
Duel
.
IsCurrentSolvingChainNegated
()
&&
currentCard
.
ActivatePlay
er
==
1
)
{
{
if
(
currentCard
.
IsCode
(
_CardId
.
MaxxC
))
if
(
currentCard
.
IsCode
(
_CardId
.
MaxxC
))
enemyActivateMaxxC
=
true
;
enemyActivateMaxxC
=
true
;
...
@@ -1166,7 +1166,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -1166,7 +1166,7 @@ namespace WindBot.Game.AI.Decks
{
{
for
(
int
i
=
0
;
i
<
5
;
++
i
)
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
{
if
(
Enemy
.
SpellZone
[
i
]
==
currentCard
)
if
(
Enemy
.
SpellZone
[
i
]
==
currentCard
.
RelatedCard
)
{
{
infiniteImpermanenceList
.
Add
(
4
-
i
);
infiniteImpermanenceList
.
Add
(
4
-
i
);
break
;
break
;
...
...
Game/AI/Decks/ExosisterExecutor.cs
View file @
ec7935f7
...
@@ -771,8 +771,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -771,8 +771,8 @@ namespace WindBot.Game.AI.Decks
public
override
void
OnChainSolved
(
int
chainIndex
)
public
override
void
OnChainSolved
(
int
chainIndex
)
{
{
C
lientCard
currentCard
=
Duel
.
GetCurrentSolvingChainCard
();
C
hainInfo
currentCard
=
Duel
.
GetCurrentSolvingChainInfo
();
if
(
currentCard
!=
null
&&
!
Duel
.
IsCurrentSolvingChainNegated
()
&&
currentCard
.
Controll
er
==
1
)
if
(
currentCard
!=
null
&&
!
Duel
.
IsCurrentSolvingChainNegated
()
&&
currentCard
.
ActivatePlay
er
==
1
)
{
{
if
(
currentCard
.
IsCode
(
_CardId
.
MaxxC
))
if
(
currentCard
.
IsCode
(
_CardId
.
MaxxC
))
enemyActivateMaxxC
=
true
;
enemyActivateMaxxC
=
true
;
...
@@ -782,7 +782,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -782,7 +782,7 @@ namespace WindBot.Game.AI.Decks
{
{
for
(
int
i
=
0
;
i
<
5
;
++
i
)
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
{
if
(
Enemy
.
SpellZone
[
i
]
==
currentCard
)
if
(
Enemy
.
SpellZone
[
i
]
==
currentCard
.
RelatedCard
)
{
{
infiniteImpermanenceList
.
Add
(
4
-
i
);
infiniteImpermanenceList
.
Add
(
4
-
i
);
break
;
break
;
...
...
Game/AI/Decks/LabrynthExecutor.cs
View file @
ec7935f7
...
@@ -1646,17 +1646,17 @@ namespace WindBot.Game.AI.Decks
...
@@ -1646,17 +1646,17 @@ namespace WindBot.Game.AI.Decks
public
override
void
OnChainSolved
(
int
chainIndex
)
public
override
void
OnChainSolved
(
int
chainIndex
)
{
{
C
lientCard
currentCard
=
Duel
.
GetCurrentSolvingChainCard
();
C
hainInfo
currentCard
=
Duel
.
GetCurrentSolvingChainInfo
();
if
(
currentCard
!=
null
&&
!
Duel
.
IsCurrentSolvingChainNegated
())
if
(
currentCard
!=
null
&&
!
Duel
.
IsCurrentSolvingChainNegated
())
{
{
if
(
currentCard
.
Controll
er
==
1
)
if
(
currentCard
.
ActivatePlay
er
==
1
)
{
{
if
(
currentCard
.
IsCode
(
_CardId
.
MaxxC
))
if
(
currentCard
.
IsCode
(
_CardId
.
MaxxC
))
enemyActivateMaxxC
=
true
;
enemyActivateMaxxC
=
true
;
if
(
currentCard
.
IsCode
(
CardId
.
DimensionShifter
))
if
(
currentCard
.
IsCode
(
CardId
.
DimensionShifter
))
dimensionShifterCount
=
2
;
dimensionShifterCount
=
2
;
}
}
if
(
currentCard
.
Controll
er
==
0
)
if
(
currentCard
.
ActivatePlay
er
==
0
)
{
{
if
(
currentCard
.
IsCode
(
CardId
.
LabrynthCooclock
))
if
(
currentCard
.
IsCode
(
CardId
.
LabrynthCooclock
))
cooclockAffected
=
true
;
cooclockAffected
=
true
;
...
...
Game/AI/Decks/RyzealExecutor.cs
View file @
ec7935f7
...
@@ -64,6 +64,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -64,6 +64,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
GhostOgreAndSnowRabbit
,
GhostOgreAndSnowRabbitActivate
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
GhostOgreAndSnowRabbit
,
GhostOgreAndSnowRabbitActivate
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
AshBlossom
,
AshBlossomActivate
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
AshBlossom
,
AshBlossomActivate
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
RyzealCross
,
RyzealCrossActivateCard
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
EvilswarmExcitonKnight
,
EvilswarmExcitonKnightActivate
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
EvilswarmExcitonKnight
,
EvilswarmExcitonKnightActivate
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
RyzealDeadnader
,
RyzealDeadnaderActivate
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
RyzealDeadnader
,
RyzealDeadnaderActivate
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
RyzealDuodrive
,
RyzealDuodriveActivate
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
RyzealDuodrive
,
RyzealDuodriveActivate
);
...
@@ -82,7 +83,6 @@ namespace WindBot.Game.AI.Decks
...
@@ -82,7 +83,6 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Bonfire
,
BonfireActivate
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Bonfire
,
BonfireActivate
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
DonnerDaggerFurHire
,
DonnerDaggerFurHireActivate
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
DonnerDaggerFurHire
,
DonnerDaggerFurHireActivate
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Number60DugaresTheTimeless
,
Number60DugaresTheTimelessActivate
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Number60DugaresTheTimeless
,
Number60DugaresTheTimelessActivate
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
RyzealCross
,
RyzealCrossActivateCard
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
TripleTacticsTalent
,
TripleTacticsTalentActivate
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
TripleTacticsTalent
,
TripleTacticsTalentActivate
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Bonfire
,
BonfireActivateToSearchNecessary
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Bonfire
,
BonfireActivateToSearchNecessary
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
SeventhTachyon
,
SeventhTachyonActivate
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
SeventhTachyon
,
SeventhTachyonActivate
);
...
@@ -372,6 +372,26 @@ namespace WindBot.Game.AI.Decks
...
@@ -372,6 +372,26 @@ namespace WindBot.Game.AI.Decks
return
true
;
return
true
;
}
}
public
bool
CheckCardShouldNegate
(
ChainInfo
chainInfo
)
{
if
(
chainInfo
==
null
)
return
false
;
ClientCard
card
=
chainInfo
.
RelatedCard
;
if
(
card
==
null
)
return
false
;
if
(
card
.
IsMonster
()
&&
card
.
HasSetcode
(
SetcodeTimeLord
)
&&
Duel
.
Phase
==
DuelPhase
.
Standby
)
return
false
;
if
(
NotToNegateIdList
.
Contains
(
card
.
Id
))
return
false
;
if
(
card
.
HasSetcode
(
_Setcode
.
Danger
)
&&
card
.
Location
==
CardLocation
.
Hand
)
return
false
;
if
(
card
.
IsMonster
()
&&
chainInfo
.
HasLocation
(
CardLocation
.
MonsterZone
)
&&
chainInfo
.
HasPosition
(
CardPosition
.
Defence
))
{
if
(
Enemy
.
MonsterZone
.
Any
(
c
=>
CheckNumber41
(
c
))
||
Bot
.
MonsterZone
.
Any
(
c
=>
CheckNumber41
(
c
)))
return
false
;
}
if
(
DefaultCheckWhetherCardIsNegated
(
card
))
return
false
;
if
(
Duel
.
Player
==
1
&&
card
.
IsCode
(
_CardId
.
MulcharmyPurulia
,
_CardId
.
MulcharmyFuwalos
,
_CardId
.
MulcharmyNyalus
))
return
false
;
if
(
card
.
IsDisabled
())
return
false
;
return
true
;
}
/// <summary>
/// <summary>
/// Check whether bot is at advantage.
/// Check whether bot is at advantage.
/// </summary>
/// </summary>
...
@@ -901,7 +921,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -901,7 +921,7 @@ namespace WindBot.Game.AI.Decks
public
override
IList
<
ClientCard
>
OnSelectCard
(
IList
<
ClientCard
>
cards
,
int
min
,
int
max
,
int
hint
,
bool
cancelable
)
public
override
IList
<
ClientCard
>
OnSelectCard
(
IList
<
ClientCard
>
cards
,
int
min
,
int
max
,
int
hint
,
bool
cancelable
)
{
{
C
lientCard
currentSolvingChain
=
Duel
.
GetCurrentSolvingChainCard
();
C
hainInfo
currentSolvingChain
=
Duel
.
GetCurrentSolvingChainInfo
();
if
(
currentSolvingChain
!=
null
)
if
(
currentSolvingChain
!=
null
)
{
{
if
(
botSolvingCross
)
if
(
botSolvingCross
)
...
@@ -933,7 +953,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -933,7 +953,7 @@ namespace WindBot.Game.AI.Decks
}
}
}
}
if
(
currentSolvingChain
.
Controll
er
==
1
&&
currentSolvingChain
.
IsCode
(
_CardId
.
EvenlyMatched
))
if
(
currentSolvingChain
.
ActivatePlay
er
==
1
&&
currentSolvingChain
.
IsCode
(
_CardId
.
EvenlyMatched
))
{
{
Logger
.
DebugWriteLine
(
"=== Evenly Matched activated."
);
Logger
.
DebugWriteLine
(
"=== Evenly Matched activated."
);
List
<
ClientCard
>
banishList
=
new
List
<
ClientCard
>();
List
<
ClientCard
>
banishList
=
new
List
<
ClientCard
>();
...
@@ -975,7 +995,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -975,7 +995,7 @@ namespace WindBot.Game.AI.Decks
return
Util
.
CheckSelectCount
(
banishList
,
cards
,
min
,
max
);
return
Util
.
CheckSelectCount
(
banishList
,
cards
,
min
,
max
);
}
}
if
(
currentSolvingChain
.
Controll
er
==
0
)
if
(
currentSolvingChain
.
ActivatePlay
er
==
0
)
{
{
if
(
hint
==
HintMsg
.
AddToHand
)
if
(
hint
==
HintMsg
.
AddToHand
)
{
{
...
@@ -1681,31 +1701,31 @@ namespace WindBot.Game.AI.Decks
...
@@ -1681,31 +1701,31 @@ namespace WindBot.Game.AI.Decks
public
override
void
OnChainSolved
(
int
chainIndex
)
public
override
void
OnChainSolved
(
int
chainIndex
)
{
{
botSolvingCross
=
false
;
botSolvingCross
=
false
;
C
lientCard
currentCard
=
Duel
.
GetCurrentSolvingChainCard
();
C
hainInfo
currentChain
=
Duel
.
GetCurrentSolvingChainInfo
();
if
(
currentC
ard
!=
null
)
if
(
currentC
hain
!=
null
&&
!
Duel
.
IsCurrentSolvingChainNegated
()
)
{
{
if
(!
Duel
.
IsCurrentSolvingChainNegated
())
if
(!
Duel
.
IsCurrentSolvingChainNegated
())
{
{
if
(
currentC
ard
.
IsCode
(
_CardId
.
LockBird
))
if
(
currentC
hain
.
IsCode
(
_CardId
.
LockBird
))
lockBirdSolved
=
true
;
lockBirdSolved
=
true
;
if
(
currentC
ard
.
IsCode
(
_CardId
.
DimensionShifter
))
if
(
currentC
hain
.
IsCode
(
_CardId
.
DimensionShifter
))
dimensionShifterCount
=
2
;
dimensionShifterCount
=
2
;
if
(
currentC
ard
.
Controll
er
==
1
)
if
(
currentC
hain
.
ActivatePlay
er
==
1
)
{
{
if
(
currentC
ard
.
IsCode
(
_CardId
.
MaxxC
))
if
(
currentC
hain
.
IsCode
(
_CardId
.
MaxxC
))
enemyActivateMaxxC
=
true
;
enemyActivateMaxxC
=
true
;
if
(
currentC
ard
.
IsCode
(
_CardId
.
MulcharmyPurulia
))
if
(
currentC
hain
.
IsCode
(
_CardId
.
MulcharmyPurulia
))
enemyActivatePurulia
=
true
;
enemyActivatePurulia
=
true
;
if
(
currentC
ard
.
IsCode
(
_CardId
.
MulcharmyFuwalos
))
if
(
currentC
hain
.
IsCode
(
_CardId
.
MulcharmyFuwalos
))
enemyActivateFuwalos
=
true
;
enemyActivateFuwalos
=
true
;
if
(
currentC
ard
.
IsCode
(
_CardId
.
MulcharmyNyalus
))
if
(
currentC
hain
.
IsCode
(
_CardId
.
MulcharmyNyalus
))
enemyActivateNyalus
=
true
;
enemyActivateNyalus
=
true
;
}
}
if
(
currentC
ard
.
Controll
er
==
0
)
if
(
currentC
hain
.
ActivatePlay
er
==
0
)
{
{
foreach
(
int
checkId
in
CheckBotSolvedList
)
foreach
(
int
checkId
in
CheckBotSolvedList
)
{
{
if
(
currentC
ard
.
IsCode
(
checkId
))
if
(
currentC
hain
.
IsCode
(
checkId
))
{
{
botSolvedCardIdList
.
Add
(
checkId
);
botSolvedCardIdList
.
Add
(
checkId
);
}
}
...
@@ -2758,10 +2778,10 @@ namespace WindBot.Game.AI.Decks
...
@@ -2758,10 +2778,10 @@ namespace WindBot.Game.AI.Decks
// whether to negate by cross
// whether to negate by cross
if
(
ActivateDescription
==
Util
.
GetStringId
(
CardId
.
RyzealCross
,
3
))
if
(
ActivateDescription
==
Util
.
GetStringId
(
CardId
.
RyzealCross
,
3
))
{
{
C
lientCard
currentSolvingChain
=
Duel
.
GetCurrentSolvingChainCard
();
C
hainInfo
currentChainInfo
=
Duel
.
GetCurrentSolvingChainInfo
();
if
(
current
SolvingChain
!=
null
&&
!
Duel
.
IsCurrentSolvingChainNegated
())
if
(
current
ChainInfo
!=
null
&&
!
Duel
.
IsCurrentSolvingChainNegated
())
{
{
if
(
CheckCardShouldNegate
(
current
SolvingChain
))
if
(
CheckCardShouldNegate
(
current
ChainInfo
))
{
{
Logger
.
DebugWriteLine
(
"** cross negate"
);
Logger
.
DebugWriteLine
(
"** cross negate"
);
activatedCardIdList
.
Add
(
CardId
.
RyzealCross
+
2
);
activatedCardIdList
.
Add
(
CardId
.
RyzealCross
+
2
);
...
@@ -2780,6 +2800,11 @@ namespace WindBot.Game.AI.Decks
...
@@ -2780,6 +2800,11 @@ namespace WindBot.Game.AI.Decks
Bot
.
Banished
.
Any
(
c
=>
c
!=
null
&&
c
.
IsFaceup
()
&&
c
.
HasSetcode
(
SetcodeRyzeal
)
&&
(
c
.
IsCanRevive
()
||
!
c
.
HasType
(
CardType
.
Xyz
))));
Bot
.
Banished
.
Any
(
c
=>
c
!=
null
&&
c
.
IsFaceup
()
&&
c
.
HasSetcode
(
SetcodeRyzeal
)
&&
(
c
.
IsCanRevive
()
||
!
c
.
HasType
(
CardType
.
Xyz
))));
flag
|=
Bot
.
MonsterZone
.
Count
(
c
=>
c
!=
null
&&
c
.
IsFaceup
()
&&
c
.
HasType
(
CardType
.
Xyz
)
&&
c
.
HasSetcode
(
SetcodeRyzeal
)
&&
(
c
.
Overlays
.
Count
()
>
0
||
canSetMaterial
))
>
0
;
flag
|=
Bot
.
MonsterZone
.
Count
(
c
=>
c
!=
null
&&
c
.
IsFaceup
()
&&
c
.
HasType
(
CardType
.
Xyz
)
&&
c
.
HasSetcode
(
SetcodeRyzeal
)
&&
(
c
.
Overlays
.
Count
()
>
0
||
canSetMaterial
))
>
0
;
if
(
Duel
.
MainPhase
.
SpecialSummonableCards
.
Any
(
c
=>
c
.
IsCode
(
CardId
.
RyzealDuodrive
)))
{
flag
|=
RyzealDuodriveSpSummonCheck
();
}
return
flag
;
return
flag
;
}
}
...
...
Game/AI/Decks/SwordsoulExecutor.cs
View file @
ec7935f7
...
@@ -695,8 +695,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -695,8 +695,8 @@ namespace WindBot.Game.AI.Decks
public
override
void
OnChainSolved
(
int
chainIndex
)
public
override
void
OnChainSolved
(
int
chainIndex
)
{
{
C
lientCard
currentCard
=
Duel
.
GetCurrentSolvingChainCard
();
C
hainInfo
currentCard
=
Duel
.
GetCurrentSolvingChainInfo
();
if
(
currentCard
!=
null
&&
!
Duel
.
IsCurrentSolvingChainNegated
()
&&
currentCard
.
Controll
er
==
1
)
if
(
currentCard
!=
null
&&
!
Duel
.
IsCurrentSolvingChainNegated
()
&&
currentCard
.
ActivatePlay
er
==
1
)
{
{
if
(
currentCard
.
IsCode
(
_CardId
.
MaxxC
))
if
(
currentCard
.
IsCode
(
_CardId
.
MaxxC
))
enemyActivateMaxxC
=
true
;
enemyActivateMaxxC
=
true
;
...
@@ -706,7 +706,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -706,7 +706,7 @@ namespace WindBot.Game.AI.Decks
{
{
for
(
int
i
=
0
;
i
<
5
;
++
i
)
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
{
if
(
Enemy
.
SpellZone
[
i
]
==
currentCard
)
if
(
Enemy
.
SpellZone
[
i
]
==
currentCard
.
RelatedCard
)
{
{
infiniteImpermanenceList
.
Add
(
4
-
i
);
infiniteImpermanenceList
.
Add
(
4
-
i
);
break
;
break
;
...
...
Game/AI/Decks/WitchcraftExecutor.cs
View file @
ec7935f7
...
@@ -201,8 +201,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -201,8 +201,8 @@ namespace WindBot.Game.AI.Decks
public
override
void
OnChainSolved
(
int
chainIndex
)
public
override
void
OnChainSolved
(
int
chainIndex
)
{
{
C
lientCard
currentCard
=
Duel
.
GetCurrentSolvingChainCard
();
C
hainInfo
currentCard
=
Duel
.
GetCurrentSolvingChainInfo
();
if
(
currentCard
!=
null
&&
currentCard
.
Controll
er
==
1
)
if
(
currentCard
!=
null
&&
currentCard
.
ActivatePlay
er
==
1
)
{
{
if
(
Duel
.
IsCurrentSolvingChainNegated
())
if
(
Duel
.
IsCurrentSolvingChainNegated
())
{
{
...
@@ -212,16 +212,16 @@ namespace WindBot.Game.AI.Decks
...
@@ -212,16 +212,16 @@ namespace WindBot.Game.AI.Decks
if
(
Bot
.
MonsterZone
.
GetFirstMatchingCard
(
c
=>
c
.
HasRace
(
CardRace
.
SpellCaster
)
&&
c
.
IsFaceup
())
!=
null
if
(
Bot
.
MonsterZone
.
GetFirstMatchingCard
(
c
=>
c
.
HasRace
(
CardRace
.
SpellCaster
)
&&
c
.
IsFaceup
())
!=
null
&&
Bot
.
HasInSpellZone
(
CardId
.
MagicianRightHand
,
true
))
&&
Bot
.
HasInSpellZone
(
CardId
.
MagicianRightHand
,
true
))
{
{
Logger
.
DebugWriteLine
(
"MagicianRightHand negate: "
+
currentCard
.
Name
??
"???"
);
Logger
.
DebugWriteLine
(
"MagicianRightHand negate: "
+
currentCard
.
RelatedCard
.
Name
??
"???"
);
MagicianRightHand_used
=
true
;
MagicianRightHand_used
=
true
;
}
}
}
}
if
(!
MagiciansLeftHand_used
&&
currentCard
.
IsTrap
()
&&
currentCard
.
Controll
er
==
1
)
if
(!
MagiciansLeftHand_used
&&
currentCard
.
IsTrap
()
&&
currentCard
.
ActivatePlay
er
==
1
)
{
{
if
(
Bot
.
MonsterZone
.
GetFirstMatchingCard
(
c
=>
c
.
HasRace
(
CardRace
.
SpellCaster
)
&&
c
.
IsFaceup
())
!=
null
if
(
Bot
.
MonsterZone
.
GetFirstMatchingCard
(
c
=>
c
.
HasRace
(
CardRace
.
SpellCaster
)
&&
c
.
IsFaceup
())
!=
null
&&
Bot
.
HasInSpellZone
(
CardId
.
MagiciansLeftHand
,
true
))
&&
Bot
.
HasInSpellZone
(
CardId
.
MagiciansLeftHand
,
true
))
{
{
Logger
.
DebugWriteLine
(
"MagiciansLeftHand negate: "
+
currentCard
.
Name
??
"???"
);
Logger
.
DebugWriteLine
(
"MagiciansLeftHand negate: "
+
currentCard
.
RelatedCard
.
Name
??
"???"
);
MagiciansLeftHand_used
=
true
;
MagiciansLeftHand_used
=
true
;
}
}
}
}
...
@@ -236,7 +236,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -236,7 +236,7 @@ namespace WindBot.Game.AI.Decks
{
{
for
(
int
i
=
0
;
i
<
5
;
++
i
)
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
{
if
(
Enemy
.
SpellZone
[
i
]
==
currentCard
)
if
(
Enemy
.
SpellZone
[
i
]
==
currentCard
.
RelatedCard
)
{
{
Impermanence_list
.
Add
(
4
-
i
);
Impermanence_list
.
Add
(
4
-
i
);
break
;
break
;
...
...
Game/ChainInfo.cs
0 → 100644
View file @
ec7935f7
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
YGOSharp.OCGWrapper
;
using
YGOSharp.OCGWrapper.Enums
;
namespace
WindBot.Game
{
public
class
ChainInfo
{
public
ClientCard
RelatedCard
{
get
;
private
set
;
}
public
int
ActivatePlayer
{
get
;
private
set
;
}
public
int
ActivateId
{
get
;
private
set
;
}
public
int
ActivateController
{
get
;
private
set
;
}
public
int
ActivatePosition
{
get
;
private
set
;
}
public
int
ActivateSequence
{
get
;
private
set
;
}
public
CardLocation
ActivateLocation
{
get
;
private
set
;
}
public
int
ActivateLevel
{
get
;
private
set
;
}
public
int
ActivateRank
{
get
;
private
set
;
}
public
int
ActivateType
{
get
;
private
set
;
}
public
int
ActivateRace
{
get
;
private
set
;
}
public
int
ActivateAttack
{
get
;
private
set
;
}
public
int
ActivateDefense
{
get
;
private
set
;
}
public
bool
IsSpecialSummoned
{
get
;
private
set
;
}
public
int
ActivateDescription
{
get
;
private
set
;
}
public
ChainInfo
(
ClientCard
card
)
:
this
(
card
,
card
.
Controller
,
0
)
{
}
public
ChainInfo
(
ClientCard
card
,
int
player
,
int
desc
)
{
RelatedCard
=
card
;
ActivatePlayer
=
player
;
ActivateId
=
card
.
Id
;
ActivateController
=
card
.
Controller
;
ActivatePosition
=
card
.
Position
;
ActivateSequence
=
card
.
Sequence
;
ActivateLocation
=
card
.
Location
;
ActivateLevel
=
card
.
Level
;
ActivateRank
=
card
.
Rank
;
ActivateType
=
card
.
Type
;
ActivateRace
=
card
.
Race
;
ActivateAttack
=
card
.
Attack
;
ActivateDefense
=
card
.
Defense
;
ActivateAttack
=
card
.
Attack
;
ActivateDefense
=
card
.
Defense
;
IsSpecialSummoned
=
card
.
IsSpecialSummoned
;
ActivateDescription
=
desc
;
}
public
bool
HasPosition
(
CardPosition
position
)
{
return
(
ActivatePosition
&
(
int
)
position
)
!=
0
;
}
public
bool
HasLocation
(
CardLocation
location
)
{
return
((
int
)
ActivateLocation
&
(
int
)
location
)
!=
0
;
}
public
bool
IsCode
(
int
id
)
{
return
RelatedCard
!=
null
&&
RelatedCard
.
IsCode
(
id
);
}
public
bool
IsCode
(
IList
<
int
>
ids
)
{
return
RelatedCard
!=
null
&&
RelatedCard
.
IsCode
(
ids
);
}
public
bool
IsCode
(
params
int
[]
ids
)
{
return
RelatedCard
!=
null
&&
RelatedCard
.
IsCode
(
ids
);
}
public
bool
HasType
(
CardType
type
)
{
return
RelatedCard
!=
null
&&
(
RelatedCard
.
Type
&
(
int
)
type
)
!=
0
;
}
public
bool
IsSpell
()
{
return
HasType
(
CardType
.
Spell
);
}
public
bool
IsTrap
()
{
return
HasType
(
CardType
.
Trap
);
}
}
}
Game/Duel.cs
View file @
ec7935f7
...
@@ -20,6 +20,7 @@ namespace WindBot.Game
...
@@ -20,6 +20,7 @@ namespace WindBot.Game
public
int
LastChainPlayer
{
get
;
set
;
}
public
int
LastChainPlayer
{
get
;
set
;
}
public
CardLocation
LastChainLocation
{
get
;
set
;
}
public
CardLocation
LastChainLocation
{
get
;
set
;
}
public
IList
<
ClientCard
>
CurrentChain
{
get
;
set
;
}
public
IList
<
ClientCard
>
CurrentChain
{
get
;
set
;
}
public
IList
<
ChainInfo
>
CurrentChainInfo
{
get
;
set
;
}
public
IList
<
ClientCard
>
ChainTargets
{
get
;
set
;
}
public
IList
<
ClientCard
>
ChainTargets
{
get
;
set
;
}
public
IList
<
ClientCard
>
LastChainTargets
{
get
;
set
;
}
public
IList
<
ClientCard
>
LastChainTargets
{
get
;
set
;
}
public
IList
<
ClientCard
>
ChainTargetOnly
{
get
;
set
;
}
public
IList
<
ClientCard
>
ChainTargetOnly
{
get
;
set
;
}
...
@@ -37,6 +38,7 @@ namespace WindBot.Game
...
@@ -37,6 +38,7 @@ namespace WindBot.Game
LastChainPlayer
=
-
1
;
LastChainPlayer
=
-
1
;
LastChainLocation
=
0
;
LastChainLocation
=
0
;
CurrentChain
=
new
List
<
ClientCard
>();
CurrentChain
=
new
List
<
ClientCard
>();
CurrentChainInfo
=
new
List
<
ChainInfo
>();
ChainTargets
=
new
List
<
ClientCard
>();
ChainTargets
=
new
List
<
ClientCard
>();
LastChainTargets
=
new
List
<
ClientCard
>();
LastChainTargets
=
new
List
<
ClientCard
>();
ChainTargetOnly
=
new
List
<
ClientCard
>();
ChainTargetOnly
=
new
List
<
ClientCard
>();
...
@@ -180,6 +182,12 @@ namespace WindBot.Game
...
@@ -180,6 +182,12 @@ namespace WindBot.Game
return
CurrentChain
[
SolvingChainIndex
-
1
];
return
CurrentChain
[
SolvingChainIndex
-
1
];
}
}
public
ChainInfo
GetCurrentSolvingChainInfo
()
{
if
(
SolvingChainIndex
==
0
||
SolvingChainIndex
>
CurrentChainInfo
.
Count
)
return
null
;
return
CurrentChainInfo
[
SolvingChainIndex
-
1
];
}
public
bool
IsCurrentSolvingChainNegated
()
public
bool
IsCurrentSolvingChainNegated
()
{
{
return
SolvingChainIndex
>
0
&&
NegatedChainIndexList
.
Contains
(
SolvingChainIndex
);
return
SolvingChainIndex
>
0
&&
NegatedChainIndexList
.
Contains
(
SolvingChainIndex
);
...
...
Game/GameBehavior.cs
View file @
ec7935f7
...
@@ -386,6 +386,7 @@ namespace WindBot.Game
...
@@ -386,6 +386,7 @@ namespace WindBot.Game
// in case of ending duel in chain's solving
// in case of ending duel in chain's solving
_duel
.
CurrentChain
.
Clear
();
_duel
.
CurrentChain
.
Clear
();
_duel
.
CurrentChainInfo
.
Clear
();
_duel
.
ChainTargets
.
Clear
();
_duel
.
ChainTargets
.
Clear
();
_duel
.
ChainTargetOnly
.
Clear
();
_duel
.
ChainTargetOnly
.
Clear
();
_duel
.
SummoningCards
.
Clear
();
_duel
.
SummoningCards
.
Clear
();
...
@@ -764,6 +765,8 @@ namespace WindBot.Game
...
@@ -764,6 +765,8 @@ namespace WindBot.Game
if
(
card
.
Id
==
0
)
if
(
card
.
Id
==
0
)
card
.
SetId
(
cardId
);
card
.
SetId
(
cardId
);
int
cc
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
cc
=
GetLocalPlayer
(
packet
.
ReadByte
());
packet
.
ReadInt16
();
// trigger location + trigger sequence
int
desc
=
packet
.
ReadInt32
();
if
(
_debug
)
if
(
_debug
)
if
(
card
!=
null
)
Logger
.
WriteLine
(
"("
+
cc
.
ToString
()
+
" 's "
+
(
card
.
Name
??
"UnKnowCard"
)
+
" activate effect from "
+
(
CardLocation
)
pcl
+
")"
);
if
(
card
!=
null
)
Logger
.
WriteLine
(
"("
+
cc
.
ToString
()
+
" 's "
+
(
card
.
Name
??
"UnKnowCard"
)
+
" activate effect from "
+
(
CardLocation
)
pcl
+
")"
);
_duel
.
LastChainLocation
=
(
CardLocation
)
pcl
;
_duel
.
LastChainLocation
=
(
CardLocation
)
pcl
;
...
@@ -772,6 +775,7 @@ namespace WindBot.Game
...
@@ -772,6 +775,7 @@ namespace WindBot.Game
_duel
.
ChainTargetOnly
.
Clear
();
_duel
.
ChainTargetOnly
.
Clear
();
_duel
.
LastSummonPlayer
=
-
1
;
_duel
.
LastSummonPlayer
=
-
1
;
_duel
.
CurrentChain
.
Add
(
card
);
_duel
.
CurrentChain
.
Add
(
card
);
_duel
.
CurrentChainInfo
.
Add
(
new
ChainInfo
(
card
,
cc
,
desc
));
_duel
.
LastChainPlayer
=
cc
;
_duel
.
LastChainPlayer
=
cc
;
}
}
...
@@ -806,6 +810,7 @@ namespace WindBot.Game
...
@@ -806,6 +810,7 @@ namespace WindBot.Game
_duel
.
LastChainPlayer
=
-
1
;
_duel
.
LastChainPlayer
=
-
1
;
_duel
.
LastChainLocation
=
0
;
_duel
.
LastChainLocation
=
0
;
_duel
.
CurrentChain
.
Clear
();
_duel
.
CurrentChain
.
Clear
();
_duel
.
CurrentChainInfo
.
Clear
();
_duel
.
ChainTargets
.
Clear
();
_duel
.
ChainTargets
.
Clear
();
_duel
.
LastChainTargets
.
Clear
();
_duel
.
LastChainTargets
.
Clear
();
_duel
.
ChainTargetOnly
.
Clear
();
_duel
.
ChainTargetOnly
.
Clear
();
...
...
WindBot.csproj
View file @
ec7935f7
...
@@ -144,6 +144,7 @@
...
@@ -144,6 +144,7 @@
<Compile
Include=
"Game\AI\ExecutorType.cs"
/>
<Compile
Include=
"Game\AI\ExecutorType.cs"
/>
<Compile
Include=
"Game\BattlePhase.cs"
/>
<Compile
Include=
"Game\BattlePhase.cs"
/>
<Compile
Include=
"Game\BattlePhaseAction.cs"
/>
<Compile
Include=
"Game\BattlePhaseAction.cs"
/>
<Compile
Include=
"Game\ChainInfo.cs"
/>
<Compile
Include=
"Game\ClientCard.cs"
/>
<Compile
Include=
"Game\ClientCard.cs"
/>
<Compile
Include=
"Game\ClientField.cs"
/>
<Compile
Include=
"Game\ClientField.cs"
/>
<Compile
Include=
"Game\Deck.cs"
/>
<Compile
Include=
"Game\Deck.cs"
/>
...
...
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