name: Aroma
card_text: Once per turn, if you control an "Aroma" monster: You can gain 500 LP, also all monsters you control gain 500 ATK and DEF until the end of your opponent's next turn (even if this card leaves the field). If a face-up "Aroma" monster you control is destroyed by battle or card effect and sent to the Graveyard: Gain 1000 LP.
external_ids: local SETCARD_ID_0 = 0xc9 --Aroma
  
lua: local SETCARD_ID_0 = 0xc9 --Aroma
  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)
  	--recover 1
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_RECOVER + CATEGORY_ATKCHANGE + CATEGORY_DEFCHANGE)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.recon1)
  	e2:SetTarget(s.retg1)
  	e2:SetOperation(s.reop1)
  	c:RegisterEffect(e2)
  	--recover 2
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_RECOVER)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e3:SetCode(EVENT_TO_GRAVE)
  	e3:SetRange(LOCATION_FZONE)
  	e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e3:SetCondition(s.recon2)
  	e3:SetTarget(s.retg2)
  	e3:SetOperation(s.reop2)
  	c:RegisterEffect(e3)
  end
  function s.cfilter1(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.recon1(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter1, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.retg1(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(500)
  	Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, 500)
  end
  function s.reop1(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.Recover(p, d, REASON_EFFECT)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_UPDATE_ATTACK)
  	e1:SetTargetRange(LOCATION_MZONE, 0)
  	e1:SetValue(500)
  	e1:SetReset(RESET_PHASE + PHASE_END + RESET_OPPO_TURN)
  	Duel.RegisterEffect(e1, tp)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_UPDATE_DEFENSE)
  	Duel.RegisterEffect(e2, tp)
  end
  function s.cfilter2(c, tp)
  	return c:IsSetCard(SETCARD_ID_0)
  		and c:IsReason(REASON_DESTROY)
  		and c:IsReason(REASON_BATTLE + REASON_EFFECT)
  		and c:IsPreviousControler(tp)
  		and c:IsPreviousLocation(LOCATION_MZONE)
  		and c:IsPreviousPosition(POS_FACEUP)
  end
  function s.recon2(e, tp, eg, ep, ev, re, r, rp)
  	return eg:IsExists(s.cfilter2, 1, nil, tp)
  end
  function s.retg2(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(1000)
  	Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, 1000)
  end
  function s.reop2(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.Recover(p, d, REASON_EFFECT)
  end
  
  
source_text: Aroma
  Once per turn, if you control an "Aroma" monster: You can gain 500 LP, also all monsters you control gain 500 ATK and DEF until the end of your opponent's next turn (even if this card leaves the field). If a face-up "Aroma" monster you control is destroyed by battle or card effect and sent to the Graveyard: Gain 1000 LP.
target_text: -- Aroma
  local SETCARD_ID_0 = 0xc9 --Aroma
  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)
  	--recover 1
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_RECOVER + CATEGORY_ATKCHANGE + CATEGORY_DEFCHANGE)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.recon1)
  	e2:SetTarget(s.retg1)
  	e2:SetOperation(s.reop1)
  	c:RegisterEffect(e2)
  	--recover 2
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_RECOVER)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e3:SetCode(EVENT_TO_GRAVE)
  	e3:SetRange(LOCATION_FZONE)
  	e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e3:SetCondition(s.recon2)
  	e3:SetTarget(s.retg2)
  	e3:SetOperation(s.reop2)
  	c:RegisterEffect(e3)
  end
  function s.cfilter1(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.recon1(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter1, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.retg1(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(500)
  	Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, 500)
  end
  function s.reop1(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.Recover(p, d, REASON_EFFECT)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_UPDATE_ATTACK)
  	e1:SetTargetRange(LOCATION_MZONE, 0)
  	e1:SetValue(500)
  	e1:SetReset(RESET_PHASE + PHASE_END + RESET_OPPO_TURN)
  	Duel.RegisterEffect(e1, tp)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_UPDATE_DEFENSE)
  	Duel.RegisterEffect(e2, tp)
  end
  function s.cfilter2(c, tp)
  	return c:IsSetCard(SETCARD_ID_0)
  		and c:IsReason(REASON_DESTROY)
  		and c:IsReason(REASON_BATTLE + REASON_EFFECT)
  		and c:IsPreviousControler(tp)
  		and c:IsPreviousLocation(LOCATION_MZONE)
  		and c:IsPreviousPosition(POS_FACEUP)
  end
  function s.recon2(e, tp, eg, ep, ev, re, r, rp)
  	return eg:IsExists(s.cfilter2, 1, nil, tp)
  end
  function s.retg2(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(1000)
  	Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, 1000)
  end
  function s.reop2(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.Recover(p, d, REASON_EFFECT)
  end
  
  