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
Tang Xinwei
windbot
Commits
3efd5c1c
Commit
3efd5c1c
authored
Sep 01, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update HasInMonstersZone and HasXyzMaterial
parent
58abefdf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
16 deletions
+38
-16
Game/AI/Decks/RainbowExecutor.cs
Game/AI/Decks/RainbowExecutor.cs
+5
-3
Game/AI/Decks/YosenjuExecutor.cs
Game/AI/Decks/YosenjuExecutor.cs
+1
-1
Game/AI/Decks/ZexalWeaponsExecutor.cs
Game/AI/Decks/ZexalWeaponsExecutor.cs
+2
-2
Game/ClientCard.cs
Game/ClientCard.cs
+15
-0
Game/ClientField.cs
Game/ClientField.cs
+15
-10
No files found.
Game/AI/Decks/RainbowExecutor.cs
View file @
3efd5c1c
...
@@ -72,9 +72,10 @@ namespace MycardBot.Game.AI.Decks
...
@@ -72,9 +72,10 @@ namespace MycardBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
SpellSet
,
(
int
)
CardId
.
虫惑的落穴
);
AddExecutor
(
ExecutorType
.
SpellSet
,
(
int
)
CardId
.
虫惑的落穴
);
AddExecutor
(
ExecutorType
.
Summon
,
(
int
)
CardId
.
救援兔
);
AddExecutor
(
ExecutorType
.
Summon
,
(
int
)
CardId
.
救援兔
);
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
救援兔
,
救援兔效果
);
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
救援兔
,
救援兔效果
);
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
强欲而贪欲之壶
,
强欲而贪欲之壶效果
);
AddExecutor
(
ExecutorType
.
Summon
,
(
int
)
CardId
.
曼陀罗天使号手
,
曼陀罗天使号手通常召唤
);
AddExecutor
(
ExecutorType
.
Summon
,
(
int
)
CardId
.
曼陀罗天使号手
,
曼陀罗天使号手通常召唤
);
AddExecutor
(
ExecutorType
.
Summon
,
(
int
)
CardId
.
打喷嚏的河马龙
,
打喷嚏的河马龙通常召唤
);
AddExecutor
(
ExecutorType
.
Summon
,
(
int
)
CardId
.
打喷嚏的河马龙
,
打喷嚏的河马龙通常召唤
);
AddExecutor
(
ExecutorType
.
Summon
,
(
int
)
CardId
.
龙剑士卓辉星灵摆
,
龙剑士卓辉星灵摆通常召唤
);
AddExecutor
(
ExecutorType
.
Summon
,
(
int
)
CardId
.
龙剑士卓辉星灵摆
,
龙剑士卓辉星灵摆通常召唤
);
...
@@ -104,7 +105,6 @@ namespace MycardBot.Game.AI.Decks
...
@@ -104,7 +105,6 @@ namespace MycardBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
芙莉西亚之虫惑魔
);
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
芙莉西亚之虫惑魔
);
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
No59
背反之料理人
,
No59
背反之料理人特殊召唤
);
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
No59
背反之料理人
,
No59
背反之料理人特殊召唤
);
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
强欲而贪欲之壶
,
强欲而贪欲之壶效果
);
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
地碎
,
地碎效果
);
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
地碎
,
地碎效果
);
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
No39
希望皇霍普
,
电光皇特殊召唤
);
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
No39
希望皇霍普
,
电光皇特殊召唤
);
...
@@ -144,8 +144,10 @@ namespace MycardBot.Game.AI.Decks
...
@@ -144,8 +144,10 @@ namespace MycardBot.Game.AI.Decks
}
}
if
(!(
defender
.
Id
==
(
int
)
CardId
.
闪光
No39
希望皇霍普电光皇
))
if
(!(
defender
.
Id
==
(
int
)
CardId
.
闪光
No39
希望皇霍普电光皇
))
{
{
if
(
attacker
.
Id
==
(
int
)
CardId
.
闪光
No39
希望皇霍普电光皇
&&
!
attacker
.
IsDisabled
())
if
(
attacker
.
Id
==
(
int
)
CardId
.
闪光
No39
希望皇霍普电光皇
&&
!
attacker
.
IsDisabled
()
&&
attacker
.
HasXyzMaterial
(
2
,
(
int
)
CardId
.
No39
希望皇霍普
)
)
attacker
.
RealPower
=
5000
;
attacker
.
RealPower
=
5000
;
if
(
Duel
.
Fields
[
0
].
HasInMonstersZone
((
int
)
CardId
.
No37
希望织龙蜘蛛鲨
,
true
,
true
))
attacker
.
RealPower
=
attacker
.
RealPower
+
1000
;
}
}
return
attacker
.
RealPower
>
defender
.
GetDefensePower
();
return
attacker
.
RealPower
>
defender
.
GetDefensePower
();
}
}
...
...
Game/AI/Decks/YosenjuExecutor.cs
View file @
3efd5c1c
...
@@ -182,7 +182,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -182,7 +182,7 @@ namespace WindBot.Game.AI.Decks
{
{
if
(
attacker
.
Attribute
==
(
int
)
CardAttribute
.
Wind
&&
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
妖仙兽辻斩风
))
if
(
attacker
.
Attribute
==
(
int
)
CardAttribute
.
Wind
&&
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
妖仙兽辻斩风
))
attacker
.
RealPower
=
attacker
.
RealPower
+
1000
;
attacker
.
RealPower
=
attacker
.
RealPower
+
1000
;
if
(
attacker
.
Id
==
(
int
)
CardId
.
闪光
No39
希望皇霍普电光皇
&&
!
attacker
.
IsDisabled
())
if
(
attacker
.
Id
==
(
int
)
CardId
.
闪光
No39
希望皇霍普电光皇
&&
!
attacker
.
IsDisabled
()
&&
attacker
.
HasXyzMaterial
(
2
,
(
int
)
CardId
.
No39
希望皇霍普
)
)
attacker
.
RealPower
=
5000
;
attacker
.
RealPower
=
5000
;
}
}
return
attacker
.
RealPower
>
defender
.
GetDefensePower
();
return
attacker
.
RealPower
>
defender
.
GetDefensePower
();
...
...
Game/AI/Decks/ZexalWeaponsExecutor.cs
View file @
3efd5c1c
...
@@ -136,7 +136,7 @@ namespace DevBot.Game.AI.Decks
...
@@ -136,7 +136,7 @@ namespace DevBot.Game.AI.Decks
{
{
if
(
attacker
.
Attribute
==
(
int
)
CardAttribute
.
Light
&&
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
Honest
))
if
(
attacker
.
Attribute
==
(
int
)
CardAttribute
.
Light
&&
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
Honest
))
attacker
.
RealPower
=
attacker
.
RealPower
+
defender
.
Attack
;
attacker
.
RealPower
=
attacker
.
RealPower
+
defender
.
Attack
;
if
(
attacker
.
Id
==
(
int
)
CardId
.
NumberS39UtopiatheLightning
&&
!
attacker
.
IsDisabled
())
if
(
attacker
.
Id
==
(
int
)
CardId
.
NumberS39UtopiatheLightning
&&
!
attacker
.
IsDisabled
()
&&
attacker
.
HasXyzMaterial
(
2
,
(
int
)
CardId
.
Number39Utopia
)
)
attacker
.
RealPower
=
5000
;
attacker
.
RealPower
=
5000
;
}
}
return
attacker
.
RealPower
>
defender
.
GetDefensePower
();
return
attacker
.
RealPower
>
defender
.
GetDefensePower
();
...
@@ -144,7 +144,7 @@ namespace DevBot.Game.AI.Decks
...
@@ -144,7 +144,7 @@ namespace DevBot.Game.AI.Decks
private
bool
Number39Utopia
()
private
bool
Number39Utopia
()
{
{
if
(!
HasChainedTrap
(
0
)
&&
Duel
.
Player
==
1
&&
Duel
.
Phase
==
DuelPhase
.
BattleStart
&&
Card
.
Overlays
.
Count
>
1
)
if
(!
HasChainedTrap
(
0
)
&&
Duel
.
Player
==
1
&&
Duel
.
Phase
==
DuelPhase
.
BattleStart
&&
Card
.
HasXyzMaterial
(
2
)
)
return
true
;
return
true
;
return
false
;
return
false
;
}
}
...
...
Game/ClientCard.cs
View file @
3efd5c1c
...
@@ -184,6 +184,21 @@ namespace WindBot.Game
...
@@ -184,6 +184,21 @@ namespace WindBot.Game
return
(
Disabled
!=
0
);
return
(
Disabled
!=
0
);
}
}
public
bool
HasXyzMaterial
()
{
return
Overlays
.
Count
>
0
;
}
public
bool
HasXyzMaterial
(
int
count
)
{
return
Overlays
.
Count
>=
count
;
}
public
bool
HasXyzMaterial
(
int
count
,
int
cardid
)
{
return
Overlays
.
Count
>=
count
&&
Overlays
.
Contains
(
cardid
);
}
public
int
GetDefensePower
()
public
int
GetDefensePower
()
{
{
return
IsAttack
()
?
Attack
:
Defense
;
return
IsAttack
()
?
Attack
:
Defense
;
...
...
Game/ClientField.cs
View file @
3efd5c1c
...
@@ -140,19 +140,24 @@ namespace WindBot.Game
...
@@ -140,19 +140,24 @@ namespace WindBot.Game
return
false
;
return
false
;
}
}
public
bool
HasInMonstersZone
(
int
cardId
)
public
bool
HasInMonstersZone
(
int
cardId
,
bool
notDisabled
=
false
,
bool
hasXyzMaterial
=
false
)
{
{
return
HasInCards
(
MonsterZone
,
cardId
);
return
HasInCards
(
MonsterZone
,
cardId
,
notDisabled
,
hasXyzMaterial
);
}
}
public
bool
HasInMonstersZone
(
List
<
int
>
cardId
)
public
bool
HasInMonstersZone
(
List
<
int
>
cardId
,
bool
notDisabled
=
false
,
bool
hasXyzMaterial
=
false
)
{
{
return
HasInCards
(
MonsterZone
,
cardId
);
return
HasInCards
(
MonsterZone
,
cardId
,
notDisabled
,
hasXyzMaterial
);
}
}
public
bool
HasInSpellZone
(
int
cardId
)
public
bool
HasInSpellZone
(
int
cardId
,
bool
notDisabled
=
false
)
{
{
return
HasInCards
(
SpellZone
,
cardId
);
return
HasInCards
(
SpellZone
,
cardId
,
notDisabled
);
}
public
bool
HasInSpellZone
(
List
<
int
>
cardId
,
bool
notDisabled
=
false
)
{
return
HasInCards
(
SpellZone
,
cardId
,
notDisabled
);
}
}
public
int
GetRemainingCount
(
int
cardId
,
int
initialCount
)
public
int
GetRemainingCount
(
int
cardId
,
int
initialCount
)
...
@@ -225,21 +230,21 @@ namespace WindBot.Game
...
@@ -225,21 +230,21 @@ namespace WindBot.Game
return
nCards
;
return
nCards
;
}
}
private
static
bool
HasInCards
(
IEnumerable
<
ClientCard
>
cards
,
int
cardId
)
private
static
bool
HasInCards
(
IEnumerable
<
ClientCard
>
cards
,
int
cardId
,
bool
notDisabled
=
false
,
bool
hasXyzMaterial
=
false
)
{
{
foreach
(
ClientCard
card
in
cards
)
foreach
(
ClientCard
card
in
cards
)
{
{
if
(
card
!=
null
&&
card
.
Id
==
cardId
)
if
(
card
!=
null
&&
card
.
Id
==
cardId
&&
!(
notDisabled
&&
card
.
IsDisabled
())
&&
!(
hasXyzMaterial
&&
!
card
.
HasXyzMaterial
())
)
return
true
;
return
true
;
}
}
return
false
;
return
false
;
}
}
private
static
bool
HasInCards
(
IEnumerable
<
ClientCard
>
cards
,
List
<
int
>
cardId
)
private
static
bool
HasInCards
(
IEnumerable
<
ClientCard
>
cards
,
List
<
int
>
cardId
,
bool
notDisabled
=
false
,
bool
hasXyzMaterial
=
false
)
{
{
foreach
(
ClientCard
card
in
cards
)
foreach
(
ClientCard
card
in
cards
)
{
{
if
(
card
!=
null
&&
cardId
.
Contains
(
card
.
Id
))
if
(
card
!=
null
&&
cardId
.
Contains
(
card
.
Id
)
&&
!(
notDisabled
&&
card
.
IsDisabled
())
&&
!(
hasXyzMaterial
&&
!
card
.
HasXyzMaterial
())
)
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
...
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