Commit 51679337 authored by TanakaKotoha's avatar TanakaKotoha

vivian

parent 36627443
No preview for this file type
...@@ -3,20 +3,21 @@ function c12031010.initial_effect(c) ...@@ -3,20 +3,21 @@ function c12031010.initial_effect(c)
--xyz summon --xyz summon
aux.AddXyzProcedure(c,nil,3,2) aux.AddXyzProcedure(c,nil,3,2)
c:EnableReviveLimit() c:EnableReviveLimit()
-- --tohand
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12031010,0)) e1:SetDescription(aux.Stringid(12031010,0))
e1:SetCategory(CATEGORY_TOHAND+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:SetProperty(EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(c12031010.con) e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,12031010) e1:SetCountLimit(1,12031010)
e1:SetTarget(c12031010.tg) e1:SetCondition(c12031010.thcon)
e1:SetOperation(c12031010.op) e1:SetTarget(c12031010.thtg)
e1:SetOperation(c12031010.thop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--destroy --destroy
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY) e2:SetCategory(CATEGORY_HANDES+CATEGORY_DRAW)
e2:SetDescription(aux.Stringid(12031010,1)) e2:SetDescription(aux.Stringid(12031010,1))
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
...@@ -27,25 +28,22 @@ function c12031010.initial_effect(c) ...@@ -27,25 +28,22 @@ function c12031010.initial_effect(c)
e2:SetOperation(c12031010.desop) e2:SetOperation(c12031010.desop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c12031010.con(e,tp,eg,ep,ev,re,r,rp) function c12031010.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ) return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end end
function c12031010.spfilter(c,e,tp) function c12031010.thfilter(c)
return c:IsSetCard(0xfa0) and c:IsAbleToHand() return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xfa0) and c:IsAbleToHand()
end end
function c12031010.tg(e,tp,eg,ep,ev,re,r,rp,chk) function c12031010.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.IsExistingMatchingCard(c12031010.thfilter,tp,LOCATION_DECK,0,1,nil) end
and Duel.IsExistingMatchingCard(c12031010.spfilter,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 c12031010.op(e,tp,eg,ep,ev,re,r,rp) function c12031010.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c12031010.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c12031010.spfilter,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,tp,REASON_EFFECT) Duel.ConfirmCards(1-tp,g)
Duel.ConfirmCards(1-tp,g)
end
end end
end end
function c12031010.descost(e,tp,eg,ep,ev,re,r,rp,chk) function c12031010.descost(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -57,34 +55,34 @@ function c12031010.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -57,34 +55,34 @@ function c12031010.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end end
function c12031010.thfilter(c) function c12031010.bafilter(c)
return c:IsCode(12031000) and c:IsAbleToHand() return c:IsCode(12031000) and c:IsFaceup()
end end
function c12031010.desop(e,tp,eg,ep,ev,re,r,rp) function c12031010.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tg=Duel.GetFirstTarget() local tg=Duel.GetFirstTarget()
if tg:IsRelateToEffect(e) then if tg:IsRelateToEffect(e) then
local gg=Duel.GetMatchingGroup(nil,tp,LOCATION_EXTRA,0,1,nil) local gg=Duel.GetMatchingGroup(nil,tp,LOCATION_DECK,0,1,nil)
if gg:GetCount()>0 then if gg:GetCount()>0 then
tc=gg:GetFirst() tc=gg:GetFirst()
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
local code=tc:GetOriginalCode() local code=tc:GetOriginalCode()
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_CHANGE_CODE) e2:SetCode(EFFECT_CHANGE_CODE)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetValue(code) e2:SetValue(code)
tg:RegisterEffect(e2) tg:RegisterEffect(e2)
Duel.BreakEffect() Duel.BreakEffect()
local cc=Duel.GetMatchingGroupCount(c12031010.thfilter,tp,LOCATION_MZONE,0,nil) local cc=Duel.GetMatchingGroupCount(c12031010.bafilter,tp,LOCATION_MZONE,0,nil)
if cc>0 then if cc>0 then
Duel.Draw(tp,cc,REASON_EFFECT) Duel.Draw(tp,cc,REASON_EFFECT)
Duel.DiscardHand(tp,nil,cc,cc,REASON_EFFECT,nil) Duel.ShuffleHand(tp)
end Duel.DiscardHand(tp,nil,cc,cc,REASON_EFFECT+REASON_DISCARD,nil)
end
end end
end end
end end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment