name: Revival
card_text: When this card is destroyed by battle and sent to the GY: You can pay 1000 LP; Special Summon it in Defense Position during your next Standby Phase.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--reborn preparation
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_BATTLE_DESTROYED)
  	e1:SetCondition(s.spcon)
  	e1:SetCost(s.spcost)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--reborn
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_PHASE + PHASE_STANDBY)
  	e2:SetRange(LOCATION_GRAVE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.spcon2)
  	e2:SetOperation(s.spop2)
  	c:RegisterEffect(e2)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckLPCost(tp, 1000)
  	end
  	Duel.PayLPCost(tp, 1000)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	e:GetHandler():RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 0)
  end
  function s.spcon2(e, tp, eg, ep, ev, re, r, rp)
  	return tp == Duel.GetTurnPlayer() and e:GetHandler():GetFlagEffect(id) > 0
  end
  function s.spop2(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	c:ResetFlagEffect(id)
  	Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP_DEFENSE)
  end
  
  
source_text: Revival
  When this card is destroyed by battle and sent to the GY: You can pay 1000 LP; Special Summon it in Defense Position during your next Standby Phase.
target_text: -- Revival
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--reborn preparation
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_BATTLE_DESTROYED)
  	e1:SetCondition(s.spcon)
  	e1:SetCost(s.spcost)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--reborn
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_PHASE + PHASE_STANDBY)
  	e2:SetRange(LOCATION_GRAVE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.spcon2)
  	e2:SetOperation(s.spop2)
  	c:RegisterEffect(e2)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckLPCost(tp, 1000)
  	end
  	Duel.PayLPCost(tp, 1000)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	e:GetHandler():RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 0)
  end
  function s.spcon2(e, tp, eg, ep, ev, re, r, rp)
  	return tp == Duel.GetTurnPlayer() and e:GetHandler():GetFlagEffect(id) > 0
  end
  function s.spop2(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	c:ResetFlagEffect(id)
  	Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP_DEFENSE)
  end
  
  