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
神之吹息
windbot
Commits
90f88870
Commit
90f88870
authored
Oct 12, 2021
by
苍蓝
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 幻宇子
parent
d11241bb
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
900 additions
and
50 deletions
+900
-50
BotWrapper/bot.conf
BotWrapper/bot.conf
+6
-1
Decks/AI_Mathmech.ydk
Decks/AI_Mathmech.ydk
+1
-1
Decks/AI_Mituzi.ydk
Decks/AI_Mituzi.ydk
+44
-0
Decks/AI_SaikyoBattleFlag.ydk
Decks/AI_SaikyoBattleFlag.ydk
+1
-2
Dialogs/Mituzi.zh-CN.json
Dialogs/Mituzi.zh-CN.json
+61
-0
Game/AI/CardContainer.cs
Game/AI/CardContainer.cs
+7
-1
Game/AI/Decks/MathMechExecutor.cs
Game/AI/Decks/MathMechExecutor.cs
+34
-19
Game/AI/Decks/MituziExecutor.cs
Game/AI/Decks/MituziExecutor.cs
+690
-0
Game/AI/Decks/MokeyMokeyExecutor.cs
Game/AI/Decks/MokeyMokeyExecutor.cs
+10
-11
Game/AI/Decks/MokeyMokeyKingExecutor.cs
Game/AI/Decks/MokeyMokeyKingExecutor.cs
+4
-4
Game/AI/Decks/SaikyoBattleFlagExecutor.cs
Game/AI/Decks/SaikyoBattleFlagExecutor.cs
+34
-11
WindBot.csproj
WindBot.csproj
+3
-0
bots.json
bots.json
+5
-0
No files found.
BotWrapper/bot.conf
View file @
90f88870
...
...
@@ -26,5 +26,10 @@ SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!传说子
Name
=传说子
Deck
=
TheLegend
Dialog
=
rd
大量传说卡堆成的卡组。
大量传说卡堆成的卡组。需勾选不检查卡组才能对战。
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!幻宇子
Name
=幻宇子
Deck
=
Mituzi
Dialog
=
Mituzi
.
zh
-
CN
新手友好型幻龙卡组。
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
\ No newline at end of file
Decks/AI_Mathmech.ydk
View file @
90f88870
...
...
@@ -14,6 +14,7 @@
120193002
120183002
120183002
120183002
120183024
120183024
120183030
...
...
@@ -35,7 +36,6 @@
120155060
120155060
120183062
120183062
120183063
120183063
120170061
...
...
Decks/AI_Mituzi.ydk
0 → 100644
View file @
90f88870
#created by ...
#main
120151029
120151029
120155002
120155002
120155002
120155001
120155001
120155001
120155022
120155022
120155024
120155024
120155024
120192010
120192010
120192010
120192011
120192011
120192011
120183034
120183034
120183034
120170037
120170037
120170037
120155025
120155025
120155025
120120037
120155044
120155044
120183053
120194004
120155042
120155042
120151033
120151033
120155053
120155053
120155054
#extra
!side
Decks/AI_SaikyoBattleFlag.ydk
View file @
90f88870
...
...
@@ -12,7 +12,7 @@
120193002
120183002
120183002
120183002
120181001
120181001
...
...
@@ -39,7 +39,6 @@
120155060
120155060
120183062
120183062
120183063
120183063
120170061
...
...
Dialogs/Mituzi.zh-CN.json
0 → 100644
View file @
90f88870
{
"welcome"
:
[
"是新朋友咩?欢迎~(≧▽≦)"
,
"你好呀,现在的我还很弱,总有一天会变强哒!ψ(`∇´)ψ"
,
"据说这里是新人保护区,不会吧(|| ゚Д゚)"
],
"deckerror"
:
[
"什么,居然不让我使用我无敌的{0}!"
],
"duelstart"
:
[
"嘿嘿,还请手下留情哦~
\\
(//∇//)
\\
"
,
"感觉是很不得了的对手啊Σ(゚д゚;)"
,
"人家会全力以赴的哦(≧ω≦)"
,
"开始决斗了,要认真要认真<(`^´)>"
],
"newturn"
:
[
"抽卡抽卡,会抽到什么呢~(´△`)"
,
"希望能有想要的卡…(><)"
],
"endturn"
:
[
"真期待下一回合呀!(。ò ∀ ó。)"
,
"让我猜猜你会怎么做呢~(=^^=)"
],
"directattack"
:
[
"{0},削平山岳吧!(/≧▽≦/)"
,
"呼呼,是不是露出破绽了?\(^▽^)/"
,
"近距离体会一下{0}的帅气吧~(/ω\)"
,
"加油啊{0}!不要输哦!(^O^)"
],
"attack"
:
[
"{1}可不是{0}的对手哦( ̄∀ ̄)"
,
"{1}是挡不住{0}的,小心啦!(☆∀☆)"
,
"{1}和{0}之间的胜者会是谁呢~(⌒▽⌒) "
],
"ondirectattack"
:
[
"呜呜呜呜呜。゚(゚´Д`゚)゚。"
,
"哇啊啊!情况不妙啦!(|| ゚Д゚)"
,
"再这么下去人家就输掉啦呜呜。゚(゚´Д`゚)゚。"
],
"facedownmonstername"
:
"怪兽"
,
"activate"
:
[
"{0},建造城池吧!\(^▽^)/"
,
"可别小看{0}的能力哦~( ̄∀ ̄)"
,
"准备施工了哦,{0}\(^▽^)/"
],
"summon"
:
[
"{0}登场啦,小心点哦(☆∀☆)"
,
"这可是人家最喜欢的怪兽!(><)"
,
"{0}超帅的对吧!(/ω\)"
,
"{0}很可爱吧?你舍得打它吗(/ω\)"
],
"setmonster"
:
[
"嗯嗯~总之先这样吧?(=^▽^=)"
,
"隐藏好我的王牌~_(:D)∠)_"
],
"chaining"
:
[
"现在可不能攻击哦~╮( ̄▽ ̄)╭"
,
"我当然会想到这一步啦~(o^∀^o)"
,
"鲁莽攻击可不行哦~<(`^´)>"
]
}
Game/AI/CardContainer.cs
View file @
90f88870
...
...
@@ -51,9 +51,15 @@ namespace WindBot.Game.AI
public
static
ClientCard
GetHighestLevelMonster
(
this
IEnumerable
<
ClientCard
>
cards
,
bool
canBeTarget
=
false
)
{
return
cards
.
Where
(
card
=>
card
?.
Data
!=
null
&&
card
.
HasType
(
CardType
.
Monster
))
.
Where
(
card
=>
card
?.
Data
!=
null
&&
card
.
HasType
(
CardType
.
Monster
)
&&
!(
canBeTarget
&&
card
.
IsShouldNotBeTarget
())
)
.
OrderBy
(
card
=>
card
.
Level
).
FirstOrDefault
();
}
public
static
ClientCard
GetLowestLevelMonster
(
this
IEnumerable
<
ClientCard
>
cards
,
bool
canBeTarget
=
false
)
{
return
cards
.
Where
(
card
=>
card
?.
Data
!=
null
&&
card
.
HasType
(
CardType
.
Monster
)
&&
!(
canBeTarget
&&
card
.
IsShouldNotBeTarget
()))
.
OrderByDescending
(
card
=>
card
.
Level
).
FirstOrDefault
();
}
public
static
ClientCard
GetHighestDefenseMonster
(
this
IEnumerable
<
ClientCard
>
cards
,
bool
canBeTarget
=
false
)
{
return
cards
...
...
Game/AI/Decks/MathMechExecutor.cs
View file @
90f88870
...
...
@@ -69,6 +69,8 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
双角兽
,
瞄准鹰双角兽
summon
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
成金恐龙王
,
瞄准鹰成金恐龙王
summon
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
突击坦克
,
瞄准鹰坦克
summon
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
最强战旗
,
DefaultOverSummon
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
钢机神
,
DefaultOverSummon
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
死苏
,
死苏
effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
最强战旗
,
最强战旗
Effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
对死者的供奉
,
死供
Effect
);
...
...
@@ -76,22 +78,24 @@ namespace WindBot.Game.AI.Decks
//AddExecutor(ExecutorType.Activate, CardId.钢机神, 钢机神1Effect);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
成金恐龙王
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
工匠无人机
,
无人机
Effect
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
工匠无人机
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
工匠无人机
,
无人机
summon
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
突击坦克
,
突击坦克
summon
);
AddExecutor
(
ExecutorType
.
SummonOrSet
,
CardId
.
旗兽
,
DefaultMonsterSummon
);
AddExecutor
(
ExecutorType
.
SummonOrSet
,
CardId
.
社员
,
DefaultMonsterSummon
);
;
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
工匠无人机
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
突击坦克
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
旗兽
,
突击坦克
summon
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
社员
,
突击坦克
summon
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
旗兽
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
社员
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
瞄准鹰
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
双角兽
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
世纪末兽机界
,
DefaultField
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
兽之拳
,
兽之拳
Effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
兽之拳
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
左迁
,
左迁
1
Effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
减俸
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
左迁
,
左迁
2
Effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
冻结
,
冻结
Effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
兽之拳
);
AddExecutor
(
ExecutorType
.
Activate
,
DefaultDontChainMyself
);
AddExecutor
(
ExecutorType
.
Repos
,
CardId
.
最强战旗
,
圣防
Repos
);
...
...
@@ -102,6 +106,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
铁之重击
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
死苏
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
对死者的供奉
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
世纪末兽机界
,
DefaultField2
);
}
...
...
@@ -174,6 +179,11 @@ namespace WindBot.Game.AI.Decks
DoubleTribute
=
false
;
return
true
;
}
private
bool
DefaultOverSummon
()
{
if
(
Bot
.
Hand
.
Count
>=
6
&&
Bot
.
HasInMonstersZone
(
CardId
.
恶德
))
return
true
;
else
return
false
;
}
private
bool
左迁
1
Effect
()
{
...
...
@@ -215,9 +225,10 @@ namespace WindBot.Game.AI.Decks
{
return
false
;
}
else
if
(
Enemy
.
HasAttackingMonster
()
||
Enemy
.
GetMonsterCount
()
<
1
)
else
//if (Enemy.HasAttackingMonster() || Enemy.GetMonsterCount() < 1)
AI
.
SelectCard
(
CardId
.
最强战旗
,
CardId
.
钢机神
,
CardId
.
恶德
,
CardId
.
旗兽
,
CardId
.
突击坦克
,
CardId
.
工匠无人机
,
CardId
.
社员
,
CardId
.
双角兽
,
CardId
.
瞄准鹰
);
else
AI
.
SelectCard
(
Bot
.
Graveyard
.
GetHighestLevelMonster
());
//
else AI.SelectCard(Bot.Graveyard.GetHighestLevelMonster());
return
true
;
}
...
...
@@ -254,16 +265,6 @@ namespace WindBot.Game.AI.Decks
return
true
;
}
private
bool
兽之拳
Effect
()
{
if
(
Enemy
.
BattlingMonster
.
Race
==
(
int
)
CardRace
.
Dragon
)
return
true
;
if
(
Enemy
.
BattlingMonster
.
Race
==
(
int
)
CardRace
.
Fairy
)
return
true
;
if
(
Enemy
.
BattlingMonster
.
Race
==
(
int
)
CardRace
.
SpellCaster
)
return
true
;
return
false
;
}
private
bool
死苏
effect
()
{
...
...
@@ -361,7 +362,13 @@ namespace WindBot.Game.AI.Decks
}
private
bool
突击坦克
summon
()
{
if
(
Bot
.
MonsterZone
.
GetMatchingCardsCount
(
card
=>
(
card
.
Race
&
(
int
)
CardRace
.
Machine
)
>
0
)
==
2
)
return
true
;
if
(
Bot
.
MonsterZone
.
GetMatchingCardsCount
(
card
=>
(
card
.
Race
&
(
int
)
CardRace
.
Machine
)
>
0
)
==
2
||
Util
.
GetOneEnemyBetterThanMyBest
(
true
,
true
)
==
null
)
return
true
;
return
false
;
}
private
bool
无人机
summon
()
{
if
(
Bot
.
Hand
.
GetMatchingCardsCount
(
card
=>
(
card
.
Race
&
(
int
)
CardRace
.
Machine
)
>
0
)
>=
1
||
Util
.
GetOneEnemyBetterThanMyBest
(
true
,
true
)
==
null
)
return
true
;
return
false
;
}
...
...
@@ -492,6 +499,14 @@ namespace WindBot.Game.AI.Decks
}
return
false
;
}
private
bool
DefaultField2
()
{
if
(
Bot
.
GetHandCount
()
>=
2
)
{
return
true
;
}
return
false
;
}
private
bool
圣防
Repos
()
{
if
(
Enemy
.
Graveyard
.
GetMatchingCardsCount
(
card
=>
(
card
.
Race
&
(
int
)
CardRace
.
SpellCaster
)
>
0
)
>=
4
&&
Enemy
.
GetSpellCountWithoutField
()
>=
1
&&
Enemy
.
Graveyard
.
GetMatchingCardsCount
(
card
=>
card
.
IsCode
(
CardId
.
暗黑释放
))
<
3
)
...
...
Game/AI/Decks/MituziExecutor.cs
0 → 100644
View file @
90f88870
using
YGOSharp.OCGWrapper.Enums
;
using
System.Collections.Generic
;
using
System.Linq
;
using
WindBot
;
using
WindBot.Game
;
using
WindBot.Game.AI
;
using
System
;
//剩余BUG:
//攻击对象不懂得选择
namespace
WindBot.Game.AI.Decks
{
[
Deck
(
"Mituzi"
,
"AI_Mituzi"
)]
public
class
MituziExecutor
:
DefaultExecutor
{
public
class
CardId
{
public
const
int
幻龙重骑
=
120155022
;
public
const
int
建造龙
=
120155024
;
public
const
int
幻刃破龙
=
120151029
;
public
const
int
铲子龙
=
120155002
;
public
const
int
搅拌龙
=
120192010
;
public
const
int
荒废蟠龙
=
120192011
;
public
const
int
风车鳞虫
=
120183034
;
public
const
int
丰沃蟠龙
=
120170037
;
public
const
int
钻头蜥蜴
=
120155001
;
public
const
int
镐头龙
=
120155025
;
public
const
int
贯通
=
120120037
;
public
const
int
阴阳封阵
=
120183053
;
public
const
int
死者苏生
=
120194004
;
public
const
int
透幻乡险峻
=
120155042
;
public
const
int
风
=
120155044
;
public
const
int
幻刃复归
=
120151033
;
public
const
int
幻刃急攻
=
120155053
;
public
const
int
幻刃封锁
=
120155054
;
public
const
int
暗黑释放
=
120105013
;
}
public
int
[]
priList
=
{
CardId
.
建造龙
,
CardId
.
幻龙重骑
,
CardId
.
幻刃破龙
};
public
int
[]
rePriList
=
{
CardId
.
幻刃破龙
,
CardId
.
幻龙重骑
,
CardId
.
建造龙
};
public
MituziExecutor
(
GameAI
ai
,
Duel
duel
)
:
base
(
ai
,
duel
)
{
AddExecutor
(
ExecutorType
.
SpSummon
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
阴阳封阵
,
阴阳封阵
Effect
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
阴阳封阵
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
透幻乡险峻
,
DefaultField
);
AddExecutor
(
ExecutorType
.
Repos
,
圣防
Repos
);
AddExecutor
(
ExecutorType
.
Repos
,
幻刃急攻
Repos
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
风
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
丰沃蟠龙
,
丰沃蟠龙
Effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
荒废蟠龙
,
荒废蟠龙
Effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
搅拌龙
,
搅拌龙
Effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
风车鳞虫
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
镐头龙
,
镐头龙
Effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
建造龙
,
建造龙
Effect
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
镐头龙
,
镐头龙
Summon
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
搅拌龙
,
搅拌龙
Summon
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
幻刃急攻
Set
);
AddExecutor
(
ExecutorType
.
Summon
,
幻刃急攻
Summon
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
死者苏生
,
死者苏生
Effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
贯通
,
贯通
Effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
幻刃复归
,
幻刃复归
Effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
幻刃封锁
,
幻刃封锁
Effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
幻刃急攻
,
幻刃急攻
Effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
透幻乡险峻
);
AddExecutor
(
ExecutorType
.
SpellSet
,
TrapCardSet
);
AddExecutor
(
ExecutorType
.
SpellSet
);
}
private
List
<
int
>
HintMsgForEnemy
=
new
List
<
int
>
{
HintMsg
.
Release
,
HintMsg
.
Destroy
,
HintMsg
.
Remove
,
HintMsg
.
ToGrave
,
HintMsg
.
ReturnToHand
,
HintMsg
.
ToDeck
,
HintMsg
.
FusionMaterial
,
HintMsg
.
SynchroMaterial
,
HintMsg
.
XyzMaterial
,
HintMsg
.
LinkMaterial
,
HintMsg
.
Disable
};
private
List
<
int
>
HintMsgForMaxSelect
=
new
List
<
int
>
{
HintMsg
.
SpSummon
,
HintMsg
.
ToGrave
,
HintMsg
.
AddToHand
,
HintMsg
.
ToDeck
,
HintMsg
.
Destroy
};
public
override
IList
<
ClientCard
>
OnSelectCard
(
IList
<
ClientCard
>
_cards
,
int
min
,
int
max
,
int
hint
,
bool
cancelable
)
{
if
(
Duel
.
Phase
==
DuelPhase
.
BattleStart
)
return
null
;
if
(
AI
.
HaveSelectedCards
())
return
null
;
IList
<
ClientCard
>
selected
=
new
List
<
ClientCard
>();
IList
<
ClientCard
>
cards
=
new
List
<
ClientCard
>(
_cards
);
if
(
max
>
cards
.
Count
)
max
=
cards
.
Count
;
if
(
HintMsgForEnemy
.
Contains
(
hint
))
{
IList
<
ClientCard
>
enemyCards
=
cards
.
Where
(
card
=>
card
.
Controller
==
1
).
ToList
();
// select enemy's card first
while
(
enemyCards
.
Count
>
0
&&
selected
.
Count
<
max
)
{
ClientCard
card
=
enemyCards
[
Program
.
Rand
.
Next
(
enemyCards
.
Count
)];
selected
.
Add
(
card
);
enemyCards
.
Remove
(
card
);
cards
.
Remove
(
card
);
}
}
if
(
HintMsgForMaxSelect
.
Contains
(
hint
))
{
// select max cards
while
(
selected
.
Count
<
max
)
{
ClientCard
card
=
cards
[
Program
.
Rand
.
Next
(
cards
.
Count
)];
selected
.
Add
(
card
);
cards
.
Remove
(
card
);
}
}
return
selected
;
}
public
override
bool
OnSelectHand
()
{
// go first
return
true
;
}
private
bool
TrapCardSet
()
{
if
(
Card
.
HasType
(
CardType
.
Trap
))
return
true
;
return
false
;
}
private
bool
MonsRepos
()
{
if
(
Card
.
Id
==
CardId
.
镐头龙
)
{
if
(
Card
.
IsAttack
())
return
true
;
if
(
Card
.
IsFacedown
())
return
Discord1Draw1Eff
(
CardRace
.
Wyrm
,
false
);
return
false
;
}
if
(
Card
.
Id
==
CardId
.
风车鳞虫
)
{
if
(
Card
.
IsFacedown
())
{
ClientCard
card
=
Util
.
GetWorstEnemyMonster
();
if
(
card
==
null
)
return
true
;
if
(
Bot
.
HasInSpellZone
(
CardId
.
透幻乡险峻
))
{
if
(
Card
.
Attack
+
400
>=
(
card
.
IsAttack
()
?
card
.
Attack
:
card
.
Defense
))
return
true
;
else
return
false
;
}
else
{
if
(
Card
.
Attack
>=
(
card
.
IsAttack
()
?
card
.
Attack
:
card
.
Defense
))
return
true
;
else
return
false
;
}
}
}
if
(
Card
.
Id
==
CardId
.
丰沃蟠龙
)
{
if
(
Card
.
IsFacedown
())
return
Bot
.
GetMonsterCount
()>
1
&&
Bot
.
Hand
.
GetMatchingCardsCount
(
card
=>
card
.
Level
>
4
)
>
0
;
}
ClientCard
emMon
=
Util
.
GetWorstEnemyMonster
();
if
(
emMon
==
null
)
return
Card
.
IsDefense
();
else
{
if
(
Card
.
Attack
>=
emMon
.
GetDefensePower
())
return
Card
.
IsDefense
();
else
return
Card
.
IsAttack
();
}
}
private
bool
镐头龙
Summon
()
{
if
(
Bot
.
HasInMonstersZone
(
CardId
.
幻刃破龙
)
&&
Bot
.
HasInHand
(
CardId
.
建造龙
))
return
Discord1Draw1Eff
(
CardRace
.
Wyrm
,
false
,
true
);
return
Discord1Draw1Eff
(
CardRace
.
Wyrm
,
false
,
false
);
}
private
bool
风车鳞虫
Summon
()
{
ClientCard
card
=
Util
.
GetWorstEnemyMonster
();
if
(
card
==
null
)
return
true
;
if
(
Bot
.
HasInSpellZone
(
CardId
.
透幻乡险峻
))
{
if
(
Card
.
Attack
+
400
>=
(
card
.
IsAttack
()
?
card
.
Attack
:
card
.
Defense
))
return
true
;
else
return
false
;
}
else
{
if
(
Card
.
Attack
>=
(
card
.
IsAttack
()
?
card
.
Attack
:
card
.
Defense
))
return
true
;
else
return
false
;
}
}
private
bool
搅拌龙
Summon
()
{
return
搅拌龙
Effect
(
false
);
}
private
bool
幻刃急攻
Summon
()
{
if
(
Card
.
Level
<
5
&&
(
Card
.
Race
&
(
int
)
CardRace
.
Wyrm
)
>
0
&&
Bot
.
HasInSpellZone
(
CardId
.
幻刃急攻
)
&&
!
isUpperMonSummon
())
{
IList
<
ClientCard
>
lowerList
=
Bot
.
Hand
.
GetMatchingCards
(
card
=>
(
card
.
Level
<
5
&&
((
card
.
Race
&
(
int
)
CardRace
.
Wyrm
)
>
0
)));
if
(
Card
.
Id
==
lowerList
.
OrderByDescending
(
card
=>
card
.
Attack
).
FirstOrDefault
().
Id
&&
Bot
.
Hand
.
GetMatchingCardsCount
(
card
=>
card
.
Id
==
Card
.
Id
)
<
2
)
return
false
;
}
return
MonsSummon
();
}
private
bool
幻刃急攻
Repos
()
{
if
(
Bot
.
HasInSpellZone
(
CardId
.
幻刃急攻
)&&
Bot
.
Hand
.
GetMatchingCardsCount
(
card
=>
card
.
Level
<
7
&&
(
card
.
Race
&
(
int
)
CardRace
.
Wyrm
)
>
0
)>
0
)
{
ClientCard
bestMon
=
Bot
.
MonsterZone
.
GetMonsters
().
OrderByDescending
(
card
=>
card
.
Attack
).
FirstOrDefault
();
if
(
bestMon
==
null
)
return
false
;
if
(
Card
.
Id
==
bestMon
.
Id
)
{
return
!
Card
.
IsAttack
();
}
}
return
MonsRepos
();
}
private
bool
幻刃急攻
Set
()
{
if
(
Card
.
Level
<
5
&&
(
Card
.
Race
&
(
int
)
CardRace
.
Wyrm
)
>
0
&&
Bot
.
HasInSpellZone
(
CardId
.
幻刃急攻
)
&&
!
isUpperMonSummon
())
{
IList
<
ClientCard
>
lowerList
=
Bot
.
Hand
.
GetMatchingCards
(
card
=>
(
card
.
Level
<
5
&&
((
card
.
Race
&
(
int
)
CardRace
.
Wyrm
)
>
0
)));
if
(
Card
.
Id
==
lowerList
.
OrderByDescending
(
card
=>
card
.
Attack
).
FirstOrDefault
().
Id
&&
Bot
.
Hand
.
GetMatchingCardsCount
(
card
=>
card
.
Id
==
Card
.
Id
)
<
2
)
return
false
;
}
return
MonsSet
();
}
private
bool
MonsSet
()
{
ClientCard
EmWorstMon
=
Util
.
GetWorstEnemyMonster
();
if
(
Card
.
Level
<
5
)
{
if
(
Card
.
Id
==
CardId
.
镐头龙
)
{
return
!
Discord1Draw1Eff
(
CardRace
.
Wyrm
,
false
);
}
if
(
Duel
.
Turn
==
1
)
{
if
(
Bot
.
HasInHandOrInSpellZone
(
CardId
.
幻刃封锁
)
&&
(
Bot
.
MonsterZone
.
GetMatchingCardsCount
(
card
=>
card
.
IsFaceup
()
&&
card
.
Level
<
5
)
<=
0
))
return
false
;
else
return
true
;
}
if
(
EmWorstMon
==
null
)
return
false
;
if
(
Card
.
Id
==
CardId
.
风车鳞虫
)
{
return
!
风车鳞虫
Summon
();
}
if
(
Bot
.
HasInSpellZone
(
CardId
.
透幻乡险峻
))
{
return
Card
.
Attack
+
400
<
(
EmWorstMon
.
GetDefensePower
());
}
else
return
Card
.
Attack
<
(
EmWorstMon
.
GetDefensePower
());
}
else
return
false
;
}
private
bool
UpperMonSummon
(
ClientCard
_card
)
//检查某怪兽是否能够上级召唤
{
if
(
_card
.
Level
<
5
)
return
true
;
int
tributeAllow
=
Bot
.
MonsterZone
.
GetMatchingCardsCount
(
card
=>
card
.
Level
<
5
);
if
(
_card
.
Id
==
CardId
.
建造龙
)
{
tributeAllow
+=
Bot
.
HasInMonstersZone
(
CardId
.
幻刃破龙
)
?
1
:
0
;
if
(
Bot
.
SpellZone
.
GetMatchingCardsCount
(
card
=>
card
.
HasType
(
CardType
.
Field
))>
0
||
Enemy
.
SpellZone
.
GetMatchingCardsCount
(
card
=>
card
.
HasType
(
CardType
.
Field
))
>
0
)
{
tributeAllow
+=
Bot
.
HasInMonstersZone
(
CardId
.
幻龙重骑
)
?
1
:
0
;
}
}
if
(
_card
.
Id
==
CardId
.
幻龙重骑
)
tributeAllow
+=
Bot
.
HasInMonstersZone
(
CardId
.
幻刃破龙
)
?
1
:
0
;
if
(
_card
.
Id
!=
CardId
.
幻刃破龙
&&
Bot
.
Hand
.
GetMatchingCardsCount
(
card
=>
card
.
Level
>
6
)
>
2
&&
Bot
.
Hand
.
GetMatchingCardsCount
(
card
=>
card
.
Level
<
5
)
+
Bot
.
MonsterZone
.
GetMatchingCardsCount
(
card
=>
card
.
Level
<
5
)
<
2
)
tributeAllow
=
Bot
.
GetMonsterCount
();
return
tributeAllow
>=
(
_card
.
Level
>
6
?
2
:
1
);
}
private
bool
isUpperMonSummon
()
//检查手卡是否有怪兽可以上级召唤
{
foreach
(
ClientCard
c
in
Bot
.
Hand
.
GetMatchingCards
(
card
=>
card
.
Level
>
4
))
{
if
(
UpperMonSummon
(
c
))
return
true
;
else
{
if
(
Bot
.
MonsterZone
.
GetMatchingCardsCount
(
card
=>
card
.
Level
>
4
)
<=
1
&&
Bot
.
MonsterZone
.
GetMatchingCardsCount
(
card
=>
card
.
Level
<
5
)
+
Bot
.
Hand
.
GetMatchingCardsCount
(
card
=>
card
.
Level
>
5
)
>=
(
c
.
Level
>
6
?
2
:
1
))
return
true
;
else
return
false
;
}
}
return
false
;
}
private
bool
MonsSummon
()
{
if
(
Card
.
Id
==
CardId
.
镐头龙
)
{
return
镐头龙
Summon
();
}
if
(
Card
.
Id
==
CardId
.
风车鳞虫
)
{
return
风车鳞虫
Summon
();
}
if
(
Card
.
Level
>
6
)
{
return
UpperMonSummon
(
Card
);
}
return
DefaultMonsterSummon
();
}
private
bool
镐头龙
Effect
()
{
if
(
Bot
.
HasInMonstersZone
(
CardId
.
幻刃破龙
)
&&
Bot
.
HasInHand
(
CardId
.
建造龙
))
return
Discord1Draw1Eff
(
CardRace
.
Wyrm
,
true
,
true
);
return
Discord1Draw1Eff
(
CardRace
.
Wyrm
,
true
,
false
);
}
/*private bool 荒废蟠龙Effect()
{
if(Bot.Hand.GetMatchingCardsCount(card=>card.HasType(CardType.Field)) > 0)
{
AI.SelectCard(Bot.GetFieldSpellCard());
return true;
}
return false;
}*/
private
bool
Discord1Draw1Eff
(
CardRace
race
,
bool
isAISelect
=
true
,
bool
isReplaceUpperMon
=
false
)
{
if
(
Bot
.
Hand
.
GetMatchingCardsCount
(
card
=>
(
card
.
Race
&
(
int
)
race
)
>
0
)
>
0
)
{
int
triCost
=
Bot
.
Hand
.
GetMatchingCardsCount
(
card
=>
card
.
Level
>
4
&&
card
.
Level
<
7
)
+
Bot
.
Hand
.
GetMatchingCardsCount
(
card
=>
card
.
Level
>
6
)
*
2
;
int
tributeNum
=
(
isReplaceUpperMon
?
Bot
.
GetMonsterCount
()
:
Bot
.
MonsterZone
.
GetMatchingCardsCount
(
card
=>
card
.
Level
<
5
))
+
Bot
.
Hand
.
GetMatchingCardsCount
(
card
=>
card
.
Level
<
5
);
if
(
triCost
>
tributeNum
&&
Bot
.
Hand
.
GetMatchingCardsCount
(
card
=>
(
card
.
Race
&
(
int
)
race
)
>
0
&&
card
.
Level
>
4
)
>
0
)
{
if
(
isAISelect
&&
triCost
>
2
)
AI
.
SelectCard
(
rePriList
);
}
else
if
(
triCost
<
tributeNum
-
1
&&
triCost
>
0
&&
Bot
.
GetSpellCountWithoutField
()<
3
&&
Bot
.
Hand
.
GetMatchingCardsCount
(
card
=>
(
card
.
Race
&
(
int
)
race
)
>
0
&&
card
.
Level
<
5
)
>
0
)
{
if
(
isAISelect
)
AI
.
SelectCard
(
Bot
.
Hand
.
GetFirstMatchingCard
(
card
=>
(
card
.
Race
&
(
int
)
race
)
>
0
&&
card
.
Level
<
5
));
}
else
return
false
;
return
true
;
}
return
false
;
}
bool
ATKdown
=
false
;
public
override
void
OnNewTurn
()
{
ATKdown
=
false
;
}
public
override
BattlePhaseAction
OnSelectAttackTarget
(
ClientCard
attacker
,
IList
<
ClientCard
>
defenders
)
{
if
(
ATKdown
&&
Bot
.
GetMonsterCount
()
<=
Enemy
.
GetMonsterCount
())
{
for
(
int
i
=
0
;
i
<
defenders
.
Count
;
i
++)
{
ClientCard
defender
=
defenders
[
i
];
attacker
.
RealPower
=
attacker
.
Attack
;
defender
.
RealPower
=
defender
.
GetDefensePower
();
if
(!
OnPreBattleBetween
(
attacker
,
defender
))
continue
;
if
(
attacker
.
RealPower
>
defender
.
RealPower
&&
defender
.
Level
>
6
&&
defender
.
IsAttack
()
&&
defender
.
Attack
<
1800
)
{
return
AI
.
Attack
(
attacker
,
defender
);
}
}
}
return
base
.
OnSelectAttackTarget
(
attacker
,
defenders
);
}
private
bool
建造龙
Effect
()
{
if
(
Bot
.
Hand
.
GetMatchingCardsCount
(
card
=>
card
.
Level
>
6
)>
0
)
{
foreach
(
ClientCard
card
in
Bot
.
Hand
.
GetMatchingCards
(
card
=>
card
.
Level
>
6
))
{
if
(
UpperMonSummon
(
card
))
return
false
;
}
}
return
建造龙
Effect
(
true
);
}
private
bool
建造龙
Effect
(
bool
isAISelect
=
true
,
bool
isDefense
=
false
)
{
if
(
Bot
.
SpellZone
.
GetMatchingCardsCount
(
card
=>
card
.
HasType
(
CardType
.
Field
))
>
0
||
Enemy
.
SpellZone
.
GetMatchingCardsCount
(
card
=>
card
.
HasType
(
CardType
.
Field
))
>
0
)
{
if
(
isAISelect
)
{
IList
<
ClientCard
>
matchList
=
Bot
.
Graveyard
.
GetMatchingCards
(
card
=>
(
card
.
Race
&
(
int
)
CardRace
.
Wyrm
)
>
0
&&
card
.
HasType
(
CardType
.
Normal
));
ClientCard
mon
=
matchList
.
OrderByDescending
(
card
=>
card
.
Level
).
FirstOrDefault
();
AI
.
SelectCard
(
mon
);
ClientCard
worstEmon
=
Util
.
GetWorstEnemyMonster
();
if
(
worstEmon
==
null
)
AI
.
SelectPosition
(
isDefense
?
CardPosition
.
FaceDownDefence
:
CardPosition
.
FaceUpAttack
);
else
if
((
Bot
.
HasInSpellZone
(
CardId
.
透幻乡险峻
)
?
mon
.
Attack
+
400
:
mon
.
Attack
)
>=
worstEmon
.
GetDefensePower
())
AI
.
SelectPosition
(
isDefense
?
CardPosition
.
FaceDownDefence
:
CardPosition
.
FaceUpAttack
);
else
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
}
return
true
;
}
return
false
;
}
private
bool
搅拌龙
Effect
()
{
return
搅拌龙
Effect
(
true
);
}
private
bool
搅拌龙
Effect
(
bool
isAISelect
=
true
)
{
if
(
Bot
.
SpellZone
.
GetMatchingCardsCount
(
card
=>
card
.
HasType
(
CardType
.
Field
))
>
0
||
Enemy
.
SpellZone
.
GetMatchingCardsCount
(
card
=>
card
.
HasType
(
CardType
.
Field
))
>
0
)
{
if
(
isAISelect
)
AI
.
SelectYesNo
(
true
);
return
true
;
}
return
false
;
}
private
bool
丰沃蟠龙
Effect
()
{
return
丰沃蟠龙
Effect
(
true
);
}
private
bool
丰沃蟠龙
Effect
(
bool
isAISelect
=
true
)
{
if
(
Bot
.
Graveyard
.
GetMatchingCardsCount
(
card
=>
card
.
HasType
(
CardType
.
Field
))
>
0
)
{
int
[]
fieldList
=
new
int
[]
{
CardId
.
透幻乡险峻
};
if
(
isAISelect
)
AI
.
SelectCard
(
fieldList
);
return
true
;
}
return
false
;
}
private
bool
荒废蟠龙
Effect
()
{
if
(
Enemy
.
LifePoints
<=
600
)
AI
.
SelectCard
(
CardId
.
透幻乡险峻
);
else
if
(
Bot
.
HasInHand
(
CardId
.
透幻乡险峻
))
{
AI
.
SelectCard
(
CardId
.
透幻乡险峻
);
return
true
;
}
return
false
;
}
private
bool
贯通
Effect
()
{
return
贯通
Effect
(
true
);
}
private
bool
贯通
Effect
(
bool
isAISelect
=
true
)
{
if
(
Enemy
.
HasDefendingMonster
()
&&
Bot
.
HasAttackingMonster
())
{
if
(
isAISelect
)
{
int
monBotNum
=
Bot
.
MonsterZone
.
GetMatchingCardsCount
(
card
=>
card
.
Level
>
6
&&
card
.
IsAttack
()),
monEnNum
=
Enemy
.
MonsterZone
.
GetMatchingCardsCount
(
card
=>
card
.
Level
>
6
&&
card
.
IsAttack
());
ClientCard
EnMon
=
Enemy
.
MonsterZone
.
GetMatchingCards
(
card
=>
card
.
IsDefense
()
&&
card
.
IsFaceup
())
.
OrderByDescending
(
card
=>
card
.
Defense
).
FirstOrDefault
(),
botMon
=
Bot
.
MonsterZone
.
GetMatchingCards
(
card
=>
card
.
IsAttack
()
&&
card
.
IsFaceup
())
.
OrderByDescending
(
card
=>
card
.
Attack
).
FirstOrDefault
();
if
(
EnMon
==
null
)
{
AI
.
SelectCard
(
Bot
.
MonsterZone
.
GetMatchingCards
(
card
=>
card
.
IsAttack
())
.
OrderByDescending
(
card
=>
card
.
Attack
).
FirstOrDefault
());
return
true
;
}
if
(
monBotNum
>
0
&&(
monBotNum
>
monEnNum
)&&
EnMon
.
Defense
<
botMon
.
Attack
)
{
ClientCard
objMon
=
Bot
.
MonsterZone
.
GetMatchingCards
(
card
=>
card
.
IsAttack
()
&&
card
.
Level
>
6
&&
card
.
Attack
>
EnMon
.
Defense
)
.
OrderBy
(
card
=>
card
.
Attack
).
FirstOrDefault
();
AI
.
SelectCard
(
objMon
);
return
true
;
}
}
}
return
false
;
}
private
bool
幻刃复归
Effect
()
{
return
幻刃复归
Effect
(
true
,
true
);
}
private
bool
幻刃复归
Effect
(
bool
isAttack
=
true
,
bool
isAISelect
=
true
)
{
if
(
Bot
.
Graveyard
.
GetMatchingCardsCount
(
card
=>
card
.
Level
>
6
&&
((
card
.
Race
&
(
int
)
CardRace
.
Wyrm
)
>
0
))
>
0
)
{
if
(
isAISelect
)
{
int
[]
localList
=
new
int
[]
{
CardId
.
建造龙
,
CardId
.
幻龙重骑
};
if
(
Bot
.
HasInMonstersZone
(
CardId
.
建造龙
)
&&
建造龙
Effect
(
true
,
false
))
{
if
(
Bot
.
HasInGraveyard
(
localList
[
0
])
||
Bot
.
HasInGraveyard
(
localList
[
1
]))
AI
.
SelectCard
(
localList
);
else
return
false
;
}
else
AI
.
SelectCard
(
priList
);
IList
<
ClientCard
>
atkingMon
=
Enemy
.
MonsterZone
.
GetMatchingCards
(
card
=>
card
.
Attacked
==
false
&&
card
.
IsAttack
());
if
(
atkingMon
.
GetHighestAttackMonster
()
==
null
)
AI
.
SelectPosition
(
isAttack
?
CardPosition
.
FaceUpAttack
:
CardPosition
.
FaceDownDefence
);
else
{
bool
defaultAtk
=
(
atkingMon
.
OrderByDescending
(
card
=>
card
.
Attack
).
FirstOrDefault
().
Attack
<=
(
2400
+
(
Bot
.
HasInSpellZone
(
CardId
.
透幻乡险峻
)
?
400
:
0
)));
AI
.
SelectPosition
(
defaultAtk
?
CardPosition
.
FaceUpAttack
:
CardPosition
.
FaceDownDefence
);
}
}
return
true
;
}
return
false
;
}
private
bool
幻刃急攻
Effect
()
{
return
幻刃急攻
Effect
(
true
);
}
private
bool
幻刃急攻
Effect
(
bool
isAISelect
=
true
)
{
if
(
Bot
.
Hand
.
GetMatchingCardsCount
(
card
=>
card
.
Level
<
7
&&
(
card
.
Race
&
(
int
)
CardRace
.
Wyrm
)>
0
)
>
0
)
{
if
(
isAISelect
)
{
IList
<
ClientCard
>
lower7Mons
=
Bot
.
Hand
.
GetMatchingCards
(
card
=>
card
.
Level
<
7
&&(
card
.
Race
&
(
int
)
CardRace
.
Wyrm
)>
0
);
ClientCard
mon
=
lower7Mons
.
OrderByDescending
(
card
=>
card
.
Attack
).
FirstOrDefault
();
if
(
Bot
.
BattlingMonster
.
GetDefensePower
()
+
mon
.
Attack
>=
Enemy
.
BattlingMonster
.
Attack
)
AI
.
SelectCard
(
mon
);
else
return
false
;
}
return
true
;
}
return
false
;
}
private
bool
幻刃封锁
Effect
()
{
return
幻刃封锁
Effect
(
true
);
}
private
bool
幻刃封锁
Effect
(
bool
isAISelect
=
true
)
{
if
(
Bot
.
MonsterZone
.
GetMatchingCardsCount
(
card
=>
card
.
Level
>
6
&&
((
card
.
Race
&
(
int
)
CardRace
.
Wyrm
)
>
0
))
>
0
)
{
if
(
Bot
.
HasInMonstersZone
(
CardId
.
建造龙
)
&&
(
Bot
.
SpellZone
.
GetMatchingCardsCount
(
card
=>
card
.
HasType
(
CardType
.
Field
))>
0
||
Enemy
.
SpellZone
.
GetMatchingCardsCount
(
card
=>
card
.
HasType
(
CardType
.
Field
))
>
0
)
&&
Bot
.
MonsterZone
.
GetMatchingCardsCount
(
card
=>
card
.
IsFaceup
()
&&
(
card
.
HasType
(
CardType
.
Normal
)))
>
0
)
{
IList
<
ClientCard
>
NormalList
=
Bot
.
MonsterZone
.
GetMatchingCards
(
card
=>
(
card
.
HasType
(
CardType
.
Normal
)));
if
(
isAISelect
)
{
AI
.
SelectCard
(
NormalList
.
GetLowestLevelMonster
());
}
}
else
if
(
Bot
.
MonsterZone
.
GetMatchingCardsCount
(
card
=>
card
.
IsFaceup
()
&&
(
card
.
Level
<
5
)
&&
(
card
.
Race
&
(
int
)
CardRace
.
Wyrm
)
>
0
)
>
0
)
{
if
(
isAISelect
)
{
AI
.
SelectCard
(
Bot
.
MonsterZone
.
GetMatchingCards
(
card
=>
card
.
IsFaceup
()
&&
(
card
.
Level
<
5
)
&&
(
card
.
Race
&
(
int
)
CardRace
.
Wyrm
)
>
0
)
.
OrderBy
(
card
=>
card
.
Attack
).
FirstOrDefault
());
}
}
else
{
ClientCard
mon
=
Util
.
GetBestBotMonster
();
int
dangerEnMons
=
Enemy
.
MonsterZone
.
GetMatchingCardsCount
(
card
=>
card
.
Attack
>
mon
.
GetDefensePower
());
if
((
Bot
.
HasInSpellZone
(
CardId
.
幻刃急攻
)
&&
幻刃急攻
Effect
(
false
))
||
(
Bot
.
HasInSpellZone
(
CardId
.
幻刃复归
)&&
幻刃复归
Effect
(
false
,
false
)))
dangerEnMons
--;
if
(
dangerEnMons
>
0
)
{
if
(
isAISelect
)
AI
.
SelectCard
(
rePriList
);
}
else
return
false
;
}
}
else
{
ClientCard
c
=
Bot
.
MonsterZone
.
GetMatchingCards
(
card
=>
card
.
IsFaceup
()
&&
(
card
.
Race
&
(
int
)
CardRace
.
Wyrm
)
>
0
)
.
OrderBy
(
card
=>
card
.
GetDefensePower
()).
FirstOrDefault
();
AI
.
SelectCard
(
c
);
}
if
(
isAISelect
)
AI
.
SelectNextCard
(
Duel
.
LastSummonedCards
);
return
true
;
}
private
bool
死者苏生
Effect
()
{
if
(
Enemy
.
Graveyard
.
GetMatchingCardsCount
(
card
=>
card
.
Level
>
6
)+
Bot
.
Graveyard
.
GetMatchingCardsCount
(
card
=>
card
.
Level
>
6
)>
0
)
{
IList
<
ClientCard
>
EmList
=
Enemy
.
Graveyard
.
GetMatchingCards
(
card
=>
card
.
Level
>
6
),
BotList
=
Bot
.
Graveyard
.
GetMatchingCards
(
card
=>
card
.
Level
>
6
),
unionList
=
EmList
.
Concat
(
BotList
).
ToList
();
AI
.
SelectCard
(
unionList
.
OrderByDescending
(
card
=>
card
.
Attack
).
FirstOrDefault
());
AI
.
SelectPosition
(
CardPosition
.
FaceUpAttack
);
return
true
;
}
return
false
;
}
//泛用墓地回收函数,内置AISelectCard, slcNum:回收数量,idList优先回收ID表,keepNums保留数量表,执行成功返回true
private
bool
GraveReturnSelect
(
int
slcNum
,
int
[]
idList
,
int
[]
keepNums
)
{
int
hadSlc
=
0
;
if
(
idList
.
FirstOrDefault
()
==
0
||
idList
.
Length
>
keepNums
.
Length
)
return
false
;
for
(
int
i
=
0
;
i
<
idList
.
Length
;
i
++)
//优先回收
{
int
keepNum
=
keepNums
.
ElementAtOrDefault
(
i
);
//keepNum不存在时为0
int
hasNum
=
Bot
.
GetCountCardInZone
(
Bot
.
Graveyard
,
idList
[
i
]);
for
(
int
j
=
0
;
j
<
hasNum
-
keepNum
;
j
++)
//返回优先
{
AI
.
SelectCard
(
idList
[
j
]);
if
(++
hadSlc
>=
slcNum
)
return
true
;
}
}
foreach
(
ClientCard
card
in
Bot
.
Graveyard
)
//返回剩余
{
if
(!
idList
.
Contains
(
card
.
Id
))
{
AI
.
SelectCard
(
card
);
if
(++
hadSlc
>=
slcNum
)
return
true
;
}
}
foreach
(
ClientCard
card
in
Bot
.
Graveyard
)
//能返则返
{
AI
.
SelectCard
(
card
);
if
(++
hadSlc
>=
slcNum
)
return
true
;
}
return
hadSlc
>=
slcNum
;
}
private
bool
阴阳封阵
Effect
()
{
if
(
Enemy
.
HasAttackingMonster
())
{
ClientCard
c
=
Enemy
.
MonsterZone
.
GetMatchingCards
(
card
=>
card
.
IsAttack
()&&
card
.
Level
>
6
).
GetHighestAttackMonster
();
if
(
c
==
null
||
!
GraveReturnSelect
(
4
,
priList
,
new
int
[]
{
0
,
0
,
1
}))
return
false
;
AI
.
SelectNextCard
(
c
);
ATKdown
=
true
;
return
true
;
}
return
false
;
}
private
bool
圣防
Repos
()
{
if
(
Enemy
.
Graveyard
.
GetMatchingCardsCount
(
card
=>
(
card
.
Race
&
(
int
)
CardRace
.
SpellCaster
)
>
0
)
>=
4
&&
Enemy
.
GetSpellCountWithoutField
()
>=
1
&&
Enemy
.
Graveyard
.
GetMatchingCardsCount
(
card
=>
card
.
IsCode
(
CardId
.
暗黑释放
))
<
3
)
{
if
(
Card
.
IsAttack
()
&&
Card
.
Level
>
6
&&
Bot
.
MonsterZone
.
GetMatchingCardsCount
(
card
=>
card
.
IsAttack
()
&&
card
.
Level
>=
5
)
>=
2
&&
!
Bot
.
HasDefendingMonster
())
return
true
;
}
return
false
;
}
}
}
Game/AI/Decks/MokeyMokeyExecutor.cs
View file @
90f88870
...
...
@@ -171,20 +171,19 @@ namespace WindBot.Game.AI.Decks
return
true
;
}
private
bool
圣防
Effect
()
{
if
(
Util
.
GetTotalAttackingMonsterAttack
(
1
)
>
1900
)
return
true
;
return
false
;
}
private
bool
落穴
Effect
()
{
foreach
(
ClientCard
n
in
Duel
.
LastSummonedCards
)
{
if
(
n
.
Attack
>=
1900
)
return
true
;
if
(
n
.
Attack
>=
1900
)
return
true
;
if
(
Util
.
GetTotalAttackingMonsterAttack
(
1
)
-
Util
.
GetTotalAttackingMonsterAttack
(
0
)
>
Bot
.
LifePoints
&&
!
Bot
.
HasDefendingMonster
())
return
true
;
}
return
false
;
}
private
bool
圣防
Effect
()
{
if
(
Util
.
GetTotalAttackingMonsterAttack
(
1
)
>
1900
)
return
true
;
if
(
Util
.
GetTotalAttackingMonsterAttack
(
1
)
-
Util
.
GetTotalAttackingMonsterAttack
(
0
)
>
Bot
.
LifePoints
&&
!
Bot
.
HasDefendingMonster
())
return
true
;
return
false
;
}
private
bool
火星心少女
Effect
()
...
...
Game/AI/Decks/MokeyMokeyKingExecutor.cs
View file @
90f88870
...
...
@@ -185,15 +185,15 @@ namespace WindBot.Game.AI.Decks
{
foreach
(
ClientCard
n
in
Duel
.
LastSummonedCards
)
{
if
(
n
.
Attack
>=
1900
)
return
true
;
if
(
n
.
Attack
>=
1900
)
return
true
;
if
(
Util
.
GetTotalAttackingMonsterAttack
(
1
)
-
Util
.
GetTotalAttackingMonsterAttack
(
0
)
>
Bot
.
LifePoints
&&
!
Bot
.
HasDefendingMonster
())
return
true
;
}
return
false
;
}
private
bool
圣防
Effect
()
{
if
(
Util
.
GetTotalAttackingMonsterAttack
(
1
)
>
1900
)
return
true
;
if
(
Util
.
GetTotalAttackingMonsterAttack
(
1
)
>
1900
)
return
true
;
if
(
Util
.
GetTotalAttackingMonsterAttack
(
1
)
-
Util
.
GetTotalAttackingMonsterAttack
(
0
)
>
Bot
.
LifePoints
&&
!
Bot
.
HasDefendingMonster
())
return
true
;
return
false
;
}
private
bool
死供
Effect
()
...
...
Game/AI/Decks/SaikyoBattleFlagExecutor.cs
View file @
90f88870
...
...
@@ -69,6 +69,8 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
双角兽
,
瞄准鹰双角兽
summon
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
成金恐龙王
,
瞄准鹰成金恐龙王
summon
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
突击坦克
,
瞄准鹰坦克
summon
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
最强战旗
,
DefaultOverSummon
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
钢机神
,
DefaultOverSummon
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
死苏
,
死苏
effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
最强战旗
,
最强战旗
Effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
对死者的供奉
,
死供
Effect
);
...
...
@@ -76,22 +78,22 @@ namespace WindBot.Game.AI.Decks
//AddExecutor(ExecutorType.Activate, CardId.钢机神, 钢机神1Effect);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
成金恐龙王
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
工匠无人机
,
无人机
Effect
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
工匠无人机
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
突击坦克
,
突击坦克
summon
);
AddExecutor
(
ExecutorType
.
SummonOrSet
,
CardId
.
旗兽
,
DefaultMonsterSummon
);
AddExecutor
(
ExecutorType
.
SummonOrSet
,
CardId
.
社员
,
DefaultMonsterSummon
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
工匠无人机
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
突击坦克
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
工匠无人机
,
无人机
summon
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
突击坦克
,
突击坦克
summon
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
旗兽
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
社员
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
瞄准鹰
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
双角兽
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
世纪末兽机界
,
DefaultField
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
兽之拳
,
兽之拳
Effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
兽之拳
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
左迁
,
左迁
1
Effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
减俸
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
左迁
,
左迁
2
Effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
冻结
,
冻结
Effect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
兽之拳
);
AddExecutor
(
ExecutorType
.
Activate
,
DefaultDontChainMyself
);
AddExecutor
(
ExecutorType
.
Repos
,
CardId
.
最强战旗
,
圣防
Repos
);
...
...
@@ -102,6 +104,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
铁之重击
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
死苏
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
对死者的供奉
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
世纪末兽机界
,
DefaultField2
);
}
...
...
@@ -174,6 +177,11 @@ namespace WindBot.Game.AI.Decks
DoubleTribute
=
false
;
return
true
;
}
private
bool
DefaultOverSummon
()
{
if
(
Bot
.
Hand
.
Count
>=
6
&&
Bot
.
HasInMonstersZone
(
CardId
.
恶德
))
return
true
;
else
return
false
;
}
private
bool
左迁
1
Effect
()
{
...
...
@@ -215,9 +223,10 @@ namespace WindBot.Game.AI.Decks
{
return
false
;
}
else
if
(
Enemy
.
HasAttackingMonster
()
||
Enemy
.
GetMonsterCount
()
<
1
)
else
//if (Enemy.HasAttackingMonster() || Enemy.GetMonsterCount() < 1)
AI
.
SelectCard
(
CardId
.
最强战旗
,
CardId
.
钢机神
,
CardId
.
恶德
,
CardId
.
旗兽
,
CardId
.
突击坦克
,
CardId
.
工匠无人机
,
CardId
.
社员
,
CardId
.
双角兽
,
CardId
.
瞄准鹰
);
else
AI
.
SelectCard
(
Bot
.
Graveyard
.
GetHighestLevelMonster
());
//
else AI.SelectCard(Bot.Graveyard.GetHighestLevelMonster());
return
true
;
}
...
...
@@ -361,7 +370,7 @@ namespace WindBot.Game.AI.Decks
}
private
bool
突击坦克
summon
()
{
if
(
Bot
.
MonsterZone
.
GetMatchingCardsCount
(
card
=>
(
card
.
Race
&
(
int
)
CardRace
.
Machine
)
>
0
)
==
2
)
return
true
;
if
(
Bot
.
MonsterZone
.
GetMatchingCardsCount
(
card
=>
(
card
.
Race
&
(
int
)
CardRace
.
Machine
)
>
0
)
==
2
||
Util
.
GetOneEnemyBetterThanMyBest
(
true
,
true
)
==
null
)
return
true
;
return
false
;
}
...
...
@@ -454,6 +463,12 @@ namespace WindBot.Game.AI.Decks
AI
.
SelectCard
(
CardId
.
瞄准鹰
,
CardId
.
突击坦克
,
CardId
.
工匠无人机
,
CardId
.
社员
,
CardId
.
旗兽
);
return
true
;
}
private
bool
无人机
summon
()
{
if
(
Bot
.
Hand
.
GetMatchingCardsCount
(
card
=>
(
card
.
Race
&
(
int
)
CardRace
.
Machine
)
>
0
)
>=
1
||
Util
.
GetOneEnemyBetterThanMyBest
(
true
,
true
)
==
null
)
return
true
;
return
false
;
}
private
bool
最强战旗
Effect
()
{
if
(
Util
.
IsOneEnemyBetterThanValue
(
1900
,
false
))
...
...
@@ -492,6 +507,14 @@ namespace WindBot.Game.AI.Decks
}
return
false
;
}
private
bool
DefaultField2
()
{
if
(
Bot
.
GetHandCount
()
>=
2
)
{
return
true
;
}
return
false
;
}
private
bool
圣防
Repos
()
{
if
(
Enemy
.
Graveyard
.
GetMatchingCardsCount
(
card
=>
(
card
.
Race
&
(
int
)
CardRace
.
SpellCaster
)
>
0
)
>=
4
&&
Enemy
.
GetSpellCountWithoutField
()
>=
1
&&
Enemy
.
Graveyard
.
GetMatchingCardsCount
(
card
=>
card
.
IsCode
(
CardId
.
暗黑释放
))
<
3
)
...
...
WindBot.csproj
View file @
90f88870
...
...
@@ -78,6 +78,7 @@
<Compile
Include=
"Game\AI\Decks\BlackwingExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\LuckyExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\MathMechExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\MituziExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\PureWindsExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\DragunExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\Level8Executor.cs"
/>
...
...
@@ -155,6 +156,8 @@
</ItemGroup>
<ItemGroup>
<None
Include=
"App.config"
/>
<None
Include=
"Decks\AI_Mituzi.ydk"
/>
<None
Include=
"Dialogs\Mituzi.zh-CN.json"
/>
<None
Include=
"Dialogs\rd-c.json"
/>
<None
Include=
"Dialogs\rd-d.json"
/>
<None
Include=
"sqlite3.dll"
>
...
...
bots.json
View file @
90f88870
...
...
@@ -25,6 +25,11 @@
"name"
:
"传说子"
,
"deck"
:
"Dragun"
,
"dialog"
:
"rd"
},
{
"name"
:
"幻宇子"
,
"deck"
:
"Mituzi"
,
"dialog"
:
"Mituzi.zh-CN"
}
]
...
...
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