Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-222DIY-cards
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
Ai
ygopro-222DIY-cards
Commits
d0d91d60
Commit
d0d91d60
authored
May 18, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updates
parent
38cc7a4f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
434 additions
and
14 deletions
+434
-14
expansions/script/c37564224.lua
expansions/script/c37564224.lua
+2
-1
expansions/script/c37564317.lua
expansions/script/c37564317.lua
+2
-3
expansions/script/c37564335.lua
expansions/script/c37564335.lua
+1
-1
expansions/script/c37564529.lua
expansions/script/c37564529.lua
+2
-6
expansions/script/c37564765.lua
expansions/script/c37564765.lua
+3
-3
expansions/script/underscore.lua
expansions/script/underscore.lua
+424
-0
No files found.
expansions/script/c37564224.lua
View file @
d0d91d60
...
...
@@ -4,6 +4,7 @@ local cm=_G["c"..m]
Duel
.
LoadScript
(
"c37564765.lua"
)
function
cm
.
initial_effect
(
c
)
--activate
Auxiliary
.
AddCodeList
(
c
,
m
+
1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
...
...
@@ -12,7 +13,7 @@ function cm.initial_effect(c)
e1
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e1
)
end
cm
.
fit_monster
=
{
37564225
}
\\
function
cm
.
filter
(
c
,
e
,
tp
,
m1
,
m2
)
if
not
c
:
IsCode
(
37564225
)
or
not
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_RITUAL
,
tp
,
false
,
true
)
then
return
false
end
local
mg
=
m1
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
c
,
c
)
...
...
expansions/script/c37564317.lua
View file @
d0d91d60
...
...
@@ -9,7 +9,6 @@ function cm.initial_effect(c)
--[[if not cm.gg then
cm.gg=Group.CreateGroup()
cm.gg:KeepAlive()
cm.fit_monster={}
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
...
...
@@ -22,8 +21,8 @@ function cm.initial_effect(c)
cm.gg:AddCard(c)
end
end)
rg:ForEach(function(c)
table.insert(cm.fit_monster,
c:GetOriginalCode())
rg:ForEach(function(
t
c)
Auxiliary.AddCodeList(c,t
c:GetOriginalCode())
end)
end)
Duel.RegisterEffect(e1,0)
...
...
expansions/script/c37564335.lua
View file @
d0d91d60
...
...
@@ -3,8 +3,8 @@ local m=37564335
local
cm
=
_G
[
"c"
..
m
]
Duel
.
LoadScript
(
"c37564765.lua"
)
cm
.
dfc_front_side
=
m
+
1
cm
.
fit_monster
=
{
m
+
1
}
function
cm
.
initial_effect
(
c
)
Auxiliary
.
AddCodeList
(
c
,
m
+
1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
...
...
expansions/script/c37564529.lua
View file @
d0d91d60
...
...
@@ -13,17 +13,13 @@ function cm.initial_effect(c)
e1
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e1
)
end
cm
.
fit_monster
=
{
37564504
,
37564526
,
37564552
}
cm
.
card_code_list
=
{[
37564504
]
=
true
,[
37564526
]
=
true
,[
37564552
]
=
true
}
function
cm
.
filter
(
c
,
e
,
tp
,
m1
,
m2
)
local
ec
=
e
:
GetHandler
()
if
not
ec
.
fit_monster
then
return
false
end
if
not
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_RITUAL
,
tp
,
false
,
true
)
then
return
false
end
local
cd1
=
c
:
GetOriginalCode
()
local
cd2
=
c
:
GetCode
()
local
check
=
false
for
i
,
cd
in
pairs
(
ec
.
fit_monster
)
do
if
cd
==
cd1
or
cd
==
cd2
then
check
=
true
end
end
local
check
=
Auxiliary
.
IsCodeListed
(
c
,
cd1
)
or
Auxiliary
.
IsCodeListed
(
c
,
cd2
)
if
not
check
then
return
false
end
local
mg
=
m1
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
c
,
c
)
mg
:
Merge
(
m2
)
...
...
expansions/script/c37564765.lua
View file @
d0d91d60
...
...
@@ -2282,19 +2282,19 @@ function cm.RemainCheckOperation(e,tp,eg,ep,ev,re,r,rp)
end
)
end
--for sayuri
cm
.
sayuri_
fit_monster
=
cm
.
sayuri_fit_monster
or
{}
cm
.
sayuri_
code_list
=
cm
.
sayuri_code_list
or
{}
cm
.
sayuri_activate_effect
=
cm
.
sayuri_activate_effect
or
{}
function
cm
.
SayuriRitualPreload
(
m
)
local
mt
=
cm
.
LoadMetatable
(
m
)
mt
.
Senya_name_with_sayuri
=
true
table.insert
(
cm
.
sayuri_fit_monster
,
m
)
cm
.
sayuri_code_list
[
m
]
=
true
return
m
,
mt
end
function
cm
.
SayuriSpellPreload
(
m
)
local
mt
=
cm
.
LoadMetatable
(
m
)
mt
.
Senya_name_with_sayuri
=
true
mt
.
fit_monster
=
cm
.
sayuri_fit_monster
mt
.
card_code_list
=
cm
.
sayuri_code_list
return
m
,
mt
end
function
cm
.
SayuriSelfReturnCommonEffect
(
c
,
m
)
...
...
expansions/script/underscore.lua
0 → 100644
View file @
d0d91d60
-- Copyright (c) 2009 Marcus Irven
--
-- Permission is hereby granted, free of charge, to any person
-- obtaining a copy of this software and associated documentation
-- files (the "Software"), to deal in the Software without
-- restriction, including without limitation the rights to use,
-- copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the
-- Software is furnished to do so, subject to the following
-- conditions:
--
-- The above copyright notice and this permission notice shall be
-- included in all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-- OTHER DEALINGS IN THE SOFTWARE.
--- Underscore is a set of utility functions for dealing with
-- iterators, arrays, tables, and functions.
local
Underscore
=
{
funcs
=
{}
}
Underscore
.
__index
=
Underscore
function
Underscore
.
__call
(
_
,
value
)
return
Underscore
:
new
(
value
)
end
function
Underscore
:
new
(
value
,
chained
)
return
setmetatable
({
_val
=
value
,
chained
=
chained
or
false
},
self
)
end
function
Underscore
.
iter
(
list_or_iter
)
if
type
(
list_or_iter
)
==
"function"
then
return
list_or_iter
end
local
i
=
0
return
function
()
i
=
i
+
1
return
list_or_iter
[
i
]
end
end
function
Underscore
.
range
(
start_i
,
end_i
,
step
)
if
end_i
==
nil
then
end_i
=
start_i
start_i
=
1
end
step
=
step
or
1
local
list
=
{}
for
i
=
start_i
,
end_i
,
step
do
table.insert
(
list
,
i
)
end
local
range_iter
=
Underscore
.
iter
(
list
)
return
Underscore
:
new
(
range_iter
)
end
--- Identity function. This function looks useless, but is used throughout Underscore as a default.
-- @name _.identity
-- @param value any object
-- @return value
-- @usage _.identity("foo")
-- => "foo"
function
Underscore
.
identity
(
value
)
return
value
end
-- chaining
function
Underscore
:
chain
()
self
.
chained
=
true
return
self
end
function
Underscore
:
value
()
return
self
.
_val
end
-- iter
function
Underscore
.
funcs
.
each
(
list
,
func
)
for
i
in
Underscore
.
iter
(
list
)
do
func
(
i
)
end
return
list
end
function
Underscore
.
funcs
.
map
(
list
,
func
)
local
mapped
=
{}
for
i
in
Underscore
.
iter
(
list
)
do
mapped
[
#
mapped
+
1
]
=
func
(
i
)
end
return
mapped
end
function
Underscore
.
funcs
.
reduce
(
list
,
memo
,
func
)
for
i
in
Underscore
.
iter
(
list
)
do
memo
=
func
(
memo
,
i
)
end
return
memo
end
function
Underscore
.
funcs
.
detect
(
list
,
func
)
for
i
in
Underscore
.
iter
(
list
)
do
if
func
(
i
)
then
return
i
end
end
return
nil
end
function
Underscore
.
funcs
.
select
(
list
,
func
)
local
selected
=
{}
for
i
in
Underscore
.
iter
(
list
)
do
if
func
(
i
)
then
selected
[
#
selected
+
1
]
=
i
end
end
return
selected
end
function
Underscore
.
funcs
.
reject
(
list
,
func
)
local
selected
=
{}
for
i
in
Underscore
.
iter
(
list
)
do
if
not
func
(
i
)
then
selected
[
#
selected
+
1
]
=
i
end
end
return
selected
end
function
Underscore
.
funcs
.
all
(
list
,
func
)
func
=
func
or
Underscore
.
identity
-- TODO what should happen with an empty list?
for
i
in
Underscore
.
iter
(
list
)
do
if
not
func
(
i
)
then
return
false
end
end
return
true
end
function
Underscore
.
funcs
.
any
(
list
,
func
)
func
=
func
or
Underscore
.
identity
-- TODO what should happen with an empty list?
for
i
in
Underscore
.
iter
(
list
)
do
if
func
(
i
)
then
return
true
end
end
return
false
end
function
Underscore
.
funcs
.
include
(
list
,
value
)
for
i
in
Underscore
.
iter
(
list
)
do
if
i
==
value
then
return
true
end
end
return
false
end
function
Underscore
.
funcs
.
invoke
(
list
,
function_name
,
...
)
local
args
=
{
...
}
Underscore
.
funcs
.
each
(
list
,
function
(
i
)
i
[
function_name
](
i
,
unpack
(
args
))
end
)
return
list
end
function
Underscore
.
funcs
.
pluck
(
list
,
propertyName
)
return
Underscore
.
funcs
.
map
(
list
,
function
(
i
)
return
i
[
propertyName
]
end
)
end
function
Underscore
.
funcs
.
min
(
list
,
func
)
func
=
func
or
Underscore
.
identity
return
Underscore
.
funcs
.
reduce
(
list
,
{
item
=
nil
,
value
=
nil
},
function
(
min
,
item
)
if
min
.
item
==
nil
then
min
.
item
=
item
min
.
value
=
func
(
item
)
else
local
value
=
func
(
item
)
if
value
<
min
.
value
then
min
.
item
=
item
min
.
value
=
value
end
end
return
min
end
).
item
end
function
Underscore
.
funcs
.
max
(
list
,
func
)
func
=
func
or
Underscore
.
identity
return
Underscore
.
funcs
.
reduce
(
list
,
{
item
=
nil
,
value
=
nil
},
function
(
max
,
item
)
if
max
.
item
==
nil
then
max
.
item
=
item
max
.
value
=
func
(
item
)
else
local
value
=
func
(
item
)
if
value
>
max
.
value
then
max
.
item
=
item
max
.
value
=
value
end
end
return
max
end
).
item
end
function
Underscore
.
funcs
.
to_array
(
list
)
local
array
=
{}
for
i
in
Underscore
.
iter
(
list
)
do
array
[
#
array
+
1
]
=
i
end
return
array
end
function
Underscore
.
funcs
.
reverse
(
list
)
local
reversed
=
{}
for
i
in
Underscore
.
iter
(
list
)
do
table.insert
(
reversed
,
1
,
i
)
end
return
reversed
end
function
Underscore
.
funcs
.
sort
(
iter
,
comparison_func
)
local
array
=
iter
if
type
(
iter
)
==
"function"
then
array
=
Underscore
.
funcs
.
to_array
(
iter
)
end
table.sort
(
array
,
comparison_func
)
return
array
end
-- arrays
function
Underscore
.
funcs
.
first
(
array
,
n
)
if
n
==
nil
then
return
array
[
1
]
else
local
first
=
{}
n
=
math.min
(
n
,
#
array
)
for
i
=
1
,
n
do
first
[
i
]
=
array
[
i
]
end
return
first
end
end
function
Underscore
.
funcs
.
rest
(
array
,
index
)
index
=
index
or
2
local
rest
=
{}
for
i
=
index
,
#
array
do
rest
[
#
rest
+
1
]
=
array
[
i
]
end
return
rest
end
function
Underscore
.
funcs
.
slice
(
array
,
start_index
,
length
)
local
sliced_array
=
{}
start_index
=
math.max
(
start_index
,
1
)
local
end_index
=
math.min
(
start_index
+
length
-
1
,
#
array
)
for
i
=
start_index
,
end_index
do
sliced_array
[
#
sliced_array
+
1
]
=
array
[
i
]
end
return
sliced_array
end
function
Underscore
.
funcs
.
flatten
(
array
)
local
all
=
{}
for
ele
in
Underscore
.
iter
(
array
)
do
if
type
(
ele
)
==
"table"
then
local
flattened_element
=
Underscore
.
funcs
.
flatten
(
ele
)
Underscore
.
funcs
.
each
(
flattened_element
,
function
(
e
)
all
[
#
all
+
1
]
=
e
end
)
else
all
[
#
all
+
1
]
=
ele
end
end
return
all
end
function
Underscore
.
funcs
.
push
(
array
,
item
)
table.insert
(
array
,
item
)
return
array
end
function
Underscore
.
funcs
.
pop
(
array
)
return
table.remove
(
array
)
end
function
Underscore
.
funcs
.
shift
(
array
)
return
table.remove
(
array
,
1
)
end
function
Underscore
.
funcs
.
unshift
(
array
,
item
)
table.insert
(
array
,
1
,
item
)
return
array
end
function
Underscore
.
funcs
.
join
(
array
,
separator
)
return
table.concat
(
array
,
separator
)
end
-- objects
function
Underscore
.
funcs
.
keys
(
obj
)
local
keys
=
{}
for
k
,
v
in
pairs
(
obj
)
do
keys
[
#
keys
+
1
]
=
k
end
return
keys
end
function
Underscore
.
funcs
.
values
(
obj
)
local
values
=
{}
for
k
,
v
in
pairs
(
obj
)
do
values
[
#
values
+
1
]
=
v
end
return
values
end
function
Underscore
.
funcs
.
extend
(
destination
,
source
)
for
k
,
v
in
pairs
(
source
)
do
destination
[
k
]
=
v
end
return
destination
end
function
Underscore
.
funcs
.
is_empty
(
obj
)
return
next
(
obj
)
==
nil
end
-- Originally based on penlight's deepcompare() -- http://luaforge.net/projects/penlight/
function
Underscore
.
funcs
.
is_equal
(
o1
,
o2
,
ignore_mt
)
local
ty1
=
type
(
o1
)
local
ty2
=
type
(
o2
)
if
ty1
~=
ty2
then
return
false
end
-- non-table types can be directly compared
if
ty1
~=
'table'
then
return
o1
==
o2
end
-- as well as tables which have the metamethod __eq
local
mt
=
getmetatable
(
o1
)
if
not
ignore_mt
and
mt
and
mt
.
__eq
then
return
o1
==
o2
end
local
is_equal
=
Underscore
.
funcs
.
is_equal
for
k1
,
v1
in
pairs
(
o1
)
do
local
v2
=
o2
[
k1
]
if
v2
==
nil
or
not
is_equal
(
v1
,
v2
,
ignore_mt
)
then
return
false
end
end
for
k2
,
v2
in
pairs
(
o2
)
do
local
v1
=
o1
[
k2
]
if
v1
==
nil
then
return
false
end
end
return
true
end
-- functions
function
Underscore
.
funcs
.
compose
(
...
)
local
function
call_funcs
(
funcs
,
...
)
if
#
funcs
>
1
then
return
funcs
[
1
](
call_funcs
(
_
.
rest
(
funcs
),
...
))
else
return
funcs
[
1
](
...
)
end
end
local
funcs
=
{
...
}
return
function
(
...
)
return
call_funcs
(
funcs
,
...
)
end
end
function
Underscore
.
funcs
.
wrap
(
func
,
wrapper
)
return
function
(
...
)
return
wrapper
(
func
,
...
)
end
end
function
Underscore
.
funcs
.
curry
(
func
,
argument
)
return
function
(
...
)
return
func
(
argument
,
...
)
end
end
function
Underscore
.
functions
()
return
Underscore
.
keys
(
Underscore
.
funcs
)
end
-- add aliases
Underscore
.
methods
=
Underscore
.
functions
Underscore
.
funcs
.
for_each
=
Underscore
.
funcs
.
each
Underscore
.
funcs
.
collect
=
Underscore
.
funcs
.
map
Underscore
.
funcs
.
inject
=
Underscore
.
funcs
.
reduce
Underscore
.
funcs
.
foldl
=
Underscore
.
funcs
.
reduce
Underscore
.
funcs
.
filter
=
Underscore
.
funcs
.
select
Underscore
.
funcs
.
every
=
Underscore
.
funcs
.
all
Underscore
.
funcs
.
some
=
Underscore
.
funcs
.
any
Underscore
.
funcs
.
head
=
Underscore
.
funcs
.
first
Underscore
.
funcs
.
tail
=
Underscore
.
funcs
.
rest
local
function
wrap_functions_for_oo_support
()
local
function
value_and_chained
(
value_or_self
)
local
chained
=
false
if
getmetatable
(
value_or_self
)
==
Underscore
then
chained
=
value_or_self
.
chained
value_or_self
=
value_or_self
.
_val
end
return
value_or_self
,
chained
end
local
function
value_or_wrap
(
value
,
chained
)
if
chained
then
value
=
Underscore
:
new
(
value
,
true
)
end
return
value
end
for
fn
,
func
in
pairs
(
Underscore
.
funcs
)
do
Underscore
[
fn
]
=
function
(
obj_or_self
,
...
)
local
obj
,
chained
=
value_and_chained
(
obj_or_self
)
return
value_or_wrap
(
func
(
obj
,
...
),
chained
)
end
end
end
wrap_functions_for_oo_support
()
_
=
Underscore
:
new
()
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