Commit 095d7ca6 authored by nekrozar's avatar nekrozar

update Card.IsSetCard

parent fffcfa90
......@@ -158,40 +158,90 @@ int32 scriptlib::card_is_set_card(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 set_code = lua_tointeger(L, 2);
lua_pushboolean(L, pcard->is_set_card(set_code));
uint32 count = lua_gettop(L) - 1;
uint32 result = FALSE;
for(uint32 i = 0; i < count; ++i) {
if(lua_isnil(L, i + 2))
continue;
uint32 set_code = lua_tointeger(L, i + 2);
if(pcard->is_set_card(set_code)) {
result = TRUE;
break;
}
}
lua_pushboolean(L, result);
return 1;
}
int32 scriptlib::card_is_origin_set_card(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 set_code = lua_tointeger(L, 2);
lua_pushboolean(L, pcard->is_origin_set_card(set_code));
uint32 count = lua_gettop(L) - 1;
uint32 result = FALSE;
for(uint32 i = 0; i < count; ++i) {
if(lua_isnil(L, i + 2))
continue;
uint32 set_code = lua_tointeger(L, i + 2);
if(pcard->is_origin_set_card(set_code)) {
result = TRUE;
break;
}
}
lua_pushboolean(L, result);
return 1;
}
int32 scriptlib::card_is_pre_set_card(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 set_code = lua_tointeger(L, 2);
lua_pushboolean(L, pcard->is_pre_set_card(set_code));
uint32 count = lua_gettop(L) - 1;
uint32 result = FALSE;
for(uint32 i = 0; i < count; ++i) {
if(lua_isnil(L, i + 2))
continue;
uint32 set_code = lua_tointeger(L, i + 2);
if(pcard->is_pre_set_card(set_code)) {
result = TRUE;
break;
}
}
lua_pushboolean(L, result);
return 1;
}
int32 scriptlib::card_is_fusion_set_card(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 set_code = lua_tointeger(L, 2);
lua_pushboolean(L, pcard->is_fusion_set_card(set_code));
uint32 count = lua_gettop(L) - 1;
uint32 result = FALSE;
for(uint32 i = 0; i < count; ++i) {
if(lua_isnil(L, i + 2))
continue;
uint32 set_code = lua_tointeger(L, i + 2);
if(pcard->is_fusion_set_card(set_code)) {
result = TRUE;
break;
}
}
lua_pushboolean(L, result);
return 1;
}
int32 scriptlib::card_is_link_set_card(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 set_code = lua_tointeger(L, 2);
lua_pushboolean(L, pcard->is_link_set_card(set_code));
uint32 count = lua_gettop(L) - 1;
uint32 result = FALSE;
for(uint32 i = 0; i < count; ++i) {
if(lua_isnil(L, i + 2))
continue;
uint32 set_code = lua_tointeger(L, i + 2);
if(pcard->is_link_set_card(set_code)) {
result = TRUE;
break;
}
}
lua_pushboolean(L, result);
return 1;
}
int32 scriptlib::card_get_type(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