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
nanahira
ygopro-core
Commits
caa4a123
Commit
caa4a123
authored
Apr 12, 2017
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
6439e4fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
28 deletions
+16
-28
field.cpp
field.cpp
+3
-1
libduel.cpp
libduel.cpp
+11
-5
operations.cpp
operations.cpp
+2
-22
No files found.
field.cpp
View file @
caa4a123
...
@@ -576,9 +576,11 @@ int32 field::get_tofield_count(uint8 playerid, uint8 location, uint8 uplayer, ui
...
@@ -576,9 +576,11 @@ int32 field::get_tofield_count(uint8 playerid, uint8 location, uint8 uplayer, ui
flag
=
(
flag
|
~
zone
)
&
0x1f
;
flag
=
(
flag
|
~
zone
)
&
0x1f
;
else
else
flag
=
(
flag
>>
8
)
&
0x1f
;
flag
=
(
flag
>>
8
)
&
0x1f
;
int32
count
=
5
-
field_used_count
[
flag
];
if
(
location
==
LOCATION_MZONE
)
flag
|=
(
1u
<<
5
)
|
(
1u
<<
6
);
if
(
list
)
if
(
list
)
*
list
=
flag
;
*
list
=
flag
;
int32
count
=
5
-
field_used_count
[
flag
];
return
count
;
return
count
;
}
}
int32
field
::
get_useable_count_fromex
(
card
*
pcard
,
uint8
playerid
,
uint8
uplayer
,
uint32
zone
,
uint32
*
list
)
{
int32
field
::
get_useable_count_fromex
(
card
*
pcard
,
uint8
playerid
,
uint8
uplayer
,
uint32
zone
,
uint32
*
list
)
{
...
...
libduel.cpp
View file @
caa4a123
...
@@ -1497,11 +1497,17 @@ int32 scriptlib::duel_get_location_count(lua_State *L) {
...
@@ -1497,11 +1497,17 @@ int32 scriptlib::duel_get_location_count(lua_State *L) {
if
(
location
==
LOCATION_MZONE
)
{
if
(
location
==
LOCATION_MZONE
)
{
uint32
flag1
,
flag2
;
uint32
flag1
,
flag2
;
int32
ct1
=
pduel
->
game_field
->
get_useable_count
(
playerid
,
location
,
uplayer
,
reason
,
zone
,
&
flag1
);
int32
ct1
=
pduel
->
game_field
->
get_useable_count
(
playerid
,
location
,
uplayer
,
reason
,
zone
,
&
flag1
);
int32
ct2
=
pduel
->
game_field
->
get_useable_count_fromex
(
0
,
playerid
,
uplayer
,
zone
,
&
flag2
);
if
(
pduel
->
game_field
->
core
.
duel_rule
>=
4
)
{
int32
ct3
=
field
::
field_used_count
[
~
(
flag1
|
flag2
)
&
0x1f
];
int32
ct2
=
pduel
->
game_field
->
get_useable_count_fromex
(
0
,
playerid
,
uplayer
,
zone
,
&
flag2
);
lua_pushinteger
(
L
,
ct1
);
int32
ct3
=
field
::
field_used_count
[
~
(
flag1
|
flag2
)
&
0x1f
];
lua_pushinteger
(
L
,
ct2
);
lua_pushinteger
(
L
,
ct1
);
lua_pushinteger
(
L
,
ct1
+
ct2
-
ct3
);
lua_pushinteger
(
L
,
ct2
);
lua_pushinteger
(
L
,
ct1
+
ct2
-
ct3
);
}
else
{
lua_pushinteger
(
L
,
ct1
);
lua_pushinteger
(
L
,
ct1
);
lua_pushinteger
(
L
,
ct1
);
}
return
3
;
return
3
;
}
else
{
}
else
{
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_useable_count
(
playerid
,
location
,
uplayer
,
reason
));
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_useable_count
(
playerid
,
location
,
uplayer
,
reason
));
...
...
operations.cpp
View file @
caa4a123
...
@@ -3976,30 +3976,10 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
...
@@ -3976,30 +3976,10 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
pduel
->
write_buffer8
(
move_player
);
pduel
->
write_buffer8
(
move_player
);
pduel
->
write_buffer32
(
target
->
data
.
code
);
pduel
->
write_buffer32
(
target
->
data
.
code
);
add_process
(
PROCESSOR_SELECT_PLACE
,
0
,
0
,
0
,
move_player
,
flag
,
1
);
add_process
(
PROCESSOR_SELECT_PLACE
,
0
,
0
,
0
,
move_player
,
flag
,
1
);
}
else
if
(
core
.
duel_rule
>=
4
&&
location
==
LOCATION_MZONE
&&
target
->
current
.
location
==
LOCATION_EXTRA
)
{
uint32
flag
;
int32
ct
=
get_useable_count_fromex
(
target
,
playerid
,
move_player
,
zone
,
&
flag
);
if
((
ret
==
1
)
&&
(
ct
<=
0
||
target
->
is_status
(
STATUS_FORBIDDEN
)
||
check_unique_onfield
(
target
,
playerid
,
location
)))
{
core
.
units
.
begin
()
->
step
=
3
;
send_to
(
target
,
core
.
reason_effect
,
REASON_RULE
,
core
.
reason_player
,
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
0
);
return
FALSE
;
}
if
(
ct
<=
0
)
return
TRUE
;
if
(
move_player
==
playerid
)
flag
=
(
flag
&
0xff
)
|
0xffffff00
;
else
flag
=
((
flag
&
0xff
)
<<
16
)
|
0xff00ffff
;
flag
|=
0xff80ff80
;
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
move_player
);
pduel
->
write_buffer32
(
target
->
data
.
code
);
add_process
(
PROCESSOR_SELECT_PLACE
,
0
,
0
,
0
,
move_player
,
flag
,
1
);
}
else
{
}
else
{
uint32
flag
;
uint32
flag
;
uint32
lreason
=
(
target
->
current
.
location
==
LOCATION_MZONE
)
?
LOCATION_REASON_CONTROL
:
LOCATION_REASON_TOFIELD
;
uint32
lreason
=
(
target
->
current
.
location
==
LOCATION_MZONE
)
?
LOCATION_REASON_CONTROL
:
LOCATION_REASON_TOFIELD
;
int32
ct
=
get_useable_count
(
playerid
,
location
,
move_player
,
lreason
,
zone
,
&
flag
);
int32
ct
=
get_useable_count
(
target
,
playerid
,
location
,
move_player
,
lreason
,
zone
,
&
flag
);
if
((
ret
==
1
)
&&
(
ct
<=
0
||
target
->
is_status
(
STATUS_FORBIDDEN
)
||
check_unique_onfield
(
target
,
playerid
,
location
)))
{
if
((
ret
==
1
)
&&
(
ct
<=
0
||
target
->
is_status
(
STATUS_FORBIDDEN
)
||
check_unique_onfield
(
target
,
playerid
,
location
)))
{
core
.
units
.
begin
()
->
step
=
3
;
core
.
units
.
begin
()
->
step
=
3
;
send_to
(
target
,
core
.
reason_effect
,
REASON_RULE
,
core
.
reason_player
,
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
0
);
send_to
(
target
,
core
.
reason_effect
,
REASON_RULE
,
core
.
reason_player
,
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
0
);
...
@@ -4018,7 +3998,7 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
...
@@ -4018,7 +3998,7 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
else
else
flag
=
((
flag
&
0xff
)
<<
16
)
|
0xff00ffff
;
flag
=
((
flag
&
0xff
)
<<
16
)
|
0xff00ffff
;
}
}
flag
|=
0xe0
e0e0e
0
;
flag
|=
0xe0
80e08
0
;
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
move_player
);
pduel
->
write_buffer8
(
move_player
);
...
...
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