Commit 691c1fdf authored by Nemo Ma's avatar Nemo Ma

fix

parent 5a8a79e7
......@@ -13,24 +13,25 @@ function cm.initial_effect(c)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.cfilter(c,tp)
function cm.cfilter(c,tp,ac)
local cg=c:GetColumnGroup()
local dg=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,cg,tp)
local dg=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,ac,cg,tp)
return c:IsFaceup() and c:IsSetCard(0x18b) and #dg>0
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.desfilter(c,g,tp)
function cm.desfilter(c,g)
return g:IsContains(c)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ac=e:GetHandler()
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and cm.mfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.cfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.cfilter,tp,LOCATION_MZONE,0,1,nil,tp,ac) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
local g=Duel.SelectTarget(tp,cm.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,ac)
local cg=g:GetFirst():GetColumnGroup()
local dg=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,cg,tp)
local dg=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,ac,cg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,#dg,0,0)
end
function cm.checkfilter(c)
......@@ -38,10 +39,11 @@ function cm.checkfilter(c)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ac=aux.ExceptThisCard(e)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local cg=tc:GetColumnGroup()
local dg=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,cg)
local dg=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,ac,cg)
if #dg>0 and Duel.Destroy(dg,REASON_EFFECT)>0 and Duel.IsExistingMatchingCard(cm.checkfilter,tp,LOCATION_ONFIELD,0,1,nil) then
local g=Duel.GetOperatedGroup():Filter(Card.IsControler,nil,1-tp)
Duel.BreakEffect()
......
......@@ -5,7 +5,7 @@ function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,cm.lfilter,2)
local e1=rsef.QO(c,nil,{m,0},nil,"sp",nil,LOCATION_EXTRA,cm.spcon,cm.spcost,rsop.target(aux.TRUE,"sp"),cm.spop)
local e2=rsef.STO(c,EVENT_SPSUMMON_SUCCESS,{m,1},nil,"sp,tg","de,dsp",rscon.sumtype("link"),nil,cm.eftg,cm.efop)
local e2=rsef.STO(c,EVENT_SPSUMMON_SUCCESS,{m,1},nil,"sp,tg","de,dsp",cm.efcon,nil,cm.eftg,cm.efop)
end
function cm.lfilter(c)
return c:IsLinkType(TYPE_PENDULUM) and not c:IsAttribute(ATTRIBUTE_DARK) and not c:IsAttribute(ATTRIBUTE_LIGHT)
......@@ -40,17 +40,25 @@ function cm.tgfilter(c)
g:AddCard(c)
return g:IsExists(Card.IsAbleToGrave,1,nil)
end
function cm.efcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.eftg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(rscf.spfilter2(Card.IsType,TYPE_PENDULUM),tp,LOCATION_REMOVED,0,1,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
local b3=Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
if chk==0 then return b1 or b2 or b3 end
if c:GetFlagEffectLabel(m) then
e:SetLabel(c:GetFlagEffectLabel(m))
else
e:SetLabel(0)
end
end
function cm.efop(e,tp)
local c=e:GetHandler()
local ct=1
if c:IsRelateToEffect(e) and c:GetFlagEffectLabel(m) then
ct=math.floor(c:GetFlagEffectLabel(m)/2)
if e:GetLabel()>0 then
ct=math.floor(e:GetLabel()/2)
end
for i=1,ct do
local b1=Duel.IsExistingMatchingCard(rscf.spfilter2(Card.IsType,TYPE_PENDULUM),tp,LOCATION_REMOVED,0,1,nil,e,tp)
......
......@@ -22,7 +22,7 @@ function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
e:SetLabel(0)
rshint.Select(tp,"res")
local rg2=rg:Select(tp,1,#rg,nil) --rg:SelectSubGroup(tp,cm.gcheck,false,1,#rg,e,tp)
local rg2=rg:Select(tp,1,#tg,nil) --rg:SelectSubGroup(tp,cm.gcheck,false,1,#rg,e,tp)
local ct=Duel.Release(rg2,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,ct,1-tp,LOCATION_ONFIELD)
e:SetValue(ct)
......
......@@ -18,7 +18,7 @@ function cm.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_TRIGGER_O)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
......
......@@ -58,8 +58,8 @@ function cm.desfilter(c)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.desfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_DECK,0,1,aux.ExceptThisCard(e)) end
local g=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_DECK,0,aux.ExceptThisCard(e))
if chk==0 then return Duel.IsExistingMatchingCard(cm.desfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_DECK,0,1,c) end
local g=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_DECK,0,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -23,6 +23,16 @@ function c33332212.initial_effect(c)
local rc=te:GetOwner()
return te:IsActiveType(TYPE_MONSTER) and rc and not rc:IsCode(33332200) end)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(33332212,1))
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,33332212)
e3:SetTarget(c33332212.settg)
e3:SetOperation(c33332212.setop)
c:RegisterEffect(e3)
end
function c33332212.cdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
......@@ -57,6 +67,23 @@ function c33332212.cdop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
---放置魔陷
function c33332212.sfilter(c)
return c:IsSetCard(0x3568) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c33332212.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c33332212.sfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
end
function c33332212.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c33332212.sfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.SSet(tp,tc)
end
end
......
......@@ -30,7 +30,7 @@ function cm.spfilter(c)
end
function cm.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>1 and Duel.IsExistingMatchingCard(cm.spfilter,c:GetControler(),0,LOCATION_MZONE,1,nil)
return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>1 and Duel.IsExistingMatchingCard(cm.spfilter,c:GetControler(),0,LOCATION_MZONE,1,nil)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
......
......@@ -35,6 +35,14 @@ function cm.initial_effect(c)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(cm.adjustop)
c:RegisterEffect(e3)
if not cm.global_check then
cm.global_check=true
Duel.DiscardDeck=function(tp,ct,reason)
local g=Duel.GetDecktopGroup(tp,ct)
Duel.DisableShuffleCheck()
return Duel.SendtoGrave(g,reason)
end
end
end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -61,18 +69,30 @@ end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END)
if Duel.GetCurrentPhase()==PHASE_END then
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetValue(Duel.GetTurnCount())
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
else
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetValue(0)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
e1:SetCondition(cm.descon)
e1:SetOperation(cm.desop)
Duel.RegisterEffect(e1,tp)
end
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnCount()==e:GetValue() then return false end
return e:GetLabelObject():GetFlagEffect(m)~=0
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if not tc or tc:GetFlagEffect(m)==0 then return end
......@@ -159,7 +179,7 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
local repop=function(e,tp,eg,ep,ev,re,r,rp)
op(e,tp,eg,ep,ev,re,r,rp)
local xyzc=Duel.GetFirstMatchingCard(Card.IsOriginalCodeRule,tp,LOCATION_MZONE,0,nil,53799193)
if xyzc and e:GetHandler():IsRelateToEffect(e) and e:IsHasType(EFFECT_TYPE_ACTIVATE) and not e:GetHandler():IsHasEffect(EFFECT_TO_GRAVE_REDIRECT) and e:GetHandler():IsOnField() and e:GetHandler():IsFaceup() and e:GetHandler():IsCanOverlay() then
if xyzc and e:GetHandler():IsRelateToEffect(e) and e:IsHasType(EFFECT_TYPE_ACTIVATE) and not e:GetHandler():IsHasEffect(EFFECT_TO_GRAVE_REDIRECT) and not e:GetHandler():IsHasEffect(EFFECT_REMAIN_FIELD) and e:GetHandler():IsOnField() and e:GetHandler():IsFaceup() and e:GetHandler():IsCanOverlay() then
e:GetHandler():CancelToGrave()
Duel.Overlay(xyzc,Group.FromCards(e:GetHandler()))
end
......
--圣印坏兽 宇宙泰坦
function c60000002.initial_effect(c)
local cm,m,o=GetID()
cm.name = "圣印坏兽 宇宙泰坦"
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),8)
cm.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),8)
c:EnableReviveLimit()
--extra material
end
function cm.LinkCondition(f,minc,maxc,gf)
return function(e,c,og,lmat,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
local tp=c:GetControler()
local mg=nil
if og then
mg=og:Filter(Auxiliary.LConditionFilter,nil,f,c,e)
local mg1=Auxiliary.GetLinkMaterials(1-tp,f,c,e)
mg:Merge(mg1)
else
mg=Auxiliary.GetLinkMaterials(tp,f,c,e)
local mg1=Auxiliary.GetLinkMaterials(1-tp,f,c,e)
mg:Merge(mg1)
end
if lmat~=nil then
if not Auxiliary.LConditionFilter(lmat,f,c,e) then return false end
mg:AddCard(lmat)
end
local fg=Duel.GetMustMaterial(tp,EFFECT_MUST_BE_LMATERIAL)
if fg:IsExists(Auxiliary.MustMaterialCounterFilter,1,nil,mg) then return false end
Duel.SetSelectedCard(fg)
return mg:CheckSubGroup(Auxiliary.LCheckGoal,minc,maxc,tp,c,gf,lmat)
end
end
function cm.LinkTarget(f,minc,maxc,gf)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,lmat,min,max)
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
local mg=nil
if og then
mg=og:Filter(Auxiliary.LConditionFilter,nil,f,c,e)
local mg1=Auxiliary.GetLinkMaterials(1-tp,f,c,e)
mg:Merge(mg1)
else
mg=Auxiliary.GetLinkMaterials(tp,f,c,e)
local mg1=Auxiliary.GetLinkMaterials(1-tp,f,c,e)
mg:Merge(mg1)
end
if lmat~=nil then
if not Auxiliary.LConditionFilter(lmat,f,c,e) then return false end
mg:AddCard(lmat)
end
local fg=Duel.GetMustMaterial(tp,EFFECT_MUST_BE_LMATERIAL)
Duel.SetSelectedCard(fg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local cancel=Duel.IsSummonCancelable()
local sg=mg:SelectSubGroup(tp,Auxiliary.LCheckGoal,cancel,minc,maxc,tp,c,gf,lmat)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
end
function cm.AddLinkProcedure(c,f,min,max,gf)
local e1=Effect.CreateEffect(c)
e1:SetDescription(1166)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(c60000002.matval)
if max==nil then max=c:GetLink() end
e1:SetCondition(cm.LinkCondition(f,min,max,gf))
e1:SetTarget(cm.LinkTarget(f,min,max,gf))
e1:SetOperation(Auxiliary.LinkOperation(f,min,max,gf))
e1:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e1)
end
function c60000002.matval(e,lc,mg,c,tp)
if e:GetHandler()~=lc then return false,nil end
return true,not mg or not mg:IsExists(Card.IsControler,100,nil,1-tp)
return e1
end
......@@ -111,7 +111,7 @@ function cm.fsop(e,tp,eg,ep,ev,re,r,rp)
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,c,chkf)
tc:SetMaterial(mat1)
Duel.SendtoDeck(mat1,nil,0,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.SendtoDeck(mat1,nil,2,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
......
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