name: Yosenju
card_text: Pendulum Scale = 5
  [ Pendulum Effect ]
  Once per turn, if you have a "Yosenju" card in your other Pendulum Zone: You can make this card's Pendulum Scale become 11 until the end of this turn, also you cannot Special Summon monsters for the rest of this turn, except "Yosenju" monsters (even if this card leaves the field).
  ----------------------------------------
  [ Monster Effect ]
  If this card is Normal Summoned: Change it to Defense Position. Monsters your opponent controls cannot target face-up "Yosenju" monsters for attacks, except this one.
external_ids: local SETCARD_ID_0 = 0xb3 --Yosenju
  
lua: local SETCARD_ID_0 = 0xb3 --Yosenju
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--pendulum summon
  	aux.EnablePendulumAttribute(c)
  	--scale change
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_PZONE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.sccon)
  	e2:SetOperation(s.scop)
  	c:RegisterEffect(e2)
  	--to defense
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetCategory(CATEGORY_POSITION)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e3:SetCode(EVENT_SUMMON_SUCCESS)
  	e3:SetTarget(s.postg)
  	e3:SetOperation(s.posop)
  	c:RegisterEffect(e3)
  	--cannot be battle target
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_FIELD)
  	e4:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
  	e4:SetRange(LOCATION_MZONE)
  	e4:SetTargetRange(0, LOCATION_MZONE)
  	e4:SetValue(s.bttg)
  	c:RegisterEffect(e4)
  end
  function s.sccon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(Card.IsSetCard, tp, LOCATION_PZONE, 0, 1, e:GetHandler(), 0xb3)
  end
  function s.scop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not c:IsRelateToEffect(e) then
  		return
  	end
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_CHANGE_LSCALE)
  	e1:SetValue(11)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE + RESET_PHASE + PHASE_END)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_CHANGE_RSCALE)
  	c:RegisterEffect(e2)
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e3:SetTargetRange(1, 0)
  	e3:SetTarget(s.splimit)
  	e3:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e3, tp)
  end
  function s.splimit(e, c)
  	return not c:IsSetCard(SETCARD_ID_0)
  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:IsPosition(POS_FACEUP_ATTACK) and c:IsRelateToEffect(e) then
  		Duel.ChangePosition(c, POS_FACEUP_DEFENSE)
  	end
  end
  function s.bttg(e, c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c ~= e:GetHandler()
  end
  
  
source_text: Yosenju
  Pendulum Scale = 5
  [ Pendulum Effect ]
  Once per turn, if you have a "Yosenju" card in your other Pendulum Zone: You can make this card's Pendulum Scale become 11 until the end of this turn, also you cannot Special Summon monsters for the rest of this turn, except "Yosenju" monsters (even if this card leaves the field).
  ----------------------------------------
  [ Monster Effect ]
  If this card is Normal Summoned: Change it to Defense Position. Monsters your opponent controls cannot target face-up "Yosenju" monsters for attacks, except this one.
target_text: -- Yosenju
  local SETCARD_ID_0 = 0xb3 --Yosenju
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--pendulum summon
  	aux.EnablePendulumAttribute(c)
  	--scale change
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_PZONE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.sccon)
  	e2:SetOperation(s.scop)
  	c:RegisterEffect(e2)
  	--to defense
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetCategory(CATEGORY_POSITION)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e3:SetCode(EVENT_SUMMON_SUCCESS)
  	e3:SetTarget(s.postg)
  	e3:SetOperation(s.posop)
  	c:RegisterEffect(e3)
  	--cannot be battle target
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_FIELD)
  	e4:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
  	e4:SetRange(LOCATION_MZONE)
  	e4:SetTargetRange(0, LOCATION_MZONE)
  	e4:SetValue(s.bttg)
  	c:RegisterEffect(e4)
  end
  function s.sccon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(Card.IsSetCard, tp, LOCATION_PZONE, 0, 1, e:GetHandler(), 0xb3)
  end
  function s.scop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not c:IsRelateToEffect(e) then
  		return
  	end
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_CHANGE_LSCALE)
  	e1:SetValue(11)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE + RESET_PHASE + PHASE_END)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_CHANGE_RSCALE)
  	c:RegisterEffect(e2)
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e3:SetTargetRange(1, 0)
  	e3:SetTarget(s.splimit)
  	e3:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e3, tp)
  end
  function s.splimit(e, c)
  	return not c:IsSetCard(SETCARD_ID_0)
  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:IsPosition(POS_FACEUP_ATTACK) and c:IsRelateToEffect(e) then
  		Duel.ChangePosition(c, POS_FACEUP_DEFENSE)
  	end
  end
  function s.bttg(e, c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c ~= e:GetHandler()
  end
  
  