Commit 038fe908 authored by GuGu's avatar GuGu

Update c24138.lua 重写检测

parent 5af929b2
Pipeline #21625 passed with stage
in 1 minute and 27 seconds
......@@ -21,7 +21,7 @@ function c24138.initial_effect(c)
c:RegisterEffect(e2)
end
function c24138.filter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_FUSION) and c:IsReleasableByEffect() --and c:GetMaterial():FilterCount(c24138.exfilter,nil,e,tp,c)>0
return c:IsFaceup() and c:IsType(TYPE_FUSION) and c:IsReleasableByEffect() and Duel.GetMZoneCount(tp,c)>0
end
function c24138.exfilter(c,e,tp,fusc)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) and c:GetReasonCard()==fusc and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......@@ -32,32 +32,42 @@ function c24138.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c24138.mgfilter(c,e,tp,fusc,mg)
return c:IsControler(tp) and c:IsLocation(LOCATION_GRAVE)
and bit.band(c:GetReason(),0x40008)==0x40008 and c:GetReasonCard()==fusc
and c:GetReason()&(REASON_FUSION+REASON_MATERIAL)==(REASON_FUSION+REASON_MATERIAL) and c:GetReasonCard()==fusc
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and fusc:CheckFusionMaterial(mg,c,PLAYER_NONE,true)
end
function c24138.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c24138.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp)
if g:GetCount()==0 then return end
local tc=g:GetFirst()
local mg=tc:GetMaterial()
local ct=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=mg:GetCount()
local sumtype=tc:GetSummonType()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
if tc and Duel.Release(tc,REASON_EFFECT)~=0 and bit.band(sumtype,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
and ct>0 and mg:FilterCount(aux.NecroValleyFilter(c24138.mgfilter),nil,e,tp,tc,mg)>0
and ct>0 and mg:FilterCount(aux.NecroValleyFilter(c24138.mgfilter),nil,e,tp,tc,mg)==ct
and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
local g=mg:FilterSelect(tp,c24138.mgfilter,ct,ct,nil,e,tp,tc,mg)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local hg=g:Filter(Card.IsAttribute,nil,0x7b)
local hc=hg:GetFirst()
while hc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(hc:GetAttack()/2)
e1:SetReset(RESET_EVENT+0xfe0000)
hc:RegisterEffect(e1)
hc=hg:GetNext()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g2=nil
if mg:GetCount()>ft then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
g2=mg:FilterSelect(tp,c24138.mgfilter,ft,ft,nil,e,tp,tc,mg)
else
g2=mg:Filter(c24138.mgfilter,nil,e,tp,tc,mg)
end
if g2:GetCount()>0 then
Duel.SpecialSummon(g2,0,tp,tp,false,false,POS_FACEUP)
local hg=g2:Filter(Card.IsAttribute,nil,0x7b)
local hc=hg:GetFirst()
while hc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(hc:GetAttack()/2)
e1:SetReset(RESET_EVENT+0xfe0000)
hc:RegisterEffect(e1)
hc=hg:GetNext()
end
end
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