Commit 070122be authored by nekrozar's avatar nekrozar Committed by VanillaSalt

add Duel.GetLinkedZone (#88)

parent c3ecac89
......@@ -408,6 +408,7 @@ static const struct luaL_Reg duellib[] = {
{ "CheckSummonedCount", scriptlib::duel_check_summon_count },
{ "GetLocationCount", scriptlib::duel_get_location_count },
{ "GetLocationCountFromEx", scriptlib::duel_get_location_count_fromex },
{ "GetLinkedZone", scriptlib::duel_get_linked_zone },
{ "GetFieldCard", scriptlib::duel_get_field_card },
{ "CheckLocation", scriptlib::duel_check_location },
{ "GetCurrentChain", scriptlib::duel_get_current_chain },
......
......@@ -1533,6 +1533,15 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) {
}
return 2;
}
int32 scriptlib::duel_get_linked_zone(lua_State *L) {
check_param_count(L, 1);
uint32 playerid = lua_tointeger(L, 1);
if(playerid != 0 && playerid != 1)
return 0;
duel* pduel = interpreter::get_duel_info(L);
lua_pushinteger(L, pduel->game_field->get_linked_zone(playerid));
return 1;
}
int32 scriptlib::duel_get_field_card(lua_State *L) {
check_param_count(L, 3);
uint32 playerid = lua_tointeger(L, 1);
......
......@@ -405,6 +405,7 @@ public:
static int32 duel_check_summon_count(lua_State *L);
static int32 duel_get_location_count(lua_State *L);
static int32 duel_get_location_count_fromex(lua_State *L);
static int32 duel_get_linked_zone(lua_State *L);
static int32 duel_get_field_card(lua_State *L);
static int32 duel_check_location(lua_State *L);
static int32 duel_get_current_chain(lua_State *L);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment