Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
specials
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
JoyJ
specials
Commits
28cba4dd
Commit
28cba4dd
authored
Sep 28, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new
parent
cc0dc5dd
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2489 additions
and
0 deletions
+2489
-0
texas/lodash.lua
texas/lodash.lua
+2292
-0
texas/special.lua
texas/special.lua
+120
-0
ylgy/special.lua
ylgy/special.lua
+77
-0
No files found.
texas/lodash.lua
0 → 100644
View file @
28cba4dd
This diff is collapsed.
Click to expand it.
texas/special.lua
0 → 100644
View file @
28cba4dd
Duel
.
LoadScript
(
"lodash.lua"
)
-- not finished
function
Group
.
Levels
(
g
)
local
levels
=
{}
for
c
in
aux
.
Next
(
g
)
do
table.insert
(
levels
,
c
:
GetLevel
())
end
table.sort
(
levels
)
return
levels
end
function
Group
.
IsFlush
(
g
)
return
g
:
GetClassCount
(
Card
.
IsAttribute
)
==
1
end
function
Group
.
IsStraight
(
g
)
local
levels
=
g
:
Levels
()
for
i
=
1
,
#
levels
-
1
do
if
levels
[
i
+
1
]
~=
levels
[
i
]
+
1
then
return
false
end
end
end
function
Group
.
HighCardValue
(
g
)
-- 20 bits
local
levels
=
{}
for
c
in
aux
.
Next
(
g
)
do
table.insert
(
levels
,
c
:
GetLevel
())
end
table.sort
(
levels
)
return
levels
[
1
]
+
(
levels
[
2
]
<<
4
)
+
(
levels
[
3
]
<<
8
)
+
(
levels
[
4
]
<<
12
)
+
(
levels
[
5
]
<<
16
)
end
function
Group
.
FindSameLevel
(
g
,
count
)
end
local
cardTypes
=
{
{
name
=
"straight flush"
,
level
=
9
,
condition
=
function
(
g
)
return
isFlush
(
g
)
and
isStraight
(
g
)
end
,
value
=
Group
.
HighCardValue
,
},
{
name
=
"4 of a kind"
,
level
=
8
,
condition
=
function
(
g
)
return
g
:
CheckSubGroup
(
g
,
function
(
sg
)
return
sg
:
GetClassCount
(
Card
.
GetLevel
)
==
1
end
,
4
,
4
)
end
,
value
=
function
(
g
)
local
uniqueCard
=
g
:
SearchCard
(
function
(
c
)
return
not
g
:
IsExists
(
function
(
c2
)
return
c
:
GetLevel
()
==
c2
:
GetLevel
()
end
,
c
)
end
)
local
g2
=
g
-
c
return
(
g2
:
GetFirst
():
GetLevel
()
<<
4
)
+
uniqueCard
:
GetLevel
()
end
,
},
{
name
=
"full house"
,
level
=
7
,
condition
=
function
(
g
)
return
g
:
CheckSubGroup
(
g
,
function
(
sg
)
return
sg
:
GetClassCount
(
Card
.
GetLevel
)
==
1
and
(
sg
-
g
):
GetClassCount
(
Card
.
GetLevel
)
==
1
end
,
3
,
3
)
and
end
,
value
=
function
(
g
)
local
uniqueCard
=
g
:
SearchCard
(
function
(
c
)
return
not
g
:
IsExists
(
function
(
c2
)
return
c
:
GetLevel
()
==
c2
:
GetLevel
()
end
,
c
)
end
)
local
g2
=
g
-
c
return
(
g2
:
GetFirst
():
GetLevel
()
<<
4
)
+
uniqueCard
:
GetLevel
()
end
,
},
{
name
=
"flush"
,
level
=
6
,
condition
=
function
(
g
)
return
isFlush
(
g
)
end
,
value
=
Group
.
HighCardValue
,
},
{
name
=
"straight"
,
level
=
5
,
condition
=
function
(
g
)
return
isStraight
(
g
)
end
,
value
=
Group
.
HighCardValue
,
},
{
name
=
"3 of a kind"
,
level
=
4
,
condition
=
function
(
g
)
return
g
:
CheckSubGroup
(
g
,
function
(
sg
)
return
sg
:
GetClassCount
(
Card
.
GetLevel
)
==
1
end
,
3
,
3
)
end
,
value
=
function
(
g
)
local
uniqueCard
=
g
:
SearchCard
(
function
(
c
)
return
not
g
:
IsExists
(
function
(
c2
)
return
c
:
GetLevel
()
==
c2
:
GetLevel
()
end
,
c
)
end
)
local
g2
=
g
-
c
return
(
g2
:
GetFirst
():
GetLevel
()
<<
4
)
+
uniqueCard
:
GetLevel
()
end
,
},
{
name
=
"2 pair"
,
level
=
3
,
condition
=
function
(
g
)
return
g
:
CheckSubGroup
(
g
,
function
(
sg
)
return
sg
:
GetClassCount
(
Card
.
GetLevel
)
==
1
end
,
2
,
2
)
and
g
:
CheckSubGroup
(
g
,
function
(
sg
)
return
sg
:
GetClassCount
(
Card
.
GetLevel
)
==
1
end
,
2
,
2
)
end
,
}
}
ylgy/special.lua
0 → 100644
View file @
28cba4dd
local
function
grantDecktop
(
e
)
local
e3
=
Effect
.
GlobalEffect
()
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e3
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
+
EFFECT_FLAG_SET_AVAILABLE
)
e3
:
SetTargetRange
(
LOCATION_DECK
,
LOCATION_DECK
)
e3
:
SetTarget
(
function
(
e
,
c
)
local
tp
=
c
:
GetControler
()
local
dg
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_DECK
,
0
)
local
g
=
dg
:
GetMinGroup
(
Card
.
GetSequence
)
return
g
:
GetFirst
()
==
c
end
)
e3
:
SetLabelObject
(
e
)
Duel
.
RegisterEffect
(
e3
,
0
)
end
local
function
gf
(
c
,
tp
)
return
(
c
:
IsFaceup
()
or
c
:
IsControler
(
tp
))
and
c
:
IsAbleToGrave
()
end
local
function
sf
(
c
,
g
)
return
g
:
IsExists
(
Card
.
IsCode
,
2
,
c
,
c
:
GetCode
())
end
function
Auxiliary
.
PreloadUds
()
local
e1
=
Effect
.
GlobalEffect
()
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetRange
(
LOCATION_DECK
)
e1
:
SetCondition
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
if
not
(
Duel
.
GetTurnPlayer
()
==
tp
and
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
and
Duel
.
GetCurrentChain
()
==
0
)
then
return
false
end
local
g
=
Duel
.
GetMatchingGroup
(
gf
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
+
LOCATION_ONFIELD
+
LOCATION_EXTRA
,
LOCATION_ONFIELD
,
nil
,
tp
)
return
g
:
IsExists
(
sf
,
1
,
nil
,
g
)
end
)
e1
:
SetOperation
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
gf
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
+
LOCATION_ONFIELD
+
LOCATION_EXTRA
,
LOCATION_ONFIELD
,
nil
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
tc
=
g
:
FilterSelect
(
tp
,
sf
,
1
,
1
,
nil
,
g
):
GetFirst
()
local
g2
=
g
:
FilterSelect
(
tp
,
Card
.
IsCode
,
2
,
2
,
tc
,
tc
:
GetCode
())
Duel
.
Hint
(
HINT_CARD
,
0
,
73915052
)
local
tg
=
g2
+
tc
local
codes
=
{}
for
tc
in
aux
.
Next
(
tg
)
do
if
tc
:
IsType
(
TYPE_MONSTER
)
then
table.insert
(
codes
,
tc
:
GetCode
())
end
end
if
Duel
.
SendtoGrave
(
tg
,
REASON_RULE
)
>
0
then
local
og
=
Duel
.
GetOperatedGroup
():
Filter
(
Card
.
IsLocation
,
nil
,
LOCATION_GRAVE
)
for
oc
in
aux
.
Next
(
og
)
do
local
e1
=
Effect
.
CreateEffect
(
oc
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_CANNOT_NEGATE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
oc
:
RegisterEffect
(
e1
,
true
)
end
if
#
codes
>
0
then
local
e2
=
Effect
.
CreateEffect
(
oc
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_CANNOT_NEGATE
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e2
:
SetTargetRange
(
1
,
1
)
e2
:
SetTarget
(
function
(
e
,
c
)
return
c
:
IsCode
(
table.unpack
(
codes
))
end
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
1
,
REASON_RULE
)
end
end
)
e1
:
SetCountLimit
(
1
,
10001
)
grantDecktop
(
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