Commit 7774e348 authored by VanillaSalt's avatar VanillaSalt

fix

parent 119aa510
...@@ -17,13 +17,15 @@ function c19580308.cfilter(c) ...@@ -17,13 +17,15 @@ function c19580308.cfilter(c)
and not c:IsCode(19580308) and c:IsAbleToGraveAsCost() and not c:IsCode(19580308) and c:IsAbleToGraveAsCost()
end end
function c19580308.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c19580308.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c19580308.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end local loc=LOCATION_HAND+LOCATION_ONFIELD
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then loc=LOCATION_MZONE end
if chk==0 then return Duel.IsExistingMatchingCard(c19580308.cfilter,tp,loc,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c19580308.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c19580308.cfilter,tp,loc,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
end end
function c19580308.target(e,tp,eg,ep,ev,re,r,rp,chk) function c19580308.target(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.GetLocationCount(tp,LOCATION_MZONE)>-1
and 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)
end end
......
...@@ -30,9 +30,6 @@ end ...@@ -30,9 +30,6 @@ end
function c45974017.pcfilter(c) function c45974017.pcfilter(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsSetCard(0xaf) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden() return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsSetCard(0xaf) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
end end
function c45974017.filter(c)
return c:IsSetCard(0xaf) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c45974017.pctg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c45974017.pctg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c45974017.pcfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c45974017.pcfilter(chkc) end
local b1=Duel.IsExistingTarget(c45974017.pcfilter,tp,LOCATION_GRAVE,0,1,nil) local b1=Duel.IsExistingTarget(c45974017.pcfilter,tp,LOCATION_GRAVE,0,1,nil)
......
...@@ -38,10 +38,10 @@ function c71069715.tdcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -38,10 +38,10 @@ function c71069715.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end end
function c71069715.tdfilter(c) function c71069715.tdfilter(c)
return c:IsSetCard(0xaf) and c:IsAbleToDeck() return c:IsFaceup() and c:IsSetCard(0xaf) and c:IsAbleToDeck()
end end
function c71069715.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c71069715.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c71069715.tdfilter(chkc) and chkc~=e:GetHandler() end if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c71069715.tdfilter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(c71069715.tdfilter,tp,LOCATION_REMOVED,0,1,e:GetHandler()) if chk==0 then return Duel.IsExistingTarget(c71069715.tdfilter,tp,LOCATION_REMOVED,0,1,e:GetHandler())
and not e:GetHandler():IsStatus(STATUS_CHAINING) end and not e:GetHandler():IsStatus(STATUS_CHAINING) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
......
...@@ -54,12 +54,24 @@ function c83303851.filter(c) ...@@ -54,12 +54,24 @@ function c83303851.filter(c)
end end
function c83303851.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c83303851.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft+1
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c83303851.filter(chkc) end if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c83303851.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c83303851.filter,tp,LOCATION_ONFIELD,0,2,nil) if chk==0 then return Duel.IsExistingTarget(c83303851.filter,tp,LOCATION_ONFIELD,0,2,nil)
and not c:IsStatus(STATUS_CHAINING) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and ct<=2 and (ct<=0 or Duel.IsExistingTarget(c83303851.filter,tp,LOCATION_MZONE,0,ct,nil))
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end and not c:IsStatus(STATUS_CHAINING) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c83303851.filter,tp,LOCATION_ONFIELD,0,2,2,nil) local g=nil
if ct<=0 then
g=Duel.SelectTarget(tp,c83303851.filter,tp,LOCATION_ONFIELD,0,2,2,nil)
elseif ct==1 then
g=Duel.SelectTarget(tp,c83303851.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,c83303851.filter,tp,LOCATION_ONFIELD,0,1,1,g:GetFirst())
g:Merge(g2)
else
g=Duel.SelectTarget(tp,c83303851.filter,tp,LOCATION_MZONE,0,2,2,nil)
end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,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