Commit 3124b512 authored by TanakaKotoha's avatar TanakaKotoha

fix 2

parent c6285d14
...@@ -2,134 +2,137 @@ ...@@ -2,134 +2,137 @@
local m=22600109 local m=22600109
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--link summon --link summon
aux.AddLinkProcedure(c,cm.matfilter,1,1) aux.AddLinkProcedure(c,cm.matfilter,1,1)
c:EnableReviveLimit() c:EnableReviveLimit()
--search --search
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_HANDES+CATEGORY_SEARCH) e1:SetCategory(CATEGORY_HANDES+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.scon1) e1:SetCondition(cm.scon1)
e1:SetCost(cm.stg1) e1:SetCost(cm.stg1)
e1:SetOperation(cm.sop1) e1:SetOperation(cm.sop1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--search --search
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SEARCH) e2:SetCategory(CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetCondition(cm.scon2) e2:SetCondition(cm.scon2)
e2:SetCost(cm.stg2) e2:SetCost(cm.stg2)
e2:SetOperation(cm.sop2) e2:SetOperation(cm.sop2)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--return --return
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(cm.retcon) e3:SetCondition(cm.retcon)
e3:SetOperation(cm.retreg) e3:SetOperation(cm.retreg)
c:RegisterEffect(e3) c:RegisterEffect(e3)
-- --
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL) e4:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetValue(cm.linklimit) e4:SetValue(cm.linklimit)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function cm.linklimit(e,c) function cm.linklimit(e,c)
if not c then return false end if not c then return false end
return not c:IsSetCard(0x261) return not c:IsSetCard(0x261)
end end
function cm.matfilter(c) function cm.matfilter(c)
return c:IsLinkSetCard(0x261) and not c:IsType(TYPE_LINK) return c:IsLinkSetCard(0x261) and not c:IsType(TYPE_LINK)
end end
function cm.scon1(e,tp,eg,ep,ev,re,r,rp) function cm.scon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end end
function cm.filter1(c) function cm.filter1(c)
return c:IsSetCard(0x261) and c:IsAbleToHand() return c:IsSetCard(0x261) and c:IsAbleToHand()
end end
function cm.stg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.stg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function cm.sop1(e,tp,eg,ep,ev,re,r,rp) function cm.sop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter1,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.filter1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0) local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
if g:GetCount()==0 then return end if g:GetCount()==0 then return end
Duel.BreakEffect() Duel.BreakEffect()
local sg=g:RandomSelect(tp,1) local sg=g:RandomSelect(tp,1)
Duel.SendtoGrave(sg,REASON_DISCARD+REASON_EFFECT) Duel.SendtoGrave(sg,REASON_DISCARD+REASON_EFFECT)
end end
end end
function cm.scon2(e,tp,eg,ep,ev,re,r,rp) function cm.scon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPIRIT)>=5 return Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPIRIT)>=5
end
function cm.sfilter(c,att)
return c:IsAttribute(att) and c:IsType(TYPE_SPIRIT)
end end
function cm.filter2(c,tp) function cm.filter2(c,tp)
return c:IsType(TYPE_SPIRIT) and c:IsAbleToHand() and not Duel.IsExistingMatchingCard(Card.IsAttribute,tp,LOCATION_GRAVE,0,1,nil,c:GetAttribute()) return c:IsType(TYPE_SPIRIT) and c:IsAbleToHand() and not Duel.IsExistingMatchingCard(cm.sfilter,tp,LOCATION_GRAVE,0,1,nil,c:GetAttribute())
end end
function cm.stg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.stg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_DECK,0,1,nil,tp) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function cm.sop2(e,tp,eg,ep,ev,re,r,rp) function cm.sop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter2,tp,LOCATION_DECK,0,1,1,nil,tp) local g=Duel.SelectMatchingCard(tp,cm.filter2,tp,LOCATION_DECK,0,1,1,nil,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp) function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end end
function cm.retreg(e,tp,eg,ep,ev,re,r,rp) function cm.retreg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(1104) e1:SetDescription(1104)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND) e1:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1ee0000+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+0x1ee0000+RESET_PHASE+PHASE_END)
e1:SetCondition(aux.SpiritReturnCondition) e1:SetCondition(aux.SpiritReturnCondition)
e1:SetTarget(cm.rettg) e1:SetTarget(cm.rettg)
e1:SetOperation(cm.retop) e1:SetOperation(cm.retop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.retfilter(c) function cm.retfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x261) and c:IsAbleToHand() return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x261) and c:IsAbleToHand()
end end
function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
if e:IsHasType(EFFECT_TYPE_TRIGGER_F) then if e:IsHasType(EFFECT_TYPE_TRIGGER_F) then
return true return true
else else
return Duel.GetMatchingGroupCount(cm.retfilter,tp,LOCATION_GRAVE,0,nil)>0 return Duel.GetMatchingGroupCount(cm.retfilter,tp,LOCATION_GRAVE,0,nil)>0
end end
end end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end end
function cm.retop(e,tp,eg,ep,ev,re,r,rp) function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and Duel.SendtoDeck(c,nil,2,REASON_EFFECT)~=0 if c:IsRelateToEffect(e) and c:IsFaceup() and Duel.SendtoDeck(c,nil,2,REASON_EFFECT)~=0
and Duel.GetMatchingGroupCount(cm.retfilter,tp,LOCATION_GRAVE,0,nil)>0 then and Duel.GetMatchingGroupCount(cm.retfilter,tp,LOCATION_GRAVE,0,nil)>0 then
local g=Duel.GetMatchingGroup(cm.retfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(cm.retfilter,tp,LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,cm.retfilter,tp,LOCATION_GRAVE,0,1,1,nil) local tg=Duel.SelectMatchingCard(tp,cm.retfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoHand(tg,nil,REASON_EFFECT) Duel.SendtoHand(tg,nil,REASON_EFFECT)
end end
end end
\ No newline at end of file
...@@ -71,7 +71,7 @@ function c26809023.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -71,7 +71,7 @@ function c26809023.spop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c26809023.cfilter(c) function c26809023.cfilter(c)
return c:IsType(TYPE_EFFECT) return c:IsType(TYPE_EFFECT) and c:IsFaceup()
end end
function c26809023.handcon(e) function c26809023.handcon(e)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
......
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