Duel.ChangePosition
Signature
Duel.ChangePosition(Card|Group targets, int au, [int ad], [int du], [int dd], [bool noflip]) -> intDescription
Changes the battle position of targets and returns the number of cards whose position actually changed. The position arguments map by current position: au for face-up Attack Position, ad for face-down Attack Position, du for face-up Defense Position, and dd for face-down Defense Position. Omitted values use au.
How To Use It
Use this when an effect changes battle position during resolution.
The short form changes every target to the same position:
if tc:IsRelateToEffect(e) then
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)
endFor mixed current positions, pass the destination for face-up Attack, face-down Attack, face-up Defense, and face-down Defense in that order. MDPro4's core does not read the old seventh setavailable argument.
Related Functions
Parameters
targetsCard|Groupauintadintoptional - default: auduintoptional - default: auddintoptional - default: aunoflipbooloptional - default: false
Returns
int
Source
D:\Programs\GitHub\ygopro-core\libduel.cpp:4880
Guided Examples
Learn how to use this function in context:
- Methods for Affecting Cards
- Battle Position Effects
- Write Your First Custom Card
- First Scripts To Study
- Quick-Play Spells
Used By
Generated from the local Scripts/ folder and cards.cdb.
- Detected in 517 indexed script(s).
- Search this function in the Script Explorer with
Duel.ChangePosition.
Script Examples
Salamandra with Chain (62091148)
Source: Scripts/c62091148.lua
Duel.HintSelection(g)
local tc2=g:GetFirst()
Duel.ChangePosition(tc2,POS_FACEDOWN_DEFENSE)
end
elseDeftero Enneacraft - "alazoneIA" (92171126)
Source: Scripts/c92171126.lua
function s.thcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
function s.thfilter2(c)Enneacraft - Asta.PIXEA (28454232)
Source: Scripts/c28454232.lua
function s.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)