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
6639d091
Commit
6639d091
authored
Jul 29, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
9bc78bae
62600336
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
77 deletions
+39
-77
card.cpp
card.cpp
+31
-51
card.h
card.h
+2
-2
effect.cpp
effect.cpp
+1
-1
libcard.cpp
libcard.cpp
+5
-23
No files found.
card.cpp
View file @
6639d091
...
@@ -1511,78 +1511,58 @@ int32 card::is_status(uint32 status) {
...
@@ -1511,78 +1511,58 @@ int32 card::is_status(uint32 status) {
return
TRUE
;
return
TRUE
;
return
FALSE
;
return
FALSE
;
}
}
uint32
card
::
get_column_zone
(
int32
loc
1
,
int32
left
,
int32
right
)
{
uint32
card
::
get_column_zone
(
int32
loc
ation
)
{
int32
zones
=
0
;
int32
zones
=
0
;
int32
loc2
=
current
.
location
;
uint8
seq
=
current
.
sequence
;
int32
s
=
current
.
sequence
;
if
(
!
(
location
&
LOCATION_ONFIELD
)
||
!
(
current
.
location
&
LOCATION_ONFIELD
)
||
current
.
location
==
LOCATION_SZONE
&&
seq
>=
5
)
if
(
!
(
loc1
&
LOCATION_ONFIELD
)
||
!
(
loc2
&
LOCATION_ONFIELD
)
||
loc2
==
LOCATION_SZONE
&&
s
>=
5
||
left
<
0
||
right
<
0
)
return
0
;
return
0
;
if
(
s
<=
4
)
{
if
(
s
eq
<=
4
)
{
if
(
loc
1
!=
loc2
)
if
(
loc
ation
&
LOCATION_MZONE
)
{
zones
|=
1u
<<
s
;
if
(
!
(
current
.
location
&
LOCATION_MZONE
))
zones
|=
1u
<<
(
16
+
(
4
-
s
))
;
zones
|=
1u
<<
seq
;
if
(
loc1
&
LOCATION_MZONE
)
{
zones
|=
1u
<<
(
16
+
(
4
-
seq
));
if
(
s
==
1
)
if
(
s
eq
==
1
)
zones
|=
(
1u
<<
5
)
|
(
1u
<<
(
16
+
6
));
zones
|=
(
1u
<<
5
)
|
(
1u
<<
(
16
+
6
));
if
(
s
==
3
)
if
(
s
eq
==
3
)
zones
|=
(
1u
<<
6
)
|
(
1u
<<
(
16
+
5
));
zones
|=
(
1u
<<
6
)
|
(
1u
<<
(
16
+
5
));
}
}
}
if
(
location
&
LOCATION_SZONE
)
{
if
(
s
==
5
)
if
(
!
(
current
.
location
&
LOCATION_SZONE
))
zones
|=
(
1u
<<
1
)
|
(
1u
<<
(
16
+
3
));
zones
|=
1u
<<
(
seq
+
8
);
if
(
s
==
6
)
zones
|=
1u
<<
(
16
+
8
+
(
4
-
seq
));
zones
|=
(
1u
<<
3
)
|
(
1u
<<
(
16
+
1
));
for
(
int32
i
=
1
;
i
<=
left
;
++
i
)
{
int32
seq
=
s
-
i
;
if
(
s
==
5
)
seq
=
1
-
i
;
if
(
s
==
6
)
seq
=
3
-
i
;
if
(
seq
>=
0
&&
seq
<=
4
)
{
zones
|=
1u
<<
seq
|
1u
<<
(
16
+
(
4
-
seq
));
if
(
loc1
&
LOCATION_MZONE
)
{
if
(
seq
==
1
)
zones
|=
(
1u
<<
5
)
|
(
1u
<<
(
16
+
6
));
if
(
seq
==
3
)
zones
|=
(
1u
<<
6
)
|
(
1u
<<
(
16
+
5
));
}
}
}
}
}
for
(
int32
i
=
1
;
i
<=
right
;
++
i
)
{
if
(
seq
==
5
)
{
int32
seq
=
s
+
i
;
if
(
location
&
LOCATION_MZONE
)
if
(
s
==
5
)
zones
|=
(
1u
<<
1
)
|
(
1u
<<
(
16
+
3
));
seq
=
1
+
i
;
if
(
location
&
LOCATION_SZONE
)
if
(
s
==
6
)
zones
|=
(
1u
<<
(
8
+
1
))
|
(
1u
<<
(
16
+
8
+
3
));
seq
=
3
+
i
;
}
if
(
seq
>=
0
&&
seq
<=
4
)
{
if
(
seq
==
6
)
{
zones
|=
1u
<<
seq
|
1u
<<
(
16
+
(
4
-
seq
));
if
(
location
&
LOCATION_MZONE
)
if
(
loc1
&
LOCATION_MZONE
)
{
zones
|=
(
1u
<<
3
)
|
(
1u
<<
(
16
+
1
));
if
(
seq
==
1
)
if
(
location
&
LOCATION_SZONE
)
zones
|=
(
1u
<<
5
)
|
(
1u
<<
(
16
+
6
));
zones
|=
(
1u
<<
(
8
+
3
))
|
(
1u
<<
(
16
+
8
+
1
));
if
(
seq
==
3
)
zones
|=
(
1u
<<
6
)
|
(
1u
<<
(
16
+
5
));
}
}
}
}
return
zones
;
return
zones
;
}
}
void
card
::
get_column_cards
(
card_set
*
cset
,
int32
left
,
int32
right
)
{
void
card
::
get_column_cards
(
card_set
*
cset
)
{
cset
->
clear
();
cset
->
clear
();
if
(
!
(
current
.
location
&
LOCATION_ONFIELD
))
if
(
!
(
current
.
location
&
LOCATION_ONFIELD
))
return
;
return
;
int32
p
=
current
.
controler
;
int32
p
=
current
.
controler
;
uint32
column_mzone
=
get_column_zone
(
LOCATION_MZONE
,
left
,
right
);
uint32
column_mzone
=
get_column_zone
(
LOCATION_MZONE
);
uint32
column_szone
=
get_column_zone
(
LOCATION_SZONE
,
left
,
right
);
uint32
column_szone
=
get_column_zone
(
LOCATION_SZONE
);
pduel
->
game_field
->
get_cards_in_zone
(
cset
,
column_mzone
,
p
,
LOCATION_MZONE
);
pduel
->
game_field
->
get_cards_in_zone
(
cset
,
column_mzone
,
p
,
LOCATION_MZONE
);
pduel
->
game_field
->
get_cards_in_zone
(
cset
,
column_mzone
>>
16
,
1
-
p
,
LOCATION_MZONE
);
pduel
->
game_field
->
get_cards_in_zone
(
cset
,
column_mzone
>>
16
,
1
-
p
,
LOCATION_MZONE
);
pduel
->
game_field
->
get_cards_in_zone
(
cset
,
column_szone
,
p
,
LOCATION_SZONE
);
pduel
->
game_field
->
get_cards_in_zone
(
cset
,
column_szone
>>
8
,
p
,
LOCATION_SZONE
);
pduel
->
game_field
->
get_cards_in_zone
(
cset
,
column_szone
>>
16
,
1
-
p
,
LOCATION_SZONE
);
pduel
->
game_field
->
get_cards_in_zone
(
cset
,
column_szone
>>
24
,
1
-
p
,
LOCATION_SZONE
);
}
}
int32
card
::
is_all_column
()
{
int32
card
::
is_all_column
()
{
if
(
!
(
current
.
location
&
LOCATION_ONFIELD
))
if
(
!
(
current
.
location
&
LOCATION_ONFIELD
))
return
FALSE
;
return
FALSE
;
card_set
cset
;
card_set
cset
;
get_column_cards
(
&
cset
,
0
,
0
);
get_column_cards
(
&
cset
);
int32
full
=
3
;
int32
full
=
3
;
if
(
pduel
->
game_field
->
core
.
duel_rule
>=
4
&&
(
current
.
sequence
==
1
||
current
.
sequence
==
3
))
if
(
pduel
->
game_field
->
core
.
duel_rule
>=
4
&&
(
current
.
sequence
==
1
||
current
.
sequence
==
3
))
full
++
;
full
++
;
...
...
card.h
View file @
6639d091
...
@@ -241,8 +241,8 @@ public:
...
@@ -241,8 +241,8 @@ public:
void
set_status
(
uint32
status
,
int32
enabled
);
void
set_status
(
uint32
status
,
int32
enabled
);
int32
get_status
(
uint32
status
);
int32
get_status
(
uint32
status
);
int32
is_status
(
uint32
status
);
int32
is_status
(
uint32
status
);
uint32
get_column_zone
(
int32
loc
1
,
int32
left
,
int32
right
);
uint32
get_column_zone
(
int32
loc
ation
);
void
get_column_cards
(
card_set
*
cset
,
int32
left
,
int32
right
);
void
get_column_cards
(
card_set
*
cset
);
int32
is_all_column
();
int32
is_all_column
();
void
equip
(
card
*
target
,
uint32
send_msg
=
TRUE
);
void
equip
(
card
*
target
,
uint32
send_msg
=
TRUE
);
...
...
effect.cpp
View file @
6639d091
...
@@ -268,7 +268,7 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
...
@@ -268,7 +268,7 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
}
}
if
(
phandler
->
current
.
location
==
LOCATION_OVERLAY
)
if
(
phandler
->
current
.
location
==
LOCATION_OVERLAY
)
return
FALSE
;
return
FALSE
;
if
((
type
&
EFFECT_TYPE_FIELD
)
&&
(
phandler
->
current
.
controler
!=
playerid
)
&&
!
is_flag
(
EFFECT_FLAG_BOTH_SIDE
))
if
((
type
&
EFFECT_TYPE_FIELD
)
&&
(
phandler
->
current
.
controler
!=
playerid
)
&&
!
is_flag
(
EFFECT_FLAG_BOTH_SIDE
|
EFFECT_FLAG_EVENT_PLAYER
))
return
FALSE
;
return
FALSE
;
if
(
phandler
->
is_status
(
STATUS_FORBIDDEN
))
if
(
phandler
->
is_status
(
STATUS_FORBIDDEN
))
return
FALSE
;
return
FALSE
;
...
...
libcard.cpp
View file @
6639d091
...
@@ -547,14 +547,8 @@ int32 scriptlib::card_get_column_group(lua_State *L) {
...
@@ -547,14 +547,8 @@ int32 scriptlib::card_get_column_group(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
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
int32
left
=
0
;
int32
right
=
0
;
if
(
lua_gettop
(
L
)
>=
2
)
left
=
lua_tointeger
(
L
,
2
);
if
(
lua_gettop
(
L
)
>=
3
)
right
=
lua_tointeger
(
L
,
3
);
card
::
card_set
cset
;
card
::
card_set
cset
;
pcard
->
get_column_cards
(
&
cset
,
left
,
right
);
pcard
->
get_column_cards
(
&
cset
);
group
*
pgroup
=
pcard
->
pduel
->
new_group
(
cset
);
group
*
pgroup
=
pcard
->
pduel
->
new_group
(
cset
);
interpreter
::
group2value
(
L
,
pgroup
);
interpreter
::
group2value
(
L
,
pgroup
);
return
1
;
return
1
;
...
@@ -563,14 +557,8 @@ int32 scriptlib::card_get_column_group_count(lua_State *L) {
...
@@ -563,14 +557,8 @@ int32 scriptlib::card_get_column_group_count(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
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
int32
left
=
0
;
int32
right
=
0
;
if
(
lua_gettop
(
L
)
>=
2
)
left
=
lua_tointeger
(
L
,
2
);
if
(
lua_gettop
(
L
)
>=
3
)
right
=
lua_tointeger
(
L
,
3
);
card
::
card_set
cset
;
card
::
card_set
cset
;
pcard
->
get_column_cards
(
&
cset
,
left
,
right
);
pcard
->
get_column_cards
(
&
cset
);
lua_pushinteger
(
L
,
cset
.
size
());
lua_pushinteger
(
L
,
cset
.
size
());
return
1
;
return
1
;
}
}
...
@@ -579,16 +567,10 @@ int32 scriptlib::card_get_column_zone(lua_State *L) {
...
@@ -579,16 +567,10 @@ int32 scriptlib::card_get_column_zone(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
);
int32
loc
=
lua_tointeger
(
L
,
2
);
int32
loc
=
lua_tointeger
(
L
,
2
);
int32
left
=
0
;
int32
right
=
0
;
int32
cp
=
pcard
->
current
.
controler
;
int32
cp
=
pcard
->
current
.
controler
;
if
(
lua_gettop
(
L
)
>=
3
)
if
(
lua_gettop
(
L
)
>=
3
&&
!
lua_isnil
(
L
,
3
))
left
=
lua_tointeger
(
L
,
3
);
cp
=
lua_tointeger
(
L
,
3
);
if
(
lua_gettop
(
L
)
>=
4
)
uint32
zone
=
pcard
->
get_column_zone
(
loc
);
right
=
lua_tointeger
(
L
,
4
);
if
(
lua_gettop
(
L
)
>=
5
&&
!
lua_isnil
(
L
,
5
))
cp
=
lua_tointeger
(
L
,
5
);
uint32
zone
=
pcard
->
get_column_zone
(
loc
,
left
,
right
);
if
(
cp
==
1
-
pcard
->
current
.
controler
)
if
(
cp
==
1
-
pcard
->
current
.
controler
)
lua_pushinteger
(
L
,
(((
zone
&
0xffff
)
<<
16
)
|
(
zone
>>
16
)));
lua_pushinteger
(
L
,
(((
zone
&
0xffff
)
<<
16
)
|
(
zone
>>
16
)));
else
else
...
...
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