name: Heavenly
card_text: While you control a monster that is equipped with an Equip Card, all monsters your opponent controls that can attack must attack monsters equipped with Equip Cards. If your "Mikanko" monster battles, your opponent cannot activate cards or effects until the end of the Damage Step. At the end of the Damage Step, if your "Mikanko" monster attacked: You can send 1 Equip Card you control to the GY; it can make another attack on a monster in a row.
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)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--must attack
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_MUST_ATTACK)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetTargetRange(0, LOCATION_MZONE)
  	e2:SetCondition(s.atkcon)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_MUST_ATTACK_MONSTER)
  	e3:SetValue(s.atklimit)
  	c:RegisterEffect(e3)
  	--act limit
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_FIELD)
  	e4:SetCode(EFFECT_CANNOT_ACTIVATE)
  	e4:SetRange(LOCATION_FZONE)
  	e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e4:SetTargetRange(0, 1)
  	e4:SetCondition(s.actcon)
  	e4:SetValue(1)
  	c:RegisterEffect(e4)
  	--extra attack
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e5:SetRange(LOCATION_FZONE)
  	e5:SetCode(EVENT_DAMAGE_STEP_END)
  	e5:SetCondition(s.excon)
  	e5:SetCost(s.excost)
  	e5:SetOperation(s.exop)
  	c:RegisterEffect(e5)
  end
  function s.atkfilter(c)
  	return c:GetEquipCount() > 0
  end
  function s.atkcon(e)
  	return Duel.IsExistingMatchingCard(s.atkfilter, e:GetHandlerPlayer(), LOCATION_MZONE, 0, 1, nil)
  end
  function s.atklimit(e, c)
  	return c:GetEquipCount() > 0
  end
  function s.actcon(e)
  	local a = Duel.GetBattleMonster(e:GetHandlerPlayer())
  	return a and a:IsFaceup() and a:IsSetCard(SETCARD_ID_0)
  end
  function s.excon(e, tp, eg, ep, ev, re, r, rp)
  	local ec = Duel.GetAttacker()
  	e:SetLabelObject(ec)
  	return ec:IsControler(tp) and ec:IsSetCard(SETCARD_ID_0) and ec:IsChainAttackable(0, true)
  end
  function s.exfilter(c)
  	return c:IsType(TYPE_EQUIP) and c:IsAbleToGraveAsCost()
  end
  function s.excost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.exfilter, tp, LOCATION_ONFIELD, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.exfilter, tp, LOCATION_ONFIELD, 0, 1, 1, nil)
  	Duel.SendtoGrave(g, REASON_COST)
  end
  function s.exop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local ec = e:GetLabelObject()
  	if not ec or not ec:IsRelateToBattle() then
  		return
  	end
  	Duel.ChainAttack()
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_BATTLE)
  	ec:RegisterEffect(e1)
  end
  
  
source_text: Heavenly
  While you control a monster that is equipped with an Equip Card, all monsters your opponent controls that can attack must attack monsters equipped with Equip Cards. If your "Mikanko" monster battles, your opponent cannot activate cards or effects until the end of the Damage Step. At the end of the Damage Step, if your "Mikanko" monster attacked: You can send 1 Equip Card you control to the GY; it can make another attack on a monster in a row.
target_text: -- Heavenly
  local SETCARD_ID_0 = 0x18d --Mikanko
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--must attack
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_MUST_ATTACK)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetTargetRange(0, LOCATION_MZONE)
  	e2:SetCondition(s.atkcon)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_MUST_ATTACK_MONSTER)
  	e3:SetValue(s.atklimit)
  	c:RegisterEffect(e3)
  	--act limit
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_FIELD)
  	e4:SetCode(EFFECT_CANNOT_ACTIVATE)
  	e4:SetRange(LOCATION_FZONE)
  	e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e4:SetTargetRange(0, 1)
  	e4:SetCondition(s.actcon)
  	e4:SetValue(1)
  	c:RegisterEffect(e4)
  	--extra attack
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e5:SetRange(LOCATION_FZONE)
  	e5:SetCode(EVENT_DAMAGE_STEP_END)
  	e5:SetCondition(s.excon)
  	e5:SetCost(s.excost)
  	e5:SetOperation(s.exop)
  	c:RegisterEffect(e5)
  end
  function s.atkfilter(c)
  	return c:GetEquipCount() > 0
  end
  function s.atkcon(e)
  	return Duel.IsExistingMatchingCard(s.atkfilter, e:GetHandlerPlayer(), LOCATION_MZONE, 0, 1, nil)
  end
  function s.atklimit(e, c)
  	return c:GetEquipCount() > 0
  end
  function s.actcon(e)
  	local a = Duel.GetBattleMonster(e:GetHandlerPlayer())
  	return a and a:IsFaceup() and a:IsSetCard(SETCARD_ID_0)
  end
  function s.excon(e, tp, eg, ep, ev, re, r, rp)
  	local ec = Duel.GetAttacker()
  	e:SetLabelObject(ec)
  	return ec:IsControler(tp) and ec:IsSetCard(SETCARD_ID_0) and ec:IsChainAttackable(0, true)
  end
  function s.exfilter(c)
  	return c:IsType(TYPE_EQUIP) and c:IsAbleToGraveAsCost()
  end
  function s.excost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.exfilter, tp, LOCATION_ONFIELD, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.exfilter, tp, LOCATION_ONFIELD, 0, 1, 1, nil)
  	Duel.SendtoGrave(g, REASON_COST)
  end
  function s.exop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local ec = e:GetLabelObject()
  	if not ec or not ec:IsRelateToBattle() then
  		return
  	end
  	Duel.ChainAttack()
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_BATTLE)
  	ec:RegisterEffect(e1)
  end
  
  