Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-rush-duel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
5
Issues
5
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
MyCard
ygopro-rush-duel
Commits
b1f96ae6
Commit
b1f96ae6
authored
Dec 01, 2023
by
未闻皂名
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2023/12/1 添加多选一代价的条件
parent
cd9757f5
Pipeline
#24217
passed with stages
in 16 minutes and 10 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
83 deletions
+89
-83
script/RDCondition.lua
script/RDCondition.lua
+5
-0
script/RDLegend.lua
script/RDLegend.lua
+84
-83
No files found.
script/RDCondition.lua
View file @
b1f96ae6
...
...
@@ -187,3 +187,8 @@ end
function
RushDuel
.
IsOperatedGroupExists
(
filter
,
count
,
expect
)
return
filter
==
nil
or
Duel
.
GetOperatedGroup
():
IsExists
(
filter
,
count
,
expect
)
end
-- 条件: 卡片组全部满足条件与数量
function
RushDuel
.
GroupAllCount
(
group
,
filter
,
count
,
...
)
return
group
:
GetCount
()
==
count
and
group
:
FilterCount
(
filter
,
nil
,
...
)
==
count
end
\ No newline at end of file
script/RDLegend.lua
View file @
b1f96ae6
-- Rush Duel 编号
RushDuel
=
RushDuel
or
{}
LEGEND_MONSTER
=
120000000
LEGEND_SPELL
=
120000001
LEGEND_TRAP
=
120000002
RushDuel
.
LegendCodes
=
{
-- 青眼白龙
{
120120000
,
120198001
,
120231001
},
-- 真红眼黑龙
{
120125001
,
120203016
,
120229101
},
-- 黑魔术师
{
120130000
,
120203015
,
120254001
},
-- 死者苏生
{
120194004
,
120195004
},
-- 天使的施舍
{
120196049
,
120195005
},
-- 海龙-泰达路斯
{
120199000
,
120239060
}
}
-- 初始化传说卡
function
RushDuel
.
InitLegend
()
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsCode
,
0
,
0xff
,
0xff
,
nil
,
LEGEND_MONSTER
,
LEGEND_SPELL
,
LEGEND_TRAP
)
g
:
ForEach
(
function
(
c
)
local
code
=
RushDuel
.
GetLegendCode
(
c
:
GetOriginalCode
())
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_LEGEND_CARD
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
+
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
+
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetRange
(
0xff
)
e1
:
SetValue
(
code
)
c
:
RegisterEffect
(
e1
,
true
)
-- 修改卡牌数据 (删除同名卡:传说卡)
c
:
SetEntityCode
(
code
,
true
)
end
)
end
-- 获取传说卡原卡名
function
RushDuel
.
GetLegendCode
(
code
)
for
_
,
codes
in
ipairs
(
RushDuel
.
LegendCodes
)
do
for
_
,
legend_code
in
ipairs
(
codes
)
do
if
(
code
==
legend_code
)
then
return
codes
[
1
]
end
end
end
return
code
end
-- 条件: 是否为传说卡
function
RushDuel
.
IsLegendCard
(
card
)
return
card
:
IsHasEffect
(
EFFECT_LEGEND_CARD
)
end
-- 条件: 是否为同名卡
function
RushDuel
.
IsSameCode
(
card1
,
card2
)
return
card1
:
IsLinkCode
(
card2
:
GetLinkCode
())
end
-- 永续改变卡名
function
RushDuel
.
EnableChangeCode
(
c
,
code
,
location
,
condition
)
Auxiliary
.
AddCodeList
(
c
,
code
)
local
loc
=
c
:
GetOriginalType
()
&
TYPE_MONSTER
~=
0
and
LOCATION_MZONE
or
LOCATION_SZONE
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CHANGE_CODE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
location
or
loc
)
if
condition
~=
nil
then
e1
:
SetCondition
(
condition
)
end
e1
:
SetValue
(
code
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_ADD_LINK_CODE
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e1
:
Clone
()
e3
:
SetCode
(
EFFECT_ADD_FUSION_CODE
)
c
:
RegisterEffect
(
e3
)
return
e1
,
e2
,
e3
end
-- Rush Duel 编号
RushDuel
=
RushDuel
or
{}
LEGEND_MONSTER
=
120000000
LEGEND_SPELL
=
120000001
LEGEND_TRAP
=
120000002
RushDuel
.
LegendCodes
=
{
-- 青眼白龙
{
120120000
,
120198001
,
120231001
},
-- 真红眼黑龙
{
120125001
,
120203016
,
120229101
},
-- 黑魔术师
{
120130000
,
120203015
,
120254001
},
-- 死者苏生
{
120194004
,
120195004
},
-- 天使的施舍
{
120196049
,
120195005
},
-- 海龙-泰达路斯
{
120199000
,
120239060
}
}
-- 初始化传说卡
function
RushDuel
.
InitLegend
()
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsCode
,
0
,
0xff
,
0xff
,
nil
,
LEGEND_MONSTER
,
LEGEND_SPELL
,
LEGEND_TRAP
)
g
:
ForEach
(
RushDuel
.
InitLegendCard
)
end
function
RushDuel
.
InitLegendCard
(
c
)
local
code
=
RushDuel
.
GetLegendCode
(
c
:
GetOriginalCode
())
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_LEGEND_CARD
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
+
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
+
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetRange
(
0xff
)
e1
:
SetValue
(
code
)
c
:
RegisterEffect
(
e1
,
true
)
-- 修改卡牌数据 (删除同名卡:传说卡)
c
:
SetEntityCode
(
code
,
true
)
end
-- 获取传说卡原卡名
function
RushDuel
.
GetLegendCode
(
code
)
for
_
,
codes
in
ipairs
(
RushDuel
.
LegendCodes
)
do
for
_
,
legend_code
in
ipairs
(
codes
)
do
if
(
code
==
legend_code
)
then
return
codes
[
1
]
end
end
end
return
code
end
-- 条件: 是否为传说卡
function
RushDuel
.
IsLegendCard
(
card
)
return
card
:
IsHasEffect
(
EFFECT_LEGEND_CARD
)
end
-- 条件: 是否为同名卡
function
RushDuel
.
IsSameCode
(
card1
,
card2
)
return
card1
:
IsLinkCode
(
card2
:
GetLinkCode
())
end
-- 永续改变卡名
function
RushDuel
.
EnableChangeCode
(
c
,
code
,
location
,
condition
)
Auxiliary
.
AddCodeList
(
c
,
code
)
local
loc
=
c
:
GetOriginalType
()
&
TYPE_MONSTER
~=
0
and
LOCATION_MZONE
or
LOCATION_SZONE
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CHANGE_CODE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
location
or
loc
)
if
condition
~=
nil
then
e1
:
SetCondition
(
condition
)
end
e1
:
SetValue
(
code
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_ADD_LINK_CODE
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e1
:
Clone
()
e3
:
SetCode
(
EFFECT_ADD_FUSION_CODE
)
c
:
RegisterEffect
(
e3
)
return
e1
,
e2
,
e3
end
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