Commit f815c1ff authored by salix5's avatar salix5

Merge pull request #25 from DailyShana/patch-2

fix Spell&Trap target check
parents 21012f26 04f64ad0
...@@ -29,7 +29,7 @@ function c14883228.filter(c) ...@@ -29,7 +29,7 @@ function c14883228.filter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable() return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end end
function c14883228.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c14883228.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c14883228.filter(chkc) end if chkc then return chkc:IsOnField() and c14883228.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(c14883228.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingTarget(c14883228.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c14883228.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler()) local g=Duel.SelectTarget(tp,c14883228.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
......
...@@ -23,7 +23,7 @@ function c15286412.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -23,7 +23,7 @@ function c15286412.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabelObject(g:GetFirst()) e:SetLabelObject(g:GetFirst())
end end
function c15286412.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c15286412.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsDestructable() end if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsDestructable() and chkc~=e:GetHandler() end
if chk==0 then if chk==0 then
e:SetLabel(0) e:SetLabel(0)
return Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) return Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler())
......
...@@ -14,7 +14,7 @@ function c19159413.filter(c) ...@@ -14,7 +14,7 @@ function c19159413.filter(c)
return c:IsFacedown() or c:IsType(TYPE_SPELL) return c:IsFacedown() or c:IsType(TYPE_SPELL)
end end
function c19159413.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c19159413.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and c19159413.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_SZONE) and c19159413.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(c19159413.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingTarget(c19159413.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c19159413.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,e:GetHandler()) local g=Duel.SelectTarget(tp,c19159413.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,e:GetHandler())
......
...@@ -35,7 +35,7 @@ function c20765952.filter(c) ...@@ -35,7 +35,7 @@ function c20765952.filter(c)
end end
function c20765952.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c20765952.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_SZONE) and c20765952.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_SZONE) and c20765952.filter(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(c20765952.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,c) end if chk==0 then return Duel.IsExistingTarget(c20765952.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c20765952.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,c) Duel.SelectTarget(tp,c20765952.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,c)
......
...@@ -21,7 +21,7 @@ function c22205600.filter(c) ...@@ -21,7 +21,7 @@ function c22205600.filter(c)
return c:IsDestructable() and c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsDestructable() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end end
function c22205600.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c22205600.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c22205600.filter(chkc) end if chkc then return chkc:IsOnField() and c22205600.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(c22205600.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,2,e:GetHandler()) end if chk==0 then return Duel.IsExistingTarget(c22205600.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c22205600.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,2,2,e:GetHandler()) local g=Duel.SelectTarget(tp,c22205600.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,2,2,e:GetHandler())
......
...@@ -20,7 +20,7 @@ function c33184236.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -20,7 +20,7 @@ function c33184236.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c33184236.cfilter,1,nil,tp) return eg:IsExists(c33184236.cfilter,1,nil,tp)
end end
function c33184236.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c33184236.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsDestructable() end if chkc then return chkc:IsOnField() and chkc:IsDestructable() and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler()) local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
......
...@@ -14,7 +14,7 @@ function c44424095.filter(c) ...@@ -14,7 +14,7 @@ function c44424095.filter(c)
return c:IsSetCard(0x26) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() return c:IsSetCard(0x26) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end end
function c44424095.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c44424095.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsDestructable() end if chkc then return chkc:IsOnField() and chkc:IsDestructable() and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingMatchingCard(c44424095.filter,tp,LOCATION_HAND,0,1,nil) if chk==0 then return Duel.IsExistingMatchingCard(c44424095.filter,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) and Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler())
and Duel.IsPlayerCanDraw(tp,1) end and Duel.IsPlayerCanDraw(tp,1) end
......
...@@ -13,14 +13,14 @@ function c45939841.initial_effect(c) ...@@ -13,14 +13,14 @@ function c45939841.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c45939841.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c45939841.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) if chk==0 then return Duel.CheckLPCost(tp,500) end
else Duel.PayLPCost(tp,500) end Duel.PayLPCost(tp,500)
end end
function c45939841.filter(c) function c45939841.filter(c)
return c:IsFaceup() and c:IsDestructable() and c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsFaceup() and c:IsDestructable() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end end
function c45939841.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c45939841.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c45939841.filter(chkc) end if chkc then return chkc:IsOnField() and c45939841.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(c45939841.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingTarget(c45939841.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c45939841.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler()) local g=Duel.SelectTarget(tp,c45939841.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
......
...@@ -22,7 +22,7 @@ function c473469.desfilter(c) ...@@ -22,7 +22,7 @@ function c473469.desfilter(c)
return c:IsDestructable() and c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsDestructable() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end end
function c473469.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c473469.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c473469.desfilter(chkc) end if chkc then return chkc:IsOnField() and c473469.desfilter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(c473469.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingTarget(c473469.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c473469.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler()) local g=Duel.SelectTarget(tp,c473469.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
......
...@@ -25,7 +25,7 @@ function c47766694.filter(c) ...@@ -25,7 +25,7 @@ function c47766694.filter(c)
return c:IsFaceup() and c:GetSequence()<5 and c:IsDestructable() return c:IsFaceup() and c:GetSequence()<5 and c:IsDestructable()
end end
function c47766694.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c47766694.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and c47766694.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_SZONE) and c47766694.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(c47766694.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingTarget(c47766694.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c47766694.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,e:GetHandler()) local g=Duel.SelectTarget(tp,c47766694.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,e:GetHandler())
......
...@@ -33,7 +33,7 @@ function c58873391.tgfilter(c,e) ...@@ -33,7 +33,7 @@ function c58873391.tgfilter(c,e)
return c:IsDestructable() and c:IsCanBeEffectTarget(e) return c:IsDestructable() and c:IsCanBeEffectTarget(e)
end end
function c58873391.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c58873391.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsDestructable() end if chkc then return chkc:IsOnField() and chkc:IsDestructable() and chkc~=e:GetHandler() end
if chk==0 then if chk==0 then
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return false end if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return false end
if e:GetLabel()==1 then if e:GetLabel()==1 then
......
...@@ -14,7 +14,7 @@ function c61844784.filter(c) ...@@ -14,7 +14,7 @@ function c61844784.filter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL) return c:IsFaceup() and c:IsType(TYPE_SPELL)
end end
function c61844784.addct(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c61844784.addct(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c61844784.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c61844784.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(c61844784.filter,tp,LOCATION_SZONE,0,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingTarget(c61844784.filter,tp,LOCATION_SZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(61844784,0)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(61844784,0))
Duel.SelectTarget(tp,c61844784.filter,tp,LOCATION_SZONE,0,1,1,e:GetHandler()) Duel.SelectTarget(tp,c61844784.filter,tp,LOCATION_SZONE,0,1,1,e:GetHandler())
......
...@@ -21,7 +21,7 @@ function c73079365.desfilter(c) ...@@ -21,7 +21,7 @@ function c73079365.desfilter(c)
return c:IsDestructable() and c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsDestructable() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end end
function c73079365.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c73079365.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c73079365.desfilter(chkc) end if chkc then return chkc:IsOnField() and c73079365.desfilter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(c73079365.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingTarget(c73079365.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c73079365.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler()) local g=Duel.SelectTarget(tp,c73079365.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
......
...@@ -25,7 +25,7 @@ function c96875080.filter(c) ...@@ -25,7 +25,7 @@ function c96875080.filter(c)
return c:IsDestructable() and c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsDestructable() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end end
function c96875080.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c96875080.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c96875080.filter(chkc) end if chkc then return chkc:IsOnField() and c96875080.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(c96875080.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingTarget(c96875080.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c96875080.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler()) local g=Duel.SelectTarget(tp,c96875080.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
......
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