Commit adf62fb6 authored by Huangnan's avatar Huangnan

fix

parent 40062d0e
Pipeline #34085 passed with stages
in 60 minutes and 18 seconds
No preview for this file type
...@@ -17,7 +17,7 @@ function cm.initial_effect(c) ...@@ -17,7 +17,7 @@ function cm.initial_effect(c)
e2:SetDescription(aux.Stringid(m,1)) e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PAY_LPCOST) e2:SetCode(EVENT_PAY_LPCOST)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,m+100) e2:SetCountLimit(1,m+100)
e2:SetCondition(cm.tgcon) e2:SetCondition(cm.tgcon)
e2:SetOperation(cm.tgop) e2:SetOperation(cm.tgop)
......
...@@ -28,15 +28,7 @@ function cm.initial_effect(c) ...@@ -28,15 +28,7 @@ function cm.initial_effect(c)
e3:SetOperation(cm.scop) e3:SetOperation(cm.scop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DESTROY+CATEGORY_RECOVER)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_DESTROYED)
e4:SetCountLimit(1,m+2)
e4:SetTarget(cm.target)
e4:SetOperation(cm.operation)
c:RegisterEffect(e4)
end end
...@@ -70,65 +62,83 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -70,65 +62,83 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.fgoal(sg) function cm.synfilter(c,tp)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_HAND)<=1 local grave_cond=Duel.IsExistingMatchingCard(Card.IsRace,tp,LOCATION_GRAVE,0,5,nil,RACE_DINOSAUR)
end local mg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
function cm.rafilter(c)
return (c:IsRace(RACE_DINOSAUR+RACE_DRAGON+RACE_SEASERPENT+RACE_WYRM) and c:IsLocation(LOCATION_HAND)) or c:IsType(TYPE_MONSTER) -- 生成所有可能素材组合
end local combinations = {mg}
function cm.syfilter(c) if grave_cond then
if Duel.IsExistingMatchingCard(Card.IsRace,tp,LOCATION_GRAVE,0,5,nil,RACE_DINOSAUR) then local hand_group = Duel.GetMatchingGroup(cm.handfilter,tp,LOCATION_HAND,0,nil)
local mg=Duel.GetMatchingGroup(cm.rafilter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil) for hc in aux.Next(hand_group) do
local fg=mg:Filter(cm.fgoal,nil) local temp = mg:Clone()
return c:IsSynchroSummonable(nil,fg) temp:AddCard(hc)
else table.insert(combinations, temp)
return c:IsSynchroSummonable(nil) end
end
-- 检查所有组合可能性
for _,comb in ipairs(combinations) do
if c:IsSynchroSummonable(nil,comb) then
return true
end
end end
end return false
end
function cm.sctg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.syfilter,tp,LOCATION_EXTRA,0,1,nil,nil) end if chk==0 then
return Duel.IsExistingMatchingCard(cm.synfilter,tp,LOCATION_EXTRA,0,1,nil,tp)
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 cm.scop(e,tp,eg,ep,ev,re,r,rp) function cm.scop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.syfilter,tp,LOCATION_EXTRA,0,nil,nil) local grave_cond=Duel.IsExistingMatchingCard(Card.IsRace,tp,LOCATION_GRAVE,0,5,nil,RACE_DINOSAUR)
if g:GetCount()>0 then local mg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
if Duel.IsExistingMatchingCard(Card.IsRace,tp,LOCATION_GRAVE,0,5,nil,RACE_DINOSAUR) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) -- 选择同调怪兽
local mg=Duel.GetMatchingGroup(cm.rafilter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local fg=mg:Filter(cm.fgoal,nil) local g=Duel.GetMatchingGroup(cm.synfilter,tp,LOCATION_EXTRA,0,nil,tp)
local sg=g:Select(tp,1,1,nil) if #g==0 then return end
Duel.SynchroSummon(tp,sg:GetFirst(),nil,fg) local tc=g:Select(tp,1,1,nil):GetFirst()
else if not tc then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil) local valid_hands=Group.CreateGroup()
Duel.SynchroSummon(tp,sg:GetFirst(),nil) if grave_cond then
local hand_group=Duel.GetMatchingGroup(cm.handfilter,tp,LOCATION_HAND,0,nil)
for hc in aux.Next(hand_group) do
local temp_mg=mg:Clone()
temp_mg:AddCard(hc)
if tc:IsSynchroSummonable(nil,temp_mg) then
valid_hands:AddCard(hc)
end
end end
end end
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,0)
e4:SetTarget(cm.splimit2)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end
function cm.splimit2(e,c)
return c:IsLocation(LOCATION_EXTRA) and not c:IsRace(RACE_DINOSAUR+RACE_DRAGON+RACE_SEASERPENT+RACE_WYRM)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then local final_mg=mg:Clone()
return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 if valid_hands:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
if valid_hands:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
valid_hands=valid_hands:Select(tp,1,1,nil)
end
final_mg:Merge(valid_hands)
end end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) -- 最终同调召唤
local tc=Duel.GetDecktopGroup(tp,1):GetFirst() final_mg=final_mg:Filter(Card.IsCanBeSynchroMaterial,nil,tc)
if not tc then return end Duel.SynchroSummon(tp,tc,nil,final_mg)
if Duel.Destroy(tc,REASON_EFFECT)>0 and tc:IsRace(RACE_DINOSAUR) then local e1=Effect.CreateEffect(c)
Duel.Recover(tp,500) e1:SetType(EFFECT_TYPE_FIELD)
end e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(function(e,c)
return c:IsLocation(LOCATION_EXTRA) and
not c:IsRace(RACE_DINOSAUR+RACE_DRAGON+RACE_SEASERPENT+RACE_WYRM)
end)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment