Commit 37521eae authored by wind2009's avatar wind2009

Fix

parent 279d7f16
Pipeline #30227 passed with stages
in 2 minutes and 14 seconds
......@@ -44,18 +44,18 @@ end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then tc=nil end
local ec=nil
if tc:IsRelateToEffect(e) then ec=tc end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,tc)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,ec)
local hc=g:GetFirst()
if hc and Duel.SendtoHand(hc,nil,REASON_EFFECT)~=0 and hc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,g)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and c:IsRelateToEffect(e)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENCE)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENCE)
end
end
end
......
......@@ -37,9 +37,10 @@ function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -69,9 +70,9 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thorspfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local gg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thorspfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local hc=g:GetFirst()
local hc=gg:GetFirst()
if hc then
if hc:IsAbleToHand() and (not hc:IsCanBeSpecialSummoned(e,0,tp,false,false) or ft<=0 or Duel.SelectOption(tp,1190,1152)==0) then
Duel.SendtoHand(hc,nil,REASON_EFFECT)
......
......@@ -38,9 +38,8 @@ function s.thorspcost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function s.thorspfilter(c,e,tp)
if not c:IsSetCard(0x160) then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if c:IsType(TYPE_MONSTER) then
return ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
elseif c:IsType(TYPE_SPELL+TYPE_TRAP) then
return c:IsAbleToHand()
end
......@@ -52,7 +51,6 @@ end
function s.thorspop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,s.thorspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local tc=g:GetFirst()
if tc then
if tc:IsType(TYPE_MONSTER) then
......@@ -69,9 +67,6 @@ end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,1-tp)
end
function s.thfilter(c)
return c:IsAbleToHand()
end
function s.cthfilter(c)
return c:IsSetCard(0x160)
end
......@@ -88,14 +83,14 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return false end
local g=c:GetOverlayGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=g:SelectSubGroup(tp,s.thcheck,false,1,2)
if tg and Duel.SendtoHand(tg,nil,REASON_EFFECT)~=0 and g:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) then
local tg=g:SelectSubGroup(tp,s.thcheck,false,1,2)
if #tg>0 and Duel.SendtoHand(tg,nil,REASON_EFFECT)~=0 and g:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) then
Duel.ConfirmCards(1-tp,tg)
if Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_GRAVE,0,1,nil,TYPE_NORMAL)
and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #sg>0 then
Duel.HintSelection(sg)
......
......@@ -19,7 +19,7 @@ function s.initial_effect(c)
--add overlay
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_CHAINING)
......@@ -32,6 +32,7 @@ function s.initial_effect(c)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>5 end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,0))
end
function s.thfilter(c)
return c:IsSetCard(0x160) and c:IsAbleToHand()
......@@ -41,8 +42,8 @@ function s.xyzfilter(c)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<6 then return end
Duel.ConfirmDecktop(tp,6)
local g=Duel.GetDecktopGroup(tp,6)
Duel.ConfirmCards(tp,g)
if g:IsExists(s.thfilter,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:FilterSelect(tp,s.thfilter,1,1,nil)
......@@ -53,7 +54,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SortDecktop(tp,tp,5)
else Duel.SortDecktop(tp,tp,6) end
local rg=Group.CreateGroup()
local xg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_MZONE,0,1,nil)
local xg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_MZONE,0,nil)
if xg:GetCount()<1 then return end
for tc in aux.Next(xg) do
local hg=tc:GetOverlayGroup()
......@@ -61,7 +62,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
rg:Merge(hg)
end
end
if rg and rg:Filter(Card.IsAbleToHand,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
if rg and rg:Filter(Card.IsAbleToHand,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.BreakEffect()
local thg=rg:FilterSelect(tp,Card.IsAbleToHand,1,1,nil)
Duel.SendtoHand(thg,nil,REASON_EFFECT)
......@@ -78,6 +79,7 @@ end
function s.ovtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.matfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,1))
end
function s.ovop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -6,6 +6,7 @@ function s.initial_effect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_TOHAND+CATEGORY_TODECK+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
......@@ -16,11 +17,14 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp)
return (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
end
function s.xyzfilter(c)
return c:IsFaceup() and c:IsRank(3)
return c:IsFaceup() and c:IsSetCard(0x160)
end
function s.ovfilter(c,tp)
return c:IsAbleToHand() and c:GetOwner()==tp
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Group.CreateGroup()
local xg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_MZONE,0,1,nil)
local xg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_MZONE,0,nil)
if xg:GetCount()<1 then return false end
for tc in aux.Next(xg) do
local hg=tc:GetOverlayGroup()
......@@ -28,9 +32,8 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
rg:Merge(hg)
end
end
if chk==0 then return rg and rg:Filter(Card.IsAbleToHand,1,nil)
and aux.nbtg(e,tp,eg,ep,ev,re,r,rp,chk) end
aux.nbtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return rg and rg:Filter(s.ovfilter,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function s.atkfilter(c,e)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x160)
......@@ -39,7 +42,7 @@ end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rg=Group.CreateGroup()
local xg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_MZONE,0,1,nil)
local xg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_MZONE,0,nil)
if xg:GetCount()<1 then return end
for tc in aux.Next(xg) do
local hg=tc:GetOverlayGroup()
......@@ -47,16 +50,17 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
rg:Merge(hg)
end
end
if rg and rg:Filter(Card.IsAbleToHand,1,nil) then
if rg and rg:Filter(s.ovfilter,nil,tp) then
Duel.BreakEffect()
local tc=rg:FilterSelect(tp,Card.IsAbleToHand,1,1,nil)
local tc=rg:FilterSelect(tp,s.ovfilter,1,1,nil,tp):GetFirst()
if Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,tc)
if Duel.NegateActivation(ev) then
Duel.BreakEffect()
local res=0
if tc:IsType(TYPE_MONSTER) and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) then
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
Duel.ShuffleHand(tp)
Duel.SendtoDeck(sg,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
res=1
end
......@@ -68,14 +72,14 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
else
res=1
end
for tc in aux.Next(g) do
for ac in aux.Next(g) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
ac:RegisterEffect(e1)
end
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