Commit 2b706e65 authored by songtongtong's avatar songtongtong

bug fix

parent 373da155
Pipeline #22161 passed with stages
in 31 minutes and 26 seconds
--恋爱头脑战-藤原千花
local m=12812006
local cm=_G["c"..m]
function c12812006.initial_effect(c)
aux.EnablePendulumAttribute(c)
c:SetSPSummonOnce(12812006)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_PZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.psplimit)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,12812106)
e2:SetCondition(cm.discon)
e2:SetTarget(cm.distg)
e2:SetOperation(cm.disop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
--
cm.self_summon_effect=e3
end
function cm.psplimit(e,c,tp,sumtp,sumpos)
return not c:IsSetCard(0xa73) and bit.band(sumtp,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
--效果1
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp==1-tp and re:IsActiveType(TYPE_MONSTER)
and Duel.IsChainDisablable(ev) and Duel.GetCurrentPhase()==PHASE_MAIN1 and Duel.GetTurnPlayer()==tp
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDestructable() end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Destroy(e:GetHandler(),REASON_EFFECT)~=0 then return end
Duel.NegateEffect(ev)
end
--效果2
function cm.filter(c)
return c:IsSetCard(0xa73) and c:IsAbleToHand() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter),tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
--恋爱头脑战-藤原千花
local m=12812006
local cm=_G["c"..m]
function c12812006.initial_effect(c)
aux.EnablePendulumAttribute(c)
c:SetSPSummonOnce(12812006)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_PZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.psplimit)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,12812106)
e2:SetCondition(cm.discon)
e2:SetTarget(cm.distg)
e2:SetOperation(cm.disop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
end
function cm.psplimit(e,c,tp,sumtp,sumpos)
return not c:IsSetCard(0xa73) and bit.band(sumtp,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
--效果1
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp==1-tp and re:IsActiveType(TYPE_MONSTER)
and Duel.IsChainDisablable(ev) and Duel.GetCurrentPhase()==PHASE_MAIN1 and Duel.GetTurnPlayer()==tp
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDestructable() end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Destroy(e:GetHandler(),REASON_EFFECT)~=0 then
Duel.NegateEffect(ev)
end
end
--效果2
function cm.filter(c)
return c:IsSetCard(0xa73) and c:IsAbleToHand() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter),tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--冲锋陷阵的教团骑士
--天命真王 梦想王
if not pcall(function() require("expansions/script/c16104200") end) then require("script/c16104200") end
local m,cm=rk.set(16104240)
function cm.initial_effect(c)
......@@ -132,7 +132,7 @@ function cm.is_include(value,tab)
return false
end
function cm.xyz(c)
return c:IsSummonType(SUMMON_TYPE_ADVANCE)
return c:IsSummonType(SUMMON_TYPE_ADVANCE) and c:IsSetCard(0xccd)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local ex=Duel.GetOperationInfo(ev,CATEGORY_ANNOUNCE)
......
......@@ -90,8 +90,8 @@ function cm.splimit(e,c)
end
--Effect 2
function cm.filter(c,e,tp)
return (c:IsSetCard(0xccb)
and c:IsType(TYPE_MONSTER) and c:IsFaceup())
return c:IsSetCard(0xccb)
and c:IsType(TYPE_MONSTER)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
......
......@@ -3,7 +3,6 @@ local m=16104425
local cm=_G["c"..m]
Duel.LoadScript("c16199990.lua")
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c)
--splimit
local e0=Effect.CreateEffect(c)
......
......@@ -16,7 +16,8 @@ end
function c33310200.filter1(c,e)
return c:IsPublic() and c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e) and c:IsAbleToDeck()
end
function c33310200.filter2(c,e,tp,m,f,chkf,m2)
function c33310200.filter2(c,e,tp,sg,f,chkf,m2)
local m=sg:Clone()
if c:IsSetCard(0x551) then m:Merge(m2) end
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
......
This diff is collapsed.
--星曜女神·乐音
local m=66915007
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(cm.splimit)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(cm.spcon)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--tograve
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.tgtg)
e3:SetOperation(cm.tgop)
c:RegisterEffect(e3)
--cannot be link material
local e33=Effect.CreateEffect(c)
e33:SetType(EFFECT_TYPE_SINGLE)
e33:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e33:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e33:SetValue(1)
c:RegisterEffect(e33)
end
function cm.spfilter(c)
return c:IsAbleToGraveAsCost() and c:IsSetCard(0x374) and ((c:IsType(TYPE_SPELL) and c:IsType(TYPE_CONTINUOUS)) or c:IsType(TYPE_TRAP))
end
function cm.splimit(e,se,sp,st)
if not StarLight_from_K then return false end
return StarLight_from_K.Brightstarlight_Effect[se]
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandler():GetControler()
return not Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,1,nil)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local tp=e:GetHandler():GetControler()
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function cm.filter(c)
return ((c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS or c:GetType()==TYPE_TRAP)and c:IsSetCard(0x374)) and c:IsSSetable() or c:IsCode(66915001)
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g)
local tc=g:GetFirst()
if tc:IsType(TYPE_TRAP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
end
--星曜女神·乐音
local m=66915007
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(cm.splimit)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(cm.spcon)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--tograve
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.tgtg)
e3:SetOperation(cm.tgop)
c:RegisterEffect(e3)
--cannot be link material
local e33=Effect.CreateEffect(c)
e33:SetType(EFFECT_TYPE_SINGLE)
e33:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e33:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e33:SetValue(1)
c:RegisterEffect(e33)
end
function cm.spfilter(c)
return c:IsAbleToGraveAsCost() and c:IsSetCard(0x374) and ((c:IsType(TYPE_SPELL) and c:IsType(TYPE_CONTINUOUS)) or c:IsType(TYPE_TRAP))
end
function cm.splimit(e,se,sp,st)
if not StarLight_from_K then return false end
return StarLight_from_K.Brightstarlight_Effect[se]
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandler():GetControler()
return not Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,1,nil)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local tp=e:GetHandler():GetControler()
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function cm.filter(c)
return ((c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS or c:GetType()==TYPE_TRAP)and c:IsSetCard(0x374)) and c:IsSSetable() or c:IsCode(66915001)
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g)
local tc=g:GetFirst()
if tc:IsType(TYPE_TRAP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
end
--行星女神·希冀
function c66915038.initial_effect(c)
c:EnableReviveLimit()
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c66915038.splimit)
c:RegisterEffect(e1)
--base atk/def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c66915038.atkval)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE+CATEGORY_LEAVE_GRAVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c66915038.rectg)
e3:SetOperation(c66915038.recop)
c:RegisterEffect(e3)
end
function c66915038.splimit(e,se,sp,st)
if not StarLight_from_K then return false end
return StarLight_from_K.Brightstarlight_Effect[se]
end
function c66915038.atkval(e,c)
return c:GetOverlayCount()*200
end
function c66915038.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c66915038.matfilter(c,tp)
return not (c:IsCode(66915037) and c:IsControler(tp))
end
function c66915038.matfilters(c)
return c:IsCode(66915037) and c:IsAbleToRemove()
end
function c66915038.filter(c)
return c:IsCode(66915037) and c:IsAbleToHand()
end
function c66915038.recop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local count=c:GetOverlayCount()
if count<=20 then
if not c:IsType(TYPE_XYZ) then return end
local ct=10
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(Card.IsCanOverlay),tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
if g:GetCount()==0 then return end
if g:GetCount()<10 then
ct=g:GetCount()
end
local sg=g:RandomSelect(tp,ct)
Duel.Overlay(c,sg)
else
local g=Duel.GetMatchingGroup(c66915038.matfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e),tp)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
if count>=50 then
local g1=Duel.GetMatchingGroup(c66915038.matfilters,tp,LOCATION_ONFIELD,0,nil)
g1:AddCard(c)
if Duel.Remove(g1,POS_FACEDOWN,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(c66915038.filter,tp,LOCATION_DECK,0,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c66915038.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
--行星女神·希冀
function c66915038.initial_effect(c)
c:EnableReviveLimit()
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c66915038.splimit)
c:RegisterEffect(e1)
--base atk/def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c66915038.atkval)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE+CATEGORY_LEAVE_GRAVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c66915038.rectg)
e3:SetOperation(c66915038.recop)
c:RegisterEffect(e3)
end
function c66915038.splimit(e,se,sp,st)
if not StarLight_from_K then return false end
return StarLight_from_K.Brightstarlight_Effect[se]
end
function c66915038.atkval(e,c)
return c:GetOverlayCount()*200
end
function c66915038.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c66915038.matfilter(c,tp)
return not (c:IsCode(66915037) and c:IsControler(tp))
end
function c66915038.matfilters(c)
return c:IsCode(66915037) and c:IsAbleToRemove()
end
function c66915038.filter(c)
return c:IsCode(66915037) and c:IsAbleToHand()
end
function c66915038.recop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local count=c:GetOverlayCount()
if count<=20 then
if not c:IsType(TYPE_XYZ) then return end
local ct=10
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(Card.IsCanOverlay),tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
if g:GetCount()==0 then return end
if g:GetCount()<10 then
ct=g:GetCount()
end
local sg=g:RandomSelect(tp,ct)
Duel.Overlay(c,sg)
else
local g=Duel.GetMatchingGroup(c66915038.matfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e),tp)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
if count>=50 then
local g1=Duel.GetMatchingGroup(c66915038.matfilters,tp,LOCATION_ONFIELD,0,nil)
g1:AddCard(c)
if Duel.Remove(g1,POS_FACEDOWN,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(c66915038.filter,tp,LOCATION_DECK,0,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c66915038.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
end
\ No newline at end of file
--耀星女神·希冀
local m=66915073
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,66915070)
--xyz summon
aux.AddXyzProcedure(c,cm.mfilter,4,2,cm.ovfilter,aux.Stringid(m,0),2,cm.xyzop)
c:EnableReviveLimit()
--code
aux.EnableChangeCode(c,m-3,LOCATION_MZONE+LOCATION_GRAVE)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(cm.splimit)
c:RegisterEffect(e1)
--X M
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_DICE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--T F
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetCategory(CATEGORY_DICE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetTarget(cm.target1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
end
function cm.splimit(e,se,sp,st)
if not StarLight_from_K then return true end
return not StarLight_from_K.Brightstarlight_Effect[se]
end
function cm.mfilter(c)
return c:IsRace(RACE_FAIRY) and c:IsAttribute(ATTRIBUTE_LIGHT)
end
function cm.ovfilter(c)
return c:IsFaceup() and c:IsCode(m-3) and c:IsType(TYPE_XYZ)
end
function cm.xfilter(c)
return c:IsCanOverlay()
end
function cm.xfilter2(c)
return c:IsCanOverlay() and c:IsSetCard(0x374) and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.tffilter(c,tp)
return c:GetOriginalType()&TYPE_CONTINUOUS~=0 and c:GetOriginalType()&TYPE_SPELL~=0 and c:IsSetCard(0x374) and c:CheckUniqueOnField(tp) and not c:IsForbidden()
end
function cm.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 and Duel.IsExistingMatchingCard(cm.xfilter,tp,LOCATION_SZONE,0,1,nil) end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local tg=Duel.SelectMatchingCard(tp,cm.xfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.Overlay(e:GetHandler(),tg)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function cm.condition(e,tp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetTurnPlayer()==tp
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and Duel.IsExistingMatchingCard(cm.xfilter2,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,PLAYER_ALL,1)
end
cm.toss_dice=true
function cm.operation(e,tp)
if not e:GetHandler():IsRelateToEffect(e) or e:GetHandler():IsFacedown() then return false end
local dice_for_it_half=math.ceil(Duel.TossDice(tp,1)/2)
Duel.Hint(HINT_MESSAGE,tp,HINTMSG_XMATERIAL)
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.xfilter2),tp,LOCATION_DECK+LOCATION_SZONE,0,dice_for_it_half,dice_for_it_half,nil)
if not tg or tg:GetCount()<1 then return end
Duel.Overlay(e:GetHandler(),tg)
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and Duel.IsExistingMatchingCard(cm.xfilter,tp,LOCATION_SZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,PLAYER_ALL,1)
end
function cm.operation1(e,tp)
local c=e:GetHandler()
if not e:GetHandler():IsRelateToEffect(e) or e:GetHandler():IsFacedown() then return false end
Duel.Hint(HINT_MESSAGE,tp,HINTMSG_XMATERIAL)
local tg=Duel.SelectMatchingCard(tp,cm.xfilter,tp,LOCATION_SZONE,0,1,1,nil)
if not tg or tg:GetCount()<1 then return end
Duel.Overlay(e:GetHandler(),tg)
local dice_for_it_half=math.ceil(Duel.TossDice(tp,1)/2)
Duel.BreakEffect()
local ft=dice_for_it_half
if ft>Duel.GetLocationCount(tp,LOCATION_SZONE) then
ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if Duel.GetFieldGroupCount(tp,LOCATION_FZONE,0)==0 then
ft=ft-1
end
end
if ft<=0 then return end
Duel.Hint(HINT_MESSAGE,tp,HINTMSG_TOFIELD)
local sg=c:GetOverlayGroup()
local tfg=sg:FilterSelect(tp,cm.tffilter,1,ft,nil)
for tc in aux.Next(tfg) do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
--耀星女神·希冀
local m=66915073
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,66915070)
--xyz summon
aux.AddXyzProcedure(c,cm.mfilter,4,2,cm.ovfilter,aux.Stringid(m,0),2,cm.xyzop)
c:EnableReviveLimit()
--code
aux.EnableChangeCode(c,m-3,LOCATION_MZONE+LOCATION_GRAVE)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(cm.splimit)
c:RegisterEffect(e1)
--X M
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_DICE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--T F
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetCategory(CATEGORY_DICE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetTarget(cm.target1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
end
function cm.splimit(e,se,sp,st)
if not StarLight_from_K then return true end
return not StarLight_from_K.Brightstarlight_Effect[se]
end
function cm.mfilter(c)
return c:IsRace(RACE_FAIRY) and c:IsAttribute(ATTRIBUTE_LIGHT)
end
function cm.ovfilter(c)
return c:IsFaceup() and c:IsCode(m-3) and c:IsType(TYPE_XYZ)
end
function cm.xfilter(c)
return c:IsCanOverlay()
end
function cm.xfilter2(c)
return c:IsCanOverlay() and c:IsSetCard(0x374) and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.tffilter(c,tp)
return c:GetOriginalType()&TYPE_CONTINUOUS~=0 and c:GetOriginalType()&TYPE_SPELL~=0 and c:IsSetCard(0x374) and c:CheckUniqueOnField(tp) and not c:IsForbidden()
end
function cm.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 and Duel.IsExistingMatchingCard(cm.xfilter,tp,LOCATION_SZONE,0,1,nil) end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local tg=Duel.SelectMatchingCard(tp,cm.xfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.Overlay(e:GetHandler(),tg)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function cm.condition(e,tp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetTurnPlayer()==tp
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and Duel.IsExistingMatchingCard(cm.xfilter2,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,PLAYER_ALL,1)
end
cm.toss_dice=true
function cm.operation(e,tp)
if not e:GetHandler():IsRelateToEffect(e) or e:GetHandler():IsFacedown() then return false end
local dice_for_it_half=math.ceil(Duel.TossDice(tp,1)/2)
Duel.Hint(HINT_MESSAGE,tp,HINTMSG_XMATERIAL)
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.xfilter2),tp,LOCATION_DECK+LOCATION_SZONE,0,dice_for_it_half,dice_for_it_half,nil)
if not tg or tg:GetCount()<1 then return end
Duel.Overlay(e:GetHandler(),tg)
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and Duel.IsExistingMatchingCard(cm.xfilter,tp,LOCATION_SZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,PLAYER_ALL,1)
end
function cm.operation1(e,tp)
local c=e:GetHandler()
if not e:GetHandler():IsRelateToEffect(e) or e:GetHandler():IsFacedown() then return false end
Duel.Hint(HINT_MESSAGE,tp,HINTMSG_XMATERIAL)
local tg=Duel.SelectMatchingCard(tp,cm.xfilter,tp,LOCATION_SZONE,0,1,1,nil)
if not tg or tg:GetCount()<1 then return end
Duel.Overlay(e:GetHandler(),tg)
local dice_for_it_half=math.ceil(Duel.TossDice(tp,1)/2)
Duel.BreakEffect()
local ft=dice_for_it_half
if ft>Duel.GetLocationCount(tp,LOCATION_SZONE) then
ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if Duel.GetFieldGroupCount(tp,LOCATION_FZONE,0)==0 then
ft=ft-1
end
end
if ft<=0 then return end
Duel.Hint(HINT_MESSAGE,tp,HINTMSG_TOFIELD)
local sg=c:GetOverlayGroup()
local tfg=sg:FilterSelect(tp,cm.tffilter,1,ft,nil)
for tc in aux.Next(tfg) do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
\ No newline at end of file
--蝶梦-「绽」
xpcall(function() require("expansions/script/c71401001") end,function() require("script/c71401001") end)
function c71401002.initial_effect(c)
yume.AddButterflySpell(c,71401002)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71401002,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,71501002)
e2:SetCondition(c71401002.con2)
e2:SetCost(c71401002.cost2)
e2:SetTarget(c71401002.tg2)
e2:SetOperation(c71401002.op2)
c:RegisterEffect(e2)
yume.ButterflyCounter()
end
function c71401002.con2(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c71401002.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(71401001,tp,ACTIVITY_CHAIN)==0 end
yume.RegButterflyCostLimit(e,tp)
end
function c71401002.filter2(c,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsLevel(4) and c:IsAttribute(ATTRIBUTE_DARK) and (c:IsAbleToHand() or not c:IsForbidden() and c:CheckUniqueOnField(tp))
end
function c71401002.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71401002.filter2,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c71401002.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c71401002.filter2,tp,LOCATION_DECK,0,1,1,nil,tp)
local tc=g:GetFirst()
if tc then
local b1=tc:IsAbleToHand()
local b2=not tc:IsForbidden() and tc:CheckUniqueOnField(tp)
if b1 and (not b2 or Duel.SelectOption(tp,1150,aux.Stringid(71401002,1))==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
if Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,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+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
end
end
end
--蝶梦-「绽」
xpcall(function() require("expansions/script/c71401001") end,function() require("script/c71401001") end)
function c71401002.initial_effect(c)
yume.AddButterflySpell(c,71401002)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71401002,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,71501002)
e2:SetCondition(c71401002.con2)
e2:SetCost(c71401002.cost2)
e2:SetTarget(c71401002.tg2)
e2:SetOperation(c71401002.op2)
c:RegisterEffect(e2)
yume.ButterflyCounter()
end
function c71401002.con2(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c71401002.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(71401001,tp,ACTIVITY_CHAIN)==0 end
yume.RegButterflyCostLimit(e,tp)
end
function c71401002.filter2(c,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsLevel(4) and c:IsAttribute(ATTRIBUTE_DARK) and (c:IsAbleToHand() or not c:IsForbidden() and c:CheckUniqueOnField(tp))
end
function c71401002.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71401002.filter2,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c71401002.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c71401002.filter2,tp,LOCATION_DECK,0,1,1,nil,tp)
local tc=g:GetFirst()
if tc then
local b1=tc:IsAbleToHand()
local b2=not tc:IsForbidden() and tc:CheckUniqueOnField(tp)
if b1 and (not b2 or Duel.SelectOption(tp,1190,aux.Stringid(71401002,1))==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
if Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,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+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
end
end
end
end
\ No newline at end of file
--蝶现-「宴」
xpcall(function() require("expansions/script/c71401001") end,function() require("script/c71401001") end)
function c71401007.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71401007,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED)
e1:SetCountLimit(1,71401007)
e1:SetCondition(c71401007.con1)
e1:SetCost(c71401007.cost1)
e1:SetTarget(c71401007.tg1)
e1:SetOperation(c71401007.op1)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71401007,1))
e2:SetCategory(CATEGORY_REMOVE+CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,71501007)
e2:SetCost(c71401007.cost2)
e2:SetTarget(c71401007.tg2)
e2:SetOperation(c71401007.op2)
c:RegisterEffect(e2)
yume.ButterflyCounter()
end
function c71401007.con1(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function c71401007.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) and Duel.GetCustomActivityCount(71401001,tp,ACTIVITY_CHAIN)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
yume.RegButterflyCostLimit(e,tp)
end
function c71401007.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c71401007.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c71401007.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(71401001,tp,ACTIVITY_CHAIN)==0 end
yume.RegButterflyCostLimit(e,tp)
end
function c71401007.filter2ext(c)
return c:IsFaceup() and c:IsType(TYPE_CONTINUOUS)
end
function c71401007.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71401007.filter2ext,tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsPlayerCanDraw(tp) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND)
end
function c71401007.filter2(c,e,tp)
return c:IsLevel(4) and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c71401007.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,2,nil)
if g:GetCount()==0 then return end
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
local sg=Duel.GetMatchingGroup(c71401007.filter2,tp,LOCATION_HAND,0,nil,e,tp)
if Duel.Draw(tp,g:GetCount(),REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(71401007,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP)
end
--蝶现-「宴」
xpcall(function() require("expansions/script/c71401001") end,function() require("script/c71401001") end)
function c71401007.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71401007,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED)
e1:SetCountLimit(1,71401007)
e1:SetCondition(c71401007.con1)
e1:SetCost(c71401007.cost1)
e1:SetTarget(c71401007.tg1)
e1:SetOperation(c71401007.op1)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71401007,1))
e2:SetCategory(CATEGORY_REMOVE+CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,71501007)
e2:SetCost(c71401007.cost2)
e2:SetTarget(c71401007.tg2)
e2:SetOperation(c71401007.op2)
c:RegisterEffect(e2)
yume.ButterflyCounter()
end
function c71401007.con1(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function c71401007.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,e:GetHandler()) and Duel.GetCustomActivityCount(71401001,tp,ACTIVITY_CHAIN)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
yume.RegButterflyCostLimit(e,tp)
end
function c71401007.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c71401007.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c71401007.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(71401001,tp,ACTIVITY_CHAIN)==0 end
yume.RegButterflyCostLimit(e,tp)
end
function c71401007.filter2ext(c)
return c:IsFaceup() and c:IsType(TYPE_CONTINUOUS)
end
function c71401007.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71401007.filter2ext,tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsPlayerCanDraw(tp) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND)
end
function c71401007.filter2(c,e,tp)
return c:IsLevel(4) and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c71401007.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,2,nil)
if g:GetCount()==0 then return end
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
local sg=Duel.GetMatchingGroup(c71401007.filter2,tp,LOCATION_HAND,0,nil,e,tp)
if Duel.Draw(tp,g:GetCount(),REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(71401007,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
This diff is collapsed.
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