name: Ultimate
card_text: 1 Psychic-Type Synchro Monster + 1 Psychic-Type monster
  This monster can only be Special Summoned by Fusion Summon from the Extra Deck. This card cannot be destroyed by card effects. During battle between this attacking card and a Defense Position monster whose DEF is lower than the ATK of this card, inflict the difference as Battle Damage to your opponent. When this card destroys an opponent's monster by battle and sends it to the Graveyard, you gain Life Points equal to the destroyed monster's ATK.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcFun2(c, s.ffilter, aux.FilterBoolFunction(Card.IsRace, RACE_PSYCHO), true)
  	--pierce
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_PIERCE)
  	c:RegisterEffect(e2)
  	--cannot be destroyed
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetValue(1)
  	c:RegisterEffect(e3)
  	--fusion success
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 0))
  	e4:SetCategory(CATEGORY_RECOVER)
  	e4:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e4:SetCode(EVENT_BATTLE_DESTROYING)
  	e4:SetCondition(s.recon)
  	e4:SetTarget(s.rectg)
  	e4:SetOperation(s.recop)
  	c:RegisterEffect(e4)
  	--spsummon condition
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e5:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e5:SetValue(s.splimit)
  	c:RegisterEffect(e5)
  end
  s.material_type = TYPE_SYNCHRO
  function s.splimit(e, se, sp, st)
  	if e:GetHandler():IsLocation(LOCATION_EXTRA) then
  		return bit.band(st, SUMMON_TYPE_FUSION) == SUMMON_TYPE_FUSION
  	end
  	return true
  end
  function s.ffilter(c)
  	return c:IsFusionType(TYPE_SYNCHRO) and c:IsRace(RACE_PSYCHO)
  end
  function s.recon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local bc = c:GetBattleTarget()
  	return c:IsRelateToBattle() and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
  end
  function s.rectg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local rec = e:GetHandler():GetBattleTarget():GetAttack()
  	if rec < 0 then
  		rec = 0
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(rec)
  	Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, rec)
  end
  function s.recop(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: Ultimate
  1 Psychic-Type Synchro Monster + 1 Psychic-Type monster
  This monster can only be Special Summoned by Fusion Summon from the Extra Deck. This card cannot be destroyed by card effects. During battle between this attacking card and a Defense Position monster whose DEF is lower than the ATK of this card, inflict the difference as Battle Damage to your opponent. When this card destroys an opponent's monster by battle and sends it to the Graveyard, you gain Life Points equal to the destroyed monster's ATK.
target_text: -- Ultimate
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcFun2(c, s.ffilter, aux.FilterBoolFunction(Card.IsRace, RACE_PSYCHO), true)
  	--pierce
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_PIERCE)
  	c:RegisterEffect(e2)
  	--cannot be destroyed
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetValue(1)
  	c:RegisterEffect(e3)
  	--fusion success
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 0))
  	e4:SetCategory(CATEGORY_RECOVER)
  	e4:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e4:SetCode(EVENT_BATTLE_DESTROYING)
  	e4:SetCondition(s.recon)
  	e4:SetTarget(s.rectg)
  	e4:SetOperation(s.recop)
  	c:RegisterEffect(e4)
  	--spsummon condition
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e5:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e5:SetValue(s.splimit)
  	c:RegisterEffect(e5)
  end
  s.material_type = TYPE_SYNCHRO
  function s.splimit(e, se, sp, st)
  	if e:GetHandler():IsLocation(LOCATION_EXTRA) then
  		return bit.band(st, SUMMON_TYPE_FUSION) == SUMMON_TYPE_FUSION
  	end
  	return true
  end
  function s.ffilter(c)
  	return c:IsFusionType(TYPE_SYNCHRO) and c:IsRace(RACE_PSYCHO)
  end
  function s.recon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local bc = c:GetBattleTarget()
  	return c:IsRelateToBattle() and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
  end
  function s.rectg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local rec = e:GetHandler():GetBattleTarget():GetAttack()
  	if rec < 0 then
  		rec = 0
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(rec)
  	Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, rec)
  end
  function s.recop(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
  
  