chevalierx
2018-08-31T15:37:52Z
i make card is work fine without issue
but it link 2 and even both zone point have monster i can use effect ( that fusion summon from hand or grave or banish zone ) the effect trigget and the fusion monster is send to grave because no zone point to summon
i need nly that part of check

this script

--Cosmic Hero nova
function c903.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2,c903.lcheck)
c:EnableReviveLimit()

--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(903,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,903)
e1:SetCondition(c903.thcon)
e1:SetTarget(c903.thtg)
e1:SetOperation(c903.thop)
c:RegisterEffect(e1)
--fusion summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(903,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,903)
e2:SetTarget(c903.target)
e2:SetOperation(c903.activate)
c:RegisterEffect(e2)

local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(c903.indtg)
e3:SetValue(1)
c:RegisterEffect(e3)

local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_TO_DECK)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,0)
e4:SetTarget(c903.indtg)
c:RegisterEffect(e4)
end
function c903.lcheck(g,lc)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x1f)
end
function c903.indtg(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c) and c:IsSetCard(0x3008) and c:IsType(TYPE_FUSION)
end
function c903.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c903.thfilter(c)
return c:IsCode(89943723) and c:IsAbleToHand()
end
function c903.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c903.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c903.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c903.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c903.filter1(c,e)
return c:IsAbleToDeck() and c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e)
end
function c903.filter2(c,e,tp,m,chkf)
return (c:IsSetCard(0x3008) and aux.IsMaterialListCode(c,89943723)) or c:IsSetCard(0x3008)
and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c903.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg=Duel.GetMatchingGroup(c903.filter1,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e)
return Duel.IsExistingMatchingCard(c903.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,chkf)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c903.cffilter(c)
return c:IsLocation(LOCATION_HAND) or (c:IsLocation(LOCATION_REMOVED) and c:IsFacedown())
end
function c903.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c903.filter1),tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e)
local sg=Duel.GetMatchingGroup(c903.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg,chkf)
if sg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
local mat=Duel.SelectFusionMaterial(tp,tc,mg,nil,chkf)
local cf=mat:Filter(c903.cffilter,nil)
if cf:GetCount()>0 then
Duel.ConfirmCards(1-tp,cf)
end
Duel.SendtoDeck(mat,nil,2,REASON_EFFECT)
Duel.BreakEffect()
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc:CompleteProcedure()
end
end


Zyrael
2018-09-23T13:05:50Z
Use: "Duel.GetLocationCountFromEx(tp)>0"