name: Aromage
card_text: While your LP are higher than your opponent's, if a Plant monster you control attacks, your opponent cannot activate monster effects until the end of the Damage Step. Once per turn, if you gain LP: Target 1 face-up monster on the field; change its battle position.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--active limit
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_ACTIVATE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetTargetRange(0, 1)
  	e1:SetCondition(s.accon)
  	e1:SetValue(s.actlimit)
  	c:RegisterEffect(e1)
  	--position change
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_POSITION)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_RECOVER)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.poscon)
  	e2:SetTarget(s.postg)
  	e2:SetOperation(s.posop)
  	c:RegisterEffect(e2)
  end
  function s.accon(e)
  	local tp = e:GetHandlerPlayer()
  	local ac = Duel.GetAttacker()
  	return Duel.GetLP(tp) > Duel.GetLP(1 - tp) and ac and ac:IsControler(tp) and ac:IsRace(RACE_PLANT)
  end
  function s.actlimit(e, re, tp)
  	return re:IsActiveType(TYPE_MONSTER)
  end
  function s.poscon(e, tp, eg, ep, ev, re, r, rp)
  	return ep == tp
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsCanChangePosition()
  end
  function s.postg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return true
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_POSCHANGE)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_POSITION, g, g:GetCount(), 0, 0)
  end
  function s.posop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc and tc:IsRelateToEffect(e) then
  		Duel.ChangePosition(tc, POS_FACEUP_DEFENSE, POS_FACEDOWN_DEFENSE, POS_FACEUP_ATTACK, POS_FACEUP_ATTACK)
  	end
  end
  
  
source_text: Aromage
  While your LP are higher than your opponent's, if a Plant monster you control attacks, your opponent cannot activate monster effects until the end of the Damage Step. Once per turn, if you gain LP: Target 1 face-up monster on the field; change its battle position.
target_text: -- Aromage
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--active limit
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_ACTIVATE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetTargetRange(0, 1)
  	e1:SetCondition(s.accon)
  	e1:SetValue(s.actlimit)
  	c:RegisterEffect(e1)
  	--position change
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_POSITION)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_RECOVER)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.poscon)
  	e2:SetTarget(s.postg)
  	e2:SetOperation(s.posop)
  	c:RegisterEffect(e2)
  end
  function s.accon(e)
  	local tp = e:GetHandlerPlayer()
  	local ac = Duel.GetAttacker()
  	return Duel.GetLP(tp) > Duel.GetLP(1 - tp) and ac and ac:IsControler(tp) and ac:IsRace(RACE_PLANT)
  end
  function s.actlimit(e, re, tp)
  	return re:IsActiveType(TYPE_MONSTER)
  end
  function s.poscon(e, tp, eg, ep, ev, re, r, rp)
  	return ep == tp
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsCanChangePosition()
  end
  function s.postg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return true
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_POSCHANGE)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_POSITION, g, g:GetCount(), 0, 0)
  end
  function s.posop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc and tc:IsRelateToEffect(e) then
  		Duel.ChangePosition(tc, POS_FACEUP_DEFENSE, POS_FACEDOWN_DEFENSE, POS_FACEUP_ATTACK, POS_FACEUP_ATTACK)
  	end
  end
  
  