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
078ad579
Commit
078ad579
authored
Sep 18, 2024
by
Tang Xinwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "发牌姬第二期AI智力修复:盖谜题、时间魔术师、链接召唤过滤、宝箱怪逻辑"
This reverts commit
7e8bc837
.
parent
7e8bc837
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
679 additions
and
828 deletions
+679
-828
Game/AI/DefaultExecutor.cs
Game/AI/DefaultExecutor.cs
+665
-811
Game/GameAI.cs
Game/GameAI.cs
+14
-17
No files found.
Game/AI/DefaultExecutor.cs
View file @
078ad579
This diff is collapsed.
Click to expand it.
Game/GameAI.cs
View file @
078ad579
using
System.Linq
;
using
System.Collections.Generic
;
using
System.Threading
;
using
WindBot.Game.AI
;
using
YGOSharp.OCGWrapper.Enums
;
using
System
;
using
System.Threading
;
namespace
WindBot.Game
{
...
...
@@ -50,6 +49,9 @@ namespace WindBot.Game
public
void
OnDeckError
(
string
card
)
{
_dialogs
.
SendDeckSorry
(
card
);
Thread
.
Sleep
(
1000
);
_dialogs
.
SendSurrender
();
Game
.
Connection
.
Close
();
}
/// <summary>
...
...
@@ -235,10 +237,10 @@ namespace WindBot.Game
if
(
result
!=
null
)
return
result
;
if
(
attackers
.
Count
==
0
)
//如果自己场上没有可以攻击的怪兽直接返回
if
(
attackers
.
Count
==
0
)
return
ToMainPhase2
();
if
(
defenders
.
Count
==
0
)
//如果对方场上没有怪兽则直接攻击
if
(
defenders
.
Count
==
0
)
{
// Attack with the monster with the lowest attack first
ClientCard
attacker
=
attackers
[
attackers
.
Count
-
1
];
...
...
@@ -246,17 +248,17 @@ namespace WindBot.Game
}
else
{
for
(
int
k
=
0
;
k
<
attackers
.
Count
;
++
k
)
//如果对方场上有怪兽
for
(
int
k
=
0
;
k
<
attackers
.
Count
;
++
k
)
{
ClientCard
attacker
=
attackers
[
k
];
attacker
.
IsLastAttacker
=
(
k
==
attackers
.
Count
-
1
);
result
=
Executor
.
OnSelectAttackTarget
(
attacker
,
defenders
);
//这个函数决定是否要攻击
result
=
Executor
.
OnSelectAttackTarget
(
attacker
,
defenders
);
if
(
result
!=
null
)
return
result
;
}
}
if
(!
battle
.
CanMainPhaseTwo
)
//如果不能进战阶强制攻击
if
(!
battle
.
CanMainPhaseTwo
)
return
Attack
(
attackers
[
0
],
(
defenders
.
Count
==
0
)
?
null
:
defenders
[
0
]);
return
ToMainPhase2
();
...
...
@@ -754,7 +756,7 @@ namespace WindBot.Game
sorted
.
Sort
(
CardContainer
.
CompareCardAttack
);
IList
<
ClientCard
>
selected
=
new
List
<
ClientCard
>();
for
(
int
i
=
0
;
i
<
min
&&
i
<
sorted
.
Count
;
++
i
)
selected
.
Add
(
sorted
[
i
]);
...
...
@@ -1172,15 +1174,10 @@ namespace WindBot.Game
if
(!
Executor
.
OnPreActivate
(
card
))
return
false
;
}
Func
<
bool
>
Func
=
()
=>
{
if
(
Executor
.
FuncFilters
.
ContainsKey
(
exec
.
Type
)
&&
Executor
.
FuncFilters
[
exec
.
Type
]
!=
null
&&
!
Executor
.
FuncFilters
[
exec
.
Type
]())
return
false
;
return
exec
.
Func
==
null
||
exec
.
Func
();
};
bool
result
=
card
!=
null
&&
exec
.
Type
==
type
&&
(
exec
.
CardId
==
-
1
||
exec
.
CardId
==
card
.
Id
)
&&
Func
();
if
(
card
.
Id
!=
0
&&
type
==
ExecutorType
.
Activate
&&
result
)
bool
result
=
card
!=
null
&&
exec
.
Type
==
type
&&
(
exec
.
CardId
==
-
1
||
exec
.
CardId
==
card
.
Id
)
&&
(
exec
.
Func
==
null
||
exec
.
Func
());
if
(
card
.
Id
!=
0
&&
type
==
ExecutorType
.
Activate
&&
result
)
{
int
count
=
card
.
IsDisabled
()
?
3
:
1
;
if
(!
_activatedCards
.
ContainsKey
(
card
.
Id
))
...
...
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