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

2022/10/31 更改传说卡判断逻辑

parent 635a0066
Pipeline #17657 passed with stages
in 6 minutes and 20 seconds
-- Rush Duel 编号
RushDuel = RushDuel or {}
LEGEND_MONSTER = 120000000
LEGEND_SPELL = 120000001
LEGEND_TRAP = 120000002
LEGEND_DARK_MAGICIAN = {120130000, 120203015}
LEGEND_BLUE_EYES_WHITE_DRAGON = {120120000, 120198001, 120230001}
LEGEND_RED_EYES_BLACK_DRAGON = {120125001, 120203016, 120229101}
......@@ -17,13 +20,18 @@ function RushDuel.AddCodeList(card, ...)
end
end
-- 条件: 是否为传说卡
-- 条件: 当前卡名是否为传说卡
function RushDuel.IsLegend(card)
return card:IsCode(LEGEND_MONSTER, LEGEND_SPELL, LEGEND_TRAP)
end
-- 条件: 是否为传说卡的卡名
function RushDuel.IsLegendCode(card, ...)
for _, list in ipairs {...} do
local type = aux.GetValueType(list)
if type == "number" and card:GetOriginalCode() == list and card:IsCode(120000000) then
for _, item in ipairs {...} do
local type = aux.GetValueType(item)
if type == "number" and RushDuel.IsLegend(card) and card:GetOriginalCode() == item then
return true
elseif type == "table" and RushDuel.IsLegendCode(card, table.unpack(list)) then
elseif type == "table" and RushDuel.IsLegendCode(card, table.unpack(item)) then
return true
end
end
......@@ -32,7 +40,7 @@ end
-- 条件: 是否为同名卡
function RushDuel.IsSameCode(card1, card2)
if (card1:IsCode(120000000) or card2:IsCode(120000000)) then
if (RushDuel.IsLegend(card1) or RushDuel.IsLegend(card2)) then
return card1:GetOriginalCode() == card2:GetOriginalCode()
else
return card1:IsCode(card2:GetCode())
......
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