name: Evil★Twins
card_text: Cannot be Normal Summoned/Set. Must be Special Summoned (from your hand or GY) by Tributing 2 Link Monsters. If this card is Special Summoned: You can activate this effect; if your opponent controls 3 or more cards, they must send cards to the GY so they control 2 cards. You can only use this effect of "Evil★Twins Ki-sikil & Lil-la" once per turn. While you have a "Ki-sikil" monster in your GY and you have a "Lil-la" monster in your GY, this card gains 2200 ATK/DEF.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	--special summon condition
  	local e0 = Effect.CreateEffect(c)
  	e0:SetType(EFFECT_TYPE_SINGLE)
  	e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e0:SetCode(EFFECT_SPSUMMON_CONDITION)
  	c:RegisterEffect(e0)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetRange(LOCATION_HAND + LOCATION_GRAVE)
  	e1:SetCondition(s.sprcon)
  	e1:SetTarget(s.sprtg)
  	e1:SetOperation(s.sprop)
  	c:RegisterEffect(e1)
  	--to grave
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_TOGRAVE)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetProperty(EFFECT_FLAG_DELAY)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetCountLimit(1, id)
  	e2:SetTarget(s.tgtg)
  	e2:SetOperation(s.tgop)
  	c:RegisterEffect(e2)
  	--atk/def
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e3:SetCode(EFFECT_UPDATE_ATTACK)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCondition(s.con)
  	e3:SetValue(2200)
  	c:RegisterEffect(e3)
  	local e4 = e3:Clone()
  	e4:SetCode(EFFECT_UPDATE_DEFENSE)
  	c:RegisterEffect(e4)
  end
  function s.sprcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	local rg = Duel.GetReleaseGroup(tp, false, REASON_SPSUMMON):Filter(Card.IsType, nil, TYPE_LINK)
  	return rg:CheckSubGroup(aux.mzctcheckrel, 2, 2, tp, REASON_SPSUMMON)
  end
  function s.sprtg(e, tp, eg, ep, ev, re, r, rp, chk, c)
  	local rg = Duel.GetReleaseGroup(tp, false, REASON_SPSUMMON):Filter(Card.IsType, nil, TYPE_LINK)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RELEASE)
  	local sg = rg:SelectSubGroup(tp, aux.mzctcheckrel, true, 2, 2, tp, REASON_SPSUMMON)
  	if sg then
  		sg:KeepAlive()
  		e:SetLabelObject(sg)
  		return true
  	else
  		return false
  	end
  end
  function s.sprop(e, tp, eg, ep, ev, re, r, rp, c)
  	local g = e:GetLabelObject()
  	Duel.Release(g, REASON_SPSUMMON)
  	g:DeleteGroup()
  end
  function s.tgtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local g = Duel.GetFieldGroup(tp, 0, LOCATION_ONFIELD)
  	local ct = g:GetCount() - 2
  	if chk == 0 then
  		return Duel.IsPlayerCanSendtoGrave(1 - tp) and ct > 0 and g:IsExists(Card.IsAbleToGrave, 1, nil, 1 - tp, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, g, ct, 0, 0)
  end
  function s.tgop(e, tp, eg, ep, ev, re, r, rp)
  	if not Duel.IsPlayerCanSendtoGrave(1 - tp) then
  		return
  	end
  	local g = Duel.GetFieldGroup(tp, 0, LOCATION_ONFIELD)
  	local ct = g:GetCount() - 2
  	if ct > 0 then
  		Duel.Hint(HINT_SELECTMSG, 1 - tp, HINTMSG_TOGRAVE)
  		local sg = g:FilterSelect(1 - tp, Card.IsAbleToGrave, ct, ct, nil, 1 - tp, nil)
  		Duel.SendtoGrave(sg, REASON_RULE)
  	end
  end
  function s.cfilter(c, setcode)
  	return c:IsFaceup() and c:IsSetCard(setcode)
  end
  function s.con(e)
  	local tp = e:GetHandlerPlayer()
  	return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_GRAVE, 0, 1, nil, 0x152) and Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_GRAVE, 0, 1, nil, 0x153)
  end
  
  
source_text: Evil★Twins
  Cannot be Normal Summoned/Set. Must be Special Summoned (from your hand or GY) by Tributing 2 Link Monsters. If this card is Special Summoned: You can activate this effect; if your opponent controls 3 or more cards, they must send cards to the GY so they control 2 cards. You can only use this effect of "Evil★Twins Ki-sikil & Lil-la" once per turn. While you have a "Ki-sikil" monster in your GY and you have a "Lil-la" monster in your GY, this card gains 2200 ATK/DEF.
target_text: -- Evil★Twins
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	--special summon condition
  	local e0 = Effect.CreateEffect(c)
  	e0:SetType(EFFECT_TYPE_SINGLE)
  	e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e0:SetCode(EFFECT_SPSUMMON_CONDITION)
  	c:RegisterEffect(e0)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetRange(LOCATION_HAND + LOCATION_GRAVE)
  	e1:SetCondition(s.sprcon)
  	e1:SetTarget(s.sprtg)
  	e1:SetOperation(s.sprop)
  	c:RegisterEffect(e1)
  	--to grave
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_TOGRAVE)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetProperty(EFFECT_FLAG_DELAY)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetCountLimit(1, id)
  	e2:SetTarget(s.tgtg)
  	e2:SetOperation(s.tgop)
  	c:RegisterEffect(e2)
  	--atk/def
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e3:SetCode(EFFECT_UPDATE_ATTACK)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCondition(s.con)
  	e3:SetValue(2200)
  	c:RegisterEffect(e3)
  	local e4 = e3:Clone()
  	e4:SetCode(EFFECT_UPDATE_DEFENSE)
  	c:RegisterEffect(e4)
  end
  function s.sprcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	local rg = Duel.GetReleaseGroup(tp, false, REASON_SPSUMMON):Filter(Card.IsType, nil, TYPE_LINK)
  	return rg:CheckSubGroup(aux.mzctcheckrel, 2, 2, tp, REASON_SPSUMMON)
  end
  function s.sprtg(e, tp, eg, ep, ev, re, r, rp, chk, c)
  	local rg = Duel.GetReleaseGroup(tp, false, REASON_SPSUMMON):Filter(Card.IsType, nil, TYPE_LINK)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RELEASE)
  	local sg = rg:SelectSubGroup(tp, aux.mzctcheckrel, true, 2, 2, tp, REASON_SPSUMMON)
  	if sg then
  		sg:KeepAlive()
  		e:SetLabelObject(sg)
  		return true
  	else
  		return false
  	end
  end
  function s.sprop(e, tp, eg, ep, ev, re, r, rp, c)
  	local g = e:GetLabelObject()
  	Duel.Release(g, REASON_SPSUMMON)
  	g:DeleteGroup()
  end
  function s.tgtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local g = Duel.GetFieldGroup(tp, 0, LOCATION_ONFIELD)
  	local ct = g:GetCount() - 2
  	if chk == 0 then
  		return Duel.IsPlayerCanSendtoGrave(1 - tp) and ct > 0 and g:IsExists(Card.IsAbleToGrave, 1, nil, 1 - tp, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, g, ct, 0, 0)
  end
  function s.tgop(e, tp, eg, ep, ev, re, r, rp)
  	if not Duel.IsPlayerCanSendtoGrave(1 - tp) then
  		return
  	end
  	local g = Duel.GetFieldGroup(tp, 0, LOCATION_ONFIELD)
  	local ct = g:GetCount() - 2
  	if ct > 0 then
  		Duel.Hint(HINT_SELECTMSG, 1 - tp, HINTMSG_TOGRAVE)
  		local sg = g:FilterSelect(1 - tp, Card.IsAbleToGrave, ct, ct, nil, 1 - tp, nil)
  		Duel.SendtoGrave(sg, REASON_RULE)
  	end
  end
  function s.cfilter(c, setcode)
  	return c:IsFaceup() and c:IsSetCard(setcode)
  end
  function s.con(e)
  	local tp = e:GetHandlerPlayer()
  	return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_GRAVE, 0, 1, nil, 0x152) and Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_GRAVE, 0, 1, nil, 0x153)
  end
  
  