Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
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
xiaoye
ygopro-core
Commits
89aa51d9
Commit
89aa51d9
authored
Jan 29, 2024
by
wind2009
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
into develop
parents
4e6cad94
aaf48f68
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
2 deletions
+44
-2
libcard.cpp
libcard.cpp
+1
-1
libgroup.cpp
libgroup.cpp
+41
-0
operations.cpp
operations.cpp
+1
-1
scriptlib.h
scriptlib.h
+1
-0
No files found.
libcard.cpp
View file @
89aa51d9
...
@@ -1241,7 +1241,7 @@ int32 scriptlib::card_is_non_attribute(lua_State *L) {
...
@@ -1241,7 +1241,7 @@ int32 scriptlib::card_is_non_attribute(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
tattrib
=
(
uint32
)
lua_tointeger
(
L
,
2
);
uint32
tattrib
=
(
uint32
)
lua_tointeger
(
L
,
2
);
if
(
pcard
->
get_attribute
()
&
(
ATTRIBUTE_ALL
-
tattrib
))
if
(
pcard
->
get_attribute
()
&
(
ATTRIBUTE_ALL
&
~
tattrib
))
lua_pushboolean
(
L
,
1
);
lua_pushboolean
(
L
,
1
);
else
else
lua_pushboolean
(
L
,
0
);
lua_pushboolean
(
L
,
0
);
...
...
libgroup.cpp
View file @
89aa51d9
...
@@ -374,6 +374,46 @@ int32 scriptlib::group_random_select(lua_State *L) {
...
@@ -374,6 +374,46 @@ int32 scriptlib::group_random_select(lua_State *L) {
interpreter
::
group2value
(
L
,
newgroup
);
interpreter
::
group2value
(
L
,
newgroup
);
return
1
;
return
1
;
}
}
int32
scriptlib
::
group_cancelable_select
(
lua_State
*
L
)
{
check_action_permission
(
L
);
check_param_count
(
L
,
5
);
check_param
(
L
,
PARAM_TYPE_GROUP
,
1
);
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
1
);
field
::
card_set
cset
(
pgroup
->
container
);
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
5
,
TRUE
))
{
card
*
pexception
=
*
(
card
**
)
lua_touserdata
(
L
,
5
);
cset
.
erase
(
pexception
);
}
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
5
,
TRUE
))
{
group
*
pexgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
5
);
for
(
auto
&
pcard
:
pexgroup
->
container
)
cset
.
erase
(
pcard
);
}
duel
*
pduel
=
pgroup
->
pduel
;
uint32
playerid
=
(
uint32
)
lua_tointeger
(
L
,
2
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
uint32
min
=
(
uint32
)
lua_tointeger
(
L
,
3
);
uint32
max
=
(
uint32
)
lua_tointeger
(
L
,
4
);
pduel
->
game_field
->
core
.
select_cards
.
clear
();
for
(
auto
&
pcard
:
cset
)
{
pduel
->
game_field
->
core
.
select_cards
.
push_back
(
pcard
);
}
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
playerid
+
0x10000
,
min
+
(
max
<<
16
));
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
if
(
pduel
->
game_field
->
returns
.
bvalue
[
0
]
==
-
1
)
{
lua_pushnil
(
L
);
}
else
{
group
*
pgroup
=
pduel
->
new_group
();
for
(
int32
i
=
0
;
i
<
pduel
->
game_field
->
returns
.
bvalue
[
0
];
++
i
)
{
card
*
pcard
=
pduel
->
game_field
->
core
.
select_cards
[
pduel
->
game_field
->
returns
.
bvalue
[
i
+
1
]];
pgroup
->
container
.
insert
(
pcard
);
}
interpreter
::
group2value
(
L
,
pgroup
);
}
return
1
;
});
}
int32
scriptlib
::
group_is_exists
(
lua_State
*
L
)
{
int32
scriptlib
::
group_is_exists
(
lua_State
*
L
)
{
check_param_count
(
L
,
4
);
check_param_count
(
L
,
4
);
check_param
(
L
,
PARAM_TYPE_GROUP
,
1
);
check_param
(
L
,
PARAM_TYPE_GROUP
,
1
);
...
@@ -890,6 +930,7 @@ static const struct luaL_Reg grouplib[] = {
...
@@ -890,6 +930,7 @@ static const struct luaL_Reg grouplib[] = {
{
"Select"
,
scriptlib
::
group_select
},
{
"Select"
,
scriptlib
::
group_select
},
{
"SelectUnselect"
,
scriptlib
::
group_select_unselect
},
{
"SelectUnselect"
,
scriptlib
::
group_select_unselect
},
{
"RandomSelect"
,
scriptlib
::
group_random_select
},
{
"RandomSelect"
,
scriptlib
::
group_random_select
},
{
"CancelableSelect"
,
scriptlib
::
group_cancelable_select
},
{
"IsExists"
,
scriptlib
::
group_is_exists
},
{
"IsExists"
,
scriptlib
::
group_is_exists
},
{
"CheckWithSumEqual"
,
scriptlib
::
group_check_with_sum_equal
},
{
"CheckWithSumEqual"
,
scriptlib
::
group_check_with_sum_equal
},
{
"SelectWithSumEqual"
,
scriptlib
::
group_select_with_sum_equal
},
{
"SelectWithSumEqual"
,
scriptlib
::
group_select_with_sum_equal
},
...
...
operations.cpp
View file @
89aa51d9
...
@@ -1409,7 +1409,7 @@ int32 field::equip(uint16 step, uint8 equip_player, card * equip_card, card * ta
...
@@ -1409,7 +1409,7 @@ int32 field::equip(uint16 step, uint8 equip_player, card * equip_card, card * ta
peffect
->
owner
=
equip_card
;
peffect
->
owner
=
equip_card
;
peffect
->
handler
=
equip_card
;
peffect
->
handler
=
equip_card
;
peffect
->
type
=
EFFECT_TYPE_SINGLE
;
peffect
->
type
=
EFFECT_TYPE_SINGLE
;
if
(
equip_card
->
get_type
()
==
TYPE_TRAP
)
{
if
(
equip_card
->
get_type
()
&
TYPE_TRAP
)
{
peffect
->
code
=
EFFECT_ADD_TYPE
;
peffect
->
code
=
EFFECT_ADD_TYPE
;
peffect
->
value
=
TYPE_EQUIP
;
peffect
->
value
=
TYPE_EQUIP
;
}
else
if
(
equip_card
->
data
.
type
&
TYPE_UNION
)
{
}
else
if
(
equip_card
->
data
.
type
&
TYPE_UNION
)
{
...
...
scriptlib.h
View file @
89aa51d9
...
@@ -371,6 +371,7 @@ public:
...
@@ -371,6 +371,7 @@ public:
static
int32
group_select
(
lua_State
*
L
);
static
int32
group_select
(
lua_State
*
L
);
static
int32
group_select_unselect
(
lua_State
*
L
);
static
int32
group_select_unselect
(
lua_State
*
L
);
static
int32
group_random_select
(
lua_State
*
L
);
static
int32
group_random_select
(
lua_State
*
L
);
static
int32
group_cancelable_select
(
lua_State
*
L
);
static
int32
group_is_exists
(
lua_State
*
L
);
static
int32
group_is_exists
(
lua_State
*
L
);
static
int32
group_check_with_sum_equal
(
lua_State
*
L
);
static
int32
group_check_with_sum_equal
(
lua_State
*
L
);
static
int32
group_select_with_sum_equal
(
lua_State
*
L
);
static
int32
group_select_with_sum_equal
(
lua_State
*
L
);
...
...
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