Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
P
pre-release-database-cdb
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
Vury Leo
pre-release-database-cdb
Commits
89b34170
You need to sign in or sign up before continuing.
Commit
89b34170
authored
May 15, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add DefineGetterTemp
parent
7261e221
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
4 deletions
+48
-4
script/c101301054.lua
script/c101301054.lua
+48
-4
No files found.
script/c101301054.lua
View file @
89b34170
...
@@ -125,6 +125,7 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
...
@@ -125,6 +125,7 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local
ac
=
Duel
.
AnnounceCard
(
tp
,
table.unpack
(
afilter
))
local
ac
=
Duel
.
AnnounceCard
(
tp
,
table.unpack
(
afilter
))
s
.
AddToAnnounced
(
tp
,
ac
)
s
.
AddToAnnounced
(
tp
,
ac
)
Duel
.
SetTargetParam
(
ac
)
Duel
.
SetTargetParam
(
ac
)
Auxiliary
.
DefineGetterTemp
(
getmetatable
(
e
:
GetHandler
()),
"announce_filter"
,
s
.
announce_filter_func
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_ANNOUNCE
,
nil
,
0
,
tp
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_ANNOUNCE
,
nil
,
0
,
tp
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
end
...
@@ -157,16 +158,61 @@ end
...
@@ -157,16 +158,61 @@ end
function
Auxiliary
.
DefineGetter
(
mt
,
field
,
f
)
function
Auxiliary
.
DefineGetter
(
mt
,
field
,
f
)
if
not
mt
.
_getters
then
if
not
mt
.
_getters
then
mt
.
_getters
=
{}
mt
.
_getters
=
{}
end
if
not
mt
.
__define_getter_registered__
then
mt
.
__define_getter_registered__
=
true
local
old_index
=
mt
.
__index
mt
.
__index
=
function
(
self
,
key
)
mt
.
__index
=
function
(
self
,
key
)
if
mt
.
_getters
[
key
]
~=
nil
then
if
mt
.
_getters
and
mt
.
_getters
[
key
]
~=
nil
then
return
mt
.
_getters
[
key
](
self
)
return
mt
.
_getters
[
key
](
self
)
end
end
return
mt
[
key
]
if
type
(
old_index
)
==
"function"
then
return
old_index
(
self
,
key
)
elseif
type
(
old_index
)
==
"table"
then
return
old_index
[
key
]
end
return
nil
end
end
end
end
mt
.
_getters
[
field
]
=
f
mt
.
_getters
[
field
]
=
f
end
end
function
Auxiliary
.
DefineSetter
(
mt
,
field
,
f
)
local
mtmt
=
getmetatable
(
mt
)
if
not
mt
.
_setters
then
mt
.
_setters
=
{}
end
if
not
mtmt
.
__define_setter_registered__
then
mtmt
.
__define_setter_registered__
=
true
local
old_newindex
=
mtmt
.
__newindex
mtmt
.
__newindex
=
function
(
self
,
key
,
value
)
if
self
.
_setters
and
self
.
_setters
[
key
]
~=
nil
then
self
.
_setters
[
key
](
self
,
value
)
else
if
type
(
old_newindex
)
==
"function"
then
old_newindex
(
self
,
key
,
value
)
else
rawset
(
self
,
key
,
value
)
end
end
end
end
mt
.
_setters
[
field
]
=
f
end
function
Auxiliary
.
DefineGetterTemp
(
mt
,
field
,
f
)
Auxiliary
.
DefineGetter
(
mt
,
field
,
f
)
Auxiliary
.
DefineSetter
(
mt
,
field
,
function
(
self
,
value
)
if
self
.
_getters
and
self
.
_getters
[
field
]
==
f
then
self
.
_getters
[
field
]
=
nil
end
if
self
.
_setters
then
self
.
_setters
[
field
]
=
nil
end
rawset
(
self
,
field
,
value
)
end
)
end
function
s
.
announce_filter_func
(
c
)
function
s
.
announce_filter_func
(
c
)
local
tp
=
c
:
GetControler
()
local
tp
=
c
:
GetControler
()
local
exg
=
Duel
.
GetMatchingGroup
(
aux
.
AND
(
Card
.
IsFaceup
,
Card
.
IsSetCard
),
tp
,
LOCATION_MZONE
,
0
,
nil
,
0x2cd
)
local
exg
=
Duel
.
GetMatchingGroup
(
aux
.
AND
(
Card
.
IsFaceup
,
Card
.
IsSetCard
),
tp
,
LOCATION_MZONE
,
0
,
nil
,
0x2cd
)
...
@@ -184,5 +230,3 @@ function s.announce_filter_func(c)
...
@@ -184,5 +230,3 @@ function s.announce_filter_func(c)
end
end
return
af
return
af
end
end
Auxiliary
.
DefineGetter
(
s
,
"announce_filter"
,
s
.
announce_filter_func
)
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