name: Cross
card_text: If the DEF of an attacked Defense Position monster is higher than the ATK of your opponent's attacking monster, the Battle Damage inflicted to your opponent is doubled. Destroy the attacking monster after damage calculation.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(TIMING_DAMAGE_STEP)
  	e1:SetCondition(s.condition)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local a = Duel.GetAttacker()
  	local at = Duel.GetAttackTarget()
  	return Duel.GetCurrentPhase() == PHASE_DAMAGE and not Duel.IsDamageCalculated() and a:IsControler(1 - tp) and at and at:IsPosition(POS_FACEUP_DEFENSE) and a:GetAttack() < at:GetDefense()
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local at = Duel.GetAttackTarget()
  	if at:IsFaceup() and at:IsRelateToBattle() then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
  		e1:SetCondition(s.dcon)
  		e1:SetValue(aux.ChangeBattleDamage(1, DOUBLE_DAMAGE))
  		e1:SetReset(RESET_PHASE + PHASE_DAMAGE)
  		at:RegisterEffect(e1)
  		local e2 = Effect.CreateEffect(e:GetHandler())
  		e2:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_FIELD)
  		e2:SetCode(EVENT_BATTLED)
  		e2:SetOperation(s.desop)
  		e2:SetReset(RESET_PHASE + PHASE_DAMAGE)
  		Duel.RegisterEffect(e2, tp)
  	end
  end
  function s.dcon(e)
  	local c = e:GetHandler()
  	return Duel.GetAttackTarget() == c
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetAttacker():IsRelateToBattle() then
  		Duel.Destroy(Duel.GetAttacker(), REASON_EFFECT)
  	end
  end
  
  
source_text: Cross
  If the DEF of an attacked Defense Position monster is higher than the ATK of your opponent's attacking monster, the Battle Damage inflicted to your opponent is doubled. Destroy the attacking monster after damage calculation.
target_text: -- Cross
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(TIMING_DAMAGE_STEP)
  	e1:SetCondition(s.condition)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local a = Duel.GetAttacker()
  	local at = Duel.GetAttackTarget()
  	return Duel.GetCurrentPhase() == PHASE_DAMAGE and not Duel.IsDamageCalculated() and a:IsControler(1 - tp) and at and at:IsPosition(POS_FACEUP_DEFENSE) and a:GetAttack() < at:GetDefense()
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local at = Duel.GetAttackTarget()
  	if at:IsFaceup() and at:IsRelateToBattle() then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
  		e1:SetCondition(s.dcon)
  		e1:SetValue(aux.ChangeBattleDamage(1, DOUBLE_DAMAGE))
  		e1:SetReset(RESET_PHASE + PHASE_DAMAGE)
  		at:RegisterEffect(e1)
  		local e2 = Effect.CreateEffect(e:GetHandler())
  		e2:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_FIELD)
  		e2:SetCode(EVENT_BATTLED)
  		e2:SetOperation(s.desop)
  		e2:SetReset(RESET_PHASE + PHASE_DAMAGE)
  		Duel.RegisterEffect(e2, tp)
  	end
  end
  function s.dcon(e)
  	local c = e:GetHandler()
  	return Duel.GetAttackTarget() == c
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetAttacker():IsRelateToBattle() then
  		Duel.Destroy(Duel.GetAttacker(), REASON_EFFECT)
  	end
  end
  
  