Commit da5bd916 authored by salix5's avatar salix5 Committed by GitHub

check unique only for face-up position (#322)

* check_unique_onfield()

* fix position

* filter_spsummon_procedure(), check EFFECT_DEVINE_LIGHT

1. Check uniqueness of sp_summon procedure with face-up position
2. Check EFFECT_DEVINE_LIGHT in is_can_be_special_summoned()

* format
Co-authored-by: default avatarDailyShana <8469304+DailyShana@users.noreply.github.com>
Co-authored-by: default avatarDailyShana <8469304+DailyShana@users.noreply.github.com>
parent 887d70fa
...@@ -2611,7 +2611,7 @@ void card::filter_spsummon_procedure(uint8 playerid, effect_set* peset, uint32 s ...@@ -2611,7 +2611,7 @@ void card::filter_spsummon_procedure(uint8 playerid, effect_set* peset, uint32 s
toplayer = playerid; toplayer = playerid;
} }
if(peffect->is_available() && peffect->check_count_limit(playerid) && is_spsummonable(peffect) if(peffect->is_available() && peffect->check_count_limit(playerid) && is_spsummonable(peffect)
&& !pduel->game_field->check_unique_onfield(this, toplayer, LOCATION_MZONE)) { && ((topos & POS_FACEDOWN) || !pduel->game_field->check_unique_onfield(this, toplayer, LOCATION_MZONE))) {
effect* sumeffect = pduel->game_field->core.reason_effect; effect* sumeffect = pduel->game_field->core.reason_effect;
if(!sumeffect) if(!sumeffect)
sumeffect = peffect; sumeffect = peffect;
...@@ -3150,7 +3150,9 @@ int32 card::is_can_be_special_summoned(effect* reason_effect, uint32 sumtype, ui ...@@ -3150,7 +3150,9 @@ int32 card::is_can_be_special_summoned(effect* reason_effect, uint32 sumtype, ui
if((data.type & TYPE_PENDULUM) && current.location == LOCATION_EXTRA && (current.position & POS_FACEUP) if((data.type & TYPE_PENDULUM) && current.location == LOCATION_EXTRA && (current.position & POS_FACEUP)
&& (sumtype == SUMMON_TYPE_FUSION || sumtype == SUMMON_TYPE_SYNCHRO || sumtype == SUMMON_TYPE_XYZ)) && (sumtype == SUMMON_TYPE_FUSION || sumtype == SUMMON_TYPE_SYNCHRO || sumtype == SUMMON_TYPE_XYZ))
return FALSE; return FALSE;
if(((sumpos & POS_FACEDOWN) == 0) && pduel->game_field->check_unique_onfield(this, toplayer, LOCATION_MZONE)) if((sumpos & POS_FACEDOWN) && pduel->game_field->is_player_affected_by_effect(sumplayer, EFFECT_DEVINE_LIGHT))
sumpos = (sumpos & POS_FACEUP) | ((sumpos & POS_FACEDOWN) >> 1);
if(!(sumpos & POS_FACEDOWN) && pduel->game_field->check_unique_onfield(this, toplayer, LOCATION_MZONE))
return FALSE; return FALSE;
sumtype |= SUMMON_TYPE_SPECIAL; sumtype |= SUMMON_TYPE_SPECIAL;
if((sumplayer == 0 || sumplayer == 1) && !pduel->game_field->is_player_can_spsummon(reason_effect, sumtype, sumpos, sumplayer, toplayer, this)) if((sumplayer == 0 || sumplayer == 1) && !pduel->game_field->is_player_can_spsummon(reason_effect, sumtype, sumpos, sumplayer, toplayer, this))
......
...@@ -3104,7 +3104,7 @@ int32 field::special_summon_step(uint16 step, group* targets, card* target, uint ...@@ -3104,7 +3104,7 @@ int32 field::special_summon_step(uint16 step, group* targets, card* target, uint
} }
} }
if((target->current.location == LOCATION_MZONE) if((target->current.location == LOCATION_MZONE)
|| check_unique_onfield(target, playerid, LOCATION_MZONE) || !(positions & POS_FACEDOWN) && check_unique_onfield(target, playerid, LOCATION_MZONE)
|| !is_player_can_spsummon(core.reason_effect, target->summon_info & 0xff00ffff, positions, target->summon_player, playerid, target) || !is_player_can_spsummon(core.reason_effect, target->summon_info & 0xff00ffff, positions, target->summon_player, playerid, target)
|| (!nocheck && !(target->data.type & TYPE_MONSTER))) { || (!nocheck && !(target->data.type & TYPE_MONSTER))) {
core.units.begin()->step = 4; core.units.begin()->step = 4;
...@@ -4450,7 +4450,7 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret, ...@@ -4450,7 +4450,7 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
uint32 flag; uint32 flag;
uint32 lreason = (target->current.location == LOCATION_MZONE) ? LOCATION_REASON_CONTROL : LOCATION_REASON_TOFIELD; uint32 lreason = (target->current.location == LOCATION_MZONE) ? LOCATION_REASON_CONTROL : LOCATION_REASON_TOFIELD;
int32 ct = get_useable_count(target, playerid, location, move_player, lreason, zone, &flag); int32 ct = get_useable_count(target, playerid, location, move_player, lreason, zone, &flag);
if((ret == 1) && (ct <= 0 || target->is_status(STATUS_FORBIDDEN) || check_unique_onfield(target, playerid, location))) { if((ret == 1) && (ct <= 0 || target->is_status(STATUS_FORBIDDEN) || !(positions & POS_FACEDOWN) && check_unique_onfield(target, playerid, location))) {
core.units.begin()->step = 3; core.units.begin()->step = 3;
send_to(target, core.reason_effect, REASON_RULE, core.reason_player, PLAYER_NONE, LOCATION_GRAVE, 0, 0); send_to(target, core.reason_effect, REASON_RULE, core.reason_player, PLAYER_NONE, LOCATION_GRAVE, 0, 0);
return FALSE; return FALSE;
......
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