Commit cfdf07eb authored by mercury233's avatar mercury233 Committed by DailyShana

fix (#462)

parent 907f28a9
...@@ -87,8 +87,10 @@ function c19748583.destg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -87,8 +87,10 @@ function c19748583.destg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c19748583.desop(e,tp,eg,ep,ev,re,r,rp) function c19748583.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=c:GetEquipTarget():GetBattleTarget() local ec=c:GetEquipTarget()
if tc:IsRelateToBattle() and Duel.Destroy(tc,REASON_EFFECT)~=0 then if not ec then return end
local tc=ec:GetBattleTarget()
if tc and tc:IsRelateToBattle() and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Destroy(c,REASON_EFFECT) Duel.Destroy(c,REASON_EFFECT)
end end
......
...@@ -45,6 +45,7 @@ function c27873305.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -45,6 +45,7 @@ function c27873305.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c27873305.eqfilter,tp,0,LOCATION_MZONE,1,1,bc) local g=Duel.SelectMatchingCard(tp,c27873305.eqfilter,tp,0,LOCATION_MZONE,1,1,bc)
local ec=g:GetFirst() local ec=g:GetFirst()
if not ec then return end
local atk=ec:GetTextAttack() local atk=ec:GetTextAttack()
if atk<0 then atk=0 end if atk<0 then atk=0 end
if not Duel.Equip(tp,ec,c,false) then return end if not Duel.Equip(tp,ec,c,false) then return end
......
...@@ -20,10 +20,12 @@ function c41925941.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -20,10 +20,12 @@ function c41925941.condition(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget() local d=Duel.GetAttackTarget()
if a:IsControler(tp) then if a:IsControler(tp) then
e:SetLabelObject(d) e:SetLabelObject(d)
return a:IsFaceup() and a:IsRace(RACE_FIEND) and a:IsRelateToBattle() and d and d:IsFaceup() and d:IsRelateToBattle() return a:IsFaceup() and a:IsRace(RACE_FIEND) and a:IsRelateToBattle()
else and d and d:IsFaceup() and d:IsRelateToBattle()
elseif d and d:IsControler(tp) then
e:SetLabelObject(a) e:SetLabelObject(a)
return d:IsFaceup() and d:IsRace(RACE_FIEND) and d:IsRelateToBattle() and a and a:IsFaceup() and a:IsRelateToBattle() return d:IsFaceup() and d:IsRace(RACE_FIEND) and d:IsRelateToBattle()
and a and a:IsFaceup() and a:IsRelateToBattle()
end end
end end
function c41925941.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c41925941.cost(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -49,7 +49,7 @@ end ...@@ -49,7 +49,7 @@ end
function c43730887.operation(e,tp,eg,ep,ev,re,r,rp) function c43730887.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then if c:IsRelateToEffect(e) and tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
c:SetCardTarget(tc) c:SetCardTarget(tc)
end end
end end
......
...@@ -56,7 +56,7 @@ function c5183693.atkcon(e) ...@@ -56,7 +56,7 @@ function c5183693.atkcon(e)
if Duel.GetCurrentPhase()~=PHASE_DAMAGE_CAL then return false end if Duel.GetCurrentPhase()~=PHASE_DAMAGE_CAL then return false end
local eqc=e:GetHandler():GetEquipTarget() local eqc=e:GetHandler():GetEquipTarget()
local bc=eqc:GetBattleTarget() local bc=eqc:GetBattleTarget()
return eqc:GetLevel()>0 and bc:GetLevel()>eqc:GetLevel() return eqc:GetLevel()>0 and bc and bc:GetLevel()>eqc:GetLevel()
end end
function c5183693.atkval(e,c) function c5183693.atkval(e,c)
local bc=c:GetBattleTarget() local bc=c:GetBattleTarget()
......
...@@ -145,11 +145,15 @@ function c57314798.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -145,11 +145,15 @@ function c57314798.desop(e,tp,eg,ep,ev,re,r,rp)
local g2=Duel.SelectMatchingCard(1-tp,c57314798.setfilter,1-tp,LOCATION_GRAVE,0,1,1,nil) local g2=Duel.SelectMatchingCard(1-tp,c57314798.setfilter,1-tp,LOCATION_GRAVE,0,1,1,nil)
local tc1=g1:GetFirst() local tc1=g1:GetFirst()
local tc2=g2:GetFirst() local tc2=g2:GetFirst()
if tc1:IsHasEffect(EFFECT_NECRO_VALLEY) or tc2:IsHasEffect(EFFECT_NECRO_VALLEY) then return end if (tc1 and tc1:IsHasEffect(EFFECT_NECRO_VALLEY)) or (tc2 and tc2:IsHasEffect(EFFECT_NECRO_VALLEY)) then return end
Duel.SSet(tp,tc1) if tc1 then
Duel.ConfirmCards(1-tp,tc1) Duel.SSet(tp,tc1)
Duel.SSet(1-tp,tc2) Duel.ConfirmCards(1-tp,tc1)
Duel.ConfirmCards(tp,tc2) end
if tc2 then
Duel.SSet(1-tp,tc2)
Duel.ConfirmCards(tp,tc2)
end
end end
end end
function c57314798.spfilter(c) function c57314798.spfilter(c)
......
...@@ -43,7 +43,7 @@ function c68077936.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -43,7 +43,7 @@ function c68077936.activate(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c68077936.descon(e,tp,eg,ep,ev,re,r,rp) function c68077936.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c68077936.cfilter,1,nil,tp) and re:IsActiveType(TYPE_SPELL) and aux.exccon(e) return eg:IsExists(c68077936.cfilter,1,nil,tp) and re and re:IsActiveType(TYPE_SPELL) and aux.exccon(e)
end end
function c68077936.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c68077936.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
......
...@@ -26,7 +26,9 @@ function c88032456.filter(c,e,tp) ...@@ -26,7 +26,9 @@ function c88032456.filter(c,e,tp)
if c:IsType(TYPE_MONSTER) then if c:IsType(TYPE_MONSTER) then
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
else else
return c:IsSSetable(true) and (c:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) local ct=Duel.GetLocationCount(tp,LOCATION_SZONE)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) and not e:GetHandler():IsLocation(LOCATION_SZONE) then ct=ct-1 end
return c:IsSSetable() and (c:IsType(TYPE_FIELD) or ct>0)
end end
end end
function c88032456.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c88032456.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
...@@ -64,7 +64,8 @@ function c90673413.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -64,7 +64,8 @@ function c90673413.desop(e,tp,eg,ep,ev,re,r,rp)
end end
function c90673413.atkcon(e,tp,eg,ep,ev,re,r,rp) function c90673413.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsReason(REASON_LOST_TARGET) and c:GetPreviousEquipTarget():IsLocation(LOCATION_OVERLAY) local tc=c:GetPreviousEquipTarget()
return c:IsReason(REASON_LOST_TARGET) and tc and tc:IsLocation(LOCATION_OVERLAY)
end end
function c90673413.atkfilter(c) function c90673413.atkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) return c:IsFaceup() and c:IsType(TYPE_XYZ)
......
...@@ -84,7 +84,7 @@ function c98777036.ctcos(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -84,7 +84,7 @@ function c98777036.ctcos(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(sg,REASON_COST) Duel.SendtoGrave(sg,REASON_COST)
end end
function c98777036.cttar(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c98777036.cttar(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c98777036.ctffilter(e,e:GetLabel()) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c98777036.ctffilter(chkc,e:GetLabel()) end
if chk==0 then return true end if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c98777036.ctffilter,tp,0,LOCATION_MZONE,1,1,nil,e:GetLabel()) local g=Duel.SelectTarget(tp,c98777036.ctffilter,tp,0,LOCATION_MZONE,1,1,nil,e:GetLabel())
......
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