Commit e8552a0b authored by TanakaKotoha's avatar TanakaKotoha

fix 2

parent 1de4f6ee
......@@ -13,43 +13,42 @@ function c75646207.initial_effect(c)
c:RegisterEffect(e1)
end
function c75646207.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
e:SetLabel(1)
return true
end
function c75646207.cfilter(c,tc,tp)
return c:IsType(TYPE_EQUIP) and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c75646207.eqfilter,tp,LOCATION_DECK,0,1,nil,c:GetCode(),tc)
function c75646207.cfilter(c,tp)
return c:IsType(TYPE_EQUIP) and c:IsAbleToGraveAsCost()
and Duel.IsExistingTarget(c75646207.efilter,tp,LOCATION_MZONE,0,1,nil,c:GetCode(),tp)
end
function c75646207.efilter(c,tp)
function c75646207.efilter(c,code,tp)
return c:IsFaceup() and c:IsSetCard(0x2c0)
and Duel.IsExistingMatchingCard(c75646207.cfilter,tp,LOCATION_SZONE,0,1,nil,c,tp)
and Duel.IsExistingMatchingCard(c75646207.eqfilter,tp,LOCATION_DECK,0,1,nil,c,code,tp)
end
function c75646207.eqfilter(c,code,tc)
return c:IsType(TYPE_EQUIP) and c:IsSetCard(0x2c0) and c:CheckEquipTarget(tc) and not c:IsCode(code)
function c75646207.eqfilter(c,ec,code,tp)
return c:IsType(TYPE_EQUIP) and c:IsSetCard(0x2c0) and c:CheckEquipTarget(ec) and c:GetCode()~=code
end
function c75646207.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c75646207.efilter(chkc,tp) end
if chk==0 then
if e:GetLabel()~=100 then return false end
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c75646207.efilter(chkc,e:GetLabel(),tp) end
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c75646207.efilter,tp,LOCATION_MZONE,0,1,nil,tp) end
local g1=Duel.GetMatchingGroup(c75646207.efilter,tp,LOCATION_MZONE,0,1,nil,tp)
local g2=Duel.SelectMatchingCard(tp,c75646207.cfilter,tp,LOCATION_SZONE,0,1,1,nil,g1:GetFirst(),tp)
Duel.SendtoGrave(g2,REASON_COST)
e:SetLabelObject(g2:GetFirst())
return Duel.IsExistingMatchingCard(c75646207.cfilter,tp,LOCATION_SZONE,0,1,nil,tp)
end
local g=Duel.SelectMatchingCard(tp,c75646207.cfilter,tp,LOCATION_SZONE,0,1,1,nil,tp)
local code=g:GetFirst():GetCode()
e:SetLabel(code)
Duel.SendtoGrave(g,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c75646207.efilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SelectTarget(tp,c75646207.efilter,tp,LOCATION_MZONE,0,1,1,nil,e:GetLabel(),tp)
end
function c75646207.activate(e,tp,eg,ep,ev,re,r,rp)
local dc=e:GetLabelObject()
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
local ec=Duel.GetFirstTarget()
if ec:IsFacedown() or not ec:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c75646207.eqfilter,tp,LOCATION_DECK,0,1,1,nil,dc:GetCode(),tc)
local g=Duel.SelectMatchingCard(tp,c75646207.eqfilter,tp,LOCATION_DECK,0,1,1,nil,ec,e:GetLabel(),tp)
local eq=g:GetFirst()
if eq then
Duel.Equip(tp,eq,tc,true)
Duel.Equip(tp,eq,ec,true)
eq:AddCounter(0x1b,2)
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