Commit 1444dfb5 authored by songtongtong's avatar songtongtong

fixed

parent 5bb1084a
Pipeline #23773 passed with stages
in 29 minutes and 6 seconds
...@@ -344,8 +344,9 @@ ...@@ -344,8 +344,9 @@
12029016 0 --惩戒双子 12029016 0 --惩戒双子
12029070 1 --巨蛾娘的宝藏 12029070 1 --巨蛾娘的宝藏
12030002 1 --乌冬 yatori 12030002 1 --乌冬 yatori
12030007 0 --夏私服 yatori
12030008 0 --礼物 yatori 12030008 0 --礼物 yatori
12030009 0 --女仆 yatori 12030009 1 --女仆 yatori
12031000 1 --人形真主 三葉巧可 12031000 1 --人形真主 三葉巧可
12031001 1 --幼血鬼 三葉巧可 12031001 1 --幼血鬼 三葉巧可
12031005 1 --懵懂幼女 三葉巧可 12031005 1 --懵懂幼女 三葉巧可
...@@ -420,7 +421,7 @@ ...@@ -420,7 +421,7 @@
12087050 1 --响彻人心之歌 罗洛涅萝尔 12087050 1 --响彻人心之歌 罗洛涅萝尔
12087052 2 --花绽的歌声 罗洛涅萝尔 12087052 2 --花绽的歌声 罗洛涅萝尔
12087055 1 --闪耀的光彩 罗洛涅萝尔 12087055 1 --闪耀的光彩 罗洛涅萝尔
12090082 1 --星界转生 12090082 0 --星界转生
12094005 1 --魔王转生 御影零夜 12094005 1 --魔王转生 御影零夜
#122 #122
12200000 1 --神明吞噬者 寰宇之灾厄 12200000 1 --神明吞噬者 寰宇之灾厄
......
--M·A·L·Imperial Chief --M·A·L·Imperial Chief
local m=30683085 local m=30683085
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
aux.EnablePendulumAttribute(c) aux.EnablePendulumAttribute(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--ev --ev
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_NEGATE) e1:SetCategory(CATEGORY_NEGATE)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING) e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,m)
e1:SetCost(cm.descost) e1:SetCost(cm.descost)
e1:SetCondition(cm.descon) e1:SetCondition(cm.descon)
e1:SetTarget(cm.destg) e1:SetTarget(cm.destg)
e1:SetOperation(cm.desop) e1:SetOperation(cm.desop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--Summon --Summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2)) e2:SetDescription(aux.Stringid(m,2))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,m+1) e2:SetCountLimit(1,m+1)
e2:SetTarget(cm.sptg) e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop) e2:SetOperation(cm.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--revive --revive
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE) e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,m+2) e3:SetCountLimit(1,m+2)
e3:SetTarget(cm.sptg2) e3:SetTarget(cm.sptg2)
e3:SetOperation(cm.spop2) e3:SetOperation(cm.spop2)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--to hand --to hand
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,0)) e0:SetDescription(aux.Stringid(m,0))
e0:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_GRAVE_ACTION) e0:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_GRAVE_ACTION)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e0:SetCode(EVENT_PHASE+PHASE_BATTLE_START) e0:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e0:SetRange(LOCATION_PZONE) e0:SetRange(LOCATION_PZONE)
e0:SetCountLimit(1,m+3) e0:SetCountLimit(1,m+3)
e0:SetTarget(cm.thtg) e0:SetTarget(cm.thtg)
e0:SetOperation(cm.thop) e0:SetOperation(cm.thop)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--effect gain --effect gain
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_BE_MATERIAL) e4:SetCode(EVENT_BE_MATERIAL)
e4:SetProperty(EFFECT_FLAG_EVENT_PLAYER) e4:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e4:SetCondition(cm.effcon) e4:SetCondition(cm.effcon)
e4:SetOperation(cm.effop) e4:SetOperation(cm.effop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function cm.filter(c) function cm.filter(c)
return c:IsSetCard(0xc19) and c:IsDiscardable(REASON_DISCARD) return c:IsSetCard(0xc19) and c:IsDiscardable(REASON_DISCARD)
end end
function cm.descon(e,tp,eg,ep,ev,re,r,rp) function cm.descon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp then return false end if Duel.GetTurnPlayer()~=tp then return false end
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION) local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
return rp~=tp and Duel.IsChainDisablable(ev) and re:IsActiveType(TYPE_MONSTER) and loc==LOCATION_GRAVE+LOCATION_REMOVED return rp~=tp and Duel.IsChainDisablable(ev) and re:IsActiveType(TYPE_MONSTER) and loc==LOCATION_GRAVE+LOCATION_REMOVED
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil) and not (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil) and not (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)
end end
function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD) Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp) function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
Duel.DiscardHand(tp,cm.filter,1,1,REASON_EFFECT+REASON_DISCARD) Duel.DiscardHand(tp,cm.filter,1,1,REASON_EFFECT+REASON_DISCARD)
Duel.NegateActivation(ev) Duel.NegateActivation(ev)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetValue(cm.aclimit) e1:SetValue(cm.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function cm.aclimit(e,re,tp) function cm.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsSetCard(0xc19) return re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsSetCard(0xc19)
end end
function cm.tdfilter(c) function cm.tdfilter(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
and c:IsSetCard(0xc19) and c:IsAbleToDeck() and c:IsSetCard(0xc19) and c:IsAbleToDeck()
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and cm.tdfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and cm.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,2,nil) if chk==0 then return Duel.IsExistingTarget(cm.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,2,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,2,2,nil) local g=Duel.SelectTarget(tp,cm.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,LOCATION_SZONE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,LOCATION_SZONE)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e) local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 then if tg:GetCount()>0 then
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if c then if c then
c:SetMaterial(nil) c:SetMaterial(nil)
if Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)~=0 then if Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)~=0 then
--extra material --extra material
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,5)) e4:SetDescription(aux.Stringid(m,5))
e4:SetType(EFFECT_TYPE_FIELD) e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE) e4:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetCode(EFFECT_EXTRA_LINK_MATERIAL) e4:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e4:SetRange(LOCATION_EXTRA) e4:SetRange(LOCATION_EXTRA)
e4:SetTargetRange(LOCATION_PZONE,0) e4:SetTargetRange(LOCATION_PZONE,0)
e4:SetValue(cm.matval) e4:SetValue(cm.matval)
c:RegisterEffect(e4,true) c:RegisterEffect(e4,true)
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT) e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e5:SetRange(LOCATION_MZONE) e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(LOCATION_EXTRA,0) e5:SetTargetRange(LOCATION_EXTRA,0)
e5:SetTarget(cm.eftg) e5:SetTarget(cm.eftg)
e5:SetLabelObject(e4) e5:SetLabelObject(e4)
e5:SetReset(RESET_EVENT+RESETS_STANDARD) e5:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e5,true) c:RegisterEffect(e5,true)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,5)) c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,5))
c:CompleteProcedure() c:CompleteProcedure()
end end
end end
end end
end end
function cm.matval(e,lc,mg,c,tp) function cm.matval(e,lc,mg,c,tp)
if e:GetHandler()~=lc then return false,nil end if e:GetHandler()~=lc then return false,nil end
return true,true return true,true
end end
function cm.eftg(e,c) function cm.eftg(e,c)
return c:IsType(TYPE_LINK) and c:IsSetCard(0xc19) return c:IsType(TYPE_LINK) and c:IsSetCard(0xc19)
end end
function cm.effcon(e,tp,eg,ep,ev,re,r,rp) function cm.effcon(e,tp,eg,ep,ev,re,r,rp)
return (r==REASON_SYNCHRO or r==REASON_FUSION or r==REASON_LINK or r==REASON_XYZ) and e:GetHandler():GetReasonCard():IsSetCard(0xc19) return (r==REASON_SYNCHRO or r==REASON_FUSION or r==REASON_LINK or r==REASON_XYZ) and e:GetHandler():GetReasonCard():IsSetCard(0xc19)
end end
function cm.effop(e,tp,eg,ep,ev,re,r,rp) function cm.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local rc=c:GetReasonCard() local rc=c:GetReasonCard()
-- --
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetDescription(aux.Stringid(m,4)) e1:SetDescription(aux.Stringid(m,4))
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PIERCE) e1:SetCode(EFFECT_CANNOT_REMOVE)
e1:SetValue(1) e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true) rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then --
local e2=Effect.CreateEffect(c) local e0_1=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e0_1:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE) e0_1:SetDescription(aux.Stringid(m,4))
e2:SetValue(TYPE_EFFECT) e0_1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e0_1:SetType(EFFECT_TYPE_SINGLE)
rc:RegisterEffect(e2,true) e0_1:SetCode(EFFECT_CANNOT_TO_GRAVE_AS_COST)
end e0_1:SetRange(LOCATION_MZONE)
rc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,4)) e0_1:SetReset(RESET_EVENT+RESETS_STANDARD)
end rc:RegisterEffect(e0_1,true)
function cm.atklimit(e,c) local e0_2=Effect.CreateEffect(c)
return c==e:GetHandler() e0_2:SetType(EFFECT_TYPE_SINGLE)
end e0_2:SetDescription(aux.Stringid(m,4))
function cm.tgfilter2(c,check) e0_2:SetProperty(EFFECT_FLAG_CLIENT_HINT)
return c:IsSetCard(0xc19) and (c:IsAbleToDeck() or (check and c:IsAbleToHand())) e0_2:SetType(EFFECT_TYPE_SINGLE)
end e0_2:SetCode(EFFECT_CANNOT_TO_GRAVE)
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) e0_2:SetRange(LOCATION_MZONE)
local check=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 e0_2:SetReset(RESET_EVENT+RESETS_STANDARD)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and cm.tgfilter2(chkc,check) end rc:RegisterEffect(e0_2,true)
if chk==0 then return Duel.IsExistingTarget(cm.tgfilter2,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,e:GetHandler(),check) end --
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local e4=Effect.CreateEffect(c)
local g=Duel.SelectTarget(tp,cm.tgfilter2,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,e:GetHandler(),check) e4:SetType(EFFECT_TYPE_SINGLE)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) e4:SetDescription(aux.Stringid(m,4))
end e4:SetProperty(EFFECT_FLAG_CLIENT_HINT)
function cm.spop2(e,tp,eg,ep,ev,re,r,rp) e4:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
local tc=Duel.GetFirstTarget() e4:SetValue(LOCATION_EXTRA)
local c=e:GetHandler() e4:SetReset(RESET_EVENT+RESETS_STANDARD)
if not tc:IsRelateToEffect(e) then return end rc:RegisterEffect(e4,true)
if Duel.GetMatchingGroupCount(nil,tp,LOCATION_MZONE,0,nil)==0 and tc:IsAbleToHand() if not rc:IsType(TYPE_EFFECT) then
and (not tc:IsAbleToDeck() or Duel.SelectOption(tp,1190,aux.Stringid(m,1))==0) then local e3=Effect.CreateEffect(c)
Duel.SendtoHand(tc,nil,REASON_EFFECT) e3:SetType(EFFECT_TYPE_SINGLE)
Duel.SendtoHand(c,nil,REASON_EFFECT) e3:SetCode(EFFECT_ADD_TYPE)
else e3:SetValue(TYPE_EFFECT)
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) e3:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) rc:RegisterEffect(e3,true)
end end
Duel.BreakEffect() rc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,4))
local sg=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil) end
if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then function cm.atklimit(e,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) return c==e:GetHandler()
local g2=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil) end
Duel.SendtoHand(g2,nil,REASON_EFFECT) function cm.tgfilter2(c,check)
Duel.ConfirmCards(1-tp,g2) return c:IsSetCard(0xc19) and (c:IsAbleToDeck() or (check and c:IsAbleToHand()))
end end
end function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function cm.thfilter(c) local check=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
return c:IsCode(30683535) and c:IsAbleToHand() if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and cm.tgfilter2(chkc,check) end
end if chk==0 then return Duel.IsExistingTarget(cm.tgfilter2,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,e:GetHandler(),check) end
function cm.thfilter(c) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_SPELL) and c:IsAbleToHand() local g=Duel.SelectTarget(tp,cm.tgfilter2,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,e:GetHandler(),check)
end Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and e:GetHandler():IsAbleToHand() end function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0) local tc=Duel.GetFirstTarget()
end local c=e:GetHandler()
function cm.thop(e,tp,eg,ep,ev,re,r,rp) if not tc:IsRelateToEffect(e) then return end
local c=e:GetHandler() if Duel.GetMatchingGroupCount(nil,tp,LOCATION_MZONE,0,nil)==0 and tc:IsAbleToHand()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) and (not tc:IsAbleToDeck() or Duel.SelectOption(tp,1190,aux.Stringid(m,1))==0) then
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil) Duel.SendtoHand(tc,nil,REASON_EFFECT)
local tc=g:GetFirst() Duel.SendtoHand(c,nil,REASON_EFFECT)
if tc and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then else
Duel.ConfirmCards(1-tp,tc) Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if c:IsRelateToEffect(e) then Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.BreakEffect() end
Duel.SendtoHand(c,nil,REASON_EFFECT) Duel.BreakEffect()
end local sg=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
end if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(g2,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g2)
end
end
function cm.thfilter(c)
return c:IsCode(30683535) and c:IsAbleToHand()
end
function cm.thfilter(c)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,tc)
if c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
end
--M·A·L·MALB --M·A·L·MALB
local m=30683220 local m=30683220
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
aux.EnablePendulumAttribute(c) aux.EnablePendulumAttribute(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--- ---
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,0)) e0:SetDescription(aux.Stringid(m,0))
e0:SetType(EFFECT_TYPE_FIELD) e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC) e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE) e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetRange(LOCATION_EXTRA) e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(cm.syncon) e0:SetCondition(cm.syncon)
e0:SetTarget(cm.syntg) e0:SetTarget(cm.syntg)
e0:SetOperation(cm.synop) e0:SetOperation(cm.synop)
e0:SetValue(SUMMON_TYPE_SYNCHRO) e0:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e0) c:RegisterEffect(e0)
aux.EnablePendulumAttribute(c) aux.EnablePendulumAttribute(c)
--special summon --special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,m)
e1:SetCondition(cm.spcon) e1:SetCondition(cm.spcon)
e1:SetCost(cm.spcost) e1:SetCost(cm.spcost)
e1:SetTarget(cm.sptg) e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop) e1:SetOperation(cm.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--effect gain --effect gain
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_MATERIAL) e3:SetCode(EVENT_BE_MATERIAL)
e3:SetProperty(EFFECT_FLAG_EVENT_PLAYER) e3:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e3:SetCondition(cm.effcon) e3:SetCondition(cm.effcon)
e3:SetOperation(cm.effop) e3:SetOperation(cm.effop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--pendulum --pendulum
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,3)) e4:SetDescription(aux.Stringid(m,3))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_LEAVE_FIELD) e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,m+3) e4:SetCountLimit(1,m+3)
e4:SetCondition(cm.pencon) e4:SetCondition(cm.pencon)
e4:SetTarget(cm.pentg) e4:SetTarget(cm.pentg)
e4:SetOperation(cm.penop) e4:SetOperation(cm.penop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--set --set
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2)) e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,m+1) e2:SetCountLimit(1,m+1)
e2:SetRange(LOCATION_PZONE) e2:SetRange(LOCATION_PZONE)
e2:SetTarget(cm.sttg) e2:SetTarget(cm.sttg)
e2:SetOperation(cm.stop) e2:SetOperation(cm.stop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.CheckGroupRecursive(c,sg,g,f,min,max,ext_params) function cm.CheckGroupRecursive(c,sg,g,f,min,max,ext_params)
sg:AddCard(c) sg:AddCard(c)
local ct=sg:GetCount() local ct=sg:GetCount()
local res=(ct>=min and f(sg,table.unpack(ext_params))) local res=(ct>=min and f(sg,table.unpack(ext_params)))
or (ct<max and g:IsExists(cm.CheckGroupRecursive,1,sg,sg,g,f,min,max,ext_params)) or (ct<max and g:IsExists(cm.CheckGroupRecursive,1,sg,sg,g,f,min,max,ext_params))
sg:RemoveCard(c) sg:RemoveCard(c)
return res return res
end end
function cm.CheckGroup(g,f,cg,min,max,...) function cm.CheckGroup(g,f,cg,min,max,...)
local min=min or 1 local min=min or 1
local max=max or g:GetCount() local max=max or g:GetCount()
if min>max then return false end if min>max then return false end
local ext_params={...} local ext_params={...}
local sg=Group.CreateGroup() local sg=Group.CreateGroup()
if cg then sg:Merge(cg) end if cg then sg:Merge(cg) end
local ct=sg:GetCount() local ct=sg:GetCount()
if ct>=min and ct<max and f(sg,...) then return true end if ct>=min and ct<max and f(sg,...) then return true end
return g:IsExists(cm.CheckGroupRecursive,1,sg,sg,g,f,min,max,ext_params) return g:IsExists(cm.CheckGroupRecursive,1,sg,sg,g,f,min,max,ext_params)
end end
function cm.SelectGroupNew(tp,desc,cancelable,g,f,cg,min,max,...) function cm.SelectGroupNew(tp,desc,cancelable,g,f,cg,min,max,...)
local min=min or 1 local min=min or 1
local max=max or #g local max=max or #g
local ext_params={...} local ext_params={...}
if cg then Duel.SetSelectedCard(cg) end if cg then Duel.SetSelectedCard(cg) end
Duel.Hint(tp,HINT_SELECTMSG,desc) Duel.Hint(tp,HINT_SELECTMSG,desc)
return g:SelectSubGroup(tp,f,cancelable,min,max,...) return g:SelectSubGroup(tp,f,cancelable,min,max,...)
end end
function cm.SelectGroup(tp,desc,g,f,cg,min,max,...) function cm.SelectGroup(tp,desc,g,f,cg,min,max,...)
return cm.SelectGroupNew(tp,desc,true,g,f,cg,min,max,...) return cm.SelectGroupNew(tp,desc,true,g,f,cg,min,max,...)
end end
function cm.matfilter1(c,syncard,tp) function cm.matfilter1(c,syncard,tp)
if c:IsFacedown() then return false end if c:IsFacedown() then return false end
if (c:IsSynchroType(TYPE_LINK) or c:IsSynchroType(TYPE_XYZ)) and c:IsControler(tp) then return true end if (c:IsSynchroType(TYPE_LINK) or c:IsSynchroType(TYPE_XYZ)) and c:IsControler(tp) then return true end
return c:IsSynchroType(TYPE_TUNER) and c:IsCanBeSynchroMaterial(syncard) and c:IsSetCard(0xc19) and c:IsType(TYPE_SYNCHRO) return c:IsSynchroType(TYPE_TUNER) and c:IsCanBeSynchroMaterial(syncard) and c:IsSetCard(0xc19) and c:IsType(TYPE_SYNCHRO)
end end
function cm.matfilter2(c,syncard) function cm.matfilter2(c,syncard)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsNotTuner(syncard) and c:IsCanBeSynchroMaterial(syncard) return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsNotTuner(syncard) and c:IsCanBeSynchroMaterial(syncard)
end end
function cm.val(c,syncard) function cm.val(c,syncard)
if c:IsSynchroType(TYPE_LINK) and c:IsSetCard(0xc19) then if c:IsSynchroType(TYPE_LINK) and c:IsSetCard(0xc19) then
return c:GetLink() return c:GetLink()
else else
if c:IsSynchroType(TYPE_XYZ) and c:IsSetCard(0xc19) then if c:IsSynchroType(TYPE_XYZ) and c:IsSetCard(0xc19) then
return c:GetRank() return c:GetRank()
else else
return c:GetSynchroLevel(syncard) return c:GetSynchroLevel(syncard)
end end
end end
end end
function cm.synfilter(c,syncard,lv,g2,g3,minc,maxc,tp) function cm.synfilter(c,syncard,lv,g2,g3,minc,maxc,tp)
local tsg=c:IsHasEffect(EFFECT_HAND_SYNCHRO) and g3 or g2 local tsg=c:IsHasEffect(EFFECT_HAND_SYNCHRO) and g3 or g2
local f=c.tuner_filter local f=c.tuner_filter
if c.tuner_filter then tsg=tsg:Filter(f,nil) end if c.tuner_filter then tsg=tsg:Filter(f,nil) end
return cm.CheckGroup(tsg,cm.goal,Group.FromCards(c),minc,maxc,tp,lv,syncard,c) return cm.CheckGroup(tsg,cm.goal,Group.FromCards(c),minc,maxc,tp,lv,syncard,c)
end end
function cm.goal(g,tp,lv,syncard,tuc) function cm.goal(g,tp,lv,syncard,tuc)
if Duel.GetLocationCountFromEx(tp,tp,g,syncard)<=0 then return false end if Duel.GetLocationCountFromEx(tp,tp,g,syncard)<=0 then return false end
if tuc:IsHasEffect(EFFECT_HAND_SYNCHRO) and g:IsExists(Card.IsLocation,2,tuc,LOCATION_HAND) then return false end if tuc:IsHasEffect(EFFECT_HAND_SYNCHRO) and g:IsExists(Card.IsLocation,2,tuc,LOCATION_HAND) then return false end
local ct=g:GetCount() local ct=g:GetCount()
return g:CheckWithSumEqual(cm.val,lv,ct,ct,syncard) return g:CheckWithSumEqual(cm.val,lv,ct,ct,syncard)
end end
function cm.syncon(e,c,tuner,mg) function cm.syncon(e,c,tuner,mg)
if c==nil then return true end if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler() local tp=c:GetControler()
local minc=2 local minc=2
local maxc=c:GetLevel() local maxc=c:GetLevel()
local g1=nil local g1=nil
local g2=nil local g2=nil
local g3=nil local g3=nil
if mg then if mg then
g1=mg:Filter(cm.matfilter1,nil,c,tp) g1=mg:Filter(cm.matfilter1,nil,c,tp)
g2=mg:Filter(cm.matfilter2,nil,c) g2=mg:Filter(cm.matfilter2,nil,c)
g3=g2:Clone() g3=g2:Clone()
else else
g1=Duel.GetMatchingGroup(cm.matfilter1,tp,LOCATION_MZONE,0,nil,c,tp) g1=Duel.GetMatchingGroup(cm.matfilter1,tp,LOCATION_MZONE,0,nil,c,tp)
g2=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE,0,nil,c) g2=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE,0,nil,c)
g3=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE+LOCATION_HAND,0,nil,c) g3=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE+LOCATION_HAND,0,nil,c)
end end
local pe=Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_SMATERIAL) local pe=Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_SMATERIAL)
local lv=c:GetLevel() local lv=c:GetLevel()
local sg=nil local sg=nil
if tuner then if tuner then
return cm.matfilter1(c,tp) and cm.synfilter(tuner,c,lv,g2,g3,minc,maxc,tp) return cm.matfilter1(c,tp) and cm.synfilter(tuner,c,lv,g2,g3,minc,maxc,tp)
elseif pe then elseif pe then
return cm.matfilter1(pe:GetOwner(),tp) and cm.synfilter(pe:GetOwner(),c,lv,g2,g3,minc,maxc,tp) return cm.matfilter1(pe:GetOwner(),tp) and cm.synfilter(pe:GetOwner(),c,lv,g2,g3,minc,maxc,tp)
else else
return g1:IsExists(cm.synfilter,1,nil,c,lv,g2,g3,minc,maxc,tp) return g1:IsExists(cm.synfilter,1,nil,c,lv,g2,g3,minc,maxc,tp)
end end
end end
function cm.syntg(e,tp,eg,ep,ev,re,r,rp,chk,c,tuner,mg) function cm.syntg(e,tp,eg,ep,ev,re,r,rp,chk,c,tuner,mg)
local minc=2 local minc=2
local maxc=c:GetLevel() local maxc=c:GetLevel()
local g1=nil local g1=nil
local g2=nil local g2=nil
local g3=nil local g3=nil
if mg then if mg then
g1=mg:Filter(cm.matfilter1,nil,c,tp) g1=mg:Filter(cm.matfilter1,nil,c,tp)
g2=mg:Filter(cm.matfilter2,nil,c) g2=mg:Filter(cm.matfilter2,nil,c)
g3=g2:Clone() g3=g2:Clone()
else else
g1=Duel.GetMatchingGroup(cm.matfilter1,tp,LOCATION_MZONE,0,nil,c,tp) g1=Duel.GetMatchingGroup(cm.matfilter1,tp,LOCATION_MZONE,0,nil,c,tp)
g2=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE,0,nil,c) g2=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE,0,nil,c)
g3=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE+LOCATION_HAND,0,nil,c) g3=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE+LOCATION_HAND,0,nil,c)
end end
local pe=Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_SMATERIAL) local pe=Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_SMATERIAL)
local lv=c:GetLevel() local lv=c:GetLevel()
local tuc=nil local tuc=nil
if tuner then if tuner then
tuner=tuc tuner=tuc
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
if not pe then if not pe then
local t1=g1:FilterSelect(tp,cm.synfilter,1,1,nil,c,lv,g2,g3,minc,maxc,tp) local t1=g1:FilterSelect(tp,cm.synfilter,1,1,nil,c,lv,g2,g3,minc,maxc,tp)
tuc=t1:GetFirst() tuc=t1:GetFirst()
else else
tuc=pe:GetOwner() tuc=pe:GetOwner()
Group.FromCards(tuc):Select(tp,1,1,nil) Group.FromCards(tuc):Select(tp,1,1,nil)
end end
end end
tuc:RegisterFlagEffect(m,RESET_EVENT+0x1fe0000,0,1) tuc:RegisterFlagEffect(m,RESET_EVENT+0x1fe0000,0,1)
local tsg=tuc:IsHasEffect(EFFECT_HAND_SYNCHRO) and g3 or g2 local tsg=tuc:IsHasEffect(EFFECT_HAND_SYNCHRO) and g3 or g2
local f=tuc.tuner_filter local f=tuc.tuner_filter
if tuc.tuner_filter then tsg=tsg:Filter(f,nil) end if tuc.tuner_filter then tsg=tsg:Filter(f,nil) end
local g=cm.SelectGroup(tp,HINTMSG_SMATERIAL,tsg,cm.goal,Group.FromCards(tuc),minc,maxc,tp,lv,c,tuc) local g=cm.SelectGroup(tp,HINTMSG_SMATERIAL,tsg,cm.goal,Group.FromCards(tuc),minc,maxc,tp,lv,c,tuc)
if g then if g then
g:KeepAlive() g:KeepAlive()
e:SetLabelObject(g) e:SetLabelObject(g)
return true return true
else return false end else return false end
end end
function cm.synop(e,tp,eg,ep,ev,re,r,rp,c,tuner,mg) function cm.synop(e,tp,eg,ep,ev,re,r,rp,c,tuner,mg)
local g=e:GetLabelObject() local g=e:GetLabelObject()
c:SetMaterial(g) c:SetMaterial(g)
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO) Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup() g:DeleteGroup()
end end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp) function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100) e:SetLabel(100)
if chk==0 then return true end if chk==0 then return true end
end end
function cm.costfilter(c,e,tp) function cm.costfilter(c,e,tp)
return c:IsType(TYPE_SYNCHRO) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetLevel(),e:GetHandler(),c:GetCode()) return c:IsType(TYPE_SYNCHRO) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetLevel(),e:GetHandler(),c:GetCode())
end end
function cm.spfilter(c,e,tp,lv,ec,code) function cm.spfilter(c,e,tp,lv,ec,code)
return c:IsLevel(lv) and c:IsType(TYPE_SYNCHRO) and c:IsSetCard(0xc19) and not c:IsCode(code) return c:IsLevel(lv) and c:IsType(TYPE_SYNCHRO) and c:IsSetCard(0xc19) and not c:IsCode(code)
and Duel.GetLocationCountFromEx(tp,tp,ec,c)>0 and Duel.GetLocationCountFromEx(tp,tp,ec,c)>0
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
if e:GetLabel()~=100 then return false end if e:GetLabel()~=100 then return false end
e:SetLabel(0) e:SetLabel(0)
return aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL) return aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL)
and Duel.CheckReleaseGroup(tp,cm.costfilter,1,nil,e,tp) and Duel.CheckReleaseGroup(tp,cm.costfilter,1,nil,e,tp)
end end
e:SetLabel(0) e:SetLabel(0)
local g=Duel.SelectReleaseGroup(tp,cm.costfilter,1,1,nil,e,tp) local g=Duel.SelectReleaseGroup(tp,cm.costfilter,1,1,nil,e,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
Duel.SetTargetCard(g) Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL) then return end if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc:GetLevel(),nil):GetFirst() local sc=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc:GetLevel(),nil):GetFirst()
if sc then if sc then
sc:SetMaterial(nil) sc:SetMaterial(nil)
if Duel.SpecialSummon(sc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)>0 then if Duel.SpecialSummon(sc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)>0 then
sc:CompleteProcedure() sc:CompleteProcedure()
end end
end end
end end
function cm.effcon(e,tp,eg,ep,ev,re,r,rp) function cm.effcon(e,tp,eg,ep,ev,re,r,rp)
return (r==REASON_SYNCHRO or r==REASON_FUSION or r==REASON_LINK or r==REASON_XYZ) and e:GetHandler():GetReasonCard():IsSetCard(0xc19) return (r==REASON_SYNCHRO or r==REASON_FUSION or r==REASON_LINK or r==REASON_XYZ) and e:GetHandler():GetReasonCard():IsSetCard(0xc19)
end end
function cm.effop(e,tp,eg,ep,ev,re,r,rp) function cm.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local rc=c:GetReasonCard() local rc=c:GetReasonCard()
-- --
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetDescription(aux.Stringid(m,1)) e1:SetDescription(aux.Stringid(m,4))
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_REMOVE) e1:SetCode(EFFECT_PIERCE)
e1:SetRange(LOCATION_MZONE) e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true) rc:RegisterEffect(e1,true)
-- if not rc:IsType(TYPE_EFFECT) then
local e0_1=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e0_1:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e0_1:SetDescription(aux.Stringid(m,1)) e2:SetCode(EFFECT_ADD_TYPE)
e0_1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e2:SetValue(TYPE_EFFECT)
e0_1:SetType(EFFECT_TYPE_SINGLE) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e0_1:SetCode(EFFECT_CANNOT_TO_GRAVE_AS_COST) rc:RegisterEffect(e2,true)
e0_1:SetRange(LOCATION_MZONE) end
e0_1:SetReset(RESET_EVENT+RESETS_STANDARD) rc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,4))
rc:RegisterEffect(e0_1,true) end
local e0_2=Effect.CreateEffect(c) function cm.pencon(e,tp,eg,ep,ev,re,r,rp)
e0_2:SetType(EFFECT_TYPE_SINGLE) local c=e:GetHandler()
e0_2:SetDescription(aux.Stringid(m,1)) return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
e0_2:SetProperty(EFFECT_FLAG_CLIENT_HINT) end
e0_2:SetType(EFFECT_TYPE_SINGLE) function cm.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
e0_2:SetCode(EFFECT_CANNOT_TO_GRAVE) if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
e0_2:SetRange(LOCATION_MZONE) end
e0_2:SetReset(RESET_EVENT+RESETS_STANDARD) function cm.penop(e,tp,eg,ep,ev,re,r,rp)
rc:RegisterEffect(e0_2,true) if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return false end
-- local c=e:GetHandler()
local e4=Effect.CreateEffect(c) if c:IsRelateToEffect(e) then
e4:SetType(EFFECT_TYPE_SINGLE) Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
e4:SetDescription(aux.Stringid(m,1)) end
e4:SetProperty(EFFECT_FLAG_CLIENT_HINT) end
e4:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) function cm.stfilter(c,tp)
e4:SetValue(LOCATION_EXTRA) local seq=c:GetSequence()
e4:SetReset(RESET_EVENT+RESETS_STANDARD) return seq<=4 and c:IsType(TYPE_MONSTER) and c:IsFaceup()
rc:RegisterEffect(e4,true) end
if not rc:IsType(TYPE_EFFECT) then function cm.sttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local e3=Effect.CreateEffect(c) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and cm.stfilter(chkc,tp) end
e3:SetType(EFFECT_TYPE_SINGLE) if chk==0 then return Duel.IsExistingTarget(cm.stfilter,tp,0,LOCATION_MZONE,1,nil,tp) end
e3:SetCode(EFFECT_ADD_TYPE) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,4))
e3:SetValue(TYPE_EFFECT) Duel.SelectTarget(tp,cm.stfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
e3:SetReset(RESET_EVENT+RESETS_STANDARD) end
rc:RegisterEffect(e3,true) function cm.stop(e,tp,eg,ep,ev,re,r,rp)
end local tc=Duel.GetFirstTarget()
rc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1)) if not (tc:IsRelateToEffect(e) and tc:IsControler(1-tp) and not tc:IsImmuneToEffect(e)) then return end
end local zone=1<<tc:GetSequence()
function cm.pencon(e,tp,eg,ep,ev,re,r,rp) local oc=Duel.GetMatchingGroup(cm.seqfilter,tp,0,LOCATION_SZONE,nil,tc:GetSequence()):GetFirst()
local c=e:GetHandler() if oc then
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup() Duel.Destroy(oc,REASON_RULE)
end end
function cm.pentg(e,tp,eg,ep,ev,re,r,rp,chk) if Duel.MoveToField(tc,tp,1-tp,LOCATION_SZONE,POS_FACEUP,true,zone) then
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end local e1=Effect.CreateEffect(e:GetHandler())
end e1:SetCode(EFFECT_CHANGE_TYPE)
function cm.penop(e,tp,eg,ep,ev,re,r,rp) e1:SetType(EFFECT_TYPE_SINGLE)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return false end e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
local c=e:GetHandler() e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
if c:IsRelateToEffect(e) then e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS)
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) tc:RegisterEffect(e1)
end end
end end
function cm.stfilter(c,tp) function cm.seqfilter(c,seq)
local seq=c:GetSequence() return c:GetSequence()==seq
return seq<=4 and c:IsType(TYPE_MONSTER) and c:IsFaceup() end
end
function cm.sttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and cm.stfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.stfilter,tp,0,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,4))
Duel.SelectTarget(tp,cm.stfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
end
function cm.stop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not (tc:IsRelateToEffect(e) and tc:IsControler(1-tp) and not tc:IsImmuneToEffect(e)) then return end
local zone=1<<tc:GetSequence()
local oc=Duel.GetMatchingGroup(cm.seqfilter,tp,0,LOCATION_SZONE,nil,tc:GetSequence()):GetFirst()
if oc then
Duel.Destroy(oc,REASON_RULE)
end
if Duel.MoveToField(tc,tp,1-tp,LOCATION_SZONE,POS_FACEUP,true,zone) 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+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
end
end
function cm.seqfilter(c,seq)
return c:GetSequence()==seq
end
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