Commit 7fc57084 authored by mercury233's avatar mercury233
parents 57599149 dbeedf32
......@@ -519,6 +519,7 @@ static const struct luaL_Reg duellib[] = {
{ "SetOperationInfo", scriptlib::duel_set_operation_info },
{ "GetOperationInfo", scriptlib::duel_get_operation_info },
{ "GetOperationCount", scriptlib::duel_get_operation_count },
{ "ClearOperationInfo", scriptlib::duel_clear_operation_info },
{ "CheckXyzMaterial", scriptlib::duel_check_xyz_material },
{ "SelectXyzMaterial", scriptlib::duel_select_xyz_material },
{ "Overlay", scriptlib::duel_overlay },
......
......@@ -3201,6 +3201,21 @@ int32 scriptlib::duel_get_operation_count(lua_State *L) {
lua_pushinteger(L, ch->opinfos.size());
return 1;
}
int32 scriptlib::duel_clear_operation_info(lua_State* L) {
check_action_permission(L);
check_param_count(L, 1);
uint32 ct = lua_tointeger(L, 1);
duel* pduel = interpreter::get_duel_info(L);
chain* ch = pduel->game_field->get_chain(ct);
if(!ch)
return 0;
for(auto& oit : ch->opinfos) {
if(oit.second.op_cards)
pduel->delete_group(oit.second.op_cards);
}
ch->opinfos.clear();
return 0;
}
int32 scriptlib::duel_check_xyz_material(lua_State *L) {
check_param_count(L, 6);
check_param(L, PARAM_TYPE_CARD, 1);
......
......@@ -513,6 +513,7 @@ public:
static int32 duel_set_operation_info(lua_State *L);
static int32 duel_get_operation_info(lua_State *L);
static int32 duel_get_operation_count(lua_State *L);
static int32 duel_clear_operation_info(lua_State *L);
static int32 duel_check_xyz_material(lua_State *L);
static int32 duel_select_xyz_material(lua_State *L);
static int32 duel_overlay(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