Commit 03423c08 authored by Tachibana's avatar Tachibana

ybb

parent d60b969c
......@@ -18,11 +18,14 @@ function cm.initial_effect(c)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_MAIN_END+TIMINGS_CHECK_MONSTER)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+10000)
e3:SetCost(cm.cost)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
end
......@@ -45,6 +48,13 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHandAsCost() end
Duel.SendtoHand(e:GetHandler(),nil,REASON_COST)
end
function cm.sumfilter(c)
return c:IsRace(RACE_CYBERSE) and c:IsSummonable(true,nil)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0 and Duel.IsExistingMatchingCard(cm.sumfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function cm.op(e,tp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
......@@ -54,24 +64,25 @@ function cm.op(e,tp)
e1:SetOperation(cm.desop)
e1:SetReset(RESET_PHASE+PHASE_END,1)
Duel.RegisterEffect(e1,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,cm.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_LOCATION)
return rscon.excard2(rsva.filter_l,LOCATION_MZONE)(e,tp) and loc & LOCATION_MZONE ~=0
end
function cm.desop(e,tp)
if Duel.GetFlagEffect(tp,m)==0 and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(cm.sumfilter,tp,LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,0))
if Duel.GetFlagEffect(tp,m)==0 and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,0))
then
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_CARD,0,m)
rsop.SelectDestroy(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,{})
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
if sg:GetCount()>0 then
Duel.Summon(tp,sg:GetFirst(),true,nil)
end
end
end
function cm.sumfilter(c)
return c:IsRace(RACE_CYBERSE) and c:IsSummonable(true,nil)
end
\ No newline at end of file
end
......@@ -10,7 +10,7 @@ function cm.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,m)
e1:SetCost(cm.spcost)
e1:SetCost(cm.cost)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
......
......@@ -148,7 +148,7 @@ end
--functions e5 needs
function cm.atktg_2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.SetChainLimit(aux.FALSE))
Duel.SetChainLimit(aux.FALSE)
end
function cm.atkop_2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -14,7 +14,6 @@ function cm.initial_effect(c)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCost(cm.spcost)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
......@@ -73,30 +72,23 @@ function cm.initial_effect(c)
c:RegisterEffect(e8)
end
--functions e1 needs
function cm.spcfilter(c,e)
local tp=e:GetHandler():GetControler()
return c:IsType(TYPE_MONSTER) and c:GetBaseAttack()==0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp,LOCATION_MZONE) and not c:IsPublic()
end
function cm.spcon(e,tp,ep,eg,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_HAND,0,1,c,e)
function cm.spcfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:GetBaseAttack()==0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp) and not c:IsPublic()
end
function cm.spcost(e,tp,ep,eg,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function cm.sptg(e,tp,ep,eg,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
if chk==0 then return Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_HAND,0,1,c,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,cm.spcfilter,tp,LOCATION_HAND,0,1,1,c,e)
local g=Duel.SelectMatchingCard(tp,cm.spcfilter,tp,LOCATION_HAND,0,1,1,c,e,tp)
Duel.ConfirmCards(1-tp,g)
g:KeepAlive()
e:SetLabelObject(g)
Duel.ShuffleHand(tp)
end
function cm.sptg(e,tp,ep,eg,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=e:GetLabelObject()
if chk==0 then return Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_HAND,0,1,c,e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,LOCATION_HAND)
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment