Commit 56c120fb authored by Nemo Ma's avatar Nemo Ma

fix

parent fd58e051
......@@ -25,7 +25,42 @@ function c111443942.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c111443942.filter,tp,LOCATION_DECK,0,1,nil) end
end
function c111443942.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.RegisterFlagEffect(tp,111443942,RESET_PHASE+PHASE_END,0,1)
if Duel.IsExistingMatchingCard(c111443942.filter,tp,LOCATION_DECK,0,2,nil) then
local sg=Duel.GetMatchingGroup(c111443942.filter,tp,LOCATION_DECK,0,nil)
Duel.ConfirmCards(tp,sg)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c111443942.con)
e1:SetOperation(c111443942.op)
e1:SetLabelObject(e6)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(EVENT_TO_HAND)
Duel.RegisterEffect(e3,tp)
local e4=e1:Clone()
e4:SetCode(EVENT_TO_DECK)
Duel.RegisterEffect(e4,tp)
local e5=e1:Clone()
e5:SetCode(EVENT_REMOVE)
Duel.RegisterEffect(e5,tp)
--
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_CHAIN_SOLVED)
e6:SetOperation(c111443942.disop)
e6:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e6,tp)
local e7=e6:Clone()
e7:SetCode(EVENT_CHAINING)
Duel.RegisterEffect(e7,tp)
end
function c111443942.cfilter(c,tp)
......
This diff is collapsed.
......@@ -48,7 +48,7 @@ function cm.initial_effect(c)
function Duel.SelectTarget(sp,f,p,s,o,min,max,nc,...)
if Duel.GetFlagEffect(0,m)>0 and min==1 and max==1 then
local e=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_EFFECT)
local tgf=function(c,...) return f(c,...) and c:IsCanBeEffectTarget(e) end
local tgf=function(c,...) return (not f or f(c,...)) and c:IsCanBeEffectTarget(e) end
local g=Duel.GetMatchingGroup(tgf,p,s,o,nc,...)
local tg=g:Select(sp,min,max,nc)
Duel.SetTargetCard(tg)
......
......@@ -149,11 +149,13 @@ function cm.pspop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(cm.desfil,tp,LOCATION_PZONE,0,1,e:GetHandler()) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
local c=e:GetHandler()
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_PZONE) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_PZONE,0,1,c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local tc=Duel.SelectTarget(tp,cm.desfil,tp,LOCATION_PZONE,0,1,1,e:GetHandler())
local tc=Duel.SelectTarget(tp,nil,tp,LOCATION_PZONE,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -142,6 +142,43 @@ function c4058.initial_effect(c)
e25:SetRange(LOCATION_ONFIELD)
e25:SetOperation(c4058.actop)
c:RegisterEffect(e25)
--public
local e26=Effect.CreateEffect(c)
e26:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e26:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e26:SetCode(EVENT_TO_GRAVE)
e26:SetRange(LOCATION_ONFIELD)
e26:SetCondition(c4058.con)
e26:SetOperation(c4058.op)
c:RegisterEffect(e26)
local e27=e26:Clone()
e27:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e27)
local e28=e26:Clone()
e28:SetCode(EVENT_TO_HAND)
c:RegisterEffect(e28)
local e29=e26:Clone()
e29:SetCode(EVENT_TO_DECK)
c:RegisterEffect(e29)
local e30=e26:Clone()
e30:SetCode(EVENT_REMOVE)
c:RegisterEffect(e30)
local e31=Effect.CreateEffect(c)
e31:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e31:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e31:SetCode(EVENT_CHAIN_SOLVED)
e31:SetRange(LOCATION_ONFIELD)
e31:SetOperation(c4058.pubop)
c:RegisterEffect(e31)
local e32=e31:Clone()
e32:SetCode(EVENT_SUMMON)
c:RegisterEffect(e32)
local e33=Effect.CreateEffect(c)
e33:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e33:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e33:SetCode(EVENT_SPSUMMON_SUCCESS)
e33:SetOperation(c4058.sumsuc)
c:RegisterEffect(e33)
--plus effect
if not c4058.global_check then
c4058.global_check=true
......@@ -329,6 +366,36 @@ function c4058.actop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(rc:GetControler(),rc:GetOriginalCode(),RESET_PHASE+PHASE_END,0,1)
end
--public
function c4058.cfilter(c,tp)
return c:GetPreviousControler()==tp
and (c:IsPreviousLocation(LOCATION_DECK) or c:GetSummonLocation()==LOCATION_DECK
or (c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK))
or c:IsLocation(LOCATION_DECK)) and not c:IsReason(REASON_DRAW)
end
function c4058.con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c4058.cfilter,1,nil,tp)
end
function c4058.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
if g:GetCount()<=1 then return end
c:RegisterFlagEffect(4058,RESET_EVENT+0x1fc0000+RESET_CHAIN,0,1)
end
function c4058.pubop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(4058)~=0 and Duel.IsExistingMatchingCard(c4058.dafilter,tp,LOCATION_DECK,0,2,nil) then
local sg=Duel.GetMatchingGroup(c4058.dafilter,tp,LOCATION_DECK,0,nil)
Duel.ConfirmCards(tp,sg)
end
end
function c4058.sumsuc(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c4058.dafilter,tp,LOCATION_DECK,0,2,nil) then
local sg=Duel.GetMatchingGroup(c4058.dafilter,tp,LOCATION_DECK,0,nil)
Duel.ConfirmCards(tp,sg)
end
end
--plus effect
function c4058.dafilter(c)
return c:IsType(TYPE_TRAP) and c:IsCode(16067089,93217231,80678380,1683982) and Duel.GetFlagEffect(c:GetControler(),c:GetOriginalCode())==0
......
......@@ -3,7 +3,7 @@ function c98920352.initial_effect(c)
c:SetSPSummonOnce(98920352)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0xef),aux.FilterBoolFunction(Card.IsFusionAttribute,ATTRIBUTE_DARK),true)
aux.AddFusionProcFun2(c,c98920352.matfilter,aux.FilterBoolFunction(Card.IsFusionAttribute,ATTRIBUTE_DARK),true)
aux.AddContactFusionProcedure(c,Card.IsAbleToGraveAsCost,LOCATION_ONFIELD,LOCATION_ONFIELD,Duel.SendtoGrave,REASON_COST)
--spsummon condition
local e1=Effect.CreateEffect(c)
......@@ -38,6 +38,9 @@ function c98920352.initial_effect(c)
e3:SetOperation(c98920352.desop)
c:RegisterEffect(e3)
end
function c98920352.matfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xef)
end
function c98920352.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end
......
......@@ -59,10 +59,12 @@ function c98920377.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c98920377.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(98920377,1))then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
if Duel.SelectYesNo(tp,aux.Stringid(98920377,1)) then
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c98920377.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
......@@ -106,9 +106,12 @@ function c98920400.desop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c98920400.splimit)
e1:SetTarget(c98920400.splimit1)
Duel.RegisterEffect(e1,tp)
end
function c98920400.splimit1(e,c)
return c:IsLocation(LOCATION_EXTRA)
end
function c98920400.valcheck(e,c,tp)
local tp=e:GetOwner():GetControler()
local g=c:GetMaterial()
......@@ -124,6 +127,3 @@ end
function c98920400.indcon(e)
return ep==tp and Duel.IsExistingMatchingCard(c98920400.thfilter,tp,LOCATION_GRAVE,0,1,nil)
end
function c98920400.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA)
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