Commit 1defafbe authored by 聖園ミカ's avatar 聖園ミカ 🐟

Replace c12866765.lua

parent 656f5273
Pipeline #32452 passed with stages
in 36 minutes and 6 seconds
--战争恶魔·田中脊髓剑 --战争恶魔
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
aux.AddCodeList(c,12866755,12866760) aux.AddCodeList(c,12866755,12866760)
c:SetSPSummonOnce(id) --splimit
--material
aux.AddMaterialCodeList(c,12866755)
aux.AddFusionProcCodeFun(c,{12866755,s.matfilter1},s.matfilter2,1,false,false)
c:EnableReviveLimit()
--spsummon condition
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE) e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION) e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(s.splimit) e0:SetValue(s.splimit)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--equip to this
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_EQUIP) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e1:SetRange(LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,id)
e1:SetTarget(s.eqtg) e1:SetCost(aux.bfgcost)
e1:SetOperation(s.eqop) e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DESTROY) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCountLimit(1) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1,id+o)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e2:SetCost(s.spcost)
e2:SetTarget(s.destg) e2:SetTarget(s.sptg)
e2:SetOperation(s.desop) e2:SetOperation(s.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--SpecialSummon Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end end
function s.matfilter1(c) s.fusion_effect=true
return aux.IsCodeListed(c,12866755) and c:IsType(TYPE_FUSION) function s.counterfilter(c)
end return not c:IsSummonLocation(LOCATION_EXTRA) or c:IsType(TYPE_FUSION)
function s.matfilter2(c)
return c:IsAttackBelow(1000)
end end
function s.splimit(e,se,sp,st) function s.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA) or aux.fuslimit(e,se,sp,st) return se:IsHasType(EFFECT_TYPE_ACTIONS)
end end
function s.eqfilter(c,tp) function s.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:CheckUniqueOnField(tp) return c:IsFaceupEx() and c:IsCode(12866760) and c:IsAbleToHand()
end end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(s.eqfilter,tp,0,LOCATION_MZONE,1,nil,c,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,s.eqfilter,tp,0,LOCATION_MZONE,1,1,nil,c,tp)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end end
function s.eqop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.GetFirstTarget() local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then if g:GetCount()>0 then
Duel.Equip(tp,tc,c,false) Duel.SendtoHand(g,nil,REASON_EFFECT)
local e1=Effect.CreateEffect(c) Duel.ConfirmCards(1-tp,g)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(s.eqlimit)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(500)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end end
end end
function s.eqlimit(e,c) function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
return e:GetOwner()==c if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit1)
Duel.RegisterEffect(e1,tp)
end end
function s.desfilter(c,g) function s.splimit1(e,c)
return c:IsFaceup() and g:IsContains(c) return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_FUSION)
end end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.filter0(c)
local g=e:GetHandler():GetEquipGroup() return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave()
if chkc then return false end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(s.desfilter,tp,LOCATION_SZONE,0,1,nil,g)
and Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_SZONE,0,1,1,nil,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end end
function s.desop(e,tp,eg,ep,ev,re,r,rp) function s.filter1(c,e)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) return not c:IsImmuneToEffect(e)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end end
function s.spfilter(c,e,tp) function s.filter2(c,e,tp,m,f,gc,chkf)
return c:IsFaceupEx() and c:IsCode(12866760) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsType(TYPE_FUSION) and aux.IsCodeListed(c,12866755) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf)
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>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)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 local c=e:GetHandler()
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end if chk==0 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED) local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local mg2=Duel.GetMatchingGroup(s.filter0,tp,LOCATION_DECK,0,nil)
mg1:Merge(mg2)
local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
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.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local chkf=tp
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp) if not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end
if g:GetCount()>0 then local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) 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,c,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,c,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,c,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,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,c,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end end
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