Skip to content

Duel.Equip ​

Signature ​

lua
Duel.Equip(int player, Card c1, Card c2, [bool up], [bool is_step]) -> bool

Description ​

Equips c1 to c2 for player and returns true if the equip succeeds. up defaults to true and makes the Equip Card face-up. When is_step is true, call Duel.EquipComplete after all step equips have been created. Register or rely on an EFFECT_EQUIP_LIMIT so the card can legally remain equipped to that monster.

How To Use It ​

Use this after both the Equip Card and the monster it will equip to are still valid.

A self-equip effect usually creates an Equip Limit after the equip succeeds so the card stays attached only to the intended monster:

lua
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if tc and tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and Duel.Equip(tp,c,tc) then
    local e1=Effect.CreateEffect(c)
    e1:SetType(EFFECT_TYPE_SINGLE)
    e1:SetCode(EFFECT_EQUIP_LIMIT)
    e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
    e1:SetValue(function(e,ec) return ec==tc end)
    e1:SetReset(RESET_EVENT+RESETS_STANDARD)
    c:RegisterEffect(e1)
end

When several cards are equipped as one procedure with is_step=true, call Duel.EquipComplete() after the final successful step.

Parameters ​

  • player int
  • c1 Card
  • c2 Card
  • up bool optional - default: true
  • is_step bool optional - default: false

Returns ​

  • bool

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 664 indexed script(s).
  • Search this function in the Script Explorer with Duel.Equip.
CardIDScriptDetected Calls
Salamandra with Chain62091148Scripts/c62091148.lua1
Fiendsmith's Sequence49867899Scripts/c49867899.lua1
Spirit Illusion71939275Scripts/c71939275.lua1
Pere-Zenet Em Heru46273941Scripts/c46273941.lua1
Am Duazenet45151304Scripts/c45151304.lua1
Converging Wishes20007374Scripts/c20007374.lua1
Graydle Split75361204Scripts/c75361204.lua1
Shining Draw35906693Scripts/c35906693.lua1
Plunder Patroll Shipshape Ships Shipping44227727Scripts/c44227727.lua1
Red-Eyes Slash Dragon21140872Scripts/c21140872.lua1
Power Patron DoomZ81650695Scripts/c81650695.lua1
Power Tool Braver Dragon63265554Scripts/c63265554.lua1
Meklord Astro Mekanikle63468625Scripts/c63468625.lua1
Amazement Administrator Arlekino94821366Scripts/c94821366.lua1
DoomZ XII Zero - Drastea92472273Scripts/c92472273.lua1
Tails of the Fairy Tails82119326Scripts/c82119326.lua1
Seven Stars Slash - Army Annihilator Hagun65114115Scripts/c65114115.lua1
Zoroa, the Magistus Verethragna37260677Scripts/c37260677.lua1
Emperor Charles the Great97864322Scripts/c97864322.lua1
Inzektor Picofalena97273514Scripts/c97273514.lua1
Favorite Hero11881272Scripts/c11881272.lua1
Amaze Attraction Wonder Wheel93473606Scripts/c93473606.lua1
Heroic Champion - Magnum Excalibur14301396Scripts/c14301396.lua1
Nephe Shaddoll Fusion60226558Scripts/c60226558.lua1
...and 640 more

Script Examples ​

Salamandra with Chain (62091148) ​

Source: Scripts/c62091148.lua

lua
	if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
	local tc=Duel.GetFirstTarget()
	if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.Equip(tp,c,tc) then
		local e1=Effect.CreateEffect(c)
		e1:SetType(EFFECT_TYPE_EQUIP)

Fiendsmith's Sequence (49867899) ​

Source: Scripts/c49867899.lua

lua
			return
		end
		if not Duel.Equip(tp,c,tc) then return end
		local e1=Effect.CreateEffect(c)
		e1:SetType(EFFECT_TYPE_SINGLE)

Spirit Illusion (71939275) ​

Source: Scripts/c71939275.lua

lua
	local tc=Duel.GetFirstTarget()
	if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
		Duel.Equip(tp,c,tc)
	end
end