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
20d0b399
Commit
20d0b399
authored
Jul 08, 2019
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:moecube/ygopro-core
parents
5e398e4c
f79332d7
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
43 additions
and
53 deletions
+43
-53
card.cpp
card.cpp
+8
-1
common.h
common.h
+0
-1
field.cpp
field.cpp
+13
-1
field.h
field.h
+1
-1
interpreter.cpp
interpreter.cpp
+0
-1
libduel.cpp
libduel.cpp
+9
-18
playerop.cpp
playerop.cpp
+10
-26
processor.cpp
processor.cpp
+2
-3
scriptlib.h
scriptlib.h
+0
-1
No files found.
card.cpp
View file @
20d0b399
...
...
@@ -2161,8 +2161,15 @@ uint8 card::refresh_control_status() {
filter_effect
(
EFFECT_SET_CONTROL
,
&
eset
);
if
(
eset
.
size
())
{
effect
*
peffect
=
eset
.
get_last
();
if
(
peffect
->
id
>=
last_id
)
if
(
peffect
->
id
>=
last_id
)
{
card
*
pcard
=
peffect
->
get_handler
();
pduel
->
game_field
->
core
.
readjust_map
[
pcard
]
++
;
if
(
pduel
->
game_field
->
core
.
readjust_map
[
pcard
]
>
3
)
{
pduel
->
game_field
->
send_to
(
pcard
,
0
,
REASON_RULE
,
peffect
->
get_handler_player
(),
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
POS_FACEUP
);
return
final
;
}
final
=
(
uint8
)
peffect
->
get_value
(
this
);
}
}
return
final
;
}
...
...
common.h
View file @
20d0b399
...
...
@@ -316,7 +316,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.cpp
View file @
20d0b399
...
...
@@ -963,8 +963,20 @@ void field::shuffle(uint8 playerid, uint8 location) {
pduel
->
write_buffer8
(
svector
.
size
());
for
(
auto
&
pcard
:
svector
)
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
if
(
location
==
LOCATION_HAND
)
if
(
location
==
LOCATION_HAND
)
{
core
.
shuffle_hand_check
[
playerid
]
=
FALSE
;
for
(
auto
&
pcard
:
svector
)
{
for
(
auto
&
i
:
pcard
->
indexer
)
{
effect
*
peffect
=
i
.
first
;
if
(
peffect
->
is_flag
(
EFFECT_FLAG_CLIENT_HINT
)
&&
!
peffect
->
is_flag
(
EFFECT_FLAG_PLAYER_TARGET
))
{
pduel
->
write_buffer8
(
MSG_CARD_HINT
);
pduel
->
write_buffer32
(
pcard
->
get_info_location
());
pduel
->
write_buffer8
(
CHINT_DESC_ADD
);
pduel
->
write_buffer32
(
peffect
->
description
);
}
}
}
}
}
else
{
pduel
->
write_buffer8
(
MSG_SHUFFLE_DECK
);
pduel
->
write_buffer8
(
playerid
);
...
...
field.h
View file @
20d0b399
...
...
@@ -609,7 +609,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 @
20d0b399
...
...
@@ -564,7 +564,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 @
20d0b399
...
...
@@ -3792,24 +3792,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 @
20d0b399
...
...
@@ -965,43 +965,27 @@ 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
];
bool
retry
=
false
;
card_data
data
;
read_card
(
code
,
&
data
);
if
(
!
data
.
code
)
{
retry
=
true
;
}
else
if
(
core
.
select_options
.
size
()
==
0
)
{
if
(
!
(
data
.
type
&
ttype
))
{
retry
=
true
;
}
pduel
->
write_buffer8
(
MSG_RETRY
);
return
FALSE
;
}
else
{
if
(
!
is_declarable
(
data
,
core
.
select_options
))
{
retry
=
true
;
pduel
->
write_buffer8
(
MSG_RETRY
);
return
FALSE
;
}
}
if
(
retry
)
{
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_MESSAGE
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer32
(
1421
);
return
announce_card
(
0
,
playerid
,
ttype
);
}
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_CODE
);
pduel
->
write_buffer8
(
playerid
);
...
...
processor.cpp
View file @
20d0b399
...
...
@@ -543,11 +543,10 @@ 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
{
if
(
it
->
step
==
0
)
it
->
step
++
;
it
->
step
++
;
}
return
PROCESSOR_WAITING
+
pduel
->
bufferlen
;
}
...
...
scriptlib.h
View file @
20d0b399
...
...
@@ -555,7 +555,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