Skip to content

Duel.GetChainMaterial ​

Signature ​

lua
Duel.GetChainMaterial(int player) -> Effect|nil

Description ​

Returns the first EFFECT_CHAIN_MATERIAL effect currently applying to player, or nil if none applies. Fusion-style scripts use the returned effect's target and operation callbacks to handle Chain Material alternatives.

Parameters ​

  • player int - Player checked for an applying EFFECT_CHAIN_MATERIAL effect.

Returns ​

  • Effect|nil - First applying EFFECT_CHAIN_MATERIAL effect; no Lua value is pushed if player is invalid or no such effect exists, which behaves as nil in normal assignment.

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 219 indexed script(s).
  • Search this function in the Script Explorer with Duel.GetChainMaterial.
CardIDScriptDetected Calls
Salamandra with Chain62091148Scripts/c62091148.lua2
Astrograph Sorcerer, the Starfrost Magician48171151Scripts/c48171151.lua1
Artmage Non-Finito74631897Scripts/c74631897.lua2
Lady's Dragonmaid48658295Scripts/c48658295.lua2
Eternal Favorite87532344Scripts/c87532344.lua2
Surprise Fusion35167375Scripts/c35167375.lua2
Spellbook of the Grand Circle11911336Scripts/c11911336.lua2
Ultra Polymerization76647978Scripts/c76647978.lua2
Melffy Playtime Surprise58036097Scripts/c58036097.lua2
Destiny HERO - Destro-Dogma25158975Scripts/c25158975.lua2
Yomagna the Fire Phantom17350692Scripts/c17350692.lua2
Fiendsmith's Sequence49867899Scripts/c49867899.lua2
D/D/D Alfred the Divine Sage King11852093Scripts/c11852093.lua2
Mementotlan Fusion66518509Scripts/c66518509.lua2
Favorite HERO Flame Wingman13243124Scripts/c13243124.lua2
Mixousia the Confounder80843006Scripts/c80843006.lua2
Gem-Knight Dispersion24220368Scripts/c24220368.lua2
Invoked Sorath43989315Scripts/c43989315.lua2
Spirit Illusion71939275Scripts/c71939275.lua2
Lubellion the Searing Dragon70534340Scripts/c70534340.lua2
Destratification Dino Stratiae3841104Scripts/c3841104.lua2
Magnet Bonding65514302Scripts/c65514302.lua2
Hecahands Tartaros57809669Scripts/c57809669.lua2
Aiwass, Divine Spirit of the Law84288367Scripts/c84288367.lua2
...and 195 more

Script Examples ​

Salamandra with Chain (62091148) ​

Source: Scripts/c62091148.lua

lua
		local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
		if not res then
			local ce=Duel.GetChainMaterial(tp)
			if ce~=nil then
				local fgroup=ce:GetTarget()

Astrograph Sorcerer, the Starfrost Magician (48171151) ​

Source: Scripts/c48171151.lua

lua
	local mg3=nil
	local sg2=nil
	local ce=Duel.GetChainMaterial(tp)
	if ce~=nil then
		local fgroup=ce:GetTarget()

Artmage Non-Finito (74631897) ​

Source: Scripts/c74631897.lua

lua
		local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
		if not res then
			local ce=Duel.GetChainMaterial(tp)
			if ce~=nil then
				local fgroup=ce:GetTarget()