Commit afe6f015 authored by POLYMER's avatar POLYMER

fix

parent 05add4ed
...@@ -115,7 +115,7 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp) ...@@ -115,7 +115,7 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.filter(c,tp) function cm.filter(c,tp)
return c:IsCode(11451631) and not c:IsForbidden() and c:CheckUniqueOnField(tp) and (c:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0 or (Duel.IsPlayerAffectedByEffect(tp,11451676) and Duel.GetLocationCount(1-tp,LOCATION_SZONE)>0)) and c:GetActivateEffect():IsActivatable(tp,true,true) return c:IsCode(11451631) and not c:IsForbidden() and c:CheckUniqueOnField(tp) and (c:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0 or Duel.IsPlayerAffectedByEffect(tp,11451676)) and c:GetActivateEffect():IsActivatable(tp,true,true)
end end
function cm.filter0(c) function cm.filter0(c)
return c:IsCanBeFusionMaterial() --and (not c:IsLocation(LOCATION_REMOVED) or c:IsFaceup()) return c:IsCanBeFusionMaterial() --and (not c:IsLocation(LOCATION_REMOVED) or c:IsFaceup())
...@@ -223,7 +223,20 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -223,7 +223,20 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end end
Duel.SendtoGrave(mat2,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION+REASON_RETURN) Duel.SendtoGrave(mat2,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION+REASON_RETURN)
Duel.BreakEffect() Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) local le={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_SPECIAL_SUMMON)}
local lex={Duel.IsPlayerAffectedByEffect(tp,EFFECT_LIMIT_SPECIAL_SUMMON_POSITION)}
for _,v in pairs(lex) do table.insert(le,v) end
local ret1,ret2={},{}
for _,v in pairs(le) do
local tg=v:GetTarget()
if not tg then tg=aux.TRUE end
table.insert(ret1,v)
table.insert(ret2,tg)
v:SetTarget(cm.chtg(tg,e))
end
Duel.SpecialSummonStep(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
for i=1,#ret1 do ret1[i]:SetTarget(ret2[i]) end
Duel.SpecialSummonComplete()
else else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf) local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation() local fop=ce:GetOperation()
...@@ -232,6 +245,12 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -232,6 +245,12 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
tc:CompleteProcedure() tc:CompleteProcedure()
end end
end end
function cm.chtg(_tg,re)
return function(e,c,sump,sumtype,sumpos,targetp,se)
if se==re then return false end
return _tg(e,c,sump,sumtype,sumpos,targetp,se)
end
end
function cm.actfilter(c,se) function cm.actfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end if not (se==nil or c:GetReasonEffect()~=se) then return false end
local code1,code2=c:GetPreviousCodeOnField() local code1,code2=c:GetPreviousCodeOnField()
...@@ -264,6 +283,22 @@ end ...@@ -264,6 +283,22 @@ end
function cm.destg2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.destg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) end if chk==0 then return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) end
end end
function cm.GetCardsInZone(tp,fd)
if fd==0x400020 then return Duel.GetFieldCard(tp,LOCATION_MZONE,5) or Duel.GetFieldCard(1-tp,LOCATION_MZONE,6) end
if fd==0x200040 then return Duel.GetFieldCard(tp,LOCATION_MZONE,6) or Duel.GetFieldCard(1-tp,LOCATION_MZONE,5) end
local seq=math.log(fd,2)
local p=tp
if seq>=16 then
p=1-tp
seq=seq-16
end
local loc=LOCATION_MZONE
if seq>=8 then
loc=LOCATION_SZONE
seq=seq-8
end
return Duel.GetFieldCard(p,loc,math.floor(seq+0.5))
end
function cm.desop2(e,tp,eg,ep,ev,re,r,rp) function cm.desop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp)
...@@ -283,8 +318,12 @@ function cm.desop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -283,8 +318,12 @@ function cm.desop2(e,tp,eg,ep,ev,re,r,rp)
if tc:IsType(TYPE_FIELD) then if tc:IsType(TYPE_FIELD) then
local fc=Duel.GetFieldCard(sp,LOCATION_FZONE,0) local fc=Duel.GetFieldCard(sp,LOCATION_FZONE,0)
if fc then if fc then
Duel.SendtoGrave(fc,REASON_RULE) if Duel.IsPlayerAffectedByEffect(tp,11451676) then
Duel.BreakEffect() Duel.Destroy(fc,REASON_RULE)
else
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
end end
Duel.MoveToField(tc,tp,sp,LOCATION_FZONE,POS_FACEUP,true) Duel.MoveToField(tc,tp,sp,LOCATION_FZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect() local te=tc:GetActivateEffect()
...@@ -293,7 +332,20 @@ function cm.desop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -293,7 +332,20 @@ function cm.desop2(e,tp,eg,ep,ev,re,r,rp)
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain()) Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
else else
Duel.MoveToField(tc,tp,sp,LOCATION_SZONE,POS_FACEUP,true) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451675,0))
local fd=0xff
if Duel.IsPlayerAffectedByEffect(tp,11451676) then
if sp==tp then
fd=Duel.SelectField(tp,1,LOCATION_SZONE,0,0x20002000)
else
fd=Duel.SelectField(tp,1,0,LOCATION_SZONE,0x20002000)
end
local fc=cm.GetCardsInZone(tp,fd)
if fc then Duel.Destroy(fc,REASON_RULE) end
fd=fd>>8
if sp~=tp then fd=fd>>16 end
end
Duel.MoveToField(tc,tp,sp,LOCATION_SZONE,POS_FACEUP,true,fd)
local te=tc:GetActivateEffect() local te=tc:GetActivateEffect()
local tep=tc:GetControler() local tep=tc:GetControler()
local cost=te:GetCost() local cost=te:GetCost()
...@@ -302,67 +354,30 @@ function cm.desop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -302,67 +354,30 @@ function cm.desop2(e,tp,eg,ep,ev,re,r,rp)
else else
if tc:IsType(TYPE_FIELD) then if tc:IsType(TYPE_FIELD) then
local fc=Duel.GetFieldCard(sp,LOCATION_FZONE,0) local fc=Duel.GetFieldCard(sp,LOCATION_FZONE,0)
if fc then if fc and Duel.IsPlayerAffectedByEffect(tp,11451676) then
Duel.SendtoGrave(fc,REASON_RULE) Duel.Destroy(fc,REASON_RULE)
Duel.BreakEffect()
end end
Duel.SSet(tp,tc,sp) Duel.SSet(tp,tc,sp)
else else
Duel.SSet(tp,tc,sp) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451675,0))
end local fd=0xff
end if Duel.IsPlayerAffectedByEffect(tp,11451676) then
end if sp==tp then
end fd=Duel.SelectField(tp,1,LOCATION_SZONE,0,0x20002000)
function cm.desop2(e,tp,eg,ep,ev,re,r,rp) else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD) fd=Duel.SelectField(tp,1,0,LOCATION_SZONE,0x20002000)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp) end
local tc=g:GetFirst() local fc=cm.GetCardsInZone(tp,fd)
if tc then if fc then Duel.Destroy(fc,REASON_RULE) end
local sp=1-tp fd=fd>>8
if not Duel.IsPlayerAffectedByEffect(tp,11451676) or (not tc:IsType(TYPE_FIELD) and Duel.GetLocationCount(1-tp,LOCATION_SZONE)<=0) or ((tc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) and Duel.SelectOption(tp,aux.Stringid(11451631,3),aux.Stringid(11451631,4))==0) then sp=tp end if sp~=tp then fd=fd>>16 end
if tc:IsType(TYPE_FIELD) then end
local fc=Duel.GetFieldCard(sp,LOCATION_FZONE,0) Duel.MoveToField(tc,tp,sp,LOCATION_SZONE,POS_FACEDOWN,false,fd)
if fc then Duel.ConfirmCards(1-sp,tc)
Duel.SendtoGrave(fc,REASON_RULE) tc:SetStatus(STATUS_SET_TURN,true)
Duel.BreakEffect() Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,ev)
end end
Duel.MoveToField(tc,tp,sp,LOCATION_FZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
else
Duel.MoveToField(tc,tp,sp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
end end
--[[local te=tc:GetActivateEffect()
if te:IsActivatable(tp,true,true) and (not tc:CheckActivateEffect(false,false,false) or Duel.SelectOption(tp,aux.Stringid(11451631,3),aux.Stringid(11451631,4))==0) then
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
else
local fc=Duel.GetFieldCard(1-tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,1-tp,LOCATION_FZONE,POS_FACEUP,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end--]]
end end
end end
......
--北极天熊 --北极天熊
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--spsummon condition --spsummon condition
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--special summon rule --special summon rule
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA) e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(s.sprcon) e2:SetCondition(s.sprcon)
e2:SetOperation(s.sprop) e2:SetOperation(s.sprop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--grave effect --grave effect
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN) e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE) e3:SetRange(LOCATION_GRAVE)
e3:SetHintTiming(0,TIMING_MAIN_END) e3:SetHintTiming(0,TIMING_MAIN_END)
e3:SetCountLimit(1,id) e3:SetCountLimit(1,id)
e3:SetCondition(s.condition) e3:SetCondition(s.condition)
e3:SetCost(s.cost) e3:SetCost(s.cost)
e3:SetOperation(s.operation) e3:SetOperation(s.operation)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--release replace --release replace
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(id) e4:SetCode(id)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_SET_AVAILABLE) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_SET_AVAILABLE)
e4:SetRange(LOCATION_EXTRA) e4:SetRange(LOCATION_EXTRA)
e4:SetCountLimit(1,id+o*10000) e4:SetCountLimit(1,id+o*10000)
c:RegisterEffect(e4) c:RegisterEffect(e4)
if not s.Ursarctic_check then if not s.Ursarctic_check then
s.Ursarctic_check=true s.Ursarctic_check=true
aux.UrsarcticSpSummonCost=s.UrsarcticSpSummonCost aux.UrsarcticSpSummonCost=s.UrsarcticSpSummonCost
local rg=Duel.GetMatchingGroup(Card.IsOriginalSetCard,tp,0xff,0xff,nil,0x163) local rg=Duel.GetMatchingGroup(Card.IsOriginalSetCard,tp,0xff,0xff,nil,0x163)
for tc in aux.Next(rg) do for tc in aux.Next(rg) do
if tc.initial_effect then if tc.initial_effect then
local Ursarctic_initial_effect=s.initial_effect local Ursarctic_initial_effect=s.initial_effect
s.initial_effect=function() end s.initial_effect=function() end
tc:ReplaceEffect(id,0) tc:ReplaceEffect(id,0)
s.initial_effect=Ursarctic_initial_effect s.initial_effect=Ursarctic_initial_effect
tc.initial_effect(tc) tc.initial_effect(tc)
end end
end end
end end
end end
function s.tgrfilter(c) function s.tgrfilter(c)
return c:IsFaceup() and c:IsLevelAbove(1) and c:IsAbleToGraveAsCost() return c:IsFaceup() and c:IsLevelAbove(1) and c:IsAbleToGraveAsCost()
end end
function s.mnfilter(c,g) function s.mnfilter(c,g)
return g:IsExists(s.mnfilter2,1,c,c) return g:IsExists(s.mnfilter2,1,c,c)
end end
function s.mnfilter2(c,mc) function s.mnfilter2(c,mc)
return c:GetLevel()-mc:GetLevel()==1 return c:GetLevel()-mc:GetLevel()==1
end end
function s.fselect(g,tp,sc) function s.fselect(g,tp,sc)
return g:GetCount()==2 return g:GetCount()==2
and g:IsExists(Card.IsType,1,nil,TYPE_TUNER) and g:IsExists(aux.NOT(Card.IsType),1,nil,TYPE_TUNER) and g:IsExists(Card.IsType,1,nil,TYPE_TUNER) and g:IsExists(aux.NOT(Card.IsType),1,nil,TYPE_TUNER)
and g:IsExists(s.mnfilter,1,nil,g) and g:IsExists(s.mnfilter,1,nil,g)
and Duel.GetLocationCountFromEx(tp,tp,g,sc)>0 and Duel.GetLocationCountFromEx(tp,tp,g,sc)>0
end end
function s.sprcon(e,c) function s.sprcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local g=Duel.GetMatchingGroup(s.tgrfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(s.tgrfilter,tp,LOCATION_MZONE,0,nil)
return g:CheckSubGroup(s.fselect,2,2,tp,c) return g:CheckSubGroup(s.fselect,2,2,tp,c)
end end
function s.sprop(e,tp,eg,ep,ev,re,r,rp,c) function s.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(s.tgrfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(s.tgrfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=g:SelectSubGroup(tp,s.fselect,false,2,2,tp,c) local tg=g:SelectSubGroup(tp,s.fselect,false,2,2,tp,c)
Duel.SendtoGrave(tg,REASON_COST) Duel.SendtoGrave(tg,REASON_COST)
end end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsSetCard(0x163) and c:IsType(TYPE_SYNCHRO) and c:IsLevel(1) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) return c:IsSetCard(0x163) and c:IsType(TYPE_SYNCHRO) and c:IsLevel(1) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end end
function s.setfilter(c) function s.setfilter(c)
return c:IsSetCard(0x163) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() return c:IsSetCard(0x163) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end end
function s.rfilter1(c,tp) function s.rfilter1(c,tp)
return c:IsLevelAbove(7) and c:IsReleasable() and Duel.GetLocationCountFromEx(tp,tp,c)>0 return c:IsLevelAbove(7) and c:IsReleasable() and Duel.GetLocationCountFromEx(tp,tp,c)>0
end end
function s.rfilter2(c) function s.rfilter2(c)
return c:IsLevelAbove(7) and c:IsReleasable() return c:IsLevelAbove(7) and c:IsReleasable()
end end
function s.excostfilter(c,tp) function s.excostfilter(c,tp)
return c:IsAbleToRemove() and (c:IsHasEffect(16471775,tp) or c:IsHasEffect(s,tp)) return c:IsAbleToRemove() and (c:IsHasEffect(16471775,tp) or c:IsHasEffect(89264428,tp) or c:IsHasEffect(s,tp))
end end
function s.condition(e,tp,eg,ep,ev,re,r,rp) function s.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
local b1=Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) local b1=Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
and (Duel.IsExistingMatchingCard(s.rfilter1,tp,LOCATION_MZONE+LOCATION_HAND,0,1,nil,tp) and (Duel.IsExistingMatchingCard(s.rfilter1,tp,LOCATION_MZONE+LOCATION_HAND,0,1,nil,tp)
or (Duel.IsExistingMatchingCard(s.excostfilter,tp,LOCATION_GRAVE,0,1,nil,tp) and Duel.GetLocationCountFromEx(tp)>0)) or (Duel.IsExistingMatchingCard(s.excostfilter,tp,LOCATION_GRAVE,0,1,nil,tp) and Duel.GetLocationCountFromEx(tp)>0))
local b2=Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) local b2=Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil)
and (Duel.IsExistingMatchingCard(s.rfilter2,tp,LOCATION_MZONE+LOCATION_HAND,0,1,nil) and (Duel.IsExistingMatchingCard(s.rfilter2,tp,LOCATION_MZONE+LOCATION_HAND,0,1,nil)
or Duel.IsExistingMatchingCard(s.excostfilter,tp,LOCATION_GRAVE,0,1,nil,tp)) or Duel.IsExistingMatchingCard(s.excostfilter,tp,LOCATION_GRAVE,0,1,nil,tp))
return (ph==PHASE_MAIN1 or ph==PHASE_MAIN2) and (b1 or b2) return (ph==PHASE_MAIN1 or ph==PHASE_MAIN2) and (b1 or b2)
end end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetMatchingGroup(s.rfilter2,tp,LOCATION_MZONE+LOCATION_HAND,0,nil) local g1=Duel.GetMatchingGroup(s.rfilter2,tp,LOCATION_MZONE+LOCATION_HAND,0,nil)
local g2=Duel.GetMatchingGroup(s.excostfilter,tp,LOCATION_GRAVE,0,nil,tp) local g2=Duel.GetMatchingGroup(s.excostfilter,tp,LOCATION_GRAVE,0,nil,tp)
g1:Merge(g2) g1:Merge(g2)
if chk==0 then return #g1>0 and e:GetHandler():IsAbleToRemoveAsCost() end if chk==0 then return #g1>0 and e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g1:Select(tp,1,1,nil) local rg=g1:Select(tp,1,1,nil)
local tc=rg:GetFirst() local tc=rg:GetFirst()
local te=tc:IsHasEffect(16471775,tp) or tc:IsHasEffect(89264428,tp) local te=tc:IsHasEffect(16471775,tp) or tc:IsHasEffect(89264428,tp)
if te then if te then
te:UseCountLimit(tp) te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE) Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
else else
aux.UseExtraReleaseCount(rg,tp) aux.UseExtraReleaseCount(rg,tp)
Duel.Release(tc,REASON_COST) Duel.Release(tc,REASON_COST)
end end
end end
function s.cfilter(c) function s.cfilter(c)
return not c:IsLevelAbove(0) and c:IsFaceup() return not c:IsLevelAbove(0) and c:IsFaceup()
end end
function s.operation(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) local b1=Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) local b2=Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil)
local op=0 local op=0
if b1 and b2 then if b1 and b2 then
if Duel.IsExistingMatchingCard(s.cfilter,tp,0,LOCATION_MZONE,1,nil) then if Duel.IsExistingMatchingCard(s.cfilter,tp,0,LOCATION_MZONE,1,nil) then
op=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2)) op=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2))
else else
op=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1)) op=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1))
end end
elseif b1 then elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(id,0)) op=Duel.SelectOption(tp,aux.Stringid(id,0))
else else
op=Duel.SelectOption(tp,aux.Stringid(id,1))+1 op=Duel.SelectOption(tp,aux.Stringid(id,1))+1
end end
if op~=1 then if op~=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local sg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEUP)
end end
if op~=0 then if op~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sc=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst() local sc=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
Duel.SSet(tp,sc) Duel.SSet(tp,sc)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN) e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1) sc:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_QP_ACT_IN_SET_TURN) e2:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
sc:RegisterEffect(e2) sc:RegisterEffect(e2)
end end
end end
function s.excostfilter2(c,tp) function s.excostfilter2(c,tp)
return c:IsAbleToGraveAsCost() and (c:IsHasEffect(31400083,tp) or c:IsHasEffect(id,tp)) return c:IsAbleToGraveAsCost() and (c:IsHasEffect(31400083,tp) or c:IsHasEffect(id,tp))
end end
function s.UrsarcticSpSummonCost(e,tp,eg,ep,ev,re,r,rp,chk) function s.UrsarcticSpSummonCost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetReleaseGroup(tp,true):Filter(Auxiliary.UrsarcticReleaseFilter,e:GetHandler()) local g1=Duel.GetReleaseGroup(tp,true):Filter(Auxiliary.UrsarcticReleaseFilter,e:GetHandler())
local g2=Duel.GetMatchingGroup(Auxiliary.UrsarcticExCostFilter,tp,LOCATION_GRAVE,0,nil,tp) local g2=Duel.GetMatchingGroup(Auxiliary.UrsarcticExCostFilter,tp,LOCATION_GRAVE,0,nil,tp)
local g3=Duel.GetMatchingGroup(s.excostfilter2,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,tp) local g3=Duel.GetMatchingGroup(s.excostfilter2,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,tp)
g1:Merge(g2) g1:Merge(g2)
g1:Merge(g3) g1:Merge(g3)
if chk==0 then return g1:GetCount()>0 end if chk==0 then return g1:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local tc=g1:Select(tp,1,1,nil):GetFirst() local tc=g1:Select(tp,1,1,nil):GetFirst()
local te1=tc:IsHasEffect(16471775,tp) or tc:IsHasEffect(89264428,tp) local te1=tc:IsHasEffect(16471775,tp) or tc:IsHasEffect(89264428,tp)
local te2=tc:IsHasEffect(31400083,tp) or tc:IsHasEffect(id,tp) local te2=tc:IsHasEffect(31400083,tp) or tc:IsHasEffect(id,tp)
if te1 then if te1 then
te1:UseCountLimit(tp) te1:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE) Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
elseif te2 then elseif te2 then
te2:UseCountLimit(tp) te2:UseCountLimit(tp)
Duel.SendtoGrave(tc,REASON_COST) Duel.SendtoGrave(tc,REASON_COST)
else else
Duel.Release(tc,REASON_COST) Duel.Release(tc,REASON_COST)
end end
end end
...@@ -10,16 +10,17 @@ function c28324124.initial_effect(c) ...@@ -10,16 +10,17 @@ function c28324124.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c28324124.target(e,tp,eg,ep,ev,re,r,rp,chk) function c28324124.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local exc=e:IsHasType(EFFECT_TYPE_ACTIVATE) and e:GetHandler() or nil
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,0,1,c) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,0,1,exc) end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(aux.FALSE) Duel.SetChainLimit(aux.FALSE)
end end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_ONFIELD) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_ONFIELD)
end end
function c28324124.activate(e,tp,eg,ep,ev,re,r,rp) function c28324124.activate(e,tp,eg,ep,ev,re,r,rp)
local exc=e:IsHasType(EFFECT_TYPE_ACTIVATE) and aux.ExceptThisCard(e) or nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,0,1,1,aux.ExceptThisCard(e)) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,0,1,1,exc)
if g:GetCount()==0 then return end if g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local gg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_GRAVE,0,0,1,nil) local gg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_GRAVE,0,0,1,nil)
......
...@@ -42,11 +42,11 @@ function s.sumop(e,tp,eg,ep,ev,re,r,rp) ...@@ -42,11 +42,11 @@ function s.sumop(e,tp,eg,ep,ev,re,r,rp)
if v:GetRange()&0x10a~=0 then if v:GetRange()&0x10a~=0 then
local e1=v:Clone() local e1=v:Clone()
e1:SetRange(LOCATION_REMOVED) e1:SetRange(LOCATION_REMOVED)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1,true) tc:RegisterEffect(e1,true)
local e2=SNNM.Act(tc,e1) local e2=SNNM.Act(tc,e1)
e2:SetRange(LOCATION_REMOVED) e2:SetRange(LOCATION_REMOVED)
e2:SetReset(RESET_PHASE+PHASE_END) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2,true) tc:RegisterEffect(e2,true)
end end
end end
......
...@@ -18,7 +18,7 @@ function c9911720.initial_effect(c) ...@@ -18,7 +18,7 @@ function c9911720.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetOperation(c9911720.regop) e2:SetOperation(c9911720.regop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--destroy --remove
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_REMOVE) e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
...@@ -26,7 +26,6 @@ function c9911720.initial_effect(c) ...@@ -26,7 +26,6 @@ function c9911720.initial_effect(c)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCountLimit(1)
e3:SetCondition(c9911720.rmcon) e3:SetCondition(c9911720.rmcon)
e3:SetCost(c9911720.rmcost) e3:SetCost(c9911720.rmcost)
e3:SetTarget(c9911720.rmtg) e3:SetTarget(c9911720.rmtg)
......
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