Commit 1a078eb4 authored by nekrozar's avatar nekrozar

fix

parent 6725c3e1
......@@ -4,29 +4,32 @@ function c40240595.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(40240595,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetRange(LOCATION_HAND)
e1:SetTarget(c40240595.eqtg)
e1:SetOperation(c40240595.eqop)
c:RegisterEffect(e1)
end
function c40240595.filter(c,e)
function c40240595.filter(c)
return c:IsFaceup() and c:IsCode(58192742)
end
function c40240595.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c40240595.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c40240595.filter,tp,LOCATION_MZONE,0,1,nil,e) end
and Duel.IsExistingTarget(c40240595.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c40240595.filter,tp,LOCATION_MZONE,0,1,1,nil,e)
Duel.SetChainLimit(aux.FALSE)
Duel.SelectTarget(tp,c40240595.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c40240595.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if Duel.Equip(tp,c,tc,true) then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
Duel.Equip(tp,c,tc,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
......@@ -40,7 +43,6 @@ function c40240595.eqop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCondition(c40240595.checkcon)
e2:SetOperation(c40240595.checkop)
e2:SetCountLimit(1)
e2:SetLabel(0)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
--equip effect
......@@ -56,16 +58,15 @@ function c40240595.eqop(e,tp,eg,ep,ev,re,r,rp)
e4:SetValue(2000)
e4:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e4)
end
c:SetTurnCounter(0)
end
function c40240595.checkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c40240595.checkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabel()
local ct=c:GetTurnCounter()
ct=ct+1
e:SetLabel(ct)
c:SetTurnCounter(ct)
end
function c40240595.eqlimit(e,c)
......
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