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
alstroemeria-silentlove
windbot
Commits
80710541
Commit
80710541
authored
Apr 26, 2019
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update GetBotAvailZonesFromExtraDeck
parent
0ef27ba1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
44 deletions
+57
-44
Game/AI/AIUtil.cs
Game/AI/AIUtil.cs
+57
-44
No files found.
Game/AI/AIUtil.cs
View file @
80710541
...
@@ -92,7 +92,7 @@ namespace WindBot.Game.AI
...
@@ -92,7 +92,7 @@ namespace WindBot.Game.AI
.
OrderByDescending
(
card
=>
card
.
GetDefensePower
())
.
OrderByDescending
(
card
=>
card
.
GetDefensePower
())
.
FirstOrDefault
();
.
FirstOrDefault
();
}
}
public
ClientCard
GetWorstBotMonster
(
bool
onlyATK
=
false
)
public
ClientCard
GetWorstBotMonster
(
bool
onlyATK
=
false
)
{
{
return
Bot
.
MonsterZone
.
GetMonsters
()
return
Bot
.
MonsterZone
.
GetMonsters
()
...
@@ -223,11 +223,11 @@ namespace WindBot.Game.AI
...
@@ -223,11 +223,11 @@ namespace WindBot.Game.AI
{
{
if
(
Duel
.
IsNewRule
)
if
(
Duel
.
IsNewRule
)
{
{
return
Duel
.
Fields
[
player
].
SpellZone
[
id
*
4
];
return
Duel
.
Fields
[
player
].
SpellZone
[
id
*
4
];
}
}
else
else
{
{
return
Duel
.
Fields
[
player
].
SpellZone
[
6
+
id
];
return
Duel
.
Fields
[
player
].
SpellZone
[
6
+
id
];
}
}
}
}
...
@@ -241,57 +241,70 @@ namespace WindBot.Game.AI
...
@@ -241,57 +241,70 @@ namespace WindBot.Game.AI
return
Duel
.
Turn
==
1
||
Duel
.
Phase
==
DuelPhase
.
Main2
;
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
)
public
int
GetBotAvailZonesFromExtraDeck
(
IList
<
ClientCard
>
remove
)
{
{
ClientCard
[]
BotMZone
=
(
ClientCard
[])
Bot
.
MonsterZone
.
Clone
();
ClientCard
[]
EnemyMZone
=
(
ClientCard
[])
Enemy
.
MonsterZone
.
Clone
();
for
(
int
i
=
0
;
i
<
7
;
i
++)
{
if
(
remove
.
Contains
(
BotMZone
[
i
]))
BotMZone
[
i
]
=
null
;
if
(
remove
.
Contains
(
EnemyMZone
[
i
]))
EnemyMZone
[
i
]
=
null
;
}
if
(!
Duel
.
IsNewRule
)
if
(!
Duel
.
IsNewRule
)
return
Zones
.
MainMonsterZones
;
return
Zones
.
MainMonsterZones
;
int
result
=
0
;
int
result
=
0
;
if
(
inListOrNull
(
Bot
.
MonsterZone
[
5
],
remove
)
&&
inListOrNull
(
Bot
.
MonsterZone
[
6
],
remove
)
&&
if
(
BotMZone
[
5
]
==
null
&&
BotMZone
[
6
]
==
null
)
(
inListOrNull
(
Enemy
.
MonsterZone
[
5
],
remove
)
||
inListOrNull
(
Enemy
.
MonsterZone
[
6
],
remove
)))
{
result
|=
Zones
.
ExtraMonsterZones
;
if
(
EnemyMZone
[
5
]
==
null
)
result
|=
Zones
.
z6
;
if
(
inListOrNull
(
Bot
.
MonsterZone
[
0
],
remove
)
&&
if
(
EnemyMZone
[
6
]
==
null
)
(!
inListOrNull
(
Bot
.
MonsterZone
[
1
],
remove
)
&&
Bot
.
MonsterZone
[
1
].
HasLinkMarker
(
CardLinkMarker
.
Left
)
||
result
|=
Zones
.
z5
;
!
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
(
BotMZone
[
0
]
==
null
&&
if
(
inListOrNull
(
Bot
.
MonsterZone
[
1
],
remove
)
&&
((
BotMZone
[
1
]?.
HasLinkMarker
(
CardLinkMarker
.
Left
)
??
false
)
||
(!
inListOrNull
(
Bot
.
MonsterZone
[
0
],
remove
)
&&
Bot
.
MonsterZone
[
0
].
HasLinkMarker
(
CardLinkMarker
.
Right
)
||
(
BotMZone
[
5
]?.
HasLinkMarker
(
CardLinkMarker
.
BottomLeft
)
??
false
)
||
!
inListOrNull
(
Bot
.
MonsterZone
[
2
],
remove
)
&&
Bot
.
MonsterZone
[
2
].
HasLinkMarker
(
CardLinkMarker
.
Left
)
||
(
EnemyMZone
[
6
]?.
HasLinkMarker
(
CardLinkMarker
.
TopRight
)
??
false
)))
!
inListOrNull
(
Bot
.
MonsterZone
[
5
],
remove
)
&&
Bot
.
MonsterZone
[
5
].
HasLinkMarker
(
CardLinkMarker
.
Bottom
)
||
result
|=
Zones
.
z0
;
!
inListOrNull
(
Enemy
.
MonsterZone
[
6
],
remove
)
&&
Enemy
.
MonsterZone
[
6
].
HasLinkMarker
(
CardLinkMarker
.
Top
)))
result
+=
Zones
.
z1
;
if
(
BotMZone
[
1
]
==
null
&&
if
(
inListOrNull
(
Bot
.
MonsterZone
[
2
],
remove
)
&&
((
BotMZone
[
0
]?.
HasLinkMarker
(
CardLinkMarker
.
Right
)
??
false
)
||
(!
inListOrNull
(
Bot
.
MonsterZone
[
1
],
remove
)
&&
Bot
.
MonsterZone
[
1
].
HasLinkMarker
(
CardLinkMarker
.
Right
)
||
(
BotMZone
[
2
]?.
HasLinkMarker
(
CardLinkMarker
.
Left
)
??
false
)
||
!
inListOrNull
(
Bot
.
MonsterZone
[
3
],
remove
)
&&
Bot
.
MonsterZone
[
3
].
HasLinkMarker
(
CardLinkMarker
.
Left
)
||
(
BotMZone
[
5
]?.
HasLinkMarker
(
CardLinkMarker
.
Bottom
)
??
false
)
||
!
inListOrNull
(
Bot
.
MonsterZone
[
5
],
remove
)
&&
Bot
.
MonsterZone
[
5
].
HasLinkMarker
(
CardLinkMarker
.
BottomRight
)
||
(
EnemyMZone
[
6
]?.
HasLinkMarker
(
CardLinkMarker
.
Top
)
??
false
)))
!
inListOrNull
(
Enemy
.
MonsterZone
[
6
],
remove
)
&&
Enemy
.
MonsterZone
[
6
].
HasLinkMarker
(
CardLinkMarker
.
TopLeft
)
||
result
|=
Zones
.
z1
;
!
inListOrNull
(
Bot
.
MonsterZone
[
6
],
remove
)
&&
Bot
.
MonsterZone
[
6
].
HasLinkMarker
(
CardLinkMarker
.
BottomLeft
)
||
!
inListOrNull
(
Enemy
.
MonsterZone
[
5
],
remove
)
&&
Enemy
.
MonsterZone
[
5
].
HasLinkMarker
(
CardLinkMarker
.
TopRight
)))
if
(
BotMZone
[
2
]
==
null
&&
result
+=
Zones
.
z2
;
((
BotMZone
[
1
]?.
HasLinkMarker
(
CardLinkMarker
.
Right
)
??
false
)
||
if
(
inListOrNull
(
Bot
.
MonsterZone
[
3
],
remove
)
&&
(
BotMZone
[
3
]?.
HasLinkMarker
(
CardLinkMarker
.
Left
)
??
false
)
||
(!
inListOrNull
(
Bot
.
MonsterZone
[
2
],
remove
)
&&
Bot
.
MonsterZone
[
2
].
HasLinkMarker
(
CardLinkMarker
.
Right
)
||
(
BotMZone
[
5
]?.
HasLinkMarker
(
CardLinkMarker
.
BottomRight
)
??
false
)
||
!
inListOrNull
(
Bot
.
MonsterZone
[
4
],
remove
)
&&
Bot
.
MonsterZone
[
4
].
HasLinkMarker
(
CardLinkMarker
.
Left
)
||
(
EnemyMZone
[
6
]?.
HasLinkMarker
(
CardLinkMarker
.
TopLeft
)
??
false
)
||
!
inListOrNull
(
Bot
.
MonsterZone
[
6
],
remove
)
&&
Bot
.
MonsterZone
[
6
].
HasLinkMarker
(
CardLinkMarker
.
Bottom
)
||
(
BotMZone
[
6
]?.
HasLinkMarker
(
CardLinkMarker
.
BottomLeft
)
??
false
)
||
!
inListOrNull
(
Enemy
.
MonsterZone
[
5
],
remove
)
&&
Enemy
.
MonsterZone
[
5
].
HasLinkMarker
(
CardLinkMarker
.
Top
)))
(
EnemyMZone
[
5
]?.
HasLinkMarker
(
CardLinkMarker
.
TopRight
)
??
false
)))
result
+=
Zones
.
z3
;
result
|=
Zones
.
z2
;
if
(
inListOrNull
(
Bot
.
MonsterZone
[
4
],
remove
)
&&
(!
inListOrNull
(
Bot
.
MonsterZone
[
3
],
remove
)
&&
Bot
.
MonsterZone
[
3
].
HasLinkMarker
(
CardLinkMarker
.
Right
)
||
if
(
BotMZone
[
3
]
==
null
&&
!
inListOrNull
(
Bot
.
MonsterZone
[
6
],
remove
)
&&
Bot
.
MonsterZone
[
6
].
HasLinkMarker
(
CardLinkMarker
.
BottomRight
)
||
((
BotMZone
[
2
]?.
HasLinkMarker
(
CardLinkMarker
.
Right
)
??
false
)
||
!
inListOrNull
(
Enemy
.
MonsterZone
[
5
],
remove
)
&&
Enemy
.
MonsterZone
[
5
].
HasLinkMarker
(
CardLinkMarker
.
TopLeft
)))
(
BotMZone
[
4
]?.
HasLinkMarker
(
CardLinkMarker
.
Left
)
??
false
)
||
result
+=
Zones
.
z4
;
(
BotMZone
[
6
]?.
HasLinkMarker
(
CardLinkMarker
.
Bottom
)
??
false
)
||
(
EnemyMZone
[
5
]?.
HasLinkMarker
(
CardLinkMarker
.
Top
)
??
false
)))
result
|=
Zones
.
z3
;
if
(
BotMZone
[
4
]
==
null
&&
((
BotMZone
[
3
]?.
HasLinkMarker
(
CardLinkMarker
.
Right
)
??
false
)
||
(
BotMZone
[
6
]?.
HasLinkMarker
(
CardLinkMarker
.
BottomRight
)
??
false
)
||
(
EnemyMZone
[
5
]?.
HasLinkMarker
(
CardLinkMarker
.
TopLeft
)
??
false
)))
result
|=
Zones
.
z4
;
return
result
;
return
result
;
}
}
public
int
GetBotAvailZonesFromExtraDeck
(
ClientCard
remove
)
public
int
GetBotAvailZonesFromExtraDeck
(
ClientCard
remove
)
{
{
return
GetBotAvailZonesFromExtraDeck
(
new
[]
{
remove
});
return
GetBotAvailZonesFromExtraDeck
(
new
[]
{
remove
});
}
}
public
int
GetBotAvailZonesFromExtraDeck
()
public
int
GetBotAvailZonesFromExtraDeck
()
...
...
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