Commit 2b706e65 authored by songtongtong's avatar songtongtong

bug fix

parent 373da155
--恋爱头脑战-藤原千花
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)
......
--GGO 星之骑士 莲
local m=33500551
local cm=_G["c"..m]
local dam=500
syu_Ggl=syu_Ggl or {}
function syu_Ggl.sespm(c,code)
local tc=c
--spsummon from szone
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,code+1)
e2:SetHintTiming(0,TIMING_BATTLE_START)
e2:SetCondition(syu_Ggl.spcon1)
e2:SetTarget(syu_Ggl.sptg1)
e2:SetOperation(syu_Ggl.spop1)
c:RegisterEffect(e2)
return e2
end
function syu_Ggl.spcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE
and aux.dscon()
and not e:GetHandler():IsStatus(STATUS_CHAINING) and e:GetHandler():GetType()==TYPE_TRAP+TYPE_CONTINUOUS
end
function syu_Ggl.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function syu_Ggl.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.Damage(1-tp,dam,REASON_EFFECT)
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetLabelObject(c)
e2:SetCondition(syu_Ggl.descon)
e2:SetOperation(syu_Ggl.desop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
c:RegisterFlagEffect(c:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,0,1)
end
end
end
function syu_Ggl.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(tc:GetOriginalCode())~=0 then
return true
else
e:Reset()
return false
end
end
function syu_Ggl.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.Destroy(tc,REASON_EFFECT)
end
function syu_Ggl.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE
and aux.dscon()
and not e:GetHandler():IsStatus(STATUS_CHAINING)
end
function syu_Ggl.costh(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand() end
Duel.SendtoHand(c,tp,REASON_COST)
end
function syu_Ggl.splimit(e,c)
return not c:IsSetCard(0x5a2)
end
-------------------------------
if not cm then return end
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.atktg1)
e1:SetOperation(cm.atkop1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.atkcon)
e2:SetOperation(cm.atkop)
c:RegisterEffect(e2)
end
--e1
function cm.spfilter1(c,e,tp)
return c:IsSetCard(0x5a2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.atktg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.atkop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(c)
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)
c:RegisterEffect(e1)
end
end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetTargetRange(1,0)
e2:SetTarget(syu_Ggl.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
-----------------
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetAttacker()
local tc=Duel.GetAttackTarget()
if not ac:IsControler(tp) then ac,tc=tc,ac end
return ac and ac:IsControler(tp) and ac:IsFaceup() and ac:IsSetCard(0x5a2)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ac=Duel.GetAttacker()
local tc=Duel.GetAttackTarget()
if not ac:IsControler(tp) then ac,tc=tc,ac end
if ac:IsRelateToBattle() and ac:IsFaceup() and tc:IsRelateToBattle() and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(tc:GetAttack())
ac:RegisterEffect(e1)
end
--GGO 星之骑士 莲
local m=33500551
local cm=_G["c"..m]
dam=500
syu_Ggl=syu_Ggl or {}
function syu_Ggl.sespm(c,code)
local tc=c
--spsummon from szone
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,code+1)
e2:SetHintTiming(0,TIMING_BATTLE_START)
e2:SetCondition(syu_Ggl.spcon1)
e2:SetTarget(syu_Ggl.sptg1)
e2:SetOperation(syu_Ggl.spop1)
c:RegisterEffect(e2)
return e2
end
function syu_Ggl.spcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE
and aux.dscon()
and not e:GetHandler():IsStatus(STATUS_CHAINING) and e:GetHandler():GetType()==TYPE_TRAP+TYPE_CONTINUOUS
end
function syu_Ggl.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function syu_Ggl.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.Damage(1-tp,dam,REASON_EFFECT)
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetLabelObject(c)
e2:SetCondition(syu_Ggl.descon)
e2:SetOperation(syu_Ggl.desop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
c:RegisterFlagEffect(c:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,0,1)
end
end
end
function syu_Ggl.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(tc:GetOriginalCode())~=0 then
return true
else
e:Reset()
return false
end
end
function syu_Ggl.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.Destroy(tc,REASON_EFFECT)
end
function syu_Ggl.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE
and aux.dscon()
and not e:GetHandler():IsStatus(STATUS_CHAINING)
end
function syu_Ggl.costh(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand() end
Duel.SendtoHand(c,tp,REASON_COST)
end
function syu_Ggl.splimit(e,c)
return not c:IsSetCard(0x5a2)
end
-------------------------------
if not cm then return end
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.atktg1)
e1:SetOperation(cm.atkop1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.atkcon)
e2:SetOperation(cm.atkop)
c:RegisterEffect(e2)
end
--e1
function cm.spfilter1(c,e,tp)
return c:IsSetCard(0x5a2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.atktg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.atkop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(c)
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)
c:RegisterEffect(e1)
end
end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetTargetRange(1,0)
e2:SetTarget(syu_Ggl.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
-----------------
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetAttacker()
local tc=Duel.GetAttackTarget()
if not ac:IsControler(tp) then ac,tc=tc,ac end
return ac and ac:IsControler(tp) and ac:IsFaceup() and ac:IsSetCard(0x5a2)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ac=Duel.GetAttacker()
local tc=Duel.GetAttackTarget()
if not ac:IsControler(tp) then ac,tc=tc,ac end
if ac:IsRelateToBattle() and ac:IsFaceup() and tc:IsRelateToBattle() and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(tc:GetAttack())
ac:RegisterEffect(e1)
end
end
\ No newline at end of file
--星曜女神·乐音
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
--剑之艺术家 单调锋
function c9310034.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x480,0x3f91),aux.NonTuner(Card.IsSynchroType,TYPE_SYNCHRO),1)
c:EnableReviveLimit()
--act limit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_CHAINING)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e0:SetRange(LOCATION_ONFIELD)
e0:SetOperation(c9310034.chainop)
c:RegisterEffect(e0)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9310034,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c9310034.spcon)
e1:SetTarget(c9310034.sptg)
e1:SetOperation(c9310034.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_REMOVE)
c:RegisterEffect(e2)
--nontuner
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_NONTUNER)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(1)
c:RegisterEffect(e3)
--negate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(9310034,1))
e4:SetCategory(CATEGORY_DISABLE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EVENT_REMOVE)
e4:SetCondition(c9310034.negcon)
e4:SetTarget(c9310034.negtg)
e4:SetOperation(c9310034.negop)
c:RegisterEffect(e4)
end
c9310034.material_setcode=0x3f91
function c9310034.chainop(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler()==e:GetHandler() and ep==tp then
Duel.SetChainLimit(c9310034.chainlm)
end
end
function c9310034.chainlm(e,rp,tp)
return tp==rp
end
function c9310034.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_ATTACK)
end
function c9310034.tgfilter(c)
return c:IsFaceup() and c:IsAbleToRemove()
and (c:IsSetCard(0x3f91) or c:IsSetCard(0x480))
end
function c9310034.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
and Duel.IsExistingMatchingCard(c9310034.tgfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,aux.ExceptThisCard(e)) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_ONFIELD+LOCATION_GRAVE)
Duel.SetChainLimit(c9310034.chainlm)
end
function c9310034.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c9310034.tgfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,aux.ExceptThisCard(e))
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
end
function c9310034.remfilter(c)
return not c:IsType(TYPE_TOKEN)
end
function c9310034.negcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c9310034.remfilter,1,nil)
end
function c9310034.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and aux.NegateAnyFilter(chkc) end
if chk==0 then return e:GetHandler():IsLevelAbove(5)
and Duel.IsExistingTarget(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
Duel.SetChainLimit(c9310034.chainlm)
end
function c9310034.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER))
and tc:IsRelateToEffect(e) and c:IsLevelAbove(5) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_UPDATE_LEVEL)
e0:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e0:SetValue(-4)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
end
--剑之艺术家 单调锋
function c9310034.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x480,0x3f91),aux.NonTuner(Card.IsSynchroType,TYPE_SYNCHRO),1)
c:EnableReviveLimit()
--act limit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_CHAINING)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e0:SetRange(LOCATION_ONFIELD)
e0:SetOperation(c9310034.chainop)
c:RegisterEffect(e0)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9310034,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c9310034.spcon)
e1:SetTarget(c9310034.sptg)
e1:SetOperation(c9310034.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_REMOVE)
c:RegisterEffect(e2)
--nontuner
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_NONTUNER)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(1)
c:RegisterEffect(e3)
--negate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(9310034,1))
e4:SetCategory(CATEGORY_DISABLE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EVENT_REMOVE)
e4:SetCondition(c9310034.negcon)
e4:SetTarget(c9310034.negtg)
e4:SetOperation(c9310034.negop)
c:RegisterEffect(e4)
end
c9310034.material_setcode=0x3f91
c9310034.material_setcode=0x480
c9310034.material_type=TYPE_SYNCHRO
function c9310034.chainop(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler()==e:GetHandler() and ep==tp then
Duel.SetChainLimit(c9310034.chainlm)
end
end
function c9310034.chainlm(e,rp,tp)
return tp==rp
end
function c9310034.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_ATTACK)
end
function c9310034.tgfilter(c)
return c:IsFaceup() and c:IsAbleToRemove()
and (c:IsSetCard(0x3f91) or c:IsSetCard(0x480))
end
function c9310034.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
and Duel.IsExistingMatchingCard(c9310034.tgfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,aux.ExceptThisCard(e)) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_ONFIELD+LOCATION_GRAVE)
Duel.SetChainLimit(c9310034.chainlm)
end
function c9310034.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c9310034.tgfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,aux.ExceptThisCard(e))
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
end
function c9310034.remfilter(c)
return not c:IsType(TYPE_TOKEN)
end
function c9310034.negcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c9310034.remfilter,1,nil)
end
function c9310034.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and aux.NegateAnyFilter(chkc) end
if chk==0 then return e:GetHandler():IsLevelAbove(5)
and Duel.IsExistingTarget(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
Duel.SetChainLimit(c9310034.chainlm)
end
function c9310034.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER))
and tc:IsRelateToEffect(e) and c:IsLevelAbove(5) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_UPDATE_LEVEL)
e0:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e0:SetValue(-4)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
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