Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
W
Windbot-408
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-408
Commits
b2d7083a
Commit
b2d7083a
authored
Jan 06, 2025
by
xiaoye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Earth_408Executor.cs
parent
7d8d5956
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
22 deletions
+26
-22
Game/AI/Decks/Earth_408Executor.cs
Game/AI/Decks/Earth_408Executor.cs
+26
-22
No files found.
Game/AI/Decks/Earth_408Executor.cs
View file @
b2d7083a
...
...
@@ -39,22 +39,26 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
MonsterSet
,
OnSelectMonsterSet
);
}
private
bool
chk_release_summon
=
false
;
private
int
summonInTurn
=
0
;
private
int
[]
changePosInTurn
=
new
int
[]
{
0
,
0
,
0
,
0
,
0
,
0
};
private
int
[]
attacked
=
new
int
[]
{
0
,
0
,
0
,
0
,
0
,
0
};
private
class
ChkCard
{
public
static
bool
chk_release_summon
=
false
;
public
static
int
summonInTurn
=
0
;
public
static
int
[]
attacked
=
new
int
[]
{
0
,
0
,
0
,
0
,
0
,
0
};
public
static
int
[]
changePosInTurn
=
new
int
[]
{
0
,
0
,
0
,
0
,
0
,
0
};
}
public
override
void
OnNewTurn
()
{
summonInTurn
=
0
;
changePosInTurn
=
new
int
[]
{
0
,
0
,
0
,
0
,
0
,
0
};
attacked
=
new
int
[]
{
0
,
0
,
0
,
0
,
0
,
0
}
;
ChkCard
.
changePosInTurn
=
new
int
[]
{
0
,
0
,
0
,
0
,
0
,
0
}
;
ChkCard
.
attacked
=
new
int
[]
{
0
,
0
,
0
,
0
,
0
,
0
};
ChkCard
.
summonInTurn
=
0
;
}
public
override
BattlePhaseAction
OnSelectAttackTarget
(
ClientCard
attacker
,
IList
<
ClientCard
>
defenders
)
{
if
(
attacker
.
CanDirectAttack
)
{
attacked
[
GetSequence
(
attacker
)]
=
attacker
.
Id
;
ChkCard
.
attacked
[
GetSequence
(
attacker
)]
=
attacker
.
Id
;
return
AI
.
Attack
(
attacker
,
null
);
}
if
(
attacker
.
IsCode
(
new
[]
{
37043180
,
70074904
}))
...
...
@@ -68,9 +72,9 @@ namespace WindBot.Game.AI.Decks
if
(!
OnPreBattleBetween
(
attacker
,
defender
))
continue
;
if
(
attacker
.
RealPower
<
defender
.
RealPower
&&
((
Bot
.
HasInMonstersZone
(
79575620
)
&&
attacked
.
Any
(
id
=>
id
==
79575620
)
&&
Bot
.
LifePoints
>
2000
)
?
defender
.
RealPower
-
attacker
.
RealPower
<
Bot
.
LifePoints
-
2000
:
defender
.
RealPower
-
attacker
.
RealPower
<
Bot
.
LifePoints
))
if
(
attacker
.
RealPower
<
defender
.
RealPower
&&
((
Bot
.
HasInMonstersZone
(
79575620
)
&&
ChkCard
.
attacked
.
Any
(
id
=>
id
==
79575620
)
&&
Bot
.
LifePoints
>
2000
)
?
defender
.
RealPower
-
attacker
.
RealPower
<
Bot
.
LifePoints
-
2000
:
defender
.
RealPower
-
attacker
.
RealPower
<
Bot
.
LifePoints
))
{
attacked
[
GetSequence
(
attacker
)]
=
attacker
.
Id
;
ChkCard
.
attacked
[
GetSequence
(
attacker
)]
=
attacker
.
Id
;
return
AI
.
Attack
(
attacker
,
defender
);
}
}
...
...
@@ -87,9 +91,9 @@ namespace WindBot.Game.AI.Decks
if
(!
OnPreBattleBetween
(
attacker
,
defender
))
continue
;
if
((
attacker
.
RealPower
>=
defender
.
RealPower
&&
defender
.
IsAttack
())
||
(
attacker
.
RealPower
>
defender
.
RealPower
&&
!
GetZoneCards
(
CardLocation
.
MonsterZone
,
Bot
).
Any
(
c
=>
c
!=
null
&&
!
c
.
IsCode
(
79575620
)
&&
c
.
IsAttack
()
&&
(
c
.
Attack
>
defender
.
RealPower
||
(
c
.
IsCode
(
new
[]
{
37043180
,
70074904
})
&&
defender
.
RealPower
-
c
.
Attack
<
Bot
.
LifePoints
-
2000
))
&&
attacked
[
GetSequence
(
c
)]
!=
c
.
Id
)
&&
defender
.
IsDefense
()
&&
defender
.
IsFaceup
()))
if
((
attacker
.
RealPower
>=
defender
.
RealPower
&&
defender
.
IsAttack
())
||
(
attacker
.
RealPower
>
defender
.
RealPower
&&
!
GetZoneCards
(
CardLocation
.
MonsterZone
,
Bot
).
Any
(
c
=>
c
!=
null
&&
!
c
.
IsCode
(
79575620
)
&&
c
.
IsAttack
()
&&
(
c
.
Attack
>
defender
.
RealPower
||
(
c
.
IsCode
(
new
[]
{
37043180
,
70074904
})
&&
defender
.
RealPower
-
c
.
Attack
<
Bot
.
LifePoints
-
2000
))
&&
ChkCard
.
attacked
[
GetSequence
(
c
)]
!=
c
.
Id
)
&&
defender
.
IsDefense
()
&&
defender
.
IsFaceup
()))
{
attacked
[
GetSequence
(
attacker
)]
=
attacker
.
Id
;
ChkCard
.
attacked
[
GetSequence
(
attacker
)]
=
attacker
.
Id
;
return
AI
.
Attack
(
attacker
,
defender
);
}
}
...
...
@@ -105,7 +109,7 @@ namespace WindBot.Game.AI.Decks
if
(
attacker
.
RealPower
>
defender
.
RealPower
||
(
attacker
.
RealPower
>=
defender
.
RealPower
&&
attacker
.
IsLastAttacker
&&
defender
.
IsAttack
()))
{
attacked
[
GetSequence
(
attacker
)]
=
attacker
.
Id
;
ChkCard
.
attacked
[
GetSequence
(
attacker
)]
=
attacker
.
Id
;
return
AI
.
Attack
(
attacker
,
defender
);
}
}
...
...
@@ -192,7 +196,7 @@ namespace WindBot.Game.AI.Decks
}
case
74131780
:
{
return
Util
.
CheckSelectCount
(
cards
.
Where
(
card
=>
card
!=
null
&&
card
.
Controller
==
1
&&
!
cards
.
Any
(
c
=>
c
!=
null
&&
c
ard
.
Controller
==
1
&&
c
.
Attack
>
card
.
Attack
)).
ToList
(),
cards
,
min
,
max
);
return
Util
.
CheckSelectCount
(
cards
.
Where
(
card
=>
card
!=
null
&&
card
.
Controller
==
1
&&
!
cards
.
Any
(
c
=>
c
!=
null
&&
c
.
Controller
==
1
&&
c
.
Attack
>
card
.
Attack
)).
ToList
(),
cards
,
min
,
max
);
}
case
79571449
:
{
...
...
@@ -298,9 +302,9 @@ namespace WindBot.Game.AI.Decks
}
}
}
if
(
chk_release_summon
)
if
(
ChkCard
.
chk_release_summon
)
{
chk_release_summon
=
false
;
ChkCard
.
chk_release_summon
=
false
;
List
<
ClientCard
>
res
=
cards
.
Where
(
card
=>
card
!=
null
&&
!
card
.
IsCode
(
new
[]
{
79575620
,
97017120
,
74131780
})).
ToList
();
if
(
Bot
.
LifePoints
<=
2000
&&
cards
.
Any
(
card
=>
card
!=
null
&&
!
card
.
IsCode
(
79575620
)))
res
.
AddRange
(
cards
.
Where
(
card
=>
card
!=
null
&&
!
card
.
IsCode
(
79575620
)).
ToList
());
res
=
res
.
Where
(
card
=>
card
!=
null
&&
!
res
.
Any
(
c
=>
c
!=
null
&&
c
.
Attack
<
card
.
Attack
)).
ToList
();
...
...
@@ -376,7 +380,7 @@ namespace WindBot.Game.AI.Decks
{
if
(
Enemy
.
GetSpellCount
()
==
0
)
{
if
((
Duel
.
Phase
==
DuelPhase
.
Main2
||
!
Duel
.
MainPhase
.
CanBattlePhase
)
||
((
changePosInTurn
[
GetSequence
(
Card
)]
==
Card
.
Id
||
summonInTurn
==
Card
.
Id
)
&&
!
Card
.
IsAttack
())
||
!
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Any
(
card
=>
card
!=
null
&&
card
.
GetDefensePower
()
<
Card
.
Attack
))
if
((
Duel
.
Phase
==
DuelPhase
.
Main2
||
!
Duel
.
MainPhase
.
CanBattlePhase
)
||
((
ChkCard
.
changePosInTurn
[
GetSequence
(
Card
)]
==
Card
.
Id
||
ChkCard
.
summonInTurn
==
Card
.
Id
)
&&
!
Card
.
IsAttack
())
||
!
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Any
(
card
=>
card
!=
null
&&
card
.
GetDefensePower
()
<
Card
.
Attack
))
return
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Any
(
card
=>
card
!=
null
&&
!
card
.
IsShouldNotBeTarget
());
}
else
...
...
@@ -466,12 +470,12 @@ namespace WindBot.Game.AI.Decks
{
if
(
Card
.
IsCode
(
74131780
)
&&
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Any
(
card
=>
card
!=
null
&&
!
card
.
IsShouldNotBeTarget
()))
{
summonInTurn
=
Card
.
Id
;
ChkCard
.
summonInTurn
=
Card
.
Id
;
return
true
;
}
if
(
Card
.
IsCode
(
new
[]
{
37043180
,
70074904
})
&&
Bot
.
GetMonsterCount
()
>=
Enemy
.
GetMonsterCount
()
-
1
)
{
summonInTurn
=
Card
.
Id
;
ChkCard
.
summonInTurn
=
Card
.
Id
;
return
true
;
}
}
...
...
@@ -483,7 +487,7 @@ namespace WindBot.Game.AI.Decks
{
if
((
GetZoneCards
(
CardLocation
.
SpellZone
,
Enemy
).
Any
(
card
=>
card
!=
null
&&
!
card
.
IsShouldNotBeTarget
()
&&
card
.
IsFacedown
())
||
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Any
(
card
=>
card
!=
null
&&
!
card
.
IsShouldNotBeTarget
()
&&
card
.
IsFacedown
()))
&&
GetZoneCards
(
CardLocation
.
MonsterZone
,
Bot
).
Any
(
card
=>
card
!=
null
&&
(!
card
.
IsCode
(
new
[]
{
79575620
,
97017120
,
74131780
})
||
(
Bot
.
LifePoints
<=
2000
&&
card
.
IsCode
(
79575620
)))))
{
chk_release_summon
=
true
;
ChkCard
.
chk_release_summon
=
true
;
return
true
;
}
List
<
ClientCard
>
g
=
GetZoneCards
(
CardLocation
.
MonsterZone
,
Bot
).
Where
(
c
=>
c
!=
null
&&
!
c
.
IsCode
(
new
[]
{
73915052
,
73915053
,
73915054
,
73915055
})).
ToList
();
...
...
@@ -492,7 +496,7 @@ namespace WindBot.Game.AI.Decks
if
(
Bot
.
LifePoints
>
2000
&&
g
[
0
].
IsCode
(
79575620
))
atk
=
g
[
1
].
Attack
;
if
(
Enemy
.
LifePoints
>
Util
.
GetBestAttack
(
Bot
)
&&
Enemy
.
LifePoints
-
Util
.
GetBestAttack
(
Bot
)
<=
2400
-
atk
&&
Enemy
.
GetMonsterCount
()
==
0
&&
!
GetZoneCards
(
CardLocation
.
Hand
,
Bot
).
Any
(
c
=>
c
!=
null
&&
c
.
Level
<
5
&&
c
.
HasType
(
CardType
.
Monster
))
&&
Duel
.
MainPhase
.
CanBattlePhase
&&
GetZoneCards
(
CardLocation
.
SpellZone
,
Bot
).
Any
(
c
=>
c
!=
null
&&
!
c
.
IsShouldNotBeTarget
()
&&
!
c
.
IsFaceup
()))
{
chk_release_summon
=
true
;
ChkCard
.
chk_release_summon
=
true
;
return
true
;
}
return
false
;
...
...
@@ -510,7 +514,7 @@ namespace WindBot.Game.AI.Decks
return
false
;
}
}
summonInTurn
=
Card
.
Id
;
ChkCard
.
summonInTurn
=
Card
.
Id
;
return
true
;
}
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