Commit 2bc86b6e authored by mercury233's avatar mercury233

update 轟雷機龍 and 竜装合体

the metatable of the target only rely on card, not on name
parent 7acc5cda
...@@ -29,9 +29,7 @@ function c12081875.effcon(e) ...@@ -29,9 +29,7 @@ function c12081875.effcon(e)
end end
function c12081875.efffilter(c,e,tp,eg,ep,ev,re,r,rp) function c12081875.efffilter(c,e,tp,eg,ep,ev,re,r,rp)
if not (c:IsSetCard(0x11c) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())) then return false end if not (c:IsSetCard(0x11c) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())) then return false end
local m=_G["c"..c:GetOriginalCode()] local te=c.discard_effect
if not m then return false end
local te=m.discard_effect
if not te then return false end if not te then return false end
local tg=te:GetTarget() local tg=te:GetTarget()
return not tg or tg and tg(e,tp,eg,ep,ev,re,r,rp,0) return not tg or tg and tg(e,tp,eg,ep,ev,re,r,rp,0)
...@@ -46,16 +44,14 @@ function c12081875.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -46,16 +44,14 @@ function c12081875.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.ClearTargetCard() Duel.ClearTargetCard()
tc:CreateEffectRelation(e) tc:CreateEffectRelation(e)
e:SetLabelObject(tc) e:SetLabelObject(tc)
local m=_G["c"..tc:GetOriginalCode()] local te=tc.discard_effect
local te=m.discard_effect
local tg=te:GetTarget() local tg=te:GetTarget()
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end
end end
function c12081875.effop(e,tp,eg,ep,ev,re,r,rp,chk) function c12081875.effop(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
local m=_G["c"..tc:GetOriginalCode()] local te=tc.discard_effect
local te=m.discard_effect
local op=te:GetOperation() local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end if op then op(e,tp,eg,ep,ev,re,r,rp) end
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -38,8 +38,7 @@ function c75402014.eqcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -38,8 +38,7 @@ function c75402014.eqcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler()) return eg:IsContains(e:GetHandler())
end end
function c75402014.eqfilter(c,tp) function c75402014.eqfilter(c,tp)
local mt=_G["c"..c:GetCode()] return c.zw_equip_monster and c:IsSetCard(0x107e) and c:IsType(TYPE_MONSTER) and not c:IsForbidden() and c:CheckUniqueOnField(tp,LOCATION_SZONE)
return mt and mt.zw_equip_monster and c:IsSetCard(0x107e) and c:IsType(TYPE_MONSTER) and not c:IsForbidden() and c:CheckUniqueOnField(tp,LOCATION_SZONE)
end end
function c75402014.eqtg(e,tp,eg,ep,ev,re,r,rp,chk) function c75402014.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
...@@ -54,8 +53,7 @@ function c75402014.eqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -54,8 +53,7 @@ function c75402014.eqop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c75402014.eqfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,tp) local g=Duel.SelectMatchingCard(tp,c75402014.eqfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if not tc then return end if not tc then return end
local mt=_G["c"..tc:GetCode()] tc.zw_equip_monster(tc,tp,c)
mt.zw_equip_monster(tc,tp,c)
end end
end end
function c75402014.eqlimit(e,c) function c75402014.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