Commit b631bbd8 authored by Huangnan's avatar Huangnan

fix

parent 90564f69
Pipeline #33510 passed with stages
in 42 minutes and 51 seconds
No preview for this file type
...@@ -3,13 +3,7 @@ local cm,m,o=GetID() ...@@ -3,13 +3,7 @@ local cm,m,o=GetID()
function cm.initial_effect(c) function cm.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
local e0=Effect.CreateEffect(c) aux.AddFusionProcFunRep(c,cm.ffilter,2,false)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_FUSION_MATERIAL)
e0:SetCondition(cm.fscondition())
e0:SetOperation(cm.fsoperation())
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -51,77 +45,9 @@ function cm.initial_effect(c) ...@@ -51,77 +45,9 @@ function cm.initial_effect(c)
e4:SetOperation(cm.negop) e4:SetOperation(cm.negop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function cm.ffilter(c,fc,sub,mg,sg)
function cm.fscondition() return not sg or not sg:IsExists(Card.IsFusionAttribute,1,c,c:GetFusionAttribute()) and sg:IsExists(Card.IsControler,1,nil,fc:GetControler())
return function(e,g,gc,chkf)
if g==nil then return aux.MustMaterialCheck(nil,e:GetHandlerPlayer(),EFFECT_MUST_BE_FMATERIAL) end
local c=e:GetHandler()
local mg=g:Filter(Card.IsCanBeFusionMaterial,nil,c)
local tp=e:GetHandlerPlayer()
return mg:GetClassCount(Card.GetAttribute)>=2 and mg:IsExists(Card.IsControler,1,nil,tp)
end
end
function cm.racefilter(c,sg,fc)
return not sg:IsExists(Card.IsAttribute,1,nil,c:GetAttribute()) and Duel.GetLocationCountFromEx(tp,tp,c,fc)>0
end end
function cm.racefilter0(c,sg,fc,tp)
return not sg:IsExists(Card.IsAttribute,1,nil,c:GetAttribute()) and Duel.GetLocationCountFromEx(tp,tp,c,fc)>0 and c:IsControler(tp)
end
function cm.fsoperation()
return function(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
local c=e:GetHandler()
local mg=eg:Filter(Card.IsCanBeFusionMaterial,nil,c)
if mg:GetClassCount(Card.GetAttribute)<2 then return end
local sg=Group.CreateGroup()
if gc then sg:AddCard(gc) end
while sg:FilterCount(Card.IsControler,nil,tp)<3 do
local cg=mg:Filter(cm.racefilter0,nil,sg,c,tp)
if cg:GetCount()==0 then break end
local cancel_group=sg:Clone()
if gc then cancel_group:RemoveCard(gc) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local tc=cg:SelectUnselect(cancel_group,tp,false,false,2,2)
if not tc then break end
if sg:IsContains(tc) then
sg:RemoveCard(tc)
else
sg:AddCard(tc)
end
end
while sg:GetCount()<4 do
local cg=mg:Filter(cm.racefilter,nil,sg,c)
if cg:GetCount()==0 then break end
local cancel_group=sg:Clone()
if gc then cancel_group:RemoveCard(gc) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local tc=cg:SelectUnselect(cancel_group,tp,false,false,2,2)
if not tc then break end
if sg:IsContains(tc) then
sg:RemoveCard(tc)
else
sg:AddCard(tc)
end
end
while sg:GetCount()<99 do
local button=true
local cg=mg:Filter(cm.racefilter,nil,sg,c)
if cg:GetCount()==0 then break end
local cancel_group=sg:Clone()
if gc then cancel_group:RemoveCard(gc) end
if sg:GetCount()<3 then button=false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local tc=cg:SelectUnselect(cancel_group,tp,button,false,2,2)
if not tc then break end
if sg:IsContains(tc) then
sg:RemoveCard(tc)
else
sg:AddCard(tc)
end
end
Duel.SetFusionMaterial(sg)
end
end
function cm.splimit(e,se,sp,st) function cm.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA) return not e:GetHandler():IsLocation(LOCATION_EXTRA)
or st&SUMMON_TYPE_FUSION==SUMMON_TYPE_FUSION or st&SUMMON_TYPE_FUSION==SUMMON_TYPE_FUSION
......
...@@ -84,7 +84,7 @@ function cm.spcon2(e,tp,eg,ep,ev,re,r,rp) ...@@ -84,7 +84,7 @@ function cm.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.filter6,tp,0,LOCATION_MZONE+LOCATION_GRAVE,3,nil) return Duel.IsExistingMatchingCard(cm.filter6,tp,0,LOCATION_MZONE+LOCATION_GRAVE,3,nil)
end end
function cm.exfilter(c) function cm.exfilter(c)
return c:IsSetCard(0x820) and c:IsAbleToRemove() return c:IsSetCard(0x820) and c:IsAbleToRemove() and c:IsType(TYPE_MONSTER)
end end
function cm.extg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.extg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil) end
......
...@@ -23,7 +23,7 @@ function VHisc_ESP.spcon(e,c) ...@@ -23,7 +23,7 @@ function VHisc_ESP.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()
local g=Duel.GetMatchingGroup(VHisc_ESP.spfilter,tp,LOCATION_REMOVED,0,nil) local g=Duel.GetMatchingGroup(VHisc_ESP.spfilter,tp,LOCATION_REMOVED,0,nil)
return g:GetCount()>0 and (c:IsLocation(LOCATION_HAND+LOCATION_GRAVE) or (VHisc_CardType==222 and c:IsLocation(LOCATION_DECK) and Duel.GetFlagEffect(tp,33201550)==0)) return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and g:GetCount()>0 and (c:IsLocation(LOCATION_HAND+LOCATION_GRAVE) or (VHisc_CardType==222 and c:IsLocation(LOCATION_DECK) and Duel.GetFlagEffect(tp,33201550)==0))
end end
function VHisc_ESP.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c) function VHisc_ESP.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(VHisc_ESP.spfilter,tp,LOCATION_REMOVED,0,nil) local g=Duel.GetMatchingGroup(VHisc_ESP.spfilter,tp,LOCATION_REMOVED,0,nil)
......
...@@ -67,7 +67,7 @@ function cm.atkfilter(c) ...@@ -67,7 +67,7 @@ function cm.atkfilter(c)
return c:IsFaceup() and c:IsRace(RACE_WINDBEAST) and c:IsType(TYPE_SYNCHRO+TYPE_XYZ) return c:IsFaceup() and c:IsRace(RACE_WINDBEAST) and c:IsType(TYPE_SYNCHRO+TYPE_XYZ)
end end
function cm.atkcon(e) function cm.atkcon(e)
return Duel.GetMatchingGroupCount(cm.atkfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil)>0 return Duel.GetMatchingGroupCount(cm.atkfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,e:GetHandler())>0
end end
--tohand --tohand
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -59,19 +59,19 @@ function cm.thfilter(c) ...@@ -59,19 +59,19 @@ function cm.thfilter(c)
return c:IsFaceup() and c:IsSetCard(0xef1) and c:IsAbleToHand() return c:IsFaceup() and c:IsSetCard(0xef1) and c:IsAbleToHand()
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and cm.spfilter(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and cm.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil,e,tp) and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,nil,e,tp)
and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_MZONE,0,1,nil) end and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_ONFIELD)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then if #g>0 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
......
...@@ -78,19 +78,18 @@ function cm.filter(c,e,tp) ...@@ -78,19 +78,18 @@ function cm.filter(c,e,tp)
end end
function cm.negtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.filter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end end
function cm.negop(e,tp,eg,ep,ev,re,r,rp) function cm.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not e:GetHandler():IsRelateToEffect(e) then return end
if tc:IsRelateToEffect(e) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.BreakEffect() Duel.BreakEffect()
Duel.SendtoHand(c,nil,REASON_EFFECT) Duel.SendtoHand(c,nil,REASON_EFFECT)
end end
......
...@@ -99,15 +99,17 @@ function cm.pentg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -99,15 +99,17 @@ function cm.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function cm.penop(e,tp,eg,ep,ev,re,r,rp) function cm.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ct1=Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_EXTRA,0,nil,TYPE_MONSTER) if c:IsRelateToEffect(e) then
local ct2=Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_EXTRA,nil,TYPE_MONSTER)
local ct=ct2-ct1
if c:IsRelateToEffect(e) and ct>0 then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
Duel.BreakEffect() Duel.BreakEffect()
local ct1=Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_EXTRA,0,nil,TYPE_MONSTER)
local ct2=Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_EXTRA,nil,TYPE_MONSTER)
local ct=ct1-ct2
if ct>0 then
local val=Duel.Recover(tp,ct*400,REASON_EFFECT) local val=Duel.Recover(tp,ct*400,REASON_EFFECT)
Duel.Damage(1-tp,val,REASON_EFFECT) Duel.Damage(1-tp,val,REASON_EFFECT)
end end
end
end end
--atkup --atkup
function cm.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -17,6 +17,7 @@ function cm.initial_effect(c) ...@@ -17,6 +17,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--set --set
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)--场上变化触发+诱发选发效果 e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)--场上变化触发+诱发选发效果
e2:SetCode(EVENT_CHAINING)--效果发动时 e2:SetCode(EVENT_CHAINING)--效果发动时
e2:SetRange(LOCATION_GRAVE)--墓地区域 e2:SetRange(LOCATION_GRAVE)--墓地区域
......
...@@ -17,6 +17,7 @@ function cm.initial_effect(c) ...@@ -17,6 +17,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--set --set
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)--场上变化触发+诱发选发效果 e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)--场上变化触发+诱发选发效果
e2:SetCode(EVENT_CHAINING)--效果发动时 e2:SetCode(EVENT_CHAINING)--效果发动时
e2:SetRange(LOCATION_GRAVE)--墓地区域 e2:SetRange(LOCATION_GRAVE)--墓地区域
......
...@@ -16,6 +16,7 @@ function cm.initial_effect(c) ...@@ -16,6 +16,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--set --set
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)--场上变化触发+诱发选发效果 e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)--场上变化触发+诱发选发效果
e2:SetCode(EVENT_CHAINING)--效果发动时 e2:SetCode(EVENT_CHAINING)--效果发动时
e2:SetRange(LOCATION_GRAVE)--墓地区域 e2:SetRange(LOCATION_GRAVE)--墓地区域
......
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