Skip to content

Card.GetPreviousEquipTarget ​

Signature ​

lua
Card.GetPreviousEquipTarget(Card c) -> Card|nil

Description ​

Returns c's previous Equip target, or nil. Use this for lost-target and sent-from-field Equip Card triggers after the live equip relationship is gone.

How To Use It ​

Use this after an Equip Card has left its equip relationship and the effect needs to know which monster it was previously equipped to.

lua
local ec=e:GetHandler():GetPreviousEquipTarget()
return e:GetHandler():IsReason(REASON_LOST_TARGET) and ec~=nil

This is the usual read for lost-target or sent-from-field Equip Card triggers. It is not a live equip relationship.

Parameters ​

  • c Card

Returns ​

  • Card|nil

Source ​

  • D:\Programs\GitHub\ygopro-core\libcard.cpp:3575

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 45 indexed script(s).
  • Search this function in the Script Explorer with Card.GetPreviousEquipTarget.
CardIDScriptDetected Calls
Parasite Paranoid14457896Scripts/c14457896.lua1
"Infernoble Arms - Almace"98319530Scripts/c98319530.lua1
Execution of the Contract55976207Scripts/c55976207.lua1
"Infernoble Arms - Durendal"37478723Scripts/c37478723.lua1
Gemini Booster18096222Scripts/c18096222.lua1
Borrel Regenerator6556178Scripts/c6556178.lua1
Grief Tablet18046862Scripts/c18046862.lua1
Archfiend's Staff of Despair21438286Scripts/c21438286.lua1
Parasomnia Pillow44092304Scripts/c44092304.lua2
Prevention Star94303232Scripts/c94303232.lua1
Cyberdark Claw82562802Scripts/c82562802.lua1
ZW - Sleipnir Mail2648201Scripts/c2648201.lua1
Attachment Cybern79875526Scripts/c79875526.lua1
Cyberdark Cannon45078193Scripts/c45078193.lua1
"Infernoble Arms - Joyeuse"90861137Scripts/c90861137.lua1
Dragunity Aklys36870345Scripts/c36870345.lua1
"Infernoble Arms - Hauteclere"64867422Scripts/c64867422.lua1
Inzektor Giga-Mantis94573223Scripts/c94573223.lua1
Spirit Burner50418970Scripts/c50418970.lua1
Red-Eyes Baby Dragon58257569Scripts/c58257569.lua1
Orb of Yasaka74115234Scripts/c74115234.lua1
Iron Chain Snake80769747Scripts/c80769747.lua1
U.A. Powered Jersey35884610Scripts/c35884610.lua1
Inzektor Giga-Weevil21977828Scripts/c21977828.lua1
...and 21 more

Script Examples ​

Parasite Paranoid (14457896) ​

Source: Scripts/c14457896.lua

lua
function c14457896.spcon(e,tp,eg,ep,ev,re,r,rp)
	local c=e:GetHandler()
	return c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousEquipTarget()
end
function c14457896.spfilter(c,e,tp)

"Infernoble Arms - Almace" (98319530) ​

Source: Scripts/c98319530.lua

lua
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
	local c=e:GetHandler()
	return c:IsReason(REASON_LOST_TARGET) and c:GetPreviousEquipTarget():IsLocation(LOCATION_GRAVE)
end
function s.thfilter(c)

Execution of the Contract (55976207) ​

Source: Scripts/c55976207.lua

lua
function c55976207.descon(e,tp,eg,ep,ev,re,r,rp)
	local c=e:GetHandler()
	local tc=c:GetPreviousEquipTarget()
	return tc and tc:IsReason(REASON_RELEASE) and c:IsReason(REASON_LOST_TARGET)
end