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
5ba39d79
Commit
5ba39d79
authored
Aug 14, 2022
by
mercury233
Committed by
GitHub
Aug 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Duel.GetTargetsRelatedToChain (#458)
parent
d76e1fca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
libduel.cpp
libduel.cpp
+15
-0
scriptlib.h
scriptlib.h
+1
-0
No files found.
libduel.cpp
View file @
5ba39d79
...
...
@@ -2226,6 +2226,20 @@ int32 scriptlib::duel_get_first_target(lua_State *L) {
interpreter::card2value(L, pcard);
return (int32)ch->target_cards->container.size();
}
int32 scriptlib::duel_get_targets_relate_to_chain(lua_State* L) {
duel* pduel = interpreter::get_duel_info(L);
group* pgroup = pduel->new_group();
chain* ch = pduel->game_field->get_chain(0);
if(ch && ch->target_cards && ch->target_cards->container.size() > 0) {
for(auto& pcard : ch->target_cards->container) {
if(pcard->is_has_relation(*ch)) {
pgroup->container.insert(pcard);
}
}
}
interpreter::group2value(L, pgroup);
return 1;
}
int32 scriptlib::duel_get_current_phase(lua_State *L) {
duel* pduel = interpreter::get_duel_info(L);
lua_pushinteger(L, pduel->game_field->infos.phase);
...
...
@@ -4675,6 +4689,7 @@ static const struct luaL_Reg duellib[] = {
{ "GetChainInfo", scriptlib::duel_get_chain_info },
{ "GetChainEvent", scriptlib::duel_get_chain_event },
{ "GetFirstTarget", scriptlib::duel_get_first_target },
{ "GetTargetsRelateToChain", scriptlib::duel_get_targets_relate_to_chain },
{ "GetCurrentPhase", scriptlib::duel_get_current_phase },
{ "SkipPhase", scriptlib::duel_skip_phase },
{ "IsDamageCalculated", scriptlib::duel_is_damage_calculated },
...
...
scriptlib.h
View file @
5ba39d79
...
...
@@ -478,6 +478,7 @@ public:
static
int32
duel_get_chain_info
(
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_targets_relate_to_chain
(
lua_State
*
L
);
static
int32
duel_get_current_phase
(
lua_State
*
L
);
static
int32
duel_skip_phase
(
lua_State
*
L
);
static
int32
duel_is_damage_calculated
(
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