Commit c6c1f5a5 authored by nanahira's avatar nanahira

fix destroy set

parent 7882a452
...@@ -85,7 +85,8 @@ function c1182051.op2(e,tp,eg,ep,ev,re,r,rp) ...@@ -85,7 +85,8 @@ function c1182051.op2(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.SelectMatchingCard(tp,c1182051.tfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp) local sg=Duel.SelectMatchingCard(tp,c1182051.tfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if sg:GetCount()>0 then if sg:GetCount()>0 then
local rc=sg:GetFirst() local rc=sg:GetFirst()
if rc:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0 and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) then if rc:IsType(TYPE_MONSTER) and
not rc:IsType(TYPE_TOKEN) and Duel.GetMZoneCount(tp)>0 and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) then
Duel.SpecialSummon(rc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE) Duel.SpecialSummon(rc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,rc) Duel.ConfirmCards(1-tp,rc)
elseif (rc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) and rc:IsSSetable() then elseif (rc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) and rc:IsSSetable() then
......
...@@ -161,7 +161,8 @@ end ...@@ -161,7 +161,8 @@ end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
if not c:IsSetCard(0x442) or c:IsHasEffect(EFFECT_NECRO_VALLEY) then return false end if not c:IsSetCard(0x442) or c:IsHasEffect(EFFECT_NECRO_VALLEY) then return false end
local rc=c local rc=c
if rc:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0 if rc:IsType(TYPE_MONSTER) and
not rc:IsType(TYPE_TOKEN) and Duel.GetMZoneCount(tp)>0
and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp)>0) and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp)>0)
and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) then return true end and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) then return true end
if (rc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) if (rc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0)
...@@ -184,4 +185,4 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -184,4 +185,4 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
end end
Duel.ConfirmCards(1-tp,rc) Duel.ConfirmCards(1-tp,rc)
end end
end end
\ No newline at end of file
...@@ -210,7 +210,8 @@ end ...@@ -210,7 +210,8 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local rc=Duel.GetFirstTarget() local rc=Duel.GetFirstTarget()
if rc:IsRelateToEffect(e) and Duel.Destroy(rc,REASON_EFFECT)~=0 and not rc:IsLocation(LOCATION_HAND+LOCATION_DECK) then if rc:IsRelateToEffect(e) and Duel.Destroy(rc,REASON_EFFECT)~=0 and not rc:IsLocation(LOCATION_HAND+LOCATION_DECK) then
if rc:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0 if rc:IsType(TYPE_MONSTER) and
not rc:IsType(TYPE_TOKEN) and Duel.GetMZoneCount(tp)>0
and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp,tp,nil,rc)>0) and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp,tp,nil,rc)>0)
and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
and Duel.SelectYesNo(tp,aux.Stringid(90809975,3)) then and Duel.SelectYesNo(tp,aux.Stringid(90809975,3)) then
......
...@@ -76,7 +76,8 @@ end ...@@ -76,7 +76,8 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local rc=Duel.GetFirstTarget() local rc=Duel.GetFirstTarget()
if rc:IsRelateToEffect(e) and Duel.Destroy(rc,REASON_EFFECT)~=0 and not rc:IsLocation(LOCATION_HAND+LOCATION_DECK) then if rc:IsRelateToEffect(e) and Duel.Destroy(rc,REASON_EFFECT)~=0 and not rc:IsLocation(LOCATION_HAND+LOCATION_DECK) then
if rc:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0 if rc:IsType(TYPE_MONSTER) and
not rc:IsType(TYPE_TOKEN) and Duel.GetMZoneCount(tp)>0
and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp,tp,nil,rc)>0) and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp,tp,nil,rc)>0)
and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
and Duel.SelectYesNo(tp,aux.Stringid(90809975,3)) then and Duel.SelectYesNo(tp,aux.Stringid(90809975,3)) then
......
...@@ -16,7 +16,8 @@ function cm.initial_effect(c) ...@@ -16,7 +16,8 @@ function cm.initial_effect(c)
local rc=re:GetHandler() local rc=re:GetHandler()
if not Duel.NegateActivation(ev) then return end if not Duel.NegateActivation(ev) then return end
if rc:IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 and not rc:IsLocation(LOCATION_HAND+LOCATION_DECK) then if rc:IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 and not rc:IsLocation(LOCATION_HAND+LOCATION_DECK) then
if rc:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0 if rc:IsType(TYPE_MONSTER) and
not rc:IsType(TYPE_TOKEN) and Duel.GetMZoneCount(tp)>0
and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp,tp,nil,rc)>0) and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp,tp,nil,rc)>0)
and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
and Duel.SelectYesNo(tp,aux.Stringid(90809975,3)) then and Duel.SelectYesNo(tp,aux.Stringid(90809975,3)) then
......
...@@ -158,7 +158,8 @@ end ...@@ -158,7 +158,8 @@ end
function c57300025.activate(e,tp,eg,ep,ev,re,r,rp) function c57300025.activate(e,tp,eg,ep,ev,re,r,rp)
local rc=Duel.GetFirstTarget() local rc=Duel.GetFirstTarget()
if rc:IsRelateToEffect(e) and Duel.Destroy(rc,REASON_EFFECT)~=0 and not rc:IsLocation(LOCATION_HAND+LOCATION_DECK) then if rc:IsRelateToEffect(e) and Duel.Destroy(rc,REASON_EFFECT)~=0 and not rc:IsLocation(LOCATION_HAND+LOCATION_DECK) then
if rc:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0 if rc:IsType(TYPE_MONSTER) and
not rc:IsType(TYPE_TOKEN) and Duel.GetMZoneCount(tp)>0
and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
and Duel.SelectYesNo(tp,aux.Stringid(90809975,3)) then and Duel.SelectYesNo(tp,aux.Stringid(90809975,3)) then
Duel.BreakEffect() Duel.BreakEffect()
...@@ -188,4 +189,4 @@ function c57300025.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -188,4 +189,4 @@ function c57300025.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT) Duel.Destroy(eg,REASON_EFFECT)
end end
end end
\ No newline at end of file
...@@ -37,7 +37,8 @@ end ...@@ -37,7 +37,8 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local rc=Duel.GetFirstTarget() local rc=Duel.GetFirstTarget()
if rc:IsRelateToEffect(e) and Duel.Destroy(rc,REASON_EFFECT)~=0 and not rc:IsLocation(LOCATION_HAND+LOCATION_DECK) then if rc:IsRelateToEffect(e) and Duel.Destroy(rc,REASON_EFFECT)~=0 and not rc:IsLocation(LOCATION_HAND+LOCATION_DECK) then
if rc:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0 if rc:IsType(TYPE_MONSTER) and
not rc:IsType(TYPE_TOKEN) and Duel.GetMZoneCount(tp)>0
and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
and Duel.SelectYesNo(tp,aux.Stringid(90809975,3)) then and Duel.SelectYesNo(tp,aux.Stringid(90809975,3)) then
Duel.BreakEffect() Duel.BreakEffect()
...@@ -50,4 +51,4 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,4 +51,4 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,rc) Duel.ConfirmCards(1-tp,rc)
end end
end end
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