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
6d4d8bbc
Commit
6d4d8bbc
authored
Jan 11, 2024
by
wind2009
Committed by
GitHub
Jan 11, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AI_Labrynth (#181)
parent
eec2779c
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
4505 additions
and
13 deletions
+4505
-13
BotWrapper/bot.conf
BotWrapper/bot.conf
+5
-0
Decks/AI_Labrynth.ydk
Decks/AI_Labrynth.ydk
+59
-0
Game/AI/Decks/DogmatikaExecutor.cs
Game/AI/Decks/DogmatikaExecutor.cs
+2
-2
Game/AI/Decks/LabrynthExecutor.cs
Game/AI/Decks/LabrynthExecutor.cs
+4368
-0
Game/AI/DefaultExecutor.cs
Game/AI/DefaultExecutor.cs
+33
-6
Game/AI/Enums/Floodgate.cs
Game/AI/Enums/Floodgate.cs
+1
-0
Game/AI/Enums/FusionSpell.cs
Game/AI/Enums/FusionSpell.cs
+1
-0
Game/AI/Executor.cs
Game/AI/Executor.cs
+7
-1
Game/AI/HintMsg.cs
Game/AI/HintMsg.cs
+6
-1
Game/GameAI.cs
Game/GameAI.cs
+12
-2
Game/GameBehavior.cs
Game/GameBehavior.cs
+10
-1
WindBot.csproj
WindBot.csproj
+1
-0
No files found.
BotWrapper/bot.conf
View file @
6d4d8bbc
...
...
@@ -99,6 +99,11 @@ Name=尼亚 Deck=Altergeist Dialog=near.zh-CN
幻变骚灵卡组。
AI_LV3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!尼亚-拉比林斯迷宫
Name
=尼亚
Deck
=
Labrynth
Dialog
=
near
.
zh
-
CN
拉比林斯迷宫卡组。
AI_LV3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!复制梁龙-闪刀姬
Name
=复制梁龙
Deck
=
SkyStriker
Dialog
=
anothercopy
.
zh
-
CN
旧式闪刀姬卡组。
...
...
Decks/AI_Labrynth.ydk
0 → 100644
View file @
6d4d8bbc
#created by ...
#main
81497285
81497285
2347656
41165831
73602965
73602965
75730490
1225009
1225009
1225009
37629703
37629703
37629703
14558127
14558127
14558127
23434538
23434538
23434538
74018812
74018812
74018812
2511
2511
2511
49238328
49238328
5380979
5380979
6351147
6351147
10045474
10045474
10045474
30748475
53417695
83326048
92714517
92714517
92714517
#extra
22850702
22850702
93039339
93039339
29479265
93084621
93084621
24269961
24269961
24269961
67680512
67680512
29301450
71607202
94259633
!side
Game/AI/Decks/DogmatikaExecutor.cs
View file @
6d4d8bbc
...
...
@@ -1081,7 +1081,7 @@ namespace WindBot.Game.AI.Decks
}
}
public
override
void
OnMove
(
int
cardI
d
,
int
previousControler
,
int
previousLocation
,
int
currentControler
,
int
currentLocation
)
public
override
void
OnMove
(
ClientCard
car
d
,
int
previousControler
,
int
previousLocation
,
int
currentControler
,
int
currentLocation
)
{
if
(
previousControler
==
1
&&
currentLocation
==
(
int
)
CardLocation
.
MonsterZone
)
{
...
...
@@ -1093,7 +1093,7 @@ namespace WindBot.Game.AI.Decks
}
}
base
.
OnMove
(
card
Id
,
previousControler
,
previousLocation
,
currentControler
,
currentLocation
);
base
.
OnMove
(
card
,
previousControler
,
previousLocation
,
currentControler
,
currentLocation
);
}
public
override
BattlePhaseAction
OnBattle
(
IList
<
ClientCard
>
attackers
,
IList
<
ClientCard
>
defenders
)
...
...
Game/AI/Decks/LabrynthExecutor.cs
0 → 100644
View file @
6d4d8bbc
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Game/AI/DefaultExecutor.cs
View file @
6d4d8bbc
...
...
@@ -125,6 +125,7 @@ namespace WindBot.Game.AI
public
const
int
VaylantzWorld_ShinraBansho
=
49568943
;
public
const
int
VaylantzWorld_KonigWissen
=
75952542
;
public
const
int
DivineArsenalAAZEUS_SkyThunder
=
90448279
;
public
const
int
LightningStorm
=
14532163
;
public
const
int
BelialMarquisOfDarkness
=
33655493
;
public
const
int
Chirubim
é
PrincessOfAutumnLeaves
=
87294988
;
...
...
@@ -223,6 +224,8 @@ namespace WindBot.Game.AI
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
SantaClaws
);
}
protected
int
lightningStormOption
=
-
1
;
/// <summary>
/// Defined:
/// if monster with code as KEY, other monsters with rules as VALUE won't be targeted for attack.
...
...
@@ -395,6 +398,9 @@ namespace WindBot.Game.AI
}
}
if
(
attacker
.
EquipCards
.
Any
(
equip
=>
equip
.
IsCode
(
_CardId
.
MoonMirrorShield
)
&&
!
equip
.
IsDisabled
()))
attacker
.
RealPower
=
defender
.
RealPower
+
100
;
if
(!
defender
.
IsDisabled
())
{
Func
<
ClientCard
,
List
<
ClientCard
>,
bool
>
defenderRule
=
(
card
,
monsterList
)
=>
false
;
...
...
@@ -430,6 +436,9 @@ namespace WindBot.Game.AI
if
(
Enemy
.
HasInSpellZone
(
_CardId
.
CrusadiaVanguard
,
true
)
&&
Enemy
.
GetMonsters
().
Any
(
card
=>
card
.
HasSetcode
(
_Setcode
.
Crusadia
)
&&
card
.
HasType
(
CardType
.
Link
))
&&
!
defender
.
HasType
(
CardType
.
Link
))
return
false
;
if
(
defender
.
IsCode
(
_CardId
.
RescueACEHydrant
)
&&
!
defender
.
IsDisabled
()
&&
Enemy
.
GetMonsters
().
Any
(
monster
=>
monster
.
HasSetcode
(
_Setcode
.
RescueACE
)
&&
!
monster
.
IsCode
(
_CardId
.
RescueACEHydrant
)))
return
false
;
if
(
Enemy
.
HasInSpellZone
(
_CardId
.
SilenforcingBarrier
,
true
)
&&
Enemy
.
HasInMonstersZone
(
_CardId
.
NovoxTheSilenforcerDisciple
,
faceUp
:
true
)
&&
!
defender
.
HasType
(
CardType
.
Ritual
))
return
false
;
...
...
@@ -1025,6 +1034,8 @@ namespace WindBot.Game.AI
if
(
Util
.
ChainContainsCard
(
destroyAllList
))
return
true
;
if
(
Enemy
.
HasInSpellZone
(
destroyAllOpponentSpellList
,
true
)
&&
Card
.
Location
==
CardLocation
.
SpellZone
)
return
true
;
if
(
lightningStormOption
==
0
&&
Card
.
Location
==
CardLocation
.
MonsterZone
&&
Card
.
IsAttack
())
return
true
;
if
(
lightningStormOption
==
1
&&
Card
.
Location
==
CardLocation
.
SpellZone
)
return
true
;
// TODO: ChainContainsCard(id, player)
return
false
;
}
...
...
@@ -1120,12 +1131,11 @@ namespace WindBot.Game.AI
bool
nontuner
=
false
;
foreach
(
ClientCard
monster
in
monsters
)
{
if
(
monster
.
HasType
(
CardType
.
Tuner
))
tuner
=
true
;
else
if
(!
monster
.
HasType
(
CardType
.
Xyz
)
&&
!
monster
.
HasType
(
CardType
.
Link
))
if
(!
monster
.
HasType
(
CardType
.
Xyz
|
CardType
.
Link
))
{
nontuner
=
true
;
levels
[
monster
.
Level
]
=
levels
[
monster
.
Level
]
+
1
;
if
(
monster
.
HasType
(
CardType
.
Tuner
))
tuner
=
true
;
else
nontuner
=
true
;
if
(!
monster
.
HasType
(
CardType
.
Token
))
levels
[
monster
.
Level
]
=
levels
[
monster
.
Level
]
+
1
;
}
if
(
monster
.
IsOneForXyz
())
...
...
@@ -1156,7 +1166,8 @@ namespace WindBot.Game.AI
}
}
ClientCard
lastchaincard
=
Util
.
GetLastChainCard
();
if
(
Duel
.
LastChainPlayer
==
1
&&
lastchaincard
!=
null
&&
!
lastchaincard
.
IsDisabled
())
if
(
Duel
.
LastChainPlayer
==
1
&&
lastchaincard
!=
null
&&
!
lastchaincard
.
IsDisabled
()
&&
(
lastchaincard
.
HasType
(
CardType
.
Spell
|
CardType
.
Trap
)
||
lastchaincard
.
Location
==
CardLocation
.
MonsterZone
))
{
if
(
lastchaincard
.
HasType
(
CardType
.
Ritual
))
{
...
...
@@ -1454,5 +1465,21 @@ namespace WindBot.Game.AI
return
false
;
}
public
override
void
OnReceivingAnnouce
(
int
player
,
int
data
)
{
if
(
player
==
1
&&
data
==
Util
.
GetStringId
(
_CardId
.
LightningStorm
,
0
)
||
data
==
Util
.
GetStringId
(
_CardId
.
LightningStorm
,
1
))
{
lightningStormOption
=
data
-
Util
.
GetStringId
(
_CardId
.
LightningStorm
,
0
);
}
base
.
OnReceivingAnnouce
(
player
,
data
);
}
public
override
void
OnChainEnd
()
{
lightningStormOption
=
-
1
;
base
.
OnChainEnd
();
}
}
}
Game/AI/Enums/Floodgate.cs
View file @
6d4d8bbc
...
...
@@ -71,6 +71,7 @@
ElShaddollConstruct
=
20366274
,
ElShaddollGrysra
=
48424886
,
ElShaddollWinda
=
94977269
,
HotRedDragonArchfiendAbyss
=
9753964
,
UltimateConductorTytanno
=
18940556
,
OvertexCoatls
=
41782653
,
FirePrison
=
269510
,
...
...
Game/AI/Enums/FusionSpell.cs
View file @
6d4d8bbc
...
...
@@ -67,6 +67,7 @@
FaceCardFusion
=
29062925
,
MyutantFusion
=
42577802
,
MyutantCry
=
31855260
,
FallenOfAlbaz
=
68468459
,
GreaterPolymerization
=
7614732
,
UltimateFusion
=
71143015
,
BrandedFusion
=
44362883
,
...
...
Game/AI/Executor.cs
View file @
6d4d8bbc
...
...
@@ -104,6 +104,12 @@ namespace WindBot.Game.AI
{
// For overriding
}
public
virtual
void
OnReceivingAnnouce
(
int
player
,
int
data
)
{
// For overriding
}
public
virtual
void
OnNewPhase
()
{
// Some AI need do something on new phase
...
...
@@ -118,7 +124,7 @@ namespace WindBot.Game.AI
// Some AI need do something on draw
}
public
virtual
void
OnMove
(
int
cardI
d
,
int
previousControler
,
int
previousLocation
,
int
currentControler
,
int
currentLocation
)
public
virtual
void
OnMove
(
ClientCard
car
d
,
int
previousControler
,
int
previousLocation
,
int
currentControler
,
int
currentLocation
)
{
// Some AI need do something on card's moving
}
...
...
Game/AI/HintMsg.cs
View file @
6d4d8bbc
...
...
@@ -57,6 +57,11 @@
ToZone
=
571
,
Counter
=
572
,
Disable
=
573
,
OperateCard
=
574
;
OperateCard
=
574
,
RITUAL
=
1057
,
FUSION
=
1056
,
SYNCHRO
=
1063
,
XYZ
=
1073
,
PENDULUM
=
1074
;
}
}
\ No newline at end of file
Game/GameAI.cs
View file @
6d4d8bbc
...
...
@@ -119,9 +119,9 @@ namespace WindBot.Game
Executor
.
OnNewPhase
();
}
public
void
OnMove
(
int
cardI
d
,
int
previousControler
,
int
previousLocation
,
int
currentControler
,
int
currentLocation
)
public
void
OnMove
(
ClientCard
car
d
,
int
previousControler
,
int
previousLocation
,
int
currentControler
,
int
currentLocation
)
{
Executor
.
OnMove
(
card
Id
,
previousControler
,
previousLocation
,
currentControler
,
currentLocation
);
Executor
.
OnMove
(
card
,
previousControler
,
previousLocation
,
currentControler
,
currentLocation
);
}
/// <summary>
...
...
@@ -157,6 +157,16 @@ namespace WindBot.Game
Executor
.
OnChainEnd
();
}
/// <summary>
/// Called when receiving annouce
/// </summary>
/// <param name="player">Player who announce.</param>
/// <param name="data">Annouced info.</param>
public
void
OnReceivingAnnouce
(
int
player
,
int
data
)
{
Executor
.
OnReceivingAnnouce
(
player
,
data
);
}
/// <summary>
/// Called when the AI has to do something during the battle phase.
/// </summary>
...
...
Game/GameBehavior.cs
View file @
6d4d8bbc
...
...
@@ -347,6 +347,10 @@ namespace WindBot.Game
{
_select_hint
=
data
;
}
if
(
type
==
4
)
// HINT_OPSELECTED
{
_ai
.
OnReceivingAnnouce
(
player
,
data
);
}
}
private
void
OnStart
(
BinaryReader
packet
)
...
...
@@ -354,6 +358,11 @@ namespace WindBot.Game
int
type
=
packet
.
ReadByte
();
_duel
.
IsFirst
=
(
type
&
0xF
)
==
0
;
_duel
.
Turn
=
0
;
_duel
.
LastChainLocation
=
0
;
_duel
.
LastChainPlayer
=
-
1
;
_duel
.
LastChainTargets
.
Clear
();
_duel
.
LastSummonedCards
.
Clear
();
_duel
.
LastSummonPlayer
=
-
1
;
int
duel_rule
=
packet
.
ReadByte
();
_ai
.
Duel
.
IsNewRule
=
(
duel_rule
>=
4
);
_ai
.
Duel
.
IsNewRule2020
=
(
duel_rule
>=
5
);
...
...
@@ -653,7 +662,7 @@ namespace WindBot.Game
}
}
_ai
.
OnMove
(
card
Id
,
previousControler
,
previousLocation
,
currentControler
,
currentLocation
);
_ai
.
OnMove
(
card
,
previousControler
,
previousLocation
,
currentControler
,
currentLocation
);
}
private
void
OnSwap
(
BinaryReader
packet
)
...
...
WindBot.csproj
View file @
6d4d8bbc
...
...
@@ -103,6 +103,7 @@
<Compile
Include=
"Game\AI\Decks\GraydleExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\GrenMajuThunderBoarderExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\LightswornExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\LabrynthExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\LightswornShaddoldinosourExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\PhantasmExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\QliphortExecutor.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