Commit 718ddddf authored by 未闻皂名's avatar 未闻皂名

2023/6/17 新增:风帝,调整部分代码

parent ce19226f
No preview for this file type
-- 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}
-- 添加记述卡牌列表
function RushDuel.AddCodeList(card, ...)
for _, list in ipairs {...} do
local type = aux.GetValueType(list)
if type == "number" then
aux.AddCodeList(card, list)
elseif type == "table" then
aux.AddCodeList(card, table.unpack(list))
end
end
end
-- 条件: 当前卡名是否为传说卡
function RushDuel.IsLegend(card)
return card:IsCode(LEGEND_MONSTER, LEGEND_SPELL, LEGEND_TRAP)
end
-- 条件: 是否为传说卡
function RushDuel.IsLegendCard(card)
return card:IsHasEffect(EFFECT_LEGEND_CARD)
end
-- 条件: 是否为传说卡的卡名
function RushDuel.IsLegendCode(card, ...)
local code = RushDuel.GetCardCode(card)
return RushDuel.FlatCheck(function(item)
return code == item
end, ...)
end
-- 获取卡牌的密码
function RushDuel.GetCardCode(card)
local code = card:GetCode()
if RushDuel.IsLegendCard(card) then
code = card:GetOriginalCode()
end
local codes = RushDuel.GetEffectValues(card, EFFECT_CHANGE_CODE)
for _, val in ipairs(codes) do
code = val
end
return code
end
-- 条件: 是否为同名卡
function RushDuel.IsSameCode(card1, card2)
return RushDuel.GetCardCode(card1) == RushDuel.GetCardCode(card2)
end
-- 条件: 是否卡名不同
function RushDuel.IsDifferentCode(card1, card2)
return RushDuel.GetCardCode(card1) ~= RushDuel.GetCardCode(card2)
end
......@@ -122,7 +122,7 @@ end
function RushDuel.SendToDeckSort(target, sequence, reason, sort_player, target_player)
local g = RushDuel.ToMaximunGroup(target)
if sequence == 1 and g:GetCount() > 1 then
Duel.SendtoDeck(g, nil, 0, reason)
Duel.SendtoDeck(g, nil, SEQ_DECKTOP, reason)
else
Duel.SendtoDeck(g, nil, sequence, reason)
end
......
......@@ -138,7 +138,7 @@ function RushDuel.MaximumLeaveOperation(e, tp, eg, ep, ev, re, r, rp)
if loc == LOCATION_HAND then
Duel.SendtoHand(g, nil, REASON_RULE)
elseif loc == LOCATION_DECK then
Duel.SendtoDeck(g, nil, 2, REASON_RULE)
Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_RULE)
elseif loc == LOCATION_REMOVED then
Duel.Remove(g, POS_FACEUP, REASON_RULE)
end
......
......@@ -25,7 +25,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local sg=g:RandomSelect(tp,1)
if sg:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoDeck(sg,nil,1,REASON_EFFECT)
Duel.SendtoDeck(sg,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
end
end
end
\ No newline at end of file
......@@ -21,7 +21,7 @@ end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_FZONE,0,1,nil) end
local g=Duel.GetMatchingGroup(cm.costfilter,tp,LOCATION_FZONE,0,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -29,7 +29,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:SelectSubGroup(tp,cm.costcheck,false,3,3,tp)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,0,REASON_COST)
Duel.SendtoDeck(sg,nil,SEQ_DECKTOP,REASON_COST)
local option=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK)
Duel.SortDecktop(tp,tp,ct)
......
......@@ -39,7 +39,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
local sg=g:RandomSelect(1-tp,1)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
--Event
......
......@@ -29,6 +29,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc and tc:IsRelateToBattle() then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
\ No newline at end of file
......@@ -31,7 +31,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc and tc:IsRelateToBattle() and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0
if tc and tc:IsRelateToBattle() and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0
and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
Duel.Damage(1-tp,600,REASON_EFFECT)
end
......
......@@ -28,6 +28,6 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_HAND,nil)
if g:GetCount()>0 then
local sg=g:RandomSelect(tp,1)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
\ No newline at end of file
......@@ -3,7 +3,7 @@ local cm=_G["c"..m]
cm.name="贤帝 威廉"
function cm.initial_effect(c)
--Advance Flag
RushDuel.CreateAdvanceSummonFlag(c,20244016)
RD.CreateAdvanceSummonFlag(c,20244016)
--Destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
......
......@@ -3,7 +3,7 @@ local cm=_G["c"..m]
cm.name="星帝 艾斯特罗姆"
function cm.initial_effect(c)
--Advance Flag
RushDuel.CreateAdvanceSummonFlag(c,20244017)
RD.CreateAdvanceSummonFlag(c,20244017)
--Destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
......
......@@ -5,7 +5,7 @@ function cm.initial_effect(c)
--Summon Procedure
RD.AddSummonProcedure(c,aux.Stringid(m,0),cm.sumcon,cm.sumop,SUMMON_TYPE_ADVANCE)
--Advance Flag
RushDuel.CreateAdvanceSummonFlag(c,20244018)
RD.CreateAdvanceSummonFlag(c,20244018)
--Destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
......
......@@ -5,7 +5,7 @@ function cm.initial_effect(c)
--Summon Procedure
RD.AddSummonProcedure(c,aux.Stringid(m,0),cm.sumcon,cm.sumop,SUMMON_TYPE_ADVANCE)
--Advance Flag
RushDuel.CreateAdvanceSummonFlag(c,20244019)
RD.CreateAdvanceSummonFlag(c,20244019)
--Destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
......
......@@ -3,7 +3,7 @@ local cm=_G["c"..m]
cm.name="雷帝 扎博尔格"
function cm.initial_effect(c)
--Advance Flag
RushDuel.CreateAdvanceSummonFlag(c,20244020)
RD.CreateAdvanceSummonFlag(c,20244020)
--Destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
......
......@@ -36,7 +36,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local mg=g:SelectWithSumEqual(tp,Card.GetLevel,tc:GetLevel(),1,g:GetCount())
if Duel.SendtoGrave(mg,REASON_EFFECT)~=0 then
RushDuel.AttachOpponentTribute(e,tc,20244046,aux.Stringid(m,1),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,RESET_PHASE+PHASE_END)
RD.AttachOpponentTribute(e,tc,20244046,aux.Stringid(m,1),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,RESET_PHASE+PHASE_END)
end
end)
end
\ No newline at end of file
local m=120247064
local cm=_G["c"..m]
cm.name="风帝 莱扎"
function cm.initial_effect(c)
--Advance Flag
RD.CreateAdvanceSummonFlag(c,20247064)
--Destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Destroy
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return RD.IsSummonTurn(c) and c:GetFlagEffect(20247064)~=0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_TODECK,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,function(g)
local tc=g:GetFirst()
RD.SendToDeckTop(tc,tp,tc:GetOwner(),true)
end)
end
\ No newline at end of file
......@@ -3,7 +3,7 @@ local cm=_G["c"..m]
cm.name="炎帝 泰斯塔罗斯"
function cm.initial_effect(c)
--Advance Flag
RushDuel.CreateAdvanceSummonFlag(c,20248001)
RD.CreateAdvanceSummonFlag(c,20248001)
--Destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
......
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