静寂虫
このカードは召喚・反転召喚に成功した場合守備表示になる。
このカードがフィールド上に表側表示で存在する限り、永続魔法・永続罠カードの効果を無効にする。
local s, id, o = GetID()
function s.initial_effect(c)
	--to defense
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_POSITION)
	e1:SetType(EFFECT_TYPE_TRIGGER_F + EFFECT_TYPE_SINGLE)
	e1:SetCode(EVENT_SUMMON_SUCCESS)
	e1:SetTarget(s.postg)
	e1:SetOperation(s.posop)
	c:RegisterEffect(e1)
	local e2 = e1:Clone()
	e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
	c:RegisterEffect(e2)
	--disable
	local e3 = Effect.CreateEffect(c)
	e3:SetType(EFFECT_TYPE_FIELD)
	e3:SetCode(EFFECT_DISABLE)
	e3:SetRange(LOCATION_MZONE)
	e3:SetTargetRange(LOCATION_SZONE, LOCATION_SZONE)
	e3:SetTarget(s.distarget)
	c:RegisterEffect(e3)
	--disable effect
	local e4 = Effect.CreateEffect(c)
	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
	e4:SetCode(EVENT_CHAIN_SOLVING)
	e4:SetRange(LOCATION_MZONE)
	e4:SetOperation(s.disop)
	c:RegisterEffect(e4)
	--disable trap monster
	local e5 = Effect.CreateEffect(c)
	e5:SetType(EFFECT_TYPE_FIELD)
	e5:SetCode(EFFECT_DISABLE_TRAPMONSTER)
	e5:SetRange(LOCATION_MZONE)
	e5:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
	e5:SetTarget(s.distarget)
	c:RegisterEffect(e5)
end
function s.postg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return e:GetHandler():IsAttackPos()
	end
	Duel.SetOperationInfo(0, CATEGORY_POSITION, e:GetHandler(), 1, 0, 0)
end
function s.posop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	if c:IsFaceup() and c:IsAttackPos() and c:IsRelateToEffect(e) then
		Duel.ChangePosition(c, POS_FACEUP_DEFENSE)
	end
end
function s.distarget(e, c)
	return c ~= e:GetHandler() and c:IsType(TYPE_CONTINUOUS)
end
function s.disop(e, tp, eg, ep, ev, re, r, rp)
	local tl = Duel.GetChainInfo(ev, CHAININFO_TRIGGERING_LOCATION)
	if tl == LOCATION_SZONE and re:IsActiveType(TYPE_CONTINUOUS) then
		Duel.NegateEffect(ev)
	end
end


静寂虫
このカードは召喚・反転召喚に成功した場合守備表示になる。
このカードがフィールド上に表側表示で存在する限り、永続魔法・永続罠カードの効果を無効にする。
-- 静寂虫
local s, id, o = GetID()
function s.initial_effect(c)
	--to defense
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_POSITION)
	e1:SetType(EFFECT_TYPE_TRIGGER_F + EFFECT_TYPE_SINGLE)
	e1:SetCode(EVENT_SUMMON_SUCCESS)
	e1:SetTarget(s.postg)
	e1:SetOperation(s.posop)
	c:RegisterEffect(e1)
	local e2 = e1:Clone()
	e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
	c:RegisterEffect(e2)
	--disable
	local e3 = Effect.CreateEffect(c)
	e3:SetType(EFFECT_TYPE_FIELD)
	e3:SetCode(EFFECT_DISABLE)
	e3:SetRange(LOCATION_MZONE)
	e3:SetTargetRange(LOCATION_SZONE, LOCATION_SZONE)
	e3:SetTarget(s.distarget)
	c:RegisterEffect(e3)
	--disable effect
	local e4 = Effect.CreateEffect(c)
	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
	e4:SetCode(EVENT_CHAIN_SOLVING)
	e4:SetRange(LOCATION_MZONE)
	e4:SetOperation(s.disop)
	c:RegisterEffect(e4)
	--disable trap monster
	local e5 = Effect.CreateEffect(c)
	e5:SetType(EFFECT_TYPE_FIELD)
	e5:SetCode(EFFECT_DISABLE_TRAPMONSTER)
	e5:SetRange(LOCATION_MZONE)
	e5:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
	e5:SetTarget(s.distarget)
	c:RegisterEffect(e5)
end
function s.postg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return e:GetHandler():IsAttackPos()
	end
	Duel.SetOperationInfo(0, CATEGORY_POSITION, e:GetHandler(), 1, 0, 0)
end
function s.posop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	if c:IsFaceup() and c:IsAttackPos() and c:IsRelateToEffect(e) then
		Duel.ChangePosition(c, POS_FACEUP_DEFENSE)
	end
end
function s.distarget(e, c)
	return c ~= e:GetHandler() and c:IsType(TYPE_CONTINUOUS)
end
function s.disop(e, tp, eg, ep, ev, re, r, rp)
	local tl = Duel.GetChainInfo(ev, CHAININFO_TRIGGERING_LOCATION)
	if tl == LOCATION_SZONE and re:IsActiveType(TYPE_CONTINUOUS) then
		Duel.NegateEffect(ev)
	end
end

