Commit 18d7c0ab authored by nanahira's avatar nanahira

add EFFECT_FLAG2_SPOSITCH

parent 6639d091
...@@ -224,6 +224,9 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con ...@@ -224,6 +224,9 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
else else
return FALSE; return FALSE;
} }
else if((handler->data.type & TYPE_PENDULUM) && pduel->game_field->infos.turn_player != playerid && is_flag(EFFECT_FLAG2_SPOSITCH)) {
ecode = EFFECT_QP_ACT_IN_NTPHAND;
}
} else if(handler->current.location == LOCATION_SZONE) { } else if(handler->current.location == LOCATION_SZONE) {
if((handler->data.type & TYPE_TRAP) && handler->get_status(STATUS_SET_TURN)) if((handler->data.type & TYPE_TRAP) && handler->get_status(STATUS_SET_TURN))
ecode = EFFECT_TRAP_ACT_IN_SET_TURN; ecode = EFFECT_TRAP_ACT_IN_SET_TURN;
......
...@@ -207,6 +207,7 @@ enum effect_flag : uint32 { ...@@ -207,6 +207,7 @@ enum effect_flag : uint32 {
enum effect_flag2 : uint32 { enum effect_flag2 : uint32 {
// EFFECT_FLAG2_NAGA = 0x0001, // EFFECT_FLAG2_NAGA = 0x0001,
EFFECT_FLAG2_COF = 0x0002, EFFECT_FLAG2_COF = 0x0002,
EFFECT_FLAG2_SPOSITCH = 0x0100, // flag2 from 0x0100 are koishipro use
}; };
inline effect_flag operator|(effect_flag flag1, effect_flag flag2) inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
{ {
......
...@@ -693,6 +693,9 @@ interpreter::interpreter(duel* pd): coroutines(256) { ...@@ -693,6 +693,9 @@ interpreter::interpreter(duel* pd): coroutines(256) {
lua_setglobal(lua_state, "CARDDATA_RSCALE"); lua_setglobal(lua_state, "CARDDATA_RSCALE");
lua_pushinteger(lua_state, CARDDATA_LINK_MARKER); lua_pushinteger(lua_state, CARDDATA_LINK_MARKER);
lua_setglobal(lua_state, "CARDDATA_LINK_MARKER"); lua_setglobal(lua_state, "CARDDATA_LINK_MARKER");
//effect flag2s
lua_pushinteger(lua_state, EFFECT_FLAG2_SPOSITCH);
lua_setglobal(lua_state, "EFFECT_FLAG2_SPOSITCH");
//effects //effects
lua_pushinteger(lua_state, EFFECT_CHANGE_LINK_MARKER_KOISHI); lua_pushinteger(lua_state, EFFECT_CHANGE_LINK_MARKER_KOISHI);
lua_setglobal(lua_state, "EFFECT_CHANGE_LINK_MARKER_KOISHI"); lua_setglobal(lua_state, "EFFECT_CHANGE_LINK_MARKER_KOISHI");
......
...@@ -472,7 +472,11 @@ int32 scriptlib::effect_get_active_type(lua_State *L) { ...@@ -472,7 +472,11 @@ int32 scriptlib::effect_get_active_type(lua_State *L) {
if(peffect->active_type) if(peffect->active_type)
atype = peffect->active_type; atype = peffect->active_type;
else if((peffect->type & EFFECT_TYPE_ACTIVATE) && (peffect->get_handler()->data.type & TYPE_PENDULUM)) else if((peffect->type & EFFECT_TYPE_ACTIVATE) && (peffect->get_handler()->data.type & TYPE_PENDULUM))
{
atype = TYPE_PENDULUM + TYPE_SPELL; atype = TYPE_PENDULUM + TYPE_SPELL;
if(peffect->is_flag(EFFECT_FLAG2_SPOSITCH))
atype |= TYPE_QUICKPLAY;
}
else else
atype = peffect->get_handler()->get_type(); atype = peffect->get_handler()->get_type();
} else } else
...@@ -490,7 +494,11 @@ int32 scriptlib::effect_is_active_type(lua_State *L) { ...@@ -490,7 +494,11 @@ int32 scriptlib::effect_is_active_type(lua_State *L) {
if(peffect->active_type) if(peffect->active_type)
atype = peffect->active_type; atype = peffect->active_type;
else if((peffect->type & EFFECT_TYPE_ACTIVATE) && (peffect->get_handler()->data.type & TYPE_PENDULUM)) else if((peffect->type & EFFECT_TYPE_ACTIVATE) && (peffect->get_handler()->data.type & TYPE_PENDULUM))
{
atype = TYPE_PENDULUM + TYPE_SPELL; atype = TYPE_PENDULUM + TYPE_SPELL;
if(peffect->is_flag(EFFECT_FLAG2_SPOSITCH))
atype |= TYPE_QUICKPLAY;
}
else else
atype = peffect->get_handler()->get_type(); atype = peffect->get_handler()->get_type();
} else } else
......
...@@ -4278,6 +4278,9 @@ int32 field::add_chain(uint16 step) { ...@@ -4278,6 +4278,9 @@ int32 field::add_chain(uint16 step) {
else if((phandler->data.type & TYPE_SPELL) && (phandler->data.type & TYPE_QUICKPLAY) else if((phandler->data.type & TYPE_SPELL) && (phandler->data.type & TYPE_QUICKPLAY)
&& infos.turn_player != phandler->current.controler) && infos.turn_player != phandler->current.controler)
ecode = EFFECT_QP_ACT_IN_NTPHAND; ecode = EFFECT_QP_ACT_IN_NTPHAND;
else if((phandler->data.type & TYPE_PENDULUM) && peffect->is_flag(EFFECT_FLAG2_SPOSITCH)
&& infos.turn_player != phandler->current.controler)
ecode = EFFECT_QP_ACT_IN_NTPHAND;
} else if(phandler->current.location == LOCATION_SZONE) { } else if(phandler->current.location == LOCATION_SZONE) {
if((phandler->data.type & TYPE_TRAP) && phandler->get_status(STATUS_SET_TURN)) if((phandler->data.type & TYPE_TRAP) && phandler->get_status(STATUS_SET_TURN))
ecode = EFFECT_TRAP_ACT_IN_SET_TURN; ecode = EFFECT_TRAP_ACT_IN_SET_TURN;
...@@ -4337,6 +4340,8 @@ int32 field::add_chain(uint16 step) { ...@@ -4337,6 +4340,8 @@ int32 field::add_chain(uint16 step) {
if((peffect->card_type & 0x5) == 0x5) if((peffect->card_type & 0x5) == 0x5)
peffect->card_type -= TYPE_TRAP; peffect->card_type -= TYPE_TRAP;
peffect->active_type = peffect->card_type; peffect->active_type = peffect->card_type;
if(peffect->is_flag(EFFECT_FLAG2_SPOSITCH))
peffect->active_type |= TYPE_QUICKPLAY;
peffect->active_handler = peffect->handler->overlay_target; peffect->active_handler = peffect->handler->overlay_target;
clit.chain_count = core.current_chain.size() + 1; clit.chain_count = core.current_chain.size() + 1;
clit.target_cards = 0; clit.target_cards = 0;
......
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