Commit 523b2a06 authored by Vury Leo's avatar Vury Leo

init ジェムナイト・ディスパージョン

parent dd3882cc
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
aux.AddCodeList(c,1264319) aux.AddCodeList(c,1264319)
local e0=FusionSpell.CreateSummonEffect(c,{
fusfilter=s.fusfilter,
pre_select_mat_location=s.pre_select_mat_location,
additional_fcheck=s.fcheck
})
--Activate 1 --Activate 1
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
...@@ -10,28 +15,46 @@ function s.initial_effect(c) ...@@ -10,28 +15,46 @@ function s.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
e1:SetLabelObject(e0)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.filter0(c) function s.filter0(c)
return c:IsSetCard(0x1047) and not c:IsRace(RACE_ROCK) return c:IsSetCard(0x1047) and not c:IsRace(RACE_ROCK)
and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave() and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave()
end end
function s.filter1(c,e)
return not c:IsImmuneToEffect(e) function s.fusfilter(c)
return c:IsSetCard(0x1047)
end end
function s.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x1047) and (not f or f(c)) --- @type FUSION_SPELL_PRE_SELECT_MAT_LOCATION_FUNCTION
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) function s.pre_select_mat_location(tc,tp)
local location=LOCATION_HAND|LOCATION_MZONE
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,1264319) then
location=location|LOCATION_DECK|LOCATION_EXTRA
end
return location
end end
function s.thfilter(c) function s.thfilter(c)
return c:IsFaceupEx() and c:IsSetCard(0x47) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsFaceupEx() and c:IsSetCard(0x47) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
function s.fcheck(tp,sg,fc)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)<=2 --- @type FUSION_FGCHECK_FUNCTION
end function s.fcheck(tp,mg,fc,all_mg)
function s.gcheck(sg) --- if we have this, we already know there is ジェムナイト・フュージョン in GY
return sg:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)<=2 local mg_deck=mg:Filter(function(c) return c:IsLocation(LOCATION_DECK|LOCATION_EXTRA) end,nil)
--- Up to 2 monsters from your Deck/Extra Deck can be used,
if #mg_deck>2 then
return false
end
--- Only if they are non-Rock "Gem-Knight" monsters
if mg_deck:IsExists(function(c) return c:IsRace(RACE_ROCK) end,1,nil) then
return false
end
return true
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e) local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e)
......
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