Commit bd60161a authored by nanahira's avatar nanahira

IsGlobalFlag

parent a23f9e94
......@@ -378,6 +378,20 @@ int32_t scriptlib::duel_enable_global_flag(lua_State *L) {
return 0;
}
int32_t scriptlib::duel_is_global_flag(lua_State *L) {
check_param_count(L, 1);
int32_t flag = (int32_t)lua_tointeger(L, 1);
duel* pduel = interpreter::get_duel_info(L);
if((pduel->game_field->core.global_flag & flag) == flag) {
lua_pushboolean(L, 1); // true
} else {
lua_pushboolean(L, 0); // false
}
return 1; // 返回一个结果值
}
int32_t scriptlib::duel_get_lp(lua_State *L) {
check_param_count(L, 1);
int32_t p = (int32_t)lua_tointeger(L, 1);
......@@ -5336,6 +5350,7 @@ static const struct luaL_Reg duellib[] = {
{ "SetRegistry", scriptlib::duel_set_registry },
{ "GetRegistry", scriptlib::duel_get_registry },
{ "ClearRegistry", scriptlib::duel_clear_registry },
{ "IsGlobalFlag", scriptlib::duel_is_global_flag },
{ "EnableGlobalFlag", scriptlib::duel_enable_global_flag },
{ "GetLP", scriptlib::duel_get_lp },
......
......@@ -57,6 +57,7 @@ public:
static int32_t duel_set_registry(lua_State *L);
static int32_t duel_get_registry(lua_State *L);
static int32_t duel_clear_registry(lua_State *L);
static int32_t duel_is_global_flag(lua_State *L);
//card lib
static int32_t card_get_code(lua_State *L);
static int32_t card_get_origin_code(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