Commit 77d998ac authored by REIKAI's avatar REIKAI 💬

禁限请求变动

parent 8b22a1c5
No preview for this file type
This diff is collapsed.
--异种 白
local m=16104602
local cm=_G["c"..m]
Duel.LoadScript("c16104600.lua")
function cm.initial_effect(c)
local e1=gs.turnup(c,m,1,0,cm.turnrptg,cm.turnupop,CATEGORY_POSITION+CATEGORY_DRAW)
local e2=gs.hdspm1(c,m,1)
local e3=gs.flip(c,m,cm.filptg,cm.flipop,nil,CATEGORY_DESTROY+CATEGORY_DRAW,EFFECT_FLAG_DAMAGE_STEP)
end
function cm.filter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function cm.turnrptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function cm.turnupop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c)
Duel.HintSelection(tc)
if tc:GetFirst():IsImmuneToEffect(e) then return end
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
end
function cm.filptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.flipop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
if Duel.Destroy(g,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
end
end
\ No newline at end of file
--异种 罔魂
local m=16104604
local cm=_G["c"..m]
Duel.LoadScript("c16104600.lua")
function cm.initial_effect(c)
local e1=gs.turnup(c,m,1,2,cm.turnrptg,cm.turnupop,CATEGORY_POSITION+CATEGORY_CONTROL)
local e2=gs.hdspm1(c,m,1)
local e3=gs.flip(c,m,cm.filptg,cm.flipop,nil,CATEGORY_DESTROY+CATEGORY_CONTROL,EFFECT_FLAG_DAMAGE_STEP)
end
function cm.filter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function cm.turnrptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE,0)>0 end
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,nil,1,0,0)
end
function cm.turnupop(e,tp,eg,ep,ev,re,r,rp)
local tab={1,2,4,8,16,32,64,128,256,512}
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local tc=Duel.SelectMatchingCard(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil)
Duel.HintSelection(tc)
local ph=Duel.GetCurrentPhase()
local phnum=gs.idget(ph,tab)
local num=0
if Duel.GetLocationCount(tp,LOCATION_MZONE,0)<=0 then return end
if phnum>1 and phnum<7 then
num=Duel.GetControl(tc,tp,PHASE_MAIN2,1)
else
num=Duel.GetControl(tc,tp,PHASE_MAIN1,1)
end
if num>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c)
Duel.HintSelection(tc)
tc=tc:GetFirst()
if tc:IsImmuneToEffect(e) then return end
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
end
function cm.filptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,nil,1,0,0)
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.flipop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
if Duel.Destroy(g,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_MZONE,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE,0)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local tc=Duel.SelectMatchingCard(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil)
Duel.HintSelection(tc)
Duel.GetControl(tc,tp,PHASE_END,1)
end
end
end
\ No newline at end of file
--异种 蝶
local m=16104606
local cm=_G["c"..m]
Duel.LoadScript("c16104600.lua")
function cm.initial_effect(c)
local e1=gs.turnup(c,m,1,3,cm.turnuptg,cm.turnupop,CATEGORY_SEARCH+CATEGORY_TOHAND)
local e2=gs.hdspm2(c,m)
local e3=gs.flip(c,m,cm.filptg,cm.flipop,nil,CATEGORY_REMOVE,EFFECT_FLAG_DAMAGE_STEP)
end
function cm.filter(c)
return c:IsAbleToHand() and c:IsSetCard(0xcca)
end
function cm.turnuptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.turnupop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function cm.filptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function cm.flipop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 then
local ttc=Duel.GetOperatedGroup():GetFirst()
gs.Cntact(ttc)
if Duel.GetMatchingGroupCount(Card.IsFacedown,tp,0,LOCATION_ONFIELD,nil)<=0 then return end
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_PUBLIC)
e2:SetReset(RESET_PHASE+PHASE_END,2)
e2:SetTargetRange(0,LOCATION_HAND)
Duel.RegisterEffect(e2,tp)
end
end
end
\ No newline at end of file
--异种 刽子手
local m=16104608
local cm=_G["c"..m]
Duel.LoadScript("c16104600.lua")
function cm.initial_effect(c)
local e1=gs.turnup(c,m,1,3,cm.turnuptg,cm.turnupop,CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SUMMON)
local e2=gs.hdspm2(c,m)
local e3=gs.flip(c,m,cm.filptg,cm.flipop,nil,CATEGORY_TOGRAVE+CATEGORY_TODECK,EFFECT_FLAG_DAMAGE_STEP)
end
function cm.filter(c)
return c:IsAbleToHand() and c:IsSetCard(0xcca)
end
function cm.sumfilter(c)
return (c:IsSummonable(true,nil) or c:IsMSetable(true,nil)) and c:IsSetCard(0xcca)
end
function cm.turnuptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.turnupop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
if Duel.SendtoHand(g,nil,REASON_EFFECT)~0 then
Duel.ConfirmCards(1-tp,g)
if Duel.GetLocationCount(tp,LOCATION_MZONE,0)>0 and Duel.IsExistingMatchingCard(cm.sumfilter,tp,LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,5)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,cm.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
local b1=tc:IsSummonable(true,nil)
local b2=tc:IsMSetable(true,nil)
local op=2
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(m,3),aux.Stringid(m,4))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(m,3))
else
op=Duel.SelectOption(tp,aux.Stringid(m,4))+1
end
if op==0 and tc:IsSummonable(true,nil) then
Duel.Summon(tp,tc,true,nil)
end
if op==1 and tc:IsSummonable(true,nil) then
Duel.MSet(tp,tc,true,nil)
end
end
end
end
end
end
function cm.filptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
end
function cm.flipop(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
local op=2
local b2=Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil)
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(m,6),aux.Stringid(m,7))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(m,6))
else
op=Duel.SelectOption(tp,aux.Stringid(m,7))+1
end
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
if Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
local ttc=Duel.GetOperatedGroup():GetFirst()
gs.Cntact(ttc)
local dg=Duel.GetFieldGroup(tp,LOCATION_DECK,LOCATION_DECK)
if Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,8)) then
Duel.ConfirmCards(tp,dg)
end
end
end
else
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(1-tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
if Duel.SendtoDeck(g,nil,2,REASON_RULE)~=0 then
local dg=Duel.GetFieldGroup(tp,LOCATION_DECK,LOCATION_DECK)
if Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,8)) then
Duel.ConfirmCards(tp,dg)
end
end
end
end
end
\ No newline at end of file
--异种 番兵
local m=16104610
local cm=_G["c"..m]
Duel.LoadScript("c16104600.lua")
function cm.initial_effect(c)
local e0=gs.nsp(c)
local e1=gs.turnup(c,m,1,1,cm.turnuptg,cm.turnupop,CATEGORY_SPECIAL_SUMMON)
local e2=gs.hdspm3(c,m)
local e3=gs.flip(c,m,cm.filptg,cm.flipop,nil,CATEGORY_TOGRAVE+CATEGORY_POSITION,EFFECT_FLAG_DAMAGE_STEP)
end
function cm.turnupfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and c:IsType(TYPE_MONSTER)
end
function cm.turnuptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.turnupfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function cm.turnupop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.turnupfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
end
end
function cm.filptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,0,0)
end
function cm.changefilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function cm.flipop(e,tp)
if not Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then return end
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #sg>0 then
if Duel.SendtoGrave(sg,REASON_EFFECT)~=0 then
local ttc=Duel.GetOperatedGroup():GetFirst()
gs.Cntact(ttc)
if Duel.IsExistingMatchingCard(cm.changefilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) and Duel.SelectYesNo(tp,aux.Stringid(m,5)) then
local sc=Duel.SelectMatchingCard(tp,cm.changefilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler()):GetFirst()
if not sc:IsImmuneToEffect(e) then
local evg=Group.CreateGroup()
if sc:IsType(TYPE_MONSTER) then
Duel.ChangePosition(sc,POS_FACEDOWN_DEFENSE)
else
sc:CancelToGrave()
if Duel.ChangePosition(sc,POS_FACEDOWN)>0 then
evg:AddCard(sc)
end
end
if #evg>0 then
Duel.RaiseEvent(evg,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
end
end
end
end
\ No newline at end of file
--异种 吞食者
local m=16104612
local cm=_G["c"..m]
Duel.LoadScript("c16104600.lua")
function cm.initial_effect(c)
local e0=gs.nsp(c)
local e1=gs.turnup(c,m,1,0,cm.turnuptg,cm.turnupop,nil)
local e2=gs.hdspm3(c,m)
local e3=gs.flip(c,m,cm.filptg,cm.flipop,nil,CATEGORY_TOGRAVE+CATEGORY_POSITION,EFFECT_FLAG_DAMAGE_STEP)
end
function cm.turnupfilter(c)
return c:IsSSetable(false) and not c:IsType(TYPE_MONSTER)
end
function cm.ssfilter(c)
return c:IsFaceup() and c:IsSSetable(false) and not c:IsType(TYPE_MONSTER)
end
function cm.turnuptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(cm.ssfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil)
end
end
function cm.turnupop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_REMOVED,LOCATION_REMOVED)
Duel.ConfirmCards(tp,g)
local sg=g:Filter(cm.turnupfilter,nil)
if sg:GetCount()<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
sg=sg:Select(tp,1,1,nil)
if sg:GetCount()>0 then
Duel.SSet(tp,sg)
end
end
function cm.filptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function cm.changefilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function cm.flipop(e,tp)
if not Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) then return end
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
if #sg>0 then
if Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)~=0 then
local ttc=Duel.GetOperatedGroup():GetFirst()
gs.Cntact(ttc)
if Duel.IsExistingMatchingCard(cm.changefilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) and Duel.SelectYesNo(tp,aux.Stringid(m,5)) then
local sc=Duel.SelectMatchingCard(tp,cm.changefilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler()):GetFirst()
if not sc:IsImmuneToEffect(e) then
local evg=Group.CreateGroup()
if sc:IsType(TYPE_MONSTER) then
Duel.ChangePosition(sc,POS_FACEDOWN_DEFENSE)
else
sc:CancelToGrave()
if Duel.ChangePosition(sc,POS_FACEDOWN)>0 then
evg:AddCard(sc)
end
end
if #evg>0 then
Duel.RaiseEvent(evg,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
end
end
end
end
\ No newline at end of file
--异种 涂壁
local m=16104614
local cm=_G["c"..m]
Duel.LoadScript("c16104600.lua")
function cm.initial_effect(c)
local e0=gs.nsp(c)
local e1=gs.turnup(c,m,1,3,cm.turnuptg,cm.turnupop,CATEGORY_SUMMON)
local e2=gs.hdspm4(c,m)
local e3=gs.flip(c,m,cm.filptg,cm.flipop,nil,CATEGORY_TOHAND+CATEGORY_POSITION,EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
end
function cm.turnupfilter(c)
return c:IsMSetable(true,nil) and c:IsType(TYPE_MONSTER)
end
function cm.setfilter(c)
return c:IsSSetable() and not c:IsType(TYPE_MONSTER)
end
function cm.turnuptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function cm.turnupop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
getmetatable(e:GetHandler()).announce_filter={TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT}
local ac=Duel.AnnounceCard(tp,table.unpack(getmetatable(e:GetHandler()).announce_filter))
local sg=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
Duel.ConfirmCards(tp,sg)
local g=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_HAND,nil,ac)
if g:GetCount()>0 then
if g:IsExists(cm.turnupfilter,1,nil) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SUMMON)
local sc=g:Select(1-tp,1,1,nil)
Duel.MSet(tp,sc:GetFirst(),true,nil)
end
if g:IsExists(cm.setfilter,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sc=g:Select(1-tp,1,1,nil)
Duel.SSet(1-tp,sc,tp)
Duel.ConfirmCards(1-tp,sc)
end
end
end
function cm.filptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
end
function cm.changefilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function cm.flipop(e,tp)
if not (Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(Card.IsAbleToHand),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil)) then return end
local sg1=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local sg2=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsAbleToHand),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
sg1:Merge(sg2)
if #sg1>0 then
if Duel.SendtoHand(sg1,nil,REASON_EFFECT)~=0 then
if Duel.IsExistingMatchingCard(cm.changefilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) and Duel.SelectYesNo(tp,aux.Stringid(m,5)) then
local sc=Duel.SelectMatchingCard(tp,cm.changefilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.HintSelection(sc)
local sc=sc:GetFirst()
if not sc:IsImmuneToEffect(e) then
local evg=Group.CreateGroup()
if sc:IsType(TYPE_MONSTER) then
Duel.ChangePosition(sc,POS_FACEDOWN_DEFENSE)
else
sc:CancelToGrave()
if Duel.ChangePosition(sc,POS_FACEDOWN)>0 then
evg:AddCard(sc)
end
end
if #evg>0 then
Duel.RaiseEvent(evg,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
return
end
if Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,6)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
end
end
function cm.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0xcca)
end
\ No newline at end of file
--异种 八姐妹
local m=16104616
local cm=_G["c"..m]
Duel.LoadScript("c16104600.lua")
function cm.initial_effect(c)
local e0=gs.nsp(c)
local e1=gs.turnup(c,m,nil,3,cm.turnuptg,cm.turnupop,CATEGORY_SPECIAL_SUMMON)
local e2=gs.hdspm4(c,m)
local e3=gs.flip(c,m,cm.filptg,cm.flipop,nil,CATEGORY_TOHAND+CATEGORY_POSITION,EFFECT_FLAG_DAMAGE_STEP)
end
function cm.turnupfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and c:IsType(TYPE_MONSTER)
end
function cm.setfilter(c)
return c:IsSSetable() and not c:IsType(TYPE_MONSTER)
end
function cm.turnuptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function cm.turnupop(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.turnupfilter),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil)
local op=2
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
getmetatable(e:GetHandler()).announce_filter={TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT}
local ac=Duel.AnnounceCard(tp,table.unpack(getmetatable(e:GetHandler()).announce_filter))
local sg=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
Duel.ConfirmCards(tp,sg)
Duel.ShuffleHand(1-tp)
local g=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_HAND,nil,ac)
if g:GetCount()>0 then
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(m,6),aux.Stringid(m,7))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(m,6))
else
op=Duel.SelectOption(tp,aux.Stringid(m,7))+1
end
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.turnupfilter),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
Duel.SSet(tp,sc)
Duel.ConfirmCards(1-tp,sc)
local tc=Duel.GetOperatedGroup():GetFirst()
if tc:IsType(TYPE_QUICKPLAY) or tc:IsType(TYPE_TRAP) then
Duel.BreakEffect()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end
end
end
function cm.filptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
end
function cm.changefilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function cm.flipop(e,tp)
if not (Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(Card.IsAbleToHand),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil)) then return end
local sg1=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local sg0=sg1
local sg2=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsAbleToHand),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
sg1:Merge(sg2)
if #sg1>0 then
if Duel.SendtoHand(sg1,tp,REASON_EFFECT)~=2 or (sg0:GetFirst():IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK)) or (sg2:GetFirst():IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK)) then
if Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(1-tp,aux.Stringid(m,5)) then
local sc=Duel.SelectMatchingCard(1-tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(sc)
Duel.SendtoDeck(sc,nil,2,REASON_RULE)
else
Duel.ChangePosition(e:GetHandler(),POS_FACEDOWN_DEFENSE)
end
end
end
end
function cm.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0xcca)
end
\ No newline at end of file
--异种 泰坦
local m=16104618
local cm=_G["c"..m]
Duel.LoadScript("c16104600.lua")
function cm.initial_effect(c)
local e00=Effect.CreateEffect(c)
e00:SetDescription(aux.Stringid(m,15))
e00:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e00:SetType(EFFECT_TYPE_SINGLE)
e00:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e00:SetCondition(cm.ttcon1)
e00:SetOperation(cm.ttop1)
e00:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e00)
local e01=Effect.CreateEffect(c)
e01:SetType(EFFECT_TYPE_SINGLE)
e01:SetCode(EFFECT_LIMIT_SET_PROC)
e01:SetCondition(cm.ttcon1)
e01:SetOperation(cm.ttop1)
e01:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e01)
local e0=gs.nsp(c)
local e1=gs.turnup(c,m,nil,3,cm.turnuptg,cm.turnupop,CATEGORY_SPECIAL_SUMMON)
local e2=gs.hdspm4(c,m)
local e3=gs.flip(c,m,cm.filptg,cm.flipop,nil,CATEGORY_TOHAND+CATEGORY_POSITION,EFFECT_FLAG_DAMAGE_STEP)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,14))
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,m)
e4:SetTarget(cm.changetg)
e4:SetOperation(cm.changeop)
c:RegisterEffect(e4)
end
function cm.changetg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(cm.changefilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,cm.changefilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,2,0,0)
end
function cm.changeop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 then
local tc=tg:GetFirst()
while tc do
if tc:IsLocation(LOCATION_MZONE) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
else
Duel.ChangePosition(tc,POS_FACEDOWN_ATTACK)
end
tc=tg:GetNext()
end
end
end
function cm.ttcon1(e,c,minc)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
return minc<=3 and Duel.CheckTribute(c,3,3,g,tp)
end
function cm.ttop1(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(Card.IsFacedown,c:GetControler(),LOCATION_MZONE,LOCATION_MZONE,nil)
local mg=Duel.SelectTribute(tp,c,3,3,g,tp)
c:SetMaterial(mg)
Duel.Release(mg,REASON_SUMMON+REASON_MATERIAL)
end
function cm.turnupfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,true,false,POS_FACEUP_ATTACK) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_FLIP)
end
function cm.setfilter(c)
return c:IsSSetable() and c:IsType(TYPE_CONTINUOUS)
end
function cm.turnuptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsChainDisablable(ev) and (Duel.IsExistingMatchingCard(cm.turnupfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA,0,1,nil,e,tp) or Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_DECK,0,1,nil))end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function cm.turnupop(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.IsExistingMatchingCard(cm.turnupfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA,0,1,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_DECK,0,1,nil)
local op=2
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
getmetatable(e:GetHandler()).announce_filter={TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT}
local ac=Duel.AnnounceCard(tp,table.unpack(getmetatable(e:GetHandler()).announce_filter))
local sg=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
Duel.ConfirmCards(tp,sg)
Duel.ShuffleHand(1-tp)
local g=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_DECK,nil,ac)
if g:GetCount()>0 then
if Duel.NegateEffect(ev) then
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(m,6),aux.Stringid(m,7))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(m,6))
else
op=Duel.SelectOption(tp,aux.Stringid(m,7))+1
end
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,cm.turnupfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA,0,1,1,nil,e,tp)
Duel.SpecialSummon(sc,0,tp,tp,true,false,POS_FACEUP_ATTACK)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sc=Duel.SelectMatchingCard(tp,cm.setfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SSet(tp,sc)
Duel.ConfirmCards(1-tp,sc)
local tc=Duel.GetOperatedGroup():GetFirst()
if tc:IsType(TYPE_TRAP) then
Duel.BreakEffect()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
end
end
end
function cm.filptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
end
function cm.changefilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function cm.flipop(e,tp)
if not Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,nil) then return end
local sg1=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,1,nil)
if #sg1>0 then
if Duel.SendtoDeck(sg1,nil,2,REASON_EFFECT)~=0 then
if Duel.IsExistingMatchingCard(cm.changefilter,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,5)) then
local sc=Duel.SelectMatchingCard(tp,cm.changefilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(sc)
if sc:GetFirst():IsImmuneToEffect(e) then
Duel.SendtoDeck(sc,nil,2,REASON_RULE)
else
local sg=sc:GetFirst()
local evg=Group.CreateGroup()
if sg:IsType(TYPE_MONSTER) then
Duel.ChangePosition(sg,POS_FACEDOWN_DEFENSE)
else
sg:CancelToGrave()
if Duel.ChangePosition(sg,POS_FACEDOWN)>0 then
evg:AddCard(sg)
end
end
if #evg>0 then
Duel.RaiseEvent(evg,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
end
end
end
end
\ No newline at end of file
--异种 绝海的巨蛟
local m=16104620
local cm=_G["c"..m]
Duel.LoadScript("c16104600.lua")
function cm.initial_effect(c)
local e1=gs.turnup(c,m,1,3,cm.turnrptg,cm.turnupop,CATEGORY_POSITION+CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_NEGATE)
local e3=gs.flip(c,m,cm.filptg,cm.flipop,nil,CATEGORY_REMOVE,EFFECT_FLAG_DAMAGE_STEP)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,3))
e4:SetCategory(CATEGORY_POSITION)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetHintTiming(TIMING_BATTLE_PHASE,TIMINGS_CHECK_MONSTER+TIMING_BATTLE_PHASE)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,m)
e4:SetCost(cm.cost)
e4:SetTarget(cm.target)
e4:SetOperation(cm.activate)
c:RegisterEffect(e4)
end
--e1
function cm.thfilter(c)
return c:IsAbleToHand()
end
function cm.turnrptg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsChainNegatable(ev)
local b2=Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK+LOCATION_REMOVED,1,nil)
if chk==0 then return b1 or b2 end
end
function cm.turnupop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local b1=Duel.IsChainNegatable(ev)
local b2=Duel.IsExistingMatchingCard(aux.NecroValleyFilter(Card.IsAbleToHand),tp,0,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK+LOCATION_REMOVED,1,nil)
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(m,4),aux.Stringid(m,5))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(m,4))
elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(m,5))+1
else return end
if op==0 then
Duel.NegateActivation(ev)
local typ=re:GetHandler():GetType()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(cm.cod)
e1:SetOperation(cm.disop)
e1:SetLabel(typ)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
else
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(m,6))--to you hand
local nx=Duel.GetMatchingGroupCount(cm.splimit,tp,0,LOCATION_ONFIELD,nil)
if nx<1 then nx=1 end
local thg=Duel.SelectMatchingCard(1-tp,aux.NecroValleyFilter(cm.thfilter),1-tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK+LOCATION_REMOVED,0,nx,nx,nil)
Duel.SendtoHand(thg,tp,REASON_EFFECT)
end
end
function cm.cod(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsType(e:GetLabel()) and re:GetHandler():GetControler()~=e:GetOwner():GetControler()
end
function cm.splimit(c)
return c:IsPosition(POS_FACEDOWN)
end
function cm.splimit0(c)
return c:IsCanTurnSet() and c:IsPosition(POS_FACEUP)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local tep=re:GetHandlerPlayer()
if not Duel.IsExistingMatchingCard(cm.splimit0,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) then return end
if Duel.SelectYesNo(tp,aux.Stringid(m,7)) then --CATEGORY_POSITION
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectMatchingCard(tp,cm.v,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
end
--e3
function cm.overfilter(c)
return c:IsCanOverlay()
end
function cm.changefilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function cm.filptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.overfilter,tp,0,LOCATION_ONFIELD,1,nil) end
end
function cm.flipop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,cm.overfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 and not g:GetFirst():IsImmuneToEffect(e) then
Duel.Overlay(c,Group.FromCards(g:GetFirst()))
if Duel.IsExistingMatchingCard(cm.changefilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,7))--ChangePosition
then
local tcg=Duel.SelectMatchingCard(tp,cm.changefilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local sg=tcg:GetFirst()
local evg=Group.CreateGroup()
if sg:IsType(TYPE_MONSTER) then
Duel.ChangePosition(sg,POS_FACEDOWN_DEFENSE)
else
sg:CancelToGrave()
if Duel.ChangePosition(sg,POS_FACEDOWN)>0 then
evg:AddCard(sg)
end
end
if #evg>0 then
Duel.RaiseEvent(evg,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
end
end
--e4
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.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL)
end
function cm.filter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
end
\ No newline at end of file
--异国的招待
local m=16104622
local cm=_G["c"..m]
Duel.LoadScript("c16104600.lua")
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
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)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetRange(LOCATION_FZONE)
e2:SetCondition(cm.econ)
e2:SetValue(cm.efilter)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_FZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e3:SetCountLimit(1)
e3:SetCondition(cm.sumaddcon)
e3:SetOperation(cm.sumaddop)
c:RegisterEffect(e3)
--
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,3))
e4:SetCategory(CATEGORY_POSITION)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1,m)
e4:SetTarget(cm.chtg2)
e4:SetOperation(cm.chop2)
c:RegisterEffect(e4)
--change effect ttarget
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetCode(m)
e5:SetRange(LOCATION_FZONE)
e5:SetTargetRange(1,0)
c:RegisterEffect(e5)
end
function cm.sumaddcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function cm.chtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCanTurnSet,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsCanTurnSet,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function cm.chop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsCanTurnSet,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local sg=g:Filter(Card.IsImmuneToEffect,nil,e)
local sg=Group.__sub(g,sg)
if sg:GetCount()>0 then
Duel.ChangePosition(sg,POS_FACEDOWN_DEFENSE)
local num=Duel.GetMatchingGroupCount(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if num>0 and Duel.SelectYesNo(tp,aux.Stringid(m,4)) then
Duel.Draw(tp,1,REASON_EFFECT)
Duel.BreakEffect()
for i=2,num do
if Duel.SelectYesNo(tp,aux.Stringid(m,5)) then
Duel.Draw(tp,1,REASON_EFFECT)
else
return
end
end
end
end
end
function cm.sumaddop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_ADD_EXTRA_TRIBUTE)
e1:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e1:SetTarget(function(e,rc) return rc~=e:GetHandler() and rc:IsFacedown() end)
e1:SetValue(POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e6:SetRange(LOCATION_FZONE)
e6:SetTargetRange(LOCATION_HAND,0)
e6:SetReset(RESET_PHASE+PHASE_END+RESET_EVENT+RESETS_STANDARD)
e6:SetTarget(cm.advtg)
e6:SetLabelObject(e1)
c:RegisterEffect(e6)
end
function cm.advtg(e,c)
return c:IsLevelAbove(5)
end
function cm.otfilter(c)
return c:IsSummonType(SUMMON_TYPE_ADVANCE)
end
function cm.efilter(e,re)
return re:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
function cm.econ(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==e:GetHandler():GetControler() and Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_ONFIELD,0,1,nil)
end
function cm.thhfilter(c,mc)
return c:IsRace(mc:GetRace())
end
function cm.thfilter(c,g)
return c:IsAbleToHand() and c:IsType(TYPE_MONSTER) and c:IsSetCard(0xcca) and not g:IsExists(cm.thhfilter,1,nil,c)
end
function cm.chtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_ONFIELD,0,1,nil) then
e:SetProperty(EFFECT_FLAG_CANNOT_NEGATE)
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND,0,nil,TYPE_MONSTER)
if not Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil,g) then return end
if not Duel.SelectYesNo(tp,aux.Stringid(m,1)) then return end
local cg=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
Duel.ConfirmCards(1-tp,cg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil,g)
if tc:GetCount()>0 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
\ No newline at end of file
--异种 兔子
local m=16104624
local cm=_G["c"..m]
Duel.LoadScript("c16104600.lua")
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_DECK)
e1:SetCondition(cm.sppcon)
e1:SetOperation(cm.sppcop)
c:RegisterEffect(e1)
--[[local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCondition(cm.actcon)
e2:SetOperation(cm.actop)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)]]--
--
local e3=gs.turnup(c,m,2,3,cm.turnuptg,cm.turnupop,CATEGORY_POSITION)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_EQUIP)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,m+1)
e4:SetTarget(cm.eqtg)
e4:SetOperation(cm.eqop)
c:RegisterEffect(e4)
--
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EFFECT_UPDATE_ATTACK)
e5:SetValue(cm.atkval)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e6)
--
local e02=Effect.CreateEffect(c)
e02:SetType(EFFECT_TYPE_SINGLE)
e02:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e02:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e02:SetCondition(cm.recon)
e02:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e02)
end
function cm.recon(e)
return e:GetHandler():IsFaceup()
end
function cm.eqfilter(c)
return c:IsFacedown() and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and (c:IsControler(tp) or c:IsAbleToChangeControler())
end
function cm.eqfilter1(c)
return c:IsCode(m)
end
function cm.eqfilter2(c)
return c:IsCode(m) and c:IsFaceup()
end
function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(cm.eqfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(cm.eqfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN)
Duel.SelectTarget(tp,cm.eqfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_ONFIELD)
end
function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or not Duel.IsExistingMatchingCard(cm.eqfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) then return end
if tc:IsRelateToEffect(e) and tc:IsFacedown() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,cm.eqfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.HintSelection(g)
local sc=g:GetFirst()
if Duel.Equip(tp,tc,sc)~=0 then
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:SetLabelObject(sc)
e1:SetValue(cm.eqlimit)
tc:RegisterEffect(e1)
if sc:GetEquipCount()>=3 then
local sg=sc:GetEquipGroup()
local tgg=sg:Select(tp,1,1,nil):GetFirst()
if not tgg:IsType(TYPE_TRAPMONSTER) then
local cid=sc:CopyEffect(tc:GetCode(),RESET_EVENT+RESETS_STANDARD)
end
end
end
end
end
function cm.eqlimit(e,c)
return c==e:GetLabelObject()
end
function cm.filter(c,code)
return c:IsFaceup() and c:IsCanTurnSet() and not c:IsCode(code)
end
function cm.turnuptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,e:GetHandler():GetCode()) end
end
function cm.turnupop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,e:GetHandler():GetCode()) then return true end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local tcg=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local sg=tcg:GetFirst()
local evg=Group.CreateGroup()
if sg:IsType(TYPE_MONSTER) then
Duel.ChangePosition(sg,POS_FACEDOWN_DEFENSE)
else
sg:CancelToGrave()
if Duel.ChangePosition(sg,POS_FACEDOWN)>0 then
evg:AddCard(sg)
end
end
if #evg>0 then
Duel.RaiseEvent(evg,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
function cm.spfilter(c)
return c:IsFacedown() and c:IsReleasable()
end
function cm.sppcon(e,c)
local tp=e:GetHandler():GetControler()
if c==nil then return true end
return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,0,3,nil) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_ONFIELD,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function cm.sppcop(e,cp,eg,ep,ev,re,r,rp)
local tp=e:GetHandler():GetControler()
local sg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_ONFIELD,0,nil)
local g=sg:Select(tp,1,1,nil)
Duel.Release(g,REASON_COST)
end
function cm.actcon(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
return re==te
end
function cm.actop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangePosition(e:GetHandler(),POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,e:GetHandler())
end
function cm.atkval(e,c)
local g=c:GetEquipGroup()
return g:GetSum(Card.GetTextAttack)
end
\ No newline at end of file
local m=77765001
local cm=_G["c"..m]
Duel.LoadScript("c77765000.lua")
function cm.initial_effect(c)
local function difficulty_filter(c)
return Kaguya.IsDifficulty(c)-- and c:GetActivateEffect():IsActivatable(tp,true,true)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCountLimit(1,m)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_SZONE,tp)>0 and Duel.IsExistingMatchingCard(difficulty_filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil) end
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(1-tp,LOCATION_SZONE,tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,difficulty_filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
local te=tc:GetActivateEffect()
Duel.MoveToField(tc,tp,1-tp,LOCATION_SZONE,POS_FACEUP,true)
if te then
te:UseCountLimit(tp,1,true)
end
end
end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(function(e,c)
return Kaguya.IsDifficulty(c)
end)
e2:SetValue(function(e,te,c)
local ec=te:GetOwner()
return ec~=e:GetOwner() and ec~=c
end)
c:RegisterEffect(e2)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,0)
e1:SetTarget(function(e,c,tp,sumtp,sumpos,top,te)
--Debug.Message(aux.GetValueType(te))
if not te then return false end
local tc=te:GetHandler()
--Debug.Message(tc and tc:GetCode() or 0)
return not tc or not Kaguya.IsDifficulty(tc)
end)
c:RegisterEffect(e1)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_TO_DECK)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,1)
e4:SetTarget(aux.TRUE)
c:RegisterEffect(e4)
end
local m=77765002
local cm=_G["c"..m]
Duel.LoadScript("c77765000.lua")
--竹取飛翔 ~ Lunatic Princess
function c77765002.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(77765002,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c77765002.activate)
c:RegisterEffect(e1)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetRange(LOCATION_FZONE)
e1:SetCountLimit(1)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_SZONE,tp)>0 and Duel.IsExistingMatchingCard(c77765002.filter1,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,LOCATION_DECK+LOCATION_HAND,tp)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(1-tp,LOCATION_SZONE,tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c77765002.filter1,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,tp)
if #g==0 then return end
Duel.SendtoGrave(g,REASON_EFFECT)
local sc=g:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=Duel.SelectMatchingCard(tp,c77765002.filter2,tp,LOCATION_DECK,0,1,1,sc,sc)
if #sg>0 then
local tc=sg:GetFirst()
local te=tc:GetActivateEffect()
Duel.MoveToField(tc,tp,1-tp,LOCATION_SZONE,POS_FACEUP,true)
c:SetCardTarget(tc)
if te then
te:UseCountLimit(tp,1,true)
end
end
end)
c:RegisterEffect(e1)
--Destroy
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)
local g=Group.CreateGroup()
g:KeepAlive()
e2:SetLabelObject(g)
e2:SetOperation(c77765002.checkop)
c:RegisterEffect(e2)
local function KaguyaFilter(c,e,tp,cc)
local p=c:GetControler()
local tc=Senya.GetDFCBackSideCard(cc)
return c:IsFaceup() and c:IsCode(77765001) and Duel.GetLocationCount(p,LOCATION_SZONE,tp)>0 and tc:CheckEquipTarget(c)
end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(0x14000+EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=e:GetLabelObject():GetLabelObject()
local tg=g:Filter(function(c)
return Senya.IsDFCTransformable(c) and Duel.IsExistingMatchingCard(KaguyaFilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp,c)
end,nil)
if chk==0 then return #tg>0 end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,tg,#tg,0,0)
end)
e3:SetOperation(function (e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=e:GetLabelObject():GetLabelObject()
local tg=g:Filter(function(c)
return Senya.IsDFCTransformable(c) and Duel.IsExistingMatchingCard(KaguyaFilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp,c)
end,nil)
for cc in aux.Next(tg) do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,KaguyaFilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp,cc)
local tc=g:GetFirst()
if tc then
local p=tc:GetControler()
if p~=cc:GetControler() then
Duel.MoveToField(cc,p,p,LOCATION_SZONE,POS_FACEUP,false)
end
Senya.TransformDFCCard(cc)
Duel.Equip(p,cc,tc)
end
end
Duel.RaiseEvent(tg,EVENT_CUSTOM+77765000,re,r,rp,ep,ev)
end)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function c77765002.filter(c,e,tp)
return c:IsCode(77765001) and (c:IsAbleToHand() or c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end
function c77765002.activate(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(c77765002.filter,tp,LOCATION_DECK,0,1,nil,e,tp) then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(77765002,1))
local g=Duel.SelectMatchingCard(tp,c77765002.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local sc=g:GetFirst()
if sc then
if sc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (not sc:IsAbleToHand() or Duel.SelectYesNo(tp,aux.Stringid(77765002,2))) then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoHand(sc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sc)
end
end
end
end
function c77765002.filter1(c,tp)
return c:IsAbleToGrave() and Kaguya.IsDifficulty(c) and Duel.IsExistingMatchingCard(c77765002.filter2,tp,LOCATION_DECK,0,1,c,c)
end
function c77765002.filter2(c,mc)
return c:IsCode(mc:GetCode())
end
function c77765002.checkop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
g:Clear()
g:Merge(e:GetHandler():GetCardTarget())
end
local m=77765003
local cm=_G["c"..m]
Duel.LoadScript("c77765000.lua")
--蓬莱传说
function c77765003.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--self destroy
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_SZONE)
e1:SetCode(EFFECT_SELF_DESTROY)
e1:SetCondition(cm.con)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,m)
e2:SetRange(LOCATION_SZONE)
e2:SetCost(cm.sgcost)
e2:SetTarget(cm.sgtg)
e2:SetOperation(cm.sgop)
c:RegisterEffect(e2)
--Draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,m+100)
e2:SetCost(cm.cost)
e2:SetTarget(cm.target)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
end
function cm.filter1(c)
return c:IsCode(77765001)
end
function cm.con(e)
return not Duel.IsExistingMatchingCard(cm.filter1,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function cm.costfilter(c)
return Kaguya.IsDifficulty(c) and c:IsDiscardable()
end
function cm.sgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,cm.costfilter,1,1,REASON_COST+REASON_DISCARD)
end
function cm.sgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,PLAYER_ALL,LOCATION_MZONE)
end
function cm.sgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function cm.filter(c)
return Kaguya.IsDifficulty(c) and c:IsAbleToDeckAsCost()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.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
local m=77765004
local cm=_G["c"..m]
Duel.LoadScript("c77765000.lua")
--cm.Senya_name_with_difficulty=1
function cm.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
c:RegisterEffect(e3)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--[[for _,code in ipairs({EFFECT_CANNOT_BE_XYZ_MATERIAL,EFFECT_CANNOT_BE_SYNCHRO_MATERIAL,EFFECT_CANNOT_BE_FUSION_MATERIAL,EFFECT_CANNOT_BE_LINK_MATERIAL,m}) do
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(code)
e2:SetProperty(EFFECT_FLAG_IGNORE_RANGE)
e2:SetTargetRange(0xff,0xff)
e2:SetTarget(function(e,c)
return c:GetSequence()>4 or not c:IsLocation(LOCATION_MZONE)
end)
e2:SetRange(LOCATION_SZONE)
e2:SetValue(function(e,c)
return c and c:IsControler(1-e:GetHandlerPlayer())
end)
c:RegisterEffect(e2)
end]]
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_IGNITION)
--e1:SetCode(EVENT_FREE_CHAIN)
--e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
Duel.SetTargetParam(Duel.SelectOption(tp,1056,1063,1073,1076))
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local opt=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local ct=nil
if opt==0 then ct=TYPE_FUSION end
if opt==1 then ct=TYPE_SYNCHRO end
if opt==2 then ct=TYPE_XYZ end
if opt==3 then ct=TYPE_LINK end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetLabel(ct)
e1:SetTargetRange(0,1)
e1:SetTarget(cm.sumlimit)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetTarget(cm.distg)
e2:SetLabel(ct)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
end)
c:RegisterEffect(e1)
local function KaguyaFilter(c,e,tp,cc)
local p=c:GetControler()
local tc=Senya.GetDFCBackSideCard(cc)
return c:IsFaceup() and c:IsCode(77765001) and Duel.GetLocationCount(p,LOCATION_SZONE,tp)>0 and tc:CheckEquipTarget(c)
end
local function DifficultyFilter(c,e,tp)
return Kaguya.IsDifficulty(c) and Senya.IsDFCTransformable(c) and Duel.IsExistingMatchingCard(KaguyaFilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp,c)
end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE)
e3:SetCategory(CATEGORY_EQUIP)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(0x14000+EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,0,0)
end)
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local dg=Duel.SelectMatchingCard(tp,DifficultyFilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local cc=dg:GetFirst()
if cc then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,KaguyaFilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp,cc)
local tc=g:GetFirst()
local p=tc:GetControler()
Duel.MoveToField(cc,tp,p,LOCATION_SZONE,POS_FACEUP,false)
Senya.TransformDFCCard(cc)
Duel.Equip(p,cc,tc)
Duel.RaiseEvent(cc,EVENT_CUSTOM+77765000,re,r,rp,ep,ev)
end
end)
c:RegisterEffect(e3)
end
function cm.filter(c)
return c:IsCode(m-1) and c:IsAbleToHand() and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
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+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_GRAVE)
--destroy
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(cm.descon)
e1:SetOperation(cm.desop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,3)
e:GetHandler():RegisterEffect(e1)
e:GetHandler():RegisterFlagEffect(1082946,RESET_PHASE+PHASE_END+RESET_OPPO_TURN,0,3)
cm[e:GetHandler()]=e1
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,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
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetTurnCounter()
ct=ct+1
c:SetTurnCounter(ct)
if ct==3 then
Duel.Destroy(c,REASON_RULE)
c:ResetFlagEffect(1082946)
end
end
function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return c:IsType(e:GetLabel())
end
function cm.distg(e,c)
return c:IsType(e:GetLabel())
end
local m=77765005
local cm=_G["c"..m]
Duel.LoadScript("c77765000.lua")
cm.Senya_name_with_difficulty=1
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:SetCountLimit(1,m)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
local function f(c,tp)
return c:IsFaceup() and Kaguya.IsDifficulty(c) and c:IsAbleToChangeControler() and Duel.GetLocationCount(1-c:GetControler(),LOCATION_SZONE,tp)>0
end
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_SZONE) and f(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(f,tp,LOCATION_SZONE,LOCATION_SZONE,1,c) and Duel.IsPlayerCanDraw(tp,1) end
local g=Duel.SelectTarget(tp,f,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,c)
e:SetLabel(g:GetFirst():GetControler())
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,1,0,0)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local p=e:GetLabel()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsControler(p) and not tc:IsImmuneToEffect(e) and Duel.GetLocationCount(1-p,LOCATION_SZONE,tp)>0 then
Duel.MoveToField(tc,tp,1-p,LOCATION_SZONE,POS_FACEUP,true)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_HAND)
e2:SetCountLimit(1,m+100)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DRAW)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(1-tp,LOCATION_SZONE,tp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 or ft<=0 then return end
Duel.ConfirmDecktop(tp,5)
local g=Duel.GetDecktopGroup(tp,5)
local tg=g:Filter(Kaguya.IsDifficulty,nil)
if ft<#tg then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
tg=tg:Select(tp,ft,ft,nil)
end
for tc in aux.Next(tg) do
Duel.MoveToField(tc,tp,1-tp,LOCATION_SZONE,POS_FACEUP,true)
if not tc:IsType(TYPE_CONTINUOUS+TYPE_FIELD+TYPE_EQUIP) then
tc:CancelToGrave()
end
end
end)
c:RegisterEffect(e2)
end
local m=77765006
local cm=_G["c"..m]
Duel.LoadScript("c77765000.lua")
cm.Senya_name_with_difficulty=1
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(22842126,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m+100)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.target)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
end
function cm.thfilter(c)
return Kaguya.IsDifficulty(c)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,3,nil) end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>=3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:Select(tp,3,3,nil)
Duel.ConfirmCards(1-tp,sg)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SET)
local tg=sg:Select(1-tp,1,1,nil)
local tc=tg:GetFirst()
Duel.MoveToField(tc,tp,1-tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.GetLocationCount(1-tp,LOCATION_SZONE,tp)>0 end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst()
Duel.Draw(tp,1,REASON_EFFECT)
if tc and tc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,tc)
if Kaguya.IsDifficulty(tc) and Duel.GetLocationCount(1-tp,LOCATION_SZONE,tp)>0 then
Duel.BreakEffect()
Duel.MoveToField(tc,tp,1-tp,LOCATION_SZONE,POS_FACEUP,true)
if not tc:IsType(TYPE_CONTINUOUS+TYPE_FIELD+TYPE_EQUIP) then
tc:CancelToGrave()
end
end
Duel.ShuffleHand(tp)
end
end
local m=77765007
local cm=_G["c"..m]
Duel.LoadScript("c77765000.lua")
cm.Senya_name_with_difficulty=1
function cm.initial_effect(c)
local function f1(c)
return Senya.check_set(c,"difficulty",1) and c:IsAbleToHand()
end
local function KaguyaFilter(c,e,tp,cc)
local p=c:GetControler()
local tc=Senya.GetDFCBackSideCard(cc)
return c:IsFaceup() and c:IsCode(77765001) and Duel.GetLocationCount(p,LOCATION_SZONE,tp)>0 and tc:CheckEquipTarget(c) and (cc:IsControler(c:GetControler()) or c:IsAbleToChangeControler())
end
local function DifficultyFilter(c,e,tp)
return Kaguya.IsDifficulty(c) and c:IsFaceup() and Senya.IsDFCTransformable(c) and Duel.IsExistingMatchingCard(KaguyaFilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp,c)
end
local target_list={
function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(f1,tp,LOCATION_DECK,0,1,nil) end
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end,
function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(DifficultyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,e,tp) end
e:SetCategory(0)
end,
function(e,tp,eg,ep,ev,re,r,rp,chk)
--[[local function generate(p)
local afilter={}
local first=true
for code,effect_list in pairs(cm[p]) do
table.insert(afilter,code)
table.insert(afilter,OPCODE_ISCODE)
if first then
first=false
else
table.insert(afilter,OPCODE_OR)
end
end
return afilter
end
if chk==0 then return #generate(1-tp)>0 end]]
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
--cm.announce_filter=generate(1-tp)
local ac=Duel.AnnounceCard(tp)
Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end,
}
local operation_list={
function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,f1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end,
function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local dg=Duel.SelectMatchingCard(tp,DifficultyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,e,tp)
local cc=dg:GetFirst()
if cc then
Duel.HintSelection(dg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,KaguyaFilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp,cc)
local tc=g:GetFirst()
local p=tc:GetControler()
if not cc:IsControler(p) then
Duel.MoveToField(cc,tp,p,LOCATION_SZONE,POS_FACEUP,false)
end
Senya.TransformDFCCard(cc)
Duel.Equip(p,cc,tc)
Duel.RaiseEvent(cc,EVENT_CUSTOM+77765000,re,r,rp,ep,ev)
end
end,
function(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
if cm[1-tp][ac] then
for _,te in ipairs(cm[1-tp][ac]) do
te:Reset()
end
cm[1-tp][ac]=nil
end
end,
}
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(function(c)
return Kaguya.IsDifficulty(c) and c:IsFaceup()
end,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end)
e1:SetTarget(Senya.multi_choice_target(m,table.unpack(target_list)))
e1:SetOperation(Senya.multi_choice_operation(table.unpack(operation_list)))
c:RegisterEffect(e1)
local function ReplaceCleanup()
for _,ftype in ipairs({"oldcf","olddf"}) do
if cm[ftype] then
--Debug.Message(ftype)
(ftype=="olddf" and Duel or Card).RegisterEffect=cm[ftype]
cm[ftype]=nil
end
end
end
if not cm.gchk then
cm.gchk=true
cm[0]={}
cm[1]={}
cm.oldcf=nil
cm.olddf=nil
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_SOLVING)
ge1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(1)
ReplaceCleanup()
cm.oldcf=Card.RegisterEffect
cm.olddf=Duel.RegisterEffect
local code=re:GetHandler():GetOriginalCode()
Card.RegisterEffect=cm.ReplacedRegisterEffect(ep,code,cm.oldcf)Duel.RegisterEffect=cm.ReplacedRegisterEffect(ep,code,cm.olddf)
end)
Duel.RegisterEffect(ge1,0)
for _,code in ipairs({EVENT_CHAIN_SOLVED,EVENT_CHAIN_NEGATED,EVENT_CHAIN_END}) do
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(code)
ge1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return cm.oldcf or cm.olddf
end)
ge1:SetOperation(ReplaceCleanup)
Duel.RegisterEffect(e1,0)
end
end
end
function cm.PushNewEffect(p,code,e)
if not cm[p][code] then
cm[p][code]={}
end
--Debug.Message(code)
table.insert(cm[p][code],e)
end
function cm.ReplacedRegisterEffect(p,code,oldf)
local effect_index=(oldf==Duel.RegisterEffect and 1 or 2)
return function(...)
--Debug.Message(2)
local e=select(effect_index,...)
for _,method in ipairs({"Target","Operation","Cost","Value"}) do
local func=Effect["Get"..method](e)
if func and aux.GetValueType(func)=="function" then
Effect["Set"..method](e,cm.ReplacedFunction(p,code,func))
end
end
cm.PushNewEffect(p,code,e)
return oldf(...)
end
end
function cm.ReplacedFunction(p,code,f)
return function(...)
local oldcf=Card.RegisterEffect
local olddf=Duel.RegisterEffect
Card.RegisterEffect=cm.ReplacedRegisterEffect(p,code,oldcf)Duel.RegisterEffect=cm.ReplacedRegisterEffect(p,code,olddf)
local res={Senya.ProtectedRun(f,...)}
Card.RegisterEffect=oldcf
Duel.RegisterEffect=olddf
return table.unpack(res)
end
end
local m=77765008
local cm=_G["c"..m]
Duel.LoadScript("c77765000.lua")
cm.Senya_name_with_difficulty=1
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9411399,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCost(aux.bfgcost)
e1:SetTarget(cm.target1)
e1:SetOperation(cm.operation1)
c:RegisterEffect(e1)
end
function cm.filter(c)
return Kaguya.IsDifficulty(c) and c:IsAbleToDeck() and not c:IsPublic()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp)
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(p,cm.filter,p,LOCATION_HAND,0,1,63,nil)
if g:GetCount()>0 then
Duel.ConfirmCards(1-p,g)
local ct=Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
Duel.ShuffleDeck(p)
Duel.BreakEffect()
Duel.Draw(p,ct+1,REASON_EFFECT)
end
end
function cm.filter1(c,e,sp)
return c:IsCode(77765001) and c:IsCanBeSpecialSummoned(e,0,sp,false,false) and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
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+LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local sc=Duel.GetFirstMatchingCard(cm.filter1,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp)
if sc then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
end
local m=77765010
local cm=_G["c"..m]
Duel.LoadScript("c77765000.lua")
cm.Senya_name_with_difficulty=true
function cm.initial_effect(c)
local function transform_trigger_filter(c,tp)
return c:GetSummonPlayer()==tp and c:GetSummonLocation()==LOCATION_EXTRA and c:IsControlerCanBeChanged() and c:IsLocation(LOCATION_MZONE)
end
Kaguya.ContinuousCommonEffect(c,EVENT_SPSUMMON_SUCCESS,function(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(transform_trigger_filter,1,nil,tp)
end,nil,nil,function(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(transform_trigger_filter,nil,tp)
return Duel.GetControl(g,1-tp)>0
end)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
--[[e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(function(c)
return c:IsFaceup() and not c:IsCode(77765001)
end,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(RACE_DRAGON)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end)]]
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(1,0)
e1:SetTarget(function(e,c)
return not c:IsCode(77765001)
end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCondition(cm.condition2)
e2:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(m)==0 end
e:GetHandler():RegisterFlagEffect(m,RESET_PHASE+PHASE_DAMAGE,0,1)
end)
e2:SetOperation(cm.operation2)
c:RegisterEffect(e2)
end
function cm.condition2(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return d~=nil and d:IsFaceup() and ((a:IsCode(77765001) and a:IsRelateToBattle())
or (d:IsCode(77765001) and d:IsRelateToBattle()))
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp,chk)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if not a:IsRelateToBattle() or not d:IsRelateToBattle() then return end
local e1=Effect.CreateEffect(e:GetHandler())
--e1:SetOwnerPlayer(tp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if a:IsCode(77765001) then
e1:SetValue(d:GetAttack())
if d:IsCode(77765001) then
local e2=e1:Clone()
e2:SetValue(a:GetAttack())
d:RegisterEffect(e2)
end
a:RegisterEffect(e1)
elseif d:IsCode(77765001) then
e1:SetValue(a:GetAttack())
d:RegisterEffect(e1)
end
end
local m=77765011
local cm=_G["c"..m]
Duel.LoadScript("c77765000.lua")
cm.Senya_name_with_treasure=true
function cm.initial_effect(c)
Kaguya.EquipCommonEffect(c)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetValue(cm.adval)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e5)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.adval(e,c)
return Duel.GetFieldGroupCount(0,LOCATION_GRAVE,LOCATION_GRAVE)*100
end
function cm.filter(c)
return c:IsFaceup() and not c:IsCode(77765001)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Damage(1-tp,tc:GetBaseAttack(),REASON_EFFECT)
end
end
local m=77765020
local cm=_G["c"..m]
Duel.LoadScript("c77765000.lua")
cm.Senya_name_with_difficulty=true
function cm.initial_effect(c)
local ex=Kaguya.ContinuousCommonEffect(c,0,aux.TRUE)
ex:SetType(EFFECT_TYPE_IGNITION)
ex:SetProperty(0)
ex:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)-Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
if chk==0 then return ct>0 and Duel.IsExistingMatchingCard(Card.IsAbleToDeckAsCost,tp,LOCATION_HAND,0,ct,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeckAsCost,tp,LOCATION_HAND,0,ct,ct,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end)
local e1=Effect.CreateEffect(c)
--e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
--e1:SetTarget(cm.target)
--e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e4:SetRange(LOCATION_SZONE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,0)
e4:SetTarget(function(e,c,tp)
--local tp=e:GetHandlerPlayer()
return Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)>=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
end)
c:RegisterEffect(e4)
--[[local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
e1:SetLabelObject(e4)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_SZONE)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
te:SetValue(Duel.GetFieldGroupCount(tp,0,LOCATION_HAND))
end)
c:RegisterEffect(e1)]]
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_DIRECT_ATTACK)
e4:SetRange(LOCATION_SZONE)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e4:SetTarget(function(e,c)
return c:IsCode(77765001) and c:IsFaceup()
end)
e4:SetValue(1)
c:RegisterEffect(e4)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(function(e,tp,eg)
return eg:GetFirst():IsCode(77765001) and Duel.GetAttackTarget()==nil
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local ee=Effect.CreateEffect(e:GetHandler())
ee:SetType(EFFECT_TYPE_SINGLE)
ee:SetCode(EFFECT_UPDATE_ATTACK)
ee:SetValue(300)
ee:SetReset(0x1fe1000)
tc:RegisterEffect(ee,true)
end)
c:RegisterEffect(e1)
--Description Required:
--0: Send to GY
--1: Special Summon Kaguya
--[[local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetCountLimit(1,m)
e1:SetRange(LOCATION_SZONE)
e1:SetCost(Senya.DescriptionCost())
e1:SetTarget(cm.target1)
e1:SetOperation(cm.operation1)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetCountLimit(1,m)
e1:SetRange(LOCATION_SZONE)
e1:SetCost(Senya.DescriptionCost())
e1:SetTarget(cm.target2)
e1:SetOperation(cm.operation2)
c:RegisterEffect(e1)
if not cm.check then
cm.check=0
local ex1=Effect.GlobalEffect()
ex1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ex1:SetCode(EVENT_SPSUMMON_SUCCESS)
ex1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(function(c)
return c:IsCode(77765001) and c:GetSummonLocation()==LOCATION_GRAVE
end,1,nil)
end)
ex1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
cm.check=cm.check+1
if cm.check%3==0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+m,re,r,rp,ep,ev)
end
end)
Duel.RegisterEffect(ex1,0)
local ex1=Effect.GlobalEffect()
ex1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ex1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ex1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
cm.check=0
end)
Duel.RegisterEffect(ex1,0)
end]]
end
--[[function cm.tgfilter(c)
return c:IsCode(77765001) and c:IsAbleToGrave()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function cm.filter(c,e,tp)
return c:IsCode(77765001) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
]]
local m=77765021
local cm=_G["c"..m]
Duel.LoadScript("c77765000.lua")
cm.Senya_name_with_treasure=true
function cm.initial_effect(c)
Kaguya.EquipCommonEffect(c)
--[[local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetValue(function(e,te,c)
local tc=te:GetOwner()
return e:GetOwner()~=tc and tc~=c and not Kaguya.IsTreasure(tc)
end)
c:RegisterEffect(e4)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_UNRELEASABLE_SUM)
e4:SetValue(1)
c:RegisterEffect(e4)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_UNRELEASABLE_NONSUM)
e4:SetValue(1)
c:RegisterEffect(e4)]]
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e2)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1)
e4:SetRange(LOCATION_SZONE)
e4:SetCost(Senya.ForbiddenCost())
e4:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
local l=e:GetLabel()
e:SetLabel(0)
local function f(c)
return c:IsAbleToRemoveAsCost() and Kaguya.IsDifficulty(c) and c:GetOriginalCode()~=m-1
end
if chk==0 then return l>0 and Duel.IsExistingMatchingCard(f,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,f,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetLabelObject(g:GetFirst())
end)
e4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local code=e:GetLabelObject():GetOriginalCode()
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
c:CopyEffect(code+1,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
end
end)
c:RegisterEffect(e4)
end
local m=77765030
local cm=_G["c"..m]
Duel.LoadScript("c77765000.lua")
cm.Senya_name_with_difficulty=true
function cm.initial_effect(c)
local ex=Kaguya.ContinuousCommonEffect(c,EVENT_CUSTOM+m,function(e,tp,eg,ep,ev,re,r,rp)
local flag=ev
--Debug.Message(100+ev)
return flag&(0x1<<tp)>0
end,Senya.DescriptionCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(m+200)==0 end
c:RegisterFlagEffect(m+200,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
end))
local e1=Effect.CreateEffect(c)
--e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
--[[e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_HAND,0,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_HAND,0,nil)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,1-tp,REASON_EFFECT)
Duel.ShuffleHand(tp)
end
end)]]
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCountLimit(1,m)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(function(e,tp)
return Duel.GetTurnPlayer()==tp
end)
e2:SetOperation(function(e,tp,eg,ep,eg,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NOT(Card.IsPublic),tp,LOCATION_HAND,0,nil)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local tc=g:Select(tp,1,1,nil):GetFirst()
local ex=Effect.CreateEffect(e:GetHandler())
ex:SetType(EFFECT_TYPE_SINGLE)
ex:SetCode(EFFECT_PUBLIC)
ex:SetValue(1)
ex:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
ex:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(ex)
end
end)
c:RegisterEffect(e2)
for _,code in ipairs({
--EFFECT_PUBLIC,
EFFECT_CANNOT_TRIGGER,
EFFECT_CANNOT_SSET,
EFFECT_CANNOT_MSET
}) do
local ex=Effect.CreateEffect(c)
ex:SetType(EFFECT_TYPE_FIELD)
ex:SetCode(code)
ex:SetValue(1)
ex:SetRange(LOCATION_SZONE)
ex:SetTargetRange(LOCATION_HAND,LOCATION_HAND)
ex:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
ex:SetTarget(function(e,c)
return c:IsHasEffect(EFFECT_PUBLIC)
end)
c:RegisterEffect(ex)
end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SSET_COST)
e3:SetCost(function(e,c,tp)
return Duel.IsExistingMatchingCard(Card.IsAbleToChangeControler,tp,LOCATION_HAND,0,1,c) and tp==e:GetLabelObject():GetHandlerPlayer()
end)
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToChangeControler,tp,LOCATION_HAND,0,1,1,e:GetHandler())
Duel.SendtoHand(g,1-tp,REASON_COST)
end)
--c:RegisterEffect(e3)
local e5=e3:Clone()
e5:SetCode(EFFECT_MSET_COST)
--c:RegisterEffect(e5)
local e3_=Effect.CreateEffect(c)
e3_:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3_:SetRange(LOCATION_SZONE)
e3_:SetProperty(EFFECT_TYPE_IGNORE_RANGE)
e3_:SetTargetRange(0xff,0)
e3:SetLabelObject(e3_)
e3_:SetLabelObject(e3)
c:RegisterEffect(e3_)
local e3__=e3_:Clone()
e5:SetLabelObject(e3__)
e3__:SetLabelObject(e5)
c:RegisterEffect(e3__)
if not cm.gchk then
cm.gchk=true
local ex=Effect.GlobalEffect()
ex:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ex:SetCode(EVENT_ADJUST)
ex:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local g=Duel.GetFieldGroup(p,LOCATION_HAND,0)
if #g>0 and g:FilterCount(Card.IsPublic,nil)==#g then return true end
end
return false
end)
ex:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local flag=0
for p=0,1 do
local g=Duel.GetFieldGroup(p,LOCATION_HAND,0)
if #g>0 and g:FilterCount(Card.IsPublic,nil)==#g then
flag=flag|(0x1<<p)
end
end
--Debug.Message(flag)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,e,0,tp,tp,flag)
end)
Duel.RegisterEffect(ex,0)
end
--[[local e2=Effect.CreateEffect(c)
e2:SetDescription(m*16)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCost(Senya.DescriptionCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetFlagEffect(tp,m)-Duel.GetFlagEffect(tp,m+100)==0 end
Duel.RegisterFlagEffect(tp,m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end))
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(aux.NOT(Card.IsPublic),tp,0,LOCATION_HAND,nil)
if chk==0 then return #g>0 end
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_HAND,nil)
if #g>0 then
local sg=g:RandomSelect(tp,1)
local tc=sg:GetFirst()
if not tc:IsPublic() then
for _,code in ipairs({
EFFECT_PUBLIC,
EFFECT_CANNOT_TRIGGER,
EFFECT_CANNOT_SSET,
EFFECT_CANNOT_MSET
}) do
local ex=Effect.CreateEffect(e:GetHandler())
ex:SetType(EFFECT_TYPE_SINGLE)
ex:SetCode(code)
ex:SetValue(1)
ex:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
ex:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(ex)
end
end
end
end)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetDescription(m*16+1)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,m)
e2:SetCost(Senya.DescriptionCost(Senya.DiscardHandCost(1)))
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,m+100,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end)
c:RegisterEffect(e2)]]
end
local m=77765031
local cm=_G["c"..m]
Duel.LoadScript("c77765000.lua")
cm.Senya_name_with_treasure=true
function cm.initial_effect(c)
Kaguya.EquipCommonEffect(c)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetValue(function(e,te,c)
local tc=te:GetOwner()
return e:GetOwner()~=tc and tc~=c and not Kaguya.IsTreasure(tc) and not Kaguya.IsDifficulty(tc)
end)
c:RegisterEffect(e4)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_UNRELEASABLE_SUM)
e4:SetValue(1)
c:RegisterEffect(e4)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_UNRELEASABLE_NONSUM)
e4:SetValue(1)
c:RegisterEffect(e4)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
if e==re or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or g:GetCount()~=1 then return false end
local tc=g:GetFirst()
e:SetLabelObject(tc)
return tc:IsOnField()
end
function cm.filter(c,re,rp,tf,ceg,cep,cev,cre,cr,crp)
return tf(re,rp,ceg,cep,cev,cre,cr,crp,0,c)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ct=ev
local label=Duel.GetFlagEffectLabel(0,m)
if label then
if ev==bit.rshift(label,16) then ct=bit.band(label,0xffff) end
end
local ce,cp=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
local tf=ce:GetTarget()
local ceg,cep,cev,cre,cr,crp=Duel.GetChainEvent(ct)
if chkc then return chkc:IsOnField() and cm.filter(chkc,ce,cp,tf,ceg,cep,cev,cre,cr,crp) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetLabelObject(),ce,cp,tf,ceg,cep,cev,cre,cr,crp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetLabelObject(),ce,cp,tf,ceg,cep,cev,cre,cr,crp)
local val=ct+bit.lshift(ev+1,16)
if label then
Duel.SetFlagEffectLabel(0,m,val)
else
Duel.RegisterFlagEffect(0,m,RESET_CHAIN,0,1,val)
end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.ChangeTargetCard(ev,Group.FromCards(tc))
end
end
local m=77765040
local cm=_G["c"..m]
Duel.LoadScript("c77765000.lua")
cm.Senya_name_with_difficulty=true
function cm.initial_effect(c)
local ex=Kaguya.ContinuousCommonEffect(c,EVENT_DESTROYED,function(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(function(c)
return c:GetPreviousControler()==tp and c:IsType(TYPE_MONSTER) and c:IsReason(REASON_EFFECT+REASON_BATTLE)
end,1,nil)
end)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_TO_HAND)
e1:SetRange(LOCATION_SZONE)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(function(c)
return not c:IsReason(REASON_DRAW) and c:GetReasonPlayer()==tp and c:IsControler(tp)
end,1,nil)
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=eg:Filter(function(c)
return c:IsAbleToRemove() and not c:IsReason(REASON_DRAW) and c:GetReasonPlayer()==tp and c:IsControler(tp)
end,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(function(c)
return c:IsAbleToRemove() and not c:IsReason(REASON_DRAW) and c:IsRelateToEffect(e) and c:GetReasonPlayer()==tp
end,nil)
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and ep==tp
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local tc=re:GetHandler()
Duel.Recover(1-tp,tc:GetAttack()+tc:GetDefense(),REASON_EFFECT)
end)
c:RegisterEffect(e1)
--[[local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_LEAVE_FIELD_P)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
e:SetLabel(eg:IsExists(function(c)
return c:GetEquipCount()>0
end,1,nil) and 1 or 0)
end)
c:RegisterEffect(e2)
ex:SetLabelObject(e2)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetOperation(cm.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(cm.damcon)
e3:SetOperation(cm.damop)
c:RegisterEffect(e3)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
local function equip_filter(c,mc)
return c:IsType(TYPE_EQUIP) and c:CheckEquipTarget(mc) and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
local function monster_filter(c,tp)
return c:IsFaceup() and Duel.IsExistingMatchingCard(equip_filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,c)
end
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(monster_filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_GRAVE)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectMatchingCard(tp,monster_filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
local tc=g:GetFirst()
if tc then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local ec=Duel.SelectMatchingCard(tp,equip_filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,tc):GetFirst()
Duel.Equip(tp,ec,tc)
end
end)
c:RegisterEffect(e1)]]
end
--[[function cm.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1)
end
function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetFlagEffect(m)~=0
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Recover(e:GetHandler():GetOwner(),800,REASON_EFFECT)
end
]]
local m=77765041
local cm=_G["c"..m]
Duel.LoadScript("c77765000.lua")
cm.Senya_name_with_treasure=true
function cm.initial_effect(c)
Kaguya.EquipCommonEffect(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_DAMAGE)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(cm.con)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_DAMAGE)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.regcon)
e2:SetOperation(cm.regop)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_DAMAGE)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.con2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetTarget(cm.negtg)
e2:SetOperation(cm.negop)
c:RegisterEffect(e2)
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_SOLVING)
ge1:SetOperation(cm.count)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_CHAIN_SOLVED)
ge2:SetOperation(cm.reset)
Duel.RegisterEffect(ge2,0)
end
end
function cm.count(e,tp,eg,ep,ev,re,r,rp)
cm.chain_solving=true
end
function cm.reset(e,tp,eg,ep,ev,re,r,rp)
cm.chain_solving=false
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and not cm.chain_solving
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,ev,REASON_EFFECT)
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and cm.chain_solving
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local ct=ev
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1,ct)
end
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)>0
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local labels={e:GetHandler():GetFlagEffectLabel(m)}
local ct=0
for i=1,#labels do ct=ct+labels[i] end
e:GetHandler():ResetFlagEffect(m)
Duel.Recover(tp,ct,REASON_EFFECT)
end
function cm.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and aux.disfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.disfilter1,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,aux.disfilter1,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function cm.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsDisabled() then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
end
end
local m=77765050
local cm=_G["c"..m]
Duel.LoadScript("c77765000.lua")
cm.Senya_name_with_difficulty=true
function cm.initial_effect(c)
c:EnableCounterPermit(0x1)
c:SetCounterLimit(0x1,7)
local ex=Kaguya.ContinuousCommonEffect(c,EVENT_CUSTOM+77765000)
ex:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
local e1=Effect.CreateEffect(c)
--e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
--[[e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_EXTRA,3,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,3,tp,LOCATION_EXTRA)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
Duel.ConfirmCards(tp,g)
if g:GetClassCount(Card.GetCode)>=3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,function(g)
return g:GetClassCount(Card.GetCode)==#g
end,false,3,3)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end)]]
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_SZONE)
e2:SetOperation(cm.counter)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(function(e,c)
return c:IsFaceup()
end)
e2:SetValue(function(e,c)
return e:GetHandler():GetCounter(0x1)*-300
end)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SELF_DESTROY)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(function(e,c)
return c:IsFaceup() and c:IsAttack(0) and c:GetBaseAttack()>0
end)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(m*16)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_ADD_COUNTER|0x1)
e3:SetRange(LOCATION_SZONE)
e3:SetCost(Senya.DescriptionCost())
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetCounter(0x1)>=7
end)
local function f(c,e,tp)
return c:IsCode(37564303) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel[c:IsLocation(LOCATION_EXTRA) and "GetLocationCountFromEx" or "GetMZoneCount"](tp)>0 and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
e3:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=c:GetCounter(0x1)
if chk==0 then return ct>0 and c:IsCanRemoveCounter(tp,0x1,ct,REASON_EFFECT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,1-tp,LOCATION_EXTRA+LOCATION_GRAVE)
end)
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetCounter(0x1)
if c:IsRelateToEffect(e) and ct>0 and c:IsCanRemoveCounter(tp,0x1,ct,REASON_EFFECT) then
c:RemoveCounter(tp,0x1,ct,REASON_EFFECT)
if Duel.IsExistingMatchingCard(f,1-tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil,e,1-tp) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(1-tp,f,1-tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil,e,1-tp)
Duel.BreakEffect()
Duel.SpecialSummon(g,0,1-tp,1-tp,false,false,POS_FACEUP)
end
end
end)
c:RegisterEffect(e3)
end
function cm.counter(e,tp,eg,ep,ev,re,r,rp)
local ct=#eg
if ct>0 then
e:GetHandler():AddCounter(0x1,ct,true)
end
end
local m=77765051
local cm=_G["c"..m]
Duel.LoadScript("c77765000.lua")
cm.Senya_name_with_treasure=true
function cm.initial_effect(c)
Kaguya.EquipCommonEffect(c)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_ATTACK_ALL)
e4:SetValue(1)
c:RegisterEffect(e4)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
e4:SetValue(1)
c:RegisterEffect(e4)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PREDRAW)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0
and Duel.GetDrawCount(tp)>0
end
function cm.filter(c)
return c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
local dt=Duel.GetDrawCount(tp)
if dt~=0 then
_replace_count=0
_replace_max=dt
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_DRAW_COUNT)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_DRAW)
e1:SetValue(0)
Duel.RegisterEffect(e1,tp)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
_replace_count=_replace_count+1
if _replace_count<=_replace_max then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
--[[
Bring the following code to some developers if you see this message. This code is somehow similar to the one for KoishiPro2 iOS. However, in fact they are not the same thing.
SSB3b3VsZCBhcHByZWNpYXRlIGlmIHlvdSBjb3VsZCBzZWUgdGhpcyBoaWRkZW4gbGV0dGVyLgpJ
IHJlYWxseSBsb3ZlIFNla2th77yMIGFsbCB0aGUgZGF5IGFuZCBuaWdodCwgbm8gbWF0dGVyIHdo
YXQgaGFwcGVuZWQsIGV2ZW4gaW4gdGhlIHdvcnN0IGNvbmRpdGlvbnMuClBsZWFzZSwgY29tZSBi
YWNrIHRvIG1lIGlmIE5hbmFoaXJhIGlzIHN0aWxsIGluIHlvdXIgbWluZC4gSSB3aWxsIGFsd2F5
cyB3ZWxjb21lIHlvdSBiYWNrLgpXaXNoIG15IGRyZWFtIHdvdWxkIGNvbWUgdHJ1ZS4uLgo=
]]
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