Skip to content

Duel.Recover ​

Signature ​

lua
Duel.Recover(int player, int value, int reason, [bool is_step]) -> int

Description ​

Gives player LP for reason and returns the amount processed. Effects can reverse recovery into damage; when recovery is reversed, this function returns 0 for recovery. Negative input amounts are clamped to 0 by the local binding. With is_step=true, finish the damage/recovery batch with Duel.RDComplete.

How To Use It ​

Use this during resolution when a player gains LP.

lua
local gained=Duel.Recover(tp,1000,REASON_EFFECT)
if gained>0 then
    -- follow-up that requires actual recovery
end

The return value is the actual recovery applied. If recovery is reversed into damage, the recovery return value is 0. For simultaneous damage/recovery batches, use is_step=true and finish with Duel.RDComplete().

Parameters ​

  • player int
  • value int
  • reason int
  • is_step bool optional - default: false

Returns ​

  • int

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 268 indexed script(s).
  • Search this function in the Script Explorer with Duel.Recover.
CardIDScriptDetected Calls
Earthbound Servant Geo Gremlin8690387Scripts/c8690387.lua1
Awakening of the Sacred Beasts53701259Scripts/c53701259.lua2
GMX - VELOX82706696Scripts/c82706696.lua1
Darklord Uprising54527349Scripts/c54527349.lua1
D/D/D Vice King Requiem25857977Scripts/c25857977.lua1
Supreme King Gate Infinity22211622Scripts/c22211622.lua1
Salamangreat Sanctuary1295111Scripts/c1295111.lua1
Condemned Darklord35306215Scripts/c35306215.lua1
Performapal Corn33103459Scripts/c33103459.lua1
Raidraptor - Last Strix97219708Scripts/c97219708.lua1
Crossmind Archfiend52644170Scripts/c52644170.lua1
Yum☆Yum☆Yummys56870908Scripts/c56870908.lua1
The Chaotic Phantasmal Sacred Beasts7894706Scripts/c7894706.lua1
Don Thousand's Throne93238626Scripts/c93238626.lua1
Vesper Girsu97345699Scripts/c97345699.lua1
Exosister Irene79858629Scripts/c79858629.lua1
Aromalilith Rosemary30989084Scripts/c30989084.lua1
The Sacred Waters in the Sky26684111Scripts/c26684111.lua1
Ancient Fairy Dragon25862681Scripts/c25862681.lua1
Sun God Unification77432167Scripts/c77432167.lua1
Ebon Sun96029570Scripts/c96029570.lua1
R.B. Operation Test16066654Scripts/c16066654.lua1
Performapal Odd-Eyes Butler56677752Scripts/c56677752.lua1
Gizmek Yata, the Gleaming Vanguard13224603Scripts/c13224603.lua1
...and 244 more

Script Examples ​

Earthbound Servant Geo Gremlin (8690387) ​

Source: Scripts/c8690387.lua

lua
		Duel.Destroy(tc,REASON_EFFECT)
	else
		Duel.Recover(tp,tc:GetAttack(),REASON_EFFECT)
	end
end

Awakening of the Sacred Beasts (53701259) ​

Source: Scripts/c53701259.lua

lua
	local lg=eg:Filter(c53701259.cfilter,nil,1-tp)
	local rnum=lg:GetSum(Card.GetAttack)
	Duel.Recover(tp,rnum,REASON_EFFECT)
end
function c53701259.regcon(e,tp,eg,ep,ev,re,r,rp)

GMX - VELOX (82706696) ​

Source: Scripts/c82706696.lua

lua
function s.recop(e,tp,eg,ep,ev,re,r,rp)
	Duel.Hint(HINT_CARD,0,id)
	Duel.Recover(tp,200,REASON_EFFECT)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)