Commit 1358b0ae authored by salix5's avatar salix5

EVENT_SPSUMMON of pendulum summon

parent 5d0bbcc3
...@@ -399,7 +399,7 @@ uint32 card::get_type() { ...@@ -399,7 +399,7 @@ uint32 card::get_type() {
int32 card::get_base_attack(uint8 swap) { int32 card::get_base_attack(uint8 swap) {
if(!(data.type & TYPE_MONSTER) && !(get_type() & TYPE_MONSTER) && !is_affected_by_effect(EFFECT_PRE_MONSTER)) if(!(data.type & TYPE_MONSTER) && !(get_type() & TYPE_MONSTER) && !is_affected_by_effect(EFFECT_PRE_MONSTER))
return 0; return 0;
if (current.location != LOCATION_MZONE || status & STATUS_SUMMONING) if (current.location != LOCATION_MZONE || is_status(STATUS_SUMMONING))
return data.attack; return data.attack;
if (temp.base_attack != -1) if (temp.base_attack != -1)
return temp.base_attack; return temp.base_attack;
...@@ -427,7 +427,7 @@ int32 card::get_attack() { ...@@ -427,7 +427,7 @@ int32 card::get_attack() {
return assume_value; return assume_value;
if(!(data.type & TYPE_MONSTER) && !(get_type() & TYPE_MONSTER) && !is_affected_by_effect(EFFECT_PRE_MONSTER)) if(!(data.type & TYPE_MONSTER) && !(get_type() & TYPE_MONSTER) && !is_affected_by_effect(EFFECT_PRE_MONSTER))
return 0; return 0;
if (current.location != LOCATION_MZONE || status & STATUS_SUMMONING) if (current.location != LOCATION_MZONE || is_status(STATUS_SUMMONING))
return data.attack; return data.attack;
if (temp.attack != -1) if (temp.attack != -1)
return temp.attack; return temp.attack;
...@@ -438,7 +438,7 @@ int32 card::get_attack() { ...@@ -438,7 +438,7 @@ int32 card::get_attack() {
int32 card::get_base_defence(uint8 swap) { int32 card::get_base_defence(uint8 swap) {
if(!(data.type & TYPE_MONSTER) && !(get_type() & TYPE_MONSTER) && !is_affected_by_effect(EFFECT_PRE_MONSTER)) if(!(data.type & TYPE_MONSTER) && !(get_type() & TYPE_MONSTER) && !is_affected_by_effect(EFFECT_PRE_MONSTER))
return 0; return 0;
if (current.location != LOCATION_MZONE || status & STATUS_SUMMONING) if (current.location != LOCATION_MZONE || is_status(STATUS_SUMMONING))
return data.defence; return data.defence;
if (temp.base_defence != -1) if (temp.base_defence != -1)
return temp.base_defence; return temp.base_defence;
...@@ -466,7 +466,7 @@ int32 card::get_defence() { ...@@ -466,7 +466,7 @@ int32 card::get_defence() {
return assume_value; return assume_value;
if(!(data.type & TYPE_MONSTER) && !(get_type() & TYPE_MONSTER) && !is_affected_by_effect(EFFECT_PRE_MONSTER)) if(!(data.type & TYPE_MONSTER) && !(get_type() & TYPE_MONSTER) && !is_affected_by_effect(EFFECT_PRE_MONSTER))
return 0; return 0;
if (current.location != LOCATION_MZONE || status & STATUS_SUMMONING) if (current.location != LOCATION_MZONE || is_status(STATUS_SUMMONING))
return data.defence; return data.defence;
if (temp.defence != -1) if (temp.defence != -1)
return temp.defence; return temp.defence;
...@@ -2357,7 +2357,7 @@ int32 card::is_setable_szone(uint8 playerid, uint8 ignore_fd) { ...@@ -2357,7 +2357,7 @@ int32 card::is_setable_szone(uint8 playerid, uint8 ignore_fd) {
} }
// return: this is affected by peffect or not // return: this is affected by peffect or not
int32 card::is_affect_by_effect(effect* peffect) { int32 card::is_affect_by_effect(effect* peffect) {
if(is_status(STATUS_SUMMONING)) if(is_status(STATUS_SUMMONING) && peffect->code != EFFECT_CANNOT_DISABLE_SUMMON && peffect->code != EFFECT_CANNOT_DISABLE_SPSUMMON)
return FALSE; return FALSE;
if(!peffect || peffect->is_flag(EFFECT_FLAG_IGNORE_IMMUNE)) if(!peffect || peffect->is_flag(EFFECT_FLAG_IGNORE_IMMUNE))
return TRUE; return TRUE;
......
...@@ -2335,15 +2335,16 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target, ui ...@@ -2335,15 +2335,16 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target, ui
core.spsummon_once_map[sumplayer][*cit]++; core.spsummon_once_map[sumplayer][*cit]++;
card_set cset; card_set cset;
for(auto cit = pgroup->container.begin(); cit != pgroup->container.end(); ++cit) { for(auto cit = pgroup->container.begin(); cit != pgroup->container.end(); ++cit) {
(*cit)->set_status(STATUS_SUMMONING, TRUE);
if(!(*cit)->is_affected_by_effect(EFFECT_CANNOT_DISABLE_SPSUMMON)) { if(!(*cit)->is_affected_by_effect(EFFECT_CANNOT_DISABLE_SPSUMMON)) {
cset.insert(*cit); cset.insert(*cit);
} }
(*cit)->set_status(STATUS_SUMMONING, TRUE);
} }
if(cset.size()) if(cset.size()) {
raise_event(&cset, EVENT_SPSUMMON, core.units.begin()->peffect, 0, sumplayer, sumplayer, 0); raise_event(&cset, EVENT_SPSUMMON, core.units.begin()->peffect, 0, sumplayer, sumplayer, 0);
process_instant_event(); process_instant_event();
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0x101, TRUE); add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0x101, TRUE);
}
return FALSE; return FALSE;
} }
case 26: { case 26: {
......
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