Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-scripts-888
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
4
Merge Requests
4
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
MyCard
ygopro-scripts-888
Commits
b2bb47f8
Commit
b2bb47f8
authored
Mar 26, 2024
by
Chen Bill
Committed by
GitHub
Mar 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Auxiliary.AddEquipSpellEffect (#2387)
parent
fd8915c3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
45 deletions
+56
-45
c1435851.lua
c1435851.lua
+1
-16
c242146.lua
c242146.lua
+1
-29
utility.lua
utility.lua
+54
-0
No files found.
c1435851.lua
View file @
b2bb47f8
--ドラゴンの秘宝
--ドラゴンの秘宝
function
c1435851
.
initial_effect
(
c
)
function
c1435851
.
initial_effect
(
c
)
--Activate
aux
.
AddEquipSpellEffect
(
c
,
true
,
true
,
c1435851
.
filter
,
c1435851
.
eqlimit
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_CONTINUOUS_TARGET
)
e1
:
SetTarget
(
c1435851
.
target
)
e1
:
SetOperation
(
c1435851
.
operation
)
c
:
RegisterEffect
(
e1
)
--atk up
--atk up
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_EQUIP
)
e2
:
SetType
(
EFFECT_TYPE_EQUIP
)
...
@@ -21,13 +13,6 @@ function c1435851.initial_effect(c)
...
@@ -21,13 +13,6 @@ function c1435851.initial_effect(c)
e3
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
e3
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
e3
:
SetValue
(
300
)
e3
:
SetValue
(
300
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
--equip limit
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
)
e4
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e4
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e4
:
SetValue
(
c1435851
.
eqlimit
)
c
:
RegisterEffect
(
e4
)
end
end
function
c1435851
.
eqlimit
(
e
,
c
)
function
c1435851
.
eqlimit
(
e
,
c
)
return
c
:
IsRace
(
RACE_DRAGON
)
return
c
:
IsRace
(
RACE_DRAGON
)
...
...
c242146.lua
View file @
b2bb47f8
--城壁壊しの大槍
--城壁壊しの大槍
function
c242146
.
initial_effect
(
c
)
function
c242146
.
initial_effect
(
c
)
--Activate
aux
.
AddEquipSpellEffect
(
c
,
true
,
true
,
Card
.
IsFaceup
,
nil
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_CONTINUOUS_TARGET
)
e1
:
SetTarget
(
c242146
.
target
)
e1
:
SetOperation
(
c242146
.
operation
)
c
:
RegisterEffect
(
e1
)
--atk up
--atk up
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_EQUIP
)
e2
:
SetType
(
EFFECT_TYPE_EQUIP
)
...
@@ -16,26 +8,6 @@ function c242146.initial_effect(c)
...
@@ -16,26 +8,6 @@ function c242146.initial_effect(c)
e2
:
SetCondition
(
c242146
.
atkcon
)
e2
:
SetCondition
(
c242146
.
atkcon
)
e2
:
SetValue
(
1500
)
e2
:
SetValue
(
1500
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--Equip limit
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e3
:
SetValue
(
1
)
c
:
RegisterEffect
(
e3
)
end
function
c242146
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsFaceup
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c242146
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
e
:
GetHandler
():
IsRelateToEffect
(
e
)
and
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
Duel
.
Equip
(
tp
,
e
:
GetHandler
(),
tc
)
end
end
end
function
c242146
.
atkcon
(
e
)
function
c242146
.
atkcon
(
e
)
if
Duel
.
GetCurrentPhase
()
~=
PHASE_DAMAGE_CAL
then
return
false
end
if
Duel
.
GetCurrentPhase
()
~=
PHASE_DAMAGE_CAL
then
return
false
end
...
...
utility.lua
View file @
b2bb47f8
...
@@ -1524,6 +1524,60 @@ function Auxiliary.GiveUpNormalDraw(e,tp,property)
...
@@ -1524,6 +1524,60 @@ function Auxiliary.GiveUpNormalDraw(e,tp,property)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RegisterFlagEffect
(
tp
,
FLAG_ID_NO_NORMAL_DRAW
,
RESET_PHASE
+
PHASE_DRAW
,
property
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
FLAG_ID_NO_NORMAL_DRAW
,
RESET_PHASE
+
PHASE_DRAW
,
property
,
1
)
end
end
---Add EFFECT_TYPE_ACTIVATE effect to Equip Spell Cards
---@param c Card
---@param is_self boolean
---@param is_opponent boolean
---@param filter function
---@param eqlimit function|nil
---@param pause? boolean
---@param skip_target? boolean
function
Auxiliary
.
AddEquipSpellEffect
(
c
,
is_self
,
is_opponent
,
filter
,
eqlimit
,
pause
,
skip_target
)
local
value
=
(
type
(
eqlimit
)
==
"function"
)
and
eqlimit
or
1
if
pause
==
nil
then
pause
=
false
end
if
skip_target
==
nil
then
skip_target
=
false
end
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_CONTINUOUS_TARGET
)
if
not
skip_target
then
e1
:
SetTarget
(
Auxiliary
.
EquipSpellTarget
(
is_self
,
is_opponent
,
filter
,
eqlimit
))
end
e1
:
SetOperation
(
Auxiliary
.
EquipSpellOperation
(
eqlimit
))
if
not
pause
then
c
:
RegisterEffect
(
e1
)
end
--Equip limit
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetValue
(
value
)
c
:
RegisterEffect
(
e2
)
return
e1
end
function
Auxiliary
.
EquipSpellTarget
(
is_self
,
is_opponent
,
filter
,
eqlimit
)
local
loc1
=
is_self
and
LOCATION_MZONE
or
0
local
loc2
=
is_opponent
and
LOCATION_MZONE
or
0
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsFaceup
()
and
(
not
eqlimit
or
eqlimit
(
e
,
chkc
))
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
filter
,
tp
,
loc1
,
loc2
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
filter
,
tp
,
loc1
,
loc2
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
end
function
Auxiliary
.
EquipSpellOperation
(
eqlimit
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
c
:
IsRelateToEffect
(
e
)
and
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
and
(
not
eqlimit
or
eqlimit
(
e
,
tc
))
then
Duel
.
Equip
(
tp
,
c
,
tc
)
end
end
end
---If this face-up card would leave the field, banish it instead.
---If this face-up card would leave the field, banish it instead.
---@param c Card
---@param c Card
---@param condition? function
---@param condition? function
...
...
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