Commit cd5a61c5 authored by Nemo Ma's avatar Nemo Ma

Update c88990247.lua

parent 7639a20c
......@@ -18,7 +18,6 @@ function c88990247.initial_effect(c)
e3:SetCode(EFFECT_SPSUMMON_CONDITION)
e3:SetValue(aux.penlimit)
c:RegisterEffect(e3)
--回手tohand
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(88990247,1))
......@@ -63,13 +62,14 @@ function c88990247.initial_effect(c)
end
--Return Hand
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(101009011,1))
e8:SetCategory(CATEGORY_TOHAND)
e8:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e8:SetRange(LOCATION_PZONE)
e8:SetCountLimit(1,101009011+100)
e8:SetCode(EVENT_PHASE+PHASE_END)
e8:SetOperation(c88990247.SpiritReturnReg)
e8:SetCountLimit(1)
e8:SetCondition(c88990247.thcon2)
e8:SetTarget(c88990247.rettg)
e8:SetOperation(c88990247.thop2)
c:RegisterEffect(e8)
end
function c88990247.splimit(e,c,tp,sumtp,sumpos)
......@@ -101,7 +101,6 @@ function c88990247.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
--禁止连锁
function c88990247.chainop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:IsSetCard(0xb3) then
......@@ -111,55 +110,20 @@ end
function c88990247.chainlm(e,rp,tp)
return tp==rp
end
--Return Hand
function c88990247.SpiritReturnReg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(1104)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1ee0000+RESET_PHASE+PHASE_END)
e1:SetCondition(aux.SpiritReturnCondition)
e1:SetTarget(c88990247.SpiritReturnTarget)
e1:SetOperation(c88990247.SpiritReturnOperation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
c:RegisterEffect(e2)
function c88990247.thcon2(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c88990247.filter(c)
return c:IsSetCard(0xb3) and c:IsType(TYPE_TRAP+TYPE_SPELL) and c:IsAbleToHand()
function c88990247.thfilter2(c)
return c:IsSetCard(0xb3) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c88990247.SpiritReturnTarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:IsHasType(EFFECT_TYPE_TRIGGER_F) then
return true
else
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
end
function c88990247.SpiritReturnOperation(e,tp,eg,ep,ev,re,r,rp)
function c88990247.thop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and Duel.SendtoHand(c,nil,REASON_EFFECT)~=0
and Duel.IsExistingMatchingCard(c88990247.filter,tp,LOCATION_DECK,0,1,nil) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(88990247,1))
local g=Duel.SelectMatchingCard(tp,c88990247.filter,tp,LOCATION_DECK,0,1,1,nil,tp)
local tc=g:GetFirst()
if tc then
local b1=tc:IsAbleToHand()
if b1 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
Duel.ConfirmCards(1-tp,tc)
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c88990247.thfilter2,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
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