name: Weather
card_text: FLIP: Destroys all opponent's face-up "Swords of Revealing Light" on the field. If "Swords of Revealing Light" is destroyed, you can perform your Battle Phase twice this turn (or your next turn, if activated during opponent's turn).
external_ids: local CARD_ID_0 = 72302403 --Swords of Revealing Light
  
lua: local CARD_ID_0 = 72302403 --Swords of Revealing Light
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--flip
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_FLIP)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsCode(CARD_ID_0)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = Duel.GetMatchingGroup(s.filter, tp, 0, LOCATION_ONFIELD, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.filter, tp, 0, LOCATION_ONFIELD, nil)
  	if Duel.Destroy(g, REASON_EFFECT) > 0 then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_FIELD)
  		e1:SetCode(EFFECT_BP_TWICE)
  		e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  		e1:SetTargetRange(1, 0)
  		if Duel.GetTurnPlayer() == tp and (Duel.GetCurrentPhase() >= PHASE_BATTLE_START and Duel.GetCurrentPhase() <= PHASE_BATTLE) then
  			e1:SetLabel(Duel.GetTurnCount())
  			e1:SetCondition(s.bpcon)
  			e1:SetReset(RESET_PHASE + PHASE_BATTLE + RESET_SELF_TURN, 2)
  		else
  			e1:SetReset(RESET_PHASE + PHASE_BATTLE + RESET_SELF_TURN, 1)
  		end
  		Duel.RegisterEffect(e1, tp)
  	end
  end
  function s.bpcon(e)
  	return Duel.GetTurnCount() ~= e:GetLabel()
  end
  
  
source_text: Weather
  FLIP: Destroys all opponent's face-up "Swords of Revealing Light" on the field. If "Swords of Revealing Light" is destroyed, you can perform your Battle Phase twice this turn (or your next turn, if activated during opponent's turn).
target_text: -- Weather
  local CARD_ID_0 = 72302403 --Swords of Revealing Light
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--flip
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_FLIP)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsCode(CARD_ID_0)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = Duel.GetMatchingGroup(s.filter, tp, 0, LOCATION_ONFIELD, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.filter, tp, 0, LOCATION_ONFIELD, nil)
  	if Duel.Destroy(g, REASON_EFFECT) > 0 then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_FIELD)
  		e1:SetCode(EFFECT_BP_TWICE)
  		e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  		e1:SetTargetRange(1, 0)
  		if Duel.GetTurnPlayer() == tp and (Duel.GetCurrentPhase() >= PHASE_BATTLE_START and Duel.GetCurrentPhase() <= PHASE_BATTLE) then
  			e1:SetLabel(Duel.GetTurnCount())
  			e1:SetCondition(s.bpcon)
  			e1:SetReset(RESET_PHASE + PHASE_BATTLE + RESET_SELF_TURN, 2)
  		else
  			e1:SetReset(RESET_PHASE + PHASE_BATTLE + RESET_SELF_TURN, 1)
  		end
  		Duel.RegisterEffect(e1, tp)
  	end
  end
  function s.bpcon(e)
  	return Duel.GetTurnCount() ~= e:GetLabel()
  end
  
  