Commit b3261868 authored by Nemo Ma's avatar Nemo Ma

fix

parent 0cbcf6e2
--诡雷战术 补给接力
--21.04.22
local m=11451564
local cm=_G["c"..m]
local cm,m=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
......@@ -70,21 +69,20 @@ function cm.trtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.trop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_ONFIELD,0,nil)
local ct=0
if #g>0 and Duel.SendtoDeck(g,nil,2,REASON_EFFECT)>0 then
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK)
if ct>1 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(ct)
e1:SetCondition(cm.thcon)
e1:SetOperation(cm.thop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(ct)
e1:SetCondition(cm.thcon)
e1:SetOperation(cm.thop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.thfilter(c)
return c:IsSetCard(0x97e) and (c:IsAbleToHand() or c:IsAbleToDeck())
......@@ -94,13 +92,16 @@ function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local rg=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,nil)
local sg=rg:FilterSelect(tp,Card.IsAbleToHand,1,e:GetLabel()-1,nil)
if #sg>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
rg:Sub(sg)
local ct=e:GetLabel()
if ct>1 and rg:IsExists(Card.IsAbleToHand,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local sg=rg:FilterSelect(tp,Card.IsAbleToHand,1,ct-1,nil)
if #sg>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
rg:Sub(sg)
end
end
Duel.SendtoDeck(rg,nil,2,REASON_EFFECT)
end
\ No newline at end of file
......@@ -38,6 +38,11 @@ function cm.initial_effect(c)
--c:RegisterEffect(e6)
end
--Effect 1
function cm.tun(c,e)
local b1=c:IsLevelAbove(1) and not c:IsImmuneToEffect(e)
and not c:IsType(TYPE_TUNER)
return b1 and c:IsFaceup() and (c:IsSetCard(0x87af) or ((_G["c"..c:GetCode()]and _G["c"..c:GetCode()].named_with_Arknight)))
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(nil,tp,LOCATION_PZONE,0,1,e:GetHandler())
end
......@@ -74,11 +79,6 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.tun(c,e)
return not c:IsImmuneToEffect(e)
and not c:IsType(TYPE_TUNER)
and c:IsFaceup() and (c:IsSetCard(0x87af) or ((_G["c"..c:GetCode()]and _G["c"..c:GetCode()].named_with_Arknight)))
end
--Effect 2
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tp1=e:GetHandler():GetControler()
......
......@@ -77,12 +77,7 @@ function c26692740.adjustop(e,tp,eg,ep,ev,re,r,rp)
local eff=effect:Clone()
local eff2=effect:Clone()
local op=eff:GetOperation()
local tg=eff:GetTarget()
eff:SetValue(26692740)
eff:SetTarget(
function(e,tp,eg,ep,ev,re,r,rp)
tg(e,tp,eg,ep,ev,re,r,1-tp)
end)
eff:SetOperation(
function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,26692740)
......
--终焉邪魂 入魔邪龙 卡利特
function c30000033.initial_effect(c)
local m=30000033
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
......@@ -13,42 +15,42 @@ function c30000033.initial_effect(c)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCondition(c30000033.spcon)
e2:SetOperation(c30000033.spop)
e2:SetCondition(cm.spcon)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--Set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(30000033,0))
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(c30000033.cost)
e3:SetCondition(c30000033.spcon1)
e3:SetTarget(c30000033.target)
e3:SetOperation(c30000033.operation)
e3:SetCost(cm.cost)
e3:SetCondition(cm.spcon1)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetHintTiming(0,TIMING_END_PHASE)
e4:SetCondition(c30000033.spcon2)
e4:SetCondition(cm.spcon2)
c:RegisterEffect(e4)
--wudi
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(30000033,1))
e5:SetDescription(aux.Stringid(m,1))
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCondition(c30000033.spcon1)
e5:SetCost(c30000033.cost2)
e5:SetOperation(c30000033.operation2)
e5:SetCondition(cm.spcon1)
e5:SetCost(cm.cost2)
e5:SetOperation(cm.operation2)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetHintTiming(0,TIMING_END_PHASE)
e6:SetCondition(c30000033.spcon2)
e6:SetCondition(cm.spcon2)
c:RegisterEffect(e6)
--Activate
local e7=Effect.CreateEffect(c)
......@@ -56,16 +58,16 @@ function c30000033.initial_effect(c)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e7:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e7:SetCode(EVENT_REMOVE)
e7:SetCountLimit(1,30000033)
e7:SetCondition(c30000033.con0)
e7:SetTarget(c30000033.target0)
e7:SetOperation(c30000033.activate)
e7:SetCountLimit(1,m)
e7:SetCondition(cm.con0)
e7:SetTarget(cm.target0)
e7:SetOperation(cm.activate)
c:RegisterEffect(e7)
end
function c30000033.con0(e,tp,eg,ep,ev,re,r,rp)
function cm.con0(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c30000033.target0(e,tp,eg,ep,ev,re,r,rp,chk)
function cm.target0(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,3) and Duel.IsPlayerCanRemove(tp) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(3)
......@@ -73,58 +75,63 @@ function c30000033.target0(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,3)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,tp,2)
end
function c30000033.activate(e,tp,eg,ep,ev,re,r,rp)
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)==3 and Duel.IsPlayerCanRemove(p) then
Duel.ShuffleHand(p)
Duel.BreakEffect()
local reg=Duel.SelectMatchingCard(p,Card.IsAbleToRemove,tp,LOCATION_HAND,0,2,2,nil)
Duel.Remove(reg,POS_FACEUP,REASON_EFFECT)
if e:GetLabel()==1 and Duel.IsPlayerCanDraw(p,tp,1) and Duel.SelectYesNo(p,aux.Stringid(30000033,3)) then
if e:GetLabel()==1 and Duel.IsPlayerCanDraw(p,tp,1) and Duel.SelectYesNo(p,aux.Stringid(m,3)) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function c30000033.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
function cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() or Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)==0 end
if Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)==0 and Duel.SelectYesNo(tp,aux.Stringid(30000033,2)) then
if Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)==0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
local mm=Group.CreateGroup()
else
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
end
function c30000033.operation2(e,tp,eg,ep,ev,re,r,rp)
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_INACTIVATE)
e1:SetValue(c30000033.effectfilter)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,30000033,RESET_PHASE+PHASE_END,0,1)
end
function c30000033.effectfilter(e,ct)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_INACTIVATE)
e1:SetValue(cm.effectfilter)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_DISEFFECT)
e2:SetValue(cm.effectfilter)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function cm.effectfilter(e,ct)
local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
return te:GetHandlerPlayer()==e:GetHandlerPlayer()
end
function c30000033.spcfil(c,tp)
function cm.spcfil(c,tp)
return Duel.GetMZoneCount(tp,c)>0 and c:IsAbleToRemoveAsCost()
end
function c30000033.spcon(e,c)
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local count=Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_GRAVE,0,c)
local rg=Duel.GetMatchingGroup(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,c)
return count==0 and rg:GetCount()>4 and rg:IsExists(c30000033.spcfil,1,nil,tp)
return count==0 and rg:GetCount()>4 and rg:IsExists(cm.spcfil,1,nil,tp)
end
function c30000033.spop(e,tp,eg,ep,ev,re,r,rp,c)
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local sg=Group.CreateGroup()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
sg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,5,5,c)
elseif Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then
local g1=Duel.SelectMatchingCard(tp,c30000033.spcfil,tp,LOCATION_MZONE,0,1,1,nil,tp)
local g1=Duel.SelectMatchingCard(tp,cm.spcfil,tp,LOCATION_MZONE,0,1,1,nil,tp)
g1:AddCard(c)
local g2=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,4,4,g1)
g1:RemoveCard(c)
......@@ -134,38 +141,37 @@ function c30000033.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c30000033.spcon1(e,tp,eg,ep,ev,re,r,rp)
function cm.spcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,30000010)
end
function c30000033.spcon2(e,tp,eg,ep,ev,re,r,rp)
function cm.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,30000010)
end
function c30000033.filter2(c)
function cm.filter2(c)
return c:IsAbleToRemoveAsCost()
end
function c30000033.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c30000033.filter2,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil) end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c30000033.filter2,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,cm.filter2,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c30000033.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_REMOVED)
function cm.thfilter(c)
return c:IsDefenseBelow(8000) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and (c:IsFaceup() or c:IsLocation(LOCATION_DECK)) and c:IsAbleToHand()
end
function c30000033.thfilter(c)
return c:IsDefenseBelow(8000) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToHand()
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_REMOVED)
end
function c30000033.operation(e,tp,eg,ep,ev,re,r,rp)
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c30000033.thfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
end
......@@ -49,7 +49,9 @@ function cm.rtop(e,tp,eg,ep,ev,re,r,rp)
end
--Effect 2
function cm.filter5(c,tp)
return c:IsCanOverlay() and ((Duel.GetMZoneCount(tp,c)>0 and c:IsControler(tp)) or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsControlerCanBeChanged() and c:IsControler(1-tp))
return c:IsCanOverlay()
and ((Duel.GetMZoneCount(tp,c)>0 and c:IsControler(tp))
or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsControlerCanBeChanged() and c:IsControler(1-tp)))
end
function cm.stg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
......@@ -62,9 +64,11 @@ function cm.stg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function cm.sop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc:IsImmuneToEffect(e) and c:IsRelateToEffect(e)
and tc:IsRelateToEffect(e) and ((Duel.GetMZoneCount(tp,c)>0 and c:IsControler(tp)) or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsControlerCanBeChanged() and c:IsControler(1-tp)) then
local tc=Duel.GetFirstTarget()
if not tc:IsImmuneToEffect(e) and c:IsRelateToEffect(e)
and tc:IsRelateToEffect(e)
and((Duel.GetMZoneCount(tp,tc)>0 and tc:IsControler(tp))
or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsControlerCanBeChanged() and tc:IsControler(1-tp))) then
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -74,11 +74,12 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,tc)
end
if Duel.IsExistingMatchingCard(cm.thfilter2,tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_REMOVED,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,0))
local g=Duel.SelectMatchingCard(tp,cm.thfilter2,tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_REMOVED,0,1,1,nil)
local tc=g:GetFirst()
if #g>0 then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,0))
local g=Duel.SelectMatchingCard(tp,cm.thfilter2,tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_REMOVED,0,1,1,nil)
local tc=g:GetFirst()
if #g>0 then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
end
......
......@@ -38,7 +38,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
g:ForEach(Card.ResetEffect,EFFECT_PUBLIC,RESET_CODE)
local ct=g:FilterCount(cm.filter,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local sg=Duel.SelectMatchingCard(tp,cm.disfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
local sg=Duel.SelectMatchingCard(tp,cm.disfilter,tp,0,LOCATION_ONFIELD,1,ct,nil)
if #sg==0 then return end
Duel.HintSelection(sg)
local c=e:GetHandler()
......
......@@ -97,20 +97,19 @@ function c67200287.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Release(g,REASON_COST)
end
--
function c67200287.spfilter2(c,tp,mc)
return Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0 and c:IsSetCard(0x674) and c:IsReleasable() and c:IsFaceup()
function c67200287.spfilter2(c,tp,spsummoncard)
return Duel.GetLocationCountFromEx(tp,tp,c,spsummoncard)>0 and c:IsSetCard(0x674) and c:IsReleasable() and c:IsFaceup()
end
function c67200287.spcon2(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(c67200287.spfilter2,tp,LOCATION_ONFIELD,0,nil)
return g:IsExists(c67200287.spfilter2,1,nil,tp,g)
local g=Duel.GetMatchingGroup(c67200287.spfilter2,tp,LOCATION_ONFIELD,0,nil,tp,c)
return #g>0
end
function c67200287.spop2(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c67200287.spfilter2,tp,LOCATION_ONFIELD,0,nil,c)
local g=Duel.GetMatchingGroup(c67200287.spfilter2,tp,LOCATION_ONFIELD,0,nil,tp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g1=g:FilterSelect(tp,c67200287.spfilter2,1,1,nil,tp,g)
local g1=g:Select(tp,1,1,nil)
Duel.Release(g1,REASON_COST)
end
--
......
......@@ -61,6 +61,7 @@ function c67200353.cfilter(c,sp)
return c:IsSummonPlayer(sp)
end
function c67200353.exctcon(e,tp,eg,ep,ev,re,r,rp)
if #eg~=1 then return false end
return eg:IsExists(c67200353.cfilter,1,nil,1-tp)
end
function c67200353.ctfilter(c,tp)
......
......@@ -2,67 +2,71 @@
local m=89389003
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SUMMON+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetCondition(cm.actcon)
c:RegisterEffect(e2)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SUMMON+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetCondition(cm.actcon)
c:RegisterEffect(e2)
end
function cm.sumfilter(c,e)
return c:IsSetCard(0x108a) and (c:IsSummonable(true,e) or c:IsMSetable(true, e))
function cm.sumfilter(c)
return c:IsSetCard(0x108a) and (c:IsSummonable(true,nil) or c:IsMSetable(true,nil))
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0x108a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsSetCard(0x108a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsCanTurnSet() then
Duel.BreakEffect()
c:CancelToGrave()
Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
local b1=Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(cm.sumfilter,tp,LOCATION_HAND,0,1,nil,e)
local b2=Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
local ops={}
local off=1
if b1 then
ops[off]=aux.Stringid(m,0)
off=off+1
end
if b2 then
ops[off]=aux.Stringid(m,1)
off=off+1
end
ops[off]=aux.Stringid(m,2)
local op=Duel.SelectOption(tp,table.unpack(ops))
if op==0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.sumfilter,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
local s1=tc and tc:IsSummonable(true,nil)
local s2=tc and tc:IsMSetable(true,nil)
if (s1 and s2 and Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
Duel.Summon(tp,tc,true,nil)
else
Duel.MSet(tp,tc,true,nil)
end
elseif op==1 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsCanTurnSet() then
Duel.BreakEffect()
c:CancelToGrave()
Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
local b1=Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(cm.sumfilter,tp,LOCATION_HAND,0,1,nil)
local b2=Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
local ops,opval={},{}
local off=1
if b1 then
ops[off]=aux.Stringid(m,0)
opval[off]=0
off=off+1
end
if b2 then
ops[off]=aux.Stringid(m,1)
opval[off]=1
off=off+1
end
ops[off]=aux.Stringid(m,2)
opval[off]=2
local op=Duel.SelectOption(tp,table.unpack(ops))+1
local sel=opval[op]
if sel==0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.sumfilter,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
local s1=tc and tc:IsSummonable(true,nil)
local s2=tc and tc:IsMSetable(true,nil)
if (s1 and s2 and Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
Duel.Summon(tp,tc,true,nil)
else
Duel.MSet(tp,tc,true,nil)
end
elseif sel==1 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function cm.actcon(e)
return not Duel.IsExistingMatchingCard(Card.IsType,e:GetHandlerPlayer(),LOCATION_GRAVE,0,1,nil,TYPE_TRAP)
return not Duel.IsExistingMatchingCard(Card.IsType,e:GetHandlerPlayer(),LOCATION_GRAVE,0,1,nil,TYPE_TRAP)
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