name: Stellar
card_text: 1 Tuner + 1+ non-Tuner monsters
  You can only control 1 "Stellar Wind Wolfrayet". Gains 300 ATK each time another monster's effect is activated, while the ATK of this card is less than 4000. Once per turn, if this card's ATK is 4000 or higher (Quick Effect): You can shuffle both this card and all monsters your opponent controls into the Deck.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	c:SetUniqueOnField(1, 0, id)
  	--synchro summon
  	aux.AddSynchroProcedure(c, nil, aux.NonTuner(nil), 1)
  	c:EnableReviveLimit()
  	--attack up
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetOperation(aux.chainreg)
  	c:RegisterEffect(e1)
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_CHAIN_SOLVED)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetOperation(s.atkop)
  	c:RegisterEffect(e2)
  	--to deck
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_TODECK)
  	e3:SetType(EFFECT_TYPE_QUICK_O)
  	e3:SetCode(EVENT_FREE_CHAIN)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetHintTiming(0, TIMINGS_CHECK_MONSTER + TIMING_END_PHASE)
  	e3:SetCountLimit(1)
  	e3:SetCondition(s.tdcon)
  	e3:SetTarget(s.tdtg)
  	e3:SetOperation(s.tdop)
  	c:RegisterEffect(e3)
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:GetAttack() < 4000 and re:GetHandler() ~= c and re:IsActiveType(TYPE_MONSTER) and c:GetFlagEffect(FLAG_ID_CHAINING) > 0 then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetValue(300)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
  		c:RegisterEffect(e1)
  	end
  end
  function s.tdcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsAttackAbove(4000)
  end
  function s.tdtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	local g = Duel.GetMatchingGroup(Card.IsAbleToDeck, tp, 0, LOCATION_MZONE, nil)
  	if chk == 0 then
  		return c:IsAbleToDeck() and g:GetCount() > 0
  	end
  	g:AddCard(c)
  	Duel.SetOperationInfo(0, CATEGORY_TODECK, g, g:GetCount(), 0, 0)
  end
  function s.tdop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		local g = Duel.GetMatchingGroup(nil, tp, 0, LOCATION_MZONE, nil)
  		if g:GetCount() > 0 then
  			g:AddCard(c)
  			Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
  		end
  	end
  end
  
  
source_text: Stellar
  1 Tuner + 1+ non-Tuner monsters
  You can only control 1 "Stellar Wind Wolfrayet". Gains 300 ATK each time another monster's effect is activated, while the ATK of this card is less than 4000. Once per turn, if this card's ATK is 4000 or higher (Quick Effect): You can shuffle both this card and all monsters your opponent controls into the Deck.
target_text: -- Stellar
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:SetUniqueOnField(1, 0, id)
  	--synchro summon
  	aux.AddSynchroProcedure(c, nil, aux.NonTuner(nil), 1)
  	c:EnableReviveLimit()
  	--attack up
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetOperation(aux.chainreg)
  	c:RegisterEffect(e1)
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_CHAIN_SOLVED)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetOperation(s.atkop)
  	c:RegisterEffect(e2)
  	--to deck
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_TODECK)
  	e3:SetType(EFFECT_TYPE_QUICK_O)
  	e3:SetCode(EVENT_FREE_CHAIN)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetHintTiming(0, TIMINGS_CHECK_MONSTER + TIMING_END_PHASE)
  	e3:SetCountLimit(1)
  	e3:SetCondition(s.tdcon)
  	e3:SetTarget(s.tdtg)
  	e3:SetOperation(s.tdop)
  	c:RegisterEffect(e3)
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:GetAttack() < 4000 and re:GetHandler() ~= c and re:IsActiveType(TYPE_MONSTER) and c:GetFlagEffect(FLAG_ID_CHAINING) > 0 then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetValue(300)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
  		c:RegisterEffect(e1)
  	end
  end
  function s.tdcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsAttackAbove(4000)
  end
  function s.tdtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	local g = Duel.GetMatchingGroup(Card.IsAbleToDeck, tp, 0, LOCATION_MZONE, nil)
  	if chk == 0 then
  		return c:IsAbleToDeck() and g:GetCount() > 0
  	end
  	g:AddCard(c)
  	Duel.SetOperationInfo(0, CATEGORY_TODECK, g, g:GetCount(), 0, 0)
  end
  function s.tdop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		local g = Duel.GetMatchingGroup(nil, tp, 0, LOCATION_MZONE, nil)
  		if g:GetCount() > 0 then
  			g:AddCard(c)
  			Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
  		end
  	end
  end
  
  