Commit b1f96ae6 authored by 未闻皂名's avatar 未闻皂名

2023/12/1 添加多选一代价的条件

parent cd9757f5
Pipeline #24217 passed with stages
in 16 minutes and 10 seconds
...@@ -187,3 +187,8 @@ end ...@@ -187,3 +187,8 @@ end
function RushDuel.IsOperatedGroupExists(filter, count, expect) function RushDuel.IsOperatedGroupExists(filter, count, expect)
return filter == nil or Duel.GetOperatedGroup():IsExists(filter, count, expect) return filter == nil or Duel.GetOperatedGroup():IsExists(filter, count, expect)
end end
-- 条件: 卡片组全部满足条件与数量
function RushDuel.GroupAllCount(group, filter, count, ...)
return group:GetCount() == count and group:FilterCount(filter, nil, ...) == count
end
\ No newline at end of file
-- Rush Duel 编号 -- Rush Duel 编号
RushDuel = RushDuel or {} RushDuel = RushDuel or {}
LEGEND_MONSTER = 120000000 LEGEND_MONSTER = 120000000
LEGEND_SPELL = 120000001 LEGEND_SPELL = 120000001
LEGEND_TRAP = 120000002 LEGEND_TRAP = 120000002
RushDuel.LegendCodes = { RushDuel.LegendCodes = {
-- 青眼白龙 -- 青眼白龙
{120120000, 120198001, 120231001}, {120120000, 120198001, 120231001},
-- 真红眼黑龙 -- 真红眼黑龙
{120125001, 120203016, 120229101}, {120125001, 120203016, 120229101},
-- 黑魔术师 -- 黑魔术师
{120130000, 120203015, 120254001}, {120130000, 120203015, 120254001},
-- 死者苏生 -- 死者苏生
{120194004, 120195004}, {120194004, 120195004},
-- 天使的施舍 -- 天使的施舍
{120196049, 120195005}, {120196049, 120195005},
-- 海龙-泰达路斯 -- 海龙-泰达路斯
{120199000, 120239060} {120199000, 120239060}
} }
-- 初始化传说卡 -- 初始化传说卡
function RushDuel.InitLegend() function RushDuel.InitLegend()
local g = Duel.GetMatchingGroup(Card.IsCode, 0, 0xff, 0xff, nil, LEGEND_MONSTER, LEGEND_SPELL, LEGEND_TRAP) local g = Duel.GetMatchingGroup(Card.IsCode, 0, 0xff, 0xff, nil, LEGEND_MONSTER, LEGEND_SPELL, LEGEND_TRAP)
g:ForEach(function(c) g:ForEach(RushDuel.InitLegendCard)
local code = RushDuel.GetLegendCode(c:GetOriginalCode()) end
local e1 = Effect.CreateEffect(c) function RushDuel.InitLegendCard(c)
e1:SetType(EFFECT_TYPE_SINGLE) local code = RushDuel.GetLegendCode(c:GetOriginalCode())
e1:SetCode(EFFECT_LEGEND_CARD) local e1 = Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_SET_AVAILABLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetRange(0xff) e1:SetCode(EFFECT_LEGEND_CARD)
e1:SetValue(code) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_SET_AVAILABLE)
c:RegisterEffect(e1, true) e1:SetRange(0xff)
-- 修改卡牌数据 (删除同名卡:传说卡) e1:SetValue(code)
c:SetEntityCode(code, true) c:RegisterEffect(e1, true)
end) -- 修改卡牌数据 (删除同名卡:传说卡)
end c:SetEntityCode(code, true)
end
-- 获取传说卡原卡名
function RushDuel.GetLegendCode(code) -- 获取传说卡原卡名
for _, codes in ipairs(RushDuel.LegendCodes) do function RushDuel.GetLegendCode(code)
for _, legend_code in ipairs(codes) do for _, codes in ipairs(RushDuel.LegendCodes) do
if (code == legend_code) then for _, legend_code in ipairs(codes) do
return codes[1] if (code == legend_code) then
end return codes[1]
end end
end end
return code end
end return code
end
-- 条件: 是否为传说卡
function RushDuel.IsLegendCard(card) -- 条件: 是否为传说卡
return card:IsHasEffect(EFFECT_LEGEND_CARD) function RushDuel.IsLegendCard(card)
end return card:IsHasEffect(EFFECT_LEGEND_CARD)
end
-- 条件: 是否为同名卡
function RushDuel.IsSameCode(card1, card2) -- 条件: 是否为同名卡
return card1:IsLinkCode(card2:GetLinkCode()) function RushDuel.IsSameCode(card1, card2)
end return card1:IsLinkCode(card2:GetLinkCode())
end
-- 永续改变卡名
function RushDuel.EnableChangeCode(c, code, location, condition) -- 永续改变卡名
Auxiliary.AddCodeList(c, code) function RushDuel.EnableChangeCode(c, code, location, condition)
local loc = c:GetOriginalType() & TYPE_MONSTER ~= 0 and LOCATION_MZONE or LOCATION_SZONE Auxiliary.AddCodeList(c, code)
local e1 = Effect.CreateEffect(c) local loc = c:GetOriginalType() & TYPE_MONSTER ~= 0 and LOCATION_MZONE or LOCATION_SZONE
e1:SetType(EFFECT_TYPE_SINGLE) local e1 = Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_CODE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(location or loc) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
if condition ~= nil then e1:SetRange(location or loc)
e1:SetCondition(condition) if condition ~= nil then
end e1:SetCondition(condition)
e1:SetValue(code) end
c:RegisterEffect(e1) e1:SetValue(code)
local e2 = e1:Clone() c:RegisterEffect(e1)
e2:SetCode(EFFECT_ADD_LINK_CODE) local e2 = e1:Clone()
c:RegisterEffect(e2) e2:SetCode(EFFECT_ADD_LINK_CODE)
local e3 = e1:Clone() c:RegisterEffect(e2)
e3:SetCode(EFFECT_ADD_FUSION_CODE) local e3 = e1:Clone()
c:RegisterEffect(e3) e3:SetCode(EFFECT_ADD_FUSION_CODE)
return e1, e2, e3 c:RegisterEffect(e3)
end return e1, e2, e3
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment