Commit 2da67847 authored by VanillaSalt's avatar VanillaSalt

fix

parent ebaf8503
......@@ -25,15 +25,15 @@ end
function c30757127.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c30757127.cfilter(c)
function c30757127.cfilter(c,tp)
return c:IsDiscardable() and Duel.IsExistingMatchingCard(c30757127.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,c)
end
function c30757127.tgfilter(c)
return c:IsSetCard(0xc008) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c30757127.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c30757127.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c30757127.cfilter,1,1,REASON_COST+REASON_DISCARD)
if chk==0 then return Duel.IsExistingMatchingCard(c30757127.cfilter,tp,LOCATION_HAND,0,1,nil,tp) end
Duel.DiscardHand(tp,c30757127.cfilter,1,1,REASON_COST+REASON_DISCARD,nil,tp)
end
function c30757127.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -15,9 +15,8 @@ end
function c51345461.filter(c,rc,tid)
return c:IsReason(REASON_BATTLE) and c:GetReasonCard()==rc and c:GetTurnID()==tid and not c:IsForbidden()
end
function c51345461.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c51345461.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e:GetHandler(),Duel.GetTurnCount()) end
function c51345461.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c51345461.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e:GetHandler(),Duel.GetTurnCount())
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,g:GetCount(),0,0)
end
......@@ -26,13 +25,10 @@ function c51345461.eqop(e,tp,eg,ep,ev,re,r,rp)
if ft<=0 then return end
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local gc=Duel.GetMatchingGroup(c51345461.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e:GetHandler(),Duel.GetTurnCount())
if gc:GetCount()==0 then return end
if gc:GetCount()>ft then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
gc=gc:Select(tp,ft,ft,nil)
end
local tc=gc:GetFirst()
local g=Duel.GetMatchingGroup(c51345461.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e:GetHandler(),Duel.GetTurnCount())
if g:GetCount()==0 then return end
if g:GetCount()>ft then return end
local tc=g:GetFirst()
while tc do
Duel.Equip(tp,tc,c,false,true)
local e1=Effect.CreateEffect(c)
......@@ -49,7 +45,7 @@ function c51345461.eqop(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetValue(200)
tc:RegisterEffect(e2)
tc=gc:GetNext()
tc=g:GetNext()
end
Duel.EquipComplete()
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