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
93cc91f7
Commit
93cc91f7
authored
Apr 04, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move some functions
parent
dd37ed18
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
43 deletions
+43
-43
Game/AI/AIFunctions.cs
Game/AI/AIFunctions.cs
+38
-0
Game/AI/Decks/ZexalWeaponsExecutor.cs
Game/AI/Decks/ZexalWeaponsExecutor.cs
+1
-1
Game/AI/DefaultExecutor.cs
Game/AI/DefaultExecutor.cs
+4
-4
Game/AI/Executor.cs
Game/AI/Executor.cs
+0
-38
No files found.
Game/AI/AIFunctions.cs
View file @
93cc91f7
...
@@ -296,6 +296,44 @@ namespace WindBot.Game.AI
...
@@ -296,6 +296,44 @@ namespace WindBot.Game.AI
return
Duel
.
ChainTargets
.
Count
==
1
&&
card
.
Equals
(
Duel
.
ChainTargets
[
0
]);
return
Duel
.
ChainTargets
.
Count
==
1
&&
card
.
Equals
(
Duel
.
ChainTargets
[
0
]);
}
}
public
bool
ChainContainsCard
(
int
id
)
{
foreach
(
ClientCard
card
in
Duel
.
CurrentChain
)
{
if
(
card
.
Id
==
id
)
return
true
;
}
return
false
;
}
public
int
ChainCountPlayer
(
int
player
)
{
int
count
=
0
;
foreach
(
ClientCard
card
in
Duel
.
CurrentChain
)
{
if
(
card
.
Controller
==
player
)
count
++;
}
return
count
;
}
public
bool
HasChainedTrap
(
int
player
)
{
foreach
(
ClientCard
card
in
Duel
.
CurrentChain
)
{
if
(
card
.
Controller
==
player
&&
card
.
HasType
(
CardType
.
Trap
))
return
true
;
}
return
false
;
}
public
ClientCard
GetLastChainCard
()
{
if
(
Duel
.
CurrentChain
.
Count
>
0
)
return
Duel
.
CurrentChain
[
Duel
.
CurrentChain
.
Count
-
1
];
return
null
;
}
/// <summary>
/// <summary>
/// Select cards listed in preferred.
/// Select cards listed in preferred.
/// </summary>
/// </summary>
...
...
Game/AI/Decks/ZexalWeaponsExecutor.cs
View file @
93cc91f7
...
@@ -150,7 +150,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -150,7 +150,7 @@ namespace WindBot.Game.AI.Decks
private
bool
Number39Utopia
()
private
bool
Number39Utopia
()
{
{
if
(!
HasChainedTrap
(
0
)
&&
Duel
.
Player
==
1
&&
Duel
.
Phase
==
DuelPhase
.
BattleStart
&&
Card
.
HasXyzMaterial
(
2
))
if
(!
AI
.
Utils
.
HasChainedTrap
(
0
)
&&
Duel
.
Player
==
1
&&
Duel
.
Phase
==
DuelPhase
.
BattleStart
&&
Card
.
HasXyzMaterial
(
2
))
return
true
;
return
true
;
return
false
;
return
false
;
}
}
...
...
Game/AI/DefaultExecutor.cs
View file @
93cc91f7
...
@@ -234,7 +234,7 @@ namespace WindBot.Game.AI
...
@@ -234,7 +234,7 @@ namespace WindBot.Game.AI
/// </summary>
/// </summary>
protected
bool
DefaultBreakthroughSkill
()
protected
bool
DefaultBreakthroughSkill
()
{
{
ClientCard
LastChainCard
=
GetLastChainCard
();
ClientCard
LastChainCard
=
AI
.
Utils
.
GetLastChainCard
();
if
(
LastChainCard
==
null
)
if
(
LastChainCard
==
null
)
return
false
;
return
false
;
...
@@ -271,7 +271,7 @@ namespace WindBot.Game.AI
...
@@ -271,7 +271,7 @@ namespace WindBot.Game.AI
/// </summary>
/// </summary>
protected
bool
DefaultTorrentialTribute
()
protected
bool
DefaultTorrentialTribute
()
{
{
return
!
HasChainedTrap
(
0
)
&&
AI
.
Utils
.
IsAllEnemyBetter
(
true
);
return
!
AI
.
Utils
.
HasChainedTrap
(
0
)
&&
AI
.
Utils
.
IsAllEnemyBetter
(
true
);
}
}
/// <summary>
/// <summary>
...
@@ -394,7 +394,7 @@ namespace WindBot.Game.AI
...
@@ -394,7 +394,7 @@ namespace WindBot.Game.AI
/// </summary>
/// </summary>
protected
bool
DefaultUniqueTrap
()
protected
bool
DefaultUniqueTrap
()
{
{
if
(
HasChainedTrap
(
0
))
if
(
AI
.
Utils
.
HasChainedTrap
(
0
))
return
false
;
return
false
;
return
UniqueFaceupSpell
();
return
UniqueFaceupSpell
();
...
@@ -509,7 +509,7 @@ namespace WindBot.Game.AI
...
@@ -509,7 +509,7 @@ namespace WindBot.Game.AI
return
true
;
return
true
;
}
}
}
}
ClientCard
lastchaincard
=
GetLastChainCard
();
ClientCard
lastchaincard
=
AI
.
Utils
.
GetLastChainCard
();
if
(
Duel
.
LastChainPlayer
==
1
&&
lastchaincard
!=
null
&&
!
lastchaincard
.
IsDisabled
())
if
(
Duel
.
LastChainPlayer
==
1
&&
lastchaincard
!=
null
&&
!
lastchaincard
.
IsDisabled
())
{
{
if
(
lastchaincard
.
HasType
(
CardType
.
Ritual
))
if
(
lastchaincard
.
HasType
(
CardType
.
Ritual
))
...
...
Game/AI/Executor.cs
View file @
93cc91f7
...
@@ -174,44 +174,6 @@ namespace WindBot.Game.AI
...
@@ -174,44 +174,6 @@ namespace WindBot.Game.AI
return
-
1
;
return
-
1
;
}
}
public
bool
ChainContainsCard
(
int
id
)
{
foreach
(
ClientCard
card
in
Duel
.
CurrentChain
)
{
if
(
card
.
Id
==
id
)
return
true
;
}
return
false
;
}
public
int
ChainCountPlayer
(
int
player
)
{
int
count
=
0
;
foreach
(
ClientCard
card
in
Duel
.
CurrentChain
)
{
if
(
card
.
Controller
==
player
)
count
++;
}
return
count
;
}
public
bool
HasChainedTrap
(
int
player
)
{
foreach
(
ClientCard
card
in
Duel
.
CurrentChain
)
{
if
(
card
.
Controller
==
player
&&
card
.
HasType
(
CardType
.
Trap
))
return
true
;
}
return
false
;
}
public
ClientCard
GetLastChainCard
()
{
if
(
Duel
.
CurrentChain
.
Count
>
0
)
return
Duel
.
CurrentChain
[
Duel
.
CurrentChain
.
Count
-
1
];
return
null
;
}
public
void
SetMain
(
MainPhase
main
)
public
void
SetMain
(
MainPhase
main
)
{
{
Main
=
main
;
Main
=
main
;
...
...
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