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
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
MyCard
windbot
Commits
16c72c66
Commit
16c72c66
authored
Apr 04, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge
https://github.com/IceYGO/windbot
parents
042ffe18
5b861398
Changes
25
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
2265 additions
and
1383 deletions
+2265
-1383
Decks/AI_LightswornShaddoldinosour.ydk
Decks/AI_LightswornShaddoldinosour.ydk
+93
-0
Decks/AI_Trickstar.ydk
Decks/AI_Trickstar.ydk
+10
-10
Dialogs/kiwi.zh-CN.json
Dialogs/kiwi.zh-CN.json
+78
-0
Game/AI/AIFunctions.cs
Game/AI/AIFunctions.cs
+38
-0
Game/AI/Decks/BlueEyesExecutor.cs
Game/AI/Decks/BlueEyesExecutor.cs
+953
-953
Game/AI/Decks/BurnExecutor.cs
Game/AI/Decks/BurnExecutor.cs
+1
-1
Game/AI/Decks/DragunityExecutor.cs
Game/AI/Decks/DragunityExecutor.cs
+1
-1
Game/AI/Decks/HorusExecutor.cs
Game/AI/Decks/HorusExecutor.cs
+1
-1
Game/AI/Decks/LightswornExecutor.cs
Game/AI/Decks/LightswornExecutor.cs
+259
-263
Game/AI/Decks/LightswornShaddoldinosourExecutor.cs
Game/AI/Decks/LightswornShaddoldinosourExecutor.cs
+686
-0
Game/AI/Decks/QliphortExecutor.cs
Game/AI/Decks/QliphortExecutor.cs
+2
-2
Game/AI/Decks/RainbowExecutor.cs
Game/AI/Decks/RainbowExecutor.cs
+2
-2
Game/AI/Decks/Rank5Executor.cs
Game/AI/Decks/Rank5Executor.cs
+2
-2
Game/AI/Decks/ToadallyAwesomeExecutor.cs
Game/AI/Decks/ToadallyAwesomeExecutor.cs
+3
-3
Game/AI/Decks/TrickstarExecutor.cs
Game/AI/Decks/TrickstarExecutor.cs
+43
-48
Game/AI/Decks/YosenjuExecutor.cs
Game/AI/Decks/YosenjuExecutor.cs
+2
-2
Game/AI/Decks/ZexalWeaponsExecutor.cs
Game/AI/Decks/ZexalWeaponsExecutor.cs
+5
-15
Game/AI/Decks/ZoodiacExecutor.cs
Game/AI/Decks/ZoodiacExecutor.cs
+3
-3
Game/AI/DefaultExecutor.cs
Game/AI/DefaultExecutor.cs
+41
-17
Game/AI/Executor.cs
Game/AI/Executor.cs
+2
-48
Game/ClientField.cs
Game/ClientField.cs
+13
-0
Game/Duel.cs
Game/Duel.cs
+5
-2
Game/GameAI.cs
Game/GameAI.cs
+0
-2
Game/GameBehavior.cs
Game/GameBehavior.cs
+21
-8
WindBot.csproj
WindBot.csproj
+1
-0
No files found.
Decks/AI_LightswornShaddoldinosour.ydk
0 → 100644
View file @
16c72c66
#created by ...
#main
18940556
18940556
18940556
93332803
93332803
55063751
28674152
41782653
41782653
41782653
3717252
3717252
80280944
48048590
77723643
55623480
30328508
30328508
44335251
77558536
77558536
77558536
95503687
95503687
4939890
4939890
14558127
14558127
59438930
37445295
37445295
23434538
23434538
33420078
67441435
1475311
1475311
1475311
11110587
11110587
11110587
18144506
38179121
38179121
38179121
44394295
44394295
44394295
67169062
81439173
83764718
94886282
94886282
99330325
10045474
10045474
74003290
77505534
4904633
#extra
74822425
20366274
48424886
94977269
50954680
80666118
4779823
33698022
76547525
42566602
98558751
30100551
74997493
50588353
50588353
!side
67696066
73176465
37742478
15341821
54757758
13529466
74586817
6983839
82633039
46772449
1861629
1845204
53129443
43898403
48130397
Decks/AI_Trickstar.ydk
View file @
16c72c66
...
...
@@ -2,6 +2,7 @@
#main
98169343
98169343
9929398
61283655
61283655
61283655
...
...
@@ -10,21 +11,20 @@
35199656
14558127
14558127
14558127
59438930
59438930
98700941
23434538
23434538
23434538
94145021
67441435
63845230
63845230
63845230
18144506
35261759
35261759
53129443
53129443
53129443
73628505
73915051
73915051
...
...
@@ -42,18 +42,18 @@
84749824
#extra
41999284
41999284
3987233
2857636
41999284
50588353
98558751
86221741
74997493
2857636
38342335
99111753
31833038
3987233
99111753
38342335
50588353
9753964
41999284
9753964
34408491
!side
Dialogs/kiwi.zh-CN.json
0 → 100644
View file @
16c72c66
{
"welcome"
:
[
"你找到我了!!!"
,
"來決鬥吧"
],
"deckerror"
:
[
"阿,可能BA又把CBD修壞導致{0}消失了。"
],
"duelstart"
:
[
"這只是AI,打贏不要太高興阿。"
,
"十分致謝233服讓我們有遊戲可以玩,別忘記去拜訪他們。"
,
"反主流學院請洽NOVA。"
,
],
"newturn"
:
[
"到我的回合了,抽牌!"
,
"我的回合,抽牌!"
,
"我抽了一張卡。"
],
"endturn"
:
[
"回合结束。"
,
"我的回合结束了。"
,
"這樣算是成功的展開嗎......"
,
"輪到你了。你的下一句是......我要發動灰流麗對吧!"
],
"directattack"
:
[
"{0},直接攻擊!"
,
"{0},直接攻擊對手!"
,
"{0},没有防守的地方,攻擊!"
,
"{0},攻擊對手的生命值!"
,
"{0},直接攻擊對手的生命值!"
,
"{0},通過直接攻擊打倒對手!"
,
"{0},使用直接攻擊打倒對手!"
,
"{0},直接攻擊釋放你的力量吧!"
,
"我的{0}將會粉碎你的生命值!"
,
"向對手展示你的力量吧,{0}!"
,
"你已經無法阻止我了。{0},攻擊!"
],
"attack"
:
[
"{0},攻擊這體{1}!"
,
"{0},消滅這體{1}!"
,
"{0},打倒{1}!"
,
"{0},衝向那體{1}!"
,
"{0},把你的力量释放到{1}上吧!"
],
"ondirectattack"
:
[
"可惡......"
,
"不過是{0}而已!"
,
"果然我還是太弱了......"
],
"facedownmonstername"
:
"怪獸"
,
"activate"
:
[
"我發動{0}。"
,
"我使用{0}的效果。"
,
"我使用{0}的力量。"
],
"summon"
:
[
"真是HIGH的最高點!出來吧{0}。"
,
"出來吧,{0}!"
,
"出現吧,{0}!"
,
"我召喚了強大的{0}!"
,
"我呼喚{0}參加戰鬥!"
,
"我呼喚出{0}。"
,
"我召喚{0}。"
],
"setmonster"
:
[
"我放置了一體怪獸。"
,
"我裡側表示放置了一體怪獸。"
],
"chaining"
:
[
"看這裡!發動{0}!"
,
"我使用{0}的力量。"
,
"很不錯的戰術...但是我拒絕!{0}!"
,
"真不愧是納粹,竟然能識破我的蓋牌......你說你只是單純的決鬥者?{0},發動!"
,
"看樣子你忘了我的{0}!"
,
"你考慮過我有{0}嗎?"
]
}
Game/AI/AIFunctions.cs
View file @
16c72c66
...
...
@@ -296,6 +296,44 @@ namespace WindBot.Game.AI
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>
/// Select cards listed in preferred.
/// </summary>
...
...
Game/AI/Decks/BlueEyesExecutor.cs
View file @
16c72c66
This diff is collapsed.
Click to expand it.
Game/AI/Decks/BurnExecutor.cs
View file @
16c72c66
...
...
@@ -90,7 +90,7 @@ namespace WindBot.Game.AI.Decks
private
bool
SupremacyBerry
()
{
return
Duel
.
LifePoints
[
0
]
<
Duel
.
LifePoints
[
1
]
;
return
Bot
.
LifePoints
<
Enemy
.
LifePoints
;
}
private
bool
PoisonOfTheOldMan
()
...
...
Game/AI/Decks/DragunityExecutor.cs
View file @
16c72c66
...
...
@@ -399,7 +399,7 @@ namespace WindBot.Game.AI.Decks
private
bool
CrystalWingSynchroDragonEffect
()
{
return
LastChainPlayer
!=
0
;
return
Duel
.
LastChainPlayer
!=
0
;
}
private
bool
DragunityPhalanxSummon
()
...
...
Game/AI/Decks/HorusExecutor.cs
View file @
16c72c66
...
...
@@ -162,7 +162,7 @@ namespace WindBot.Game.AI.Decks
private
bool
HorusTheBlackFlameDragonLv8
()
{
return
LastChainPlayer
==
1
;
return
Duel
.
LastChainPlayer
==
1
;
}
private
bool
DragonsRebirth
()
...
...
Game/AI/Decks/LightswornExecutor.cs
View file @
16c72c66
This diff is collapsed.
Click to expand it.
Game/AI/Decks/LightswornShaddoldinosourExecutor.cs
0 → 100644
View file @
16c72c66
This diff is collapsed.
Click to expand it.
Game/AI/Decks/QliphortExecutor.cs
View file @
16c72c66
...
...
@@ -161,7 +161,7 @@ namespace WindBot.Game.AI.Decks
private
bool
SkillDrainEffect
()
{
return
(
Duel
.
LifePoints
[
0
]
>
1000
)
&&
DefaultUniqueTrap
();
return
(
Bot
.
LifePoints
>
1000
)
&&
DefaultUniqueTrap
();
}
private
bool
PotOfDualityEffect
()
...
...
@@ -315,7 +315,7 @@ namespace WindBot.Game.AI.Decks
{
AI
.
SelectCard
(
HighScaleCards
);
}
return
Duel
.
LifePoints
[
0
]
>
800
;
return
Bot
.
LifePoints
>
800
;
}
private
bool
StealthEffect
()
...
...
Game/AI/Decks/RainbowExecutor.cs
View file @
16c72c66
...
...
@@ -107,7 +107,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Number39Utopia
,
DefaultNumberS39UtopiaTheLightningSummon
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
NumberS39UtopiatheLightning
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
NumberS39UtopiatheLightning
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
NumberS39UtopiatheLightning
,
DefaultNumberS39UtopiaTheLightningEffect
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
StardustDragon
,
DefaultStardustDragonSummon
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
StardustDragon
,
DefaultStardustDragonEffect
);
...
...
@@ -267,7 +267,7 @@ namespace WindBot.Game.AI.Decks
private
bool
GagagaCowboySummon
()
{
if
(
Duel
.
LifePoints
[
1
]
<=
800
)
if
(
Enemy
.
LifePoints
<=
800
)
{
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
return
true
;
...
...
Game/AI/Decks/Rank5Executor.cs
View file @
16c72c66
...
...
@@ -262,9 +262,9 @@ namespace WindBot.Game.AI.Decks
private
bool
CyberDragonInfinityEffect
()
{
if
(
CurrentChain
.
Count
>
0
)
if
(
Duel
.
CurrentChain
.
Count
>
0
)
{
return
LastChainPlayer
==
1
;
return
Duel
.
LastChainPlayer
==
1
;
}
else
{
...
...
Game/AI/Decks/ToadallyAwesomeExecutor.cs
View file @
16c72c66
...
...
@@ -117,7 +117,7 @@ namespace WindBot.Game.AI.Decks
if
(!
defender
.
IsMonsterHasPreventActivationEffectInBattle
())
{
if
(
attacker
.
Id
==
CardId
.
SkyCavalryCentaurea
&&
!
attacker
.
IsDisabled
()
&&
attacker
.
HasXyzMaterial
())
attacker
.
RealPower
=
Duel
.
LifePoints
[
0
]
+
attacker
.
Attack
;
attacker
.
RealPower
=
Bot
.
LifePoints
+
attacker
.
Attack
;
}
return
base
.
OnPreBattleBetween
(
attacker
,
defender
);
}
...
...
@@ -302,7 +302,7 @@ namespace WindBot.Game.AI.Decks
private
bool
ToadallyAwesomeEffect
()
{
if
(
CurrentChain
.
Count
>
0
)
if
(
Duel
.
CurrentChain
.
Count
>
0
)
{
// negate effect, select a cost for it
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
...
...
@@ -506,7 +506,7 @@ namespace WindBot.Game.AI.Decks
{
defence
+=
monster
.
GetDefensePower
();
}
if
(
attack
-
2000
-
defence
>
Duel
.
LifePoints
[
1
]
&&
!
AI
.
Utils
.
IsOneEnemyBetter
(
true
))
if
(
attack
-
2000
-
defence
>
Enemy
.
LifePoints
&&
!
AI
.
Utils
.
IsOneEnemyBetter
(
true
))
return
true
;
}
return
false
;
...
...
Game/AI/Decks/TrickstarExecutor.cs
View file @
16c72c66
This diff is collapsed.
Click to expand it.
Game/AI/Decks/YosenjuExecutor.cs
View file @
16c72c66
...
...
@@ -129,7 +129,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Number39Utopia
,
DefaultNumberS39UtopiaTheLightningSummon
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
NumberS39UtopiaOne
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
NumberS39UtopiatheLightning
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
NumberS39UtopiatheLightning
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
NumberS39UtopiatheLightning
,
DefaultNumberS39UtopiaTheLightningEffect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
StardustDragon
,
DefaultStardustDragonEffect
);
...
...
@@ -291,7 +291,7 @@ namespace WindBot.Game.AI.Decks
private
bool
GagagaCowboySummon
()
{
if
(
Duel
.
LifePoints
[
1
]
<=
800
||
(
Bot
.
GetMonsterCount
()>=
4
&&
Duel
.
LifePoints
[
1
]
<=
1600
))
if
(
Enemy
.
LifePoints
<=
800
||
(
Bot
.
GetMonsterCount
()>=
4
&&
Enemy
.
LifePoints
<=
1600
))
{
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
return
true
;
...
...
Game/AI/Decks/ZexalWeaponsExecutor.cs
View file @
16c72c66
...
...
@@ -72,7 +72,7 @@ namespace WindBot.Game.AI.Decks
// XYZ effects
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Number39Utopia
,
Number39Utopia
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
NumberS39UtopiaOne
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
NumberS39UtopiatheLightning
,
NumberS39UtopiatheLightning
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
NumberS39UtopiatheLightning
,
DefaultNumberS39UtopiaTheLightningEffect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ZwLionArms
,
ZwLionArms
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
AdreusKeeperOfArmageddon
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Number61Volcasaurus
);
...
...
@@ -105,7 +105,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
TinGoldfish
,
GoblindberghEffect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Kagetokage
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
SummonerMonk
,
SummonerMonkEffect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Honest
,
Hones
t
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Honest
,
DefaultHonestEffec
t
);
// Reposition
AddExecutor
(
ExecutorType
.
Repos
,
MonsterRepos
);
...
...
@@ -150,7 +150,7 @@ namespace WindBot.Game.AI.Decks
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
false
;
}
...
...
@@ -184,7 +184,7 @@ namespace WindBot.Game.AI.Decks
private
bool
InstantFusion
()
{
if
(
Duel
.
LifePoints
[
0
]
<=
1000
)
if
(
Bot
.
LifePoints
<=
1000
)
return
false
;
int
count4
=
0
;
int
count5
=
0
;
...
...
@@ -210,17 +210,7 @@ namespace WindBot.Game.AI.Decks
private
bool
XyzChangeTactics
()
{
return
Duel
.
LifePoints
[
0
]
>
500
;
}
private
bool
NumberS39UtopiatheLightning
()
{
return
Card
.
Attack
<
5000
;
}
private
bool
Honest
()
{
return
Duel
.
Phase
!=
DuelPhase
.
Main1
||
Duel
.
Turn
==
1
;
return
Bot
.
LifePoints
>
500
;
}
private
bool
GoblindberghFirst
()
...
...
Game/AI/Decks/ZoodiacExecutor.cs
View file @
16c72c66
...
...
@@ -73,7 +73,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Number39Utopia
,
DefaultNumberS39UtopiaTheLightningSummon
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
NumberS39UtopiatheLightning
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
NumberS39UtopiatheLightning
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
NumberS39UtopiatheLightning
,
DefaultNumberS39UtopiaTheLightningEffect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
InvokedMechaba
,
DefaultTrap
);
...
...
@@ -486,7 +486,7 @@ namespace WindBot.Game.AI.Decks
private
bool
DridentEffect
()
{
if
(
LastChainPlayer
==
0
)
if
(
Duel
.
LastChainPlayer
==
0
)
return
false
;
ClientCard
target
=
AI
.
Utils
.
GetBestEnemyCard
(
true
);
if
(
target
==
null
)
...
...
@@ -571,7 +571,7 @@ namespace WindBot.Game.AI.Decks
private
bool
ZoodiacComboEffect
()
{
if
(
CurrentChain
.
Count
>
0
)
if
(
Duel
.
CurrentChain
.
Count
>
0
)
return
false
;
if
(
Card
.
Location
!=
CardLocation
.
Grave
)
{
...
...
Game/AI/DefaultExecutor.cs
View file @
16c72c66
...
...
@@ -104,7 +104,7 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultMysticalSpaceTyphoon
()
{
foreach
(
ClientCard
card
in
CurrentChain
)
foreach
(
ClientCard
card
in
Duel
.
CurrentChain
)
if
(
card
.
Id
==
_CardId
.
MysticalSpaceTyphoon
)
return
false
;
...
...
@@ -137,10 +137,10 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultCosmicCyclone
()
{
foreach
(
ClientCard
card
in
CurrentChain
)
foreach
(
ClientCard
card
in
Duel
.
CurrentChain
)
if
(
card
.
Id
==
_CardId
.
CosmicCyclone
)
return
false
;
return
(
Duel
.
LifePoints
[
0
]
>
1000
)
&&
DefaultMysticalSpaceTyphoon
();
return
(
Bot
.
LifePoints
>
1000
)
&&
DefaultMysticalSpaceTyphoon
();
}
/// <summary>
...
...
@@ -243,11 +243,12 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultBreakthroughSkill
()
{
ClientCard
LastChainCard
=
GetLastChainCard
();
ClientCard
LastChainCard
=
AI
.
Utils
.
GetLastChainCard
();
if
(
LastChainCard
==
null
)
return
false
;
AI
.
SelectCard
(
LastChainCard
);
return
LastChainCard
.
Controller
==
1
&&
LastChainCard
.
Location
==
CardLocation
.
MonsterZone
&&
DefaultUniqueTrap
();
}
...
...
@@ -256,7 +257,7 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultSolemnJudgment
()
{
return
!
AI
.
Utils
.
IsChainTargetOnly
(
Card
)
&&
!(
Duel
.
Player
==
0
&&
LastChainPlayer
==
-
1
)
&&
DefaultTrap
();
return
!
AI
.
Utils
.
IsChainTargetOnly
(
Card
)
&&
!(
Duel
.
Player
==
0
&&
Duel
.
LastChainPlayer
==
-
1
)
&&
DefaultTrap
();
}
/// <summary>
...
...
@@ -264,7 +265,7 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultSolemnWarning
()
{
return
(
Duel
.
LifePoints
[
0
]
>
2000
)
&&
!(
Duel
.
Player
==
0
&&
LastChainPlayer
==
-
1
)
&&
DefaultTrap
();
return
(
Bot
.
LifePoints
>
2000
)
&&
!(
Duel
.
Player
==
0
&&
Duel
.
LastChainPlayer
==
-
1
)
&&
DefaultTrap
();
}
/// <summary>
...
...
@@ -272,7 +273,7 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultSolemnStrike
()
{
return
(
Duel
.
LifePoints
[
0
]
>
1500
)
&&
!(
Duel
.
Player
==
0
&&
LastChainPlayer
==
-
1
)
&&
DefaultTrap
();
return
(
Bot
.
LifePoints
>
1500
)
&&
!(
Duel
.
Player
==
0
&&
Duel
.
LastChainPlayer
==
-
1
)
&&
DefaultTrap
();
}
/// <summary>
...
...
@@ -280,7 +281,7 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultTorrentialTribute
()
{
return
!
HasChainedTrap
(
0
)
&&
AI
.
Utils
.
IsAllEnemyBetter
(
true
);
return
!
AI
.
Utils
.
HasChainedTrap
(
0
)
&&
AI
.
Utils
.
IsAllEnemyBetter
(
true
);
}
/// <summary>
...
...
@@ -395,7 +396,7 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultTrap
()
{
return
(
LastChainPlayer
==
-
1
&&
Duel
.
LastSummonPlayer
!=
0
)
||
LastChainPlayer
==
1
;
return
(
Duel
.
LastChainPlayer
==
-
1
&&
Duel
.
LastSummonPlayer
!=
0
)
||
Duel
.
LastChainPlayer
==
1
;
}
/// <summary>
...
...
@@ -403,7 +404,7 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultUniqueTrap
()
{
if
(
HasChainedTrap
(
0
))
if
(
AI
.
Utils
.
HasChainedTrap
(
0
))
return
false
;
return
UniqueFaceupSpell
();
...
...
@@ -445,7 +446,7 @@ namespace WindBot.Game.AI
if
(
exec
.
Type
==
Type
&&
exec
.
CardId
==
Card
.
Id
)
return
false
;
}
return
LastChainPlayer
!=
0
;
return
Duel
.
LastChainPlayer
!=
0
;
}
/// <summary>
...
...
@@ -459,11 +460,11 @@ namespace WindBot.Game.AI
if
(
exec
.
Type
==
Type
&&
exec
.
CardId
==
Card
.
Id
)
count
++;
}
if
(
count
>
1
||
Duel
.
LifePoints
[
0
]
<=
1000
)
if
(
count
>
1
||
Bot
.
LifePoints
<=
1000
)
return
false
;
if
(
Duel
.
LifePoints
[
0
]
<=
Duel
.
LifePoints
[
1
]
&&
ActivateDescription
==
AI
.
Utils
.
GetStringId
(
_CardId
.
ChickenGame
,
0
))
if
(
Bot
.
LifePoints
<=
Enemy
.
LifePoints
&&
ActivateDescription
==
AI
.
Utils
.
GetStringId
(
_CardId
.
ChickenGame
,
0
))
return
true
;
if
(
Duel
.
LifePoints
[
0
]
>
Duel
.
LifePoints
[
1
]
&&
ActivateDescription
==
AI
.
Utils
.
GetStringId
(
_CardId
.
ChickenGame
,
1
))
if
(
Bot
.
LifePoints
>
Enemy
.
LifePoints
&&
ActivateDescription
==
AI
.
Utils
.
GetStringId
(
_CardId
.
ChickenGame
,
1
))
return
true
;
return
false
;
}
...
...
@@ -518,8 +519,8 @@ namespace WindBot.Game.AI
return
true
;
}
}
ClientCard
lastchaincard
=
GetLastChainCard
();
if
(
LastChainPlayer
==
1
&&
lastchaincard
!=
null
&&
!
lastchaincard
.
IsDisabled
())
ClientCard
lastchaincard
=
AI
.
Utils
.
GetLastChainCard
();
if
(
Duel
.
LastChainPlayer
==
1
&&
lastchaincard
!=
null
&&
!
lastchaincard
.
IsDisabled
())
{
if
(
lastchaincard
.
HasType
(
CardType
.
Ritual
))
{
...
...
@@ -638,6 +639,14 @@ namespace WindBot.Game.AI
return
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
bestBotAttack
,
false
);
}
/// <summary>
/// Activate if the card is attack pos, and its attack is below 5000, when the enemy monster is attack pos or not useless faceup defense pos
/// </summary>
protected
bool
DefaultNumberS39UtopiaTheLightningEffect
()
{
return
Card
.
IsAttack
()
&&
Card
.
Attack
<
5000
&&
(
Enemy
.
BattlingMonster
.
IsAttack
()
||
Enemy
.
BattlingMonster
.
IsFacedown
()
||
Enemy
.
BattlingMonster
.
GetDefensePower
()
>=
Card
.
Attack
);
}
/// <summary>
/// Summon when it can and should use effect.
/// </summary>
...
...
@@ -691,7 +700,7 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultStardustDragonEffect
()
{
return
(
Card
.
Location
==
CardLocation
.
Grave
)
||
LastChainPlayer
==
1
;
return
(
Card
.
Location
==
CardLocation
.
Grave
)
||
Duel
.
LastChainPlayer
==
1
;
}
/// <summary>
...
...
@@ -753,5 +762,20 @@ namespace WindBot.Game.AI
return
(
oppoCount
>
0
&&
selfCount
<=
oppoCount
)
||
oppoCount
>=
3
;
}
/// <summary>
/// Clever enough.
/// </summary>
protected
bool
DefaultHonestEffect
()
{
if
(
Card
.
Location
==
CardLocation
.
Hand
)
{
return
Bot
.
BattlingMonster
.
IsAttack
()
&&
(((
Bot
.
BattlingMonster
.
Attack
<
Enemy
.
BattlingMonster
.
Attack
)
||
Bot
.
BattlingMonster
.
Attack
>=
Enemy
.
LifePoints
)
||
((
Bot
.
BattlingMonster
.
Attack
<
Enemy
.
BattlingMonster
.
Defense
)
&&
(
Bot
.
BattlingMonster
.
Attack
+
Enemy
.
BattlingMonster
.
Attack
>
Enemy
.
BattlingMonster
.
Defense
)));
}
else
return
AI
.
Utils
.
IsTurn1OrMain2
();
}
}
}
Game/AI/Executor.cs
View file @
16c72c66
...
...
@@ -21,9 +21,6 @@ namespace WindBot.Game.AI
protected
ClientCard
Card
{
get
;
private
set
;
}
protected
int
ActivateDescription
{
get
;
private
set
;
}
protected
int
LastChainPlayer
{
get
;
private
set
;
}
protected
IList
<
ClientCard
>
CurrentChain
{
get
;
private
set
;
}
protected
ClientField
Bot
{
get
;
private
set
;
}
protected
ClientField
Enemy
{
get
;
private
set
;
}
...
...
@@ -33,9 +30,6 @@ namespace WindBot.Game.AI
AI
=
ai
;
Executors
=
new
List
<
CardExecutor
>();
LastChainPlayer
=
-
1
;
CurrentChain
=
new
List
<
ClientCard
>();
Bot
=
Duel
.
Fields
[
0
];
Enemy
=
Duel
.
Fields
[
1
];
}
...
...
@@ -109,14 +103,12 @@ namespace WindBot.Game.AI
public
virtual
void
OnChaining
(
int
player
,
ClientCard
card
)
{
CurrentChain
.
Add
(
card
);
LastChainPlayer
=
player
;
}
public
virtual
void
OnChainEnd
()
{
LastChainPlayer
=
-
1
;
CurrentChain
.
Clear
();
}
public
virtual
void
OnNewTurn
()
...
...
@@ -182,44 +174,6 @@ namespace WindBot.Game.AI
return
-
1
;
}
public
bool
ChainContainsCard
(
int
id
)
{
foreach
(
ClientCard
card
in
CurrentChain
)
{
if
(
card
.
Id
==
id
)
return
true
;
}
return
false
;
}
public
int
ChainCountPlayer
(
int
player
)
{
int
count
=
0
;
foreach
(
ClientCard
card
in
CurrentChain
)
{
if
(
card
.
Controller
==
player
)
count
++;
}
return
count
;
}
public
bool
HasChainedTrap
(
int
player
)
{
foreach
(
ClientCard
card
in
CurrentChain
)
{
if
(
card
.
Controller
==
player
&&
card
.
HasType
(
CardType
.
Trap
))
return
true
;
}
return
false
;
}
public
ClientCard
GetLastChainCard
()
{
if
(
CurrentChain
.
Count
>
0
)
return
CurrentChain
[
CurrentChain
.
Count
-
1
];
return
null
;
}
public
void
SetMain
(
MainPhase
main
)
{
Main
=
main
;
...
...
Game/ClientField.cs
View file @
16c72c66
...
...
@@ -13,6 +13,9 @@ namespace WindBot.Game
public
IList
<
ClientCard
>
Deck
{
get
;
private
set
;
}
public
IList
<
ClientCard
>
ExtraDeck
{
get
;
private
set
;
}
public
int
LifePoints
;
public
ClientCard
BattlingMonster
;
public
ClientField
()
{
}
...
...
@@ -33,6 +36,15 @@ namespace WindBot.Game
ExtraDeck
.
Add
(
new
ClientCard
(
0
,
CardLocation
.
Extra
));
}
public
int
GetMonstersExtraZoneCount
()
{
int
count
=
0
;
if
(
MonsterZone
[
5
]
!=
null
)
count
++;
if
(
MonsterZone
[
6
]
!=
null
)
count
++;
return
count
;
}
public
int
GetMonsterCount
()
{
return
GetCount
(
MonsterZone
);
...
...
@@ -68,6 +80,7 @@ namespace WindBot.Game
{
return
GetCards
(
MonsterZone
);
}
public
List
<
ClientCard
>
GetGraveyardMonsters
()
{
...
...
Game/Duel.cs
View file @
16c72c66
...
...
@@ -8,7 +8,6 @@ namespace WindBot.Game
public
bool
IsFirst
{
get
;
set
;
}
public
bool
IsNewRule
{
get
;
set
;
}
public
int
[]
LifePoints
{
get
;
private
set
;
}
public
ClientField
[]
Fields
{
get
;
private
set
;
}
public
int
Turn
{
get
;
set
;
}
...
...
@@ -16,15 +15,19 @@ namespace WindBot.Game
public
DuelPhase
Phase
{
get
;
set
;
}
public
MainPhase
MainPhase
{
get
;
set
;
}
public
BattlePhase
BattlePhase
{
get
;
set
;
}
public
int
LastChainPlayer
{
get
;
set
;
}
public
IList
<
ClientCard
>
CurrentChain
{
get
;
set
;
}
public
IList
<
ClientCard
>
ChainTargets
{
get
;
set
;
}
public
int
LastSummonPlayer
{
get
;
set
;
}
public
Duel
()
{
LifePoints
=
new
int
[
2
];
Fields
=
new
ClientField
[
2
];
Fields
[
0
]
=
new
ClientField
();
Fields
[
1
]
=
new
ClientField
();
LastChainPlayer
=
-
1
;
CurrentChain
=
new
List
<
ClientCard
>();
ChainTargets
=
new
List
<
ClientCard
>();
LastSummonPlayer
=
-
1
;
}
...
...
Game/GameAI.cs
View file @
16c72c66
...
...
@@ -90,7 +90,6 @@ namespace WindBot.Game
m_option
=
-
1
;
m_yesno
=
-
1
;
m_position
=
CardPosition
.
FaceUpAttack
;
Duel
.
LastSummonPlayer
=
-
1
;
if
(
Duel
.
Player
==
0
&&
Duel
.
Phase
==
DuelPhase
.
Draw
)
{
_dialogs
.
SendNewTurn
();
...
...
@@ -112,7 +111,6 @@ namespace WindBot.Game
/// <param name="player">Player who is currently chaining.</param>
public
void
OnChaining
(
ClientCard
card
,
int
player
)
{
Duel
.
LastSummonPlayer
=
-
1
;
Executor
.
OnChaining
(
player
,
card
);
}
...
...
Game/GameBehavior.cs
View file @
16c72c66
...
...
@@ -324,8 +324,8 @@ namespace WindBot.Game
int
type
=
packet
.
ReadByte
();
_duel
.
IsFirst
=
(
type
&
0xF
)
==
0
;
_duel
.
Turn
=
0
;
_duel
.
LifePoints
[
GetLocalPlayer
(
0
)]
=
packet
.
ReadInt32
();
_duel
.
LifePoints
[
GetLocalPlayer
(
1
)]
=
packet
.
ReadInt32
();
_duel
.
Fields
[
GetLocalPlayer
(
0
)].
LifePoints
=
packet
.
ReadInt32
();
_duel
.
Fields
[
GetLocalPlayer
(
1
)].
LifePoints
=
packet
.
ReadInt32
();
int
deck
=
packet
.
ReadInt16
();
int
extra
=
packet
.
ReadInt16
();
_duel
.
Fields
[
GetLocalPlayer
(
0
)].
Init
(
deck
,
extra
);
...
...
@@ -421,27 +421,30 @@ namespace WindBot.Game
private
void
OnNewPhase
(
BinaryReader
packet
)
{
_duel
.
Phase
=
(
DuelPhase
)
packet
.
ReadInt16
();
_duel
.
LastSummonPlayer
=
-
1
;
_duel
.
Fields
[
0
].
BattlingMonster
=
null
;
_duel
.
Fields
[
1
].
BattlingMonster
=
null
;
_ai
.
OnNewPhase
();
}
private
void
OnDamage
(
BinaryReader
packet
)
{
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
final
=
_duel
.
LifePoints
[
player
]
-
packet
.
ReadInt32
();
int
final
=
_duel
.
Fields
[
player
].
LifePoints
-
packet
.
ReadInt32
();
if
(
final
<
0
)
final
=
0
;
_duel
.
LifePoints
[
player
]
=
final
;
_duel
.
Fields
[
player
].
LifePoints
=
final
;
}
private
void
OnRecover
(
BinaryReader
packet
)
{
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
_duel
.
LifePoints
[
player
]
+=
packet
.
ReadInt32
();
_duel
.
Fields
[
player
].
LifePoints
+=
packet
.
ReadInt32
();
}
private
void
OnLpUpdate
(
BinaryReader
packet
)
{
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
_duel
.
LifePoints
[
player
]
=
packet
.
ReadInt32
();
_duel
.
Fields
[
player
].
LifePoints
=
packet
.
ReadInt32
();
}
private
void
OnMove
(
BinaryReader
packet
)
...
...
@@ -494,12 +497,16 @@ namespace WindBot.Game
int
la
=
packet
.
ReadByte
();
int
sa
=
packet
.
ReadByte
();
packet
.
ReadByte
();
//
packet
.
ReadByte
();
// cd
int
cd
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
ld
=
packet
.
ReadByte
();
packet
.
ReadByte
();
// sd
int
sd
=
packet
.
ReadByte
();
packet
.
ReadByte
();
//
ClientCard
attackcard
=
_duel
.
GetCard
(
ca
,
(
CardLocation
)
la
,
sa
);
ClientCard
defendcard
=
_duel
.
GetCard
(
cd
,
(
CardLocation
)
ld
,
sd
);
_duel
.
Fields
[
attackcard
.
Controller
].
BattlingMonster
=
attackcard
;
_duel
.
Fields
[
1
-
attackcard
.
Controller
].
BattlingMonster
=
defendcard
;
if
(
ld
==
0
&&
(
attackcard
!=
null
)
&&
(
ca
!=
0
))
{
_ai
.
OnDirectAttack
(
attackcard
);
...
...
@@ -530,11 +537,17 @@ namespace WindBot.Game
int
cc
=
GetLocalPlayer
(
packet
.
ReadByte
());
_ai
.
OnChaining
(
card
,
cc
);
_duel
.
ChainTargets
.
Clear
();
_duel
.
LastSummonPlayer
=
-
1
;
_duel
.
CurrentChain
.
Add
(
card
);
_duel
.
LastChainPlayer
=
cc
;
}
private
void
OnChainEnd
(
BinaryReader
packet
)
{
_ai
.
OnChainEnd
();
_duel
.
LastChainPlayer
=
-
1
;
_duel
.
CurrentChain
.
Clear
();
//_duel.ChainTargets.Clear();
}
...
...
WindBot.csproj
View file @
16c72c66
...
...
@@ -79,6 +79,7 @@
<Compile
Include=
"Game\AI\Decks\EvilswarmExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\GraydleExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\LightswornExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\LightswornShaddoldinosourExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\QliphortExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\ST1732Executor.cs"
/>
<Compile
Include=
"Game\AI\Decks\TrickstarExecutor.cs"
/>
...
...
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