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
nanahira
windbot
Commits
82d2241f
Commit
82d2241f
authored
Apr 09, 2018
by
wind2009
Committed by
mercury233
Apr 10, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update TrickstarExecutor.cs
Fix borreload dragon's effect. Fix Eater of Millions' repos.
parent
8763f440
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
36 deletions
+53
-36
Game/AI/Decks/TrickstarExecutor.cs
Game/AI/Decks/TrickstarExecutor.cs
+53
-36
No files found.
Game/AI/Decks/TrickstarExecutor.cs
View file @
82d2241f
...
@@ -43,10 +43,10 @@ namespace WindBot.Game.AI.Decks
...
@@ -43,10 +43,10 @@ namespace WindBot.Game.AI.Decks
public
const
int
Linkspi
=
98978921
;
public
const
int
Linkspi
=
98978921
;
public
const
int
SafeDra
=
99111753
;
public
const
int
SafeDra
=
99111753
;
public
const
int
Crystal
=
50588353
;
public
const
int
Crystal
=
50588353
;
public
const
int
p
honeix
=
2857636
;
public
const
int
P
honeix
=
2857636
;
public
const
int
u
nicorn
=
38342335
;
public
const
int
U
nicorn
=
38342335
;
public
const
int
s
nake
=
74997493
;
public
const
int
S
nake
=
74997493
;
public
const
int
b
orrel
=
31833038
;
public
const
int
B
orrel
=
31833038
;
public
const
int
TG
=
98558751
;
public
const
int
TG
=
98558751
;
public
const
int
Beelze
=
34408491
;
public
const
int
Beelze
=
34408491
;
...
@@ -60,10 +60,10 @@ namespace WindBot.Game.AI.Decks
...
@@ -60,10 +60,10 @@ namespace WindBot.Game.AI.Decks
public
int
getLinkMarker
(
int
id
)
public
int
getLinkMarker
(
int
id
)
{
{
if
(
id
==
CardId
.
borrel
||
id
==
CardId
.
s
nake
)
return
4
;
if
(
id
==
CardId
.
Borrel
||
id
==
CardId
.
S
nake
)
return
4
;
else
if
(
id
==
CardId
.
Abyss
||
id
==
CardId
.
Beelze
||
id
==
CardId
.
Exterio
||
id
==
CardId
.
Ultimate
||
id
==
CardId
.
Cardian
)
return
5
;
else
if
(
id
==
CardId
.
Abyss
||
id
==
CardId
.
Beelze
||
id
==
CardId
.
Exterio
||
id
==
CardId
.
Ultimate
||
id
==
CardId
.
Cardian
)
return
5
;
else
if
(
id
==
CardId
.
u
nicorn
)
return
3
;
else
if
(
id
==
CardId
.
U
nicorn
)
return
3
;
else
if
(
id
==
CardId
.
Crystal
||
id
==
CardId
.
p
honeix
||
id
==
CardId
.
SafeDra
||
id
==
CardId
.
Missus
)
return
2
;
else
if
(
id
==
CardId
.
Crystal
||
id
==
CardId
.
P
honeix
||
id
==
CardId
.
SafeDra
||
id
==
CardId
.
Missus
)
return
2
;
return
1
;
return
1
;
}
}
...
@@ -108,26 +108,26 @@ namespace WindBot.Game.AI.Decks
...
@@ -108,26 +108,26 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Tuner
,
Tuner_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Tuner
,
Tuner_eff
);
// ex ss
// ex ss
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
b
orrel
,
Borrel_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
B
orrel
,
Borrel_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Missus
,
Missus_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Missus
,
Missus_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
p
honeix
,
Phoneix_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
P
honeix
,
Phoneix_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
s
nake
,
Snake_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
S
nake
,
Snake_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Crystal
,
Crystal_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Crystal
,
Crystal_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
SafeDra
,
Safedragon_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
SafeDra
,
Safedragon_ss
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
SafeDra
,
DefaultCompulsoryEvacuationDevice
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
SafeDra
,
DefaultCompulsoryEvacuationDevice
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Linkuri
,
Linkuri_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Linkuri
,
Linkuri_eff
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Linkuri
,
Linkuri_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Linkuri
,
Linkuri_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
u
nicorn
,
Unicorn_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
U
nicorn
,
Unicorn_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Linkspi
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Linkspi
);
// ex_monster act
// ex_monster act
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Beelze
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Beelze
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Missus
,
Missus_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Missus
,
Missus_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Crystal
,
Crystal_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Crystal
,
Crystal_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
p
honeix
,
Phoneix_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
P
honeix
,
Phoneix_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
u
nicorn
,
Unicorn_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
U
nicorn
,
Unicorn_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
s
nake
,
Snake_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
S
nake
,
Snake_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
b
orrel
,
Borrel_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
B
orrel
,
Borrel_eff
);
// normal act
// normal act
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Trans
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Trans
);
...
@@ -168,7 +168,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -168,7 +168,7 @@ namespace WindBot.Game.AI.Decks
public
bool
Has_down_arrow
(
int
id
)
public
bool
Has_down_arrow
(
int
id
)
{
{
return
(
id
==
CardId
.
Linkuri
||
id
==
CardId
.
Linkspi
||
id
==
CardId
.
u
nicorn
);
return
(
id
==
CardId
.
Linkuri
||
id
==
CardId
.
Linkspi
||
id
==
CardId
.
U
nicorn
);
}
}
public
bool
IsTrickstar
(
int
id
)
public
bool
IsTrickstar
(
int
id
)
...
@@ -223,7 +223,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -223,7 +223,7 @@ namespace WindBot.Game.AI.Decks
if
(
Enemy
.
GetMonstersExtraZoneCount
()
>
1
)
judge
=
false
;
// exlink
if
(
Enemy
.
GetMonstersExtraZoneCount
()
>
1
)
judge
=
false
;
// exlink
if
(
Bot
.
GetMonstersExtraZoneCount
()
>=
1
)
if
(
Bot
.
GetMonstersExtraZoneCount
()
>=
1
)
{
{
foreach
(
ClientCard
card
in
Bot
.
GetMonstersInExtraZone
())
foreach
(
ClientCard
card
in
Bot
.
GetMonstersInExtraZone
())
{
{
if
(
getLinkMarker
(
card
.
Id
)
==
5
)
judge
=
false
;
if
(
getLinkMarker
(
card
.
Id
)
==
5
)
judge
=
false
;
}
}
...
@@ -236,14 +236,17 @@ namespace WindBot.Game.AI.Decks
...
@@ -236,14 +236,17 @@ namespace WindBot.Game.AI.Decks
ClientCard
ex_best
=
null
;
ClientCard
ex_best
=
null
;
foreach
(
ClientCard
ex_card
in
ex
)
foreach
(
ClientCard
ex_card
in
ex
)
{
{
if
(!
fornextss
)
{
if
(!
fornextss
)
{
if
(
ex_best
==
null
||
ex_card
.
Attack
>
ex_best
.
Attack
)
ex_best
=
ex_card
;
if
(
ex_best
==
null
||
ex_card
.
Attack
>
ex_best
.
Attack
)
ex_best
=
ex_card
;
}
else
}
else
{
{
if
(
getLinkMarker
(
ex_card
.
Id
)
!=
5
&&
(
ex_best
==
null
||
ex_card
.
Attack
>
ex_best
.
Attack
))
ex_best
=
ex_card
;
if
(
getLinkMarker
(
ex_card
.
Id
)
!=
5
&&
(
ex_best
==
null
||
ex_card
.
Attack
>
ex_best
.
Attack
))
ex_best
=
ex_card
;
}
}
}
}
if
(
ex_best
!=
null
)
{
if
(
ex_best
!=
null
)
{
AI
.
SelectCard
(
ex_best
);
AI
.
SelectCard
(
ex_best
);
}
}
}
}
...
@@ -252,10 +255,11 @@ namespace WindBot.Game.AI.Decks
...
@@ -252,10 +255,11 @@ namespace WindBot.Game.AI.Decks
// cannot ss from exdeck or have more than 1 grass in chain
// cannot ss from exdeck or have more than 1 grass in chain
int
[]
secondselect
=
new
[]
int
[]
secondselect
=
new
[]
{
{
CardId
.
b
orrel
,
CardId
.
B
orrel
,
CardId
.
Ultimate
,
CardId
.
Ultimate
,
CardId
.
Abyss
,
CardId
.
Abyss
,
CardId
.
Cardian
,
CardId
.
Cardian
,
CardId
.
Exterio
,
CardId
.
Ghost
,
CardId
.
Ghost
,
CardId
.
White
,
CardId
.
White
,
CardId
.
Red
,
CardId
.
Red
,
...
@@ -661,17 +665,14 @@ namespace WindBot.Game.AI.Decks
...
@@ -661,17 +665,14 @@ namespace WindBot.Game.AI.Decks
List
<
ClientCard
>
monster_list
=
Bot
.
GetMonsters
();
List
<
ClientCard
>
monster_list
=
Bot
.
GetMonsters
();
monster_list
.
Sort
(
AIFunctions
.
CompareCardAttack
);
monster_list
.
Sort
(
AIFunctions
.
CompareCardAttack
);
monster_list
.
Reverse
();
monster_list
.
Reverse
();
ClientCard
self_best
=
null
;
foreach
(
ClientCard
card
in
monster_list
)
foreach
(
ClientCard
card
in
monster_list
)
{
{
if
(
IsTrickstar
(
card
.
Id
)
&&
card
!=
return_card
&&
card
.
HasPosition
(
CardPosition
.
Attack
))
if
(
IsTrickstar
(
card
.
Id
)
&&
card
!=
return_card
&&
card
.
HasPosition
(
CardPosition
.
Attack
))
{
{
self_best
=
card
;
int
this_power
=
(
Bot
.
HasInHand
(
CardId
.
White
)
&&
!
white_eff_used
)
?
(
card
.
RealPower
+
card
.
Attack
)
:
card
.
RealPower
;
break
;
if
(
this_power
>=
self_power
)
self_power
=
this_power
;
}
}
else
if
(
card
.
RealPower
>=
self_power
)
self_power
=
card
.
RealPower
;
}
}
if
(
self_best
!=
null
)
self_power
=
(
Bot
.
HasInHand
(
CardId
.
White
))
?
(
self_best
.
Attack
+
self_best
.
RealPower
)
:
self_best
.
Attack
;
}
}
ClientCard
bestenemy
=
AI
.
Utils
.
GetOneEnemyBetterThanValue
(
self_power
,
true
);
ClientCard
bestenemy
=
AI
.
Utils
.
GetOneEnemyBetterThanValue
(
self_power
,
true
);
if
(
bestenemy
!=
null
)
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
if
(
bestenemy
!=
null
)
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
...
@@ -1510,8 +1511,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -1510,8 +1511,8 @@ namespace WindBot.Game.AI.Decks
AI
.
SelectCard
(
Useless_List
());
AI
.
SelectCard
(
Useless_List
());
return
true
;
return
true
;
}
}
//if (ActivateDescription == AI.Utils.GetStringId(CardId.
s
nake, 2)) return true;
//if (ActivateDescription == AI.Utils.GetStringId(CardId.
S
nake, 2)) return true;
if
(
ActivateDescription
==
AI
.
Utils
.
GetStringId
(
CardId
.
s
nake
,
1
))
if
(
ActivateDescription
==
AI
.
Utils
.
GetStringId
(
CardId
.
S
nake
,
1
))
{
{
foreach
(
ClientCard
hand
in
Bot
.
Hand
)
foreach
(
ClientCard
hand
in
Bot
.
Hand
)
{
{
...
@@ -1546,7 +1547,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -1546,7 +1547,7 @@ namespace WindBot.Game.AI.Decks
{
{
AI
.
SelectMaterials
(
material_list
);
AI
.
SelectMaterials
(
material_list
);
return
true
;
return
true
;
}
else
if
(
AI
.
Utils
.
GetProblematicEnemyMonster
(
2000
)
!=
null
&&
Bot
.
HasInExtra
(
CardId
.
b
orrel
)
&&
!
Bot
.
HasInMonstersZone
(
CardId
.
Missus
))
}
else
if
(
AI
.
Utils
.
GetProblematicEnemyMonster
(
2000
)
!=
null
&&
Bot
.
HasInExtra
(
CardId
.
B
orrel
)
&&
!
Bot
.
HasInMonstersZone
(
CardId
.
Missus
))
{
{
AI
.
SelectMaterials
(
material_list
);
AI
.
SelectMaterials
(
material_list
);
return
true
;
return
true
;
...
@@ -1560,7 +1561,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -1560,7 +1561,7 @@ namespace WindBot.Game.AI.Decks
{
{
CardId
.
MG
,
CardId
.
MG
,
CardId
.
Missus
,
CardId
.
Missus
,
CardId
.
s
nake
CardId
.
S
nake
});
});
return
true
;
return
true
;
}
}
...
@@ -1620,7 +1621,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -1620,7 +1621,7 @@ namespace WindBot.Game.AI.Decks
{
{
return
(
Card
.
Attack
-
enemy_monster
.
Attack
<
Enemy
.
LifePoints
);
return
(
Card
.
Attack
-
enemy_monster
.
Attack
<
Enemy
.
LifePoints
);
}
}
else
return
fals
e
;
return
tru
e
;
};
};
ClientCard
BestEnemy
=
AI
.
Utils
.
GetBestEnemyMonster
(
true
);
ClientCard
BestEnemy
=
AI
.
Utils
.
GetBestEnemyMonster
(
true
);
ClientCard
WorstBot
=
Bot
.
GetMonsters
().
GetLowestAttackMonster
();
ClientCard
WorstBot
=
Bot
.
GetMonsters
().
GetLowestAttackMonster
();
...
@@ -1670,15 +1671,30 @@ namespace WindBot.Game.AI.Decks
...
@@ -1670,15 +1671,30 @@ namespace WindBot.Game.AI.Decks
return
false
;
return
false
;
}
}
public
bool
IsAllEnemyBetter
()
{
int
bestPower
=
-
1
;
for
(
int
i
=
0
;
i
<
7
;
++
i
)
{
ClientCard
card
=
Bot
.
MonsterZone
[
i
];
if
(
card
==
null
||
card
.
Data
==
null
)
continue
;
int
newPower
=
card
.
Attack
;
if
(
IsTrickstar
(
card
.
Id
)
&&
Bot
.
HasInHand
(
CardId
.
White
)
&&
!
white_eff_used
)
newPower
+=
card
.
RealPower
;
if
(
newPower
>
bestPower
)
bestPower
=
newPower
;
}
return
AI
.
Utils
.
IsAllEnemyBetterThanValue
(
bestPower
,
true
);
}
public
bool
MonsterRepos
()
public
bool
MonsterRepos
()
{
{
if
(
Card
.
Id
==
CardId
.
Eater
&&
Card
.
HasPosition
(
CardPosition
.
Attack
))
return
false
;
if
(
Card
.
Id
==
CardId
.
Eater
)
return
(!
Card
.
HasPosition
(
CardPosition
.
Attack
))
;
if
(
IsTrickstar
(
Card
.
Id
)
&&
!
white_eff_used
&&
Bot
.
HasInHand
(
CardId
.
White
)
&&
Card
.
IsAttack
()
&&
Duel
.
Phase
==
DuelPhase
.
Main1
)
return
false
;
if
(
IsTrickstar
(
Card
.
Id
)
&&
!
white_eff_used
&&
Bot
.
HasInHand
(
CardId
.
White
)
&&
Card
.
IsAttack
()
&&
Duel
.
Phase
==
DuelPhase
.
Main1
)
return
false
;
if
(
Card
.
IsFaceup
()
&&
Card
.
IsDefense
()
&&
Card
.
Attack
==
0
)
if
(
Card
.
IsFaceup
()
&&
Card
.
IsDefense
()
&&
Card
.
Attack
==
0
)
return
false
;
return
false
;
bool
enemyBetter
=
AI
.
Utils
.
IsAllEnemyBetter
(
true
);
bool
enemyBetter
=
IsAllEnemyBetter
(
);
if
(
Card
.
IsAttack
()
&&
enemyBetter
)
if
(
Card
.
IsAttack
()
&&
enemyBetter
)
return
true
;
return
true
;
...
@@ -1731,7 +1747,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -1731,7 +1747,8 @@ namespace WindBot.Game.AI.Decks
if
(!
defender
.
IsMonsterHasPreventActivationEffectInBattle
()
&&
!
attacker
.
IsDisabled
())
if
(!
defender
.
IsMonsterHasPreventActivationEffectInBattle
()
&&
!
attacker
.
IsDisabled
())
{
{
if
((
attacker
.
Id
==
CardId
.
Eater
&&
!
defender
.
HasType
(
CardType
.
Token
)
&&
GraveCall_id
!=
CardId
.
Eater
)
||
attacker
.
Id
==
CardId
.
borrel
)
return
AI
.
Attack
(
attacker
,
defender
);
if
((
attacker
.
Id
==
CardId
.
Eater
&&
!
defender
.
HasType
(
CardType
.
Token
))
||
attacker
.
Id
==
CardId
.
Borrel
)
return
AI
.
Attack
(
attacker
,
defender
);
if
((
attacker
.
Id
==
CardId
.
Ultimate
||
attacker
.
Id
==
CardId
.
Cardian
)
&&
attacker
.
RealPower
>
defender
.
RealPower
)
return
AI
.
Attack
(
attacker
,
defender
);
}
}
if
(!
OnPreBattleBetween
(
attacker
,
defender
))
if
(!
OnPreBattleBetween
(
attacker
,
defender
))
...
@@ -1752,7 +1769,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -1752,7 +1769,7 @@ namespace WindBot.Game.AI.Decks
for
(
int
i
=
0
;
i
<
attackers
.
Count
;
++
i
)
for
(
int
i
=
0
;
i
<
attackers
.
Count
;
++
i
)
{
{
ClientCard
attacker
=
attackers
[
i
];
ClientCard
attacker
=
attackers
[
i
];
if
(
attacker
.
Id
==
CardId
.
b
orrel
||
attacker
.
Id
==
CardId
.
Eater
)
return
attacker
;
if
(
attacker
.
Id
==
CardId
.
B
orrel
||
attacker
.
Id
==
CardId
.
Eater
)
return
attacker
;
}
}
return
null
;
return
null
;
}
}
...
...
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