Commit 79f6a9a0 authored by argon.sun's avatar argon.sun

fix

parent 76f31cc4
--水精鱗-リードアビス
function c37781520.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(37781520,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c37781520.spcost)
e1:SetTarget(c37781520.sptg)
e1:SetOperation(c37781520.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(37781520,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c37781520.thcon)
e2:SetTarget(c37781520.thtg)
e2:SetOperation(c37781520.thop)
c:RegisterEffect(e2)
--handes
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(37781520,2))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(c37781520.hdcost)
e3:SetTarget(c37781520.hdtg)
e3:SetOperation(c37781520.hdop)
c:RegisterEffect(e3)
end
function c37781520.cfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsDiscardable() and c:IsAbleToGraveAsCost()
end
function c37781520.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c37781520.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c37781520.cfilter,1,1,REASON_COST+REASON_DISCARD,e:GetHandler())
end
function c37781520.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c37781520.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,1,tp,tp,false,false,POS_FACEUP)
end
end
function c37781520.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1
end
function c37781520.thfilter(c)
return c:IsSetCard(0x75) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c37781520.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c37781520.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c37781520.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c37781520.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c37781520.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
function c37781520.costfilter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsSetCard(0x74)
end
function c37781520.hdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,37781520)==0 and Duel.CheckReleaseGroup(tp,c37781520.costfilter,1,e:GetHandler()) end
local sg=Duel.SelectReleaseGroup(tp,c37781520.costfilter,1,1,e:GetHandler())
Duel.Release(sg,REASON_COST)
Duel.RegisterFlagEffect(tp,37781520,RESET_PHASE+PHASE_END,0,1)
end
function c37781520.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)~=0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_HAND)
end
function c37781520.hdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(1-tp,LOCATION_HAND,0)
if g:GetCount()==0 then return end
local sg=g:RandomSelect(1-tp,1)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
...@@ -16,7 +16,7 @@ function c4259068.initial_effect(c) ...@@ -16,7 +16,7 @@ function c4259068.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c4259068.costchange(e,re,rp,val) function c4259068.costchange(e,re,rp,val)
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsType(TYPE_SPELL) then if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsType(TYPE_SPELL) and not re:GetHandler():IsCode(9236985) then
return 0 return 0
else else
return val return val
......
...@@ -11,6 +11,7 @@ function c58242947.initial_effect(c) ...@@ -11,6 +11,7 @@ function c58242947.initial_effect(c)
e1:SetTarget(c58242947.target) e1:SetTarget(c58242947.target)
e1:SetOperation(c58242947.operation) e1:SetOperation(c58242947.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
c58242947[0]=nil
end end
function c58242947.filter(c) function c58242947.filter(c)
return c:GetType()==0x4 and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(false,true,false)~=nil return c:GetType()==0x4 and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(false,true,false)~=nil
...@@ -22,12 +23,12 @@ function c58242947.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -22,12 +23,12 @@ function c58242947.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(58242947,1)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(58242947,1))
local g=Duel.SelectMatchingCard(tp,c58242947.filter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c58242947.filter,tp,LOCATION_GRAVE,0,1,1,nil)
local te=g:GetFirst():CheckActivateEffect(false,true,true) local te=g:GetFirst():CheckActivateEffect(false,true,true)
e:SetLabelObject(te) c58242947[0]=te
g:AddCard(c) g:AddCard(c)
Duel.Remove(g,POS_FACEUP,REASON_COST) Duel.Remove(g,POS_FACEUP,REASON_COST)
end end
function c58242947.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c58242947.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local te=e:GetLabelObject() local te=c58242947[0]
if chkc then if chkc then
local tg=te:GetTarget() local tg=te:GetTarget()
return tg(e,tp,eg,ep,ev,re,r,rp,0,true) return tg(e,tp,eg,ep,ev,re,r,rp,0,true)
...@@ -40,7 +41,7 @@ function c58242947.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -40,7 +41,7 @@ function c58242947.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end
end end
function c58242947.operation(e,tp,eg,ep,ev,re,r,rp) function c58242947.operation(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject() local te=c58242947[0]
if not te then return end if not te then return end
local op=te:GetOperation() local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end if op then op(e,tp,eg,ep,ev,re,r,rp) end
......
...@@ -52,7 +52,7 @@ function c62950604.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,7 +52,7 @@ function c62950604.spcon(e,tp,eg,ep,ev,re,r,rp)
end end
function c62950604.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c62950604.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
if chk==0 then return tc:GetFlagEffect(62950604)~=0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return tc:GetFlagEffect(62950604)~=0 end
tc:CreateEffectRelation(e) tc:CreateEffectRelation(e)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,0,0)
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