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
c81e590f
Commit
c81e590f
authored
Aug 28, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add GetLinkedZones and GetBotAvailZonesFromExtraDeck
parent
47f5ca86
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
121 additions
and
4 deletions
+121
-4
Game/AI/AIFunctions.cs
Game/AI/AIFunctions.cs
+58
-0
Game/AI/Decks/AltergeistExecutor.cs
Game/AI/Decks/AltergeistExecutor.cs
+2
-2
Game/ClientCard.cs
Game/ClientCard.cs
+51
-1
Game/ClientField.cs
Game/ClientField.cs
+10
-1
YGOSharp.OCGWrapper.Enums.dll
YGOSharp.OCGWrapper.Enums.dll
+0
-0
No files found.
Game/AI/AIFunctions.cs
View file @
c81e590f
...
...
@@ -265,6 +265,64 @@ namespace WindBot.Game.AI
return
Duel
.
Turn
==
1
||
Duel
.
Phase
==
DuelPhase
.
Main2
;
}
internal
bool
inListOrNull
(
ClientCard
card
,
IList
<
ClientCard
>
list
)
{
return
card
==
null
||
list
.
Contains
(
card
);
}
public
int
GetBotAvailZonesFromExtraDeck
(
IList
<
ClientCard
>
remove
)
{
if
(!
Duel
.
IsNewRule
)
return
Zones
.
MainMonsterZones
;
int
result
=
0
;
if
(
inListOrNull
(
Bot
.
MonsterZone
[
5
],
remove
)
&&
inListOrNull
(
Bot
.
MonsterZone
[
6
],
remove
)
&&
(
inListOrNull
(
Enemy
.
MonsterZone
[
5
],
remove
)
||
inListOrNull
(
Enemy
.
MonsterZone
[
6
],
remove
)))
result
|=
Zones
.
ExtraMonsterZones
;
if
(
inListOrNull
(
Bot
.
MonsterZone
[
0
],
remove
)
&&
(!
inListOrNull
(
Bot
.
MonsterZone
[
1
],
remove
)
&&
Bot
.
MonsterZone
[
1
].
HasLinkMarker
(
CardLinkMarker
.
Left
)
||
!
inListOrNull
(
Bot
.
MonsterZone
[
5
],
remove
)
&&
Bot
.
MonsterZone
[
5
].
HasLinkMarker
(
CardLinkMarker
.
BottomLeft
)
||
!
inListOrNull
(
Enemy
.
MonsterZone
[
6
],
remove
)
&&
Enemy
.
MonsterZone
[
6
].
HasLinkMarker
(
CardLinkMarker
.
TopRight
)))
result
+=
Zones
.
z0
;
if
(
inListOrNull
(
Bot
.
MonsterZone
[
1
],
remove
)
&&
(!
inListOrNull
(
Bot
.
MonsterZone
[
0
],
remove
)
&&
Bot
.
MonsterZone
[
0
].
HasLinkMarker
(
CardLinkMarker
.
Right
)
||
!
inListOrNull
(
Bot
.
MonsterZone
[
2
],
remove
)
&&
Bot
.
MonsterZone
[
2
].
HasLinkMarker
(
CardLinkMarker
.
Left
)
||
!
inListOrNull
(
Bot
.
MonsterZone
[
5
],
remove
)
&&
Bot
.
MonsterZone
[
5
].
HasLinkMarker
(
CardLinkMarker
.
Bottom
)
||
!
inListOrNull
(
Enemy
.
MonsterZone
[
6
],
remove
)
&&
Enemy
.
MonsterZone
[
6
].
HasLinkMarker
(
CardLinkMarker
.
Top
)))
result
+=
Zones
.
z1
;
if
(
inListOrNull
(
Bot
.
MonsterZone
[
2
],
remove
)
&&
(!
inListOrNull
(
Bot
.
MonsterZone
[
1
],
remove
)
&&
Bot
.
MonsterZone
[
1
].
HasLinkMarker
(
CardLinkMarker
.
Right
)
||
!
inListOrNull
(
Bot
.
MonsterZone
[
3
],
remove
)
&&
Bot
.
MonsterZone
[
3
].
HasLinkMarker
(
CardLinkMarker
.
Left
)
||
!
inListOrNull
(
Bot
.
MonsterZone
[
5
],
remove
)
&&
Bot
.
MonsterZone
[
5
].
HasLinkMarker
(
CardLinkMarker
.
BottomRight
)
||
!
inListOrNull
(
Enemy
.
MonsterZone
[
6
],
remove
)
&&
Enemy
.
MonsterZone
[
6
].
HasLinkMarker
(
CardLinkMarker
.
TopLeft
)
||
!
inListOrNull
(
Bot
.
MonsterZone
[
6
],
remove
)
&&
Bot
.
MonsterZone
[
6
].
HasLinkMarker
(
CardLinkMarker
.
BottomLeft
)
||
!
inListOrNull
(
Enemy
.
MonsterZone
[
5
],
remove
)
&&
Enemy
.
MonsterZone
[
5
].
HasLinkMarker
(
CardLinkMarker
.
TopRight
)))
result
+=
Zones
.
z2
;
if
(
inListOrNull
(
Bot
.
MonsterZone
[
3
],
remove
)
&&
(!
inListOrNull
(
Bot
.
MonsterZone
[
2
],
remove
)
&&
Bot
.
MonsterZone
[
2
].
HasLinkMarker
(
CardLinkMarker
.
Right
)
||
!
inListOrNull
(
Bot
.
MonsterZone
[
4
],
remove
)
&&
Bot
.
MonsterZone
[
4
].
HasLinkMarker
(
CardLinkMarker
.
Left
)
||
!
inListOrNull
(
Bot
.
MonsterZone
[
6
],
remove
)
&&
Bot
.
MonsterZone
[
6
].
HasLinkMarker
(
CardLinkMarker
.
Bottom
)
||
!
inListOrNull
(
Enemy
.
MonsterZone
[
5
],
remove
)
&&
Enemy
.
MonsterZone
[
5
].
HasLinkMarker
(
CardLinkMarker
.
Top
)))
result
+=
Zones
.
z3
;
if
(
inListOrNull
(
Bot
.
MonsterZone
[
4
],
remove
)
&&
(!
inListOrNull
(
Bot
.
MonsterZone
[
3
],
remove
)
&&
Bot
.
MonsterZone
[
3
].
HasLinkMarker
(
CardLinkMarker
.
Right
)
||
!
inListOrNull
(
Bot
.
MonsterZone
[
6
],
remove
)
&&
Bot
.
MonsterZone
[
6
].
HasLinkMarker
(
CardLinkMarker
.
BottomRight
)
||
!
inListOrNull
(
Enemy
.
MonsterZone
[
5
],
remove
)
&&
Enemy
.
MonsterZone
[
5
].
HasLinkMarker
(
CardLinkMarker
.
TopLeft
)))
result
+=
Zones
.
z4
;
return
result
;
}
public
int
GetBotAvailZonesFromExtraDeck
(
ClientCard
remove
)
{
return
GetBotAvailZonesFromExtraDeck
(
new
[]
{
remove
});
}
public
int
GetBotAvailZonesFromExtraDeck
()
{
return
GetBotAvailZonesFromExtraDeck
(
new
List
<
ClientCard
>());
}
public
bool
IsChainTarget
(
ClientCard
card
)
{
return
Duel
.
ChainTargets
.
Any
(
card
.
Equals
);
...
...
Game/AI/Decks/AltergeistExecutor.cs
View file @
c81e590f
...
...
@@ -2161,7 +2161,7 @@ namespace WindBot.Game.AI.Decks
if
(
Duel
.
Phase
!=
DuelPhase
.
Main2
)
return
false
;
ClientCard
card_ex_left
=
Enemy
.
MonsterZone
[
6
];
ClientCard
card_ex_right
=
Enemy
.
MonsterZone
[
5
];
if
(
card_ex_left
!=
null
&&
card_ex_left
.
HasLinkMarker
((
int
)
LinkMarker
.
Top
))
if
(
card_ex_left
!=
null
&&
card_ex_left
.
HasLinkMarker
((
int
)
Card
LinkMarker
.
Top
))
{
ClientCard
self_card_1
=
Bot
.
MonsterZone
[
1
];
if
(
self_card_1
==
null
)
...
...
@@ -2178,7 +2178,7 @@ namespace WindBot.Game.AI.Decks
return
true
;
}
}
if
(
card_ex_right
!=
null
&&
card_ex_right
.
HasLinkMarker
((
int
)
LinkMarker
.
Top
))
if
(
card_ex_right
!=
null
&&
card_ex_right
.
HasLinkMarker
((
int
)
Card
LinkMarker
.
Top
))
{
ClientCard
self_card_2
=
Bot
.
MonsterZone
[
3
];
if
(
self_card_2
==
null
)
...
...
Game/ClientCard.cs
View file @
c81e590f
...
...
@@ -154,11 +154,61 @@ namespace WindBot.Game
return
(
LinkMarker
&
dir
)
!=
0
;
}
public
bool
HasLinkMarker
(
LinkMarker
dir
)
public
bool
HasLinkMarker
(
Card
LinkMarker
dir
)
{
return
(
LinkMarker
&
(
int
)
dir
)
!=
0
;
}
public
int
GetLinkedZones
()
{
if
(!
HasType
(
CardType
.
Link
)
||
Location
!=
CardLocation
.
MonsterZone
)
return
0
;
int
zones
=
0
;
if
(
Sequence
>
0
&&
Sequence
<=
4
&&
HasLinkMarker
(
CardLinkMarker
.
Left
))
zones
|=
1
<<
(
Sequence
-
1
);
if
(
Sequence
<=
3
&&
HasLinkMarker
(
CardLinkMarker
.
Right
))
zones
|=
1
<<
(
Sequence
+
1
);
if
(
Sequence
==
0
&&
HasLinkMarker
(
CardLinkMarker
.
TopRight
)
||
Sequence
==
1
&&
HasLinkMarker
(
CardLinkMarker
.
Top
)
||
Sequence
==
2
&&
HasLinkMarker
(
CardLinkMarker
.
TopLeft
))
zones
|=
(
1
<<
5
)
|
(
1
<<
(
16
+
6
));
if
(
Sequence
==
2
&&
HasLinkMarker
(
CardLinkMarker
.
TopRight
)
||
Sequence
==
3
&&
HasLinkMarker
(
CardLinkMarker
.
Top
)
||
Sequence
==
4
&&
HasLinkMarker
(
CardLinkMarker
.
TopLeft
))
zones
|=
(
1
<<
6
)
|
(
1
<<
(
16
+
5
));
if
(
Sequence
==
5
)
{
if
(
HasLinkMarker
(
CardLinkMarker
.
BottomLeft
))
zones
|=
1
<<
0
;
if
(
HasLinkMarker
(
CardLinkMarker
.
Bottom
))
zones
|=
1
<<
1
;
if
(
HasLinkMarker
(
CardLinkMarker
.
BottomRight
))
zones
|=
1
<<
2
;
if
(
HasLinkMarker
(
CardLinkMarker
.
TopLeft
))
zones
|=
1
<<
(
16
+
4
);
if
(
HasLinkMarker
(
CardLinkMarker
.
Top
))
zones
|=
1
<<
(
16
+
3
);
if
(
HasLinkMarker
(
CardLinkMarker
.
TopRight
))
zones
|=
1
<<
(
16
+
2
);
}
if
(
Sequence
==
6
)
{
if
(
HasLinkMarker
(
CardLinkMarker
.
BottomLeft
))
zones
|=
1
<<
2
;
if
(
HasLinkMarker
(
CardLinkMarker
.
Bottom
))
zones
|=
1
<<
3
;
if
(
HasLinkMarker
(
CardLinkMarker
.
BottomRight
))
zones
|=
1
<<
4
;
if
(
HasLinkMarker
(
CardLinkMarker
.
TopLeft
))
zones
|=
1
<<
(
16
+
2
);
if
(
HasLinkMarker
(
CardLinkMarker
.
Top
))
zones
|=
1
<<
(
16
+
1
);
if
(
HasLinkMarker
(
CardLinkMarker
.
TopRight
))
zones
|=
1
<<
(
16
+
0
);
}
return
zones
;
}
public
bool
HasType
(
CardType
type
)
{
return
(
Type
&
(
int
)
type
)
!=
0
;
...
...
Game/ClientField.cs
View file @
c81e590f
...
...
@@ -97,7 +97,6 @@ namespace WindBot.Game
return
count
;
}
public
int
GetFieldCount
()
{
return
GetSpellCount
()
+
GetMonsterCount
();
...
...
@@ -113,6 +112,16 @@ namespace WindBot.Game
return
GetMonsters
().
Count
==
0
&&
GetSpells
().
Count
==
0
;
}
public
int
GetLinkedZones
()
{
int
zones
=
0
;
for
(
int
i
=
0
;
i
<
7
;
i
++)
{
zones
|=
MonsterZone
[
i
]?.
GetLinkedZones
()
??
0
;
}
return
zones
;
}
public
List
<
ClientCard
>
GetMonsters
()
{
return
GetCards
(
MonsterZone
);
...
...
YGOSharp.OCGWrapper.Enums.dll
View file @
c81e590f
No preview for this file type
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