name: Mikanko
card_text: Equip only to an opponent's monster. While you control a "Mikanko" monster, take control of that equipped monster. Neither player can activate the effects of the equipped monster while you control it. When this card leaves the field, send the equipped monster to the GY. You can only control 1 "Mikanko Reflection Rondo". You can only activate 1 "Mikanko Reflection Rondo" per turn.
external_ids: local SETCARD_ID_0 = 0x18d --Mikanko
  
lua: local SETCARD_ID_0 = 0x18d --Mikanko
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:SetUniqueOnField(1, 0, id)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_EQUIP)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_CONTINUOUS_TARGET)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--Equip Limit
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_EQUIP_LIMIT)
  	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e2:SetValue(s.eqlimit)
  	c:RegisterEffect(e2)
  	--control
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_EQUIP)
  	e3:SetCode(EFFECT_SET_CONTROL)
  	e3:SetCondition(s.ctcon)
  	e3:SetValue(s.ctval)
  	c:RegisterEffect(e3)
  	--cannot trigger
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_EQUIP)
  	e4:SetCode(EFFECT_CANNOT_TRIGGER)
  	e4:SetCondition(s.con)
  	c:RegisterEffect(e4)
  	--to grave
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_SINGLE)
  	e5:SetCode(EVENT_LEAVE_FIELD)
  	e5:SetOperation(s.tgop)
  	c:RegisterEffect(e5)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and chkc:IsFaceup()
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(Card.IsFaceup, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local g = Duel.SelectTarget(tp, Card.IsFaceup, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, g, 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsControler(1 - tp) then
  		Duel.Equip(tp, e:GetHandler(), tc)
  	end
  end
  function s.eqlimit(e, c)
  	return e:GetHandlerPlayer() ~= c:GetControler() or e:GetHandler():GetEquipTarget() == c
  end
  function s.filter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsFaceup()
  end
  function s.ctcon(e)
  	return Duel.IsExistingMatchingCard(s.filter, e:GetHandlerPlayer(), LOCATION_MZONE, 0, 1, nil)
  end
  function s.ctval(e, c)
  	return e:GetHandlerPlayer()
  end
  function s.con(e)
  	return e:GetHandler():GetEquipTarget():IsControler(e:GetHandlerPlayer())
  end
  function s.tgop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = e:GetHandler():GetFirstCardTarget()
  	if tc and tc:IsLocation(LOCATION_MZONE) then
  		Duel.SendtoGrave(tc, REASON_EFFECT)
  	end
  end
  
  
source_text: Mikanko
  Equip only to an opponent's monster. While you control a "Mikanko" monster, take control of that equipped monster. Neither player can activate the effects of the equipped monster while you control it. When this card leaves the field, send the equipped monster to the GY. You can only control 1 "Mikanko Reflection Rondo". You can only activate 1 "Mikanko Reflection Rondo" per turn.
target_text: -- Mikanko
  local SETCARD_ID_0 = 0x18d --Mikanko
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:SetUniqueOnField(1, 0, id)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_EQUIP)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_CONTINUOUS_TARGET)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--Equip Limit
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_EQUIP_LIMIT)
  	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e2:SetValue(s.eqlimit)
  	c:RegisterEffect(e2)
  	--control
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_EQUIP)
  	e3:SetCode(EFFECT_SET_CONTROL)
  	e3:SetCondition(s.ctcon)
  	e3:SetValue(s.ctval)
  	c:RegisterEffect(e3)
  	--cannot trigger
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_EQUIP)
  	e4:SetCode(EFFECT_CANNOT_TRIGGER)
  	e4:SetCondition(s.con)
  	c:RegisterEffect(e4)
  	--to grave
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_SINGLE)
  	e5:SetCode(EVENT_LEAVE_FIELD)
  	e5:SetOperation(s.tgop)
  	c:RegisterEffect(e5)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and chkc:IsFaceup()
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(Card.IsFaceup, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local g = Duel.SelectTarget(tp, Card.IsFaceup, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, g, 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsControler(1 - tp) then
  		Duel.Equip(tp, e:GetHandler(), tc)
  	end
  end
  function s.eqlimit(e, c)
  	return e:GetHandlerPlayer() ~= c:GetControler() or e:GetHandler():GetEquipTarget() == c
  end
  function s.filter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsFaceup()
  end
  function s.ctcon(e)
  	return Duel.IsExistingMatchingCard(s.filter, e:GetHandlerPlayer(), LOCATION_MZONE, 0, 1, nil)
  end
  function s.ctval(e, c)
  	return e:GetHandlerPlayer()
  end
  function s.con(e)
  	return e:GetHandler():GetEquipTarget():IsControler(e:GetHandlerPlayer())
  end
  function s.tgop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = e:GetHandler():GetFirstCardTarget()
  	if tc and tc:IsLocation(LOCATION_MZONE) then
  		Duel.SendtoGrave(tc, REASON_EFFECT)
  	end
  end
  
  