Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
no81cards
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
Nemo Ma
no81cards
Commits
6ee9b657
Commit
6ee9b657
authored
Apr 13, 2025
by
POLYMER
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
51a70fbe
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
107 additions
and
3 deletions
+107
-3
expansions/script/c11400010.lua
expansions/script/c11400010.lua
+103
-1
expansions/script/c22348391.lua
expansions/script/c22348391.lua
+1
-1
expansions/script/c60010030.lua
expansions/script/c60010030.lua
+1
-1
expansions/script/c65131100.lua
expansions/script/c65131100.lua
+2
-0
No files found.
expansions/script/c11400010.lua
View file @
6ee9b657
...
@@ -4,7 +4,10 @@ function cm.initial_effect(c) end
...
@@ -4,7 +4,10 @@ function cm.initial_effect(c) end
if
pnfl
then
return
end
if
pnfl
then
return
end
pnfl
=
cm
pnfl
=
cm
--subgroup optimization
--子集判断、选取函数优化版.11451549.
--采用顺序迭代的深度搜索,等效于逐层剪枝递归而不是原版代码的第一层剪枝
--通过分类、排序、跳过三个人工辅助函数提升效率.注意,分类函数要保证同类卡选取时【完全等效】
--满足条件的组之间有包含关系时(如等级合计是5的倍数)goalstop取false.check取true则等价于CheckSubGroup
function
cm
.
SelectSubGroup
(
g
,
tp
,
f
,
cancelable
,
min
,
max
,
...
)
function
cm
.
SelectSubGroup
(
g
,
tp
,
f
,
cancelable
,
min
,
max
,
...
)
--classif: function to classify cards, e.g. function(c,tc) return c:GetLevel()==tc:GetLevel() end
--classif: function to classify cards, e.g. function(c,tc) return c:GetLevel()==tc:GetLevel() end
--sortif: function of subgroup search order, high to low. e.g. Card.GetLevel
--sortif: function of subgroup search order, high to low. e.g. Card.GetLevel
...
@@ -12,6 +15,7 @@ function cm.SelectSubGroup(g,tp,f,cancelable,min,max,...)
...
@@ -12,6 +15,7 @@ function cm.SelectSubGroup(g,tp,f,cancelable,min,max,...)
--goalstop: do you want to backtrack after reaching the goal? true/false
--goalstop: do you want to backtrack after reaching the goal? true/false
--check: do you want to return true after reaching the goal firstly? true/false
--check: do you want to return true after reaching the goal firstly? true/false
local
classif
,
sortf
,
passf
,
goalstop
,
check
=
table.unpack
(
cm
.
SubGroupParams
)
local
classif
,
sortf
,
passf
,
goalstop
,
check
=
table.unpack
(
cm
.
SubGroupParams
)
goalstop
=
goalstop
~=
false
min
=
min
or
1
min
=
min
or
1
max
=
max
or
#
g
max
=
max
or
#
g
local
sg
=
Group
.
CreateGroup
()
local
sg
=
Group
.
CreateGroup
()
...
@@ -187,6 +191,104 @@ function cm.SelectSubGroup(g,tp,f,cancelable,min,max,...)
...
@@ -187,6 +191,104 @@ function cm.SelectSubGroup(g,tp,f,cancelable,min,max,...)
end
end
end
end
--将不入连锁效果变为允许手动排序的状态
function
cm
.
enableeffectsort
(
...
)
for
_
,
e
in
pairs
({
...
})
do
local
c
=
e
:
GetHandler
()
if
not
e
:
IsHasType
(
EFFECT_TYPE_CONTINUOUS
)
then
return
end
local
event
=
e
:
GetCode
()
if
event
==
EVENT_FREE_CHAIN
or
event
&
EVENT_PHASE
>
0
then
return
end
if
e
:
IsHasProperty
(
EFFECT_FLAG_DELAY
)
then
event
=
event
+
0x100000
end
cm
.
continuoustab
=
cm
.
continuoustab
or
{}
if
not
cm
.
continuoustab
[
event
]
then
cm
.
continuoustab
[
event
]
=
{[
0
]
=
{},[
1
]
=
{}}
local
ec
=
{
EVENT_CHAIN_ACTIVATING
,
EVENT_CHAINING
,
EVENT_ATTACK_ANNOUNCE
,
EVENT_BREAK_EFFECT
,
EVENT_CHAIN_SOLVING
,
EVENT_CHAIN_SOLVED
,
EVENT_CHAIN_END
,
EVENT_SUMMON
,
EVENT_SPSUMMON
,
EVENT_MSET
,
EVENT_BATTLE_DESTROYED
}
for
_
,
code
in
ipairs
(
ec
)
do
if
code
~=
event
%
0x100000
then
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
code
)
ge1
:
SetOperation
(
function
()
cm
.
continuoustab
[
event
]
=
{[
0
]
=
{},[
1
]
=
{}}
end
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
end
local
con
=
e
:
GetCondition
()
or
aux
.
TRUE
local
op
=
e
:
GetOperation
()
or
aux
.
TRUE
e
:
SetCondition
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
p
=
c
:
GetControler
()
local
res
=
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
res
and
not
c
:
IsDisabled
()
then
table.insert
(
cm
.
continuoustab
[
event
][
p
],
e
)
end
return
res
end
)
e
:
SetOperation
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
p
=
c
:
GetControler
()
if
cm
.
continuoustab
[
event
][
"resolving"
]
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
cm
.
continuoustab
[
event
][
"resolving"
]
=
nil
e
:
Reset
()
elseif
cm
.
continuoustab
[
event
][
"sorting"
]
or
#
cm
.
continuoustab
[
event
][
p
]
>
1
then
cm
.
continuoustab
[
event
][
"sorting"
]
=#
cm
.
continuoustab
[
event
][
p
]
>
1
local
opt
=
1
if
cm
.
continuoustab
[
event
][
"sorting"
]
then
local
tab
,
tab2
,
tab3
=
{},{},{}
local
g
=
Group
.
CreateGroup
()
for
i
,
te
in
pairs
(
cm
.
continuoustab
[
event
][
p
])
do
g
:
AddCard
(
te
:
GetHandler
())
tab
[
i
]
=
te
:
GetDescription
()
tab2
[
te
:
GetHandler
()]
=
tab2
[
te
:
GetHandler
()]
or
{}
table.insert
(
tab2
[
te
:
GetHandler
()],
te
:
GetDescription
())
tab3
[
te
:
GetHandler
()]
=
tab3
[
te
:
GetHandler
()]
or
{}
table.insert
(
tab3
[
te
:
GetHandler
()],
i
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
p
,
aux
.
Stringid
(
m
,
0
))
local
tc
=
g
:
Select
(
p
,
1
,
1
,
nil
):
GetFirst
()
local
s
=
1
if
#
tab2
[
tc
]
>
1
then
s
=
1
+
Duel
.
SelectOption
(
p
,
table.unpack
(
tab2
[
tc
]))
end
opt
=
tab3
[
tc
][
s
]
end
local
de
=
cm
.
continuoustab
[
event
][
p
][
opt
]
table.remove
(
cm
.
continuoustab
[
event
][
p
],
opt
)
if
e
==
de
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
else
local
ce
=
de
:
Clone
()
local
fid
=
ce
:
GetFieldID
()
ce
:
SetCondition
(
aux
.
TRUE
)
ce
:
SetCode
(
EVENT_CUSTOM
+
m
+
event
*
0xffff
+
fid
)
Duel
.
RegisterEffect
(
ce
,
de
:
GetHandler
():
GetControler
())
cm
.
continuoustab
[
event
][
"resolving"
]
=
true
if
not
eg
then
Duel
.
RaiseEvent
(
de
:
GetHandler
(),
EVENT_CUSTOM
+
m
+
event
*
0xffff
+
fid
,
re
,
r
,
rp
,
ep
,
ev
)
else
Duel
.
RaiseEvent
(
eg
,
EVENT_CUSTOM
+
m
+
event
*
0xffff
+
fid
,
re
,
r
,
rp
,
ep
,
ev
)
end
cm
.
continuoustab
[
event
][
"resolving"
]
=
nil
ce
:
Reset
()
end
else
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
end
)
end
end
--card,zone,(p,loc,seq),(x,y)的转换.x为纵列号,y为横行号.
--card,zone,(p,loc,seq),(x,y)的转换.x为纵列号,y为横行号.
--(p,loc,seq)->从tp来看的zone.11451494.
--(p,loc,seq)->从tp来看的zone.11451494.
...
...
expansions/script/c22348391.lua
View file @
6ee9b657
...
@@ -70,7 +70,7 @@ function c22348391.cost(e,tp,eg,ep,ev,re,r,rp,chk)
...
@@ -70,7 +70,7 @@ function c22348391.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
end
end
function
c22348391
.
spfilter2
(
c
,
e
,
tp
)
function
c22348391
.
spfilter2
(
c
,
e
,
tp
)
return
aux
.
IsCodeListed
(
c
,
22348157
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsRace
(
RACE_MACHINE
)
and
c
:
Is
Attribute
(
ATTRIBUTE_DARK
)
and
c
:
Is
CanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
IsExistingMatchingCard
(
c22348391
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
c
)
return
aux
.
IsCodeListed
(
c
,
22348157
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsRace
(
RACE_MACHINE
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
IsExistingMatchingCard
(
c22348391
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
c
)
end
end
function
c22348391
.
thfilter
(
c
)
function
c22348391
.
thfilter
(
c
)
return
c
:
IsCode
(
22348157
)
and
c
:
IsAbleToHand
()
return
c
:
IsCode
(
22348157
)
and
c
:
IsAbleToHand
()
...
...
expansions/script/c60010030.lua
View file @
6ee9b657
...
@@ -45,7 +45,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -45,7 +45,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
end
function
cm
.
fil
(
c
,
race
,
attr
)
function
cm
.
fil
(
c
,
race
,
attr
)
return
c
:
IsRace
(
race
)
and
c
:
IsAttribute
(
attr
)
return
(
c
:
IsRace
(
race
)
and
c
:
IsAttribute
(
attr
))
or
aux
.
IsCodeListed
(
c
,
60010029
)
end
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
...
...
expansions/script/c65131100.lua
View file @
6ee9b657
...
@@ -60,6 +60,8 @@ function s.initial_effect(c)
...
@@ -60,6 +60,8 @@ function s.initial_effect(c)
end
end
local
_SSet
=
Duel
.
SSet
local
_SSet
=
Duel
.
SSet
function
Duel
.
SSet
(
player
,
targets
,
tplayer
,
bool
)
function
Duel
.
SSet
(
player
,
targets
,
tplayer
,
bool
)
tplayer
=
tplayer
or
player
bool
=
bool
~=
false
local
count
=
_SSet
(
player
,
targets
,
tplayer
,
bool
)
local
count
=
_SSet
(
player
,
targets
,
tplayer
,
bool
)
if
bool
and
bool
==
true
and
aux
.
GetValueType
(
targets
)
==
"Card"
then
if
bool
and
bool
==
true
and
aux
.
GetValueType
(
targets
)
==
"Card"
then
local
tc
=
targets
local
tc
=
targets
...
...
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