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
c32963b2
Commit
c32963b2
authored
Jul 07, 2019
by
Edoardo Lolletti
Committed by
mercury233
Jul 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge MSG_ANNOUNCE_CARD with MSG_ANNOUNCE_CARD_FILTER (#216)
parent
9e1dc567
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
41 deletions
+17
-41
common.h
common.h
+0
-1
field.h
field.h
+1
-1
interpreter.cpp
interpreter.cpp
+0
-1
libduel.cpp
libduel.cpp
+9
-18
playerop.cpp
playerop.cpp
+6
-18
processor.cpp
processor.cpp
+1
-1
scriptlib.h
scriptlib.h
+0
-1
No files found.
common.h
View file @
c32963b2
...
...
@@ -315,7 +315,6 @@ struct card_sort {
#define MSG_ANNOUNCE_ATTRIB 141
#define MSG_ANNOUNCE_CARD 142
#define MSG_ANNOUNCE_NUMBER 143
#define MSG_ANNOUNCE_CARD_FILTER 144
#define MSG_CARD_HINT 160
#define MSG_TAG_SWAP 161
#define MSG_RELOAD_FIELD 162 // Debug.ReloadFieldEnd()
...
...
field.h
View file @
c32963b2
...
...
@@ -607,7 +607,7 @@ public:
int32
sort_card
(
int16
step
,
uint8
playerid
,
uint8
is_chain
);
int32
announce_race
(
int16
step
,
uint8
playerid
,
int32
count
,
int32
available
);
int32
announce_attribute
(
int16
step
,
uint8
playerid
,
int32
count
,
int32
available
);
int32
announce_card
(
int16
step
,
uint8
playerid
,
uint32
ttype
);
int32
announce_card
(
int16
step
,
uint8
playerid
);
int32
announce_number
(
int16
step
,
uint8
playerid
);
};
...
...
interpreter.cpp
View file @
c32963b2
...
...
@@ -537,7 +537,6 @@ static const struct luaL_Reg duellib[] = {
{
"AnnounceAttribute"
,
scriptlib
::
duel_announce_attribute
},
{
"AnnounceLevel"
,
scriptlib
::
duel_announce_level
},
{
"AnnounceCard"
,
scriptlib
::
duel_announce_card
},
{
"AnnounceCardFilter"
,
scriptlib
::
duel_announce_card_filter
},
{
"AnnounceType"
,
scriptlib
::
duel_announce_type
},
{
"AnnounceNumber"
,
scriptlib
::
duel_announce_number
},
{
"AnnounceCoin"
,
scriptlib
::
duel_announce_coin
},
...
...
libduel.cpp
View file @
c32963b2
...
...
@@ -3555,24 +3555,15 @@ int32 scriptlib::duel_announce_card(lua_State * L) {
int32
playerid
=
lua_tointeger
(
L
,
1
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
pduel
->
game_field
->
core
.
select_options
.
clear
();
uint32
ttype
=
TYPE_MONSTER
|
TYPE_SPELL
|
TYPE_TRAP
;
if
(
lua_gettop
(
L
)
>=
2
)
ttype
=
lua_tointeger
(
L
,
2
);
pduel
->
game_field
->
add_process
(
PROCESSOR_ANNOUNCE_CARD
,
0
,
0
,
0
,
playerid
,
ttype
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
lua_pushinteger
(
L
,
pduel
->
game_field
->
returns
.
ivalue
[
0
]);
return
1
;
});
}
int32
scriptlib
::
duel_announce_card_filter
(
lua_State
*
L
)
{
check_action_permission
(
L
);
check_param_count
(
L
,
2
);
int32
playerid
=
lua_tointeger
(
L
,
1
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
pduel
->
game_field
->
core
.
select_options
.
clear
();
for
(
int32
i
=
2
;
i
<=
lua_gettop
(
L
);
++
i
)
pduel
->
game_field
->
core
.
select_options
.
push_back
(
lua_tointeger
(
L
,
i
));
if
(
lua_gettop
(
L
)
==
1
)
{
pduel
->
game_field
->
core
.
select_options
.
push_back
(
TRUE
);
}
else
if
(
lua_gettop
(
L
)
==
2
)
{
pduel
->
game_field
->
core
.
select_options
.
push_back
(
lua_tointeger
(
L
,
2
));
pduel
->
game_field
->
core
.
select_options
.
push_back
(
OPCODE_ISTYPE
);
}
else
{
for
(
int32
i
=
2
;
i
<=
lua_gettop
(
L
);
++
i
)
pduel
->
game_field
->
core
.
select_options
.
push_back
(
lua_tointeger
(
L
,
i
));
}
pduel
->
game_field
->
add_process
(
PROCESSOR_ANNOUNCE_CARD
,
0
,
0
,
0
,
playerid
,
0
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
...
...
playerop.cpp
View file @
c32963b2
...
...
@@ -965,19 +965,13 @@ static int32 is_declarable(card_data const& cd, const std::vector<uint32>& opcod
return
cd
.
code
==
CARD_MARINE_DOLPHIN
||
cd
.
code
==
CARD_TWINKLE_MOSS
||
(
!
cd
.
alias
&&
(
cd
.
type
&
(
TYPE_MONSTER
+
TYPE_TOKEN
))
!=
(
TYPE_MONSTER
+
TYPE_TOKEN
));
}
int32
field
::
announce_card
(
int16
step
,
uint8
playerid
,
uint32
ttype
)
{
int32
field
::
announce_card
(
int16
step
,
uint8
playerid
)
{
if
(
step
==
0
)
{
if
(
core
.
select_options
.
size
()
==
0
)
{
pduel
->
write_buffer8
(
MSG_ANNOUNCE_CARD
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer32
(
ttype
);
}
else
{
pduel
->
write_buffer8
(
MSG_ANNOUNCE_CARD_FILTER
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
core
.
select_options
.
size
());
for
(
auto
&
option
:
core
.
select_options
)
pduel
->
write_buffer32
(
option
);
}
pduel
->
write_buffer8
(
MSG_ANNOUNCE_CARD
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
core
.
select_options
.
size
());
for
(
auto
&
option
:
core
.
select_options
)
pduel
->
write_buffer32
(
option
);
return
FALSE
;
}
else
{
int32
code
=
returns
.
ivalue
[
0
];
...
...
@@ -986,12 +980,6 @@ int32 field::announce_card(int16 step, uint8 playerid, uint32 ttype) {
if
(
!
data
.
code
)
{
pduel
->
write_buffer8
(
MSG_RETRY
);
return
FALSE
;
}
if
(
core
.
select_options
.
size
()
==
0
)
{
if
(
!
(
data
.
type
&
ttype
))
{
pduel
->
write_buffer8
(
MSG_RETRY
);
return
FALSE
;
}
}
else
{
if
(
!
is_declarable
(
data
,
core
.
select_options
))
{
pduel
->
write_buffer8
(
MSG_RETRY
);
...
...
processor.cpp
View file @
c32963b2
...
...
@@ -543,7 +543,7 @@ int32 field::process() {
return
PROCESSOR_WAITING
+
pduel
->
bufferlen
;
}
case
PROCESSOR_ANNOUNCE_CARD
:
{
if
(
announce_card
(
it
->
step
,
it
->
arg1
,
it
->
arg2
))
{
if
(
announce_card
(
it
->
step
,
it
->
arg1
))
{
core
.
units
.
pop_front
();
}
else
{
it
->
step
++
;
...
...
scriptlib.h
View file @
c32963b2
...
...
@@ -532,7 +532,6 @@ public:
static
int32
duel_announce_attribute
(
lua_State
*
L
);
static
int32
duel_announce_level
(
lua_State
*
L
);
static
int32
duel_announce_card
(
lua_State
*
L
);
static
int32
duel_announce_card_filter
(
lua_State
*
L
);
static
int32
duel_announce_type
(
lua_State
*
L
);
static
int32
duel_announce_number
(
lua_State
*
L
);
static
int32
duel_announce_coin
(
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