name: Cactus
card_text: If this card destroys an opponent's monster by battle, Special Summon 1 "Needle Token" (Plant-Type/EARTH/Level 1/ATK 500/DEF 500) to your opponent's side of the field in Defense Position.
external_ids: local CARD_ID_0 = 74440056 --Needle Token
  
lua: local CARD_ID_0 = 74440056 --Needle Token
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_BATTLE_DESTROYING)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return c:IsRelateToBattle() and c:GetBattleTarget():IsType(TYPE_MONSTER)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 1, tp, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if
  		Duel.GetLocationCount(1 - tp, LOCATION_MZONE) > 0 and Duel.IsPlayerCanSpecialSummonMonster(
  			tp,
  			id + 1,
  			0,
  			TYPES_TOKEN_MONSTER,
  			500,
  			500,
  			1,
  			RACE_PLANT,
  			ATTRIBUTE_EARTH,
  			POS_FACEUP_DEFENSE,
  			1 - tp
  		)
  	then
  		local token = Duel.CreateToken(tp, id + 1)
  		Duel.SpecialSummon(token, 0, tp, 1 - tp, false, false, POS_FACEUP_DEFENSE)
  	end
  end
  
  
source_text: Cactus
  If this card destroys an opponent's monster by battle, Special Summon 1 "Needle Token" (Plant-Type/EARTH/Level 1/ATK 500/DEF 500) to your opponent's side of the field in Defense Position.
target_text: -- Cactus
  local CARD_ID_0 = 74440056 --Needle Token
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_BATTLE_DESTROYING)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return c:IsRelateToBattle() and c:GetBattleTarget():IsType(TYPE_MONSTER)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 1, tp, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if
  		Duel.GetLocationCount(1 - tp, LOCATION_MZONE) > 0 and Duel.IsPlayerCanSpecialSummonMonster(
  			tp,
  			id + 1,
  			0,
  			TYPES_TOKEN_MONSTER,
  			500,
  			500,
  			1,
  			RACE_PLANT,
  			ATTRIBUTE_EARTH,
  			POS_FACEUP_DEFENSE,
  			1 - tp
  		)
  	then
  		local token = Duel.CreateToken(tp, id + 1)
  		Duel.SpecialSummon(token, 0, tp, 1 - tp, false, false, POS_FACEUP_DEFENSE)
  	end
  end
  
  