Commit a90e1080 authored by zengsxing's avatar zengsxing

fix

parent 1ed20bb2
...@@ -11,6 +11,7 @@ function s.initial_effect(c) ...@@ -11,6 +11,7 @@ function s.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg) e1:SetTarget(s.sptg)
e1:SetOperation(s.spop) e1:SetOperation(s.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -27,6 +28,9 @@ function s.initial_effect(c) ...@@ -27,6 +28,9 @@ function s.initial_effect(c)
e2:SetOperation(s.desop) e2:SetOperation(s.desop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsLocation(LOCATION_FZONE) end if chkc then return chkc:IsOnField() and chkc:IsLocation(LOCATION_FZONE) end
...@@ -44,9 +48,9 @@ end ...@@ -44,9 +48,9 @@ end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,1-tp,false,false,POS_FACEUP)>0 then if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,1-tp,false,false,POS_FACEUP)>0 then
Duel.BreakEffect()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then
Duel.BreakEffect()
local b1=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) local b1=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) local b2=Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil)
if not b1 and not b2 then return end if not b1 and not b2 then return end
......
...@@ -27,10 +27,10 @@ end ...@@ -27,10 +27,10 @@ end
function s.sprcon(e,c) function s.sprcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.sprfilter,tp,LOCATION_FZONE,0,1,nil) return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.sprfilter,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
end end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsRace(RACE_PYRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x2ad) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function s.atkfilter(c) function s.atkfilter(c)
return c:IsFaceup() and c:IsAttackAbove(2800) return c:IsFaceup() and c:IsAttackAbove(2800)
......
...@@ -18,8 +18,9 @@ function s.initial_effect(c) ...@@ -18,8 +18,9 @@ function s.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_FREE_CHAIN) e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1) e3:SetCountLimit(1,id+o)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCondition(s.descon)
e3:SetTarget(s.destg) e3:SetTarget(s.destg)
e3:SetOperation(s.desop) e3:SetOperation(s.desop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
...@@ -30,7 +31,10 @@ end ...@@ -30,7 +31,10 @@ end
function s.sprcon(e,c) function s.sprcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.sprfilter,tp,LOCATION_FZONE,0,1,nil) return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.sprfilter,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end end
function s.desfilter(c) function s.desfilter(c)
return c:IsFaceup() and c:IsRace(RACE_PYRO) return c:IsFaceup() and c:IsRace(RACE_PYRO)
...@@ -47,16 +51,14 @@ function s.setfilter(c) ...@@ -47,16 +51,14 @@ function s.setfilter(c)
end end
function s.desop(e,tp,eg,ep,ev,re,r,rp) function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then if tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) and Duel.Destroy(tc,REASON_EFFECT)>0 and tc:GetPreviousCodeOnField()==101203090 and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
local dc=Duel.GetOperatedGroup():GetFirst() Duel.BreakEffect()
if dc:IsCode(101203090) and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then local tc=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
local tc=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst() local fc=Duel.GetFieldCard(p,LOCATION_SZONE,5)
local fc=Duel.GetFieldCard(p,LOCATION_SZONE,5) if fc then
if fc then Duel.SendtoGrave(fc,REASON_RULE)
Duel.SendtoGrave(fc,REASON_RULE) Duel.BreakEffect()
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,p,LOCATION_FZONE,POS_FACEUP,true)
end end
Duel.MoveToField(tc,tp,p,LOCATION_FZONE,POS_FACEUP,true)
end end
end end
\ No newline at end of file
...@@ -32,10 +32,10 @@ function s.sprcon(e,c) ...@@ -32,10 +32,10 @@ function s.sprcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.sprfilter,tp,LOCATION_FZONE,0,1,nil) and Duel.IsExistingMatchingCard(s.sprfilter,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
end end
function s.thfilter(c) function s.thfilter(c)
return c:IsSetCard(0x2ad) and c:IsAbleToHand() return c:IsSetCard(0x2ad) and not c:IsCode(id) and c:IsAbleToHand()
end end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
......
...@@ -12,7 +12,7 @@ function s.initial_effect(c) ...@@ -12,7 +12,7 @@ function s.initial_effect(c)
e2:SetCode(EFFECT_CHANGE_RACE) e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0,LOCATION_MZONE) e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCondition(s.condition) e2:SetTarget(s.ratg)
e2:SetValue(RACE_PYRO) e2:SetValue(RACE_PYRO)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--todeck --todeck
...@@ -35,6 +35,7 @@ function s.initial_effect(c) ...@@ -35,6 +35,7 @@ function s.initial_effect(c)
e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_DESTROYED) e4:SetCode(EVENT_DESTROYED)
e4:SetCountLimit(1,id+o) e4:SetCountLimit(1,id+o)
e4:SetCondition(s.spcon)
e4:SetTarget(s.sptg) e4:SetTarget(s.sptg)
e4:SetOperation(s.spop) e4:SetOperation(s.spop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
...@@ -42,8 +43,8 @@ function s.initial_effect(c) ...@@ -42,8 +43,8 @@ function s.initial_effect(c)
e5:SetCode(EVENT_REMOVE) e5:SetCode(EVENT_REMOVE)
c:RegisterEffect(e5) c:RegisterEffect(e5)
end end
function s.condition(e) function s.ratg(e,c)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==e:GetHandlerPlayer() and c:IsSummonType(SUMMON_TYPE_SPECIAL)
end end
function s.tdcon(e,tp,eg,ep,ev,re,r,rp) function s.tdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
...@@ -61,10 +62,14 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -61,10 +62,14 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function s.tdop(e,tp,eg,ep,ev,re,r,rp) function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKBOTTOM,REASON_EFFECT)>0 then if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKBOTTOM,REASON_EFFECT)>0 and Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK)>0 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
end end
end end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_FZONE)
end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsSetCard(0x2ad) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x2ad) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
......
...@@ -7,6 +7,7 @@ function s.initial_effect(c) ...@@ -7,6 +7,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -34,6 +35,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -34,6 +35,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.BreakEffect() Duel.BreakEffect()
end end
if Duel.MoveToField(tc,tp,p,LOCATION_FZONE,POS_FACEUP,true) and Duel.GetFieldGroupCount(tp,0,LOCATION_FZONE)>0 and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then if Duel.MoveToField(tc,tp,p,LOCATION_FZONE,POS_FACEUP,true) and Duel.GetFieldGroupCount(tp,0,LOCATION_FZONE)>0 and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.BreakEffect()
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
......
...@@ -17,9 +17,9 @@ function s.initial_effect(c) ...@@ -17,9 +17,9 @@ function s.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1) e2:SetCountLimit(1,id+o)
e2:SetTarget(s.tg) e2:SetTarget(s.contrtg)
e2:SetOperation(s.op) e2:SetOperation(s.controp)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.thfilter(c) function s.thfilter(c)
...@@ -37,16 +37,17 @@ end ...@@ -37,16 +37,17 @@ end
function s.contrfilter(c,tp) function s.contrfilter(c,tp)
return c:GetOwner()==tp and c:IsControlerCanBeChanged() return c:GetOwner()==tp and c:IsControlerCanBeChanged()
end end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.contrtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.contrfilter(chkc,tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.contrfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(s.contrfilter,tp,0,LOCATION_MZONE,1,nil,tp) end if chk==0 then return Duel.IsExistingTarget(s.contrfilter,tp,0,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,s.contrfilter,tp,0,LOCATION_MZONE,1,1,nil,tp) local g=Duel.SelectTarget(tp,s.contrfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end end
function s.op(e,tp,eg,ep,ev,re,r,rp) function s.controp(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.GetControl(tc,tp) and Duel.GetMatchingGroupCount(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then if tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) and Duel.GetControl(tc,tp) and tc:IsLocation(LOCATION_MZONE) and Duel.GetMatchingGroupCount(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
for ac in aux.Next(g) do for ac in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
......
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