Commit a1e2a805 authored by wind2009's avatar wind2009

Fix

parent 7f235d0b
No preview for this file type
...@@ -5,7 +5,7 @@ function s.initial_effect(c) ...@@ -5,7 +5,7 @@ function s.initial_effect(c)
--set --set
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_SSET+CATEGORY_HANDES) e1:SetCategory(CATEGORY_SSET+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
......
...@@ -31,7 +31,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -31,7 +31,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD) Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end end
function s.filter(c) function s.filter(c)
return (c:IsCode(c,97077563) or aux.IsCodeListed(c,97077563) and c:IsType(TYPE_SPELL+TYPE_TRAP)) return (c:IsCode(97077563) or (aux.IsCodeListed(c,97077563) and c:IsType(TYPE_SPELL+TYPE_TRAP)))
and c:IsAbleToHand() and c:IsAbleToHand()
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -59,7 +59,7 @@ end ...@@ -59,7 +59,7 @@ end
function s.disop(e,tp,eg,ep,ev,re,r,rp) function s.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then if tc:IsRelateToChain() and tc:IsFaceup() then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2)) e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
...@@ -30,8 +30,8 @@ function s.initial_effect(c) ...@@ -30,8 +30,8 @@ function s.initial_effect(c)
--tohand --tohand
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2)) e3:SetDescription(aux.Stringid(id,2))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCategory(CATEGORY_TOHAND) e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id+o) e3:SetCountLimit(1,id+o)
...@@ -80,8 +80,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -80,8 +80,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0)
end end
function s.operation(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local g=Duel.GetTargetsRelateToChain():Filter(Card.IsOnField,nil)
local g=Duel.GetTargetsRelateToChain()
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
end end
......
...@@ -29,19 +29,18 @@ end ...@@ -29,19 +29,18 @@ end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local g=c:GetOverlayGroup() local g=c:GetOverlayGroup()
local ct=2 local minct=2
if not g:IsExists(aux.NOT(Card.IsType),1,nil,TYPE_XYZ) then if not g:IsExists(aux.NOT(Card.IsType),1,nil,TYPE_XYZ) then
ct=1 minct=1
end end
if chk==0 then return c:CheckRemoveOverlayCard(tp,ct,REASON_COST) end if chk==0 then return c:CheckRemoveOverlayCard(tp,minct,REASON_COST) end
c:RemoveOverlayCard(tp,ct,2,REASON_COST) c:RemoveOverlayCard(tp,minct,2,REASON_COST)
end end
function s.filter(c) function s.filter(c)
return (c:IsPosition(POS_FACEUP_ATTACK) or c:IsLocation(LOCATION_GRAVE)) and c:IsType(TYPE_MONSTER) and c:IsCanOverlay() return (c:IsPosition(POS_FACEUP_ATTACK) or c:IsLocation(LOCATION_GRAVE)) and c:IsType(TYPE_MONSTER) and c:IsCanOverlay()
end end
function s.con(e,tp,eg,ep,ev,re,r,rp) function s.con(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() return Duel.GetTurnPlayer()~=tp and Duel.IsMainPhase()
return Duel.GetTurnPlayer()~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and s.filter(chkc) end if chkc then return chkc:IsControler(1-tp) and s.filter(chkc) end
......
...@@ -5,9 +5,9 @@ function s.initial_effect(c) ...@@ -5,9 +5,9 @@ function s.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SSET)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCategory(CATEGORY_SSET)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
......
...@@ -45,6 +45,9 @@ end ...@@ -45,6 +45,9 @@ end
function s.drfilter(c) function s.drfilter(c)
return c:IsFaceup() and c:IsCode(97077563) return c:IsFaceup() and c:IsCode(97077563)
end end
function s.atkupfilter(c)
return not c:IsHasEffect(EFFECT_REVERSE_UPDATE)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==1 then if e:GetLabel()==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
...@@ -55,6 +58,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,6 +58,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
end end
elseif e:GetLabel()==2 then elseif e:GetLabel()==2 then
local g=Duel.GetMatchingGroup(s.adfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(s.adfilter,tp,LOCATION_MZONE,0,nil)
if #g>0 then
local tc=g:GetFirst() local tc=g:GetFirst()
while tc do while tc do
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
...@@ -65,10 +69,13 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -65,10 +69,13 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
tc=g:GetNext() tc=g:GetNext()
end end
if g:IsExists(s.atkupfilter,1,nil) then
local dct=Duel.GetMatchingGroupCount(s.drfilter,tp,LOCATION_ONFIELD,0,nil) local dct=Duel.GetMatchingGroupCount(s.drfilter,tp,LOCATION_ONFIELD,0,nil)
if #g>0 and dct>0 and Duel.IsPlayerCanDraw(tp,dct) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then if dct>0 and Duel.IsPlayerCanDraw(tp,dct) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Draw(tp,dct,REASON_EFFECT) Duel.Draw(tp,dct,REASON_EFFECT)
end end
end end
end
end
end end
...@@ -21,7 +21,9 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -21,7 +21,9 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp)
(re:IsActiveType(TYPE_MONSTER) or re:GetActiveType()==TYPE_SPELL or re:IsActiveType(TYPE_QUICKPLAY)) (re:IsActiveType(TYPE_MONSTER) or re:GetActiveType()==TYPE_SPELL or re:IsActiveType(TYPE_QUICKPLAY))
end end
function s.chtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,REASON_RULE) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_MZONE,0,1,nil,tp,REASON_RULE)
or Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,nil,1-tp,REASON_RULE)
end
end end
function s.chop(e,tp,eg,ep,ev,re,r,rp) function s.chop(e,tp,eg,ep,ev,re,r,rp)
local res=Duel.TossCoin(1-tp,1) local res=Duel.TossCoin(1-tp,1)
...@@ -34,12 +36,14 @@ function s.chop(e,tp,eg,ep,ev,re,r,rp) ...@@ -34,12 +36,14 @@ function s.chop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.repop1(e,tp,eg,ep,ev,re,r,rp) function s.repop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE) local op=1-tp
local g=Duel.SelectMatchingCard(1-tp,Card.IsAbleToRemove,1-tp,LOCATION_MZONE,0,1,1,nil,REASON_RULE) Duel.Hint(HINT_SELECTMSG,op,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(op,Card.IsAbleToRemove,op,LOCATION_MZONE,0,1,1,nil,op,REASON_RULE)
Duel.HintSelection(g) Duel.HintSelection(g)
Duel.Remove(g,POS_FACEUP,REASON_RULE) Duel.Remove(g,POS_FACEUP,REASON_RULE,op)
end end
function s.repop2(e,tp,eg,ep,ev,re,r,rp) function s.repop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_MZONE,0,nil,REASON_RULE) local op=tp
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_MZONE,0,nil,op,REASON_RULE)
Duel.Remove(g,POS_FACEUP,REASON_RULE) Duel.Remove(g,POS_FACEUP,REASON_RULE)
end end
...@@ -35,11 +35,14 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -35,11 +35,14 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,0,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,0,nil)
return g:IsExists(Card.IsRace,1,nil,RACE_ZOMBIE) and g:IsExists(Card.IsCode,1,nil,97077563) return g:IsExists(Card.IsRace,1,nil,RACE_ZOMBIE) and g:IsExists(Card.IsCode,1,nil,97077563)
end end
function s.tgfilter1(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) end if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and s.tgfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(s.tgfilter1,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,s.tgfilter1,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end end
function s.operation(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
......
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