Commit 4252d8c7 authored by wind2009's avatar wind2009

format

parent ede97397
Pipeline #42979 passed with stages
in 5 minutes and 26 seconds
--閉ザサレシ世界ノ冥神 --閉ザサレシ世界ノ冥神
local s,id,o=GetID() function c98127546.initial_effect(c)
function s.initial_effect(c)
--link summon --link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),4) aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),4)
c:EnableReviveLimit() c:EnableReviveLimit()
...@@ -11,18 +10,18 @@ function s.initial_effect(c) ...@@ -11,18 +10,18 @@ function s.initial_effect(c)
e1:SetCode(EFFECT_EXTRA_LINK_MATERIAL) e1:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e1:SetRange(LOCATION_EXTRA) e1:SetRange(LOCATION_EXTRA)
e1:SetTargetRange(0,LOCATION_MZONE) e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(s.matval) e1:SetValue(c98127546.matval)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--disable --disable
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0)) e2:SetDescription(aux.Stringid(98127546,0))
e2:SetCategory(CATEGORY_DISABLE) e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(s.discon) e2:SetCondition(c98127546.discon)
e2:SetTarget(s.distg) e2:SetTarget(c98127546.distg)
e2:SetOperation(s.disop) e2:SetOperation(c98127546.disop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--immune --immune
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
...@@ -30,30 +29,29 @@ function s.initial_effect(c) ...@@ -30,30 +29,29 @@ function s.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_IMMUNE_EFFECT) e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetCondition(s.immcon) e3:SetCondition(c98127546.immcon)
e3:SetValue(s.efilter) e3:SetValue(c98127546.efilter)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--negate --negate
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1)) e4:SetDescription(aux.Stringid(98127546,1))
e4:SetCategory(CATEGORY_NEGATE) e4:SetCategory(CATEGORY_NEGATE)
e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING) e4:SetCode(EVENT_CHAINING)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1) e4:SetCountLimit(1)
e4:SetCondition(s.negcon) e4:SetCondition(c98127546.negcon)
e4:SetTarget(s.negtg) e4:SetTarget(c98127546.negtg)
e4:SetOperation(s.negop) e4:SetOperation(c98127546.negop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c98127546.is_external_exmat(c,lc,mg,tp)
function s.is_external_exmat(c,lc,mg,tp)
local le={c:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL,tp)} local le={c:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL,tp)}
for _,te in ipairs(le) do for _,te in ipairs(le) do
local h=te:GetHandler() local h=te:GetHandler()
-- external = any ex-mat effect not created by 閉ザサレシ世界ノ冥神 herself -- external = any ex-mat effect not created by 閉ザサレシ世界ノ冥神 herself
if h and not h:IsCode(id) then if h and not h:IsCode(98127546) then
local f=te:GetValue() local f=te:GetValue()
if f then if f then
local related,valid=f(te,lc,mg,c,tp) local related,valid=f(te,lc,mg,c,tp)
...@@ -65,45 +63,38 @@ function s.is_external_exmat(c,lc,mg,tp) ...@@ -65,45 +63,38 @@ function s.is_external_exmat(c,lc,mg,tp)
end end
return false return false
end end
function c98127546.is_goddess_opp(mc,lc,mg,tp)
function s.is_goddess_opp(mc,lc,mg,tp) return mc:IsControler(1-tp) and not c98127546.is_external_exmat(mc,lc,mg,tp)
return mc:IsControler(1-tp) and not s.is_external_exmat(mc,lc,mg,tp)
end end
function c98127546.matval(e,lc,mg,c,tp)
function s.matval(e,lc,mg,c,tp)
-- Only while Link Summoning this card -- Only while Link Summoning this card
if e:GetHandler()~=lc then return false,nil end if e:GetHandler()~=lc then return false,nil end
-- 閉ザサレシ世界ノ冥神 only concerns opponent monsters -- 閉ザサレシ世界ノ冥神 only concerns opponent monsters
if not c:IsControler(1-tp) then return false,nil end if not c:IsControler(1-tp) then return false,nil end
-- related=true -- related=true
if not mg then if not mg then
return true,true return true,true
end end
-- If this opponent monster is already permitted by some OTHER ex-mat effect, -- If this opponent monster is already permitted by some OTHER ex-mat effect,
-- 閉ザサレシ世界ノ冥神 should not block it and should not count it as "her 1". -- 閉ザサレシ世界ノ冥神 should not block it and should not count it as "her 1".
if s.is_external_exmat(c,lc,mg,tp) then if c98127546.is_external_exmat(c,lc,mg,tp) then
return true,true return true,true
end end
-- Otherwise this would be "via 閉ザサレシ世界ノ冥神": allow at most one such opponent monster. -- Otherwise this would be "via 閉ザサレシ世界ノ冥神": allow at most one such opponent monster.
if mg:IsExists(s.is_goddess_opp,1,c,lc,mg,tp) then if mg:IsExists(c98127546.is_goddess_opp,1,c,lc,mg,tp) then
return true,false return true,false
end end
return true,true return true,true
end end
function c98127546.discon(e,tp,eg,ep,ev,re,r,rp)
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) function c98127546.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.NegateMonsterFilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(aux.NegateMonsterFilter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(aux.NegateMonsterFilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(aux.NegateMonsterFilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0)
end end
function s.disop(e,tp,eg,ep,ev,re,r,rp) function c98127546.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NegateMonsterFilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(aux.NegateMonsterFilter,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
while tc do while tc do
...@@ -124,27 +115,27 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -124,27 +115,27 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp)
tc=g:GetNext() tc=g:GetNext()
end end
end end
function s.immcon(e) function c98127546.immcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end end
function s.efilter(e,te) function c98127546.efilter(e,te)
if te:GetOwnerPlayer()==e:GetHandlerPlayer() or not te:IsActivated() then return false end if te:GetOwnerPlayer()==e:GetHandlerPlayer() or not te:IsActivated() then return false end
if not te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return true end if not te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return true end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
return not g or not g:IsContains(e:GetHandler()) return not g or not g:IsContains(e:GetHandler())
end end
function s.cfilter(c) function c98127546.cfilter(c)
return c:IsLocation(LOCATION_GRAVE) and c:IsType(TYPE_MONSTER) return c:IsLocation(LOCATION_GRAVE) and c:IsType(TYPE_MONSTER)
end end
function s.negcon(e,tp,eg,ep,ev,re,r,rp) function c98127546.negcon(e,tp,eg,ep,ev,re,r,rp)
local ex,g,gc,dp,dv=Duel.GetOperationInfo(ev,CATEGORY_SPECIAL_SUMMON) local ex,g,gc,dp,dv=Duel.GetOperationInfo(ev,CATEGORY_SPECIAL_SUMMON)
return Duel.IsChainNegatable(ev) and rp==1-tp return Duel.IsChainNegatable(ev) and rp==1-tp
and (ex and (dv&LOCATION_GRAVE==LOCATION_GRAVE or g and g:IsExists(s.cfilter,1,nil)) or re:IsHasCategory(CATEGORY_GRAVE_SPSUMMON)) and (ex and (dv&LOCATION_GRAVE==LOCATION_GRAVE or g and g:IsExists(c98127546.cfilter,1,nil)) or re:IsHasCategory(CATEGORY_GRAVE_SPSUMMON))
end end
function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk) function c98127546.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end end
function s.negop(e,tp,eg,ep,ev,re,r,rp) function c98127546.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev) Duel.NegateActivation(ev)
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