Commit 6acc04ad authored by Huangnan's avatar Huangnan

fix

parent 14ce4515
Pipeline #38806 failed with stages
in 90 minutes and 47 seconds
...@@ -25,10 +25,10 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -25,10 +25,10 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e0,true) Duel.RegisterEffect(e0,true)
end end
function s.adjustop(e,tp,eg,ep,ev,re,r,rp) function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetFieldGroup(tp,0,LOCATION_HAND) local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
local ct=g1:GetCount()-6 local ct=g:GetCount()-6
if ct>0 then if ct>0 then
local g2=g1:RandomSelect(1-tp,ct) local sg=g:RandomSelect(1-tp,ct)
Duel.SendtoDeck(g2,nil,SEQ_DECKBOTTOM,REASON_EFFECT) Duel.SendtoDeck(sg,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
end end
end end
\ No newline at end of file
...@@ -16,13 +16,13 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -16,13 +16,13 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
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()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
local opt=Duel.SelectOption(tp,1056,1063,1073,1076) local opt=Duel.SelectOption(tp,1056,1063,1073,1076)
if opt==0 then ct=TYPE_FUSION end if opt==0 then ct=TYPE_FUSION end
if opt==1 then ct=TYPE_SYNCHRO end if opt==1 then ct=TYPE_SYNCHRO end
if opt==2 then ct=TYPE_XYZ end if opt==2 then ct=TYPE_XYZ end
if opt==3 then ct=TYPE_LINK end if opt==3 then ct=TYPE_LINK end
local c=e:GetHandler()
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS) e0:SetCode(EVENT_SPSUMMON_SUCCESS)
...@@ -47,12 +47,12 @@ function s.regcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -47,12 +47,12 @@ function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.filter,1,nil,1-tp,e:GetLabel()) return eg:IsExists(s.filter,1,nil,1-tp,e:GetLabel())
end end
function s.regop(e,tp,eg,ep,ev,re,r,rp) function s.regop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(Card.IsType,tp,0,LOCATION_EXTRA,nil,e:GetLabel()) local c=e:GetHandler()
if g1:GetCount()>0 then local g=Duel.GetMatchingGroup(Card.IsType,tp,0,LOCATION_EXTRA,nil,e:GetLabel())
local g2=g1:RandomSelect(1-tp,2) if g:GetCount()>0 then
local tc=g2:GetFirst() Duel.ShuffleExtra(1-tp)
while tc do local sg=g:RandomSelect(tp,2)
local c=e:GetHandler() for tc in aux.Next(sg) do
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(id,0)) e0:SetDescription(aux.Stringid(id,0))
e0:SetType(EFFECT_TYPE_SINGLE) e0:SetType(EFFECT_TYPE_SINGLE)
...@@ -61,41 +61,26 @@ function s.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -61,41 +61,26 @@ function s.regop(e,tp,eg,ep,ev,re,r,rp)
e0:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e0:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e0) tc:RegisterEffect(e0)
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2) tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
tc=g2:GetNext()
end end
end end
end end
function s.spfilter1(c) function s.spfilter(c,e,tp)
return c:GetFlagEffect(id)>0
end
function s.spfilter2(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:GetFlagEffect(id)>0 return c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:GetFlagEffect(id)>0
end end
function s.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLocationCountFromEx(tp,tp,nil)>0 return Duel.GetLocationCountFromEx(tp,tp,nil)>0
and Duel.IsExistingMatchingCard(s.spfilter1,tp,0,LOCATION_EXTRA,1,nil) and Duel.IsExistingMatchingCard(s.spfilter,tp,0,LOCATION_EXTRA,1,nil,e,tp)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(id,1)) then if Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_CARD,0,id) Duel.Hint(HINT_CARD,0,id)
local g1=Duel.GetMatchingGroup(s.spfilter1,tp,0,LOCATION_EXTRA,nil) local g=Duel.GetMatchingGroup(s.spfilter,tp,0,LOCATION_EXTRA,nil,e,tp)
if g1:GetCount()>0 then Duel.ConfirmCards(tp,g)
Duel.ConfirmCards(tp,g1) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:FilterSelect(tp,s.spfilter,1,1,nil,e,tp)
local g2=Duel.SelectMatchingCard(tp,s.spfilter2,tp,0,LOCATION_EXTRA,1,1,nil,e,tp) if #sg>0 then
if g2:GetCount()>0 then Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEUP)
Duel.SpecialSummon(g2,0,tp,tp,true,false,POS_FACEUP)
Duel.ShuffleExtra(1-tp)
end
end
end
s.skipop(e,tp)
end
function s.skipop(e,tp)
local g1=Duel.GetMatchingGroup(s.spfilter1,tp,0,LOCATION_EXTRA,nil)
if g1:GetCount()>0 then
for tc in aux.Next(g1) do
tc:ResetFlagEffect(id)
end end
Duel.ShuffleExtra(1-tp)
end end
end end
\ No newline at end of file
...@@ -50,13 +50,13 @@ function s.fcon(con) ...@@ -50,13 +50,13 @@ function s.fcon(con)
return e:GetHandler():GetFlagEffect(id)==0 and con(e,tp,...) return e:GetHandler():GetFlagEffect(id)==0 and con(e,tp,...)
end end
end end
function s.synCheckAdditional(c,level) function s.syncheckadditional(c,level)
return function(g) return function(g)
local sum = g:GetSum(Card.GetLevel) local sum = g:GetSum(Card.GetLevel)
return sum <= level return sum <= level
end end
end end
function s.synCheck(g,tp,c,level) function s.syncheck(g,tp,c,level)
local sum = g:GetSum(Card.GetLevel) local sum = g:GetSum(Card.GetLevel)
return sum == level and c:IsSynchroSummonable(nil,g) return sum == level and c:IsSynchroSummonable(nil,g)
end end
...@@ -78,8 +78,8 @@ function s.scop(e,tp,eg,ep,ev,re,r,rp) ...@@ -78,8 +78,8 @@ function s.scop(e,tp,eg,ep,ev,re,r,rp)
if tc then if tc then
local level=tc:GetLevel() local level=tc:GetLevel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
aux.GCheckAdditional=s.synCheckAdditional(tc,level) aux.GCheckAdditional=s.syncheckadditional(tc,level)
local sg=mg:SelectSubGroup(tp,s.synCheck,false,2,#mg,tp,tc,level) local sg=mg:SelectSubGroup(tp,s.syncheck,false,2,#mg,tp,tc,level)
aux.GCheckAdditional=nil aux.GCheckAdditional=nil
if sg then if sg then
sg:KeepAlive() sg:KeepAlive()
......
...@@ -11,7 +11,7 @@ function cm.initial_effect(c) ...@@ -11,7 +11,7 @@ function cm.initial_effect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SUMMON_SUCCESS) e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,m) e3:SetCountLimit(2,m)
e3:SetCondition(cm.descon) e3:SetCondition(cm.descon)
e3:SetTarget(cm.destg) e3:SetTarget(cm.destg)
e3:SetOperation(cm.desop) e3:SetOperation(cm.desop)
......
...@@ -18,6 +18,7 @@ function s.initial_effect(c) ...@@ -18,6 +18,7 @@ function s.initial_effect(c)
e2:SetCategory(CATEGORY_DESTROY) e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE) e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCountLimit(1,id+1)
e2:SetTarget(s.destg) e2:SetTarget(s.destg)
e2:SetOperation(s.desop) e2:SetOperation(s.desop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
......
...@@ -40,6 +40,9 @@ function s.initial_effect(c) ...@@ -40,6 +40,9 @@ function s.initial_effect(c)
e3:SetOperation(s.operation3) e3:SetOperation(s.operation3)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function s.mfilter(c)
return c:IsFusionSetCard(0x5ce1) and c:IsFusionAttribute(ATTRIBUTE_LIGHT)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp) function s.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL) and rp==1-tp return re:IsActiveType(TYPE_SPELL) and rp==1-tp
end end
......
...@@ -30,7 +30,7 @@ function s.filter1(c,e,tp) ...@@ -30,7 +30,7 @@ function s.filter1(c,e,tp)
return c.MoJin and c:IsAbleToRemoveAsCost() and Duel.GetLocationCountFromEx(tp,tp,c)>0 and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,5,c) and c:IsFaceup() return c.MoJin and c:IsAbleToRemoveAsCost() and Duel.GetLocationCountFromEx(tp,tp,c)>0 and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,5,c) and c:IsFaceup()
end end
function s.filter2(c) function s.filter2(c)
return c.MoJin and c:IsAbleToRemoveAsCost() and c:IsFaceup() and c:IsFaceup() return c.MoJin and c:IsAbleToRemoveAsCost() and c:IsFaceup()
end 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()
...@@ -40,7 +40,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -40,7 +40,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g1:Clone() local sg=g1:Clone()
sg:AddCard(c) sg:AddCard(c)
local g2=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,5,5,sg,e,tp) local g2=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,4,4,sg,e,tp)
g1:Merge(g2) g1:Merge(g2)
Duel.Remove(g1,POS_FACEUP,REASON_COST) Duel.Remove(g1,POS_FACEUP,REASON_COST)
end end
......
--律法塔魂的贤王 法墨特 --律法塔魂的贤王 法墨特
local m=79100260 local m=79100260
local cm=c79100260 local cm=c79100260
function s.initial_effect(c) function cm.initial_effect(c)
--fusion summon --fusion summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
...@@ -9,10 +9,10 @@ function s.initial_effect(c) ...@@ -9,10 +9,10 @@ function s.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMING_MAIN_END) e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCountLimit(1,id+o) e1:SetCountLimit(1,m)
e1:SetCondition(s.condition) e1:SetCondition(cm.condition)
e1:SetTarget(s.target) e1:SetTarget(cm.target)
e1:SetOperation(s.operation) e1:SetOperation(cm.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
-- --
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -26,18 +26,18 @@ function s.initial_effect(c) ...@@ -26,18 +26,18 @@ function s.initial_effect(c)
e2:SetOperation(cm.spop2) e2:SetOperation(cm.spop2)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2 return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end end
function s.filter1(c,e) function cm.filter1(c,e)
return c:IsOnField() and not c:IsImmuneToEffect(e) return c:IsOnField() and not c:IsImmuneToEffect(e)
end end
function s.filter2(c,e,tp,m,f,gc,chkf) function cm.filter2(c,e,tp,m,f,gc,chkf)
return c:IsType(TYPE_FUSION) and (c:IsSetCard(0x3a11) or Duel.GetTurnPlayer()==tp) and (not f or f(c)) return c:IsType(TYPE_FUSION) and (c:IsSetCard(0x3a11) or Duel.GetTurnPlayer()==tp) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf)
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local chkf=tp local chkf=tp
...@@ -56,7 +56,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -56,7 +56,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function s.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local chkf=tp local chkf=tp
if not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end if not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end
......
...@@ -4,93 +4,96 @@ function s.initial_effect(c) ...@@ -4,93 +4,96 @@ function s.initial_effect(c)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcCode2FunRep(c,79103130,79103000,aux.FilterBoolFunction(Card.IsFusionSetCard,0x5a13),1,127,true,true) aux.AddFusionProcCode2FunRep(c,79103130,79103000,aux.FilterBoolFunction(Card.IsFusionSetCard,0x5a13),1,127,true,true)
--spsummon success --attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(s.sumcon)
e1:SetOperation(s.sucop)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(82734805,0)) e2:SetDescription(1131)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCategory(CATEGORY_DISABLE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCondition(s.con) e2:SetCode(EVENT_CHAINING)
e2:SetTarget(s.tg) e2:SetCountLimit(1,id)
e2:SetOperation(s.op) e2:SetRange(LOCATION_MZONE)
e2:SetCondition(s.discon)
e2:SetTarget(s.distg)
e2:SetOperation(s.disop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--material check --indes
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EFFECT_MATERIAL_CHECK) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetValue(s.valcheck) e3:SetCondition(s.e3con)
e3:SetLabelObject(e2) e3:SetOperation(s.e3op)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function s.valcheck(e,c) function s.sumcon(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetHandler():GetMaterial():GetClassCount(Card.GetCode)
e:GetLabelObject():SetLabel(ct)
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION) return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sucop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel() local c=e:GetHandler()
local con3,con5,con8,con10=nil,nil,nil,nil local e1=Effect.CreateEffect(c)
if ct>=3 then e1:SetType(EFFECT_TYPE_SINGLE)
con3=Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_EXTRA,0,3,nil) e1:SetCode(EFFECT_SET_BASE_ATTACK)
and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_EXTRA,3,nil) e1:SetValue(c:GetMaterialCount()*400)
end e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
if ct>=5 then c:RegisterEffect(e1)
con5=Duel.IsPlayerCanDiscardDeck(tp,3) and Duel.IsPlayerCanDiscardDeck(1-tp,3) local e2=e1:Clone()
end e2:SetCode(EFFECT_SET_BASE_DEFENSE)
if ct>=8 then c:RegisterEffect(e2)
con8=Duel.IsExistingMatchingCard(nil,tp,LOCATION_REMOVED,0,1,nil)
and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_REMOVED,1,nil)
end
if ct>=10 then
con10=Duel.GetFieldGroupCount(tp,LOCATION_HAND,LOCATION_HAND)>0
end
if chk==0 then return con3 or con5 or con8 or con10 end
local cat=0
if ct>=3 or ct>=8 then cat=cat+CATEGORY_TOGRAVE end
if ct>=5 then cat=cat+CATEGORY_DECKDES end
if ct>=10 then cat=cat+CATEGORY_HANDES end
e:SetCategory(cat)
end end
function s.op(e,tp,eg,ep,ev,re,r,rp) function s.discon(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel() return ep~=tp and re:IsActiveType(TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP) and Duel.IsChainDisablable(ev)
if ct>=3 then end
local g1=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_EXTRA,0,nil) function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
local sg1=nil if chk==0 then return true end
if g1:GetCount()>=3 then Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) end
sg1=g1:Select(tp,3,3,nil) function s.disop(e,tp,eg,ep,ev,re,r,rp)
else sg1=g1 end local d=Duel.TossDice(tp,1)
local g2=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_EXTRA,nil) if d==6 then
local sg2=nil Duel.NegateEffect(ev)
if g2:GetCount()>=3 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
sg2=g2:Select(1-tp,3,3,nil)
else sg2=g2 end
sg1:Merge(sg2)
if sg1:GetCount()>0 then
Duel.SendtoGrave(sg1,REASON_EFFECT)
end
end
if ct>=5 then
Duel.BreakEffect()
Duel.DiscardDeck(tp,3,REASON_EFFECT)
Duel.DiscardDeck(1-tp,3,REASON_EFFECT)
end end
if ct>=8 then end
Duel.BreakEffect() function s.e3con(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local c=e:GetHandler()
local g1=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_REMOVED,0,1,3,nil) return c:IsSummonType(SUMMON_TYPE_FUSION) and c:GetMaterialCount()>=4
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE) end
local g2=Duel.SelectMatchingCard(1-tp,nil,1-tp,LOCATION_REMOVED,0,1,3,nil) function s.e3op(e,tp,eg,ep,ev,re,r,rp)
g1:Merge(g2) local c=e:GetHandler()
if g1:GetCount()>0 then local e2=Effect.CreateEffect(c)
Duel.SendtoGrave(g1,REASON_EFFECT+REASON_RETURN) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TOSS_DICE_NEGATE)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetCondition(s.dicecon)
e2:SetOperation(s.diceop)
c:RegisterEffect(e2)
end
function s.dicecon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetFlagEffect(id)==0
end
function s.diceop(e,tp,eg,ep,ev,re,r,rp)
local cc=Duel.GetCurrentChain()
local cid=Duel.GetChainInfo(cc,CHAININFO_CHAIN_ID)
if Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_CARD,0,id)
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
local dc={Duel.GetDiceResult()}
local ac=1
local ct=(ev&0xff)+(ev>>16&0xff)
if ct>1 then
--choose the index of results
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2))
local val,idx=Duel.AnnounceNumber(tp,table.unpack(aux.idx_table,1,ct))
ac=idx+1
end end
end dc[ac]=7
if ct>=10 then Duel.SetDiceResult(table.unpack(dc))
Duel.BreakEffect()
local g1=Duel.GetFieldGroup(tp,LOCATION_HAND,LOCATION_HAND)
Duel.SendtoGrave(g1,REASON_EFFECT)
end end
end end
\ No newline at end of file
--虚星舰组件 流水推进器 --虚星舰组件 流水推进器
local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,1,2,nil,nil,99) aux.AddXyzProcedure(c,nil,1,2,nil,nil,99)
--tograve --fus
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1174075,0)) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCategory(CATEGORY_TOGRAVE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(id)
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,1174075)
e1:SetCondition(s.tgcon)
e1:SetTarget(s.tgtg)
e1:SetOperation(s.tgop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--extra material --
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_OVERLAY_RITUAL_MATERIAL) e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.indcon)
e2:SetValue(1) e2:SetOperation(s.indop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--negate --tograve
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(1174075,1)) e3:SetDescription(1191)
e3:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCode(EVENT_CHAINING) e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE) e3:SetCondition(s.tgcon)
e3:SetCountLimit(1,1174076) e3:SetTarget(s.tgtg)
e3:SetCondition(s.discon) e3:SetOperation(s.tgop)
e3:SetCost(s.discost)
e3:SetTarget(s.distg)
e3:SetOperation(s.disop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
if not s.global_check then
s.global_check=true
GM_hack_fusion_check=Card.CheckFusionMaterial
function Card.CheckFusionMaterial(card,Group_fus,Card_g,int_chkf,not_mat)
local exc=Duel.GetMatchingGroup(s.getexc,int_chkf,LOCATION_MZONE,0,nil)
local exg=Group.CreateGroup()
if exc:GetCount()>0 then
for tc in aux.Next(exc) do
local exg_temp=tc:GetOverlayGroup()
if exg_temp:GetCount()>0 then
exg:Merge(exg_temp)
end
end
end
if card:IsSetCard(0xa13) and exg:GetCount()>0 then
Group_fus:Merge(exg)
end
return GM_hack_fusion_check(card,Group_fus,Card_g,int_chkf,not_mat)
end
end
end
function s.getexc(c)
return c:IsHasEffect(id) and c:IsFaceup()
end
function s.indcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_FUSION
end
function s.indop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(rc)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(aux.dscon)
e1:SetCountLimit(1)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
end
rc:RegisterFlagEffect(id+o,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,1))
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetValue(RESET_TURN_SET)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp) function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ) return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end end
function s.tgfilter(c) function s.tgfilter(c)
return c:IsSetCard(0x154) and c:IsAbleToGrave() return c:IsSetCard(0xa13) and c:IsAbleToGrave() and c:IsType(TYPE_MONSTER)
end end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
...@@ -53,30 +123,4 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -53,30 +123,4 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT) Duel.SendtoGrave(g,REASON_EFFECT)
end end
end end
function s.cfilter(c) \ No newline at end of file
return c:IsFaceup() and c:IsType(TYPE_RITUAL) and c:IsRace(RACE_MACHINE)
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
and ep==1-tp and re:IsHasType(EFFECT_TYPE_ACTIVATE)
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
...@@ -5,44 +5,54 @@ function s.initial_effect(c) ...@@ -5,44 +5,54 @@ function s.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCondition(s.spcon) e1:SetCondition(s.spcon)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--position --destroy
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_POSITION) e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCategory(CATEGORY_DESTROY)
e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e2:SetCountLimit(1,id) e2:SetCountLimit(1,id)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetTarget(s.destg)
e2:SetTarget(s.postg) e2:SetOperation(s.desop)
e2:SetOperation(s.posop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end end
function s.cfilter(c) function s.cfilter(c)
return c:IsAttackPos() and c:IsRace(RACE_INSECT) return c:IsFaceup() and c:IsSetCard(0xa13)
end end
function s.spcon(e,c) function s.spcon(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.cfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil)
end end
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsCanChangePosition() end if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end end
function s.posop(e,tp,eg,ep,ev,re,r,rp) function s.fufilter(c)
return c:IsFaceup() and c:IsSetCard(0xa13) and c:IsType(TYPE_FUSION)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK) if Duel.IsExistingMatchingCard(s.fufilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE)>0
and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
end
end end
end end
\ No newline at end of file
...@@ -3,69 +3,80 @@ local s,id,o=GetID() ...@@ -3,69 +3,80 @@ local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--spsummon --spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(1118)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon) e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--to deck --Destroy
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e2:SetDescription(1101)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_REMOVE) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,id) e2:SetCountLimit(1,id+1)
e2:SetTarget(s.tdtg) e2:SetTarget(s.destg)
e2:SetOperation(s.tdop) e2:SetOperation(s.desop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=e2:Clone() local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c) if not s.global_check then
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) s.global_check=true
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) local ge1=Effect.CreateEffect(c)
e4:SetCode(EVENT_SPSUMMON_SUCCESS) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetOperation(s.checkop) ge1:SetCode(EVENT_TO_GRAVE)
c:RegisterEffect(e4) ge1:SetCondition(s.regcon)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
function s.rfilter(c,tp)
return c:IsSetCard(0x5a13) and c:IsType(TYPE_MONSTER) and not c:IsReason(REASON_RETURN)
end end
function s.filter(c) function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return (c:IsLevel(2) and c:IsType(TYPE_SYNCHRO) or c:IsLink(1) and c:IsType(TYPE_LINK)) and c:IsFaceup() return eg:IsExists(s.rfilter,1,nil)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
if s.rfilter(tc) then
Duel.RegisterFlagEffect(tc:GetControler(),id,RESET_PHASE+PHASE_END,0,1)
end
end
end end
function s.spcon(e,c) function s.spcon(e,c)
if c==nil then return true end return Duel.GetFlagEffect(tp,id)>0
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,1,nil) end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
if e:GetHandler():GetFlagEffect(id)>0 then Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
e:SetLabel(1) end
else function s.spop(e,tp,eg,ep,ev,re,r,rp)
e:SetLabel(0) local c=e:GetHandler()
if c:IsRelateToEffect(e) and aux.NecroValleyFilter()(c) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end end
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,1,1,nil) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end end
function s.tdop(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 not (tc:IsRelateToEffect(e) and aux.NecroValleyFilter()(tc)) then return end if not tc:IsRelateToEffect(e) then return end
local b1=tc:IsAbleToDeck() if not tc:IsAbleToRemove() or not Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
local b2=e:GetLabel()==1 and tc:IsAbleToRemove() Duel.Destroy(tc,REASON_EFFECT)
if b1 and (not b2 or not Duel.SelectYesNo(tp,aux.Stringid(id,2))) then elseif tc:IsAbleToRemove() then
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
elseif b2 then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end end
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
if not re then return end
if re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsType(TYPE_SYNCHRO) then
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD-RESET_TEMP_REMOVE,0,1)
end
end end
\ No newline at end of file
...@@ -4,93 +4,142 @@ function s.initial_effect(c) ...@@ -4,93 +4,142 @@ function s.initial_effect(c)
--special summon --special summon
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_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_TODECK+CATEGORY_DRAW+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetCost(s.spcost) e1:SetCost(s.e1cost)
e1:SetTarget(s.sptg) e1:SetTarget(s.e1tg)
e1:SetOperation(s.spop) e1:SetOperation(s.e1op)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--buff
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(s.atkval)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--set
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,id+o)
e4:SetCost(aux.bfgcost)
e4:SetTarget(s.settg)
e4:SetOperation(s.setop)
c:RegisterEffect(e4)
end end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.e1cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end if chk==0 then return not e:GetHandler():IsPublic() end
end end
function s.spfilter(c,tp,chk) function s.tdfilter(c)
return c:IsSetCard(0x1c1) and c:IsAllTypes(TYPE_CONTINUOUS|TYPE_TRAP) and c:IsFaceup() and c:IsAbleToHand() return c:IsFaceup() and c:IsSetCard(0x5a13) and c:IsType(TYPE_MONSTER)
and (Duel.GetMZoneCount(tp,c)>0 or not chk)
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.filter1(c)
local c=e:GetHandler() return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_ONFIELD,0,1,nil,tp,true) end
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.filter2(c,e,tp,m,f,chkf)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0) return c:IsType(TYPE_FUSION) and c:IsSetCard(0xa13) and (not f or f(c))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,LOCATION_HAND) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function s.filter3(c,e)
return c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.fufilter(c)
return c:IsFaceup() and c:IsType(TYPE_FUSION) and c:IsSetCard(0xa13)
end
function s.e1tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local b1=Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_REMOVED,0,1,nil) and Duel.IsPlayerCanDraw(tp,1)
local rg=nil local chkf=tp
if Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_ONFIELD,0,1,nil,tp,true) then local mg1=Duel.GetFusionMaterial(tp)
rg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp,true) local mg2=Duel.GetMatchingGroup(s.filter1,tp,0,LOCATION_GRAVE,nil)
else if #mg2>0 then
rg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp,false) mg1:Merge(mg2)
end end
if rg and rg:GetCount()>0 then local b2=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
Duel.HintSelection(rg) if not b2 then
if Duel.SendtoHand(rg,nil,REASON_EFFECT)~=0 and rg:FilterCount(Card.IsLocation,nil,LOCATION_HAND)>0 local ce=Duel.GetChainMaterial(tp)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then if ce~=nil then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
b2=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end end
end end
local b3=Duel.IsExistingMatchingCard(s.fufilter,tp,LOCATION_MZONE,0,1,nil) and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
if chk==0 then return (b1 or b2 or b3) and Duel.GetFlagEffect(tp,id)<3 end
Duel.RegisterFlagEffect(tp,id,0,0,0)
end end
function s.atkval(e,c) function s.e1op(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.bfilter,c:GetControler(),LOCATION_MZONE,0,c) local c=e:GetHandler()
return g:GetClassCount(Card.GetCode)*700 local c=e:GetHandler()
end local b1=Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_REMOVED,0,1,nil) and Duel.IsPlayerCanDraw(tp,1)
function s.bfilter(c) local chkf=tp
return c:IsFaceup() and c:IsSetCard(0x1c1) local mg1=Duel.GetFusionMaterial(tp)
end local mg2=Duel.GetMatchingGroup(s.filter1,tp,0,LOCATION_GRAVE,nil)
function s.setfilter(c) if #mg2>0 then
return c:IsAllTypes(TYPE_TRAP+TYPE_CONTINUOUS) and c:IsSSetable() mg1:Merge(mg2)
end end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) local b2=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_HAND,0,1,nil) end if not b2 then
end local ce=Duel.GetChainMaterial(tp)
function s.setop(e,tp,eg,ep,ev,re,r,rp) if ce~=nil then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local fgroup=ce:GetTarget()
local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_HAND,0,1,1,nil) local mg3=fgroup(ce,e,tp)
local tc=g:GetFirst() local mf=ce:GetValue()
if tc and Duel.SSet(tp,tc)~=0 then b2=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
local e1=Effect.CreateEffect(e:GetHandler()) end
e1:SetDescription(aux.Stringid(id,3)) end
e1:SetType(EFFECT_TYPE_SINGLE) local b3=Duel.IsExistingMatchingCard(s.fufilter,tp,LOCATION_MZONE,0,1,nil) and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE) local op=aux.SelectFromOptions(tp,
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN) {b1,aux.Stringid(id,1)},
e1:SetReset(RESET_EVENT+RESETS_STANDARD) {b2,aux.Stringid(id,2)},
tc:RegisterEffect(e1) {b3,aux.Stringid(id,3)})
if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=Duel.SelectMatchingCard(tp,s.tdfilter,tp,LOCATION_REMOVED,0,1,5,nil)
if #sg>0 then
Duel.HintSelection(sg)
if Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)>0 and sg:IsExists(Card.IsLocation,1,nil,LOCATION_DECK+LOCATION_EXTRA) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
if op==2 then
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter3,nil,e)
local mg2=Duel.GetMatchingGroup(s.filter1,tp,0,LOCATION_GRAVE,nil)
if #mg2>0 then
mg1:Merge(mg2)
end
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
if op==3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=Duel.SelectMatchingCard(tp,s.fufilter,tp,LOCATION_MZONE,0,1,1,nil)
if #sg>0 then
Duel.HintSelection(sg)
if Duel.Destroy(sg,REASON_EFFECT)>0 then
local dg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
if #dg>0 then
Duel.Destroy(dg,REASON_EFFECT)
end
end
end
end end
end end
\ No newline at end of file
...@@ -3,6 +3,7 @@ local s,id,o=GetID() ...@@ -3,6 +3,7 @@ local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(1118)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
...@@ -10,41 +11,31 @@ function s.initial_effect(c) ...@@ -10,41 +11,31 @@ function s.initial_effect(c)
e1:SetCost(s.cost) e1:SetCost(s.cost)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
e1:SetLabel(0)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end 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)
e:SetLabel(100) if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
Duel.SendtoGrave(sg,REASON_COST)
local code=sg:GetFirst():GetCode()
e:SetLabel(code)
end end
function s.costfilter(c,e,tp) function s.costfilter(c,e,tp)
return c:IsFaceup() and c:GetOriginalLevel()>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,c,e,tp) return c:IsSetCard(0x5a13) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,c,c:GetCode(),e,tp)
and Duel.GetMZoneCount(tp,c)>0
end end
function s.spfilter(c,tc,e,tp) function s.spfilter(c,code,e,tp)
return c:GetOriginalLevel()==tc:GetOriginalLevel()-1 return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and c:GetOriginalRace()==tc:GetOriginalRace()
and c:GetOriginalAttribute()==tc:GetOriginalAttribute()
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 if chk==0 then return e:IsCostChecked() end
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return e:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.CheckReleaseGroup(tp,s.costfilter,1,nil,e,tp)
end
e:SetLabel(0)
local g=Duel.SelectReleaseGroup(tp,s.costfilter,1,1,nil,e,tp)
Duel.Release(g,REASON_COST)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler() local code=e:GetLabel(code)
local tc=Duel.GetFirstTarget()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,tc,e,tp) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,code,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
......
...@@ -3,32 +3,45 @@ local s,id,o=GetID() ...@@ -3,32 +3,45 @@ local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(1169)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(1108)
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCountLimit(1,id)
e2:SetCost(s.drcost)
e2:SetTarget(s.drtg)
e2:SetOperation(s.drop)
c:RegisterEffect(e2)
end end
function s.filter0(c) function s.filter1(c)
return c:IsOnField() and c:IsAbleToRemove() return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end
function s.filter1(c,e)
return c:IsOnField() and c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
end end
function s.filter2(c,e,tp,m,f,chkf) function s.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_MACHINE) and (not f or f(c)) return c:IsType(TYPE_FUSION) and c:IsSetCard(0xa13) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end end
function s.filter3(c) function s.filter3(c,e)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove() return c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
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 if chk==0 then
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter0,nil) local mg1=Duel.GetFusionMaterial(tp)
local mg2=Duel.GetMatchingGroup(s.filter3,tp,LOCATION_GRAVE,0,nil) local mg2=Duel.GetMatchingGroup(s.filter1,tp,0,LOCATION_GRAVE,nil)
mg1:Merge(mg2) if #mg2>0 then
mg1:Merge(mg2)
end
local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then if not res then
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
...@@ -39,16 +52,17 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -39,16 +52,17 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf) res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end end
end end
return res
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE)
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e) local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter3,nil,e)
local mg2=Duel.GetMatchingGroup(s.filter3,tp,LOCATION_GRAVE,0,nil) local mg2=Duel.GetMatchingGroup(s.filter1,tp,0,LOCATION_GRAVE,nil)
mg1:Merge(mg2) if #mg2>0 then
mg1:Merge(mg2)
end
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg3=nil local mg3=nil
local sg2=nil local sg2=nil
...@@ -79,3 +93,17 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -79,3 +93,17 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
tc:CompleteProcedure() tc:CompleteProcedure()
end end
end end
function s.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST)
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
\ No newline at end of file
...@@ -3,25 +3,38 @@ local s,id,o=GetID() ...@@ -3,25 +3,38 @@ local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
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)
end end
function s.filter0(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave() and c:IsSetCard(0x5a13)
end
function s.filter1(c,e) function s.filter1(c,e)
return not c:IsImmuneToEffect(e) return not c:IsImmuneToEffect(e) and c:IsLocation(LOCATION_HAND) and c:IsSetCard(0x5a13)
end end
function s.filter2(c,e,tp,m,f,chkf) function s.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c)) return c:IsType(TYPE_FUSION) and c:IsSetCard(0xa13) and (not f or f(c)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) end
function s.filter3(c)
return c:IsLocation(LOCATION_HAND) and c:IsSetCard(0x5a13)
end
function s.fcheck(tp,sg,fc)
return sg:GetCount()==3
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 if chk==0 then
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp) local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter3,nil)
local mg2=Duel.GetMatchingGroup(s.filter0,tp,LOCATION_DECK,0,nil)
mg1:Merge(mg2)
aux.FGoalCheckAdditional=s.fcheck
local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
aux.FGoalCheckAdditional=nil
if not res then if not res then
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
if ce~=nil then if ce~=nil then
...@@ -38,15 +51,17 @@ end ...@@ -38,15 +51,17 @@ end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e) local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(s.filter0,tp,LOCATION_DECK,0,nil)
mg1:Merge(mg2)
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil local mg3=nil
local sg2=nil local sg2=nil
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
if ce~=nil then if ce~=nil then
local fgroup=ce:GetTarget() local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp) mg3=fgroup(ce,e,tp)
local mf=ce:GetValue() local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf) sg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone() local sg=sg1:Clone()
...@@ -55,16 +70,18 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,16 +70,18 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=sg:Select(tp,1,1,nil) local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
aux.FGoalCheckAdditional=s.fcheck
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf) local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
aux.FGoalCheckAdditional=nil
tc:SetMaterial(mat1) tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect() Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf) local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation() local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2) fop(ce,e,tp,tc,mat2)
end end
tc:CompleteProcedure() tc:CompleteProcedure()
end end
end end
\ No newline at end of file
...@@ -3,82 +3,57 @@ local s,id,o=GetID() ...@@ -3,82 +3,57 @@ local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--spsummon --spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetDescription(1118)
e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND) e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCode(EVENT_TO_GRAVE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon) e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--search --spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.thcon)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--material effect
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e3:SetDescription(1118)
e3:SetCode(EVENT_BE_MATERIAL) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_EVENT_PLAYER) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCountLimit(1,id+o*2) e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(s.effcon) e3:SetCode(EVENT_TO_GRAVE)
e3:SetOperation(s.effop) e3:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e3:SetCountLimit(1,id+1)
e3:SetCondition(s.spcon2)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function s.spfilter(c) function s.spfilter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x103d) and not c:IsCode(id) return c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end end
function s.thcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end end
function s.thfilter(c) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
return c:IsSetCard(0x203d) and c:IsAbleToHand() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE) function s.spop(e,tp,eg,ep,ev,re,r,rp)
end if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil) if g:GetCount()>0 then
if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.SendtoHand(g,nil,REASON_EFFECT) end
Duel.ConfirmCards(1-tp,g)
end end
end end
function s.effcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_SYNCHRO)~=0 and e:GetHandler():GetReasonCard():IsSetCard(0x103d) local check=false
end for tc in aux.Next(eg) do
function s.effop(e,tp,eg,ep,ev,re,r,rp) local mg=tc:GetMaterial()
local c=e:GetHandler() if tc:IsPreviousLocation(LOCATION_ONFIELD) and tc:IsSetCard(0xa13) and tc:IsType(TYPE_FUSION) and mg:IsContains(e:GetHandler()) then
local rc=c:GetReasonCard() check=true
local e1=Effect.CreateEffect(rc) end
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(-500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
end end
rc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,3)) return check
end end
\ No newline at end of file
--星舰组件 破片炮塔 --星舰组件 破片炮塔
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--atk up --attack all
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_ATTACK_ALL)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.rmcon)
e1:SetValue(2000)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--attack all --pierce
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ATTACK_ALL) e2:SetCode(EFFECT_PIERCE)
e2:SetValue(1)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--battle remove --
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCode(EFFECT_BATTLE_DESTROY_REDIRECT) e3:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e3:SetRange(LOCATION_MZONE) e3:SetCondition(s.indcon)
e3:SetValue(LOCATION_REMOVED) e3:SetOperation(s.indop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--special summon --
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetDescription(1191)
e4:SetCategory(CATEGORY_TOGRAVE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_LEAVE_FIELD) e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,id) e4:SetCountLimit(1,id)
e4:SetCondition(s.spcon) e4:SetTarget(s.tgtg)
e4:SetTarget(s.sptg) e4:SetOperation(s.tgop)
e4:SetOperation(s.spop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
if not s.global_check then local e5=e4:Clone()
s.global_check=true e5:SetCode(EVENT_SPSUMMON_SUCCESS)
local ge1=Effect.CreateEffect(c) c:RegisterEffect(e5)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_REMOVE)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end
end end
function s.checkop(e,tp,eg,ep,ev,re,r,rp) function s.indcon(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(0,id,RESET_PHASE+PHASE_END,0,1) return r==REASON_FUSION and e:GetHandler():GetReasonCard():IsSetCard(0xa13)
end end
function s.rmcon(e) function s.indop(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(0,id)>0
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) local rc=c:GetReasonCard()
and c:IsPreviousControler(tp) and c:GetReasonPlayer()==1-tp --attack all
local e1=Effect.CreateEffect(rc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ATTACK_ALL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
--pierce
local e2=Effect.CreateEffect(rc)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PIERCE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
if not rc:IsType(TYPE_EFFECT) then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_ADD_TYPE)
e4:SetValue(TYPE_EFFECT)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e4,true)
end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(1600)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e3,true)
rc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,1))
end end
function s.spfilter(c,e,tp) function s.tgfilter(c)
return not c:IsCode(id) and c:IsSetCard(0xcf) and c:IsType(TYPE_SYNCHRO) return c:IsSetCard(0xa13) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SendtoGrave(g,REASON_EFFECT)
end end
end end
\ No newline at end of file
--星舰组件 沙塔尔立场 --星舰组件 沙塔尔立场
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--cannot be target/effect indestructable --cannot be target/effect indestructable
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCondition(s.dcon)
e2:SetValue(aux.tgoval) e2:SetValue(aux.tgoval)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=e2:Clone() local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetValue(aux.indoval) e3:SetValue(aux.indoval)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--Trap Set
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,id+o)
e4:SetCondition(s.setcon)
e4:SetTarget(s.settg)
e4:SetOperation(s.setop)
c:RegisterEffect(e4)
-- --
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter) local e5=Effect.CreateEffect(c)
end e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
function s.chainfilter(re,tp,cid) e5:SetCode(EVENT_BE_MATERIAL)
local rc=re:GetHandler() e5:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
return rc:IsCode(id) or not ((rc:GetType()==TYPE_TRAP and re:IsHasType(EFFECT_TYPE_ACTIVATE)) e5:SetCondition(s.indcon)
or (rc:IsSetCard(0x17e))) e5:SetOperation(s.indop)
c:RegisterEffect(e5)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(1118)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
local e4=e1:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
end end
function s.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spfilter(c,e,tp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)>0 return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0xa13)
or Duel.GetCustomActivityCount(id,1-tp,ACTIVITY_CHAIN)>0
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) 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 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end 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() if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if not c:IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
end if g:GetCount()>0 then
function s.dcon(e) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
return Duel.IsExistingMatchingCard(Card.IsFacedown,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil) end
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return rc:GetType()==TYPE_TRAP and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function s.setfilter(c,rc)
return not c:IsCode(rc:GetCode()) and c:GetType()==TYPE_TRAP and c:IsSSetable()
end end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) function s.indcon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler() return r==REASON_FUSION and e:GetHandler():GetReasonCard():IsSetCard(0xa13)
if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil,rc) end
end end
function s.setop(e,tp,eg,ep,ev,re,r,rp) function s.indop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler() local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local rc=c:GetReasonCard()
local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil,rc) --cannot be target/effect indestructable
if g:GetCount()>0 then local e2=Effect.CreateEffect(rc)
Duel.SSet(tp,g:GetFirst()) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(aux.tgoval)
rc:RegisterEffect(e2,true)
local e1=e2:Clone()
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetValue(aux.indoval)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_ADD_TYPE)
e4:SetValue(TYPE_EFFECT)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e4,true)
end end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_DEFENSE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(1600)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e3,true)
rc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,1))
end end
\ No newline at end of file
...@@ -3,7 +3,7 @@ local s,id,o=GetID() ...@@ -3,7 +3,7 @@ local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--tohand --tohand
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(1101)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCode(EVENT_SUMMON_SUCCESS)
...@@ -17,7 +17,7 @@ function s.initial_effect(c) ...@@ -17,7 +17,7 @@ function s.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--spsummon --spsummon
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1)) e3:SetDescription(1101)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BE_MATERIAL) e3:SetCode(EVENT_BE_MATERIAL)
......
--星舰战略 回收地堡 --星舰战略 回收地堡
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE) e1:SetDescription(1102)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetOperation(s.activate) e1:SetCountLimit(1,id)
e1:SetTarget(s.rmtg)
e1:SetOperation(s.rmop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(1190)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end end
function s.filter(c) function s.rmfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and s.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and s.rmfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingTarget(s.rmfilter,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_GRAVE,1,1,nil) local g=Duel.SelectTarget(tp,s.rmfilter,tp,0,LOCATION_GRAVE,1,3,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_REMOVED) then
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(s.distg)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetCondition(s.discon)
e2:SetOperation(s.disop)
e2:SetLabelObject(tc)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
end
end end
function s.distg(e,c) function s.spfilter(c,e,tp)
local tc=e:GetLabelObject() return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsFaceup() and c:IsLocation(LOCATION_REMOVED)
return c:IsOriginalCodeRule(tc:GetOriginalCodeRule()) and (c:IsType(TYPE_EFFECT) or c:GetOriginalType()&TYPE_EFFECT~=0)
end end
function s.discon(e,tp,eg,ep,ev,re,r,rp) function s.fufilter(c)
local tc=e:GetLabelObject() return c:IsSetCard(0xa13) and c:IsFaceup() and c:IsType(TYPE_FUSION)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsOriginalCodeRule(tc:GetOriginalCodeRule())
end end
function s.disop(e,tp,eg,ep,ev,re,r,rp) function s.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev) local g=Duel.GetTargetsRelateToChain()
if #g>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)>0 then
if Duel.IsExistingMatchingCard(s.fufilter,tp,LOCATION_MZONE,0,1,nil) and g:IsExists(s.spfilter,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:FilterSelect(tp,s.spfilter,1,1,nil,e,tp)
if #sg>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end end
function s.thfilter(c)
return c:IsSetCard(0x3a13) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end
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
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
...@@ -12,18 +12,31 @@ function s.initial_effect(c) ...@@ -12,18 +12,31 @@ function s.initial_effect(c)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.counterfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_DARK)
end
function s.cfilter(c) function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x11b) and c:IsType(TYPE_LINK) return c:IsFaceup() and c:IsSetCard(0xa13) and c:IsType(TYPE_FUSION)
end end
function s.condition(e,tp,eg,ep,ev,re,r,rp) function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsChainNegatable(ev) and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev) and re:IsActiveType(TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP)
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then local c=e:GetHandler()
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT) if Duel.NegateActivation(ev) then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(s.discon)
e1:SetOperation(s.disop)
Duel.RegisterEffect(e1,tp)
end end
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and Duel.IsChainDisablable(ev) and re:IsActiveType(TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,id)
local rc=re:GetHandler()
Duel.NegateEffect(ev)
e:Reset()
end end
\ No newline at end of file
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