Commit 6f8129ed authored by mercury233's avatar mercury233
parents 9f397160 2ca5402e
...@@ -2799,7 +2799,7 @@ void card::get_unique_target(card_set* cset, int32 controler, card* icard) { ...@@ -2799,7 +2799,7 @@ void card::get_unique_target(card_set* cset, int32 controler, card* icard) {
if(unique_location & LOCATION_MZONE) { if(unique_location & LOCATION_MZONE) {
for(auto cit = player.list_mzone.begin(); cit != player.list_mzone.end(); ++cit) { for(auto cit = player.list_mzone.begin(); cit != player.list_mzone.end(); ++cit) {
card* pcard = *cit; card* pcard = *cit;
if(pcard && (pcard != icard) && pcard->is_position(POS_FACEUP) && !pcard->is_status(STATUS_BATTLE_DESTROYED) if(pcard && (pcard != icard) && pcard->is_position(POS_FACEUP) && !pcard->get_status(STATUS_BATTLE_DESTROYED | STATUS_SPSUMMON_STEP)
&& check_unique_code(pcard)) && check_unique_code(pcard))
cset->insert(pcard); cset->insert(pcard);
} }
......
...@@ -749,5 +749,5 @@ int32 effect::in_range(const chain& ch) { ...@@ -749,5 +749,5 @@ int32 effect::in_range(const chain& ch) {
void effect::set_activate_location() { void effect::set_activate_location() {
card* phandler = get_handler(); card* phandler = get_handler();
active_location = phandler->current.location; active_location = phandler->current.location;
//active_sequence = phandler->current.sequence; active_sequence = phandler->current.sequence;
} }
...@@ -51,7 +51,8 @@ public: ...@@ -51,7 +51,8 @@ public:
uint32 hint_timing[2]; uint32 hint_timing[2];
uint32 card_type; uint32 card_type;
uint32 active_type; uint32 active_type;
uint32 active_location; uint16 active_location;
uint16 active_sequence;
card* active_handler; card* active_handler;
uint16 status; uint16 status;
uint32 label; uint32 label;
......
...@@ -315,6 +315,7 @@ static const struct luaL_Reg effectlib[] = { ...@@ -315,6 +315,7 @@ static const struct luaL_Reg effectlib[] = {
{ "IsActivatable", scriptlib::effect_is_activatable }, { "IsActivatable", scriptlib::effect_is_activatable },
{ "IsActivated", scriptlib::effect_is_activated }, { "IsActivated", scriptlib::effect_is_activated },
{ "GetActivateLocation", scriptlib::effect_get_activate_location }, { "GetActivateLocation", scriptlib::effect_get_activate_location },
{ "GetActivateSequence", scriptlib::effect_get_activate_sequence },
{ NULL, NULL } { NULL, NULL }
}; };
......
...@@ -1828,8 +1828,11 @@ int32 scriptlib::card_is_special_summonable(lua_State *L) { ...@@ -1828,8 +1828,11 @@ int32 scriptlib::card_is_special_summonable(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1); card* pcard = *(card**) lua_touserdata(L, 1);
uint32 sumtype = 0;
if(lua_gettop(L) >= 2)
sumtype = lua_tointeger(L, 2);
uint32 p = pcard->pduel->game_field->core.reason_player; uint32 p = pcard->pduel->game_field->core.reason_player;
lua_pushboolean(L, pcard->is_special_summonable(p, 0)); lua_pushboolean(L, pcard->is_special_summonable(p, sumtype));
return 1; return 1;
} }
int32 scriptlib::card_is_synchro_summonable(lua_State *L) { int32 scriptlib::card_is_synchro_summonable(lua_State *L) {
......
...@@ -266,7 +266,7 @@ int32 scriptlib::duel_summon(lua_State *L) { ...@@ -266,7 +266,7 @@ int32 scriptlib::duel_summon(lua_State *L) {
uint32 zone = 0x1f; uint32 zone = 0x1f;
if(lua_gettop(L) >= 6) if(lua_gettop(L) >= 6)
zone = lua_tointeger(L, 6); zone = lua_tointeger(L, 6);
duel * pduel = pcard->pduel; duel* pduel = pcard->pduel;
pduel->game_field->core.summon_cancelable = FALSE; pduel->game_field->core.summon_cancelable = FALSE;
pduel->game_field->summon(playerid, pcard, peffect, ignore_count, min_tribute, zone); pduel->game_field->summon(playerid, pcard, peffect, ignore_count, min_tribute, zone);
return lua_yield(L, 0); return lua_yield(L, 0);
...@@ -279,9 +279,12 @@ int32 scriptlib::duel_special_summon_rule(lua_State *L) { ...@@ -279,9 +279,12 @@ int32 scriptlib::duel_special_summon_rule(lua_State *L) {
if(playerid != 0 && playerid != 1) if(playerid != 0 && playerid != 1)
return 0; return 0;
card* pcard = *(card**)lua_touserdata(L, 2); card* pcard = *(card**)lua_touserdata(L, 2);
duel * pduel = pcard->pduel; duel* pduel = pcard->pduel;
uint32 sumtype = 0;
if(lua_gettop(L) >= 3)
sumtype = lua_tointeger(L, 3);
pduel->game_field->core.summon_cancelable = FALSE; pduel->game_field->core.summon_cancelable = FALSE;
pduel->game_field->special_summon_rule(playerid, pcard, 0); pduel->game_field->special_summon_rule(playerid, pcard, sumtype);
return lua_yield(L, 0); return lua_yield(L, 0);
} }
int32 scriptlib::duel_synchro_summon(lua_State *L) { int32 scriptlib::duel_synchro_summon(lua_State *L) {
...@@ -304,7 +307,7 @@ int32 scriptlib::duel_synchro_summon(lua_State *L) { ...@@ -304,7 +307,7 @@ int32 scriptlib::duel_synchro_summon(lua_State *L) {
mg = *(group**) lua_touserdata(L, 4); mg = *(group**) lua_touserdata(L, 4);
} }
} }
duel * pduel = pcard->pduel; duel* pduel = pcard->pduel;
pduel->game_field->core.limit_tuner = tuner; pduel->game_field->core.limit_tuner = tuner;
pduel->game_field->core.limit_syn = mg; pduel->game_field->core.limit_syn = mg;
pduel->game_field->core.summon_cancelable = FALSE; pduel->game_field->core.summon_cancelable = FALSE;
...@@ -330,7 +333,7 @@ int32 scriptlib::duel_xyz_summon(lua_State *L) { ...@@ -330,7 +333,7 @@ int32 scriptlib::duel_xyz_summon(lua_State *L) {
int32 maxc = 0; int32 maxc = 0;
if(lua_gettop(L) >= 5) if(lua_gettop(L) >= 5)
maxc = lua_tointeger(L, 5); maxc = lua_tointeger(L, 5);
duel * pduel = pcard->pduel; duel* pduel = pcard->pduel;
pduel->game_field->core.limit_xyz = materials; pduel->game_field->core.limit_xyz = materials;
pduel->game_field->core.limit_xyz_minc = minc; pduel->game_field->core.limit_xyz_minc = minc;
pduel->game_field->core.limit_xyz_maxc = maxc; pduel->game_field->core.limit_xyz_maxc = maxc;
......
...@@ -516,11 +516,17 @@ int32 scriptlib::effect_is_activated(lua_State * L) { ...@@ -516,11 +516,17 @@ int32 scriptlib::effect_is_activated(lua_State * L) {
lua_pushboolean(L, (peffect->type & 0x7f0)); lua_pushboolean(L, (peffect->type & 0x7f0));
return 1; return 1;
} }
int32 scriptlib::effect_get_activate_location(lua_State *L) { int32 scriptlib::effect_get_activate_location(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
check_param(L, PARAM_TYPE_EFFECT, 1); check_param(L, PARAM_TYPE_EFFECT, 1);
effect* peffect = *(effect**) lua_touserdata(L, 1); effect* peffect = *(effect**) lua_touserdata(L, 1);
lua_pushinteger(L, peffect->active_location); lua_pushinteger(L, peffect->active_location);
return 1; return 1;
} }
\ No newline at end of file int32 scriptlib::effect_get_activate_sequence(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_EFFECT, 1);
effect* peffect = *(effect**) lua_touserdata(L, 1);
lua_pushinteger(L, peffect->active_sequence);
return 1;
}
...@@ -315,6 +315,7 @@ public: ...@@ -315,6 +315,7 @@ public:
static int32 effect_is_activatable(lua_State *L); static int32 effect_is_activatable(lua_State *L);
static int32 effect_is_activated(lua_State *L); static int32 effect_is_activated(lua_State *L);
static int32 effect_get_activate_location(lua_State *L); static int32 effect_get_activate_location(lua_State *L);
static int32 effect_get_activate_sequence(lua_State *L);
//Group functions //Group functions
static int32 group_new(lua_State *L); static int32 group_new(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