Commit 5a5201b9 authored by TanakaKotoha's avatar TanakaKotoha

foo foo

parent 8211c500
Pipeline #832 passed with stages
in 45 minutes and 45 seconds
No preview for this file type
...@@ -78,7 +78,7 @@ function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -78,7 +78,7 @@ function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local loc=LOCATION_MZONE+LOCATION_HAND+LOCATION_SZONE local loc=LOCATION_MZONE+LOCATION_HAND+LOCATION_SZONE
if ft==0 then loc=LOCATION_MZONE end if ft==0 then loc=LOCATION_MZONE end
if chk==0 then return ft>-1 and Duel.IsExistingMatchingCard(cm.spcfilter,tp,loc,0,1,nil,ft) end if chk==0 then return ft>-1 and Duel.IsExistingMatchingCard(cm.spcfilter,tp,loc,0,1,c,ft) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.spcfilter,tp,loc,0,1,1,c,ft) local g=Duel.SelectMatchingCard(tp,cm.spcfilter,tp,loc,0,1,1,c,ft)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
......
--炼金工作室-天然的炼金术师 --炼金工作室-天然的炼金术师
function c4212302.initial_effect(c) function c4212302.initial_effect(c)
c:SetUniqueOnField(1,0,4212302) c:SetUniqueOnField(1,0,4212302)
--Activate --Activate
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DECKDES) e2:SetCategory(CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_ACTIVATE) e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetOperation(c4212302.activate) e2:SetOperation(c4212302.activate)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--copy trap --copy trap
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(4212302,0)) e3:SetDescription(aux.Stringid(4212302,0))
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_FREE_CHAIN) e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetHintTiming(0x3c0) e3:SetHintTiming(0x3c0)
e3:SetCountLimit(1,4212302) e3:SetCountLimit(1,4212302)
e3:SetCondition(c4212302.condition) e3:SetCondition(c4212302.condition)
e3:SetTarget(c4212302.target1) e3:SetTarget(c4212302.target1)
e3:SetOperation(c4212302.operation) e3:SetOperation(c4212302.operation)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(4212302,1)) e4:SetDescription(aux.Stringid(4212302,1))
e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetRange(LOCATION_SZONE) e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_CHAINING) e4:SetCode(EVENT_CHAINING)
e4:SetCountLimit(1,4212302) e4:SetCountLimit(1,4212302)
e4:SetTarget(c4212302.target2) e4:SetTarget(c4212302.target2)
e4:SetOperation(c4212302.operation) e4:SetOperation(c4212302.operation)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c4212302.mfilter(c) function c4212302.mfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL) return c:IsFaceup() and c:IsType(TYPE_SPELL)
end end
function c4212302.tffilter(c,tp) function c4212302.tffilter(c,tp)
return c:IsType(TYPE_SPELL) and c:IsType(TYPE_CONTINUOUS) and c:IsSetCard(0xa25) and not c:IsForbidden() and c:CheckUniqueOnField(tp) return c:IsType(TYPE_SPELL) and c:IsType(TYPE_CONTINUOUS) and c:IsSetCard(0xa25) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
end end
function c4212302.activate(e,tp,eg,ep,ev,re,r,rp) function c4212302.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerCanDiscardDeck(tp,2) then if Duel.IsPlayerCanDiscardDeck(tp,2) then
if Duel.SelectEffectYesNo(tp,e:GetHandler(),95) then if Duel.SelectEffectYesNo(tp,e:GetHandler(),95) then
if Duel.DiscardDeck(tp,2,REASON_EFFECT)~=0 if Duel.DiscardDeck(tp,2,REASON_EFFECT)~=0
and Duel.IsExistingMatchingCard(c4212301.tffilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,tp) and Duel.IsExistingMatchingCard(c4212302.tffilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,tp)
and Duel.SelectEffectYesNo(tp,e:GetHandler(),527) then and Duel.SelectEffectYesNo(tp,e:GetHandler(),527) then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,c4212302.tffilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst() local tc=Duel.SelectMatchingCard(tp,c4212302.tffilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if tc then if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end end
end end
end end
end end
end end
function c4212302.condition(e,tp,eg,ep,ev,re,r,rp) function c4212302.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.CheckEvent(EVENT_CHAINING) return not Duel.CheckEvent(EVENT_CHAINING)
end end
function c4212302.filter1(c) function c4212302.filter1(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0xa25) and c:CheckActivateEffect(false,true,false)~=nil return c:IsType(TYPE_SPELL) and c:IsSetCard(0xa25) and c:CheckActivateEffect(false,true,false)~=nil
end end
function c4212302.target1(e,tp,eg,ep,ev,re,r,rp,chk) function c4212302.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then if chkc then
local te=e:GetLabelObject() local te=e:GetLabelObject()
local tg=te:GetTarget() local tg=te:GetTarget()
return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc) return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)
end end
if chk==0 then return Duel.IsExistingTarget(c4212302.filter1,tp,LOCATION_SZONE,0,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingTarget(c4212302.filter1,tp,LOCATION_SZONE,0,1,e:GetHandler()) end
local g=Duel.SelectTarget(tp,c4212302.filter1,tp,LOCATION_SZONE,0,1,1,e:GetHandler()) local g=Duel.SelectTarget(tp,c4212302.filter1,tp,LOCATION_SZONE,0,1,1,e:GetHandler())
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true) local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true)
Duel.ClearTargetCard() Duel.ClearTargetCard()
e:SetCategory(te:GetCategory()) e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty()) e:SetProperty(te:GetProperty())
local tg=te:GetTarget() local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject()) te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te) e:SetLabelObject(te)
end end
function c4212302.operation(e,tp,eg,ep,ev,re,r,rp) function c4212302.operation(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject() local te=e:GetLabelObject()
if not te then return end if not te then return end
e:SetLabelObject(te:GetLabelObject()) e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation() local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end if op then op(e,tp,eg,ep,ev,re,r,rp) end
end end
function c4212302.filter2(c,e,tp,eg,ep,ev,re,r,rp) function c4212302.filter2(c,e,tp,eg,ep,ev,re,r,rp)
if c:IsType(TYPE_SPELL) and c:IsSetCard(0xa25) then if c:IsType(TYPE_SPELL) and c:IsSetCard(0xa25) then
if c:CheckActivateEffect(false,true,false)~=nil then return true end if c:CheckActivateEffect(false,true,false)~=nil then return true end
local te=c:GetActivateEffect() local te=c:GetActivateEffect()
if te:GetCode()~=EVENT_CHAINING then return false end if te:GetCode()~=EVENT_CHAINING then return false end
local con=te:GetCondition() local con=te:GetCondition()
if con and not con(e,tp,eg,ep,ev,re,r,rp) then return false end if con and not con(e,tp,eg,ep,ev,re,r,rp) then return false end
local tg=te:GetTarget() local tg=te:GetTarget()
if tg and not tg(e,tp,eg,ep,ev,re,r,rp,0) then return false end if tg and not tg(e,tp,eg,ep,ev,re,r,rp,0) then return false end
return true return true
else return false end else return false end
end end
function c4212302.target2(e,tp,eg,ep,ev,re,r,rp,chk) function c4212302.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
if e:GetLabel()==0 then return false end if e:GetLabel()==0 then return false end
e:SetLabel(0) e:SetLabel(0)
return Duel.IsExistingMatchingCard(c4212302.filter2,tp,LOCATION_SZONE,0,1,nil,e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(c4212302.filter2,tp,LOCATION_SZONE,0,1,nil,e,tp,eg,ep,ev,re,r,rp)
end end
local g=Duel.SelectMatchingCard(tp,c4212302.filter2,tp,LOCATION_SZONE,0,1,1,nil,e,tp,eg,ep,ev,re,r,rp) local g=Duel.SelectMatchingCard(tp,c4212302.filter2,tp,LOCATION_SZONE,0,1,1,nil,e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst() local tc=g:GetFirst()
local te,ceg,cep,cev,cre,cr,crp local te,ceg,cep,cev,cre,cr,crp
local fchain=c4212302.filter1(tc) local fchain=c4212302.filter1(tc)
if fchain then if fchain then
te,ceg,cep,cev,cre,cr,crp=tc:CheckActivateEffect(false,true,true) te,ceg,cep,cev,cre,cr,crp=tc:CheckActivateEffect(false,true,true)
else else
te=tc:GetActivateEffect() te=tc:GetActivateEffect()
end end
e:SetCategory(te:GetCategory()) e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty()) e:SetProperty(te:GetProperty())
local tg=te:GetTarget() local tg=te:GetTarget()
if tg then if tg then
if fchain then if fchain then
tg(e,tp,ceg,cep,cev,cre,cr,crp,1) tg(e,tp,ceg,cep,cev,cre,cr,crp,1)
else else
tg(e,tp,eg,ep,ev,re,r,rp,1) tg(e,tp,eg,ep,ev,re,r,rp,1)
end end
end end
te:SetLabelObject(e:GetLabelObject()) te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te) e:SetLabelObject(te)
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