Commit 54310e8d authored by Nemo Ma's avatar Nemo Ma

add

parent 86b75089
No preview for this file type
...@@ -3,5 +3,100 @@ local m=33700354 ...@@ -3,5 +3,100 @@ local m=33700354
local cm=_G["c"..m] local cm=_G["c"..m]
xpcall(function() require("expansions/script/c37564765") end,function() require("script/c37564765") end) xpcall(function() require("expansions/script/c37564765") end,function() require("script/c37564765") end)
function cm.initial_effect(c) function cm.initial_effect(c)
aux.AddXyzProcedureLevelFree(c,nil,cm.gcheck,2,63)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1)
e1:SetCost(cm.cost)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TOSS_DICE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.dicecon)
e2:SetOperation(cm.diceop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_TOSS_COIN)
e3:SetOperation(cm.coinop)
c:RegisterEffect(e3)
end
function cm.gcheck(g)
return g:GetClassCount(Card.GetCode)==1
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
if op==0 then
local coinop=Duel.SelectOption(tp,aux.Stringid(m,2),aux.Stringid(m,3))
_TossCoin=Duel.TossCoin
function Duel.TossCoin(player,count)
local boolflg=false
local result = {_TossCoin(player,count)}
local result_ret={}
for i=0,count do
if boolflg==false then
table.insert(result_ret,coinop)
else
table.insert(result_ret,result[i])
end
end
Duel.TossCoin=_TossCoin
return table.unpack(result_ret)
end
else
local diceop=Duel.AnnounceNumber(tp,1,2,3,4,5,6)
_TossDice=Duel.TossDice
function Duel.TossDice(player,count,count2)
local boolflg=true
local result = {_TossDice(player,count,count2)}
local result_ret={}
local sum=count
if count2 then
sum=sum+count2
end
for i=0,sum do
if boolflg == true then
table.insert(result_ret,diceop)
boolflg=false
else
table.insert(result_ret,result[i])
end
end
Duel.TossDice=_TossDice
return table.unpack(result_ret)
end
end
end
function cm.dicecon(e,tp,eg,ep,ev,re,r,rp)
return rp==tp
end
function cm.diceop(e,tp,eg,ep,ev,re,r,rp)
local flag=0
local dc={Duel.GetDiceResult()}
for _,v in ipairs(dc) do
if v==6 then
flag=flag+1
end
end
Duel.Recover(tp,flag*2000,REASON_EFFECT)
end end
function cm.coinop(e,tp,eg,ep,ev,re,r,rp)
local flag=0
local dc={Duel.GetCoinResult()}
for _,v in ipairs(dc) do
if v==1 then
flag=flag+1
end
end
Duel.Recover(tp,flag*2000,REASON_EFFECT)
end
\ No newline at end of file
--Maize ~自我重生的树精~
local m=33700960
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2)
c:EnableReviveLimit()
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetCountLimit(1)
e1:SetCondition(cm.discon)
e1:SetTarget(cm.distg)
e1:SetOperation(cm.disop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(TIMING_BATTLE_PHASE,TIMINGS_CHECK_MONSTER+TIMING_BATTLE_PHASE)
e2:SetCountLimit(1)
e2:SetCondition(cm.pscon)
e2:SetTarget(cm.pstg)
e2:SetOperation(cm.psop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.imcon)
e3:SetValue(cm.efilter)
c:RegisterEffect(e3)
end
function cm.lkfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_EARTH)
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetLinkedGroup():IsExists(cm.lkfilter,1,nil)
end
function cm.distg(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 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)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
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 cm.lkfilter1(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER)
end
function cm.pscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetLinkedGroup():IsExists(cm.lkfilter1,1,nil)
end
function cm.filter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function cm.pstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function cm.psop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsOnField() and tc:IsFaceup() then
if tc:IsType(TYPE_MONSTER) then
if Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)>0 then
Duel.BreakEffect()
Duel.ChangePosition(tc,POS_FACEUP_ATTACK)
end
else
Duel.ChangePosition(rc,POS_FACEDOWN)
Duel.RaiseEvent(rc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
end
function cm.lkfilter2(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT)
end
function cm.imcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetLinkedGroup():IsExists(cm.lkfilter2,1,nil)
end
function cm.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
...@@ -91,7 +91,13 @@ function rsss.sscon(con) ...@@ -91,7 +91,13 @@ function rsss.sscon(con)
end end
function rsss.ssop(e,tp,eg,ep,ev,re,r,rp,c) function rsss.ssop(e,tp,eg,ep,ev,re,r,rp,c)
if c:IsLocation(LOCATION_GRAVE) then if c:IsLocation(LOCATION_GRAVE) then
local e1=rsef.SV_REDIRECT(c,"leave",LOCATION_REMOVED,nil,rsreset.est-RESET_TOFIELD) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end end
end end
function rsss.MatFunction(c,fun) function rsss.MatFunction(c,fun)
......
...@@ -26,6 +26,7 @@ function s.initial_effect(c) ...@@ -26,6 +26,7 @@ function s.initial_effect(c)
e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY)
e2:SetCondition(function(e) return e:GetHandler():GetFlagEffect(id)>0 end)
e2:SetOperation(s.negop) e2:SetOperation(s.negop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--special summon other --special summon other
...@@ -50,19 +51,19 @@ function s.spfilter(c) ...@@ -50,19 +51,19 @@ function s.spfilter(c)
return c:IsSetCard(0x144e) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() return c:IsSetCard(0x144e) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end end
--function s.MZFilter(c, tp) --function s.MZFilter(c, tp)
-- return c:IsLocation(LOCATION_MZONE) and c:GetSequence() < 5 and c:IsControler(tp) -- return c:IsLocation(LOCATION_MZONE) and c:GetSequence() < 5 and c:IsControler(tp)
--end --end
--function s.ChkfMMZ(sumcount) --function s.ChkfMMZ(sumcount)
-- return function(sg, e, tp, mg) -- return function(sg, e, tp, mg)
-- return sg:FilterCount(s.MZFilter, nil, tp) + Duel.GetLocationCount(tp, LOCATION_MZONE) >= sumcount -- return sg:FilterCount(s.MZFilter, nil, tp) + Duel.GetLocationCount(tp, LOCATION_MZONE) >= sumcount
-- end -- end
--end --end
function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk) function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,nil) end
-- if chk == 0 then -- if chk == 0 then
-- return Duel.GetLocationCount(tp, LOCATION_MZONE) > -2 and #rg > 1 and -- return Duel.GetLocationCount(tp, LOCATION_MZONE) > -2 and #rg > 1 and
-- rg:CheckSubGroup(s.ChkfMMZ(1), 2, 2, tp) -- rg:CheckSubGroup(s.ChkfMMZ(1), 2, 2, tp)
-- end -- end
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,2,nil) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,2,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST) Duel.Remove(g,POS_FACEUP,REASON_COST)
end end
...@@ -77,7 +78,7 @@ function s.spop(e, tp, eg, ep, ev, re, r, rp) ...@@ -77,7 +78,7 @@ function s.spop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler() local c = e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCountFromEx(tp)>0 and Duel.SpecialSummon(c, 1, tp, tp, true, true, POS_FACEUP) ~= 0 then if c:IsRelateToEffect(e) and Duel.GetLocationCountFromEx(tp)>0 and Duel.SpecialSummon(c, 1, tp, tp, true, true, POS_FACEUP) ~= 0 then
c:CompleteProcedure() c:CompleteProcedure()
-- c:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 0) c:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 0)
end end
end end
function s.negop(e, tp, eg, ep, ev, re, r, rp) function s.negop(e, tp, eg, ep, ev, re, r, rp)
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
function c33701329.initial_effect(c) function c33701329.initial_effect(c)
--SSet --SSet
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
......
...@@ -18,8 +18,8 @@ function cm.initial_effect(c) ...@@ -18,8 +18,8 @@ function cm.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetTarget(cm.dmtg) e2:SetTarget(cm.damtg)
e2:SetOperation(cm.dmop) e2:SetOperation(cm.damop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1)) e3:SetDescription(aux.Stringid(m,1))
......
...@@ -27,6 +27,9 @@ function cm.initial_effect(c) ...@@ -27,6 +27,9 @@ function cm.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function cm.ovfilter(c)
return c:IsFaceup() and not c:IsCode(m) and c:GetOverlayCount()==0 and c:IsType(TYPE_XYZ)
end
function cm.atkval(e,c) function cm.atkval(e,c)
return c:GetOverlayCount()*500 return c:GetOverlayCount()*500
end end
......
...@@ -91,8 +91,7 @@ function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c) ...@@ -91,8 +91,7 @@ function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.spfilter,c:GetControler(),LOCATION_EXTRA,0,c,sc) local g=Duel.GetMatchingGroup(cm.spfilter,c:GetControler(),LOCATION_EXTRA,0,c,sc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local sg=g:Select(tp,5,5,c) local sg=g:Select(tp,5,5,c)
c:SetMaterial(g) Duel.Remove(sg,POS_FACEDOWN,REASON_COST)
Duel.Remove(sg,POS_FACEDOWN,REASON_MATERIAL+REASON_LINK)
end end
function cm.indtg(e,c) function cm.indtg(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c) return e:GetHandler():GetLinkedGroup():IsContains(c)
......
--踏破新世界 ~开路之卷~
local m=33701440
local cm=_G["c"..m]
cm.named_with_NewVenture=1
function cm.NewVenture(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_NewVenture
end
function cm.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_SELF_TOGRAVE)
--activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--Effect 1
local e03=Effect.CreateEffect(c)
e03:SetType(EFFECT_TYPE_SINGLE)
e03:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e03:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e03:SetRange(LOCATION_SZONE)
e03:SetValue(1)
c:RegisterEffect(e03)
--Effect 2
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.lpcon)
e2:SetOperation(cm.lpop)
c:RegisterEffect(e2)
local e8=e2:Clone()
e8:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e8)
--Effect 3
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(cm.condition)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
--Effect 4
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SELF_TOGRAVE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.tgccon)
c:RegisterEffect(e2)
end
--Effect 1
--Effect 2
function cm.cfilter(c,tp)
return c:IsSummonPlayer(tp)
end
function cm.lpcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
return eg:IsExists(cm.cfilter,1,nil,1-tp) and #g>0
end
function cm.lpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
if #g==0 then return end
Duel.Hint(HINT_CARD,0,m)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e8=e1:Clone()
e8:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e8)
tc=g:GetNext()
end
end
--Effect 3
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandlerPlayer()
return Duel.GetTurnPlayer()~=p and Duel.GetFlagEffect(p,m+m)==0
end
function cm.filter(c)
if c:IsForbidden() or c:IsCode(m) then return false end
return c:IsType(TYPE_CONTINUOUS) and cm.NewVenture(c)
and c:CheckUniqueOnField(tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToDeck()
and c:GetFlagEffect(m)==0
and Duel.GetLocationCount(tp,LOCATION_SZONE)>-1
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e:GetHandler()) end
c:RegisterFlagEffect(m,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,m+m)>0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e)
and Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0
and c:IsLocation(LOCATION_DECK) then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc and Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
Duel.RegisterFlagEffect(tp,m+m,RESET_PHASE+PHASE_END,0,1)
end
end
end
--Effect 4
function cm.tgccon(e)
return Duel.GetCurrentPhase()==PHASE_END
end
\ No newline at end of file
--踏破新世界 ~铸甲之卷~
local m=33701441
local cm=_G["c"..m]
cm.named_with_NewVenture=1
function cm.NewVenture(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_NewVenture
end
function cm.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_SELF_TOGRAVE)
--activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--Effect 1
local e03=Effect.CreateEffect(c)
e03:SetType(EFFECT_TYPE_SINGLE)
e03:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e03:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e03:SetRange(LOCATION_SZONE)
e03:SetValue(1)
c:RegisterEffect(e03)
--Effect 2
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.lpcon)
e2:SetOperation(cm.lpop)
c:RegisterEffect(e2)
local e8=e2:Clone()
e8:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e8)
--Effect 3
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(cm.condition)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
--Effect 4
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SELF_TOGRAVE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.tgccon)
c:RegisterEffect(e2)
end
--Effect 1
--Effect 2
function cm.cfilter(c,tp)
return c:IsSummonPlayer(tp)
end
function cm.tf(c)
return cm.NewVenture(c) and c:IsAbleToHand()
end
function cm.lpcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.tf),tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
local b1=#g>0
local b2=Duel.CheckLPCost(tp,500) and Duel.IsPlayerCanDraw(tp,1)
return eg:IsExists(cm.cfilter,1,nil,1-tp) and (b1 or b2)
end
function cm.lpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.tf),tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
local b1=#g>0
local b2=Duel.CheckLPCost(tp,500) and Duel.IsPlayerCanDraw(tp,1)
if b1 or b2 then
Duel.Hint(HINT_CARD,0,m)
local off=1
local ops={}
local opval={}
if b1 then
ops[off]=aux.Stringid(m,0)
opval[off-1]=1
off=off+1
end
if b2 then
ops[off]=aux.Stringid(m,1)
opval[off-1]=2
off=off+1
end
ops[off]=aux.Stringid(m,2)
opval[off-1]=3
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPTION)
local op=Duel.SelectOption(tp,table.unpack(ops))
local sel=opval[op]
if sel==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.tf),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
elseif sel==2 then
Duel.PayLPCost(tp,500)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
--Effect 3
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandlerPlayer()
return Duel.GetTurnPlayer()~=p and Duel.GetFlagEffect(p,m+m)==0
end
function cm.filter(c)
if c:IsForbidden() or c:IsCode(m) then return false end
return c:IsType(TYPE_CONTINUOUS) and cm.NewVenture(c)
and c:CheckUniqueOnField(tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToDeck()
and c:GetFlagEffect(m)==0
and Duel.GetLocationCount(tp,LOCATION_SZONE)>-1
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e:GetHandler()) end
c:RegisterFlagEffect(m,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,m+m)>0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e)
and Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0
and c:IsLocation(LOCATION_DECK) then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc and Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
Duel.RegisterFlagEffect(tp,m+m,RESET_PHASE+PHASE_END,0,1)
end
end
end
--Effect 4
function cm.tgccon(e)
return Duel.GetCurrentPhase()==PHASE_END
end
\ No newline at end of file
--踏破新世界 ~巡天之卷~
local m=33701442
local cm=_G["c"..m]
cm.named_with_NewVenture=1
function cm.NewVenture(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_NewVenture
end
function cm.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_SELF_TOGRAVE)
--activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--Effect 1
local e03=Effect.CreateEffect(c)
e03:SetType(EFFECT_TYPE_SINGLE)
e03:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e03:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e03:SetRange(LOCATION_SZONE)
e03:SetValue(1)
c:RegisterEffect(e03)
--Effect 2
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.lpcon)
e2:SetOperation(cm.lpop)
c:RegisterEffect(e2)
local e8=e2:Clone()
e8:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e8)
--Effect 3
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(cm.condition)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
--Effect 4
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SELF_TOGRAVE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.tgccon)
c:RegisterEffect(e2)
end
--Effect 1
--Effect 2
function cm.cfilter(c,tp)
return c:IsSummonPlayer(tp) and c:IsFaceup()
end
function cm.lpcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,1-tp)
end
function cm.lpop(e,tp,eg,ep,ev,re,r,rp)
local lg=eg:Filter(cm.cfilter,nil,1-tp)
local rnum=lg:GetSum(Card.GetAttack)
if Duel.SelectYesNo(tp,aux.Stringid(m,0)) and rnum>0 then
Duel.Hint(HINT_CARD,0,m)
Duel.Recover(tp,rnum,REASON_EFFECT)
end
end
--Effect 3
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandlerPlayer()
return Duel.GetTurnPlayer()~=p and Duel.GetFlagEffect(p,m+m)==0
end
function cm.filter(c)
if c:IsForbidden() or c:IsCode(m) then return false end
return c:IsType(TYPE_CONTINUOUS) and cm.NewVenture(c)
and c:CheckUniqueOnField(tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToDeck()
and c:GetFlagEffect(m)==0
and Duel.GetLocationCount(tp,LOCATION_SZONE)>-1
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e:GetHandler()) end
c:RegisterFlagEffect(m,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,m+m)>0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e)
and Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0
and c:IsLocation(LOCATION_DECK) then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc and Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
Duel.RegisterFlagEffect(tp,m+m,RESET_PHASE+PHASE_END,0,1)
end
end
end
--Effect 4
function cm.tgccon(e)
return Duel.GetCurrentPhase()==PHASE_END
end
--踏破新世界 ~平海之卷~
local m=33701443
local cm=_G["c"..m]
cm.named_with_NewVenture=1
function cm.NewVenture(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_NewVenture
end
function cm.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_SELF_TOGRAVE)
--activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--Effect 1
local e03=Effect.CreateEffect(c)
e03:SetType(EFFECT_TYPE_SINGLE)
e03:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e03:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e03:SetRange(LOCATION_SZONE)
e03:SetValue(1)
c:RegisterEffect(e03)
--Effect 2
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_HAND)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.lpcon)
e2:SetOperation(cm.lpop)
c:RegisterEffect(e2)
--Effect 3
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(cm.condition)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
--Effect 4
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SELF_TOGRAVE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.tgccon)
c:RegisterEffect(e2)
end
--Effect 1
--Effect 2
function cm.cfilter(c,tp)
return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK)
end
function cm.lpcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_HAND+LOCATION_ONFIELD,nil)
local b1= Duel.IsPlayerCanRemove(1-tp) and #g>0
and g:IsExists(Card.IsAbleToRemove,1,nil,1-tp,POS_FACEUP,REASON_RULE)
return eg:IsExists(cm.cfilter,1,nil,1-tp) and b1
end
function cm.lpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_HAND+LOCATION_ONFIELD,nil)
local b1= Duel.IsPlayerCanRemove(1-tp) and #g>0
and g:IsExists(Card.IsAbleToRemove,1,nil,1-tp,POS_FACEUP,REASON_RULE)
if not b1 then return end
Duel.Hint(HINT_CARD,0,m)
local rg=g:Filter(Card.IsAbleToRemove,nil,1-tp,POS_FACEUP,REASON_RULE)
local sg=rg:RandomSelect(1-tp,1)
Duel.HintSelection(sg)
Duel.Remove(sg,POS_FACEUP,REASON_RULE)
end
--Effect 3
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandlerPlayer()
return Duel.GetTurnPlayer()~=p and Duel.GetFlagEffect(p,m+m)==0
end
function cm.filter(c)
if c:IsForbidden() or c:IsCode(m) then return false end
return c:IsType(TYPE_CONTINUOUS) and cm.NewVenture(c)
and c:CheckUniqueOnField(tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToDeck()
and c:GetFlagEffect(m)==0
and Duel.GetLocationCount(tp,LOCATION_SZONE)>-1
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e:GetHandler()) end
c:RegisterFlagEffect(m,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,m+m)>0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e)
and Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0
and c:IsLocation(LOCATION_DECK) then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc and Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
Duel.RegisterFlagEffect(tp,m+m,RESET_PHASE+PHASE_END,0,1)
end
end
end
--Effect 4
function cm.tgccon(e)
return Duel.GetCurrentPhase()==PHASE_END
end
--昂扬的大象承载着希望
local m=33701444
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
local e01=Effect.CreateEffect(c)
e01:SetDescription(aux.Stringid(m,0))
e01:SetCategory(CATEGORY_SPECIAL_SUMMON)
e01:SetType(EFFECT_TYPE_QUICK_O)
e01:SetCode(EVENT_FREE_CHAIN)
e01:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e01:SetRange(LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED)
e01:SetCondition(cm.spcon)
e01:SetTarget(cm.sptg)
e01:SetOperation(cm.spop)
c:RegisterEffect(e01)
--Effect 2
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
c:RegisterEffect(e1)
--Effect 3
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(cm.chainop)
c:RegisterEffect(e3)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_NEGATED)
ge1:SetOperation(cm.regop)
ge1:SetLabelObject(ge3)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_CHAIN_DISABLED)
ge2:SetLabelObject(ge3)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_ADJUST)
ge3:SetOperation(cm.adjustop)
Duel.RegisterEffect(ge3,0)
end
end
--all
function cm.f(c)
return c:IsFaceup() and c:IsDisabled()
and c:GetFlagEffect(m+m)==0
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local de,sp=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
if de:GetHandlerPlayer()==sp then
Duel.RegisterFlagEffect(sp,m,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.f,e:GetHandlerPlayer(),LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if #g>0 then
local tc=g:GetFirst()
while tc do
if tc:GetFlagEffect(m+m)==0 then
local p=tc:GetControler()
Duel.RegisterFlagEffect(p,m+m,RESET_PHASE+PHASE_END,0,1)
tc:RegisterFlagEffect(m+m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
tc=g:GetNext()
end
end
end
--Effect 1
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local ct1=Duel.GetFlagEffect(e:GetHandlerPlayer(),m)
local ct2=Duel.GetFlagEffect(e:GetHandlerPlayer(),m+m)
return ct1>=3 or (ct1+ct2)>=4 or ct2>=3
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(m+m)==0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
c:RegisterFlagEffect(m+m,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local b1=c:IsRelateToEffect(e)
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)
if not b1 or b2==0 then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--Effect 2
function cm.splimit(e,c,tp,sumtp,sumpos)
return c:IsLocation(LOCATION_EXTRA)
end
--Effect 3
function cm.chainop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if re and rc:IsControler(e:GetHandlerPlayer()) and ep==tp then
Duel.SetChainLimit(cm.chainlm)
end
end
function cm.chainlm(e,rp,tp)
return tp==rp
end
--闪耀的孔雀摒除了沮丧
local m=33701445
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
local e01=Effect.CreateEffect(c)
e01:SetCategory(CATEGORY_SPECIAL_SUMMON)
e01:SetType(EFFECT_TYPE_QUICK_O)
e01:SetCode(EVENT_FREE_CHAIN)
e01:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e01:SetRange(LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED)
e01:SetCondition(cm.spcon)
e01:SetTarget(cm.sptg)
e01:SetOperation(cm.spop)
c:RegisterEffect(e01)
--Effect 2
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
c:RegisterEffect(e1)
--Effect 3
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetTargetRange(LOCATION_ONFIELD,0)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetValue(1)
c:RegisterEffect(e3)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROYED)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
--all
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
local tp1=tc:GetPreviousControler()
Duel.RegisterFlagEffect(tp1,m,RESET_PHASE+PHASE_END,0,1)
tc=eg:GetNext()
end
end
--Effect 1
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,m)>=3
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(m+m)==0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
c:RegisterFlagEffect(m+m,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local b1=c:IsRelateToEffect(e)
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)
if not b1 or b2==0 then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--Effect 2
function cm.splimit(e,c,tp,sumtp,sumpos)
return c:IsLocation(LOCATION_EXTRA)
end
--Effect 3
--悠闲的河马吞噬了烦恼
local m=33701446
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
local e01=Effect.CreateEffect(c)
e01:SetCategory(CATEGORY_SPECIAL_SUMMON)
e01:SetType(EFFECT_TYPE_QUICK_O)
e01:SetCode(EVENT_FREE_CHAIN)
e01:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e01:SetRange(LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED)
e01:SetCondition(cm.spcon)
e01:SetTarget(cm.sptg)
e01:SetOperation(cm.spop)
c:RegisterEffect(e01)
--Effect 2
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
c:RegisterEffect(e1)
--Effect 3
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_REVERSE_DAMAGE)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(cm.rev)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
cm[0]=0
cm[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DAMAGE)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge3:SetOperation(cm.clear)
Duel.RegisterEffect(ge3,0)
end
end
--all
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
if ep==0 and (bit.band(r,REASON_BATTLE)~=0 or (bit.band(r,REASON_EFFECT)~=0 and rp~=0)) then
cm[0]=cm[0]+ev
elseif ep~=0 and (bit.band(r,REASON_BATTLE)~=0 or (bit.band(r,REASON_EFFECT)~=0 and rp==0)) then
cm[1]=cm[1]+ev
end
end
function cm.clear(e,tp,eg,ep,ev,re,r,rp)
cm[0]=0
cm[1]=0
end
--Effect 1
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return cm[e:GetHandlerPlayer()]>=4000
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(m+m)==0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
c:RegisterFlagEffect(m+m,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local b1=c:IsRelateToEffect(e)
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)
if not b1 or b2==0 then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--Effect 2
function cm.splimit(e,c,tp,sumtp,sumpos)
return c:IsLocation(LOCATION_EXTRA)
end
--Effect 3
function cm.rev(e,re,r,rp,rc)
local tp=e:GetHandlerPlayer()
return bit.band(r,REASON_EFFECT)~=0 or bit.band(r,REASON_BATTLE)~=0
end
--翱翔的老鹰引领着梦想
local m=33701447
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
local e02=Effect.CreateEffect(c)
e02:SetDescription(aux.Stringid(m,3))
e02:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH)
e02:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e02:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e02:SetCode(EVENT_PHASE+PHASE_STANDBY)
e02:SetCountLimit(1)
e02:SetCondition(cm.spcon)
e02:SetTarget(cm.sptg)
e02:SetOperation(cm.spop)
c:RegisterEffect(e02)
--Effect 2
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
c:RegisterEffect(e1)
--Effect 3
local e12=Effect.CreateEffect(c)
e12:SetType(EFFECT_TYPE_FIELD)
e12:SetCode(EFFECT_DRAW_COUNT)
e12:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e12:SetRange(LOCATION_MZONE)
e12:SetTargetRange(1,0)
e12:SetValue(2)
c:RegisterEffect(e12)
end
--Effect 1
function cm.spcon(e)
local tp=e:GetHandlerPlayer()
return Duel.GetTurnPlayer()~=tp and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
function cm.sto(c,tp)
if not c:IsCode(m+1) then return false end
local b1=c:IsAbleToHand()
local b2=c:IsType(TYPE_FIELD)
and c:CheckUniqueOnField(tp) and not c:IsForbidden()
return b1 or b2
end
function cm.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) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e)
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.sto),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp)
and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.sto),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if tc then
local b1=tc:IsType(TYPE_FIELD) and tc:CheckUniqueOnField(tp) and not tc:IsForbidden()
if b1 and (not tc:IsAbleToHand() or Duel.SelectOption(tp,1190,aux.Stringid(m,1))==1) then
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
else
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
end
end
--Effect 2
function cm.splimit(e,c,tp,sumtp,sumpos)
return c:IsLocation(LOCATION_EXTRA)
end
\ No newline at end of file
--那电光普照的未来天堂
local m=33701448
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x46e,LOCATION_FZONE)
--activate
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,2))
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCost(cm.cost)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--Effect 2
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_FZONE)
e2:SetCondition(cm.ctcon1)
e2:SetOperation(cm.ctop1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_NEGATED)
e3:SetRange(LOCATION_FZONE)
e3:SetCondition(cm.ctcon2)
e3:SetOperation(cm.ctop2)
c:RegisterEffect(e3)
--Effect 3 buff+
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_INDESTRUCTABLE)
e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e4:SetRange(LOCATION_FZONE)
e4:SetTargetRange(LOCATION_ONFIELD,0)
e4:SetCondition(cm.bfcon)
e4:SetTarget(cm.infilter)
e4:SetValue(1)
e4:SetLabel(3)
c:RegisterEffect(e4)
local e12=Effect.CreateEffect(c)
e12:SetType(EFFECT_TYPE_FIELD)
e12:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e12:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e12:SetRange(LOCATION_FZONE)
e12:SetTargetRange(LOCATION_ONFIELD,0)
e12:SetCondition(cm.bfcon)
e12:SetTarget(cm.infilter)
e12:SetValue(aux.tgoval)
e12:SetLabel(5)
c:RegisterEffect(e12)
local e14=Effect.CreateEffect(c)
e14:SetType(EFFECT_TYPE_FIELD)
e14:SetCode(EFFECT_IMMUNE_EFFECT)
e14:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e14:SetRange(LOCATION_FZONE)
e14:SetTargetRange(LOCATION_ONFIELD,0)
e14:SetCondition(cm.bfcon)
e14:SetTarget(cm.infilter)
e14:SetValue(cm.efilter)
e14:SetLabel(7)
c:RegisterEffect(e14)
local e15=Effect.CreateEffect(c)
e15:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e15:SetRange(LOCATION_FZONE)
e15:SetCode(EVENT_PHASE+PHASE_STANDBY)
e15:SetCountLimit(1)
e15:SetCondition(cm.drcon)
e15:SetOperation(cm.drop)
c:RegisterEffect(e15)
--Effect 4
local e34=Effect.CreateEffect(c)
e34:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e34:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e34:SetCode(EFFECT_DESTROY_REPLACE)
e34:SetRange(LOCATION_FZONE)
e34:SetTarget(cm.reptg)
c:RegisterEffect(e34)
local e36=Effect.CreateEffect(c)
e36:SetType(EFFECT_TYPE_SINGLE)
e36:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e36:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e36:SetCondition(cm.rmcon)
e36:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e36)
end
--Effect 1
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=1
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_REVERSE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(cm.rev)
if Duel.GetTurnPlayer()==e:GetHandlerPlayer() then
ct=2
end
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,ct)
Duel.RegisterEffect(e1,tp)
end
function cm.rev(e,re,r,rp,rc)
return bit.band(r,REASON_EFFECT)~=0 or bit.band(r,REASON_BATTLE)~=0
end
--Effect 2
function cm.cfilter(c,tp)
return c:GetReasonPlayer()==1-tp
and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
end
function cm.ctcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp)
end
function cm.ctop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=eg:FilterCount(cm.cfilter,nil,tp)
if g>0 then
c:AddCounter(0x46e,g)
end
end
function cm.ctcon2(e,tp,eg,ep,ev,re,r,rp)
local de,dp=Duel.GetChainInfo(ev,CHAININFO_DISABLE_REASON,CHAININFO_DISABLE_PLAYER)
return de and dp~=tp and rp==tp
end
function cm.ctop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:AddCounter(0x46e,1)
end
--Effect 3 buff+
function cm.bfcon(e)
local c=e:GetHandler()
return c:GetCounter(0x46e)>=e:GetLabel()
end
function cm.infilter(e,c)
return c~=e:GetHandler()
end
function cm.efilter(e,re)
return re:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p=e:GetHandlerPlayer()
return Duel.GetTurnPlayer()~=p and c:GetCounter(0x46e)>=10
and Duel.IsPlayerCanDraw(p,1)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p=e:GetHandlerPlayer()
if Duel.SelectYesNo(p,aux.Stringid(m,0)) then
Duel.Hint(HINT_CARD,0,m)
Duel.Draw(p,1,REASON_EFFECT)
end
end
--Effect 4
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=c:GetCounter(0x46e)
if chk==0 then return not c:IsReason(REASON_REPLACE)
and c:IsCanRemoveCounter(tp,0x46e,7,REASON_EFFECT) end
c:AddCounter(0x46e,ct)
c:RemoveCounter(tp,0x46e,14,REASON_EFFECT+REASON_REPLACE)
return true
end
function cm.rmcon(e)
local c=e:GetHandler()
return c:IsFaceup() and c:IsLocation(LOCATION_FZONE)
and c:IsReason(REASON_DESTROY)
end
--纯洁之魂 - 白野
local m=33701449
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,4,cm.lcheck)
c:EnableReviveLimit()
--Effect 1
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(1)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e4)
local e13=Effect.CreateEffect(c)
e13:SetType(EFFECT_TYPE_FIELD)
e13:SetRange(LOCATION_MZONE)
e13:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e13:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e13:SetTargetRange(1,0)
e13:SetTarget(cm.sumlimit)
c:RegisterEffect(e13)
--Effect 2
local e01=Effect.CreateEffect(c)
e01:SetType(EFFECT_TYPE_SINGLE)
e01:SetCode(EFFECT_UPDATE_ATTACK)
e01:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e01:SetRange(LOCATION_MZONE)
e01:SetValue(cm.atkval)
c:RegisterEffect(e01)
--Effect 3
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e7:SetRange(LOCATION_MZONE)
e7:SetCondition(cm.tkcon)
e7:SetValue(aux.imval1)
c:RegisterEffect(e7)
local e8=e7:Clone()
e8:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e8:SetValue(aux.tgoval)
c:RegisterEffect(e8)
--Effect 4
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetCondition(cm.imcon)
e1:SetValue(0)
c:RegisterEffect(e1)
end
--link summon
function cm.lcheck(g,lc)
return g:IsExists(Card.IsLinkType,2,nil,TYPE_TOKEN)
end
--Effect 1
function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return not c:IsType(TYPE_TOKEN)
end
--Effect 2
function cm.atkval(e,c)
local g=e:GetHandler():GetLinkedGroup():FilterCount(Card.IsType,nil,TYPE_TOKEN)
return g*2000
end
--Effect 3
function cm.tkcon(e)
return Duel.IsExistingMatchingCard(Card.IsType,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil,TYPE_TOKEN)
end
--Effect 4
function cm.imcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_ONFIELD,0)==1
end
\ No newline at end of file
--启明之魂 - 赤街
local m=33701450
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x46f)
--link summon
aux.AddLinkProcedure(c,nil,2,4,cm.lcheck)
c:EnableReviveLimit()
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MATERIAL_CHECK)
e1:SetValue(cm.valcheck)
c:RegisterEffect(e1)
local e02=Effect.CreateEffect(c)
e02:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e02:SetCode(EVENT_SPSUMMON_SUCCESS)
e02:SetCondition(cm.regcon)
e02:SetOperation(cm.regop)
e02:SetLabelObject(e1)
c:RegisterEffect(e02)
--Effect 2
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(m,0))
e7:SetCategory(CATEGORY_DRAW)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e7:SetProperty(EFFECT_FLAG_DELAY)
e7:SetCode(EVENT_DRAW)
e7:SetRange(LOCATION_MZONE)
e7:SetCondition(cm.con1)
e7:SetTarget(cm.tg1)
e7:SetOperation(cm.op1)
c:RegisterEffect(e7)
local e12=Effect.CreateEffect(c)
e12:SetDescription(aux.Stringid(m,1))
e12:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e12:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e12:SetProperty(EFFECT_FLAG_DELAY)
e12:SetCode(EVENT_TO_HAND)
e12:SetRange(LOCATION_MZONE)
e12:SetCountLimit(1)
e12:SetCondition(cm.con2)
e12:SetTarget(cm.tg2)
e12:SetOperation(cm.op2)
c:RegisterEffect(e12)
local e11=Effect.CreateEffect(c)
e11:SetDescription(aux.Stringid(m,2))
e11:SetCategory(CATEGORY_DESTROY)
e11:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e11:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e11:SetCode(EVENT_DESTROYED)
e11:SetRange(LOCATION_MZONE)
e11:SetCondition(cm.con3)
e11:SetTarget(cm.tg3)
e11:SetOperation(cm.op3)
c:RegisterEffect(e11)
--Effect 3
local e32=Effect.CreateEffect(c)
e32:SetCategory(CATEGORY_TOGRAVE)
e32:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e32:SetCode(EVENT_LEAVE_FIELD)
e32:SetProperty(EFFECT_FLAG_DELAY)
e32:SetCondition(cm.rlcon)
e32:SetCost(cm.rlcost)
e32:SetTarget(cm.rltg)
e32:SetOperation(cm.rlop)
c:RegisterEffect(e32)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_LEAVE_FIELD_P)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetOperation(cm.fdop)
e5:SetLabelObject(e32)
c:RegisterEffect(e5)
end
--link summon
function cm.lcheck(g,lc)
return g:IsExists(Card.IsLinkAttribute,2,nil,ATTRIBUTE_FIRE)
end
--Effect 1
function cm.valcheck(e,c)
local g=c:GetMaterialCount()
e:SetLabel(g)
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
and e:GetLabelObject():GetLabel()~=0
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local vt=e:GetLabelObject():GetLabel()
local c=e:GetHandler()
c:AddCounter(0x46f,vt)
end
--Effect 2
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetCounter(0x46f)
local lt=c:GetFlagEffect(m)
local b1=ct>0 and lt<=ct
local b2=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
return b1 and b2 and ep~=tp
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=c:GetCounter(0x46f)
local lt=c:GetFlagEffect(m)
local b1=ct>0 and lt<=ct
if chk==0 then return b1 and Duel.IsPlayerCanDraw(tp,1) end
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function cm.cf(c,tp)
return not c:IsReason(REASON_DRAW)
and c:IsControler(1-tp)
and c:IsPreviousLocation(LOCATION_DECK+LOCATION_GRAVE)
end
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetCounter(0x46f)
local lt=c:GetFlagEffect(m)
local b1=ct>0 and lt<=ct
local b2=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
return b1 and b2 and eg:IsExists(cm.cf,1,nil,tp)
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=c:GetCounter(0x46f)
local lt=c:GetFlagEffect(m)
local b1=ct>0 and lt<=ct
if chk==0 then return b1 and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil) end
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_DECK)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsAbleToHand),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.cfilter(c,tp,rp)
return c:IsPreviousControler(tp)
and c:IsPreviousLocation(LOCATION_ONFIELD)
and c:IsReason(REASON_DESTROY)
and c:IsReason(REASON_EFFECT)
and rp==1-tp
end
function cm.con3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetCounter(0x46f)
local lt=c:GetFlagEffect(m)
local b1=ct>0 and lt<=ct
local b2=Duel.GetLP(tp)<Duel.GetLP(1-tp)
return b1 and b2 and eg:IsExists(cm.cfilter,1,nil,tp,rp)
end
function cm.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=c:GetCounter(0x46f)
local lt=c:GetFlagEffect(m)
local b1=ct>0 and lt<=ct
if chk==0 then return b1 and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_ONFIELD,1,nil) end
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
--Effect 3
function cm.fdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetCounter(0x46f)
e:GetLabelObject():SetLabel(ct)
end
function cm.rlcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and e:GetLabel()>0
end
function cm.rlcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function cm.rtg(c,tp)
return Duel.IsPlayerCanSendtoGrave(1-tp,c)
end
function cm.rltg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=e:GetLabel()
local g=Duel.GetMatchingGroup(cm.rtg,tp,0,LOCATION_ONFIELD,nil,tp)
if chk==0 then return ct>0 and #g>=ct end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,ct,0,0)
end
function cm.rlop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
local g=Duel.GetMatchingGroup(cm.rtg,tp,0,LOCATION_ONFIELD,nil,tp)
if ct>0 and #g>=ct then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
local sg=g:FilterSelect(1-tp,cm.rtg,ct,ct,nil,tp)
Duel.HintSelection(sg)
Duel.SendtoGrave(sg,REASON_RULE)
end
end
--渴求之魂 - 碧海
local m=33701451
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,4,cm.lcheck)
c:EnableReviveLimit()
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.lpcon)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
c:RegisterEffect(e2)
--Effect 2
local e12=Effect.CreateEffect(c)
e12:SetDescription(aux.Stringid(m,0))
e12:SetCategory(CATEGORY_RECOVER+CATEGORY_DRAW)
e12:SetType(EFFECT_TYPE_QUICK_O)
e12:SetCode(EVENT_FREE_CHAIN)
e12:SetRange(LOCATION_MZONE)
e12:SetHintTiming(TIMING_BATTLE_START+TIMING_BATTLE_END)
e12:SetCountLimit(1)
e12:SetCondition(cm.descon)
e12:SetTarget(cm.destg)
e12:SetOperation(cm.desop)
c:RegisterEffect(e12)
--Effect 3
local e21=Effect.CreateEffect(c)
e21:SetDescription(aux.Stringid(m,1))
e21:SetType(EFFECT_TYPE_QUICK_O)
e21:SetCode(EVENT_CHAINING)
e21:SetRange(LOCATION_MZONE)
e21:SetCountLimit(1,m)
e21:SetCondition(cm.chcon)
e21:SetTarget(cm.chtg)
e21:SetOperation(cm.chop)
c:RegisterEffect(e21)
end
--link summon
function cm.lcheck(g,lc)
return g:IsExists(Card.IsLinkType,1,nil,TYPE_XYZ)
end
--Effect 1
function cm.lpcon(e)
local lp=Duel.GetLP(e:GetHandlerPlayer())
return lp<=12000
end
--Effect 2
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=e:GetHandler():GetLinkedGroup():Filter(Card.IsFaceup,nil)
local atk=g:GetSum(Card.GetAttack)
if chk==0 then return atk>0 end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,atk)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=c:GetLinkedGroup():Filter(Card.IsFaceup,nil)
local atk=g:GetSum(Card.GetAttack)
if atk>0 and c:IsRelateToEffect(e) then
if Duel.Recover(tp,atk,REASON_EFFECT)~=0
and Duel.IsPlayerCanDraw(1-tp,2)
and Duel.SelectYesNo(1-tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
local def=g:GetSum(Card.GetDefense)
if Duel.Draw(1-tp,2,REASON_EFFECT)~=0
and def>0 then
Duel.BreakEffect()
Duel.Recover(tp,def,REASON_EFFECT)
end
end
end
end
--Effect 3
function cm.chcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function cm.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,2000)
end
function cm.chop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Damage(tp,2000,REASON_EFFECT)<=0 then return end
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.repop)
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,2000,REASON_EFFECT)
end
--孤寂之魂 - 夜城
local m=33701452
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetRange(LOCATION_EXTRA)
e0:SetValue(aux.FALSE)
c:RegisterEffect(e0)
--Effect 1
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_EXTRA)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetCondition(cm.spcon)
e2:SetCost(cm.spcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--Effect 2
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,3))
e1:SetCategory(CATEGORY_GRAVE_SPSUMMON+CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetCondition(cm.con)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
--Effect 1
function cm.ckcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==e:GetHandlerPlayer()
end
function cm.cfilter(c,tp,sc)
return c:IsSetCard(0x144e) and c:IsType(TYPE_MONSTER)
and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
and c:IsAbleToRemoveAsCost()
and Duel.GetLocationCountFromEx(tp,tp,c,sc)>0
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==e:GetHandlerPlayer()
and Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==0
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,3,nil,tp,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,3,3,nil,tp,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:IsLocation(LOCATION_EXTRA) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e)
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
and c:IsLocation(LOCATION_EXTRA) then
if Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)==0 then return end
c:CompleteProcedure()
end
end
--Effect 2
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local b1=not Duel.IsPlayerAffectedByEffect(tp,EFFECT_SKIP_M1)
local b2=not Duel.IsPlayerAffectedByEffect(tp,EFFECT_SKIP_BP)
and not Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_BP)
local b3=not Duel.IsPlayerAffectedByEffect(tp,EFFECT_SKIP_M2)
if chk==0 then return b1 or b2 or b3 end
if b1 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetCode(EFFECT_SKIP_M1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
c:RegisterFlagEffect(m,RESET_PHASE+PHASE_END,0,1)
end
if b2 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetCode(EFFECT_SKIP_BP)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
c:RegisterFlagEffect(m,RESET_PHASE+PHASE_END,0,1)
end
if b3 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetCode(EFFECT_SKIP_M2)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
c:RegisterFlagEffect(m,RESET_PHASE+PHASE_END,0,1)
end
if c:GetFlagEffect(m)>0 then return false end
local off=1
local ops={}
local opval={}
if b1 then
ops[off]=aux.Stringid(m,0)
opval[off-1]=1
off=off+1
end
if b2 then
ops[off]=aux.Stringid(m,1)
opval[off-1]=2
off=off+1
end
if b3 then
ops[off]=aux.Stringid(m,2)
opval[off-1]=3
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))
local sel=opval[op]
if sel==1 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetCode(EFFECT_SKIP_M1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
c:RegisterFlagEffect(m,RESET_PHASE+PHASE_END,0,1)
elseif sel==2 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetCode(EFFECT_SKIP_BP)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
c:RegisterFlagEffect(m,RESET_PHASE+PHASE_END,0,1)
elseif sel==3 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetCode(EFFECT_SKIP_M2)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
c:RegisterFlagEffect(m,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetFlagEffect(m)
Debug.Message(ct)
if ct>0 then
Duel.Hint(HINT_CARD,0,m)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(ct)
e1:SetCondition(cm.thcon)
e1:SetOperation(cm.thop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function cm.sp(c,e,tp)
return c:IsType(TYPE_MONSTER)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
local b1= ct>=1 and Duel.IsPlayerCanDraw(tp,1)
local b2= ct>=2 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.sp),tp,LOCATION_GRAVE,0,1,nil,e,tp)
local b3= ct>=3
return b1 or b2 or b3
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local c=e:GetHandler()
local ct=e:GetLabel()
local b1= ct>=1 and Duel.IsPlayerCanDraw(tp,1)
local b2= ct>=2 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.sp),tp,LOCATION_GRAVE,0,1,nil,e,tp)
local b3= ct>=3
if b1 then
Duel.Draw(tp,1,REASON_EFFECT)
end
if b2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.sp),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
if b3 then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetTargetRange(0,1)
e3:SetValue(cm.aclimit2)
e3:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
Duel.RegisterEffect(e3,tp)
end
c:ResetFlagEffect(m)
end
function cm.aclimit2(e,re,tp)
return re:GetActivateLocation()==LOCATION_HAND
end
\ No newline at end of file
--破灭之魂 - 靛墟
local m=33701453
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,4,cm.lcheck)
c:EnableReviveLimit()
--Effect 1
local e12=Effect.CreateEffect(c)
e12:SetDescription(aux.Stringid(m,0))
e12:SetCategory(CATEGORY_DAMAGE+CATEGORY_DESTROY)
e12:SetType(EFFECT_TYPE_QUICK_O)
e12:SetCode(EVENT_FREE_CHAIN)
e12:SetRange(LOCATION_MZONE)
e12:SetHintTiming(TIMING_BATTLE_START+TIMING_BATTLE_END)
e12:SetCountLimit(1,m)
e12:SetCondition(cm.descon)
e12:SetTarget(cm.destg)
e12:SetOperation(cm.desop)
c:RegisterEffect(e12)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROYED)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
--all
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
local tp1=tc:GetPreviousControler()
Duel.RegisterFlagEffect(tp1,m,RESET_PHASE+PHASE_END,0,1)
tc=eg:GetNext()
end
end
--link summon
function cm.lcheck(g,lc)
return g:IsExists(Card.IsLinkRace,1,nil,RACE_DRAGON)
end
--Effect 1
function cm.descon(e)
local tp=e:GetHandlerPlayer()
local ct1=Duel.GetFlagEffect(tp,m)
local ct2=Duel.GetFlagEffect(1-tp,m)
return ct1>0 or ct2>0
end
function cm.check(c,atk)
return c:GetAttack()<atk and c:IsType(TYPE_MONSTER)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=e:GetHandler():GetLinkedGroup()
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=c:GetLinkedGroup()
if c:IsRelateToEffect(e)
and #g>0
and Duel.Destroy(g,REASON_EFFECT)>0 then
local atk=Duel.GetOperatedGroup():GetSum(Card.GetAttack)
if atk==0 then return end
if Duel.SelectYesNo(1-tp,aux.Stringid(m,0)) then
local kg=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
Duel.ConfirmCards(tp,kg)
if kg:IsExists(cm.check,1,nil,atk) then
local xg=Group.CreateGroup()
local mg=Duel.GetMatchingGroup(cm.check,tp,0,LOCATION_DECK,nil,atk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dc=mg:Select(tp,1,1,nil):GetFirst()
if dc then
xg:AddCard(dc)
mg:RemoveCard(dc)
atk=atk-dc:GetAttack()
local chk=true
while chk do
if atk>0 and mg:IsExists(cm.check,1,nil,atk)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local tc=mg:FilterSelect(tp,cm.check,1,1,nil,atk):GetFirst()
xg:AddCard(tc)
mg:RemoveCard(tc)
atk=atk-tc:GetAttack()
else
chk=false
end
end
Duel.Destroy(xg,REASON_EFFECT)
end
Duel.ShuffleDeck(1-tp)
else
Duel.ShuffleDeck(1-tp)
end
else
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
end
--远航之魂 - 璞玉
local m=33701454
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,cm.mfilter,2,4)
c:EnableReviveLimit()
--extra material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e1:SetRange(LOCATION_EXTRA)
e1:SetTargetRange(LOCATION_SZONE+LOCATION_FZONE,0)
e1:SetValue(cm.matval)
c:RegisterEffect(e1)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,2))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
--Effect 2
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetProperty(EFFECT_FLAG_DELAY)
e6:SetCode(EVENT_DESTROYED)
e6:SetTarget(cm.sptg)
e6:SetOperation(cm.spop)
c:RegisterEffect(e6)
end
--link summon
function cm.mfilter(c)
local b1=c:GetOriginalType()&TYPE_SPELL+TYPE_TRAP~=0 and c:IsLocation(LOCATION_MZONE)
local b2=c:GetOriginalType()&TYPE_MONSTER~=0 and c:IsLocation(LOCATION_SZONE+LOCATION_FZONE)
return b1 or b2
end
--extra material
function cm.matval(e,lc,mg,c,tp)
if e:GetHandler()~=lc then return false,nil end
return true,true
end
--Effect 1
function cm.f(c)
return c:GetOriginalType()&TYPE_MONSTER~=0
end
function cm.cf(c)
return not c:IsForbidden()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local zone=bit.band(c:GetLinkedZone(tp),0x1f)
local g=Duel.GetMatchingGroup(cm.f,tp,LOCATION_SZONE,0,nil)
local mg=c:GetLinkedGroup():Filter(cm.cf,nil)
local b1=Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and #mg>0
and Duel.IsPlayerCanDraw(tp,1)
local b2=#g>0 and Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0,zone)>0 and Duel.IsPlayerCanDraw(tp,1)
if chk==0 then return b1 or b2 end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local zone=bit.band(c:GetLinkedZone(tp),0x1f)
local g=Duel.GetMatchingGroup(cm.f,tp,LOCATION_SZONE,0,nil)
local mg=c:GetLinkedGroup():Filter(cm.cf,nil)
local b1=Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and #mg>0
and Duel.IsPlayerCanDraw(tp,1)
local b2=#g>0 and Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0,zone)>0 and Duel.IsPlayerCanDraw(tp,1)
local opt=0
if b1 and b2 then
opt=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))+1
elseif b1 then opt=1
elseif b2 then opt=2
end
if opt==1 then
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=mg:Select(tp,1,1,nil):GetFirst()
if tc and not tc:IsImmuneToEffect(e) then
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_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
elseif opt==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tc=g:Select(tp,1,1,nil):GetFirst()
local flag=bit.bxor(zone,0xff)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag)
if Duel.MoveToField(tc,tp,tp,LOCATION_MZONE,POS_FACEUP,true,s) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
--Effect 2
function cm.tf(c)
return c:IsFaceup() and c:IsAbleToGrave()
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.tf,tp,LOCATION_SZONE,0,nil)
if chk==0 then return #g>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_SZONE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local b1=c:IsRelateToEffect(e)
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetMatchingGroup(cm.tf,tp,LOCATION_SZONE,0,nil)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)>0
and b1 and b2 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--瑞佳 永恒之扉
local m=33701455
local cm=_G["c"..m]
function cm.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MATERIAL_CHECK)
e1:SetValue(cm.valcheck)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(cm.regcon)
e2:SetOperation(cm.regop)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
end
--Effect 1
function cm.valcheck(e,c)
local g=c:GetMaterial():FilterCount(Card.IsType,nil,TYPE_TOKEN)
e:SetLabel(g)
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
and e:GetLabelObject():GetLabel()~=0
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local vt=e:GetLabelObject():GetLabel()
local c=e:GetHandler()
c:RegisterFlagEffect(m+m*2,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,vt-1))
if vt>=1 then
local e02=Effect.CreateEffect(c)
e02:SetType(EFFECT_TYPE_SINGLE)
e02:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e02:SetValue(cm.indes)
e02:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e02)
end
if vt>=2 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetValue(cm.efilter)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2)
end
if vt>=3 then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,4))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP,TIMINGS_CHECK_MONSTER+TIMING_DAMAGE_STEP)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(cm.rntg)
e1:SetOperation(cm.rnop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
if vt>=4 then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,1)
e3:SetTarget(cm.sumlimit)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e3)
end
end
function cm.indes(e,c)
return not c:IsType(TYPE_TOKEN)
end
function cm.efilter(e,te)
return te:IsActiveType(TYPE_MONSTER) and te:GetOwner()~=e:GetOwner()
end
function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return not c:IsType(TYPE_TOKEN)
end
function cm.rf(c)
return c:IsType(TYPE_MONSTER)
and c:IsAbleToRemove()
and (c:GetAttack()>0 or c:GetDefense()>0)
end
function cm.rntg(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetMatchingGroup(cm.rf,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
local g2=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_MZONE,0,nil,TYPE_TOKEN)
if chk==0 then return #g1>0 and #g2>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g1,1,0,0)
end
function cm.rnop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g1=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.rf),tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
local g2=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_MZONE,0,nil,TYPE_TOKEN)
if #g1==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=g1:Select(tp,1,1,nil)
local rc=rg:GetFirst()
Duel.HintSelection(rg)
if rc and Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)>0
and rc:IsLocation(LOCATION_REMOVED)
and #g2>0 then
local atk=rc:GetAttack()
local def=rc:GetDefense()
if atk>0 or def>0 then
local tc=g2:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetValue(def)
tc:RegisterEffect(e2)
tc=g2:GetNext()
end
end
end
end
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
local m=33701600 local m=33701600
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--Ritual Summon aux.AddCodeList(c,33701601)
--Ritual Summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES+CATEGORY_TOGRAVE) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
......
--联动融合
local m=33703018
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_EXTRA,0):Filter(Card.IsType,nil,TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)
if chk==0 then return #g>0 end
end
function cm.f1(c)
return not c:IsForbidden()
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,LOCATION_EXTRA,0)
local g1=Duel.GetFieldGroup(1-tp,LOCATION_EXTRA,0)
local lose=false
local close=false
if g:FilterCount(Card.IsType,nil,TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)>0 then
local tgp=1-tp
local chkf=1-tp
Duel.ConfirmCards(1-tp,g)
Duel.Hint(HINT_SELECTMSG,tgp,HINTMSG_OPERATECARD)
local setg=g:FilterSelect(tgp,Card.IsType,1,1,nil,TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)
if #setg==0 then return false end
local tc=setg:GetFirst()
Duel.Hint(HINT_CARD,0,tc:GetOriginalCodeRule())
local min,max=aux.GetMaterialListCount(tc)
local cong=Duel.GetMatchingGroup(Card.IsType,tgp,LOCATION_DECK,0,nil,TYPE_MONSTER)
local maxfs=false
if #cong==0 then return false end
if tc:IsType(TYPE_FUSION) and tc:CheckFusionMaterial(cong,nil,chkf) and max>0 and max>10 and Duel.SelectYesNo(tgp,aux.Stringid(m,1)) then
Duel.SendtoGrave(tc,REASON_RULE)
Duel.SendtoDeck(tc,tgp,SEQ_DECKSHUFFLE,REASON_RULE)
mg=Duel.SelectFusionMaterial(1-tp,tc,cong,nil,chkf)
maxfs=true
else
Duel.Hint(HINT_SELECTMSG,tgp,HINTMSG_CONFIRM)
mg=cong:FilterSelect(tgp,cm.f1,1,#cong,nil)
end
Duel.ConfirmCards(tp,mg)
if maxfs~=false then
Duel.SendtoGrave(tc,REASON_RULE)
Duel.SendtoDeck(tc,tc:GetOwner(),SEQ_DECKSHUFFLE,REASON_RULE)
end
Duel.ShuffleExtra(tp)
--
local mctchk=min>0 and max>0 and #mg==min
local xmctchk=min>0 and max>0 and #mg>min and max>10
local spsum=Duel.GetLocationCountFromEx(tgp,tgp,nil,tc)>0 and tc:IsCanBeSpecialSummoned(e,0,tgp,false,false)
local fschk=tc:IsType(TYPE_FUSION) and spsum and tc:CheckFusionMaterial(mg,nil,chkf)
local sychk=spsum and tc:IsSynchroSummonable(nil,mg,#mg-1,#mg-1)
local xchk=spsum and tc:IsXyzSummonable(mg,#mg,#mg)
local chk1=mg:FilterCount(Card.IsAbleToGrave,nil)==#mg
if fschk and xmctchk and maxfs~=false and chk1 and Duel.SelectYesNo(tgp,aux.Stringid(m,0)) then
Duel.BreakEffect()
if Duel.SendtoGrave(mg,REASON_EFFECT)==0 then return false end
Duel.SpecialSummon(tc,0,tgp,tgp,false,false,POS_FACEUP)
lose=true
end
if fschk and mctchk and chk1 and Duel.SelectYesNo(tgp,aux.Stringid(m,0)) then
Duel.BreakEffect()
if Duel.SendtoGrave(mg,REASON_EFFECT)==0 then return false end
Duel.SpecialSummon(tc,0,tgp,tgp,false,false,POS_FACEUP)
lose=true
end
if sychk and chk1 and Duel.SelectYesNo(tgp,aux.Stringid(m,0)) then
Duel.BreakEffect()
if Duel.SendtoGrave(mg,REASON_EFFECT)==0 then return false end
Duel.SpecialSummon(tc,0,tgp,tgp,false,false,POS_FACEUP)
lose=true
end
if xchk and chk1 and Duel.SelectYesNo(tgp,aux.Stringid(m,0)) then
Duel.BreakEffect()
if Duel.SendtoGrave(mg,REASON_EFFECT)==0 then return false end
Duel.SpecialSummon(tc,0,tgp,tgp,false,false,POS_FACEUP)
lose=true
end
end
if lose==true and #g1>0 then
Duel.BreakEffect()
local tgp=tp
local chkf=tp
Duel.ConfirmCards(tp,g1)
Duel.Hint(HINT_SELECTMSG,tgp,HINTMSG_OPERATECARD)
local setg=g1:FilterSelect(tgp,Card.IsType,1,1,nil,TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)
if #setg==0 then return false end
local tc=setg:GetFirst()
Duel.Hint(HINT_CARD,0,tc:GetOriginalCodeRule())
local min,max=aux.GetMaterialListCount(tc)
local cong=Duel.GetMatchingGroup(Card.IsType,tgp,LOCATION_DECK,0,nil,TYPE_MONSTER)
local maxfs=false
if #cong==0 then return false end
if tc:IsType(TYPE_FUSION) and tc:CheckFusionMaterial(cong,nil,chkf) and max>0 and max>10 and Duel.SelectYesNo(tgp,aux.Stringid(m,1)) then
Duel.SendtoGrave(tc,REASON_RULE)
Duel.SendtoDeck(tc,tp,SEQ_DECKSHUFFLE,REASON_RULE)
mg=Duel.SelectFusionMaterial(tp,tc,cong,nil,chkf)
maxfs=true
else
Duel.Hint(HINT_SELECTMSG,tgp,HINTMSG_CONFIRM)
mg=cong:FilterSelect(tgp,cm.f1,1,#cong,nil)
end
Duel.ConfirmCards(1-tp,mg)
if maxfs~=false then
Duel.SendtoGrave(tc,REASON_RULE)
Duel.SendtoDeck(tc,tc:GetOwner(),SEQ_DECKSHUFFLE,REASON_RULE)
end
Duel.ShuffleExtra(1-tp)
--
local mctchk=min>0 and max>0 and #mg==min
local xmctchk=min>0 and max>0 and #mg>min and max>10
local spsum=Duel.GetLocationCountFromEx(tgp,tgp,nil,tc)>0 and tc:IsCanBeSpecialSummoned(e,0,tgp,false,false)
local fschk=tc:IsType(TYPE_FUSION) and spsum and tc:CheckFusionMaterial(mg,nil,chkf)
local sychk=spsum and tc:IsSynchroSummonable(nil,mg,#mg-1,#mg-1)
local xchk=spsum and tc:IsXyzSummonable(mg,#mg,#mg)
local chk1=mg:FilterCount(Card.IsAbleToGrave,nil)==#mg
if fschk and xmctchk and maxfs~=false and chk1 and Duel.SelectYesNo(tgp,aux.Stringid(m,0)) then
Duel.BreakEffect()
if Duel.SendtoGrave(mg,REASON_EFFECT)==0 then return false end
Duel.SpecialSummon(tc,0,tgp,tgp,false,false,POS_FACEUP)
close=true
end
if fschk and mctchk and chk1 and Duel.SelectYesNo(tgp,aux.Stringid(m,0)) then
Duel.BreakEffect()
if Duel.SendtoGrave(mg,REASON_EFFECT)==0 then return false end
Duel.SpecialSummon(tc,0,tgp,tgp,false,false,POS_FACEUP)
close=true
end
if sychk and chk1 and Duel.SelectYesNo(tgp,aux.Stringid(m,0)) then
Duel.BreakEffect()
if Duel.SendtoGrave(mg,REASON_EFFECT)==0 then return false end
Duel.SpecialSummon(tc,0,tgp,tgp,false,false,POS_FACEUP)
close=true
end
if xchk and chk1 and Duel.SelectYesNo(tgp,aux.Stringid(m,0)) then
Duel.BreakEffect()
if Duel.SendtoGrave(mg,REASON_EFFECT)==0 then return false end
Duel.SpecialSummon(tc,0,tgp,tgp,false,false,POS_FACEUP)
close=true
end
end
if close==false and lose==false then
Duel.Damage(1-tp,1000,REASON_EFFECT,true)
Duel.Damage(tp,1000,REASON_EFFECT,true)
Duel.RDComplete()
elseif lose==true and close==false then
Duel.Damage(tp,1000,REASON_EFFECT)
end
end
\ No newline at end of file
...@@ -66,7 +66,8 @@ function cm.initial_effect(c) ...@@ -66,7 +66,8 @@ function cm.initial_effect(c)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetRange(LOCATION_FZONE) e5:SetRange(LOCATION_FZONE)
e5:SetTargetRange(1,1) e5:SetTargetRange(1,1)
e5:SetValue(cm.drval) e5:SetCondition(cm.drcon)
e5:SetValue(2)
c:RegisterEffect(e5) c:RegisterEffect(e5)
--recover --recover
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
...@@ -142,15 +143,8 @@ function cm.sumval(e,c) ...@@ -142,15 +143,8 @@ function cm.sumval(e,c)
local sp=cm.GetNorthPlayer(e:GetHandler(),e:GetHandlerPlayer()) local sp=cm.GetNorthPlayer(e:GetHandler(),e:GetHandlerPlayer())
return c:IsControler(sp) return c:IsControler(sp)
end end
function cm.drval(e) function cm.drcon(e)
local tp=Duel.GetTurnPlayer() return Duel.GetTurnPlayer()==1-cm.GetNorthPlayer(e:GetHandler(),e:GetHandlerPlayer())
local sp=cm.GetNorthPlayer(e:GetHandler(),e:GetHandlerPlayer())
local dr=Duel.GetDrawCount(tp)
if tp==1-sp then
return 2
else
return dr
end
end end
function cm.rmcon(e,tp,eg,ep,ev,re,r,rp) function cm.rmcon(e,tp,eg,ep,ev,re,r,rp)
local sp=cm.GetNorthPlayer(e:GetHandler(),tp) local sp=cm.GetNorthPlayer(e:GetHandler(),tp)
......
--Lily White ~ 白雪飞舞的街道
local m=33711115
local cm=_G["c"..m]
local CTR_PETAL = 0x234
function cm.initial_effect(c)
c:EnableCounterPermit(0x234)
c:EnableReviveLimit()
--synchro summon
aux.AddSynchroProcedure(c,aux.Tuner(nil),aux.NonTuner(Card.IsType,TYPE_TOKEN),1)
--add counter
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m, 0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(cm.cttg)
e1:SetOperation(cm.ctop)
c:RegisterEffect(e1)
--ADD COUNTER
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(cm.bmcost)
e2:SetTarget(cm.bmtg)
e2:SetOperation(cm.bmop)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.idcon)
e3:SetValue(aux.indoval)
c:RegisterEffect(e3)
--negate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,3))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetCondition(cm.condition)
e4:SetCost(cm.cost)
e4:SetOperation(cm.neop)
c:RegisterEffect(e4)
--atkchange
local e10=Effect.CreateEffect(c)
e10:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOEXTRA)
e10:SetDescription(aux.Stringid(m,4))
e10:SetType(EFFECT_TYPE_QUICK_O)
e10:SetCode(EVENT_FREE_CHAIN)
e10:SetRange(LOCATION_MZONE)
e10:SetCost(cm.rccost)
e10:SetTarget(cm.rctg)
e10:SetOperation(cm.rcop)
c:RegisterEffect(e10)
end
function cm.cttg(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then
return true
end
Duel.SetOperationInfo(0, CATEGORY_COUNTER, nil, 2, 0, CTR_PETAL)
end
function cm.ctop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
if c:IsRelateToEffect(e) then
c:AddCounter(CTR_PETAL, 2)
end
end
function cm.idcon(e)
return Duel.GetMatchingGroupCount(Card.IsType,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,nil,TYPE_TOKEN)>0
end
function cm.bmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsType,1,nil,TYPE_TOKEN) end
local g=Duel.SelectReleaseGroup(tp,Card.IsType,1,1,nil,TYPE_TOKEN)
Duel.Release(g,REASON_COST)
end
function cm.bmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanAddCounter(tp,CTR_PETAL,1,e:GetHandler()) end
end
function cm.bmop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or not e:GetHandler():IsFaceup() then return end
e:GetHandler():AddCounter(CTR_PETAL,1)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function cm.cfilter(c)
return c:IsType(TYPE_SPIRIT) and c:IsAbleToRemoveAsCost()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,LOCATION_ONFIELD,LOCATION_ONFIELD,CTR_PETAL,1,REASON_COST) end
Duel.RemoveCounter(tp,LOCATION_ONFIELD,LOCATION_ONFIELD,CTR_PETAL,1,REASON_COST)
end
function cm.neop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateAttack()
end
function cm.rccost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,LOCATION_ONFIELD,LOCATION_ONFIELD,CTR_PETAL,4,REASON_COST) end
Duel.RemoveCounter(tp,LOCATION_ONFIELD,LOCATION_ONFIELD,CTR_PETAL,4,REASON_COST)
end
function cm.rctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToExtra() and Duel.IsExistingMatchingCard(cm.check,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.check(c,e,tp)
return Duel.GetLocationCountFromEx(tp,tp,e:GetHandler(),c)>0 and c:IsCode(33711114) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function cm.rcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,2,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.check,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end
end
--Lily White ~ 白雪将临的街道
local m=33711117
local cm=_G["c"..m]
local CTR_PETAL = 0x234
function cm.initial_effect(c)
c:EnableCounterPermit(0x234)
aux.AddLinkProcedure(c,cm.matfilter,5,5)
--
--add counter
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m, 0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(function(e) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) end)
e1:SetTarget(cm.cttg)
e1:SetOperation(cm.ctop)
c:RegisterEffect(e1)
--reflect battle dam
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
e2:SetValue(1)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(1)
c:RegisterEffect(e3)
--
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetValue(1)
local e5=e4:Clone()
e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetRange(LOCATION_MZONE)
e8:SetCode(EFFECT_UPDATE_ATTACK)
e8:SetValue(function () return Duel.GetMatchingGroupCount(Card.IsType,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,TYPE_TOKEN)*500 end)
local e10=Effect.CreateEffect(c)
e10:SetType(EFFECT_TYPE_SINGLE)
e10:SetCode(EFFECT_PIERCE)
local e12=Effect.CreateEffect(c)
e12:SetType(EFFECT_TYPE_SINGLE)
e12:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e12:SetValue(aux.ChangeBattleDamage(1,DOUBLE_DAMAGE))
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e6:SetRange(LOCATION_MZONE)
e6:SetTargetRange(LOCATION_MZONE,0)
e6:SetTarget(cm.eftg)
e6:SetLabelObject(e4)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetLabelObject(e5)
c:RegisterEffect(e7)
local e9=e6:Clone()
e9:SetLabelObject(e8)
c:RegisterEffect(e9)
local e11=e6:Clone()
e11:SetLabelObject(e10)
c:RegisterEffect(e11)
local e13=e6:Clone()
e13:SetLabelObject(e12)
c:RegisterEffect(e13)
local e14=Effect.CreateEffect(c)
e14:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOEXTRA)
e14:SetDescription(aux.Stringid(m,4))
e14:SetType(EFFECT_TYPE_QUICK_O)
e14:SetCode(EVENT_FREE_CHAIN)
e14:SetRange(LOCATION_MZONE)
e14:SetCost(cm.rccost)
e14:SetTarget(cm.rctg)
e14:SetOperation(cm.rcop)
c:RegisterEffect(e14)
end
function cm.cttg(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then
return true
end
Duel.SetOperationInfo(0, CATEGORY_COUNTER, nil, 2, 0, CTR_PETAL)
end
function cm.ctop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
if c:IsRelateToEffect(e) then
c:AddCounter(CTR_PETAL, 2)
end
end
function cm.matfilter(c)
return c:IsType(TYPE_TOKEN)
end
function cm.eftg(e,c)
return c:IsType(TYPE_TOKEN) and e:GetHandler():GetLinkedGroup() and e:GetHandler():GetLinkedGroup():IsContains(c)
end
function cm.rccost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,LOCATION_ONFIELD,LOCATION_ONFIELD,CTR_PETAL,4,REASON_COST) end
Duel.RemoveCounter(tp,LOCATION_ONFIELD,LOCATION_ONFIELD,CTR_PETAL,4,REASON_COST)
end
function cm.rctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToExtra() and Duel.IsExistingMatchingCard(cm.check,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.check(c,e,tp)
return Duel.GetLocationCountFromEx(tp,tp,e:GetHandler(),c)>0 and c:IsCode(33711115) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function cm.rcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,2,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.check,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end
end
\ No newline at end of file
--哆帝伽姪世滅遮罰耶倒罰豆冥蘇怯度皤佛俱真娑究梵無罰若不即蘇孕世隸佛故諳羯瑟夜室哆大怯波參
local m=33711118
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(function(e,tp) return Duel.GetLP(tp)<=1000 end)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLP(tp)<=1000 then
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,3))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.sumlimit)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCost(cm.cost1)
e2:SetTarget(cm.tg1)
e2:SetOperation(cm.op1)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1)
e3:SetCost(cm.cost2)
e3:SetTarget(cm.tg2)
e3:SetOperation(cm.op2)
Duel.RegisterEffect(e3,tp)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1)
e4:SetCost(cm.cost3)
e4:SetTarget(cm.tg3)
e4:SetOperation(cm.op3)
Duel.RegisterEffect(e4,tp)
end
end
function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return not (c:IsType(TYPE_TOKEN) or c:IsCode(33710928) or c:IsCode(33711115,33711116,33711117,33700412,33701414,33711113,33711114))
end
function cm.check1(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function cm.check2(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToRemoveAsCost()
end
function cm.check3(c)
return c:IsType(TYPE_TRAP) and c:IsAbleToRemoveAsCost()
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.check2,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.check2,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function cm.cost3(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.check3,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.check3,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsType(TYPE_TOKEN) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chk==0 then
if e:GetLabel()==1 then
return Duel.IsExistingTarget(Card.IsType,tp,LOCATION_MZONE,0,1,nil,TYPE_TOKEN) and Duel.IsExistingMatchingCard(cm.check1,tp,LOCATION_GRAVE,0,1,nil)
else
return false
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.check1,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
local tc=g:GetFirst()
e:SetLabelObject(tc)
Duel.SelectTarget(tp,Card.IsType,tp,LOCATION_MZONE,0,1,1,nil,TYPE_TOKEN)
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>3
and Duel.IsPlayerCanSpecialSummonMonster(tp,33710919,0,TYPE_TOKEN+TYPE_MONSTER+TYPE_NORMAL,0,0,4,nil,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local rc=Duel.AnnounceAttribute(tp,1,0xffff)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RACE)
local rac=Duel.AnnounceRace(tp,1,RACE_ALL)
e:SetLabel(rc)
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(rac)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,4,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,4,0,0)
end
function cm.tg3(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_MZONE,0,1,nil,TYPE_TOKEN) end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local lc=e:GetLabelObject()
local atk=lc:GetAttack()
local def=lc:GetDefense()
local race=lc:GetRace()
local att=lc:GetAttribute()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
e2:SetValue(def)
tc:RegisterEffect(e2)
local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e11:SetValue(att)
e11:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e11)
local e21=Effect.CreateEffect(c)
e21:SetType(EFFECT_TYPE_SINGLE)
e21:SetCode(EFFECT_CHANGE_RACE)
e21:SetValue(race)
e21:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e21)
if lc:IsType(TYPE_TUNER) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_TYPE)
e1:SetValue(TYPE_TUNER)
tc:RegisterEffect(e1)
end
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetLabel()
local p,rac=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)>3
and Duel.IsPlayerCanSpecialSummonMonster(tp,33710919,0,TYPE_TOKEN+TYPE_MONSTER+TYPE_NORMAL,0,0,4,rc,rac) then
for i=1,4 do
local token=Duel.CreateToken(tp,33710919)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e11=Effect.CreateEffect(e:GetHandler())
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e11:SetValue(rc)
e11:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e11)
local e21=Effect.CreateEffect(e:GetHandler())
e21:SetType(EFFECT_TYPE_SINGLE)
e21:SetCode(EFFECT_CHANGE_RACE)
e21:SetValue(rac)
e21:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e21)
end
Duel.SpecialSummonComplete()
end
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_MZONE,0,nil,TYPE_TOKEN)
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(2000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetProperty(EFFECT_CANNOT_DISABLE)
e3:SetOperation(cm.rcop)
tc:RegisterEffect(e3)
end
end
function cm.rcop(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,ev,REASON_EFFECT)
end
\ No newline at end of file
--醍醐灌顶!
local m=33711119
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE+CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(cm.handcon)
c:RegisterEffect(e2)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.check,tp,LOCATION_MZONE,0,1,nil) end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0)
end
function cm.check(c)
return c:IsType(TYPE_TOKEN) and (c:IsAttackAbove(1) or c:IsDefenseAbove(1))
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.check,tp,LOCATION_MZONE,0,nil)
local sum=0
for tc in aux.Next(g) do
local atk=tc:GetAttack()
local def=tc:GetDefense()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
e2:SetValue(0)
tc:RegisterEffect(e2)
if tc:IsAttack(0) and tc:IsDefense(0) then sum=sum+def+atk end
end
if sum>0 then
Duel.BreakEffect()
if Duel.Recover(tp,sum,REASON_EFFECT)>0 and Duel.CheckReleaseGroup(tp,Card.IsType,1,nil,TYPE_TOKEN) and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
local g=Duel.SelectReleaseGroup(tp,Card.IsType,1,99,nil,TYPE_TOKEN)
local num=Duel.Release(g,REASON_EFFECT)
Duel.Recover(tp,num*1000,REASON_EFFECT)
end
end
end
function cm.handcon(e)
return Duel.GetMatchingGroupCount(Card.IsType,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,nil,TYPE_TOKEN)>=2
end
\ No newline at end of file
--【日】月下的雏菊之丘
local m=33711120
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x246)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetRange(LOCATION_FZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetTarget(cm.splimit)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_FZONE)
e3:SetCondition(cm.condition)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
--ct
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_COUNTER)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1)
e4:SetCondition(function (e,tp) return Duel.GetTurnPlayer() == tp end)
e4:SetTarget(cm.chtg2)
e4:SetOperation(cm.chop2)
c:RegisterEffect(e4)
end
function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return se:GetHandler()~=e:GetHandler()
end
function cm.check(c)
return c:IsFaceup() and c:IsSetCard(0x440)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(cm.check,tp,LOCATION_MZONE,0,nil)==0
end
function cm.filter(c,e,tp)
return c:IsSetCard(0x440) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
Duel.ConfirmCards(1-tp,tc)
local atk=tc:GetAttack()
local def=tc:GetDefense()
if Duel.Damage(tp,atk+def,REASON_EFFECT)>0 then
Duel.BreakEffect()
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
end
function cm.chtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.chop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local num=c:GetCounter(0x246)
if Duel.GetMatchingGroupCount(cm.check,tp,LOCATION_MZONE,0,nil)==0 then
c:RemoveCounter(tp,0x246,num,REASON_EFFECT)
else
c:AddCounter(0x246,1)
if c:GetCounter(0x246)==3 then
c:SetEntityCode(33711123,true)
c:ReplaceEffect(33711123,0,0)
Duel.Hint(HINT_CARD,1,33711123)
end
end
end
--【月】静海上的蜜月
local m=33711123
local cm=_G["c"..m]
function cm.initial_effect(c)
--back
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_ADJUST)
e0:SetRange(LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_HAND+LOCATION_EXTRA)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE)
e0:SetCountLimit(1)
e0:SetCondition(cm.backon)
e0:SetOperation(cm.backop)
c:RegisterEffect(e0)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EFFECT_SEND_REPLACE)
e1:SetRange(LOCATION_FZONE)
e1:SetTarget(cm.reptg)
e1:SetValue(cm.repval)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetRange(LOCATION_FZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetTarget(cm.splimit)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCondition(cm.condition)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetDescription(aux.Stringid(m,3))
e4:SetCondition(cm.condition1)
e4:SetTarget(cm.target1)
e4:SetOperation(cm.operation1)
c:RegisterEffect(e4)
local e5=e3:Clone()
e5:SetDescription(aux.Stringid(m,4))
e5:SetCondition(cm.condition2)
e5:SetTarget(cm.target2)
e5:SetOperation(cm.operation2)
c:RegisterEffect(e5)
end
function cm.backon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetOriginalCode()==m
end
function cm.backop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:SetEntityCode(m-3)
Duel.ConfirmCards(tp,Group.FromCards(c))
Duel.ConfirmCards(1-tp,Group.FromCards(c))
c:ReplaceEffect(m-3,0,0)
Duel.Hint(HINT_CARD,1,m-3)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
local lp=Duel.GetLP(tp)
Duel.SetLP(tp,lp/2)
return true
else return false end
end
function cm.repval(e,c)
return true
end
function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not ((c:IsRank(5) or c:IsLevel(5)) and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_EARTH)) and se:GetHandler()~=e:GetHandler()
end
function cm.check(c)
return c:IsFacedown() or not c:IsSetCard(0x440)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(cm.check,tp,LOCATION_MZONE,0,nil)==0
end
function cm.filter(c,e,tp)
return ((c:IsSetCard(0x441) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsLevel(5)) or c:IsSetCard(0x3440) or c:IsCode(33700035,33701066)) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
local atk=tc:GetAttack()
local def=tc:GetDefense()
if Duel.Recover(tp,atk+def,REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.BreakEffect()
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
end
function cm.check1(c)
return c:IsFaceup() and c:IsSetCard(0x441)
end
function cm.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(cm.check1,tp,LOCATION_MZONE,0,nil)>0
end
function cm.filter1(c,e,tp)
return c:IsSetCard(0x441) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsLevel(5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
local atk=tc:GetAttack()
if Duel.Recover(tp,atk,REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.BreakEffect()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
local g=Duel.GetMatchingGroup(cm.check1,tp,LOCATION_MZONE,0,nil)
for tc in aux.Next(g) do
tc:AddCounter(0x1021,2)
end
end
end
end
function cm.check2(c)
return c:IsFaceup() and c:IsSetCard(0x3440)
end
function cm.condition2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(cm.check2,tp,LOCATION_MZONE,0,nil)>0
end
function cm.filter2(c,e,tp)
return c:IsSetCard(0x6440) and c:IsSummonableCard() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter2,tp,LOCATION_EXTRA,0,1,2,nil,e,tp)
if g:GetCount()>0 then
local atk=g:GetSum(Card.GetAttack)
if Duel.Recover(tp,atk,REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.BreakEffect()
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
\ No newline at end of file
--内卷
local m=33711301
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return cm.check(chkc) and chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(cm.check,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.check,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,0)
end
function cm.check(c,tp)
return c:IsFaceup() and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,c) and not Duel.IsExistingMatchingCard(cm.check2,tp,LOCATION_MZONE,0,1,c,c:GetAttack(),c:GetDefense())
end
function cm.check2(c,atk,def)
return c:IsFaceup() and c:IsAttackAbove(atk) and c:IsDefenseAbove(def)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,tc)
local sum=0
local atk=tc:GetAttack()
local def=tc:GetDefense()
local op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
if op==0 then
for dc in aux.Next(g) do
local at=dc:GetAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
dc:RegisterEffect(e1)
if dc:IsAttack(atk) then sum=math.abs(atk-at)+sum end
end
else
for dc in aux.Next(g) do
local df=dc:GetDefense()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_DEFENSE)
e1:SetValue(def)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
dc:RegisterEffect(e1)
if dc:IsDefense(def) then sum=math.abs(def-df)+sum end
end
end
if sum>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:SetLabel(sum)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetOperation(cm.damop)
Duel.RegisterEffect(e2,tp)
end
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
local dam=e:GetLabel()
if Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_MZONE,0,1,nil,TYPE_TOKEN) then
dam=dam/2
end
Duel.Damage(tp,dam,REASON_EFFECT)
end
...@@ -91,7 +91,7 @@ function cm.top(e,tp) ...@@ -91,7 +91,7 @@ function cm.top(e,tp)
if sg:GetClassCount(Card.GetCode)==#sg and sg:IsExists(cm.rfilter2,1,nil) then if sg:GetClassCount(Card.GetCode)==#sg and sg:IsExists(cm.rfilter2,1,nil) then
local rg=sg:Filter(cm.rfilter2,nil) local rg=sg:Filter(cm.rfilter2,nil)
Duel.Recover(tp,rg:GetSum(Card.GetAttack),REASON_EFFECT) Duel.Recover(tp,rg:GetSum(Card.GetAttack),REASON_EFFECT)
else elseif sg:GetClassCount(Card.GetCode)<#sg then
Duel.Damage(tp,#sg*2000,REASON_EFFECT) Duel.Damage(tp,#sg*2000,REASON_EFFECT)
end end
end end
......
...@@ -85,19 +85,23 @@ function cm.top(e,tp) ...@@ -85,19 +85,23 @@ function cm.top(e,tp)
local g=Duel.GetOperatedGroup() local g=Duel.GetOperatedGroup()
local sg=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE) local sg=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
Duel.BreakEffect() Duel.BreakEffect()
if sg:GetClassCount(Card.GetCode)==#sg and sg:IsExists(cm.rfilter2,1,nil) then if sg:GetClassCount(Card.GetCode)==#sg then
local rg=sg:Filter(cm.rfilter2,nil) local rct=sg:FilterCount(cm.rfilter2,nil)
local num=Duel.GetMatchingGroupCount(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,nil)
if rct==0 or num==0 then return end
if rct>num then rct=num end
if not Duel.SelectYesNo(tp,aux.Stringid(9910024,0)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg1=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,#rg,nil) local sg1=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,rct,nil)
if sg1:GetCount()>0 then if sg1:GetCount()>0 then
Duel.SendtoHand(sg1,nil,REASON_EFFECT) Duel.SendtoHand(sg1,nil,REASON_EFFECT)
end end
else elseif sg:GetClassCount(Card.GetCode)<#sg then
local num=Duel.GetMatchingGroupCount(Card.IsAbleToGrave,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil) local num=Duel.GetMatchingGroupCount(Card.IsAbleToGrave,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
if num<1 then return end if num<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) if num>#sg then num=#sg end
local sg1=Duel.SelectMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD+LOCATION_HAND,0,num,#sg,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg1=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_ONFIELD+LOCATION_HAND,0,num,num,nil)
if sg1:GetCount()>0 then if sg1:GetCount()>0 then
Duel.SendtoGrave(sg1,REASON_EFFECT) Duel.SendtoGrave(sg1,REASON_EFFECT)
end end
......
...@@ -18,13 +18,19 @@ function cm.initial_effect(c) ...@@ -18,13 +18,19 @@ function cm.initial_effect(c)
e2:SetCondition(cm.discon) e2:SetCondition(cm.discon)
e2:SetOperation(cm.disop) e2:SetOperation(cm.disop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--leav effect --leave
local e3=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e6:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_DELAY) e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_LEAVE_FIELD) e6:SetCode(EVENT_LEAVE_FIELD_P)
e3:SetOperation(cm.tdop) e6:SetOperation(cm.checkop)
c:RegisterEffect(e3) c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_LEAVE_FIELD)
e7:SetLabelObject(e6)
e7:SetOperation(cm.leave)
c:RegisterEffect(e7)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetDecktopGroup(tp,3) local g=Duel.GetDecktopGroup(tp,3)
...@@ -49,28 +55,39 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -49,28 +55,39 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_DECK,0,ac/800,ac/800,nil) local rg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_DECK,0,ac/800,ac/800,nil)
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT) Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
end end
function cm.remfilter(c) function cm.remfilter(c,tp)
return c:GetFlagEffect(m)<1 return c:GetFlagEffect(m)<1 and c:IsControler(tp)
end end
function cm.discon(e,tp,eg,ep,ev,re,r,rp) function cm.discon(e,tp,eg,ep,ev,re,r,rp)
local sg=eg:Filter(cm.remfilter,nil) local sg=eg:Filter(cm.remfilter,nil,tp)
return sg:GetCount()>0 return sg:GetCount()>0
end end
function cm.disop(e,tp,eg,ep,ev,re,r,rp) function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
local num=Duel.Remove(eg:Filter(cm.remfilter,nil),POS_FACEDOWN,REASON_RULE) local num=Duel.Remove(eg:Filter(cm.remfilter,nil,tp),POS_FACEDOWN,REASON_RULE)
if num<1 then return end if num<1 then return end
local tg=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil) local tg=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
local sg=tg:Filter(Card.IsAbleToHand,nil) local sg=tg:Filter(Card.IsAbleToHand,nil)
if sg:GetCount()>0 then if sg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=sg:RandomSelect(tp,1) local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst() local tc=tg:GetFirst()
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD-RESET_TOHAND,0,0) tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD-RESET_TOHAND,0,0)
Duel.SendtoHand(tc,tp,REASON_EFFECT) Duel.SendtoHand(tc,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
end end
end end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp) function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(e:GetHandlerPlayer(),500*Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_REMOVED,0,nil),REASON_EFFECT) local c=e:GetHandler()
end if c:IsDisabled() then
\ No newline at end of file e:SetLabel(1)
else e:SetLabel(0) end
end
function cm.leave(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_REMOVED,0,nil)
if e:GetLabelObject():GetLabel()==0 and c:IsPreviousControler(tp) and ct>0 then
Duel.Hint(HINT_CARD,0,m)
Duel.Damage(tp,500*ct,REASON_EFFECT)
end
end
--摸头杀法
local m=33711801
local cm=_G["c"..m]
function cm.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1)
e2:SetCondition(function (e,tp) return Duel.GetTurnPlayer() == tp end)
e2:SetTarget(cm.chtg2)
e2:SetOperation(cm.chop2)
c:RegisterEffect(e2)
end
function cm.chtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.chop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
for tc in aux.Next(sg) do
local atk=tc:GetAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(100)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
if tc:GetAttack()-atk==100 then
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,0)
local ct=tc:GetFlagEffect(m)
if ct==1 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
end
if ct==3 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
end
if ct==5 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(cm.efilter)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
end
if ct==10 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_LEAVE_FIELD_P)
e1:SetOperation(cm.leaveop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
if ct==15 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(10000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
tc:RegisterEffect(e2,true)
end
end
end
end
function cm.spcheck(c,e,tp,rc)
return c:IsCode(rc:GetCode()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function cm.leaveop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsFacedown() then return end
local effp=e:GetHandler():GetControler()
if not Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spcheck),tp,LOCATION_GRAVE,0,1,nil,e,effp,e:GetHandler()) or Duel.SelectYesNo(tp,aux.Stringid(m,2)) then return end
Duel.Hint(HINT_SELECTMSG,effp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spcheck),tp,LOCATION_GRAVE,0,1,1,nil,e,effp,e:GetHandler())
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,effp,effp,false,false,POS_FACEUP)
e:Reset()
end
end
function cm.efilter(e,re)
return e:GetHandlerPlayer()~=re:GetOwnerPlayer()
end
\ No newline at end of file
--狂热精武门!
local m=33711901
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP+CATEGORY_LEAVE_GRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return cm.check(chkc) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(cm.check,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.check2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.check,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.check(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL)
end
function cm.check2(c)
return not c:IsForbidden() and c:IsType(TYPE_EQUIP)
end
function cm.filter2(c)
return c:IsAbleToGrave() and c:IsType(TYPE_EQUIP)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dc=Duel.GetFirstTarget()
local ct=Duel.GetLocationCount(tp,LOCATION_SZONE)
if not dc:IsRelateToEffect(e) or not dc:IsFaceup() then return end
if ct>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.check2),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,ct,nil)
for tc in aux.Next(g) do
if not Duel.Equip(tp,tc,dc) then return end
--Add Equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(cm.eqlimit)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_TRIGGER)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
if Duel.GetMatchingGroupCount(nil,tp,LOCATION_MZONE,0,dc)==0 and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.filter2,tp,LOCATION_DECK,0,1,99,nil)
if g:GetCount()>0 then
local num=Duel.SendtoGrave(g,REASON_EFFECT)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(num*500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
dc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
dc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,3))
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e3:SetTargetRange(1,0)
e3:SetTarget(cm.sumlimit)
Duel.RegisterEffect(e3,tp)
end
end
end
function cm.eqlimit(e,c)
return e:GetOwner()==c
end
function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return true
end
\ No newline at end of file
--大陆的使者
local m=33711902
local cm=_G["c"..m]
function cm.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_GRAVE,0,nil)
local g2=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_GRAVE,0,nil,0x3442)
return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 and (g:GetClassCount(Card.GetCode)>=15 or g2:CheckSubGroup(aux.dncheck,5))
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
if Duel.GetCurrentPhase()==PHASE_STANDBY then
e1:SetCondition(cm.spcon2)
e1:SetLabel(Duel.GetTurnCount())
end
Duel.RegisterEffect(e1,tp)
end
function cm.spfilter(c)
local code=c:GetOriginalCode()
return c:IsSetCard(0x3442) and c:IsAbleToHand()
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function cm.spcon2(e,tp,eg,ep,ev,re,r,rp)
local sg=Group.CreateGroup()
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_GRAVE,0,nil)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(m)>0 and tc:IsAbleToHand() then
sg:AddCard(tc)
end
sg:Merge(g)
return Duel.GetTurnCount()>e:GetLabel() and Duel.GetTurnPlayer()==tp
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE+LOCATION_DECK,0,nil)
if g:GetCount()>=5 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local rg=g:SelectSubGroup(tp,aux.dncheck,false,5,5,nil)
Duel.SendtoHand(rg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,rg)
end
e:Reset()
end
\ No newline at end of file
--心散华·困兽决斗
local m=33711903
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
return Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)==1 and Duel.GetMatchingGroupCount(Card.IsFaceup,1-tp,LOCATION_MZONE,0,nil)==1
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g1=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g2=Duel.SelectTarget(tp,Card.IsFaceup,1-tp,LOCATION_MZONE,0,1,1,nil)
g1:Merge(g2)
if Duel.GetMatchingGroupCount(nil,tp,LOCATION_SZONE,0,e:GetHandler())==0 then
e:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
end
end
function cm.check(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL)
end
function cm.check2(c)
return not c:IsForbidden() and c:IsType(TYPE_EQUIP)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
for tc in aux.Next(tg) do
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_CANNOT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(cm.efilter)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE+EFFECT_CANNOT_DISABLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BATTLE_START)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetHintTiming(TIMING_DAMAGE_STEP)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.atkcon)
e3:SetOperation(cm.atkop)
tc:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_BATTLE_DAMAGE)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetCondition(cm.condition2)
e4:SetOperation(cm.operation2)
tc:RegisterEffect(e4)
end
end
function cm.efilter(e,re)
return e:GetHandlerPlayer()~=re:GetOwnerPlayer() and re:GetOwner()~=e:GetOwner()
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToBattle() then
return false
end
local a=Duel.GetAttacker()
local b=Duel.GetAttackTarget()
if b and b==e:GetHandler() then
return a:GetFlagEffect(m)==0
else
return b and b:GetFlagEffect(m)==0
end
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local b=Duel.GetAttackTarget()
if b and b==e:GetHandler() then
Duel.SendtoGrave(a,REASON_EFFECT)
elseif a==e:GetHandler() then
Duel.SendtoGrave(b,REASON_EFFECT)
end
end
function cm.condition2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local a=Duel.GetAttacker()
local t=Duel.GetAttackTarget()
return (t==c and a:GetFlagEffect(m)>0)
or (a==c and t and t:GetFlagEffect(m)>0)
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
local g=Group.FromCards(a,d)
local rg=g:GetMinGroup(Card.GetAttack)
if Duel.SendtoGrave(rg,REASON_EFFECT) then
local og=Duel.GetOperatedGroup()
local tc=og:GetFirst()
local effp=tc:GetPreviousControler()
if Duel.IsExistingMatchingCard(cm.sp,effp,LOCATION_DECK,0,1,nil,e,effp,tc) and Duel.GetLocationCount(effp,LOCATION_MZONE)>0 and Duel.SelectYesNo(effp,aux.Stringid(m,3)) then
local dg=Duel.GetFieldGroup(effp,LOCATION_DECK,0)
Duel.ConfirmCards(1-effp,dg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(effp,cm.sp,effp,LOCATION_DECK,0,1,1,nil,e,effp,tc)
Duel.SpecialSummon(sg,0,effp,effp,false,false,POS_FACEUP)
else
local lp=Duel.GetLP(effp)
Duel.SetLP(effp,lp/2)
end
end
end
\ No newline at end of file
local m=33712000
local cm=_G["c"..m]
cm.name="赛扬娜拉"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
Debug.Message(Duel.GetTurnCount())
return Duel.GetTurnCount()>=3
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local check1=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil)
local check2=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) or e:GetHandler():IsLocation(LOCATION_HAND)
local check3=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil)
local check4=Duel.GetDecktopGroup(tp,15):FilterCount(Card.IsAbleToRemove,nil)==15 and Duel.GetDecktopGroup(1-tp,15):FilterCount(Card.IsAbleToRemove,nil)==15
if chk==0 then return (check1 or check2 or check3 or check4) and Duel.GetLP(tp)>=4000 end
Duel.SetChainLimit(aux.FALSE)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_SZONE,LOCATION_SZONE,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local g3=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
local g4=Duel.GetDecktopGroup(tp,15)
g4:Merge(Duel.GetDecktopGroup(1-tp,15))
g4=g4:Filter(Card.IsAbleToRemove,nil)
local sel=0
if g1 and #g1>0 and Duel.GetLP(tp)>=4000 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.SetLP(tp,Duel.GetLP(tp)-4000)
Duel.Remove(g1,POS_FACEUP,REASON_EFFECT)
sel=sel+1
end
if g2 and #g2>0 and Duel.GetLP(tp)>=4000 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.SetLP(tp,Duel.GetLP(tp)-4000)
Duel.Remove(g2,POS_FACEUP,REASON_EFFECT)
sel=sel+1
end
if g3 and #g3>0 and Duel.GetLP(tp)>=4000 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.SetLP(tp,Duel.GetLP(tp)-4000)
Duel.Remove(g3,POS_FACEUP,REASON_EFFECT)
sel=sel+1
end
if g4 and #g4==30 and Duel.GetLP(tp)>=4000 and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
Duel.SetLP(tp,Duel.GetLP(tp)-4000)
Duel.DisableShuffleCheck()
Duel.Remove(g4,POS_FACEUP,REASON_EFFECT)
sel=sel+1
end
if sel==4 and Duel.CheckLPCost(tp,8000) and Duel.SelectYesNo(tp,aux.Stringid(m,4)) then
Duel.BreakEffect()
Duel.PayLPCost(tp,8000)
Duel.Damage(1-tp,Duel.GetLP(1-tp),REASON_EFFECT)
end
end
\ No newline at end of file
local m=33712002
local cm=_G["c"..m]
cm.name="俊达萌"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RECOVER)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1)
e3:SetCondition(cm.condition)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)==0
end
function cm.target(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) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.Recover(tp,3000,REASON_EFFECT)
Duel.SkipPhase(tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
if Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,0,c)==0 then
local op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1),aux.Stringid(m,2))
if op==0 then
Duel.BreakEffect()
Duel.SendtoDeck(c,nil,SEQ_DECKTOP,REASON_EFFECT)
elseif op==1 then
Duel.BreakEffect()
Duel.SendtoDeck(c,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
end
end
end
end
\ No newline at end of file
local m=33712003
local cm=_G["c"..m]
cm.name="收容"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_LEAVE_FIELD_P)
e2:SetOperation(cm.checkop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetOperation(cm.leaveop)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
if chk==0 then return g:IsExists(Card.IsAbleToRemove,1,e:GetHandler(),tp,POS_FACEDOWN,REASON_EFFECT) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD):Filter(Card.IsAbleToRemove,e:GetHandler(),tp,POS_FACEDOWN,REASON_EFFECT)
if g and #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc and Duel.Remove(tc,POS_FACEDOWN,REASON_EFFECT) then
e:GetHandler():SetCardTarget(tc)
end
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsDisabled() then
e:SetLabel(1)
else e:SetLabel(0) end
end
function cm.leaveop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local tc=e:GetHandler():GetFirstCardTarget()
if tc and tc:IsLocation(LOCATION_REMOVED) and tc:IsPosition(POS_FACEDOWN) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
\ No newline at end of file
local m=33712004
local cm=_G["c"..m]
cm.name="卑命抗争"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 and Duel.GetFieldGroup(tp,LOCATION_DECK,0):FilterCount(Card.IsAbleToHand,nil)>0 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,nil,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 then return end
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0):Filter(Card.IsAbleToHand,nil)
local max=7
if #g<max then max=#g end
local t={}
local i=1
for i=1,max do t[i]=i end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NUMBER)
local num=Duel.AnnounceNumber(tp,table.unpack(t))
local sg=g:Select(1-tp,num,num,nil)
if sg and #sg>0 and Duel.SendtoHand(sg,nil,REASON_EFFECT)>0 then
Duel.ConfirmCards(1-tp,sg)
Duel.SetLP(1-tp,Duel.GetLP(1-tp)+num*1000)
end
end
\ No newline at end of file
local m=33712005
local cm=_G["c"..m]
cm.name="向虚空怀念"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(aux.exccon)
e2:SetCost(cm.setcost)
e2:SetTarget(cm.settg)
e2:SetOperation(cm.setop)
c:RegisterEffect(e2)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsChainNegatable(ev)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local num=math.ceil(Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)/2)
local g=Duel.GetDecktopGroup(tp,num)
if chk==0 then return g:FilterCount(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN,REASON_COST)==num end
Duel.Remove(g,POS_FACEDOWN,REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function cm.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetDecktopGroup(tp,20)
if chk==0 then return g:FilterCount(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN,REASON_COST)==20 end
Duel.Remove(g,POS_FACEDOWN,REASON_COST)
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SSet(tp,c)
end
end
\ No newline at end of file
local m=33712006
local cm=_G["c"..m]
cm.name="黄昏道"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>=2 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,nil,1-tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local op_deck=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
if #op_deck<2 then return end
local t={}
local i=2
local max=op_deck:GetCount()
for i=2,max do t[i-1]=i end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NUMBER)
local num=Duel.AnnounceNumber(1-tp,table.unpack(t))
Duel.ConfirmDecktop(1-tp,num)
local g=Duel.GetDecktopGroup(1-tp,num)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local tc=g:Select(1-tp,1,1,nil):GetFirst()
if tc and Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 then
Duel.ConfirmCards(tp,tc)
g:RemoveCard(tc)
Duel.DisableShuffleCheck()
local tg_num=Duel.SendtoDeck(g,tp,SEQ_DECKTOP,REASON_EFFECT)
Duel.ShuffleDeck(tp)
Duel.DiscardDeck(tp,tg_num,REASON_EFFECT)
end
end
\ No newline at end of file
local m=33712007
local cm=_G["c"..m]
cm.name="逆天而为?"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
if chk==0 then return g:FilterCount(Card.IsAbleToHand,nil)>=2 end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local op_deck=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
if #op_deck<2 then return end
if Duel.IsChainDisablable(0) and e:GetHandler():IsSSetable() and Duel.SelectYesNo(1-tp,aux.Stringid(m,0)) then
Duel.SetLP(1-tp,math.ceil(Duel.GetLP(tp)/2))
Duel.NegateEffect(0)
Duel.SSet(1-tp,e:GetHandler(),1-tp)
e:GetHandler():CancelToGrave()
Duel.MoveToField(e:GetHandler(),1-tp,1-tp,LOCATION_SZONE,POS_FACEDOWN,false)
Duel.RaiseEvent(Group.FromCards(e:GetHandler()),EVENT_SSET,e,REASON_EFFECT,1-tp,1-tp,0)
return
end
local max=20
if #op_deck<max then max=#op_deck end
local p=1-tp
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 then p=tp end
local t={}
local i=2
for i=2,max do t[i-1]=i end
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_NUMBER)
local num=Duel.AnnounceNumber(p,table.unpack(t))
Duel.ConfirmDecktop(1-tp,num)
local g=Duel.GetDecktopGroup(1-tp,num)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local sg=g:Select(1-tp,math.ceil(num/2),math.ceil(num/2),nil)
if sg and Duel.SendtoHand(sg,1-tp,REASON_EFFECT)>0 then
Duel.ConfirmCards(tp,sg)
g:Sub(sg)
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
local m=33712008
local cm=_G["c"..m]
cm.name="小心身后!"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(cm.target)
e2:SetOperation(cm.activate2)
c:RegisterEffect(e2)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_HAND,0,1,nil,TYPE_EFFECT) end
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
end
function cm.activate1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
local c=Duel.SelectMatchingCard(tp,Card.IsType,tp,LOCATION_HAND,0,1,1,nil,TYPE_EFFECT):GetFirst()
if c then
tc:ReplaceEffect(c:GetCode(),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(0)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetOperation(cm.endop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
tc:RegisterEffect(e1,true)
end
function cm.endop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEDOWN,REASON_RULE)
end
\ No newline at end of file
local m=33712009
local cm=_G["c"..m]
cm.name="草精 Eryi"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(cm.atkval)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.atkval(e,c)
local tp=e:GetHandlerPlayer()
local val=0
if Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_MZONE,0,e:GetHandler())==0 then val=val+1000 end
if Duel.GetFieldGroupCount(tp,LOCATION_SZONE,0)==0 then val=val+1000 end
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 then val=val+2000 end
return val
end
function cm.cfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp) and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function cm.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) end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(m,0))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetOperation(cm.endop)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e3:SetCountLimit(1)
c:RegisterEffect(e3)
end
end
function cm.endop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Recover(tp,e:GetHandler():GetAttack(),REASON_EFFECT)>0 then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end
\ No newline at end of file
--强欲与强欲与强欲之壶
local m=33712019
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCategory(CATEGORY_DRAW)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local num=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if chk==0 then return Duel.IsPlayerCanDraw(tp,num) end
Duel.Draw(tp,num,REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local a=Duel.IsPlayerCanDraw(tp,2) and Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_DECK,1,nil)
local b=Duel.IsPlayerCanDraw(tp,202) and not Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_DECK,1,nil)
if chk==0 then return a or b end
local num=2
if not Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_DECK,1,nil) then
num=202
end
Duel.SetTargetParam(num)
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,num,tp,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
\ No newline at end of file
...@@ -111,7 +111,7 @@ end ...@@ -111,7 +111,7 @@ end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=e:GetHandler():GetOverlayGroup() local g=e:GetHandler():GetOverlayGroup()
if chk==0 then if chk==0 then
local res=e:GetLabel()==0 or #g>2 local res=e:GetLabel()==0 or #g>=2
e:SetLabel(0) e:SetLabel(0)
return res and g:IsExists(Card.IsAbleToHand,1,nil) return res and g:IsExists(Card.IsAbleToHand,1,nil)
end end
......
--动物朋友虚拟YouTuber 洪堡企鹅与非洲企鹅 || Anifriends VTuber Hululu & Cape
--Scripted by: XGlitchy30
local s,id = GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
aux.AddSynchroMixProcedure(c,nil,nil,nil,nil,2,2,s.gcheck(c))
--Special summon procedure
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(id,0))
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(s.sprcon)
e0:SetTarget(s.sprtg)
e0:SetOperation(s.sprop)
c:RegisterEffect(e0)
--Gain effects
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(s.condition)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
local e1x=Effect.CreateEffect(c)
e1x:SetType(EFFECT_TYPE_SINGLE)
e1x:SetCode(EFFECT_MATERIAL_CHECK)
e1x:SetValue(s.valcheck)
c:RegisterEffect(e1x)
e1:SetLabelObject(e1x)
end
function s.gcheck(c)
return function(g)
return g:GetClassCount(Card.GetCode)==#g and g:GetSum(Card.GetSynchroLevel,c)==8
end
end
function s.sprfilter(c)
return c:IsFaceup() and c:IsAbleToGraveAsCost()
end
function s.spgcheck(g,sync,tp)
return s.gcheck(sync)(g) and Duel.GetLocationCountFromEx(tp,tp,g,sync)>0
end
function s.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_MZONE,0,nil)
return g:CheckSubGroup(s.spgcheck,2,2,c,tp)
end
function s.sprtg(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_MZONE,0,nil)
if #g<=0 then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local mg=g:SelectSubGroup(tp,s.spgcheck,true,2,2,c,tp)
if #mg==2 then
mg:KeepAlive()
e:SetLabelObject(mg)
return true
end
return false
end
function s.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
if not g then return end
c:SetMaterial(g)
Duel.SendtoGrave(g,REASON_COST)
end
function s.valcheck(e,c)
local g=c:GetMaterial()
local effs=0
if g:IsExists(Card.IsType,1,nil,TYPE_TUNER) then
effs=effs|0x1
end
if g:IsExists(Card.IsSetCard,1,nil,0x442) then
effs=effs|0x2
end
e:SetLabel(effs)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():GetLabel()~=0
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local effs=e:GetLabelObject():GetLabel()
if effs&0x1>0 then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(s.tdtg)
e1:SetOperation(s.tdop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,3))
end
if effs&0x2>0 then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,4))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(s.tgtg)
e1:SetOperation(s.tgop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,5))
end
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(Card.IsAbleToDeck),tp,LOCATION_GRAVE,0,nil)
if #g<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg=g:SelectSubGroup(tp,aux.dncheck,false,1,3)
if #tg>0 then
Duel.HintSelection(tg)
if Duel.SendtoDeck(tg,nil,SEQ_DECKTOP,REASON_EFFECT)>0 then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_DECK)
if #og==0 then return end
if #og>1 then
for p=tp,1-tp,1-2*tp do
local dg=og:Filter(Card.IsControler,nil,p)
if #dg>1 then
Duel.SortDecktop(tp,p,#dg)
for i=1,#dg do
local mg=Duel.GetDecktopGroup(p,1)
Duel.MoveSequence(mg:GetFirst(),SEQ_DECKBOTTOM)
end
end
end
end
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 and Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 and Duel.SendtoGrave(tg,REASON_EFFECT)>0 and tg:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
\ No newline at end of file
--Confusione Totale - Ritiro
--Scripted by: XGlitchy30
local s,id=GetID()
xpcall(function() require("expansions/script/glitchylib_vsnemo") end,function() require("script/glitchylib_vsnemo") end)
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1)
e1:SetCondition(s.condition)
e1:SetOperation(s.activate)
e1:SetHintTiming(TIMING_END_PHASE,0)
c:RegisterEffect(e1)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_TO_GRAVE)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function s.cfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_HAND)
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local ct=eg:FilterCount(s.cfilter,nil,p)
if ct>0 then
for i=1,ct do
Duel.RegisterFlagEffect(p,id,RESET_PHASE+PHASE_END,0,1)
end
end
end
if Duel.GetFlagEffect(tp,id+100)<=0 then
Duel.RegisterFlagEffect(tp,id+100,RESET_PHASE+PHASE_END,0,1,0)
end
local saved_levels = Duel.GetFlagEffectLabel(tp,id+100)
local incr_lv=0
for tc in aux.Next(eg) do
if tc:HasLevel() then
local lv=tc:GetLevel()
if saved_levels&(2^lv)==0 and incr_lv&(2^lv)==0 then
incr_lv = incr_lv + (2^lv)
end
end
end
Duel.UpdateFlagEffectLabel(tp,id+100,incr_lv)
end
function s.condition(e,tp)
return Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_END and Duel.GetFlagEffect(1-tp,id)>=2
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(1-tp,id)<2 then return false end
local c=e:GetHandler()
local rct = Duel.GetTurnPlayer()~=tp and 1 or 2
local saved_levels = Duel.GetFlagEffectLabel(tp,id+100)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(LOCATION_ALL,LOCATION_ALL)
e1:SetTarget(s.distg)
e1:SetLabel(saved_levels)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,rct)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetTargetRange(0,1)
e2:SetValue(s.aclimit)
e2:SetLabel(saved_levels)
e2:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,rct)
Duel.RegisterEffect(e2,tp)
--
if Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
local lp=Duel.GetLP(tp)
Duel.SetLP(tp,math.ceil(lp/2))
if math.abs(Duel.GetLP(tp)*2 - lp)<=1 then
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,3))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(s.damcon)
e3:SetOperation(s.damop)
e3:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,rct)
Duel.RegisterEffect(e3,tp)
end
end
end
function s.distg(e,c)
local saved_levels = e:GetLabel()
return c:HasLevel() and saved_levels&(2^c:GetLevel())~=0
end
function s.aclimit(e,re,tp)
local saved_levels = e:GetLabel()
local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and rc and rc:HasLevel() and saved_levels&(2^rc:GetLevel())~=0
end
function s.df(c,tp)
return c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=tp
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.df,1,nil,tp)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,id)
local ct=eg:FilterCount(s.df,nil,tp)
Duel.Damage(1-tp,ct*1000,REASON_EFFECT)
end
\ No newline at end of file
--Confusione Totale - Confidenza
--Scripted by: XGlitchy30
local s,id=GetID()
xpcall(function() require("expansions/script/glitchylib_vsnemo") end,function() require("script/glitchylib_vsnemo") end)
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1)
e1:SetCondition(s.condition)
e1:SetOperation(s.activate)
e1:SetHintTiming(TIMING_END_PHASE,0)
c:RegisterEffect(e1)
if not s.global_check then
s.global_check=true
Duel.RegisterFlagEffect(0,GLITCHY_ENABLE_TEST_CHAMBER,0,0,1)
end
end
function s.condition(e,tp)
return Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_END and Duel.GetLP(tp)-Duel.GetLP(1-tp)>=3000
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLP(tp)-Duel.GetLP(1-tp)<3000 then return false end
local c=e:GetHandler()
local rct = Duel.GetTurnPlayer()~=tp and 1 or 2
--immune
local g1=Effect.CreateEffect(c)
g1:SetDescription(aux.Stringid(id,3))
g1:SetType(EFFECT_TYPE_FIELD)
g1:SetCode(EFFECT_IMMUNE_EFFECT)
g1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CLIENT_HINT)
g1:SetTargetRange(LOCATION_ONFIELD,0)
g1:SetValue(s.efilter)
g1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,rct)
Duel.RegisterEffect(g1,tp)
local g2=Effect.CreateEffect(c)
g2:SetDescription(aux.Stringid(id,4))
g2:SetType(EFFECT_TYPE_FIELD)
g2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
g2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CLIENT_HINT)
g2:SetTargetRange(LOCATION_ONFIELD,0)
g2:SetValue(1)
g2:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,rct)
Duel.RegisterEffect(g2,tp)
--change targeting player
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,5))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_GLITCHY_CHANGE_TARGETING_PLAYER)
e1:SetTargetRange(1,0)
e1:SetValue(s.changetg)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,rct)
Duel.RegisterEffect(e1,tp)
--opponent chooses search targers
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,6))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e2:SetCode(EFFECT_UTTER_CONFUSION_CONFIDENCE)
e2:SetTargetRange(1,0)
e2:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,rct)
Duel.RegisterEffect(e2,tp)
--opponent chooses attack targets
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,7))
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_PATRICIAN_OF_DARKNESS)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e3:SetTargetRange(1,0)
e2:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,rct)
Duel.RegisterEffect(e3,tp)
end
function s.efilter(e,te,c)
return te:GetOwner()~=c
end
function s.changetg(e,re,rp)
return re:IsActivated() and rp and rp==e:GetOwnerPlayer()
end
\ No newline at end of file
--Confusione Totale - Determinazione
--Scripted by: XGlitchy30
local s,id=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1)
e1:SetCondition(s.condition)
e1:SetOperation(s.activate)
e1:SetHintTiming(TIMING_END_PHASE,0)
c:RegisterEffect(e1)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROYED)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function s.cfilter(c,tp)
return c:IsPreviousControler(tp)
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local ct=eg:FilterCount(s.cfilter,nil,p)
if ct>0 then
for i=1,ct do
Duel.RegisterFlagEffect(p,id,RESET_PHASE+PHASE_END,0,1)
end
end
end
end
function s.condition(e,tp)
return Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_END and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFlagEffect(tp,id)>=2
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>0 or Duel.GetFlagEffect(tp,id)<2 then return false end
local c=e:GetHandler()
local rct = Duel.GetTurnPlayer()~=tp and 1 or 2
local rct2 = Duel.GetTurnPlayer()==tp and 1 or 2
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_REVERSE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,0)
e1:SetValue(s.rev)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,rct)
Duel.RegisterEffect(e1,tp)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,2))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_MUST_ATTACK)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CLIENT_HINT)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetLabel(Duel.GetTurnCount()+rct2)
e2:SetCondition(s.con)
e2:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,rct2)
Duel.RegisterEffect(e2,tp)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,3))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e3:SetCountLimit(1)
e3:SetLabel(Duel.GetTurnCount()+1)
e3:SetCondition(s.btcon)
e3:SetOperation(s.btop)
e3:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e3,tp)
end
function s.rev(e,re,r,rp,rc)
return bit.band(r,REASON_BATTLE)~=0
end
function s.con(e)
local tp=e:GetOwnerPlayer()
return Duel.GetTurnPlayer()==1-tp and Duel.GetTurnCount()==e:GetLabel()
end
function s.btcon(e)
return Duel.GetTurnCount()==e:GetLabel()
end
function s.btop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(aux.NOT(Card.IsControlerCanBeChanged),tp,0,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(1-tp,aux.Stringid(id,4)) then
Duel.Hint(HINT_CARD,tp,id)
local g=Duel.GetMatchingGroup(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,nil)
if not Duel.GetControl(g,tp,0,0,0xff,1-tp) then return end
local ph=Duel.GetCurrentPhase()
if g:FilterCount(Card.IsControler,nil,tp)==#g and ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE then
Duel.SkipPhase(Duel.GetTurnPlayer(),PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE_STEP,1)
end
end
end
\ No newline at end of file
--Confusione Totale - Noia
--Scripted by: XGlitchy30
local s,id=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1)
e1:SetCondition(s.condition)
e1:SetOperation(s.activate)
e1:SetHintTiming(TIMING_END_PHASE,0)
c:RegisterEffect(e1)
end
function s.condition(e,tp)
return Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_END and e:GetHandler():IsOnField() and Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)==1
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsOnField() or Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)~=1 then return false end
local c=e:GetHandler()
local rct = Duel.GetTurnPlayer()~=tp and 1 or 2
local rct2 = Duel.GetTurnPlayer()==tp and 1 or 2
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,0)
e1:SetValue(s.rev)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,rct)
Duel.RegisterEffect(e1,tp)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetLabel(Duel.GetTurnCount()+rct2)
e3:SetCondition(s.btcon)
e3:SetOperation(s.btop)
e3:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,rct2)
Duel.RegisterEffect(e3,tp)
end
function s.rev(e,re,dam,r)
if bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 then
return math.floor(dam/2)
else return dam end
end
function s.btcon(e,tp)
return Duel.GetTurnPlayer()==1-tp and Duel.GetTurnCount()==e:GetLabel()
end
function s.filter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsControlerCanBeChanged() or not c:IsLocation(LOCATION_MZONE) and c:IsAbleToChangeControler()
end
function s.backrow(c)
return c:IsLocation(LOCATION_SZONE) and c:GetSequence()<5
end
function s.btop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
if Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)==0 and Duel.IsExistingMatchingCard(s.filter,tp,0,LOCATION_ONFIELD,math.ceil(ct/2),nil) then
Duel.Hint(HINT_CARD,tp,id)
local g=Duel.SelectMatchingCard(1-tp,s.filter,tp,0,LOCATION_ONFIELD,math.ceil(ct/2),math.ceil(ct/2),nil)
if #g<math.ceil(ct/2) then return end
local monsters=g:Filter(Card.IsLocation,nil,LOCATION_MZONE)
local pendulums=g:Filter(Card.IsLocation,nil,LOCATION_PZONE)
local fieldsp=g:Filter(Card.IsLocation,nil,LOCATION_FZONE)
local backrow=g:Filter(s.backrow,nil)
if #monsters>0 then
Duel.GetControl(monsters,tp,0,0,0xff,1-tp)
end
if #pendulums>0 then
for pc in aux.Next(pendulums) do
Duel.MoveToField(pc,1-tp,tp,LOCATION_PZONE,pc:GetPosition(),true)
end
end
if #fieldsp>0 then
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
local pc=fieldsp:GetFirst()
Duel.MoveToField(pc,1-tp,tp,LOCATION_FZONE,pc:GetPosition(),true)
end
if #backrow>0 then
for pc in aux.Next(backrow) do
Duel.MoveToField(pc,1-tp,tp,LOCATION_SZONE,pc:GetPosition(),true)
end
end
end
end
\ No newline at end of file
--Risucchia Confusione - 996ICU
--Scripted by: XGlitchy30
local s,id=GetID()
s.unique_label = 0
xpcall(function() require("expansions/script/glitchylib_vsnemo") end,function() require("script/glitchylib_vsnemo") end)
function s.initial_effect(c)
s.unique_label = s.unique_label + 1
--ss proc
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(id,0))
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e0:SetCondition(s.hspcon)
e0:SetTarget(s.hsptg)
e0:SetOperation(s.hspop)
c:RegisterEffect(e0)
--cannot material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e1:SetValue(s.matlimit)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e4)
--tribute protection
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EFFECT_UNRELEASABLE_SUM)
e5:SetValue(1)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e6)
--hand traps
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetCode(EFFECT_TRAP_ACT_IN_NTPHAND)
e7:SetRange(LOCATION_MZONE)
e7:SetTarget(s.trapfilter)
e7:SetTargetRange(LOCATION_HAND,0)
c:RegisterEffect(e7)
--apply effects
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(id,1))
e8:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e8:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e8:SetCode(EVENT_SUMMON_SUCCESS)
e8:SetTarget(s.target)
e8:SetOperation(s.operation(s.unique_label))
c:RegisterEffect(e8)
local e8x=e8:Clone()
e8x:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e8x)
local e8y=e8:Clone()
e8y:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e8y)
if not s.global_check then
s.global_check=true
s.resolution_tracker={}
s.resolution_count=0
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetOperation(s.regop)
Duel.RegisterEffect(e2,0)
end
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
if not re:GetHandler():IsCode(table.unpack(ARCHE_UTTER_CONFUSION)) or not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local cid=re:GetHandler():GetCode()
if not s.resolution_tracker[cid] then
s.resolution_tracker[cid]=true
s.resolution_count = s.resolution_count + 1
end
end
function s.spfilter(c)
return c:IsCode(table.unpack(ARCHE_UTTER_CONFUSION)) and c:IsAbleToRemoveAsCost()
end
function s.mzonechk_g(g,tp)
return g:IsExists(s.mzonechk,1,nil,tp)
end
function s.mzonechk(g,tp)
return Duel.GetMZoneCount(tp,c)>0
end
function s.hspcon(e,c)
if c==nil then return true end
local eff={c:IsHasEffect(EFFECT_NECRO_VALLEY)}
for _,ce in ipairs(eff) do
if ce and aux.GetValueType(ce)=="Effect" and ce.GetLabel then
local op=ce:GetOperation()
if not op or op(e,c) then return false end
end
end
local tp=c:GetControler()
local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,c)
return rg:CheckSubGroup(s.mzonechk_g,2,2,tp)
end
function s.hsptg(e,tp,eg,ep,ev,re,r,rp,c)
local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,c)
local g=rg:SelectSubGroup(tp,s.mzonechk_g,true,2,2,tp)
if #g<2 then return false end
g:KeepAlive()
e:SetLabelObject(g)
return true
end
function s.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
if not g then return end
Duel.Remove(g,POS_FACEUP,REASON_COST)
g:DeleteGroup()
end
function s.matlimit(e,c)
if not c then return false end
return c:IsLocation(LOCATION_EXTRA)
end
function s.trapfilter(e,c)
return c:GetType()==0x4 and c:IsCode(table.unpack(ARCHE_UTTER_CONFUSION))
end
function s.df(c,e)
return c:IsOnField() or c:IsDestructable(e)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ct=s.resolution_count
if ct>=4 then
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0)
end
if ct>=7 then
local g=Duel.GetMatchingGroup(s.df,tp,0,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA,nil,e)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
end
end
function s.operation(lab)
return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=s.resolution_count
if ct>=2 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
e1:SetLabel(e:GetFieldID())
e1:SetOperation(s.chkop(lab))
Duel.RegisterEffect(e1,tp)
ct=s.resolution_count
Duel.RegisterFlagEffect(1-tp,id,0,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2))
Duel.BreakEffect()
end
if ct>=4 then
Duel.Damage(1-tp,Duel.GetLP(1-tp),REASON_EFFECT)
ct=s.resolution_count
Duel.BreakEffect()
end
if ct>=7 then
local g=Duel.GetMatchingGroup(s.df,tp,0,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA,nil,e)
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
end
end
function s.notflag(c,lab,fid)
return c:IsFaceup() and (c:GetFlagEffect(id+lab*100)==0 or c:GetFlagEffectLabel(id+lab*100)~=fid)
end
function s.chkop(lab)
return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(s.notflag,tp,0,LOCATION_MZONE,nil,lab,e:GetLabel())
if #g<=0 then return end
local dg=Group.CreateGroup()
for tc in aux.Next(g) do
local preatk,predef=tc:GetAttack(),tc:GetDefense()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-2000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
if tc:GetFlagEffect(id+lab*100)==0 then
tc:RegisterFlagEffect(id+lab*100,RESET_EVENT+RESETS_STANDARD,0,1)
end
tc:SetFlagEffectLabel(id+lab*100,e:GetLabel())
if preatk~=0 and not tc:IsImmuneToEffect(e1) and tc:GetAttack()==0 and predef~=0 and not tc:IsImmuneToEffect(e2) and tc:GetDefense()==0 then
dg:AddCard(tc)
end
end
if #dg>0 then
for tc in aux.Next(dg) do
Duel.Negate(tc,e)
end
Duel.Readjust()
end
dg:DeleteGroup()
end
end
\ No newline at end of file
--键★等 - YURIPPE || K.E.Y Etc. Yurippe
--Scripted by: XGlitchy30
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Gain all Types/Attributes
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e0:SetCode(EFFECT_ADD_RACE)
e0:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e0:SetValue(RACE_ALL)
c:RegisterEffect(e0)
local e0x=e0:Clone()
e0x:SetCode(EFFECT_ADD_ATTRIBUTE)
e0x:SetValue(ATTRIBUTE_ALL)
c:RegisterEffect(e0x)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.spcon)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--atk/def up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(s.lpcon(2000))
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xc460))
e2:SetValue(1000)
c:RegisterEffect(e2)
local e2x=e2:Clone()
e2x:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2x)
--direct attack
local e3=e2:Clone()
e3:SetCode(EFFECT_DIRECT_ATTACK)
e3:SetCondition(s.lpcon(4000))
e3:SetValue(1)
c:RegisterEffect(e3)
--immune
local e4=e2:Clone()
e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetCondition(s.lpcon(6000))
e4:SetValue(s.efilter)
c:RegisterEffect(e4)
end
function s.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLP(1-tp)>Duel.GetLP(tp)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c)
return not c:IsSetCard(0xc460)
end
function s.lpcon(lp)
return function(e)
local tp=e:GetHandlerPlayer()
return math.abs(Duel.GetLP(tp)-Duel.GetLP(1-tp))>=lp
end
end
function s.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
\ No newline at end of file
--键★等 - A·Y·U || K.E.Y Etc. A.Y.U
--Scripted by: XGlitchy30
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Gain all Types/Attributes
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e0:SetCode(EFFECT_ADD_RACE)
e0:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e0:SetValue(RACE_ALL)
c:RegisterEffect(e0)
local e0x=e0:Clone()
e0x:SetCode(EFFECT_ADD_ATTRIBUTE)
e0x:SetValue(ATTRIBUTE_ALL)
c:RegisterEffect(e0x)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.spcon)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_HAND)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(s.drcon1)
e2:SetOperation(s.drop1)
c:RegisterEffect(e2)
local e2x=Effect.CreateEffect(c)
e2x:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2x:SetCode(EVENT_SPSUMMON_SUCCESS)
e2x:SetRange(LOCATION_MZONE)
e2x:SetCondition(s.regcon)
e2x:SetOperation(s.regop)
c:RegisterEffect(e2x)
local e2y=Effect.CreateEffect(c)
e2y:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2y:SetCode(EVENT_CHAIN_SOLVED)
e2y:SetRange(LOCATION_MZONE)
e2y:SetCondition(s.drcon2)
e2y:SetOperation(s.drop2)
c:RegisterEffect(e2y)
--draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,3))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_CUSTOM+id)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e3:SetCost(s.cost)
e3:SetTarget(s.target)
e3:SetOperation(s.operation)
c:RegisterEffect(e3)
local g=Group.CreateGroup()
g:KeepAlive()
e3:SetLabelObject(g)
local e3x=Effect.CreateEffect(c)
e3x:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3x:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3x:SetCode(EVENT_TO_HAND)
e3x:SetRange(LOCATION_MZONE)
e3x:SetLabelObject(e3)
e3x:SetOperation(s.regop_global)
c:RegisterEffect(e3x)
end
function s.cfilter(c,tp)
return c:IsSetCard(0xc460) and c:IsControler(tp) and c:IsDiscardable()
end
function s.regop_global(e,tp,eg,ep,ev,re,r,rp)
local tg=eg:Filter(s.cfilter,nil,tp)
if #tg>0 then
for tc in aux.Next(tg) do
tc:RegisterFlagEffect(id,RESET_CHAIN,0,1)
end
local g=e:GetLabelObject():GetLabelObject()
if Duel.GetCurrentChain()==0 then g:Clear() end
g:Merge(tg)
g:Remove(function(c) return c:GetFlagEffect(id)==0 end,nil)
e:GetLabelObject():SetLabelObject(g)
if Duel.GetFlagEffect(tp,id+100)==0 then
Duel.RegisterFlagEffect(tp,id+100,RESET_CHAIN,0,1)
Duel.RaiseSingleEvent(e:GetHandler(),EVENT_CUSTOM+id,e,0,tp,tp,0)
end
end
end
function s.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(1-tp,LOCATION_MZONE,0)>Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c)
return not c:IsSetCard(0xc460)
end
function s.drcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,1-tp) and (not re or re:IsHasType(EFFECT_TYPE_ACTIONS) or re:IsHasType(EFFECT_TYPE_CONTINUOUS))
end
function s.filter(c)
return c:IsSetCard(0xc460) and c:IsAbleToHand()
end
function s.drop1(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) or not Duel.SelectYesNo(tp,aux.Stringid(id,2)) then return end
Duel.Hint(HINT_CARD,tp,id)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,1-tp) and re and re:IsHasType(EFFECT_TYPE_ACTIONS) and not re:IsHasType(EFFECT_TYPE_CONTINUOUS)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,id,RESET_CHAIN,0,1)
end
function s.drcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,id)>0
end
function s.drop2(e,tp,eg,ep,ev,re,r,rp)
local n=Duel.GetFlagEffect(tp,id)
Duel.ResetFlagEffect(tp,id)
for i=1,n do
if not Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) or not Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
break
end
Duel.Hint(HINT_CARD,tp,id)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=e:GetLabelObject():Filter(s.cfilter,nil)
if chk==0 then return #g>0 end
Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.GetFlagEffect(tp,id+100)==0 end
Duel.RegisterFlagEffect(tp,id+100,RESET_CHAIN,0,1)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
\ No newline at end of file
--键★等 - YUMEMISAN || K.E.Y Etc. Yumemisan
--Scripted by: XGlitchy30
xpcall(function() require("expansions/script/glitchylib_vsnemo") end,function() require("script/glitchylib_vsnemo") end)
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Gain all Types/Attributes
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e0:SetCode(EFFECT_ADD_RACE)
e0:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e0:SetValue(RACE_ALL)
c:RegisterEffect(e0)
local e0x=e0:Clone()
e0x:SetCode(EFFECT_ADD_ATTRIBUTE)
e0x:SetValue(ATTRIBUTE_ALL)
c:RegisterEffect(e0x)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.spcon)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--SS
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_CUSTOM+id)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(s.target)
e3:SetOperation(s.operation)
c:RegisterEffect(e3)
local g=Group.CreateGroup()
g:KeepAlive()
e3:SetLabelObject(g)
local e3x=Effect.CreateEffect(c)
e3x:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3x:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3x:SetCode(EVENT_SPSUMMON_SUCCESS)
e3x:SetRange(LOCATION_MZONE)
e3x:SetLabelObject(e3)
e3x:SetOperation(s.regop_global)
c:RegisterEffect(e3x)
end
function s.cfilter(c,tp)
return c:IsSummonPlayer(tp)
end
function s.regop_global(e,tp,eg,ep,ev,re,r,rp)
local tg=eg:Filter(s.cfilter,nil,1-tp)
if #tg>0 then
for tc in aux.Next(tg) do
tc:RegisterFlagEffect(id,RESET_CHAIN,0,1)
end
local g=e:GetLabelObject():GetLabelObject()
if Duel.GetCurrentChain()==0 then g:Clear() end
g:Merge(tg)
g:Remove(function(c) return c:GetFlagEffect(id)==0 end,nil)
e:GetLabelObject():SetLabelObject(g)
if Duel.GetFlagEffect(tp,id)==0 then
Duel.RegisterFlagEffect(tp,id,RESET_CHAIN,0,1)
Duel.RaiseSingleEvent(e:GetHandler(),EVENT_CUSTOM+id,e,0,tp,tp,0)
end
end
end
function s.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(1-tp,LOCATION_ONFIELD,0)>Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c)
return not c:IsSetCard(0xc460)
end
function s.spfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xc460) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetFlagEffect(tp,id)==0 end
Duel.RegisterFlagEffect(tp,id+100,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function s.negfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and (c:GetAttack()>0 or c:GetDefense()>0 or aux.NegateMonsterFilter(c))
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsChainDisablable(0) then
local g=e:GetLabelObject():Filter(s.negfilter,nil)
if #g>0 and Duel.SelectYesNo(1-tp,aux.Stringid(id,3)) then
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
tc:RegisterEffect(e2)
if aux.NegateMonsterFilter(tc) then
Duel.Negate(tc,e)
end
end
return
end
end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--键★断片 - 渚正立于坂道之下 || K.E.Y Fragments - Nagisa, Bottom of the Hill
--Scripted by: XGlitchy30
xpcall(function() require("expansions/script/glitchylib_vsnemo") end,function() require("script/glitchylib_vsnemo") end)
local s,id=GetID()
function s.initial_effect(c)
c:SetCounterLimit(0x1460,1)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(s.eqtg)
e1:SetOperation(s.eqop)
c:RegisterEffect(e1)
local e1x=e1:Clone()
e1x:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e1x)
local e1y=e1:Clone()
e1y:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e1y)
--apply effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(s.applycon)
e2:SetCost(s.apply)
e2:SetTarget(s.defaulttg)
e2:SetOperation(s.defaultop)
c:RegisterEffect(e2)
--light orb
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetOperation(s.spreg)
c:RegisterEffect(e3)
local e3x=e3:Clone()
e3x:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3x)
local e3y=e3:Clone()
e3y:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3y)
local e3z=Effect.CreateEffect(c)
e3z:SetDescription(aux.Stringid(id,2))
e3z:SetCategory(CATEGORY_COUNTER)
e3z:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3z:SetRange(LOCATION_ONFIELD)
e3z:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3z:SetCountLimit(1)
e3z:SetCondition(s.ctcon)
e3z:SetTarget(s.cttg)
e3z:SetOperation(s.ctop)
c:RegisterEffect(e3z)
end
function s.eqfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x460) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_SPELLCASTER+RACE_WARRIOR)
and c:CheckUniqueOnField(tp) and not c:IsForbidden()
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToChain(0) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local tc=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then
if not Duel.Equip(tp,tc,c) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetValue(s.eqlimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function s.eqlimit(e,c)
return e:GetOwner()==c
end
function s.applycon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler():GetEquipTarget()
end
function s.applyfilter(c,e,tp,chk,chain)
if not c:IsFaceup() or not c:IsSetCard(0x460) then return false end
local effs=global_card_effect_table[c]
if #effs==0 then return false end
for _,ce in ipairs(effs) do
if ce and ce.GetLabel and ce:IsHasType(EFFECT_TYPE_ACTIONS) and not ce:IsHasType(EFFECT_TYPE_CONTINUOUS) and ce:GetRange()&LOCATION_MZONE~=0 then
local _,eg,ep,ev,re,r,rp
local check=true
local event=ce:GetCode()
if event and event~=0 then
if event==EVENT_CHAINING and chk~=0 then
if not chain or chain<=0 then
check=false
else
local te2,p=Duel.GetChainInfo(chain,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
local tc=te2:GetHandler()
local g=Group.FromCards(tc)
eg,ep,ev,re,r,rp=g,p,chain,te2,REASON_EFFECT,p
end
elseif event~=EVENT_FREE_CHAIN then
check=Duel.CheckEvent(event)
if check then
_,eg,ep,ev,re,r,rp=Duel.CheckEvent(event,true)
end
end
end
if check then
local condition=ce:GetCondition()
local target=ce:GetTarget()
Debug.Message(not target or target(e,tp,eg,ep,ev,re,r,rp,0))
if (not condition or condition(e,tp,eg,ep,ev,re,r,rp)) and (not target or target(e,tp,eg,ep,ev,re,r,rp,0)) then
return true
end
end
end
end
return false
end
function s.apply(e,tp,eg,ep,ev,re,r,rp,chk)
local chain=Duel.GetCurrentChain()
if chk==0 then return Duel.IsExistingMatchingCard(s.applyfilter,tp,LOCATION_MZONE,0,1,nil,e,tp,chk,chain) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,s.applyfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp,chk,chain-1)
if #g>0 then
Duel.HintSelection(g)
local tc=g:GetFirst()
local choose_effect, choose_desc, choose_params = {}, {}, {}
local effs=global_card_effect_table[tc]
for _,ce in ipairs(effs) do
if ce and ce.GetLabel and ce:IsHasType(EFFECT_TYPE_ACTIONS) and not ce:IsHasType(EFFECT_TYPE_CONTINUOUS) and ce:GetRange()&LOCATION_MZONE~=0 then
local _,teg,tep,tev,tre,tr,trp
local check=true
local event=ce:GetCode()
if event and event~=0 then
if event==EVENT_CHAINING then
if chain<=1 then
check=false
else
local te2,p=Duel.GetChainInfo(chain,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
local tc=te2:GetHandler()
local g=Group.FromCards(tc)
teg,tep,tev,tre,tr,trp=g,p,chain,te2,REASON_EFFECT,p
end
elseif event~=EVENT_FREE_CHAIN then
check=Duel.CheckEvent(event)
if check then
_,teg,tep,tev,tre,tr,trp=Duel.CheckEvent(event,true)
end
end
end
if check then
local condition=ce:GetCondition()
local target=ce:GetTarget()
if (not condition or condition(e,tp,teg,tep,tev,tre,tr,trp)) and (not target or target(e,tp,teg,tep,tev,tre,tr,trp,0)) then
if type(teg)=="nil" then teg=false end
if type(tep)=="nil" then tep=false end
if type(tev)=="nil" then tev=false end
if type(tre)=="nil" then tre=false end
if type(tr) =="nil" then tr=false end
if type(trp)=="nil" then trp=false end
table.insert(choose_effect,ce)
table.insert(choose_desc,ce:GetDescription())
table.insert(choose_params,{teg,tep,tev,tre,tr,trp})
end
end
end
end
if #choose_effect>0 then
local opt=Duel.SelectOption(tp,table.unpack(choose_desc))+1
local ce=choose_effect[opt]
if ce and ce.GetLabel then
s[Duel.GetCurrentChain()]=ce
local params=choose_params[opt]
local teg,tep,tev,tre,tr,trp
if #params>0 then
teg,tep,tev,tre,tr,trp=params[1],params[2],params[3],params[4],params[5],params[6]
if type(teg)==false then teg=nil end
if type(tep)==false then tep=nil end
if type(tev)==false then tev=nil end
if type(tre)==false then tre=nil end
if type(tr) ==false then tr=nil end
if type(trp)==false then trp=nil end
end
e:SetProperty(ce:GetProperty())
e:SetTarget(s.targetchk(teg,tep,tev,tre,tr,trp))
e:SetOperation(s.operationchk(teg,tep,tev,tre,tr,trp))
end
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetReset(RESET_CHAIN)
e1:SetLabelObject(e)
e1:SetOperation(s.resetop)
Duel.RegisterEffect(e1,tp)
end
function s.targetchk(teg,tep,tev,tre,tr,trp)
return function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local te=s[Duel.GetCurrentChain()]
if chkc then
local tg=te:GetTarget()
return tg and tg(e,tp,teg,tep,tev,tre,tr,trp,chk,chkc)
end
if chk==0 then return true end
if not te then return end
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,teg,tep,tev,tre,tr,trp,chk) end
end
end
function s.operationchk(teg,tep,tev,tre,tr,trp)
return function(e,tp,eg,ep,ev,re,r,rp)
local te=s[Duel.GetCurrentChain()]
if not te then return end
local op=te:GetOperation()
if op then op(e,tp,teg,tep,tev,tre,tr,trp) end
end
end
function s.resetop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if te then
te:SetTarget(s.defaulttg)
te:SetOperation(s.defaultop)
end
end
function s.defaulttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local te=s[Duel.GetCurrentChain()]
if chkc then
local tg=te:GetTarget()
return tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
if chk==0 then return true end
if not te then return end
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,eg,ep,ev,re,r,rp,chk) end
Duel.ClearOperationInfo(0)
end
function s.defaultop(e,tp,eg,ep,ev,re,r,rp)
local te=s[Duel.GetCurrentChain()]
if not te then return end
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
function s.spreg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:SetTurnCounter(0)
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY,0,3,0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,3))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetCondition(s.upcon)
e1:SetOperation(s.update_counter)
e1:SetReset(RESET_PHASE+PHASE_STANDBY,3)
Duel.RegisterEffect(e1,tp)
end
function s.upcon(e,tp)
local c=e:GetHandler()
if c:GetFlagEffect(id)<=0 then
c:SetTurnCounter(0)
e:Reset()
return false
end
return true
end
function s.update_counter(e,tp)
local c=e:GetHandler()
c:SetTurnCounter(c:GetTurnCounter()+1)
c:SetFlagEffectLabel(id,c:GetFlagEffectLabel(id)+1)
end
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetFlagEffect(id)>0 and c:GetFlagEffectLabel(id)==3
end
function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
Duel.SetOperationInfo(0,CATEGORY_COUNTER,c,1,0,0x1460)
c:SetTurnCounter(0)
c:ResetFlagEffect(id)
end
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and c:IsCanAddCounter(0x1460,1,false,c:GetLocation()) then
c:AddCounter(0x1460,1)
end
end
\ No newline at end of file
--键★断片 - 渚正立于坂道之下 || K.E.Y Fragments - Kyou, Strength in Love
--Scripted by: XGlitchy30
local s,id=GetID()
function s.initial_effect(c)
c:SetCounterLimit(0x1460,1)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(s.eqtg)
e1:SetOperation(s.eqop)
c:RegisterEffect(e1)
local e1x=e1:Clone()
e1x:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e1x)
local e1y=e1:Clone()
e1y:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e1y)
--equip effects
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetCondition(s.eqcon)
e2:SetValue(1500)
c:RegisterEffect(e2)
local e2x=e2:Clone()
e2x:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2x)
local e2y=e2:Clone()
e2y:SetCode(EFFECT_PIERCE)
e2y:SetValue(1)
c:RegisterEffect(e2y)
--light orb
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_COUNTER)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetRange(LOCATION_ONFIELD)
e3:SetCode(EVENT_CUSTOM+id)
e3:SetCondition(s.ctcon)
e3:SetTarget(s.cttg)
e3:SetOperation(s.ctop)
c:RegisterEffect(e3)
if not s.global_check then
s.global_check=true
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetOperation(s.regop)
Duel.RegisterEffect(e1,0)
end
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=tp,1-tp,1-2*tp do
local g=eg:Filter(Card.IsSummonPlayer,nil,p)
if #g>0 then
local ct=Duel.GetFlagEffect(p,id)>0 and Duel.GetFlagEffectLabel(p,id) or 0
if ct==0 then
Duel.RegisterFlagEffect(p,id,RESET_PHASE+PHASE_END,0,1,0)
end
Duel.SetFlagEffectLabel(p,id,Duel.GetFlagEffectLabel(p,id)+#g)
if ct<3 and Duel.GetFlagEffectLabel(p,id)>=3 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+id,re,r,rp,p,ev)
end
end
end
end
function s.eqfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x460) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_SPELLCASTER+RACE_WARRIOR)
and c:CheckUniqueOnField(tp) and not c:IsForbidden()
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToChain(0) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local tc=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then
if not Duel.Equip(tp,tc,c) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetValue(s.eqlimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function s.eqlimit(e,c)
return e:GetOwner()==c
end
function s.eqcon(e)
return e:GetHandler():GetEquipTarget():IsSetCard(0x460)
end
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
Duel.SetOperationInfo(0,CATEGORY_COUNTER,c,1,0,0x1460)
end
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and c:IsCanAddCounter(0x1460,1,false,c:GetLocation()) then
c:AddCounter(0x1460,1)
end
end
\ No newline at end of file
--键★断片 - 风子为愿望而游走 || K.E.Y Fragments - Fuuko, Hit and Run
--Scripted by: XGlitchy30
local s,id=GetID()
function s.initial_effect(c)
c:SetCounterLimit(0x1460,1)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(s.eqtg)
e1:SetOperation(s.eqop)
c:RegisterEffect(e1)
local e1x=e1:Clone()
e1x:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e1x)
local e1y=e1:Clone()
e1y:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e1y)
--equip effects
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetCondition(s.eqcon)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
local e2y=e2:Clone()
e2y:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e2y:SetValue(1)
c:RegisterEffect(e2y)
--light orb
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_COUNTER)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetRange(LOCATION_ONFIELD)
e3:SetCode(EVENT_CUSTOM+id)
e3:SetCondition(s.ctcon)
e3:SetTarget(s.cttg)
e3:SetOperation(s.ctop)
c:RegisterEffect(e3)
if not s.global_check then
s.global_check=true
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_EQUIP)
e1:SetOperation(s.regop)
Duel.RegisterEffect(e1,0)
end
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=tp,1-tp,1-2*tp do
local g=eg:Filter(aux.FilterEqualFunction(Card.GetReasonPlayer,p),nil)
if #g>0 then
local ct=Duel.GetFlagEffect(p,id)>0 and Duel.GetFlagEffectLabel(p,id) or 0
if ct==0 then
Duel.RegisterFlagEffect(p,id,RESET_PHASE+PHASE_END,0,1,0)
end
Duel.SetFlagEffectLabel(p,id,Duel.GetFlagEffectLabel(p,id)+#g)
if ct<3 and Duel.GetFlagEffectLabel(p,id)>=3 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+id,re,r,rp,p,ev)
end
end
end
end
function s.eqfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x460) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_SPELLCASTER+RACE_WARRIOR)
and c:CheckUniqueOnField(tp) and not c:IsForbidden()
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToChain(0) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local tc=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then
if not Duel.Equip(tp,tc,c) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetValue(s.eqlimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function s.eqlimit(e,c)
return e:GetOwner()==c
end
function s.eqcon(e)
return e:GetHandler():GetEquipTarget():IsSetCard(0x460)
end
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end
function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
Duel.SetOperationInfo(0,CATEGORY_COUNTER,c,1,0,0x1460)
end
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and c:IsCanAddCounter(0x1460,1,false,c:GetLocation()) then
c:AddCounter(0x1460,1)
end
end
\ No newline at end of file
--键★断片 - 智代为了未来而战 || K.E.Y Fragments - Tomoyo, Fight for Future
--Scripted by: XGlitchy30
local s,id=GetID()
function s.initial_effect(c)
c:SetCounterLimit(0x1460,1)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(s.eqtg)
e1:SetOperation(s.eqop)
c:RegisterEffect(e1)
local e1x=e1:Clone()
e1x:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e1x)
local e1y=e1:Clone()
e1y:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e1y)
--equip effects
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLE_START)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(s.bancon)
e2:SetTarget(s.bantg)
e2:SetOperation(s.banop)
c:RegisterEffect(e2)
--light orb
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_COUNTER)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetRange(LOCATION_ONFIELD)
e3:SetCode(EVENT_CUSTOM+id)
e3:SetTarget(s.cttg)
e3:SetOperation(s.ctop)
c:RegisterEffect(e3)
if not s.global_check then
s.global_check=true
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetOperation(s.regop)
Duel.RegisterEffect(e1,0)
end
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFlagEffect(0,id)>0 and Duel.GetFlagEffectLabel(0,id) or 0
if ct==0 then
Duel.RegisterFlagEffect(0,id,RESET_PHASE+PHASE_END,0,1,0)
end
Duel.SetFlagEffectLabel(0,id,Duel.GetFlagEffectLabel(0,id)+#eg)
Debug.Message(Duel.GetFlagEffectLabel(0,id))
if ct<3 and Duel.GetFlagEffectLabel(0,id)>=3 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+id,re,r,rp,0,ev)
end
end
function s.eqfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x460) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_SPELLCASTER+RACE_WARRIOR)
and c:CheckUniqueOnField(tp) and not c:IsForbidden()
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToChain(0) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local tc=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then
if not Duel.Equip(tp,tc,c) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetValue(s.eqlimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function s.eqlimit(e,c)
return e:GetOwner()==c
end
function s.bancon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler():GetEquipTarget()
local bc=c:GetBattleTarget()
return c and c:IsSetCard(0x460) and c:IsRelateToBattle() and bc and bc:IsControler(1-tp)
end
function s.bantg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler():GetEquipTarget():GetBattleTarget(),1,0,0)
end
function s.banop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToChain(0) then return end
local ec=e:GetHandler():GetEquipTarget()
local bc=ec:GetBattleTarget()
if bc and bc:IsRelateToBattle() and bc:IsControler(1-tp) and bc:IsAbleToGrave() then
Duel.SendtoGrave(bc,REASON_EFFECT)
end
end
function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
Duel.SetOperationInfo(0,CATEGORY_COUNTER,c,1,0,0x1460)
end
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and c:IsCanAddCounter(0x1460,1,false,c:GetLocation()) then
c:AddCounter(0x1460,1)
end
end
\ No newline at end of file
--键★断片 - 缭绕琴美的弦理论 || Frammenti K.E.Y - Kotomi, Teoria delle Stringhe
--Scripted by: XGlitchy30
xpcall(function() require("expansions/script/glitchylib_vsnemo") end,function() require("script/glitchylib_vsnemo") end)
local s,id=GetID()
s.unique_label = 0
function s.initial_effect(c)
s.unique_label = s.unique_label + 1
c:SetCounterLimit(0x1460,1)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(s.eqtg)
e1:SetOperation(s.eqop)
c:RegisterEffect(e1)
local e1x=e1:Clone()
e1x:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e1x)
local e1y=e1:Clone()
e1y:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e1y)
--equip effects
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCondition(s.eqcon)
e2:SetTarget(s.stattg(s.unique_label))
e2:SetValue(s.eqval)
c:RegisterEffect(e2)
local e2x=Effect.CreateEffect(c)
e2x:SetDescription(aux.Stringid(id,1))
e2x:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2x:SetCode(EVENT_ADJUST)
e2x:SetRange(LOCATION_SZONE)
e2x:SetLabelObject(e2)
e2x:SetCondition(s.eqcon)
e2x:SetOperation(s.chkop(s.unique_label))
c:RegisterEffect(e2x)
--light orb
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_COUNTER)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetRange(LOCATION_ONFIELD)
e3:SetCode(EVENT_CUSTOM+id)
e3:SetCondition(s.ctcon)
e3:SetTarget(s.cttg)
e3:SetOperation(s.ctop)
c:RegisterEffect(e3)
if not s.global_check then
s.global_check=true
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_TO_HAND)
e1:SetOperation(s.regop)
Duel.RegisterEffect(e1,0)
end
end
function s.regfilter(c,p)
return c:IsPreviousLocation(LOCATION_ONFIELD+LOCATION_GRAVE) and c:IsLocation(LOCATION_HAND) and c:IsPreviousControler(p) and c:IsControler(p)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=tp,1-tp,1-2*tp do
local g=eg:Filter(s.regfilter,nil,p)
if #g>0 then
local ct=Duel.GetFlagEffect(p,id)>0 and Duel.GetFlagEffectLabel(p,id) or 0
if ct==0 then
Duel.RegisterFlagEffect(p,id,RESET_PHASE+PHASE_END,0,1,0)
end
Duel.SetFlagEffectLabel(p,id,Duel.GetFlagEffectLabel(p,id)+#g)
if ct<3 and Duel.GetFlagEffectLabel(p,id)>=3 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+id,re,r,rp,p,ev)
end
end
end
end
function s.eqfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x460) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_SPELLCASTER+RACE_WARRIOR)
and c:CheckUniqueOnField(tp) and not c:IsForbidden()
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToChain(0) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local tc=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then
if not Duel.Equip(tp,tc,c) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetValue(s.eqlimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function s.eqlimit(e,c)
return e:GetOwner()==c
end
function s.eqcon(e)
local ec=e:GetHandler():GetEquipTarget()
return ec and ec:IsSetCard(0x460) and ec:HasDefense() and ec:GetDefense()>0
end
function s.stattg(lab)
return function(e,tc)
return tc:GetFlagEffect(id+lab*100)~=0 and tc:GetFlagEffectLabel(id+lab*100)==e:GetLabel()
end
end
function s.eqval(e,c)
return -e:GetHandler():GetEquipTarget():GetDefense()
end
function s.notflag(c,lab,fid)
return c:IsFaceup() and (c:GetFlagEffect(id+lab*100)==0 or c:GetFlagEffectLabel(id+lab*100)~=fid)
end
function s.chkop(lab)
return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local fid=c:GetFieldID()
if e:GetLabelObject():GetLabel()~=fid then
e:GetLabelObject():SetLabel(fid)
end
local g=Duel.GetMatchingGroup(s.notflag,tp,0,LOCATION_MZONE,nil,lab,fid)
if #g<=0 then return end
local dg=Group.CreateGroup()
for tc in aux.Next(g) do
local preatk,predef=tc:GetAttack(),tc:GetDefense()
if tc:GetFlagEffect(id+lab*100)==0 then
tc:RegisterFlagEffect(id+lab*100,RESET_EVENT+RESETS_STANDARD,0,1)
end
tc:SetFlagEffectLabel(id+lab*100,fid)
if preatk~=0 and not tc:IsImmuneToEffect(e:GetLabelObject()) and tc:GetAttack()==0 then
dg:AddCard(tc)
end
end
if #dg>0 then
for tc in aux.Next(dg) do
Duel.Negate(tc,e)
end
Duel.Readjust()
end
dg:DeleteGroup()
end
end
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end
function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
Duel.SetOperationInfo(0,CATEGORY_COUNTER,c,1,0,0x1460)
end
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and c:IsCanAddCounter(0x1460,1,false,c:GetLocation()) then
c:AddCounter(0x1460,1)
end
end
\ No newline at end of file
--键★断片 - 渚的未来时光 || Frammenti K.E.Y - Nagisa, Momenti Dopo la Storia
--Scripted by: XGlitchy30
local s,id=GetID()
function s.initial_effect(c)
--SS
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--effect gain
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(s.lptg)
e2:SetOperation(s.lpop)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetCondition(s.eqcon)
e3:SetTarget(s.eftg)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_SEND_REPLACE)
e4:SetTarget(s.reptg)
e4:SetValue(s.repval)
e4:SetOperation(s.repop)
c:RegisterEffect(e4)
end
function s.cfilter(c)
local ec=c:GetEquipTarget()
return ec and ec:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsAbleToHandAsCost() and c:IsSetCard(0x460)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_COST)
end
end
function s.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)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_HAND)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not c:IsRelateToChain(0) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function s.eqcon(e)
local ec=e:GetHandler():GetEquipTarget()
return ec and ec:IsSetCard(0x460)
end
function s.eftg(e,c)
local ec=e:GetHandler():GetEquipTarget()
return c==ec
end
function s.lptg(e,tp,eg,ep,ev,re,r,rp,chk)
local atk=e:GetHandler():GetAttack()
if chk==0 then return atk>0 end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(atk)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,atk)
end
function s.lpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToChain(0) then return end
local atk=c:GetAttack()
if atk<=0 then return end
Duel.Recover(p,atk,REASON_EFFECT)
end
function s.repfilter(c,tp)
return (not c:IsLocation(LOCATION_HAND) or not c:IsControler(tp)) and c:GetDestination()==LOCATION_GRAVE and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT)
and c:IsRace(RACE_SPELLCASTER+RACE_WARRIOR) and c:IsSetCard(0x460)
and c:IsAbleToHand(tp) and (c:IsFaceup() or not c:IsLocation(LOCATION_ONFIELD+LOCATION_REMOVED)) and not c:IsReason(REASON_REPLACE+REASON_RETURN)
end
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(s.repfilter,1,nil,tp) end
local c=e:GetHandler()
local g=eg:Filter(s.repfilter,nil,tp)
if #g>0 then
g:KeepAlive()
e:SetLabelObject(g)
return true
else
return false
end
end
function s.repval(e,c)
local g=e:GetLabelObject()
return g and g:IsContains(c)
end
function s.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,1-tp,id)
local g=e:GetLabelObject()
if g then
if #g>0 and Duel.SendtoHand(g,tp,REASON_EFFECT+REASON_REPLACE)>0 then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_HAND):Filter(Card.IsControler,nil,tp)
if #og>0 then
Duel.ConfirmCards(1-tp,og)
end
end
g:DeleteGroup()
end
end
\ No newline at end of file
--键★断片 - 渚的未来时光 || Frammenti K.E.Y - Kyou, Doveri Dopo la Storia
--Scripted by: XGlitchy30
local s,id=GetID()
function s.initial_effect(c)
--SS
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--effect gain
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(s.lpcost(LOCATION_ONFIELD))
e2:SetTarget(s.lptg)
e2:SetOperation(s.lpop)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetCondition(s.eqcon)
e3:SetTarget(s.eftg)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1)
e4:SetCost(s.lpcost(LOCATION_MZONE))
e4:SetTarget(s.lptg)
e4:SetOperation(s.lpop)
c:RegisterEffect(e4)
end
function s.cfilter(c)
local ec=c:GetEquipTarget()
return ec and ec:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsAbleToHandAsCost() and c:IsSetCard(0x460)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_COST)
end
end
function s.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)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_HAND)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not c:IsRelateToChain(0) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function s.eqcon(e)
local ec=e:GetHandler():GetEquipTarget()
return ec and ec:IsSetCard(0x460)
end
function s.eftg(e,c)
local ec=e:GetHandler():GetEquipTarget()
return c==ec
end
function s.filter(c,tp)
return c:IsFaceup() and c:IsAbleToHandAsCost() and c:IsSetCard(0x460) and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
end
function s.lpcost(loc)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,loc,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,loc,0,1,1,nil,tp)
if #g>0 then
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_COST)
end
end
end
function s.lptg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if chk==0 then
local res = e:GetLabel()==1 or #g>0
e:SetLabel(0)
return res
end
e:SetLabel(0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.lpop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
\ No newline at end of file
--键★断片 - 风子的未来奇迹 || Frammenti K.E.Y - Fuuko, Miracoli Dopo la Storia
--Scripted by: XGlitchy30
local s,id=GetID()
function s.initial_effect(c)
--SS
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--effect gain
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(s.lpcost(LOCATION_ONFIELD))
e2:SetTarget(s.lptg)
e2:SetOperation(s.lpop)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetCondition(s.eqcon)
e3:SetTarget(s.eftg)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1)
e4:SetCost(s.lpcost(LOCATION_MZONE))
e4:SetTarget(s.tdtg)
e4:SetOperation(s.tdop)
c:RegisterEffect(e4)
end
function s.cfilter(c)
local ec=c:GetEquipTarget()
return ec and ec:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsAbleToHandAsCost() and c:IsSetCard(0x460)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_COST)
end
end
function s.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)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_HAND)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not c:IsRelateToChain(0) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function s.eqcon(e)
local ec=e:GetHandler():GetEquipTarget()
return ec and ec:IsSetCard(0x460)
end
function s.eftg(e,c)
local ec=e:GetHandler():GetEquipTarget()
return c==ec
end
function s.filter(c,tp)
return c:IsFaceup() and c:IsAbleToHandAsCost() and c:IsSetCard(0x460)
end
function s.lpcost(loc)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,loc,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,loc,0,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_COST)
end
end
end
function s.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT)
and c:IsRace(RACE_SPELLCASTER+RACE_WARRIOR) and c:IsSetCard(0x460)
and c:IsAbleToHand()
end
function s.lptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE,0,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function s.lpop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.tdfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT)
and c:IsRace(RACE_SPELLCASTER+RACE_WARRIOR) and c:IsSetCard(0x460)
and c:IsAbleToDeck()
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_HAND,0,1,nil) and Duel.IsPlayerCanDraw(tp,2) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,s.tdfilter,tp,LOCATION_HAND,0,1,1,nil)
if #g>0 then
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
if Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK+LOCATION_EXTRA) then
for p=tp,1-tp,1-2*tp do
if g:Filter(Card.IsControler,nil,p):IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then
Duel.ShuffleDeck(p)
end
end
Duel.Draw(tp,2,REASON_EFFECT)
end
end
end
\ No newline at end of file
--键★断片 - 智代的异色故事 || Frammenti K.E.Y - Tomoyo, Storia Alternativa
--Scripted by: XGlitchy30
local s,id=GetID()
function s.initial_effect(c)
--summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.spcon)
c:RegisterEffect(e1)
--tribute and SS
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_RELEASE+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCost(s.eqcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.scfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_SPELLCASTER+RACE_WARRIOR) and c:IsSetCard(0x460)
end
function s.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.scfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.cfilter(c,e,tp)
return c:IsSetCard(0x460) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_SPELLCASTER) and c:IsReleasableByEffect() and (c:IsControler(tp) or c:IsFaceup())
and Duel.GetMZoneCount(tp,c)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x460) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_WARRIOR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.eqcon(e)
local ec=e:GetHandler():GetEquipTarget()
return ec and ec:IsSetCard(0x460)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,s.cfilter,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=Duel.SelectReleaseGroup(tp,s.cfilter,1,1,nil,e,tp)
if rg and Duel.Release(rg,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
\ No newline at end of file
--键★记忆 汐 || K.E.Y. Memoria - Ushio
--Scripted by: XGlitchy30
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_SPELLCASTER),6,2)
--check xyz mats
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_MATERIAL_CHECK)
e0:SetValue(s.valcheck)
c:RegisterEffect(e0)
--special summon proc
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetValue(1)
e1:SetCondition(s.sprcon)
e1:SetOperation(s.sprop)
c:RegisterEffect(e1)
--equip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(s.eqcon)
e2:SetTarget(s.eqtg)
e2:SetOperation(s.eqop)
c:RegisterEffect(e2)
--atkup
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(s.val)
c:RegisterEffect(e3)
--return
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_RECOVER)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCost(s.lpcost)
e4:SetTarget(s.lptg)
e4:SetOperation(s.lpop)
c:RegisterEffect(e4)
end
function s.matfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x460)
end
function s.valcheck(e,c)
local g=c:GetMaterial()
if g:IsExists(s.matfilter,1,nil) then
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1)
end
end
function s.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and Duel.IsCanRemoveCounter(tp,1,1,0x1460,3,REASON_COST)
end
function s.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.RemoveCounter(tp,1,1,0x1460,3,REASON_COST)
end
function s.eqcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_SPECIAL+1) or (c:IsSummonType(SUMMON_TYPE_XYZ) and c:GetFlagEffect(id)>0)
end
function s.eqval(ec,c,tp)
return ec:IsControler(tp) and ec:IsRace(RACE_FISH+RACE_AQUA+RACE_SEASERPENT)
end
function s.filter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsSetCard(0x460) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ft<=0 or not c:IsRelateToChain(0) or not c:IsFaceup() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,ft,ft,nil,tp)
if #g>0 then
for tc in aux.Next(g) do
if Duel.Equip(tp,tc,c,true,true) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(s.eqlimit)
tc:RegisterEffect(e1)
end
end
Duel.EquipComplete()
end
end
function s.eqlimit(e,c)
return e:GetOwner()==c
end
function s.val(e,c)
return c:GetEquipCount()*1200
end
function s.lpcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.lptg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=e:GetHandler():GetEquipGroup()
if chk==0 then return g:IsExists(Card.IsAbleToHand,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0)
end
function s.lpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToChain(0) then return end
local g=c:GetEquipGroup():Filter(Card.IsAbleToHand,nil)
if #g>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 and g:IsExists(Card.IsLocation,1,nil,LOCATION_HAND+LOCATION_EXTRA) then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_HAND+LOCATION_EXTRA)
if #og>0 then
Duel.Recover(tp,#g*1200,REASON_EFFECT)
end
end
end
\ No newline at end of file
--键★记忆梗 Hurry, Starfish || K.E.Y Memoria! - Sbrigati, Stella Marina
--Scripted by: XGlitchy30
xpcall(function() require("expansions/script/glitchylib_vsnemo") end,function() require("script/glitchylib_vsnemo") end)
local s,id = GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1,1)
--Special summon procedure
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(id,0))
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetValue(1)
e0:SetCondition(s.sprcon)
e0:SetTarget(s.sprtg)
e0:SetOperation(s.sprop)
c:RegisterEffect(e0)
--Gain effects
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(s.condition)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--Special Summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,5))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PHASE+PHASE_STANDBY)
e4:SetRange(LOCATION_REMOVED)
e4:SetCountLimit(1,id+100+EFFECT_COUNT_CODE_OATH)
e4:SetCondition(s.spcon)
e4:SetTarget(s.sptg)
e4:SetOperation(s.spop)
c:RegisterEffect(e4)
end
function s.ogfilter(c)
return c:GetOriginalType()&TYPE_MONSTER>0
end
function s.sprfilter(c,tp,sc)
return c:IsFaceup() and c:IsSetCard(0x460) and c:IsAbleToGraveAsCost() and c:GetEquipGroup():IsExists(s.ogfilter,1,nil)
and Duel.GetLocationCountFromEx(tp,tp,c,sc)
end
function s.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and Duel.IsCanRemoveCounter(tp,1,1,0x1460,2,REASON_COST)
or Duel.IsExistingMatchingCard(s.sprfilter,tp,LOCATION_MZONE,0,1,nil,tp,c)
end
function s.sprtg(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_MZONE,0,nil,tp,c)
local b1 = Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and Duel.IsCanRemoveCounter(tp,1,1,0x1460,2,REASON_COST)
local b2 = #g>0
if not b1 and not b2 then return false end
local opt=aux.Option(id,tp,1,b1,b2)
e:SetLabel(opt)
if opt==0 then
return true
elseif opt==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local mg=g:Select(tp,1,1,nil)
if #mg==1 then
mg:KeepAlive()
e:SetLabelObject(mg)
return true
end
return false
end
return false
end
function s.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local opt=e:GetLabel()
if opt==0 then
c:SetMaterial(nil)
Duel.RemoveCounter(tp,1,1,0x1460,2,REASON_COST)
elseif opt==1 then
local g=e:GetLabelObject()
if not g then return end
c:SetMaterial(g)
Duel.SendtoGrave(g,REASON_COST)
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL+1)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,3))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,4))
end
function s.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsSetCard(0x460) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemove() and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToChain(0) then return end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE,0,nil)
if Duel.Remove(c,POS_FACEUP,REASON_EFFECT)>0 and c:IsLocation(LOCATION_REMOVED) and #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local tg=g:Select(tp,1,1,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 and Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 and Duel.SendtoGrave(tg,REASON_EFFECT)>0 and tg:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function s.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) and Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not c:IsRelateToChain(0) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
\ No newline at end of file
--键★记忆 小小的手心 || K.E.Y. Memoria - Piccolo Palmo
--Scripted by: XGlitchy30
xpcall(function() require("expansions/script/glitchylib_vsnemo") end,function() require("script/glitchylib_vsnemo") end)
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,8,6)
--special summon proc
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetValue(1)
e1:SetCondition(s.sprcon)
e1:SetOperation(s.sprop)
c:RegisterEffect(e1)
--attach
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(s.xyzcon)
e2:SetTarget(s.xyztg)
e2:SetOperation(s.xyzop)
c:RegisterEffect(e2)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(s.imcon)
e3:SetValue(s.efilter)
c:RegisterEffect(e3)
--detach and equip
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_EQUIP)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(s.attcon)
e4:SetCost(s.attcost)
e4:SetTarget(s.atttg)
e4:SetOperation(s.attop)
c:RegisterEffect(e4)
--negate
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id,3))
e5:SetCategory(CATEGORY_DISABLE)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_CHAINING)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(s.discon)
e5:SetCost(s.discost)
e5:SetTarget(s.distg)
e5:SetOperation(s.disop)
c:RegisterEffect(e5)
end
function s.matfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x460)
end
function s.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and Duel.IsCanRemoveCounter(tp,1,1,0x1,7,REASON_COST)
end
function s.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.RemoveCounter(tp,1,1,0x1,7,REASON_COST)
end
function s.xyzcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_SPECIAL+1)
end
function s.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsSetCard(0x460) and not c:IsForbidden() and c:IsCanOverlay()
end
function s.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
if Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE,0,1,nil) then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,0)
end
end
function s.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToChain(0) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.filter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil)
if #g>0 then
local ct=g:GetClassCount(Card.GetCode)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,ct,ct)
if #sg>0 then
Duel.Attach(sg,c)
end
end
end
function s.imcon(e)
return e:GetHandler():GetOverlayCount()>0
end
function s.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
function s.attcon(e)
local c=e:GetHandler()
return c:GetOverlayCount()>0 and not c:GetOverlayGroup():IsExists(aux.NOT(Card.IsSetCard),1,nil,0x460)
end
function s.attcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return true end
end
function Card.CheckEquipTargetWhileOverlay(c,ec)
local egroup=global_card_effect_table[c]
for _,ce in ipairs(egroup) do
if ce and aux.GetValueType(ce)=="Effect" and ce:GetCode()==EFFECT_EQUIP_LIMIT then
local val=ce:GetValue()
if not val or type(val)=="number" then
return true
elseif type(val)=="function" then
return val(ce,ec)
end
end
end
return false
end
function s.detachfilter(c,ec,tp,step)
if c:IsForbidden() or not c:CheckUniqueOnField(tp) then return false end
if not c:IsType(TYPE_EQUIP) then return true end
if tp then
return Duel.IsExistingMatchingCard(s.attfilter,tp,LOCATION_MZONE,0,1,nil,c)
else
return not step and c:CheckEquipTargetWhileOverlay(ec) or (step and c:CheckEquipTarget(ec))
end
end
function s.attfilter(c,g)
return c:IsFaceup() and c:IsSetCard(0x460) and ((aux.GetValueType(g)=="Card" and s.detachfilter(g,c)) or (aux.GetValueType(g)=="Group" and g:IsExists(s.detachfilter,1,nil,c)))
end
function s.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=c:GetOverlayGroup()
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(s.attfilter,tp,LOCATION_MZONE,0,1,nil,g) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
local detached=g:FilterSelect(tp,s.detachfilter,1,1,c,nil,tp):GetFirst()
if detached and Duel.SendtoGrave(detached,REASON_COST)>0 then
Duel.SetTargetCard(detached)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,detached,1,detached:GetControler(),detached:GetLocation())
if detached:IsLocation(LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,detached,1,tp,0)
end
end
end
function s.attop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToChain(0) or Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsForbidden() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,s.attfilter,tp,LOCATION_MZONE,0,1,1,nil,tc,nil,true)
if #g>0 then
Duel.HintSelection(g)
if not Duel.Equip(tp,tc,g:GetFirst()) or tc:IsOriginalType(TYPE_EQUIP) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(s.eqlimit)
e1:SetLabelObject(g:GetFirst())
tc:RegisterEffect(e1)
end
end
function s.eqlimit(e,c)
return c==e:GetLabelObject()
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsChainDisablable(ev) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and s.attcon(e)
end
function s.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
\ No newline at end of file
--键★高潮 小镇、时光的流逝、人 || Città, Scorrere del Tempo, Persone
--Scripted by: XGlitchy30
local s,id=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COUNTER)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--transfer orbs
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_LEAVE_FIELD_P)
e2:SetRange(LOCATION_FZONE)
e2:SetCondition(s.trcon)
e2:SetOperation(s.trop)
c:RegisterEffect(e2)
--place orb
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_COUNTER)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetCondition(s.ctcon)
e3:SetOperation(s.ctop)
c:RegisterEffect(e3)
--Replace destruction
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetRange(LOCATION_FZONE)
e4:SetTarget(s.desreptg)
e4:SetValue(s.desrepval)
e4:SetOperation(s.desrepop)
c:RegisterEffect(e4)
--register SS
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
Duel.RegisterEffect(ge2,0)
local ge3=ge1:Clone()
ge3:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(ge3,0)
end
end
function s.spfilter(c)
return c:IsFaceup() and c:IsSetCard(0x460) and c:IsAttribute(ATTRIBUTE_LIGHT)
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(s.spfilter,nil)
if #g<=0 then return end
for p=tp,1-tp,1-2*tp do
local ct=g:FilterCount(Card.IsSummonPlayer,nil,p)
if ct>0 then
if Duel.GetFlagEffect(p,id)<=0 then
Duel.RegisterFlagEffect(p,id,RESET_PHASE+PHASE_END,0,1,0)
end
Duel.SetFlagEffectLabel(p,id,Duel.GetFlagEffectLabel(p,id)+ct)
end
end
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsCanAddCounter(tp,0x1460,1,c) end
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToChain(0) and c:IsFaceup() then
c:AddCounter(0x1460,1)
end
end
function s.trfilter(c,tc)
local ct=c:GetCounter(0x1460)
return ct>0 and c:IsCanRemoveCounter(tp,0x1460,ct,REASON_EFFECT) and tc:IsCanAddCounter(0x1460,ct)
end
function s.trcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.trfilter,1,nil,e:GetHandler())
end
function s.trop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(s.trfilter,nil,e:GetHandler())
if #g<=0 then return end
Duel.Hint(HINT_CARD,tp,id)
local exg=Group.CreateGroup()
while #g>0 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc=g:Select(tp,1,1,nil):GetFirst()
if not tc then return end
local ct=tc:GetCounter(0x1460)
tc:RemoveCounter(tp,0x1460,ct,REASON_EFFECT)
local diff=math.abs(ct-tc:GetCounter(0x1460))
e:GetHandler():AddCounter(0x1460,diff)
exg:AddCard(tc)
g=eg:Filter(s.trfilter,exg,e:GetHandler())
end
end
function s.ctcon(e,tp)
return Duel.GetTurnPlayer()==tp and Duel.GetFlagEffect(tp,id)>0 and Duel.GetFlagEffectLabel(tp,id)>=3
end
function s.ctop(e,tp)
local c=e:GetHandler()
if c:IsRelateToChain(0) and c:IsFaceup() and c:IsCanAddCounter(0x1460,1) then
c:AddCounter(0x1460,1)
end
end
function s.repfilter(c,tp)
return c:IsControler(tp) and c:IsSetCard(0x460) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and not c:IsReason(REASON_REPLACE+REASON_RULE)
end
function s.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(s.repfilter,1,nil,tp) and c:IsCanRemoveCounter(tp,0x1460,1,REASON_EFFECT) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function s.desrepval(e,c)
return s.repfilter(c,e:GetHandlerPlayer())
end
function s.desrepop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RemoveCounter(tp,0x1460,1,REASON_EFFECT+REASON_REPLACE)
end
\ No newline at end of file
--键★高潮 东风 || K.E.Y. Climax - Vento di Primavera
--Scripted by: XGlitchy30
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.recfilter(c)
return c:IsFaceup() and c:IsSetCard(0x460)
end
function s.monfilter(c,tp)
return c:IsSetCard(0x460) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsPublic() and not c:IsForbidden() and c:CheckUniqueOnField(tp)
and Duel.IsExistingMatchingCard(s.recfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if not e:GetHandler():IsLocation(LOCATION_SZONE) and e:IsHasType(EFFECT_TYPE_ACTIVATE) then
ft=ft-1
end
return ft>0 and Duel.IsExistingMatchingCard(s.monfilter,tp,LOCATION_HAND,0,1,nil,tp)
end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_HAND)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,s.monfilter,tp,LOCATION_HAND,0,1,1,nil,tp):GetFirst()
if not tc then return end
Duel.ConfirmCards(1-tp,Group.FromCards(tc))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local ec=Duel.SelectMatchingCard(tp,s.recfilter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
if not ec then return end
Duel.HintSelection(Group.FromCards(ec))
if not Duel.Equip(tp,tc,ec,true) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_COPY_INHERIT)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(s.eqlimit)
e1:SetLabelObject(ec)
tc:RegisterEffect(e1)
end
function s.eqlimit(e,c)
return c==e:GetLabelObject()
end
\ No newline at end of file
--键★高潮 -形影成双- || K.E.Y Climax - Due Ombre
--Scripted by: XGlitchy30
local s,id=GetID()
function s.initial_effect(c)
--SS
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.spfilter(c,e,tp)
local ec=c:GetEquipTarget()
return c:IsFaceup() and c:IsOriginalType(TYPE_MONSTER) and ec and ec:IsSetCard(0x460) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and s.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,g:GetFirst():GetControler(),LOCATION_SZONE)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToChain(0) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--键★高潮 潮鸣 || K.E.Y Climax - Maree Ruggenti
--Scripted by: XGlitchy30
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--place orbs
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(s.descon)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
--register destructions
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROYED)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function s.chkfilter(c)
if not c:IsReason(REASON_BATTLE+REASON_EFFECT) then return false end
if c:IsPreviousLocation(LOCATION_ONFIELD) then
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousTypeOnField()&TYPE_MONSTER>0 and c:IsPreviousSetCard(0x460) and c:GetPreviousAttributeOnField()&ATTRIBUTE_LIGHT>0
else
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x460) and c:IsAttribute(ATTRIBUTE_LIGHT)
end
end
function s.rpchk(c,tp)
return c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==tp
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(s.chkfilter,nil)
if #g<=0 then return end
for p=tp,1-tp,1-2*tp do
local ct1=g:FilterCount(Card.IsReason,nil,REASON_BATTLE)
local ct2=g:FilterCount(s.rpchk,nil,p)
if ct1+ct2>0 then
if Duel.GetFlagEffect(p,id)<=0 then
Duel.RegisterFlagEffect(p,id,RESET_PHASE+PHASE_END,0,1,0)
end
Duel.SetFlagEffectLabel(p,id,Duel.GetFlagEffectLabel(p,id)+ct1+ct2)
end
end
end
function s.condition(e,tp)
return Duel.GetCurrentPhase()==PHASE_END and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFlagEffect(1-tp,id)>0 and Duel.GetFlagEffectLabel(1-tp,id)>0
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local exc=nil
if e:IsHasType(EFFECT_TYPE_ACTIVATE) and not e:GetHandler():IsType(TYPE_EQUIP+TYPE_FIELD+TYPE_CONTINUOUS) and not e:GetHandler():IsHasEffect(EFFECT_REMAIN_FIELD) then exc=e:GetHandler() end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,0,exc)
local ct=Duel.GetFlagEffectLabel(1-tp,id)
if chk==0 then
if #g<=0 then return false end
local total=0
for tc in aux.Next(g) do
for i=ct-total,1,-1 do
if tc:IsCanAddCounter(0x1460,i) then
total=total+i
break
end
end
if total==ct then
return true
end
end
return false
end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,g,ct,0,0x1460)
end
function s.counterchk(c)
return c:IsCanAddCounter(0x1460,1)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>0 then return end
local c=e:GetHandler()
local exc=nil
if c:IsOnField() and c:IsFaceup() and e:IsHasType(EFFECT_TYPE_ACTIVATE) and not c:IsType(TYPE_EQUIP+TYPE_FIELD+TYPE_CONTINUOUS) and not c:IsHasEffect(EFFECT_REMAIN_FIELD) then exc=c end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,0,exc)
if #g<=0 then return end
local ct=Duel.GetFlagEffectLabel(1-tp,id)
local total=0
for tc in aux.Next(g) do
for chk=ct-total,1,-1 do
if tc:IsCanAddCounter(0x1460,chk) then
total=total+chk
break
end
end
if total==ct then
break
end
end
if total~=ct then return end
for i=1,ct do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER)
local tc=g:FilterSelect(tp,s.counterchk,1,1,nil):GetFirst()
if not tc then return end
tc:AddCounter(0x1460,1)
end
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and c:IsReason(REASON_DESTROY) and rp~=tp and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if #g>0 then
Duel.SetOperationInfo(0,CATEGORY_COUNTER,g,#g,0,0x1460)
end
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if #g<=0 then return end
for tc in aux.Next(g) do
if s.counterchk(tc) then
tc:AddCounter(0x1460,1,REASON_EFFECT)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e1:SetValue(s.matlimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
tc:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
tc:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
tc:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_UNRELEASABLE_SUM)
e5:SetValue(1)
e5:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
tc:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_UNRELEASABLE_NONSUM)
tc:RegisterEffect(e6)
end
end
function s.matlimit(e,c)
if not c then return false end
return c:IsLocation(LOCATION_EXTRA)
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment