Commit 92148c28 authored by POLYMER's avatar POLYMER

fix

parent e842f493
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
local m=40009221 local m=40009221
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--special summon
--splimit --splimit
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -22,22 +20,20 @@ function cm.initial_effect(c) ...@@ -22,22 +20,20 @@ function cm.initial_effect(c)
e2:SetTarget(cm.sptg) e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop) e2:SetOperation(cm.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--attack up --attack up
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1)) e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN) e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,m) e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCountLimit(1,m+1)
e3:SetTarget(cm.thtg) e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop) e3:SetOperation(cm.thop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function cm.splimit(e,se,sp,st) function cm.splimit(e,se,sp,st)
return se:IsHasType(EFFECT_TYPE_ACTIONS) return se:IsHasType(EFFECT_TYPE_ACTIONS)
end end
...@@ -45,31 +41,35 @@ function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -45,31 +41,35 @@ function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end if chk==0 then return not e:GetHandler():IsPublic() end
end end
function cm.thfilter1(c) function cm.thfilter1(c)
return c:IsLevel(4,8) and c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) and c:IsAbleToHand() --and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) return c:IsLevel(4,8) and c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) and c:IsAbleToHand()
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsLevel(8) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) return c:IsLevel(8) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_DECK,0,1,nil) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_DECK,0,1,nil)
and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter1,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.thfilter1,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,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end if g:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) local sg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if #sg==0 then return end if #sg>0 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.ShuffleHand(tp)
Duel.SpecialSummon(sg,0,tp,1-tp,false,false,POS_FACEUP) Duel.SpecialSummon(sg,0,tp,1-tp,false,false,POS_FACEUP)
local e2=Effect.CreateEffect(c) end
end
end
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
...@@ -81,7 +81,6 @@ end ...@@ -81,7 +81,6 @@ end
function cm.splimit2(e,c) function cm.splimit2(e,c)
return not (c:IsType(TYPE_XYZ) and c:IsRace(RACE_DRAGON)) and c:IsLocation(LOCATION_EXTRA) return not (c:IsType(TYPE_XYZ) and c:IsRace(RACE_DRAGON)) and c:IsLocation(LOCATION_EXTRA)
end end
function cm.tdfilter(c) function cm.tdfilter(c)
return c:IsFaceup() and c:IsAbleToDeck() return c:IsFaceup() and c:IsAbleToDeck()
end end
...@@ -99,7 +98,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -99,7 +98,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local c=e:GetHandler() local c=e:GetHandler()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0
and tc:IsLocation(LOCATION_DECK) and tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and Duel.IsExistingMatchingCard(cm.thfilter2,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(cm.thfilter2,tp,LOCATION_DECK,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect() Duel.BreakEffect()
...@@ -108,5 +107,4 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -108,5 +107,4 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
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