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