Commit 78c0411a authored by nanahira's avatar nanahira

use to_leave_fromex instead of status

parent 90a1b3bd
......@@ -189,6 +189,7 @@ card::card(duel* pd) {
assume_value = 0;
spsummon_code = 0;
current.controler = PLAYER_NONE;
to_leave_fromex = FALSE;
}
inline void update_cache(uint32& tdata, uint32& cache, int32*& p, uint32& query_flag, const uint32 flag) {
if (tdata != cache) {
......@@ -1421,7 +1422,7 @@ uint32 card::get_link_marker() {
return 0;
for (int32 i = 0; i < effects3.size(); ++i) {
card* ocard = effects3[i]->get_handler();
if (!(effects3[i]->type & EFFECT_TYPE_FIELD) || !(ocard && ocard->get_status(STATUS_TO_LEAVE_FROMEX)))
if (!(effects3[i]->type & EFFECT_TYPE_FIELD) || !(ocard && ocard->to_leave_fromex))
link_marker = effects3[i]->get_value(this);
}
}
......@@ -1430,14 +1431,14 @@ uint32 card::get_link_marker() {
filter_effect(EFFECT_CHANGE_LINK_MARKER_KOISHI, &effects2);
for (int32 i = 0; i < effects.size(); ++i) {
card* ocard = effects[i]->get_handler();
if (effects[i]->code == EFFECT_ADD_LINK_MARKER_KOISHI && (!(effects[i]->type & EFFECT_TYPE_FIELD) || !(ocard && ocard->get_status(STATUS_TO_LEAVE_FROMEX))))
if (effects[i]->code == EFFECT_ADD_LINK_MARKER_KOISHI && (!(effects[i]->type & EFFECT_TYPE_FIELD) || !(ocard && ocard->to_leave_fromex)))
link_marker |= effects[i]->get_value(this);
else if (effects[i]->code == EFFECT_REMOVE_LINK_MARKER_KOISHI && (!(effects[i]->type & EFFECT_TYPE_FIELD) || !(ocard && ocard->get_status(STATUS_TO_LEAVE_FROMEX))))
else if (effects[i]->code == EFFECT_REMOVE_LINK_MARKER_KOISHI && (!(effects[i]->type & EFFECT_TYPE_FIELD) || !(ocard && ocard->to_leave_fromex)))
link_marker &= ~(effects[i]->get_value(this));
}
for (int32 i = 0; i < effects2.size(); ++i) {
card* ocard = effects2[i]->get_handler();
if (!(effects2[i]->type & EFFECT_TYPE_FIELD) || !(ocard && ocard->get_status(STATUS_TO_LEAVE_FROMEX)))
if (!(effects2[i]->type & EFFECT_TYPE_FIELD) || !(ocard && ocard->to_leave_fromex))
link_marker = effects2[i]->get_value(this);
}
return link_marker;
......
......@@ -215,6 +215,8 @@ public:
effect_relation relate_effect;
effect_set_v immune_effect;
uint8 to_leave_fromex;
explicit card(duel* pd);
~card() = default;
static bool card_operation_sort(card* c1, card* c2);
......
......@@ -2209,12 +2209,12 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) {
if(lua_gettop(L) >= 3 && !lua_isnil(L, 3)) {
if(check_param(L, PARAM_TYPE_CARD, 3, TRUE)) {
mcard = *(card**) lua_touserdata(L, 3);
mcard->set_status(STATUS_TO_LEAVE_FROMEX, TRUE);
mcard->to_leave_fromex = TRUE;
} else if(check_param(L, PARAM_TYPE_GROUP, 3, TRUE)) {
mgroup = *(group**) lua_touserdata(L, 3);
for(auto cit = mgroup->container.begin(); cit != mgroup->container.end(); ++cit) {
card* gcard = *cit;
gcard->set_status(STATUS_TO_LEAVE_FROMEX, TRUE);
gcard->to_leave_fromex = TRUE;
}
} else
return luaL_error(L, "Parameter %d should be \"Card\" or \"Group\".", 3);
......@@ -2258,11 +2258,11 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) {
lua_pushinteger(L, pduel->game_field->get_useable_count_fromex(scard, playerid, uplayer, zone, &list));
lua_pushinteger(L, list);
if(mcard)
mcard->set_status(STATUS_TO_LEAVE_FROMEX, FALSE);
mcard->to_leave_fromex = FALSE;
if(mgroup){
for(auto cit = mgroup->container.begin(); cit != mgroup->container.end(); ++cit) {
card* gcard = *cit;
gcard->set_status(STATUS_TO_LEAVE_FROMEX, FALSE);
gcard->to_leave_fromex = FALSE;
}
}
if(swapped) {
......
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