Skip to content

Card.ReplaceEffect ​

Signature ​

lua
Card.ReplaceEffect(Card c, int code, int reset, [int count]) -> int

Description ​

Replaces c's effects with the effects of card code under the given reset flags and returns the replacement id. count defaults to 1; phase resets automatically include both players' turns when no turn side is specified.

Parameters ​

  • c Card
  • code int
  • reset int
  • count int optional - default: 1

Returns ​

  • int

Source ​

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

Used By ​

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

  • Detected in 2 indexed script(s).
  • Search this function in the Script Explorer with Card.ReplaceEffect.
CardIDScriptDetected Calls
Arcana Call99189322Scripts/c99189322.lua1
Red Supremacy50584941Scripts/c50584941.lua1

Script Examples ​

Arcana Call (99189322) ​

Source: Scripts/c99189322.lua

lua
	if Duel.Remove(regc,POS_FACEUP,REASON_EFFECT)==0 or not regc:IsLocation(LOCATION_REMOVED) then return end
	if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetFlagEffect(FLAG_ID_REVERSAL_OF_FATE)~=0 and tc:GetFlagEffect(FLAG_ID_ARCANA_COIN)~=0 then
		local cid=tc:ReplaceEffect(regc:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
		tc:RegisterFlagEffect(99189322,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END,0,1)
		local e1=Effect.CreateEffect(e:GetHandler())

Red Supremacy (50584941) ​

Source: Scripts/c50584941.lua

lua
		e1:SetReset(RESET_EVENT+RESETS_STANDARD)
		tc:RegisterEffect(e1)
		tc:ReplaceEffect(code,RESET_EVENT+RESETS_STANDARD)
	end
end