name: Gallis
card_text: You can reveal this card in your hand; send the top card of your Deck to the Graveyard, then, if it was a monster, inflict damage to your opponent equal to its Level x 200 and Special Summon this card from your hand, otherwise destroy this card.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_DAMAGE + CATEGORY_DECKDES)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCost(s.spcost)
  	e1:SetTarget(s.sptarget)
  	e1:SetOperation(s.spoperation)
  	c:RegisterEffect(e1)
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return not e:GetHandler():IsPublic()
  	end
  end
  function s.sptarget(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsPlayerCanDiscardDeck(tp, 1) and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DECKDES, nil, 0, tp, 1)
  end
  function s.spoperation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	Duel.DiscardDeck(tp, 1, REASON_EFFECT)
  	local g = Duel.GetOperatedGroup()
  	local tc = g:GetFirst()
  	if tc then
  		Duel.BreakEffect()
  		if tc:IsType(TYPE_MONSTER) then
  			Duel.Damage(1 - tp, tc:GetLevel() * 200, REASON_EFFECT)
  			if not c:IsRelateToEffect(e) then
  				return
  			end
  			Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
  		else
  			if c:IsRelateToEffect(e) then
  				Duel.Destroy(c, REASON_EFFECT)
  			end
  		end
  	end
  end
  
  
source_text: Gallis
  You can reveal this card in your hand; send the top card of your Deck to the Graveyard, then, if it was a monster, inflict damage to your opponent equal to its Level x 200 and Special Summon this card from your hand, otherwise destroy this card.
target_text: -- Gallis
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_DAMAGE + CATEGORY_DECKDES)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCost(s.spcost)
  	e1:SetTarget(s.sptarget)
  	e1:SetOperation(s.spoperation)
  	c:RegisterEffect(e1)
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return not e:GetHandler():IsPublic()
  	end
  end
  function s.sptarget(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsPlayerCanDiscardDeck(tp, 1) and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DECKDES, nil, 0, tp, 1)
  end
  function s.spoperation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	Duel.DiscardDeck(tp, 1, REASON_EFFECT)
  	local g = Duel.GetOperatedGroup()
  	local tc = g:GetFirst()
  	if tc then
  		Duel.BreakEffect()
  		if tc:IsType(TYPE_MONSTER) then
  			Duel.Damage(1 - tp, tc:GetLevel() * 200, REASON_EFFECT)
  			if not c:IsRelateToEffect(e) then
  				return
  			end
  			Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
  		else
  			if c:IsRelateToEffect(e) then
  				Duel.Destroy(c, REASON_EFFECT)
  			end
  		end
  	end
  end
  
  