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
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
MyCard
ygopro-core
Commits
1253f398
Commit
1253f398
authored
Jul 24, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Card.GetMutualLinkedGroup
parent
3b5bcce0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
0 deletions
+42
-0
card.cpp
card.cpp
+9
-0
card.h
card.h
+1
-0
interpreter.cpp
interpreter.cpp
+3
-0
libcard.cpp
libcard.cpp
+26
-0
scriptlib.h
scriptlib.h
+3
-0
No files found.
card.cpp
View file @
1253f398
...
@@ -1303,6 +1303,15 @@ uint32 card::get_mutual_linked_zone() {
...
@@ -1303,6 +1303,15 @@ uint32 card::get_mutual_linked_zone() {
}
}
return
zones
;
return
zones
;
}
}
void
card
::
get_mutual_linked_cards
(
card_set
*
cset
)
{
cset
->
clear
();
if
(
!
(
data
.
type
&
TYPE_LINK
)
||
current
.
location
!=
LOCATION_MZONE
)
return
;
int32
p
=
current
.
controler
;
uint32
mutual_linked_zone
=
get_mutual_linked_zone
();
pduel
->
game_field
->
get_cards_in_zone
(
cset
,
mutual_linked_zone
,
p
);
pduel
->
game_field
->
get_cards_in_zone
(
cset
,
mutual_linked_zone
>>
16
,
1
-
p
);
}
int32
card
::
is_link_state
()
{
int32
card
::
is_link_state
()
{
if
(
current
.
location
!=
LOCATION_MZONE
)
if
(
current
.
location
!=
LOCATION_MZONE
)
return
FALSE
;
return
FALSE
;
...
...
card.h
View file @
1253f398
...
@@ -202,6 +202,7 @@ public:
...
@@ -202,6 +202,7 @@ public:
uint32
get_linked_zone
();
uint32
get_linked_zone
();
void
get_linked_cards
(
card_set
*
cset
);
void
get_linked_cards
(
card_set
*
cset
);
uint32
get_mutual_linked_zone
();
uint32
get_mutual_linked_zone
();
void
get_mutual_linked_cards
(
card_set
*
cset
);
int32
is_link_state
();
int32
is_link_state
();
int32
is_position
(
int32
pos
);
int32
is_position
(
int32
pos
);
void
set_status
(
uint32
status
,
int32
enabled
);
void
set_status
(
uint32
status
,
int32
enabled
);
...
...
interpreter.cpp
View file @
1253f398
...
@@ -47,6 +47,9 @@ static const struct luaL_Reg cardlib[] = {
...
@@ -47,6 +47,9 @@ static const struct luaL_Reg cardlib[] = {
{
"GetLinkedGroup"
,
scriptlib
::
card_get_linked_group
},
{
"GetLinkedGroup"
,
scriptlib
::
card_get_linked_group
},
{
"GetLinkedGroupCount"
,
scriptlib
::
card_get_linked_group_count
},
{
"GetLinkedGroupCount"
,
scriptlib
::
card_get_linked_group_count
},
{
"GetLinkedZone"
,
scriptlib
::
card_get_linked_zone
},
{
"GetLinkedZone"
,
scriptlib
::
card_get_linked_zone
},
{
"GetMutualLinkedGroup"
,
scriptlib
::
card_get_mutual_linked_group
},
{
"GetMutualLinkedGroupCount"
,
scriptlib
::
card_get_mutual_linked_group_count
},
{
"GetMutualLinkedZone"
,
scriptlib
::
card_get_mutual_linked_zone
},
{
"IsLinkState"
,
scriptlib
::
card_is_link_state
},
{
"IsLinkState"
,
scriptlib
::
card_is_link_state
},
{
"GetAttribute"
,
scriptlib
::
card_get_attribute
},
{
"GetAttribute"
,
scriptlib
::
card_get_attribute
},
{
"GetOriginalAttribute"
,
scriptlib
::
card_get_origin_attribute
},
{
"GetOriginalAttribute"
,
scriptlib
::
card_get_origin_attribute
},
...
...
libcard.cpp
View file @
1253f398
...
@@ -311,6 +311,32 @@ int32 scriptlib::card_get_linked_zone(lua_State *L) {
...
@@ -311,6 +311,32 @@ int32 scriptlib::card_get_linked_zone(lua_State *L) {
lua_pushinteger
(
L
,
pcard
->
get_linked_zone
());
lua_pushinteger
(
L
,
pcard
->
get_linked_zone
());
return
1
;
return
1
;
}
}
int32
scriptlib
::
card_get_mutual_linked_group
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
::
card_set
cset
;
pcard
->
get_mutual_linked_cards
(
&
cset
);
group
*
pgroup
=
pcard
->
pduel
->
new_group
(
cset
);
interpreter
::
group2value
(
L
,
pgroup
);
return
1
;
}
int32
scriptlib
::
card_get_mutual_linked_group_count
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
::
card_set
cset
;
pcard
->
get_mutual_linked_cards
(
&
cset
);
lua_pushinteger
(
L
,
cset
.
size
());
return
1
;
}
int32
scriptlib
::
card_get_mutual_linked_zone
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
lua_pushinteger
(
L
,
pcard
->
get_mutual_linked_zone
());
return
1
;
}
int32
scriptlib
::
card_is_link_state
(
lua_State
*
L
)
{
int32
scriptlib
::
card_is_link_state
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
...
...
scriptlib.h
View file @
1253f398
...
@@ -49,6 +49,9 @@ public:
...
@@ -49,6 +49,9 @@ public:
static
int32
card_get_linked_group
(
lua_State
*
L
);
static
int32
card_get_linked_group
(
lua_State
*
L
);
static
int32
card_get_linked_group_count
(
lua_State
*
L
);
static
int32
card_get_linked_group_count
(
lua_State
*
L
);
static
int32
card_get_linked_zone
(
lua_State
*
L
);
static
int32
card_get_linked_zone
(
lua_State
*
L
);
static
int32
card_get_mutual_linked_group
(
lua_State
*
L
);
static
int32
card_get_mutual_linked_group_count
(
lua_State
*
L
);
static
int32
card_get_mutual_linked_zone
(
lua_State
*
L
);
static
int32
card_is_link_state
(
lua_State
*
L
);
static
int32
card_is_link_state
(
lua_State
*
L
);
static
int32
card_get_attribute
(
lua_State
*
L
);
static
int32
card_get_attribute
(
lua_State
*
L
);
static
int32
card_get_origin_attribute
(
lua_State
*
L
);
static
int32
card_get_origin_attribute
(
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