Skip to content

Commit

Permalink
add Duel.AdjustAll (#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
mercury233 authored Jul 30, 2022
1 parent 934f571 commit 3ef5beb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libduel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2347,6 +2347,13 @@ int32 scriptlib::duel_adjust_instantly(lua_State *L) {
pduel->game_field->adjust_instant();
return 0;
}
int32 scriptlib::duel_adjust_all(lua_State* L) {
duel* pduel = interpreter::get_duel_info(L);
pduel->game_field->adjust_all();
return lua_yieldk(L, 0, (lua_KContext)pduel, [](lua_State *L, int32 status, lua_KContext ctx) {
return 0;
});
}
/**
* \brief Duel.GetFieldGroup
* \param playerid, location1, location2
Expand Down Expand Up @@ -4678,6 +4685,7 @@ static const struct luaL_Reg duellib[] = {
{ "ChainAttack", scriptlib::duel_chain_attack },
{ "Readjust", scriptlib::duel_readjust },
{ "AdjustInstantly", scriptlib::duel_adjust_instantly },
{ "AdjustAll", scriptlib::duel_adjust_all },
{ "GetFieldGroup", scriptlib::duel_get_field_group },
{ "GetFieldGroupCount", scriptlib::duel_get_field_group_count },
{ "GetDecktopGroup", scriptlib::duel_get_decktop_group },
Expand Down
1 change: 1 addition & 0 deletions scriptlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ class scriptlib {
static int32 duel_chain_attack(lua_State *L);
static int32 duel_readjust(lua_State *L);
static int32 duel_adjust_instantly(lua_State *L);
static int32 duel_adjust_all(lua_State *L);

static int32 duel_get_field_group(lua_State *L);
static int32 duel_get_field_group_count(lua_State *L);
Expand Down

0 comments on commit 3ef5beb

Please sign in to comment.