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
311b7c3f
Commit
311b7c3f
authored
Dec 10, 2023
by
Chen Bill
Committed by
GitHub
Dec 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Duel.GetReadyChain (#519)
parent
39fb7c86
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
0 deletions
+14
-0
field.h
field.h
+1
-0
libduel.cpp
libduel.cpp
+10
-0
processor.cpp
processor.cpp
+2
-0
scriptlib.h
scriptlib.h
+1
-0
No files found.
field.h
View file @
311b7c3f
...
@@ -298,6 +298,7 @@ struct processor {
...
@@ -298,6 +298,7 @@ struct processor {
uint8
dice_result
[
5
]{
0
};
uint8
dice_result
[
5
]{
0
};
uint8
coin_result
[
MAX_COIN_COUNT
]{
0
};
uint8
coin_result
[
MAX_COIN_COUNT
]{
0
};
int32
coin_count
{
0
};
int32
coin_count
{
0
};
bool
is_target_ready
{
false
};
uint8
to_bp
{
FALSE
};
uint8
to_bp
{
FALSE
};
uint8
to_m2
{
FALSE
};
uint8
to_m2
{
FALSE
};
...
...
libduel.cpp
View file @
311b7c3f
...
@@ -2121,6 +2121,15 @@ int32 scriptlib::duel_get_current_chain(lua_State *L) {
...
@@ -2121,6 +2121,15 @@ int32 scriptlib::duel_get_current_chain(lua_State *L) {
lua_pushinteger
(
L
,
pduel
->
game_field
->
core
.
current_chain
.
size
());
lua_pushinteger
(
L
,
pduel
->
game_field
->
core
.
current_chain
.
size
());
return
1
;
return
1
;
}
}
int32
scriptlib
::
duel_get_ready_chain
(
lua_State
*
L
)
{
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
int32
size
=
(
int32
)
pduel
->
game_field
->
core
.
current_chain
.
size
();
if
(
size
&&
!
pduel
->
game_field
->
core
.
is_target_ready
)
{
--
size
;
}
lua_pushinteger
(
L
,
size
);
return
1
;
}
int32
scriptlib
::
duel_get_chain_info
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_get_chain_info
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param_count
(
L
,
1
);
uint32
c
=
(
uint32
)
lua_tointeger
(
L
,
1
);
uint32
c
=
(
uint32
)
lua_tointeger
(
L
,
1
);
...
@@ -4780,6 +4789,7 @@ static const struct luaL_Reg duellib[] = {
...
@@ -4780,6 +4789,7 @@ static const struct luaL_Reg duellib[] = {
{
"GetFieldCard"
,
scriptlib
::
duel_get_field_card
},
{
"GetFieldCard"
,
scriptlib
::
duel_get_field_card
},
{
"CheckLocation"
,
scriptlib
::
duel_check_location
},
{
"CheckLocation"
,
scriptlib
::
duel_check_location
},
{
"GetCurrentChain"
,
scriptlib
::
duel_get_current_chain
},
{
"GetCurrentChain"
,
scriptlib
::
duel_get_current_chain
},
{
"GetReadyChain"
,
scriptlib
::
duel_get_ready_chain
},
{
"GetChainInfo"
,
scriptlib
::
duel_get_chain_info
},
{
"GetChainInfo"
,
scriptlib
::
duel_get_chain_info
},
{
"GetChainEvent"
,
scriptlib
::
duel_get_chain_event
},
{
"GetChainEvent"
,
scriptlib
::
duel_get_chain_event
},
{
"GetFirstTarget"
,
scriptlib
::
duel_get_first_target
},
{
"GetFirstTarget"
,
scriptlib
::
duel_get_first_target
},
...
...
processor.cpp
View file @
311b7c3f
...
@@ -4071,6 +4071,7 @@ int32 field::add_chain(uint16 step) {
...
@@ -4071,6 +4071,7 @@ int32 field::add_chain(uint16 step) {
if
(
phandler
->
current
.
location
==
LOCATION_HAND
)
if
(
phandler
->
current
.
location
==
LOCATION_HAND
)
clit
.
flag
|=
CHAIN_HAND_EFFECT
;
clit
.
flag
|=
CHAIN_HAND_EFFECT
;
core
.
current_chain
.
push_back
(
clit
);
core
.
current_chain
.
push_back
(
clit
);
core
.
is_target_ready
=
false
;
check_chain_counter
(
peffect
,
clit
.
triggering_player
,
clit
.
chain_count
);
check_chain_counter
(
peffect
,
clit
.
triggering_player
,
clit
.
chain_count
);
// triggered events which are not caused by event create relation with the handler
// triggered events which are not caused by event create relation with the handler
if
(
!
peffect
->
is_flag
(
EFFECT_FLAG_FIELD_ONLY
)
if
(
!
peffect
->
is_flag
(
EFFECT_FLAG_FIELD_ONLY
)
...
@@ -4173,6 +4174,7 @@ int32 field::add_chain(uint16 step) {
...
@@ -4173,6 +4174,7 @@ int32 field::add_chain(uint16 step) {
}
}
case
7
:
{
case
7
:
{
break_effect
();
break_effect
();
core
.
is_target_ready
=
true
;
auto
&
clit
=
core
.
current_chain
.
back
();
auto
&
clit
=
core
.
current_chain
.
back
();
effect
*
peffect
=
clit
.
triggering_effect
;
effect
*
peffect
=
clit
.
triggering_effect
;
peffect
->
cost_checked
=
FALSE
;
peffect
->
cost_checked
=
FALSE
;
...
...
scriptlib.h
View file @
311b7c3f
...
@@ -486,6 +486,7 @@ public:
...
@@ -486,6 +486,7 @@ public:
static
int32
duel_get_field_card
(
lua_State
*
L
);
static
int32
duel_get_field_card
(
lua_State
*
L
);
static
int32
duel_check_location
(
lua_State
*
L
);
static
int32
duel_check_location
(
lua_State
*
L
);
static
int32
duel_get_current_chain
(
lua_State
*
L
);
static
int32
duel_get_current_chain
(
lua_State
*
L
);
static
int32
duel_get_ready_chain
(
lua_State
*
L
);
static
int32
duel_get_chain_info
(
lua_State
*
L
);
static
int32
duel_get_chain_info
(
lua_State
*
L
);
static
int32
duel_get_chain_event
(
lua_State
*
L
);
static
int32
duel_get_chain_event
(
lua_State
*
L
);
static
int32
duel_get_first_target
(
lua_State
*
L
);
static
int32
duel_get_first_target
(
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