Commit 107f8b37 authored by POLYMER's avatar POLYMER

fix

parent 94d1b433
...@@ -62,7 +62,6 @@ function s.copytg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -62,7 +62,6 @@ function s.copytg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetFirstMatchingCard(s.costfilter,tp,LOCATION_DECK,0,1,nil) local tc=Duel.GetFirstMatchingCard(s.costfilter,tp,LOCATION_DECK,0,1,nil)
Duel.SendtoGrave(Group.FromCards(c,tc),REASON_COST) Duel.SendtoGrave(Group.FromCards(c,tc),REASON_COST)
local te=s.drdiseff(c,e,tp,eg,ep,ev,re,r,rp) local te=s.drdiseff(c,e,tp,eg,ep,ev,re,r,rp)
e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty()) e:SetProperty(te:GetProperty())
Duel.ClearTargetCard() Duel.ClearTargetCard()
e:SetLabelObject(te) e:SetLabelObject(te)
......
...@@ -57,17 +57,17 @@ function c21113935.initial_effect(c) ...@@ -57,17 +57,17 @@ function c21113935.initial_effect(c)
Duel.AddCustomActivityCounter(21113935,ACTIVITY_SPSUMMON,c21113935.counter) Duel.AddCustomActivityCounter(21113935,ACTIVITY_SPSUMMON,c21113935.counter)
end end
function c21113935.counter(c) function c21113935.counter(c)
return c:IsSetCard(0xc914) return c:IsSetCard(0xc904)
end end
function c21113935.GetLinkCount(c) function c21113935.GetLinkCount(c)
if c:IsType(TYPE_LINK) then if c:IsType(TYPE_LINK) then
if c:IsSetCard(0xc914) and c:IsDisabled() then if c:IsSetCard(0xc904) and c:IsDisabled() then
return 1+0x10000*c:GetLink()*2 return 1+0x10000*c:GetLink()*2
else else
return 1+0x10000*c:GetLink() return 1+0x10000*c:GetLink()
end end
else else
if c:IsSetCard(0xc914) and c:IsDisabled() then if c:IsSetCard(0xc904) and c:IsDisabled() then
return 2 return 2
else else
return 1 return 1
...@@ -99,7 +99,7 @@ function c21113935.linkcon() ...@@ -99,7 +99,7 @@ function c21113935.linkcon()
if max<maxc then maxc=max end if max<maxc then maxc=max end
if minc>maxc then return false end if minc>maxc then return false end
end end
local f = function(c) return c:IsFaceup() and c:IsLinkSetCard(0xc914) end local f = function(c) return c:IsFaceup() and c:IsLinkSetCard(0xc904) end
local tp=c:GetControler() local tp=c:GetControler()
local mg=nil local mg=nil
if og then if og then
...@@ -126,7 +126,7 @@ function c21113935.linktg() ...@@ -126,7 +126,7 @@ function c21113935.linktg()
if max<maxc then maxc=max end if max<maxc then maxc=max end
if minc>maxc then return false end if minc>maxc then return false end
end end
local f = function(c) return c:IsFaceup() and c:IsLinkSetCard(0xc914) end local f = function(c) return c:IsFaceup() and c:IsLinkSetCard(0xc904) end
local mg=nil local mg=nil
if og then if og then
mg=og:Filter(Auxiliary.LConditionFilter,nil,f,c,e) mg=og:Filter(Auxiliary.LConditionFilter,nil,f,c,e)
...@@ -171,7 +171,7 @@ function c21113935.opq(e,tp,eg,ep,ev,re,r,rp) ...@@ -171,7 +171,7 @@ function c21113935.opq(e,tp,eg,ep,ev,re,r,rp)
e:Reset() e:Reset()
end end
function c21113935.q(c) function c21113935.q(c)
return c:IsFaceup() and c:IsSetCard(0xc914) return c:IsFaceup() and c:IsSetCard(0xc904)
end end
function c21113935.tg(e,tp,eg,ep,ev,re,r,rp,chk) function c21113935.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,4)>0 end if chk==0 then return Duel.GetLocationCount(tp,4)>0 end
...@@ -221,7 +221,7 @@ function c21113935.cost4(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -221,7 +221,7 @@ function c21113935.cost4(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function c21113935.w(c) function c21113935.w(c)
return c:IsSetCard(0xc914) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() return c:IsSetCard(0xc904) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end end
function c21113935.opq2(e,tp,eg,ep,ev,re,r,rp) function c21113935.opq2(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
...@@ -245,10 +245,10 @@ function c21113935.op4(e,tp,eg,ep,ev,re,r,rp) ...@@ -245,10 +245,10 @@ function c21113935.op4(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function c21113935.e(c,e,tp) function c21113935.e(c,e,tp)
return c:IsSetCard(0xc914) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,4)>0 and c:IsFaceupEx() return c:IsSetCard(0xc904) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,4)>0 and c:IsFaceupEx()
end end
function c21113935.con4_(e,tp,eg,ep,ev,re,r,rp) function c21113935.con4_(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffectLabel(tp,21113935+1)==0 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c21113935.e),tp,0x30,0,1,nil,e,tp) and Duel.GetTurnPlayer()==1-tp return Duel.GetFlagEffect(tp,21113935+1)==0 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c21113935.e),tp,0x30,0,1,nil,e,tp) and Duel.GetTurnPlayer()==1-tp
end end
function c21113935.op4_(e,tp,eg,ep,ev,re,r,rp) function c21113935.op4_(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(21113935,3)) then if Duel.SelectYesNo(tp,aux.Stringid(21113935,3)) then
...@@ -274,5 +274,5 @@ function c21113935.op5(e,tp,eg,ep,ev,re,r,rp) ...@@ -274,5 +274,5 @@ function c21113935.op5(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function c21113935.splimit(e,c,sump,sumtype,sumpos,targetp,se) function c21113935.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0xc914) return not c:IsSetCard(0xc904)
end end
\ No newline at end of file
...@@ -52,6 +52,9 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,6 +52,9 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end end
end end
function s.splimit(e,c)
return not c:IsRace(RACE_REPTILE)
end
function s.costfilter(c) function s.costfilter(c)
return c:IsRace(RACE_REPTILE) and c:IsDiscardable() return c:IsRace(RACE_REPTILE) and c:IsDiscardable()
end end
...@@ -65,6 +68,10 @@ end ...@@ -65,6 +68,10 @@ end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) end
end end
function s.gselect(g,ft)
local fc=g:FilterCount(Card.IsType,nil,TYPE_FIELD)
return fc<=1 and aux.dncheck(g) and #g-fc<=ft
end
function s.setop(e,tp,eg,ep,ev,re,r,rp) function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
...@@ -72,7 +79,7 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -72,7 +79,7 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.setfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(s.setfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,ft) local sg=g:SelectSubGroup(tp,s.gselect,false,1,ft+1,ft)
if sg:GetCount()>0 and Duel.SSet(tp,sg)==#sg then if sg:GetCount()>0 and Duel.SSet(tp,sg)==#sg then
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1) c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1)
for tc in aux.Next(sg) do for tc in aux.Next(sg) do
......
...@@ -53,6 +53,9 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -53,6 +53,9 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end end
end end
function s.splimit(e,c)
return not c:IsRace(RACE_REPTILE)
end
function s.setcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000) Duel.PayLPCost(tp,1000)
...@@ -63,6 +66,10 @@ end ...@@ -63,6 +66,10 @@ end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
end end
function s.gselect(g,ft)
local fc=g:FilterCount(Card.IsType,nil,TYPE_FIELD)
return fc<=1 and aux.dncheck(g) and #g-fc<=ft
end
function s.setop(e,tp,eg,ep,ev,re,r,rp) function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
...@@ -70,7 +77,7 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -70,7 +77,7 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.setfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil) local g=Duel.GetMatchingGroup(s.setfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,ft) local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,ft+1,ft)
if sg:GetCount()>0 and Duel.SSet(tp,sg)==#sg then if sg:GetCount()>0 and Duel.SSet(tp,sg)==#sg then
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1) c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1)
for tc in aux.Next(sg) do for tc in aux.Next(sg) do
......
...@@ -42,7 +42,7 @@ end ...@@ -42,7 +42,7 @@ 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 c=e:GetHandler()
local sg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) local sg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if Duel.SendtoHand(sg,nil,REASON_EFFECT)>0 and sg:FilterCount(s.xfilter,nil,tp)>0 and c:IsType(TYPE_XYZ) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then if Duel.SendtoHand(sg,nil,REASON_EFFECT)>0 and sg:FilterCount(s.xfilter,nil,tp)>0 and c:IsType(TYPE_XYZ) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
local tc=Duel.GetFieldGroup(tp,0,LOCATION_HAND):RandomSelect(tp,1) local tc=Duel.GetFieldGroup(tp,0,LOCATION_HAND):RandomSelect(tp,1)
Duel.Overlay(c,tc) Duel.Overlay(c,tc)
end end
...@@ -63,12 +63,14 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -63,12 +63,14 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ft<=0 then return end if ft<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil) local sg=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if sg:GetCount()>0 and Duel.SSet(tp,sg)==#sg then if sg:GetCount()>0 and Duel.SSet(tp,sg)==#sg then
local tc=sg:GetFirst()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER) e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCondition(s.actcon) e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end end
......
...@@ -11,7 +11,7 @@ function s.initial_effect(c) ...@@ -11,7 +11,7 @@ function s.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.thfilter(c,e,tp) function s.thfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and (c:IsSetCard(0x1c5) or Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_MZONE,0,1,nil,89480012,89480013) and c:IsRace(RACE_REPTILE)) and (c:IsAbleToHand() or Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_MZONE,0,1,nil,89480012) and Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_MZONE,0,1,nil,89480013) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)) return c:IsType(TYPE_MONSTER) and (c:IsSetCard(0xc20) or Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_MZONE,0,1,nil,89480012,89480013) and c:IsRace(RACE_REPTILE)) and (c:IsAbleToHand() or Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_MZONE,0,1,nil,89480012) and Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_MZONE,0,1,nil,89480013) and c:IsCanBeSpecialSummoned(e,0,tp,false,false))
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)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
......
...@@ -6,7 +6,6 @@ function s.initial_effect(c) ...@@ -6,7 +6,6 @@ function s.initial_effect(c)
e2:SetType(EFFECT_TYPE_ACTIVATE) e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e2:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(s.condition)
e2:SetTarget(s.target) e2:SetTarget(s.target)
e2:SetOperation(s.operation) e2:SetOperation(s.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -23,13 +22,13 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -23,13 +22,13 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 and Duel.Destroy(g,REASON_EFFECT)~=0 then if g:GetCount()>0 and Duel.Destroy(g,REASON_EFFECT)~=0 then
if Duel.Draw(tp,2,REASON_EFFECT)<=0 or not Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_MZONE,0,1,nil,89480012) or Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_MZONE,0,1,nil,89480013) then return end if Duel.Draw(tp,2,REASON_EFFECT)<2 or not Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_MZONE,0,1,nil,89480012) and not Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_MZONE,0,1,nil,89480013) then return end
Duel.BreakEffect() Duel.BreakEffect()
local tc=g:GetFirst() local tc=g:GetFirst()
if Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_MZONE,0,1,nil,89480012) and c:IsLocation(LOCATION_GRAVE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then if Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_MZONE,0,1,nil,89480012) and tc:IsLocation(LOCATION_GRAVE) and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end end
if Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_MZONE,0,1,nil,89480013) and Duel.IsExistingMatchingCard(aux.AND(Card.IsAbleToHand,Card.IsCode),tp,LOCATION_DECK,0,1,nil,tc:GetCode()) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) if Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_MZONE,0,1,nil,89480013) and Duel.IsExistingMatchingCard(aux.AND(Card.IsAbleToHand,Card.IsCode),tp,LOCATION_DECK,0,1,nil,tc:GetCode()) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,aux.AND(Card.IsAbleToHand,Card.IsCode),tp,LOCATION_DECK,0,1,1,nil,tc:GetCode()) local sg=Duel.SelectMatchingCard(tp,aux.AND(Card.IsAbleToHand,Card.IsCode),tp,LOCATION_DECK,0,1,1,nil,tc:GetCode())
Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.SendtoHand(sg,nil,REASON_EFFECT)
......
...@@ -8,7 +8,7 @@ function s.initial_effect(c) ...@@ -8,7 +8,7 @@ function s.initial_effect(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_DEFENSE) e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetRange(LOCATION_FZONE) e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0) e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_REPTILE)) e2:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_REPTILE))
e2:SetValue(300) e2:SetValue(300)
...@@ -16,39 +16,148 @@ function s.initial_effect(c) ...@@ -16,39 +16,148 @@ function s.initial_effect(c)
local e3=e2:Clone() local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_ATTACK) e3:SetCode(EFFECT_UPDATE_ATTACK)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local custom_code=aux.RegisterMergedDelayedEvent_ToSingleCard(c,id,EVENT_TO_GRAVE) local custom_code=s.RegisterMergedDelayedEvent_ToSingleCard(c,id,EVENT_TO_GRAVE)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(custom_code) e2:SetCode(custom_code)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,id)
e2:SetCondition(s.descon)
e2:SetTarget(s.destg) e2:SetTarget(s.destg)
e2:SetOperation(s.desop) e2:SetOperation(s.desop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.desfilter(c,tp) function s.RegisterMergedDelayedEvent_ToSingleCard(c,code,events)
return c:IsControler(tp) and c:IsRace(RACE_REPTILE) and c:IsType(TYPE_MONSTER) local g=Group.CreateGroup()
g:KeepAlive()
local g2=Group.CreateGroup()
g2:KeepAlive()
local g3=Group.CreateGroup()
g3:KeepAlive()
local mt=getmetatable(c)
local seed=0
if type(events) == "table" then
for _, event in ipairs(events) do
seed = seed + event
end
else
seed = events
end
while(mt[seed]==true)
do
seed = seed + 1
end
mt[seed]=true
local event_code_single = (code ~ (seed << 16)) | EVENT_CUSTOM
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(events)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_SZONE)
e1:SetLabel(event_code_single)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
g:Merge(eg:Filter(s.desfilter,nil,tp,LOCATION_HAND))
g2:Merge(eg:Filter(s.desfilter,nil,tp,LOCATION_DECK+LOCATION_EXTRA))
g3:Merge(eg:Filter(s.desfilter,nil,tp,LOCATION_ONFIELD))
if Duel.GetCurrentChain()==0 and not Duel.CheckEvent(EVENT_CHAIN_END) then
local _eg=g:Clone()
local _eg2=g2:Clone()
local _eg3=g3:Clone()
local sum=0
if #g>0 then sum=sum+1 end
if #g2>0 then sum=sum+2 end
if #g3>0 then sum=sum+4 end
if sum>0 then
Duel.RaiseEvent(_eg+_eg2+_eg3,e:GetLabel(),re,sum,rp,ep,ev)
end
g:Clear()
g2:Clear()
g3:Clear()
end
end)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_END)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local _eg=g:Clone()
local _eg2=g2:Clone()
local _eg3=g3:Clone()
local sum=0
if #g>0 then sum=sum|0x1 end
if #g2>0 then sum=sum|0x2 end
if #g3>0 then sum=sum|0x4 end
if sum>0 then
Duel.RaiseEvent(_eg+_eg2+_eg3,e:GetLabel(),re,sum,rp,ep,ev)
end
g:Clear()
g2:Clear()
g3:Clear()
end)
c:RegisterEffect(e2)
return event_code_single
end end
function s.descon(e,tp,eg,ep,ev,re,r,rp) function s.desfilter(c,tp,loc)
return eg:IsExists(s.desfilter,1,nil,tp) return c:IsControler(tp) and c:IsRace(RACE_REPTILE) and c:IsType(TYPE_MONSTER) and c:IsPreviousLocation(loc)
end end
function s.cfilter(c,code) function s.cfilter(c,code)
return c:IsCode(code) and (c:IsFaceup() or not c:IsOnField()) return c:IsCode(code) and c:IsFaceupEx()
end end
function s.sumfilter(c,se) function s.sumfilter(c)
return c:IsSummonableCard() and (c:IsSummonable(true,se) or c:IsMSetable(true,se)) return c:IsSummonableCard() and (c:IsSummonable(true,nil) or c:IsMSetable(true,nil))
end end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsRace(RACE_REPTILE) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil,c:GetCode()) return c:IsRace(RACE_REPTILE) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil,c:GetCode())
end end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local b1=eg:IsExists(Card.IsPreviousLocation,1,nil,LOCATION_HAND) and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) and c:GetFlagEffect(id)==0 local b1=r&0x1>0 and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) and c:GetFlagEffect(id)==0
local b2=eg:IsExists(Card.IsPreviousLocation,1,nil,LOCATION_DECK+LOCATION_EXTRA) and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_HAND,0,1,nil,e) and c:GetFlagEffect(id+1)==0 local b2=r&0x2>0 and Duel.IsExistingMatchingCard(s.sumfilter,tp,LOCATION_HAND,0,1,nil) and c:GetFlagEffect(id+1)==0
local b3=eg:IsExists(Card.IsPreviousLocation,1,nil,LOCATION_ONFIELD) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil) and c:GetFlagEffect(id+2)==0 local b3=r&0x4>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and c:GetFlagEffect(id+2)==0
if chk==0 then return b1 or b2 or b3 end if chk==0 then return b1 or b2 or b3 end
local cat=0
if b1 then
cat=cat+CATEGORY_TOHAND
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,PLAYER_ALL,LOCATION_ONFIELD)
end
if b2 then
cat=cat+CATEGORY_SUMMON
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,tp,LOCATION_HAND)
end
if b3 then
cat=cat+CATEGORY_SPECIAL_SUMMON
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
e:SetCategory(cat)
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 c=e:GetHandler()
local b1=r&0x1>0 and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) and c:GetFlagEffect(id)==0
local b2=r&0x2>0 and Duel.IsExistingMatchingCard(s.sumfilter,tp,LOCATION_HAND,0,1,nil) and c:GetFlagEffect(id+1)==0
local b3=r&0x4>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and c:GetFlagEffect(id+2)==0
if b1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c)
Duel.SendtoHand(g1,nil,REASON_EFFECT)
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
if b2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g2=Duel.SelectMatchingCard(tp,s.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g2:GetFirst()
if tc then
local s1=tc:IsSummonable(true,nil)
local s2=tc:IsMSetable(true,nil)
if (s1 and s2 and Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
Duel.Summon(tp,tc,true,nil)
else
Duel.MSet(tp,tc,true,nil)
end
c:RegisterFlagEffect(id+1,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
if b3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g3=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
Duel.SpecialSummon(g3,0,tp,tp,false,false,POS_FACEUP)
c:RegisterFlagEffect(id+2,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end end
...@@ -81,10 +81,11 @@ function s.setcon2(e,tp,eg,ep,ev,re,r,rp) ...@@ -81,10 +81,11 @@ function s.setcon2(e,tp,eg,ep,ev,re,r,rp)
end end
function s.settg2(e,tp,eg,ep,ev,re,r,rp,chk) function s.settg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:GetFirst():IsAbleToHand() end if chk==0 then return eg:GetFirst():IsAbleToHand() end
Duel.SetTargetCard(eg:GetFirst())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,eg:GetFirst(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,eg:GetFirst(),1,0,0)
end end
function s.setop2(e,tp,eg,ep,ev,re,r,rp) function s.setop2(e,tp,eg,ep,ev,re,r,rp)
local c=eg:GetFirst() local c=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT) Duel.SendtoHand(c,nil,REASON_EFFECT)
end end
......
...@@ -10,6 +10,7 @@ function s.initial_effect(c) ...@@ -10,6 +10,7 @@ function s.initial_effect(c)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_FZONE) e1:SetRange(LOCATION_FZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetCondition(s.condition)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetValue(-500) e1:SetValue(-500)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -21,6 +22,7 @@ function s.initial_effect(c) ...@@ -21,6 +22,7 @@ function s.initial_effect(c)
e2:SetCode(EFFECT_CANNOT_ACTIVATE) e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_FZONE) e2:SetRange(LOCATION_FZONE)
e2:SetCondition(s.condition)
e2:SetTargetRange(1,1) e2:SetTargetRange(1,1)
e2:SetValue(s.limval) e2:SetValue(s.limval)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -45,9 +47,15 @@ function s.initial_effect(c) ...@@ -45,9 +47,15 @@ function s.initial_effect(c)
e1:SetOperation(s.penop) e1:SetOperation(s.penop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xc20)
end
function s.condition(e)
return Duel.IsExistingMatchingCard(s.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function s.target(e,c) function s.target(e,c)
return c:IsFaceup() and not c:IsRace(RACE_REPTILE) return c:IsFaceup() and not c:IsRace(RACE_REPTILE)
end end
function s.limval(e,re,rp) function s.limval(e,re,rp)
local rc=re:GetHandler() local rc=re:GetHandler()
return rc:IsLocation(LOCATION_MZONE) and re:IsActiveType(TYPE_MONSTER) and not rc:IsRace(RACE_REPTILE) return rc:IsLocation(LOCATION_MZONE) and re:IsActiveType(TYPE_MONSTER) and not rc:IsRace(RACE_REPTILE)
......
...@@ -16,8 +16,8 @@ function s.filter(c) ...@@ -16,8 +16,8 @@ function s.filter(c)
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:IsOnField() and aux.NegateAnyFilter(chkc) end if chkc then return chkc:IsOnField() and aux.NegateAnyFilter(chkc) end
if chk==0 then return e:IsCostChecked() or Duel.IsExistingTarget(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingTarget(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil) end
local sgt=Duel.GetMatchingGroupCount(s.filter,LOCATION_MZONE,0,nil) local sgt=Duel.GetMatchingGroupCount(s.filter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,sgt,nil) Duel.SelectTarget(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,sgt,nil)
end end
...@@ -32,19 +32,19 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -32,19 +32,19 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET) e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER) e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD) e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3) tc:RegisterEffect(e3)
end end
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
...@@ -52,7 +52,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,7 +52,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL) e4:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e4:SetValue(1) e4:SetValue(1)
e4:SetReset(RESET_EVENT+RESETS_STANDARD) e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e4) tc:RegisterEffect(e4)
local e5=e4:Clone() local e5=e4:Clone()
e5:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL) e5:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
...@@ -71,7 +71,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -71,7 +71,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_MZONE,0,1,nil,89480012) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then if Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_MZONE,0,1,nil,89480012) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.Recover(tp,n*800,REASON_EFFECT) Duel.Recover(tp,n*800,REASON_EFFECT)
end end
if Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_MZONE,0,1,nil,89480013) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) if Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_MZONE,0,1,nil,89480013) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Damage(1-tp,n*500,REASON_EFFECT) Duel.Damage(1-tp,n*500,REASON_EFFECT)
end 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