Commit cfef0aad authored by songtongtong's avatar songtongtong

fixed

parent bb9b7776
Pipeline #23784 passed with stages
in 25 minutes and 53 seconds
......@@ -78,11 +78,10 @@ function cm.thcheck(c)
end
function cm.activate(e,tp)
if Duel.IsExistingMatchingCard(cm.thcheck,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,cm.thcheck,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(tg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,cm.thcheck,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(tg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
function cm.check(c)
......
--迷镜魇 征服
Duel.LoadScript("c47350500.lua")
local s,id=GetID()
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc,tp,0) end
if chk==0 then
return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp,0)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and tc:IsCanTurnSet()
and Duel.MoveToField(tc,tp,tc:GetOwner(),LOCATION_SZONE,POS_FACEDOWN,true) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_TRAP)
tc:RegisterEffect(e1)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tc:GetOwner(),nil,0)
end
end
function s.filter(c,tp)
local r=LOCATION_REASON_TOFIELD
if not c:IsControler(c:GetOwner()) then r=LOCATION_REASON_CONTROL end
return c:IsFaceup() and Duel.GetLocationCount(c:GetOwner(),LOCATION_SZONE,tp,r)>0
end
function s.initial_effect(c)
LIM.lim_eff(c,id)
local e1=LIM.eff2(c,id)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(s.tg)
e1:SetOperation(s.op)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_REMOVE)
c:RegisterEffect(e2)
end
--迷镜魇 征服
Duel.LoadScript("c47350500.lua")
local s,id=GetID()
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc,tp,0) end
if chk==0 then
return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp,0)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e)
and Duel.MoveToField(tc,tp,tc:GetOwner(),LOCATION_SZONE,POS_FACEDOWN,true) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_TRAP)
tc:RegisterEffect(e1)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tc:GetOwner(),nil,0)
end
end
function s.filter(c,tp)
local r=LOCATION_REASON_TOFIELD
if not c:IsControler(c:GetOwner()) then r=LOCATION_REASON_CONTROL end
return c:IsFaceup() and Duel.GetLocationCount(c:GetOwner(),LOCATION_SZONE,tp,r)>0
end
function s.initial_effect(c)
LIM.lim_eff(c,id)
local e1=LIM.eff2(c,id)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(s.tg)
e1:SetOperation(s.op)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_REMOVE)
c:RegisterEffect(e2)
end
--夺魂迷镜魇
Duel.LoadScript("c47350500.lua")
local s,id=GetID()
function s.confirm(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(47350500,1))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(s.cftg)
e1:SetOperation(s.cfop)
c:RegisterEffect(e1)
end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function s.cffilter(c)
return c:IsRace(RACE_FIEND) and c:IsLevel(3) and c:IsAbleToGrave()
end
function s.limit(c)
return function (e,lp,tp)
return e:GetHandler()~=c
end
end
function s.cftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsFacedown() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN)
local g=Duel.SelectTarget(tp,Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetChainLimit(s.limit(g:GetFirst()))
end
function s.cfop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() and tc:IsRelateToEffect(e) then
LIM.confirm(tp,tc)
local ct=tc:GetOriginalType()
if ct&TYPE_MONSTER~=0 then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
elseif ct&(TYPE_SPELL+TYPE_TRAP)~=0 and tc:IsAbleToHand() then
if Duel.SendtoHand(tc,tp,REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SelectEffectYesNo(tp,e:GetHandler(),aux.Stringid(id,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,Card.IsSSetable,tp,LOCATION_HAND,0,1,1,nil)
Duel.SSet(tp,g,tp,true)
LIM.confirm(tp,tc)
end
end
end
end
function s.ind(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(s.indtg)
e1:SetValue(aux.indoval)
c:RegisterEffect(e1)
end
function s.indtg(e,c)
return c:IsFacedown()
end
function s.set(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.setcon)
e1:SetTarget(s.settg)
e1:SetOperation(s.setop)
c:RegisterEffect(e1)
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and rc~=c and rc:IsSetCard(0x43c)
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
if tc:IsType(TYPE_SPELL) or tc:IsType(TYPE_TRAP) then
Duel.SendtoGrave(tc,REASON_EFFECT)
elseif tc:IsType(TYPE_MONSTER) then
if Duel.MoveToField(tc,tp,tc:GetOwner(),LOCATION_SZONE,POS_FACEDOWN,true) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_TRAP)
tc:RegisterEffect(e1)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tc:GetOwner(),nil,0)
end
end
end
end
function s.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x43c),s.fmatfilter,true)
s.confirm(c)
s.ind(c)
s.set(c)
end
function s.fmatfilter(c)
return c:IsLevel(3) and c:IsFusionType(TYPE_MONSTER)
--夺魂迷镜魇
Duel.LoadScript("c47350500.lua")
local s,id=GetID()
function s.confirm(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(47350500,1))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(s.cftg)
e1:SetOperation(s.cfop)
c:RegisterEffect(e1)
end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function s.cffilter(c)
return c:IsRace(RACE_FIEND) and c:IsLevel(3) and c:IsAbleToGrave()
end
function s.limit(c)
return function (e,lp,tp)
return e:GetHandler()~=c
end
end
function s.cftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsFacedown() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN)
local g=Duel.SelectTarget(tp,Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetChainLimit(s.limit(g:GetFirst()))
end
function s.cfop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() and tc:IsRelateToEffect(e) then
LIM.confirm(tp,tc)
local ct=tc:GetOriginalType()
if ct&TYPE_MONSTER~=0 then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
elseif ct&(TYPE_SPELL+TYPE_TRAP)~=0 and tc:IsAbleToHand() then
if Duel.SendtoHand(tc,tp,REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SelectEffectYesNo(tp,e:GetHandler(),aux.Stringid(id,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,Card.IsSSetable,tp,LOCATION_HAND,0,1,1,nil)
Duel.SSet(tp,g,tp,true)
LIM.confirm(tp,tc)
end
end
end
end
function s.ind(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(s.indtg)
e1:SetValue(aux.indoval)
c:RegisterEffect(e1)
end
function s.indtg(e,c)
return c:IsFacedown()
end
function s.set(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.setcon)
e1:SetTarget(s.settg)
e1:SetOperation(s.setop)
c:RegisterEffect(e1)
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and rc~=c and rc:IsSetCard(0x43c)
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
if tc:IsType(TYPE_SPELL) or tc:IsType(TYPE_TRAP) then
Duel.SendtoGrave(tc,REASON_EFFECT)
elseif tc:IsType(TYPE_MONSTER) then
if not tc:IsImmuneToEffect(e) and Duel.MoveToField(tc,tp,tc:GetOwner(),LOCATION_SZONE,POS_FACEDOWN,true) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_TRAP)
tc:RegisterEffect(e1)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tc:GetOwner(),nil,0)
end
end
end
end
function s.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x43c),s.fmatfilter,true)
s.confirm(c)
s.ind(c)
s.set(c)
end
function s.fmatfilter(c)
return c:IsLevel(3) and c:IsFusionType(TYPE_MONSTER)
end
\ No newline at end of file
--夺躯迷镜魇
Duel.LoadScript("c47350500.lua")
local s,id=GetID()
function s.dis(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.discon)
e1:SetTarget(s.distg)
e1:SetOperation(s.disop)
c:RegisterEffect(e1)
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(s.confilter,tp,LOCATION_ONFIELD+LOCATION_HAND,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function s.confilter(c)
return (c:IsFacedown() and c:IsLocation(LOCATION_ONFIELD)) or (not c:IsPublic() and c:IsLocation(LOCATION_HAND))
end
function s.setfilter(c)
return c:IsSetCard(0x43c) and c:IsType(TYPE_MONSTER) and c:IsSSetable()
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(s.confilter,tp,LOCATION_ONFIELD+LOCATION_HAND,LOCATION_ONFIELD,1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,s.confilter,tp,LOCATION_ONFIELD+LOCATION_HAND,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
local ct=tc:GetOriginalType()
if tc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,tc)
elseif tc:IsLocation(LOCATION_ONFIELD) then
LIM.confirm(tp,tc)
end
local ec=eg:GetFirst()
if ct&ec:GetType()&0x7~=0 then
Duel.NegateEffect(ev)
elseif Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_GRAVE,0,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SSet(tp,sg)
end
end
end
function s.tograve(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_MSET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id-1000)
e1:SetTarget(s.tgtg)
e1:SetOperation(s.tgop)
c:RegisterEffect(e1)
local e4=e1:Clone()
e4:SetCode(EVENT_SSET)
c:RegisterEffect(e4)
local e2=e1:Clone()
e2:SetCode(EVENT_CHANGE_POS)
e2:SetCondition(s.tgcon)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(s.tgcon)
c:RegisterEffect(e3)
end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsFacedown,1,nil)
end
function s.tgfilter(c)
return c:IsLocation(LOCATION_ONFIELD) and c:IsFacedown() and c:IsAbleToGrave()
end
function s.tgfilter2(c)
return c:IsSetCard(0x43c) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGrave()
end
function s.ckfilter(c)
return c:IsLocation(LOCATION_GRAVE) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(s.tgfilter,1,nil) end
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
if not eg:IsExists(s.tgfilter,1,nil) then return end
local tg=eg:Filter(s.tgfilter,nil)
if #tg>0 then
if Duel.SendtoGrave(tg,REASON_EFFECT)>0 then
local rg=tg:Filter(s.ckfilter,nil)
if #rg>0 then
if rg:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
Duel.BreakEffect()
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetCondition(s.atcon)
e1:SetOperation(s.atop)
c:RegisterEffect(e1)
end
if rg:IsExists(Card.IsType,1,nil,TYPE_SPELL+TYPE_TRAP) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter2,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
end
end
end
function s.atcon(e,tp,eg,ep,ev,re,r,rp)
return aux.bdocon(e,tp,eg,ep,ev,re,r,rp) and e:GetHandler():IsChainAttackable()
end
function s.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack(e:GetHandler())
end
function s.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x43c),s.fmatfilter,true)
s.dis(c)
s.tograve(c)
end
function s.fmatfilter(c)
return c:IsRace(RACE_FIEND) and c:IsType(TYPE_MONSTER)
--夺躯迷镜魇
Duel.LoadScript("c47350500.lua")
local s,id=GetID()
function s.dis(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.discon)
e1:SetTarget(s.distg)
e1:SetOperation(s.disop)
c:RegisterEffect(e1)
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(s.confilter,tp,LOCATION_ONFIELD+LOCATION_HAND,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function s.confilter(c)
return (c:IsFacedown() and c:IsLocation(LOCATION_ONFIELD)) or (not c:IsPublic() and c:IsLocation(LOCATION_HAND))
end
function s.setfilter(c)
return c:IsSetCard(0x43c) and c:IsType(TYPE_MONSTER) and c:IsSSetable()
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(s.confilter,tp,LOCATION_ONFIELD+LOCATION_HAND,LOCATION_ONFIELD,1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,s.confilter,tp,LOCATION_ONFIELD+LOCATION_HAND,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
local ct=tc:GetOriginalType()
if tc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,tc)
elseif tc:IsLocation(LOCATION_ONFIELD) then
LIM.confirm(tp,tc)
end
local ec=eg:GetFirst()
if ct&ec:GetType()&0x7~=0 then
Duel.NegateEffect(ev)
elseif Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_GRAVE,0,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SSet(tp,sg)
end
end
end
function s.tograve(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_MSET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id-1000)
e1:SetTarget(s.tgtg)
e1:SetOperation(s.tgop)
c:RegisterEffect(e1)
local e4=e1:Clone()
e4:SetCode(EVENT_SSET)
c:RegisterEffect(e4)
local e2=e1:Clone()
e2:SetCode(EVENT_CHANGE_POS)
e2:SetCondition(s.tgcon)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(s.tgcon)
c:RegisterEffect(e3)
end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsFacedown,1,nil)
end
function s.tgfilter(c)
return c:IsLocation(LOCATION_ONFIELD) and c:IsFacedown() and c:IsAbleToGrave()
end
function s.tgfilter2(c)
return c:IsSetCard(0x43c) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGrave()
end
function s.ckfilter(c)
return c:IsLocation(LOCATION_GRAVE) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(s.tgfilter,1,nil) end
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
if not eg:IsExists(s.tgfilter,1,nil) then return end
local tg=eg:Filter(s.tgfilter,nil)
if #tg>0 then
if Duel.SendtoGrave(tg,REASON_EFFECT)>0 then
local rg=tg:Filter(s.ckfilter,nil)
if #rg>0 then
if rg:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
Duel.BreakEffect()
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetCondition(s.atcon)
e1:SetOperation(s.atop)
c:RegisterEffect(e1)
end
if rg:IsExists(Card.IsType,1,nil,TYPE_SPELL+TYPE_TRAP) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter2,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
end
end
end
function s.atcon(e,tp,eg,ep,ev,re,r,rp)
return aux.bdocon(e,tp,eg,ep,ev,re,r,rp) and e:GetHandler():IsChainAttackable()
end
function s.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
end
function s.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x43c),s.fmatfilter,true)
s.dis(c)
s.tograve(c)
end
function s.fmatfilter(c)
return c:IsRace(RACE_FIEND) and c:IsFusionType(TYPE_MONSTER)
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