Skip to content

Duel.RemoveOverlayCard ​

Signature ​

lua
Duel.RemoveOverlayCard(int player, int s, int o, int min, int max, int reason) -> int

Description ​

Lets player remove between min and max Xyz Materials from the specified own/opponent field locations for reason. s marks locations on player's own field and o marks locations on the opponent's field, from player's perspective. The return value is the number of materials removed.

Parameters ​

  • player int
  • s int
  • o int
  • min int
  • max int
  • reason int

Returns ​

  • int

Source ​

  • D:\Programs\GitHub\ygopro-core\libduel.cpp:5018

Guided Examples ​

Learn how to use this function in context:

Used By ​

Generated from the local Scripts/ folder and cards.cdb.

  • Detected in 40 indexed script(s).
  • Search this function in the Script Explorer with Duel.RemoveOverlayCard.
CardIDScriptDetected Calls
Goblin's Crazy Beast71100270Scripts/c71100270.lua1
LeVirtue Dragon33113958Scripts/c33113958.lua1
Valiant Shark Lancer23672629Scripts/c23672629.lua1
Garbage Golem28968609Scripts/c28968609.lua1
Unbreakable Xyz Barrier96004535Scripts/c96004535.lua1
Tally-ho! Springans9175957Scripts/c9175957.lua1
Mansion of the Dreadful Dolls36890111Scripts/c36890111.lua1
Baromet the Sacred Sheep Shrub62967433Scripts/c62967433.lua1
Goblin Bikers Gone Bonkers46014517Scripts/c46014517.lua2
Xyz Force31398842Scripts/c31398842.lua1
Ryzeal Duo Drive7511613Scripts/c7511613.lua1
Mikanko Shinbu - Noble Twins84550369Scripts/c84550369.lua1
Xyz Poseidon Splash16938770Scripts/c16938770.lua1
Spright Sprind72329844Scripts/c72329844.lua1
Battlin' Boxer King Dempsey46804536Scripts/c46804536.lua1
Springans Captain Sargas29601381Scripts/c29601381.lua1
Migratory Zereort87640391Scripts/c87640391.lua1
Time Thief Bezel Ship82496097Scripts/c82496097.lua1
Constellar Castor33302589Scripts/c33302589.lua1
Xyz Lay43150717Scripts/c43150717.lua1
Goblin Biker Clatter Sploder51473858Scripts/c51473858.lua1
Goblin Biker Troika Griare44241999Scripts/c44241999.lua2
Goblin Biker Grand Stampede50311058Scripts/c50311058.lua1
Daruma Dropper35394356Scripts/c35394356.lua1
...and 16 more

Script Examples ​

Goblin's Crazy Beast (71100270) ​

Source: Scripts/c71100270.lua

lua
	local c=e:GetHandler()
	local tc=Duel.GetFirstTarget()
	if Duel.RemoveOverlayCard(tp,1,1,2,2,REASON_EFFECT)~=0
		and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
		local og=tc:GetOverlayGroup()

LeVirtue Dragon (33113958) ​

Source: Scripts/c33113958.lua

lua
end
function s.thop2(e,tp,eg,ep,ev,re,r,rp)
	if not Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_EFFECT) or Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_EFFECT)==0 then return end
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
	local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter2),tp,LOCATION_GRAVE,0,1,1,nil)

Valiant Shark Lancer (23672629) ​

Source: Scripts/c23672629.lua

lua
function c23672629.desop(e,tp,eg,ep,ev,re,r,rp)
	local tc=Duel.GetFirstTarget()
	if Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_EFFECT)>0 and tc:IsRelateToEffect(e) then
		Duel.Destroy(tc,REASON_EFFECT)
	end