Commit a217e3bb authored by Huangnan's avatar Huangnan

fix

parent 1bb8075a
Pipeline #39978 failed with stages
in 3 minutes and 46 seconds
...@@ -35,50 +35,28 @@ function cm.initial_effect(c) ...@@ -35,50 +35,28 @@ function cm.initial_effect(c)
e4:SetTarget(cm.thtg2) e4:SetTarget(cm.thtg2)
e4:SetOperation(cm.thop2) e4:SetOperation(cm.thop2)
c:RegisterEffect(e4) c:RegisterEffect(e4)
if not cm.check then if not aux.checkxyzfusionhack then
cm.check=true aux.checkxyzfusionhack=true
local e1=Effect.CreateEffect(c) _hack_fusion_check=Card.CheckFusionMaterial
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetOperation(cm.chainop)
Duel.RegisterEffect(e1,0)
local _CheckFusionMaterial=Card.CheckFusionMaterial
local _SelectFusionMaterial=Duel.SelectFusionMaterial
function Card.CheckFusionMaterial(card,Group_fus,Card_g,int_chkf,not_mat) function Card.CheckFusionMaterial(card,Group_fus,Card_g,int_chkf,not_mat)
local tp=card:GetControler() local exg_temp=Duel.GetMatchingGroup(cm.getexc,int_chkf,0,LOCATION_MZONE+LOCATION_GRAVE,nil)
local exg=Duel.GetMatchingGroup(cm.filter0,tp,0,LOCATION_MZONE+LOCATION_GRAVE,nil,card) local exg=Group.CreateGroup()
exg:Sub(Group_fus) if exg_temp:GetCount()>0 then
if #exg>0 and Duel.GetFlagEffect(tp,18700544)>0 then exg:Merge(exg_temp)
local hg=Group.__add(Group_fus,exg)
return _CheckFusionMaterial(card,hg,Card_g,int_chkf,not_mat)
end
return _CheckFusionMaterial(card,Group_fus,Card_g,int_chkf,not_mat)
end
function Duel.SelectFusionMaterial(tp,card,mg,gc_nil,chkf)
if Duel.GetFlagEffect(tp,18700544)>0 then
local exg=Duel.GetMatchingGroup(cm.filter0,tp,0,LOCATION_MZONE+LOCATION_GRAVE,nil,card)
mg:Merge(exg)
end end
return _SelectFusionMaterial(tp,card,mg,gc_nil,chkf) if exg:GetCount()>0 then
Group_fus:Merge(exg)
end end
return _hack_fusion_check(card,Group_fus,Card_g,int_chkf,not_mat)
end end
end
function cm.chainop(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandlerPlayer()==tp then
Duel.RegisterFlagEffect(tp,m,RESET_CHAIN,0,1)
end end
end end
function cm.getexc(c)
function cm.filter0(c,fc) return c:GetFlagEffect(18700544)>0 and c:IsFaceup()
return c:IsCanBeFusionMaterial(fc)
and c:GetFlagEffect(18700544)>0
and c:IsLocation(LOCATION_MZONE+LOCATION_GRAVE)
end end
function cm.thfilter2(c) function cm.thfilter2(c)
return c:IsType(TYPE_MONSTER) return c:IsType(TYPE_MONSTER)
end end
...@@ -132,7 +110,6 @@ function cm.thop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -132,7 +110,6 @@ function cm.thop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(m,4)) then if Duel.SelectYesNo(tp,aux.Stringid(m,4)) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,3)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,3))
local tc=Duel.SelectMatchingCard(tp,cm.effilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil):GetFirst() local tc=Duel.SelectMatchingCard(tp,cm.effilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil):GetFirst()
Duel.HintSelection(Group.FromCards(tc))
tc:RegisterFlagEffect(m,RESET_PHASE+PHASE_END,0,1) tc:RegisterFlagEffect(m,RESET_PHASE+PHASE_END,0,1)
end end
end end
...@@ -60,8 +60,8 @@ function cm.teop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,8 +60,8 @@ function cm.teop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then if g:GetCount()>0 then
local b1=not g:GetFirst():IsForbidden() local b1=not g:GetFirst():IsForbidden()
local op=aux.SelectFromOptions(tp, local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(m,1)}, {b1,aux.Stringid(m,2)},
{true,aux.Stringid(m,2)}) {true,aux.Stringid(m,1)})
if op==1 then if op==1 then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true) Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end end
......
...@@ -4,16 +4,17 @@ function cm.initial_effect(c) ...@@ -4,16 +4,17 @@ function cm.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,cm.mfilter0,aux.FilterBoolFunction(Card.IsRace,RACE_AQUA),2,true) aux.AddFusionProcCodeFun(c,cm.mfilter0,aux.FilterBoolFunction(Card.IsRace,RACE_AQUA),2,true)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(cm.fuscon) e1:SetCondition(cm.fuscon)
e1:SetCost(cm.rmcost) e1:SetCost(cm.rmcost)
e1:SetOperation(cm.fusop) e1:SetOperation(cm.fusop)
e1:SetCountLimit(1,o) e1:SetCountLimit(1,o)
c:RegisterEffect(e1) c:RegisterEffect(e1)
-- ②效果
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
...@@ -23,7 +24,6 @@ function cm.initial_effect(c) ...@@ -23,7 +24,6 @@ function cm.initial_effect(c)
e2:SetTarget(cm.tgfilter) e2:SetTarget(cm.tgfilter)
e2:SetValue(1) e2:SetValue(1)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
...@@ -33,14 +33,14 @@ function cm.initial_effect(c) ...@@ -33,14 +33,14 @@ function cm.initial_effect(c)
e3:SetValue(1) e3:SetValue(1)
c:RegisterEffect(e3) c:RegisterEffect(e3)
-- ③效果
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1)) e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_REMOVE) e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN) e4:SetCode(EVENT_FREE_CHAIN)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,o+1) e4:SetCountLimit(1,m+1)
e4:SetTarget(cm.exctg) e4:SetTarget(cm.exctg)
e4:SetOperation(cm.excop) e4:SetOperation(cm.excop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
...@@ -96,20 +96,22 @@ end ...@@ -96,20 +96,22 @@ end
function cm.tgfilter(e,c) function cm.tgfilter(e,c)
return c:IsRace(RACE_AQUA) and c:IsLevelBelow(9) return c:IsRace(RACE_AQUA) and c:IsLevelBelow(9)
end end
function cm.exfilter(c)
return c:IsRace(RACE_AQUA) and c:IsFaceup()
end
function cm.exctg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.exctg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct1=Duel.GetMatchingGroupCount(Card.IsRace,tp,0,LOCATION_MZONE+LOCATION_GRAVE,nil,RACE_AQUA) local ct1=Duel.GetMatchingGroupCount(cm.exfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,nil)
local ct=math.max(1,ct1) local ct=math.max(1,ct1)
if chk==0 then return ct>0 and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return ct>0 and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,ct,nil) local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,ct,1-tp,LOCATION_ONFIELD+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,ct,1-tp,LOCATION_ONFIELD)
end end
-- ③效果处理
function cm.excop(e,tp,eg,ep,ev,re,r,rp) function cm.excop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if tc:IsRelateToEffect(e) then local tg=g:Filter(Card.IsRelateToEffect,nil,e)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) if tg:GetCount()>0 then
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end end
end end
--深红诞地之心 --深红诞地之心
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
local e1=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e0:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1) c:RegisterEffect(e0)
-- --
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
...@@ -76,6 +76,7 @@ function s.cond3(e,tp,eg,ep,ev,re,r,rp) ...@@ -76,6 +76,7 @@ function s.cond3(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end end
function s.tg3(e,tp,eg,ep,ev,re,r,rp,chk) function s.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
tp=e:GetOwnerPlayer()
local b1=Duel.IsExistingMatchingCard(s.spfilter1,tp,LOCATION_DECK,0,1,nil) local b1=Duel.IsExistingMatchingCard(s.spfilter1,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,3,nil) local b2=Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,3,nil)
if chk==0 then if chk==0 then
......
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