Commit 3f7bc5d5 authored by nekrozar's avatar nekrozar

fix summon effect

parent 573645ee
......@@ -16,8 +16,7 @@ function c21524779.filter(c)
and c:GetCode()~=21524779 and c:IsSummonable(true,nil)
end
function c21524779.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c21524779.filter,tp,LOCATION_HAND,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c21524779.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c21524779.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -30,12 +30,12 @@ function c34010534.sumfilter(c)
return c:IsRace(RACE_CYBERSE) and c:IsSummonable(true,nil)
end
function c34010534.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c34010534.sumfilter,tp,LOCATION_HAND,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c34010534.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c34010534.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c34010534.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c34010534.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
......
......@@ -25,7 +25,7 @@ function c41139112.filter3(c,e,tp)
return c:IsLevelAbove(5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c41139112.filter(c,e,tp)
return Duel.IsExistingMatchingCard(c41139112.filter1,tp,LOCATION_HAND,0,1,nil)
return Duel.IsExistingMatchingCard(c41139112.filter1,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
or Duel.IsExistingMatchingCard(c41139112.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp)
or Duel.IsExistingMatchingCard(c41139112.filter3,tp,LOCATION_HAND,0,1,nil,e,tp)
end
......@@ -36,7 +36,7 @@ end
function c41139112.activate(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.TossDice(tp,1)
if d==1 or d==2 then
local g=Duel.GetMatchingGroup(c41139112.filter1,tp,LOCATION_HAND,0,nil)
local g=Duel.GetMatchingGroup(c41139112.filter1,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(41139112,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local tc=g:Select(tp,1,1,nil):GetFirst()
......
......@@ -60,7 +60,7 @@ function c44352516.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_HAND) then
local g=Duel.GetMatchingGroup(c44352516.filter2,tp,LOCATION_HAND,0,nil)
local g=Duel.GetMatchingGroup(c44352516.filter2,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(44352516,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
......
......@@ -68,12 +68,12 @@ function c4756629.sumfilter(c)
return c:IsSetCard(0xa) and c:IsSummonable(true,nil)
end
function c4756629.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c4756629.sumfilter,tp,LOCATION_HAND,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c4756629.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c4756629.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c4756629.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c4756629.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
......
......@@ -36,11 +36,11 @@ end
function c68815132.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_HAND) then
if Duel.IsExistingMatchingCard(c68815132.sumfilter,tp,LOCATION_HAND,0,1,nil)
if Duel.IsExistingMatchingCard(c68815132.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(68815132,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c68815132.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c68815132.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
Duel.Summon(tp,g:GetFirst(),true,nil)
end
end
......
......@@ -41,8 +41,7 @@ function c72291078.filter(c)
return c:IsSetCard(0x101b) and c:IsSummonable(true,nil)
end
function c72291078.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c72291078.filter,tp,LOCATION_HAND,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c72291078.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c72291078.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -67,12 +67,12 @@ function c78358521.sumfilter(c)
return c:IsSetCard(0x53) and c:IsSummonable(true,nil)
end
function c78358521.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c78358521.sumfilter,tp,LOCATION_HAND,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c78358521.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c78358521.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c78358521.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c78358521.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
......
......@@ -3,7 +3,7 @@ function c81470373.initial_effect(c)
--search and normal summon / gy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(81470373,0))
e1:SetCategory(CATEGORY_SUMMON)
e1:SetCategory(CATEGORY_SUMMON+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,81470373)
......@@ -12,6 +12,10 @@ function c81470373.initial_effect(c)
e1:SetTarget(c81470373.sumtg)
e1:SetOperation(c81470373.sumop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetValue(SUMMON_TYPE_NORMAL)
c:RegisterEffect(e2)
e1:SetLabelObject(e2)
end
function c81470373.sumcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
......@@ -29,23 +33,11 @@ end
function c81470373.acfilter(c,tp)
return c:IsCode(91351370) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
end
function c81470373.ttcon(e,c,minc)
if c==nil then return true end
return minc==0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c81470373.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0
or not Duel.IsExistingMatchingCard(c81470373.acfilter,tp,LOCATION_DECK,0,1,nil,tp) then return false end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e1:SetCondition(c81470373.ttcon)
c:RegisterEffect(e1)
local res=c:IsSummonable(true,nil) or c:IsAbleToGrave()
e1:Reset()
return res
return e:GetHandler():IsSummonable(true,e:GetLabelObject()) or e:GetHandler():IsAbleToGrave()
end
end
function c81470373.sumop(e,tp,eg,ep,ev,re,r,rp)
......@@ -71,22 +63,15 @@ function c81470373.sumop(e,tp,eg,ep,ev,re,r,rp)
e1:SetOperation(c81470373.tgop)
tc:RegisterEffect(e1)
if not c:IsRelateToEffect(e) then return end
Duel.BreakEffect()
--summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e2:SetCondition(c81470373.ttcon)
c:RegisterEffect(e2)
if c:IsSummonable(true,nil)
local se=e:GetLabelObject()
if c:IsSummonable(true,se)
and (not c:IsAbleToGrave() or Duel.SelectOption(tp,1151,1191)==0) then
Duel.BreakEffect()
Duel.Summon(tp,c,true,nil)
Duel.Summon(tp,c,true,se)
else
Duel.BreakEffect()
Duel.SendtoGrave(c,REASON_EFFECT)
end
e2:Reset()
end
end
function c81470373.splimit(e,c)
......
......@@ -16,8 +16,7 @@ function c84530620.filter(c)
and c:GetCode()~=84530620 and c:IsSummonable(true,nil)
end
function c84530620.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84530620.filter,tp,LOCATION_HAND,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c84530620.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c84530620.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -22,6 +22,7 @@ function c94561645.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetOperatedGroup():GetFirst()
if tc:IsType(TYPE_MONSTER) and tc:IsSummonable(true,nil)
and Duel.SelectYesNo(tp,aux.Stringid(94561645,0)) then
Duel.BreakEffect()
Duel.Summon(tp,tc,true,nil)
end
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