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

2021/9/12 新增:KP07新卡,修复选择多只怪兽回到卡组下面的条件,选择额外卡组怪兽排序错误的bug

parent 005382b4
No preview for this file type
......@@ -26,8 +26,9 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE,0,4,4,nil)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,0,REASON_COST)
Duel.SortDecktop(tp,tp,4)
for i=1,4 do
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK)
Duel.SortDecktop(tp,tp,ct)
for i=1,ct do
local tc=Duel.GetDecktopGroup(tp,1):GetFirst()
Duel.MoveSequence(tc,1)
end
......
......@@ -26,8 +26,9 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,3,3)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,0,REASON_COST)
Duel.SortDecktop(tp,tp,3)
for i=1,3 do
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK)
Duel.SortDecktop(tp,tp,ct)
for i=1,ct do
local tc=Duel.GetDecktopGroup(tp,1):GetFirst()
Duel.MoveSequence(tc,1)
end
......
......@@ -34,8 +34,9 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local sg=g:SelectSubGroup(tp,cm.costcheck,false,2,2,e,tp)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,0,REASON_COST)
Duel.SortDecktop(tp,tp,2)
for i=1,2 do
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK)
Duel.SortDecktop(tp,tp,ct)
for i=1,ct do
local tc=Duel.GetDecktopGroup(tp,1):GetFirst()
Duel.MoveSequence(tc,1)
end
......
......@@ -23,8 +23,9 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE,0,4,4,nil)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,0,REASON_COST)
Duel.SortDecktop(tp,tp,4)
for i=1,4 do
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK)
Duel.SortDecktop(tp,tp,ct)
for i=1,ct do
local tc=Duel.GetDecktopGroup(tp,1):GetFirst()
Duel.MoveSequence(tc,1)
end
......
......@@ -31,8 +31,9 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local sg=g:SelectSubGroup(tp,cm.costcheck,false,2,2,e,tp)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,0,REASON_COST)
Duel.SortDecktop(tp,tp,2)
for i=1,2 do
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK)
Duel.SortDecktop(tp,tp,ct)
for i=1,ct do
local tc=Duel.GetDecktopGroup(tp,1):GetFirst()
Duel.MoveSequence(tc,1)
end
......
......@@ -31,8 +31,9 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local sg=g:SelectSubGroup(tp,cm.costcheck,false,2,2,tp)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,0,REASON_COST)
Duel.SortDecktop(tp,tp,2)
for i=1,2 do
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK)
Duel.SortDecktop(tp,tp,ct)
for i=1,ct do
local tc=Duel.GetDecktopGroup(tp,1):GetFirst()
Duel.MoveSequence(tc,1)
end
......
......@@ -30,8 +30,9 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,0,REASON_COST)
Duel.SortDecktop(tp,tp,2)
for i=1,2 do
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK)
Duel.SortDecktop(tp,tp,ct)
for i=1,ct do
local tg=Duel.GetDecktopGroup(tp,1)
Duel.MoveSequence(tg:GetFirst(),1)
end
......
local m=120196023
local list={120110004,120110008,120196050}
local cm=_G["c"..m]
cm.name="月轮龙 暗影蓝瑟龙F"
cm.name="月轮龙 本影枪骑兵F"
function cm.initial_effect(c)
aux.AddCodeList(c,list[1],list[2])
--Fusion Material
......
local m=120199019
local cm=_G["c"..m]
cm.name="槲寄生纳米粒子机"
function cm.initial_effect(c)
--To Hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION+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
--To Hand
function cm.confilter1(c)
return c:IsRace(RACE_CYBERSE)
end
function cm.confilter2(c)
return c:IsType(TYPE_MONSTER) and not cm.confilter1(c)
end
function cm.thfilter(c)
return c:IsRace(RACE_CYBERSE) and c:IsAbleToHand()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(cm.confilter1,tp,LOCATION_GRAVE,0,nil)==3
and not Duel.IsExistingMatchingCard(cm.confilter2,tp,LOCATION_GRAVE,0,1,nil)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_GRAVE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_GRAVE,0,nil)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SendtoDeck(c,nil,1,REASON_EFFECT)
end
end
end
\ No newline at end of file
local m=120199020
local list={120155024}
local cm=_G["c"..m]
cm.name="幻刃天龙 门式起重龙"
function cm.initial_effect(c)
aux.AddCodeList(c,list[1])
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
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
--Special Summon
function cm.spfilter(c,e,tp)
return c:IsCode(list[1]) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
if Duel.GetFlagEffect(tp,m)~=0 then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(cm.atktg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--Hint
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e2:SetTargetRange(1,0)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.atktg(e,c)
return not c:IsRace(RACE_WYRM)
end
\ No newline at end of file
local m=120199044
local cm=_G["c"..m]
cm.name="奇装天铠"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
--Activate
function cm.costfilter(c)
return c:IsLevelAbove(7) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.thfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsAbleToHand()
end
function cm.costcheck(g,tp)
return g:GetClassCount(Card.GetRace,nil)==g:GetCount()
and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,g)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.costfilter,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return g:CheckSubGroup(cm.costcheck,3,3,tp) end
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)
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK)
Duel.SortDecktop(tp,tp,ct)
for i=1,ct do
local tc=Duel.GetDecktopGroup(tp,1):GetFirst()
Duel.MoveSequence(tc,1)
end
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
if Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2))
local sg=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
if sg:GetCount()>0 then
Duel.BreakEffect()
Duel.HintSelection(sg)
local tc=sg:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-1500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
end
end
\ No newline at end of file
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