Commit 4e4e1e4b authored by POLYMER's avatar POLYMER

fix

parent 8eade3a4
...@@ -53,30 +53,27 @@ end ...@@ -53,30 +53,27 @@ end
function s.matfilter2(c) function s.matfilter2(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) or c:IsAttribute(ATTRIBUTE_DARK) return c:IsAttribute(ATTRIBUTE_LIGHT) or c:IsAttribute(ATTRIBUTE_DARK)
end end
function s.eqfilter1(c,tp) function s.eqfilter1(c,e,tp)
return (c:IsRace(RACE_WARRIOR) or c:IsRace(RACE_FIEND)) and return (c:IsRace(RACE_WARRIOR) or c:IsRace(RACE_FIEND)) and
c:CheckUniqueOnField(tp) and not c:IsForbidden() c:CheckUniqueOnField(tp) and not c:IsForbidden() and c:IsCanBeEffectTarget(e)
end end
function s.eqfilter2(c,tp) function s.eqfilter2(c)
return aux.IsCodeListed(c,12866755) and c:IsType(TYPE_FUSION) and return aux.IsCodeListed(c,12866755) and c:IsType(TYPE_FUSION)
c:CheckUniqueOnField(tp) and (c:IsRace(RACE_WARRIOR) or c:IsRace(RACE_FIEND)) and not c:IsForbidden() end
function s.check(g)
return g:IsExists(s.eqfilter2,1,nil)
end end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and s.eqfilter2(chkc,tp) and local g=Duel.GetMatchingGroup(s.eqfilter1,tp,LOCATION_GRAVE,0,nil,e,tp)
chkc:IsControler(tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and s.eqfilter1(chkc,e,tp) and chkc:IsControler(tp) end
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return ft>0 if chk==0 then return ft>0 and #g>0 end
and Duel.IsExistingTarget(s.eqfilter2,tp,LOCATION_GRAVE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local ct=math.min(ft,2) local ct=math.min(ft,2)
local g1=Duel.SelectTarget(tp,s.eqfilter2,tp,LOCATION_GRAVE,0,1,1,nil,tp) local sg=g:SelectSubGroup(tp,s.check,false,1,ct)
if ct>1 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.SetTargetCard(sg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,sg,#sg,0,0)
local g2=Duel.SelectTarget(tp,s.eqfilter1,tp,LOCATION_GRAVE,0,1,1,g1,tp)
g1:Merge(g2)
end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g1,g1:GetCount(),0,0)
end end
function s.eqop(e,tp,eg,ep,ev,re,r,rp) function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -30,6 +30,7 @@ function s.initial_effect(c) ...@@ -30,6 +30,7 @@ function s.initial_effect(c)
e2:SetCategory(CATEGORY_DESTROY) e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCondition(s.descon1)
e2:SetCost(s.descost) e2:SetCost(s.descost)
e2:SetTarget(s.destg) e2:SetTarget(s.destg)
e2:SetOperation(s.desop) e2:SetOperation(s.desop)
...@@ -38,7 +39,7 @@ function s.initial_effect(c) ...@@ -38,7 +39,7 @@ function s.initial_effect(c)
e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN) e5:SetCode(EVENT_FREE_CHAIN)
e5:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e5:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e5:SetCondition(s.descon) e5:SetCondition(s.descon2)
c:RegisterEffect(e5) c:RegisterEffect(e5)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE) e4:SetType(EFFECT_TYPE_SINGLE)
...@@ -133,7 +134,10 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -133,7 +134,10 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
end end
end end
function s.descon(e,tp,eg,ep,ev,re,r,rp) function s.descon1(e,tp,eg,ep,ev,re,r,rp)
return not e:GetLabel()==1
end
function s.descon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabel()==1 return e:GetLabel()==1
end end
function s.valcheck(e,c) function s.valcheck(e,c)
......
...@@ -138,12 +138,17 @@ function c28322413.tdcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -138,12 +138,17 @@ function c28322413.tdcon(e,tp,eg,ep,ev,re,r,rp)
end end
function c28322413.tdcost(e,tp,eg,ep,ev,re,r,rp,chk) function c28322413.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST) end if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST) end
if e:GetHandler():GetOverlayCount()>1 then
Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST) Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DEATTACHFROM)
local tc=Duel.SelectMatchingCard(tp,Card.CheckRemoveOverlayCard,tp,LOCATION_MZONE,0,1,1,e:GetHandler(),tp,1,REASON_COST):GetFirst()
tc:RemoveOverlayCard(tp,1,1,REASON_COST)
end
end end
function c28322413.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c28322413.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) and chkc:IsAbleToDeck() end if chkc then return chkc:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) and chkc:IsAbleToDeck() end
local ct=e:GetHandler():GetOverlayGroup():GetCount() if chk==0 then return e:GetHandler():GetOverlayCount()>=1 and Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
if chk==0 then return ct>1 and Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,ct,nil) local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,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