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
f84924f5
Commit
f84924f5
authored
Aug 24, 2018
by
handsomekiwi
Committed by
mercury233
Aug 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add some default executor (#87)
parent
ac4b43fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
Game/AI/DefaultExecutor.cs
Game/AI/DefaultExecutor.cs
+69
-0
No files found.
Game/AI/DefaultExecutor.cs
View file @
f84924f5
...
...
@@ -56,6 +56,14 @@ namespace WindBot.Game.AI
public
const
int
MacroCosmos
=
30241314
;
public
const
int
UpstartGoblin
=
70368879
;
public
const
int
EaterOfMillions
=
63845230
;
public
const
int
InvokedPurgatrio
=
12307878
;
public
const
int
ChaosAncientGearGiant
=
51788412
;
public
const
int
UltimateAncientGearGolem
=
12652643
;
public
const
int
ImperialOrder
=
61740673
;
public
const
int
NaturiaBeast
=
33198837
;
public
const
int
AntiSpellFragrance
=
58921041
;
}
protected
DefaultExecutor
(
GameAI
ai
,
Duel
duel
)
...
...
@@ -342,6 +350,31 @@ namespace WindBot.Game.AI
return
true
;
}
/// <summary>
/// Default Scapegoat effect
/// </summary>
protected
bool
DefaultScapegoat
()
{
if
(
DefaultSpellWillBeNegated
())
return
false
;
if
(
Duel
.
Player
==
0
)
return
false
;
if
(
Duel
.
Phase
==
DuelPhase
.
End
)
return
true
;
if
(
DefaultOnBecomeTarget
())
return
true
;
if
(
Duel
.
Phase
>
DuelPhase
.
Main1
&&
Duel
.
Phase
<
DuelPhase
.
Main2
)
{
if
(
Enemy
.
HasInMonstersZone
(
_CardId
.
UltimateConductorTytanno
,
true
))
return
false
;
if
(
Enemy
.
HasInMonstersZone
(
_CardId
.
InvokedPurgatrio
,
true
))
return
false
;
if
(
Enemy
.
HasInMonstersZone
(
_CardId
.
ChaosAncientGearGiant
,
true
))
return
false
;
if
(
Enemy
.
HasInMonstersZone
(
_CardId
.
UltimateAncientGearGolem
,
true
))
return
false
;
int
total_atk
=
0
;
List
<
ClientCard
>
enemy_monster
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
m
in
enemy_monster
)
{
if
(
m
.
IsAttack
())
total_atk
+=
m
.
Attack
;
}
if
(
total_atk
>=
Bot
.
LifePoints
)
return
true
;
}
return
false
;
}
/// <summary>
/// Always active in opponent's turn.
/// </summary>
...
...
@@ -641,6 +674,42 @@ namespace WindBot.Game.AI
return
false
;
}
/// <summary>
/// If spell will be negated
/// </summary>
protected
bool
DefaultSpellWillBeNegated
()
{
ClientCard
card
=
null
;
foreach
(
ClientCard
check
in
Bot
.
GetSpells
())
{
if
(
check
.
Id
==
_CardId
.
ImperialOrder
&&
!
check
.
IsDisabled
())
card
=
check
;
}
if
(
card
!=
null
&&
card
.
IsFaceup
())
return
true
;
if
(
Enemy
.
HasInSpellZone
(
_CardId
.
ImperialOrder
,
true
)
||
Enemy
.
HasInMonstersZone
(
_CardId
.
NaturiaBeast
,
true
))
return
true
;
return
false
;
}
/// <summary>
/// If spell must set first to activate
/// </summary>
protected
bool
DefaultSpellMustSetFirst
()
{
ClientCard
card
=
null
;
foreach
(
ClientCard
check
in
Bot
.
GetSpells
())
{
if
(
check
.
Id
==
_CardId
.
AntiSpellFragrance
&&
!
check
.
IsDisabled
())
card
=
check
;
}
if
(
card
!=
null
&&
card
.
IsFaceup
())
return
true
;
if
(
Enemy
.
HasInSpellZone
(
_CardId
.
AntiSpellFragrance
,
true
))
return
true
;
return
false
;
}
/// <summary>
/// if spell/trap is the target or enermy activate HarpiesFeatherDuster
/// </summary>
...
...
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