Commit baf79be6 authored by nanahira's avatar nanahira

update

parent 90037a26
...@@ -1129,8 +1129,11 @@ uint32 card::get_link_marker() { ...@@ -1129,8 +1129,11 @@ uint32 card::get_link_marker() {
effect_set effects; effect_set effects;
uint32 link_marker = data.link_marker; uint32 link_marker = data.link_marker;
filter_effect(710253, &effects); filter_effect(710253, &effects);
for (int32 i = 0; i < effects.size(); ++i) for (int32 i = 0; i < effects.size(); ++i){
link_marker = effects[i]->get_value(this); card* ocard = effects[i]->get_handler();
if (!(effects[i]->type & EFFECT_TYPE_FIELD) || !(ocard && ocard->get_status(STATUS_TO_LEAVE_FROMEX)))
link_marker = effects[i]->get_value(this);
}
return link_marker; return link_marker;
} }
int32 card::is_link_marker(uint32 dir) { int32 card::is_link_marker(uint32 dir) {
......
...@@ -499,6 +499,8 @@ public: ...@@ -499,6 +499,8 @@ public:
#define STATUS_OPPO_BATTLE 0x10000000 #define STATUS_OPPO_BATTLE 0x10000000
#define STATUS_FLIP_SUMMON_TURN 0x20000000 #define STATUS_FLIP_SUMMON_TURN 0x20000000
#define STATUS_SPSUMMON_TURN 0x40000000 #define STATUS_SPSUMMON_TURN 0x40000000
//222DIY
#define STATUS_TO_LEAVE_FROMEX 0x80000000
//Counter //Counter
#define COUNTER_WITHOUT_PERMIT 0x1000 #define COUNTER_WITHOUT_PERMIT 0x1000
#define COUNTER_NEED_ENABLE 0x2000 #define COUNTER_NEED_ENABLE 0x2000
......
...@@ -1653,6 +1653,7 @@ int32 scriptlib::duel_get_location_count(lua_State *L) { ...@@ -1653,6 +1653,7 @@ int32 scriptlib::duel_get_location_count(lua_State *L) {
lua_pushinteger(L, pduel->game_field->get_useable_count(playerid, location, uplayer, reason, zone)); lua_pushinteger(L, pduel->game_field->get_useable_count(playerid, location, uplayer, reason, zone));
return 1; return 1;
} }
//222DIY modded by Flandre
int32 scriptlib::duel_get_location_count_fromex(lua_State *L) { int32 scriptlib::duel_get_location_count_fromex(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
uint32 playerid = lua_tointeger(L, 1); uint32 playerid = lua_tointeger(L, 1);
...@@ -1670,8 +1671,13 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) { ...@@ -1670,8 +1671,13 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) {
if(lua_gettop(L) >= 3 && !lua_isnil(L, 3)) { if(lua_gettop(L) >= 3 && !lua_isnil(L, 3)) {
if(check_param(L, PARAM_TYPE_CARD, 3, TRUE)) { if(check_param(L, PARAM_TYPE_CARD, 3, TRUE)) {
mcard = *(card**) lua_touserdata(L, 3); mcard = *(card**) lua_touserdata(L, 3);
mcard->set_status(STATUS_TO_LEAVE_FROMEX, TRUE);
} else if(check_param(L, PARAM_TYPE_GROUP, 3, TRUE)) { } else if(check_param(L, PARAM_TYPE_GROUP, 3, TRUE)) {
mgroup = *(group**) lua_touserdata(L, 3); 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);
}
} else } else
luaL_error(L, "Parameter %d should be \"Card\" or \"Group\".", 3); luaL_error(L, "Parameter %d should be \"Card\" or \"Group\".", 3);
for(int32 p = 0; p < 2; p++) { for(int32 p = 0; p < 2; p++) {
...@@ -1701,6 +1707,14 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) { ...@@ -1701,6 +1707,14 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) {
lua_pushinteger(L, pduel->game_field->get_useable_count_fromex(scard, playerid, uplayer, zone)); lua_pushinteger(L, pduel->game_field->get_useable_count_fromex(scard, playerid, uplayer, zone));
else else
lua_pushinteger(L, pduel->game_field->get_useable_count(playerid, LOCATION_MZONE, uplayer, LOCATION_REASON_TOFIELD, zone)); lua_pushinteger(L, pduel->game_field->get_useable_count(playerid, LOCATION_MZONE, uplayer, LOCATION_REASON_TOFIELD, zone));
if(mcard)
mcard->set_status(STATUS_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);
}
}
if(swapped) { if(swapped) {
pduel->game_field->player[0].used_location = used_location[0]; pduel->game_field->player[0].used_location = used_location[0];
pduel->game_field->player[1].used_location = used_location[1]; pduel->game_field->player[1].used_location = used_location[1];
......
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