Commit a84c4f81 authored by nanahira's avatar nanahira

update

parent 06b4305f
......@@ -20,6 +20,9 @@ static const struct luaL_Reg cardlib[] = {
{ "GetAffectingEffect", scriptlib::card_get_affecting_effect },
{ "FilterEffect", scriptlib::card_filter_effect },
{ "SetEntityCode", scriptlib::card_set_entity_code },
{ "IsLinkBelow", scriptlib::card_is_link_below },
{ "IsLinkAbove", scriptlib::card_is_link_above },
{ "GetCode", scriptlib::card_get_code },
{ "GetOriginalCode", scriptlib::card_get_origin_code },
{ "GetOriginalCodeRule", scriptlib::card_get_origin_code_rule },
......
......@@ -55,6 +55,30 @@ int32 scriptlib::card_set_entity_code(lua_State *L) {
lua_pushinteger(L, pcard->set_entity_code(trace, remove_alias));
return 1;
}
int32 scriptlib::card_is_link_below(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 lnk = lua_tointeger(L, 2);
if(!(pcard->data.type & TYPE_LINK) || (pcard->status & STATUS_NO_LEVEL)
|| (!(pcard->data.type & TYPE_MONSTER) && !(pcard->current.location & LOCATION_MZONE)))
lua_pushboolean(L, 0);
else
lua_pushboolean(L, pcard->get_link() <= lnk);
return 1;
}
int32 scriptlib::card_is_link_above(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 lnk = lua_tointeger(L, 2);
if(!(pcard->data.type & TYPE_LINK) || (pcard->status & STATUS_NO_LEVEL)
|| (!(pcard->data.type & TYPE_MONSTER) && !(pcard->current.location & LOCATION_MZONE)))
lua_pushboolean(L, 0);
else
lua_pushboolean(L, pcard->get_link() >= lnk);
return 1;
}
int32 scriptlib::card_get_code(lua_State *L) {
check_param_count(L, 1);
......
......@@ -20,6 +20,8 @@ public:
static int32 card_get_affecting_effect(lua_State *L);
static int32 card_set_entity_code(lua_State *L);
static int32 card_filter_effect(lua_State *L);
static int32 card_is_link_below(lua_State *L);
static int32 card_is_link_above(lua_State *L);
static int32 effect_set_owner(lua_State *L);
static int32 duel_select_field(lua_State *L);
static int32 duel_get_master_rule(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