Skip to content

Card.GetOriginalCodeRule ​

Signature ​

lua
Card.GetOriginalCodeRule(Card c) -> int,int|nil

Description ​

Returns c's rule-original card code. Double-code cards return two codes: the printed original code and the second rule code. Other cards return only the duel code used by the core.

Parameters ​

  • c Card

Returns ​

  • int - Primary rule-original code.
  • int|nil - Second rule code, when present.

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 48 indexed script(s).
  • Search this function in the Script Explorer with Card.GetOriginalCodeRule.
CardIDScriptDetected Calls
Starving Venemy Dragon93729065Scripts/c93729065.lua1
Windwitch - Crystal Bell25793414Scripts/c25793414.lua1
Union Activation38527680Scripts/c38527680.lua2
Odd-Eyes Venom Dragon45014450Scripts/c45014450.lua1
Millennium-Eyes Restrict41578483Scripts/c41578483.lua2
Starving Venom Fusion Dragon41209827Scripts/c41209827.lua1
Majesty Pegasus, the Dracoslayer92332424Scripts/c92332424.lua1
Photon Change42925441Scripts/c42925441.lua1
Penguin Sword69792699Scripts/c69792699.lua2
Donner, Dagger Fur Hire8728498Scripts/c8728498.lua2
T.G. Rocket Salamander77392987Scripts/c77392987.lua2
Rokket Recharger5969957Scripts/c5969957.lua1
The Kaiju Files11163040Scripts/c11163040.lua2
Steel-Stringed Sacrifice7166709Scripts/c7166709.lua1
War Rock Meteoragon10497636Scripts/c10497636.lua2
Nephthys, the Sacred Preserver50669347Scripts/c50669347.lua1
Supreme King Dragon Starving Venom43387895Scripts/c43387895.lua1
Nightmell the Dark Bonder66569334Scripts/c66569334.lua1
Solemn Accusation78114463Scripts/c78114463.lua2
Test Panther66863374Scripts/c66863374.lua1
Dark Magic Talisman71440209Scripts/c71440209.lua1
Number 8: Heraldic King Genom-Heritage47387961Scripts/c47387961.lua1
Fist of Fate79868386Scripts/c79868386.lua2
Harpie Lady Elegance65664792Scripts/c65664792.lua3
...and 24 more

Script Examples ​

Starving Venemy Dragon (93729065) ​

Source: Scripts/c93729065.lua

lua
		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
		e1:SetCode(EFFECT_CHANGE_CODE)
		e1:SetValue(tc:GetOriginalCodeRule())
		e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
		c:RegisterEffect(e1)

Windwitch - Crystal Bell (25793414) ​

Source: Scripts/c25793414.lua

lua
	local tc=Duel.GetFirstTarget()
	if tc and c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsType(TYPE_TOKEN) then
		local code=tc:GetOriginalCodeRule()
		local cid=0
		local e1=Effect.CreateEffect(c)

Union Activation (38527680) ​

Source: Scripts/c38527680.lua

lua
function s.tgfilter(c,tp)
	return c:IsType(TYPE_NORMAL+TYPE_UNION) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_MACHINE) and c:IsAbleToGrave()
		and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,c,c:GetOriginalCodeRule(),c:GetAttack())
end
function s.thfilter(c,code,atk)