Commit ca6f8413 authored by mercury233's avatar mercury233 Committed by GitHub

keep last active_type until the next activate (#615)

parent 8f4b2899
...@@ -299,7 +299,7 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con ...@@ -299,7 +299,7 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
return FALSE; return FALSE;
} else if(!(type & EFFECT_TYPE_CONTINUOUS)) { } else if(!(type & EFFECT_TYPE_CONTINUOUS)) {
card* phandler = get_handler(); card* phandler = get_handler();
if(!(phandler->get_type() & TYPE_MONSTER) && (get_active_type() & TYPE_MONSTER)) if(!(phandler->get_type() & TYPE_MONSTER) && (get_active_type(FALSE) & TYPE_MONSTER))
return FALSE; return FALSE;
if((type & EFFECT_TYPE_QUICK_O) && is_flag(EFFECT_FLAG_DELAY) && !in_range(phandler)) if((type & EFFECT_TYPE_QUICK_O) && is_flag(EFFECT_FLAG_DELAY) && !in_range(phandler))
return FALSE; return FALSE;
...@@ -837,9 +837,9 @@ void effect::set_active_type() { ...@@ -837,9 +837,9 @@ void effect::set_active_type() {
if(active_type & TYPE_TRAPMONSTER) if(active_type & TYPE_TRAPMONSTER)
active_type &= ~TYPE_TRAP; active_type &= ~TYPE_TRAP;
} }
uint32 effect::get_active_type() { uint32 effect::get_active_type(uint8 uselast) {
if(type & 0x7f0) { if(type & 0x7f0) {
if(active_type) 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))
return TYPE_PENDULUM + TYPE_SPELL; return TYPE_PENDULUM + TYPE_SPELL;
......
...@@ -109,7 +109,7 @@ public: ...@@ -109,7 +109,7 @@ public:
int32 in_range(const chain& ch); int32 in_range(const chain& ch);
void set_activate_location(); void set_activate_location();
void set_active_type(); void set_active_type();
uint32 get_active_type(); uint32 get_active_type(uint8 uselast = TRUE);
int32 get_code_type() const; int32 get_code_type() const;
bool is_flag(effect_flag x) const { bool is_flag(effect_flag x) const {
......
...@@ -4497,7 +4497,8 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2 ...@@ -4497,7 +4497,8 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
destroy(fscard, 0, REASON_RULE, 1 - pcard->current.controler); destroy(fscard, 0, REASON_RULE, 1 - pcard->current.controler);
} }
} }
peffect->active_type = 0; // keep last active_type until the next activate, for the using in script
// peffect->active_type = 0;
peffect->active_handler = 0; peffect->active_handler = 0;
pcard->release_relation(*cait); pcard->release_relation(*cait);
if(cait->target_cards) if(cait->target_cards)
......
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