Commit 7307e290 authored by POLYMER's avatar POLYMER

fix

parent cc2a6660
...@@ -6,23 +6,22 @@ function s.initial_effect(c) ...@@ -6,23 +6,22 @@ function s.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--spsummon --spsummon
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(id,0))
e0:SetCategory(CATEGORY_SPECIAL_SUMMON) e0:SetCategory(CATEGORY_SPECIAL_SUMMON)
e0:SetType(EFFECT_TYPE_IGNITION) e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e0:SetProperty(EFFECT_FLAG_CARD_TARGET) e0:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e0:SetRange(LOCATION_MZONE) e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetCountLimit(1,id) e0:SetCountLimit(1,id)
e0:SetCondition(s.sspcon)
e0:SetTarget(s.ssptg) e0:SetTarget(s.ssptg)
e0:SetOperation(s.sspop) e0:SetOperation(s.sspop)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--special summon --special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE) e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,id+1) e1:SetCountLimit(1,id+1)
e1:SetCost(s.cost1) e1:SetCost(s.cost)
e1:SetCondition(s.spcon1) e1:SetCondition(s.spcon1)
e1:SetTarget(s.sptg) e1:SetTarget(s.sptg)
e1:SetOperation(s.spop) e1:SetOperation(s.spop)
...@@ -33,28 +32,13 @@ function s.initial_effect(c) ...@@ -33,28 +32,13 @@ function s.initial_effect(c)
e2:SetHintTiming(0,TIMING_END_PHASE) e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCondition(s.spcon2) e2:SetCondition(s.spcon2)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,id+1)
e3:SetCost(s.cost2)
e3:SetCondition(s.spcon1)
e3:SetTarget(s.sptg2)
e3:SetOperation(s.spop2)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetHintTiming(0,TIMING_END_PHASE)
e4:SetCondition(s.spcon2)
c:RegisterEffect(e4)
end end
function s.lcheck(g,lc) function s.lcheck(g,lc)
return g:IsExists(Card.IsLinkSetCard,1,nil,0xc09) return g:IsExists(Card.IsLinkSetCard,1,nil,0xc09)
end end
function s.sspcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsRace(RACE_THUNDER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) return c:IsRace(RACE_THUNDER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end end
...@@ -67,10 +51,9 @@ function s.ssptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -67,10 +51,9 @@ function s.ssptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
function s.sspop(e,tp,eg,ep,ev,re,r,rp) function s.sspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then if tc:IsRelateToEffect(e) then
Duel.SpecialSummonComplete() Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end end
end end
function s.spcon1(e,tp,eg,ep,ev,re,r,rp) function s.spcon1(e,tp,eg,ep,ev,re,r,rp)
...@@ -79,48 +62,35 @@ end ...@@ -79,48 +62,35 @@ end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp) function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,88881099) return Duel.IsPlayerAffectedByEffect(tp,88881099)
end end
function s.cfilter(c) function s.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xc09) and c:IsAbleToHandAsCost() return c:IsFaceup() and c:IsSetCard(0xc09) and (c:IsAbleToHandAsCost() or c:IsAbleToGraveAsCost())
and Duel.GetMZoneCount(tp,c)>0
end end
function s.cost1(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil) local tc=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp):GetFirst()
Duel.SendtoHand(g,nil,REASON_COST) if tc:IsAbleToHandAsCost() and (not tc:IsAbleToGraveAsCost() or Duel.SelectOption(tp,1104,1191)==0) then
Duel.SendtoHand(tc,nil,REASON_COST)
e:SetLabel(0)
else
Duel.SendtoGrave(tc,REASON_COST)
e:SetLabel(1)
end
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg(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 e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
if e:GetLabel()==1 then
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1500)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1500)
end
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 and e:GetLabel()==1 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) Duel.BreakEffect()
Duel.Recover(tp,1500,REASON_EFFECT)
end end
end end
function s.cfilter3(c)
return c:IsFaceup() and c:IsSetCard(0xc09) and c:IsAbleToGraveAsCost()
end
function s.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter3,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter3,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function s.sptg2(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)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1500)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1500)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
Duel.Recover(p,d,REASON_EFFECT)
end
end
\ No newline at end of file
...@@ -26,13 +26,17 @@ function s.initial_effect(c) ...@@ -26,13 +26,17 @@ function s.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function s.cfilter(c,tp) function s.cfilter(c,tp)
return c:IsFaceup() and c:IsAbleToHandAsCost() and Duel.GetMZoneCount(tp,c)>0 return c:IsFaceup() and (c:IsAbleToHandAsCost() or c:IsAbleToGraveAsCost()) and Duel.GetMZoneCount(tp,c)>0
end end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil,tp) end if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp) local tc=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp):GetFirst()
Duel.SendtoHand(g,nil,REASON_COST) if tc:IsAbleToHandAsCost() and (not tc:IsAbleToGraveAsCost() or Duel.SelectOption(tp,1104,1191)==0) then
Duel.SendtoHand(tc,nil,REASON_COST)
else
Duel.SendtoGrave(tc,REASON_COST)
end
end end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsSetCard(0xc09) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0xc09) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
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