Commit 2b5eac4d authored by salix5's avatar salix5

add constant EFFECT_TYPES_CHAIN_LINK

parent bca4aaeb
...@@ -2526,7 +2526,7 @@ void card::set_special_summon_status(effect* peffect) { ...@@ -2526,7 +2526,7 @@ void card::set_special_summon_status(effect* peffect) {
} }
card* pcard = peffect->get_handler(); card* pcard = peffect->get_handler();
auto cait = pduel->game_field->core.current_chain.rbegin(); auto cait = pduel->game_field->core.current_chain.rbegin();
if(!(peffect->type & 0x7f0) || (pcard->is_has_relation(*cait) && !(pcard->get_type() & TYPE_TRAPMONSTER))) { if(!(peffect->type & EFFECT_TYPES_CHAIN_LINK) || (pcard->is_has_relation(*cait) && !(pcard->get_type() & TYPE_TRAPMONSTER))) {
spsummon.code = pcard->get_code(); spsummon.code = pcard->get_code();
spsummon.code2 = pcard->get_another_code(); spsummon.code2 = pcard->get_another_code();
spsummon.type = pcard->get_type(); spsummon.type = pcard->get_type();
......
...@@ -841,7 +841,7 @@ void effect::set_active_type() { ...@@ -841,7 +841,7 @@ void effect::set_active_type() {
active_type &= ~TYPE_TRAP; active_type &= ~TYPE_TRAP;
} }
uint32 effect::get_active_type(uint8 uselast) { uint32 effect::get_active_type(uint8 uselast) {
if(type & 0x7f0) { if(type & EFFECT_TYPES_CHAIN_LINK) {
if(active_type && uselast) if(active_type && uselast)
return active_type; return active_type;
else if((type & EFFECT_TYPE_ACTIVATE) && (get_handler()->data.type & TYPE_PENDULUM)) else if((type & EFFECT_TYPE_ACTIVATE) && (get_handler()->data.type & TYPE_PENDULUM))
......
...@@ -171,7 +171,8 @@ public: ...@@ -171,7 +171,8 @@ public:
#define EFFECT_TYPE_GRANT 0x2000 // #define EFFECT_TYPE_GRANT 0x2000 //
#define EFFECT_TYPE_TARGET 0x4000 // #define EFFECT_TYPE_TARGET 0x4000 //
#define EFFECT_TYPES_TRIGGER_LIKE (EFFECT_TYPE_ACTIVATE | EFFECT_TYPE_TRIGGER_O | EFFECT_TYPE_TRIGGER_F | EFFECT_TYPE_QUICK_O | EFFECT_TYPE_QUICK_F) constexpr uint32 EFFECT_TYPES_TRIGGER_LIKE = EFFECT_TYPE_ACTIVATE | EFFECT_TYPE_TRIGGER_O | EFFECT_TYPE_TRIGGER_F | EFFECT_TYPE_QUICK_O | EFFECT_TYPE_QUICK_F;
constexpr uint32 EFFECT_TYPES_CHAIN_LINK = EFFECT_TYPES_TRIGGER_LIKE | EFFECT_TYPE_FLIP | EFFECT_TYPE_IGNITION;
//========== Flags ========== //========== Flags ==========
enum effect_flag : uint32 { enum effect_flag : uint32 {
......
...@@ -147,7 +147,7 @@ int32 scriptlib::effect_set_type(lua_State *L) { ...@@ -147,7 +147,7 @@ int32 scriptlib::effect_set_type(lua_State *L) {
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);
uint32 v = (uint32)lua_tointeger(L, 2); uint32 v = (uint32)lua_tointeger(L, 2);
if (v & 0x0ff0) if (v & (EFFECT_TYPES_CHAIN_LINK | EFFECT_TYPE_CONTINUOUS))
v |= EFFECT_TYPE_ACTIONS; v |= EFFECT_TYPE_ACTIONS;
else else
v &= ~EFFECT_TYPE_ACTIONS; v &= ~EFFECT_TYPE_ACTIONS;
...@@ -518,7 +518,7 @@ int32 scriptlib::effect_is_activated(lua_State *L) { ...@@ -518,7 +518,7 @@ int32 scriptlib::effect_is_activated(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_pushboolean(L, (peffect->type & 0x7f0)); lua_pushboolean(L, (peffect->type & EFFECT_TYPES_CHAIN_LINK));
return 1; return 1;
} }
int32 scriptlib::effect_is_cost_checked(lua_State *L) { int32 scriptlib::effect_is_cost_checked(lua_State *L) {
......
...@@ -4915,7 +4915,7 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec ...@@ -4915,7 +4915,7 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec
flips.insert(pcard); flips.insert(pcard);
} }
if(enable) { if(enable) {
if(!reason_effect || !(reason_effect->type & 0x7f0) || pcard->current.location != LOCATION_MZONE) if(!reason_effect || !(reason_effect->type & EFFECT_TYPES_CHAIN_LINK) || pcard->current.location != LOCATION_MZONE)
pcard->enable_field_effect(true); pcard->enable_field_effect(true);
else else
core.delayed_enable_set.insert(pcard); core.delayed_enable_set.insert(pcard);
......
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