name: Aromage
card_text: While your LP is higher than your opponent's, if a Plant-Type monster you control attacks a Defense Position monster, inflict piercing battle damage to your opponent. Once per turn, if you gain LP: This card gains 1000 ATK and DEF until the end of your opponent's turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--pierce
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_PIERCE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(LOCATION_MZONE, 0)
  	e1:SetCondition(s.pccon)
  	e1:SetTarget(aux.TargetBoolFunction(Card.IsRace, RACE_PLANT))
  	c:RegisterEffect(e1)
  	--atk & def
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_ATKCHANGE + CATEGORY_DEFCHANGE)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_RECOVER)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.adcon)
  	e2:SetOperation(s.adop)
  	c:RegisterEffect(e2)
  end
  function s.pccon(e)
  	local tp = e:GetHandlerPlayer()
  	return Duel.GetLP(tp) > Duel.GetLP(1 - tp)
  end
  function s.adcon(e, tp, eg, ep, ev, re, r, rp)
  	return ep == tp
  end
  function s.adop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and c:IsFaceup() then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetValue(1000)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE + RESET_PHASE + PHASE_END + RESET_OPPO_TURN)
  		c:RegisterEffect(e1)
  		local e2 = e1:Clone()
  		e2:SetCode(EFFECT_UPDATE_DEFENSE)
  		c:RegisterEffect(e2)
  	end
  end
  
  
source_text: Aromage
  While your LP is higher than your opponent's, if a Plant-Type monster you control attacks a Defense Position monster, inflict piercing battle damage to your opponent. Once per turn, if you gain LP: This card gains 1000 ATK and DEF until the end of your opponent's turn.
target_text: -- Aromage
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--pierce
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_PIERCE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(LOCATION_MZONE, 0)
  	e1:SetCondition(s.pccon)
  	e1:SetTarget(aux.TargetBoolFunction(Card.IsRace, RACE_PLANT))
  	c:RegisterEffect(e1)
  	--atk & def
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_ATKCHANGE + CATEGORY_DEFCHANGE)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_RECOVER)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.adcon)
  	e2:SetOperation(s.adop)
  	c:RegisterEffect(e2)
  end
  function s.pccon(e)
  	local tp = e:GetHandlerPlayer()
  	return Duel.GetLP(tp) > Duel.GetLP(1 - tp)
  end
  function s.adcon(e, tp, eg, ep, ev, re, r, rp)
  	return ep == tp
  end
  function s.adop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and c:IsFaceup() then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetValue(1000)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE + RESET_PHASE + PHASE_END + RESET_OPPO_TURN)
  		c:RegisterEffect(e1)
  		local e2 = e1:Clone()
  		e2:SetCode(EFFECT_UPDATE_DEFENSE)
  		c:RegisterEffect(e2)
  	end
  end
  
  