Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-scripts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
ygopro-scripts
Commits
7fbf0605
You need to sign in or sign up before continuing.
Commit
7fbf0605
authored
Oct 15, 2024
by
salix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add aux.BecomeOriginalCode
parent
2db3cea8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
15 deletions
+23
-15
c30312361.lua
c30312361.lua
+2
-8
c50584941.lua
c50584941.lua
+4
-7
utility.lua
utility.lua
+17
-0
No files found.
c30312361.lua
View file @
7fbf0605
...
@@ -38,15 +38,9 @@ function c30312361.operation(e,tp,eg,ep,ev,re,r,rp)
...
@@ -38,15 +38,9 @@ function c30312361.operation(e,tp,eg,ep,ev,re,r,rp)
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
==
1
and
c
:
IsRelateToEffect
(
e
)
and
c
:
IsFaceup
()
then
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
==
1
and
c
:
IsRelateToEffect
(
e
)
and
c
:
IsFaceup
()
then
--copy name, base atk
--copy name, base atk
local
code
=
tc
:
GetOriginalCode
Rule
()
local
code
=
tc
:
GetOriginalCode
()
local
ba
=
tc
:
GetBaseAttack
()
local
ba
=
tc
:
GetBaseAttack
()
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
aux
.
BecomeOriginalCode
(
c
,
tc
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetCode
(
EFFECT_CHANGE_CODE
)
e1
:
SetValue
(
code
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
...
...
c50584941.lua
View file @
7fbf0605
...
@@ -28,6 +28,7 @@ function c50584941.cost(e,tp,eg,ep,ev,re,r,rp,chk)
...
@@ -28,6 +28,7 @@ function c50584941.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c50584941
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
tp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c50584941
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
tp
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
e
:
SetLabel
(
g
:
GetFirst
():
GetOriginalCode
())
e
:
SetLabel
(
g
:
GetFirst
():
GetOriginalCode
())
e
:
SetLabelObject
(
g
:
GetFirst
())
end
end
function
c50584941
.
filter
(
c
,
code
)
function
c50584941
.
filter
(
c
,
code
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x1045
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
and
not
c
:
IsCode
(
code
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x1045
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
and
not
c
:
IsCode
(
code
)
...
@@ -37,6 +38,7 @@ function c50584941.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
...
@@ -37,6 +38,7 @@ function c50584941.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if
chk
==
0
then
if
chk
==
0
then
if
e
:
GetLabel
()
~=
1
then
return
false
end
if
e
:
GetLabel
()
~=
1
then
return
false
end
e
:
SetLabel
(
0
)
e
:
SetLabel
(
0
)
e
:
SetLabelObject
(
nil
)
return
true
return
true
end
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
...
@@ -46,14 +48,9 @@ function c50584941.activate(e,tp,eg,ep,ev,re,r,rp)
...
@@ -46,14 +48,9 @@ function c50584941.activate(e,tp,eg,ep,ev,re,r,rp)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
local
code
=
e
:
GetLabel
()
local
code
=
e
:
GetLabel
()
local
source
=
e
:
GetLabelObject
()
if
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
if
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
local
e1
=
Effect
.
CreateEffect
(
c
)
aux
.
BecomeOriginalCode
(
c
,
source
,
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CHANGE_CODE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetValue
(
code
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
tc
:
ReplaceEffect
(
code
,
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
ReplaceEffect
(
code
,
RESET_EVENT
+
RESETS_STANDARD
)
end
end
end
end
utility.lua
View file @
7fbf0605
...
@@ -1776,3 +1776,20 @@ end
...
@@ -1776,3 +1776,20 @@ end
function
Auxiliary
.
MimighoulFlipCondition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
Auxiliary
.
MimighoulFlipCondition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsMainPhase
()
return
Duel
.
IsMainPhase
()
end
end
---The name of `c` becomes the original name of `tc`
---@param c Card
---@param tc Card
---@param reset? integer defult: RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END
---@return Effect
function
Auxiliary
.
BecomeOriginalCode
(
c
,
tc
,
reset
)
reset
=
reset
or
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
local
code
=
tc
:
GetOriginalCodeRule
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CHANGE_CODE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetValue
(
code
)
e1
:
SetReset
(
reset
)
c
:
RegisterEffect
(
e1
)
return
e1
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment