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) {
}
card* pcard = peffect->get_handler();
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.code2 = pcard->get_another_code();
spsummon.type = pcard->get_type();
......
......@@ -841,7 +841,7 @@ void effect::set_active_type() {
active_type &= ~TYPE_TRAP;
}
uint32 effect::get_active_type(uint8 uselast) {
if(type & 0x7f0) {
if(type & EFFECT_TYPES_CHAIN_LINK) {
if(active_type && uselast)
return active_type;
else if((type & EFFECT_TYPE_ACTIVATE) && (get_handler()->data.type & TYPE_PENDULUM))
......
......@@ -171,7 +171,8 @@ public:
#define EFFECT_TYPE_GRANT 0x2000 //
#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 ==========
enum effect_flag : uint32 {
......
......@@ -147,7 +147,7 @@ int32 scriptlib::effect_set_type(lua_State *L) {
check_param(L, PARAM_TYPE_EFFECT, 1);
effect* peffect = *(effect**) lua_touserdata(L, 1);
uint32 v = (uint32)lua_tointeger(L, 2);
if (v & 0x0ff0)
if (v & (EFFECT_TYPES_CHAIN_LINK | EFFECT_TYPE_CONTINUOUS))
v |= EFFECT_TYPE_ACTIONS;
else
v &= ~EFFECT_TYPE_ACTIONS;
......@@ -518,7 +518,7 @@ int32 scriptlib::effect_is_activated(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_EFFECT, 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;
}
int32 scriptlib::effect_is_cost_checked(lua_State *L) {
......
......@@ -4915,7 +4915,7 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec
flips.insert(pcard);
}
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);
else
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