Pere-Zenet Em Heru
- Card ID:
46273941 - Format: Standard
- Script:
Scripts/c46273941.lua
Stats
| Field | Value |
|---|---|
| Type | 0x80002 |
| ATK | 0 |
| DEF | 0 |
| Level/Rank/Link | 0x0 |
| Race | 0x0 |
| Attribute | 0x0 |
| Category | 0x40100 |
Card Text
text
Once per turn: You can Ritual Summon 1 "Zenet" Ritual Monster from your hand or GY, by sending Normal Monster Cards with different names from each other from your hand, Deck, and/or face-up field to the GY whose total Levels equal or exceed its Level, then you can equip 1 Normal Monster from your GY to it as an Equip Spell.
If you Special Summon a non-Token Normal Monster(s) (except during the Damage Step): You can draw 1 card.
You can only use this effect of "Pere-Zenet Em Heru" once per turn.Detected API Calls
Auxiliary.GCheckAdditionalAuxiliary.NecroValleyFilterAuxiliary.StringidAuxiliary.dncheckCard.CheckUniqueOnFieldCard.CompleteProcedureCard.GetLevelCard.GetOriginalLevelCard.GetRitualLevelCard.GetSummonPlayerCard.GetTypeCard.IsAbleToGraveCard.IsAllCardTypesCard.IsCanBeSpecialSummonedCard.IsFaceupCard.IsFaceupExCard.IsForbiddenCard.IsSetCardCard.IsTypeCard.RegisterEffectCard.SetMaterialDuel.BreakEffectDuel.DrawDuel.EquipDuel.GetChainInfoDuel.GetLocationCountDuel.GetMZoneCountDuel.GetMatchingGroupDuel.HintDuel.IsExistingMatchingCardDuel.IsPlayerCanDrawDuel.SelectMatchingCardDuel.SelectYesNoDuel.SendtoGraveDuel.SetOperationInfoDuel.SetSelectedCardDuel.SetTargetParamDuel.SetTargetPlayerDuel.SpecialSummonEffect.CreateEffect- ...and 25 more
Script
lua
--光帰葬魂の儀
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--apply
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,id)
e3:SetCondition(s.drcon)
e3:SetTarget(s.drtg)
e3:SetOperation(s.drop)
c:RegisterEffect(e3)
end
function s.getrlv(c,rc)
if c:IsType(TYPE_MONSTER) then
return c:GetRitualLevel(rc)
else
return c:GetOriginalLevel()
end
end
function s.gcheckf(tc,lv)
return function(sg,ec)
if not aux.dncheck(sg) then return false end
if ec then
return sg:GetSum(s.getrlv,tc)-s.getrlv(ec,tc)<=lv
else
return true
end
end
end
function s.RitualCheckGreater(g,c,lv,tp)
if Duel.GetMZoneCount(tp,g)<=0 then return false end
Duel.SetSelectedCard(g)
return g:CheckWithSumGreater(s.getrlv,lv,c)
end
function s.spfilter(c,e,tp,m)
if bit.band(c:GetType(),0x81)~=0x81 or not c:IsSetCard(0x1eb)
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
if c.mat_filter then
m=m:Filter(c.mat_filter,nil,tp)
end
local lv=c:GetLevel()
aux.GCheckAdditional=s.gcheckf(c,lv)
local res=m:CheckSubGroup(s.RitualCheckGreater,1,lv,c,lv,tp)
aux.GCheckAdditional=nil
return res
end
function s.matfilter(c)
return c:IsAllCardTypes(TYPE_NORMAL+TYPE_MONSTER)
and c:IsFaceupEx() and c:IsAbleToGrave()
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetMatchingGroup(s.matfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_ONFIELD,0,nil)
return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function s.eqfilter(c,tp)
return c:IsType(TYPE_NORMAL) and c:CheckUniqueOnField(tp) and not c:IsForbidden()
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
::cancel::
local mg=Duel.GetMatchingGroup(s.matfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
if tg:GetCount()>0 then
local tc=tg:GetFirst()
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,nil,tp)
end
local lv=tc:GetLevel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
aux.GCheckAdditional=s.gcheckf(tc,lv)
local mat=mg:SelectSubGroup(tp,s.RitualCheckGreater,true,1,lv,tc,lv,tp)
aux.GCheckAdditional=nil
if not mat then goto cancel end
tc:SetMaterial(mat)
Duel.SendtoGrave(mat,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
if Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.eqfilter),tp,LOCATION_GRAVE,0,1,nil,tp)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local ec=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.eqfilter),tp,LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if ec then
Duel.BreakEffect()
if not Duel.Equip(tp,ec,tc) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetLabelObject(tc)
e1:SetValue(s.eqlimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
ec:RegisterEffect(e1)
end
end
end
end
function s.eqlimit(e,c)
return c==e:GetLabelObject()
end
function s.cfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and not c:IsType(TYPE_TOKEN) and c:GetSummonPlayer()==tp
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end