Skip to content

Commit

Permalink
Spsummon procedure: pass the proc effect to player's EFFECT_CANNOT_SP…
Browse files Browse the repository at this point in the history
…ECIAL_SUMMON
  • Loading branch information
edo9300 committed Oct 14, 2023
1 parent 9c44670 commit dd9f84e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion card.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2851,7 +2851,7 @@ void card::filter_spsummon_procedure(uint8_t playerid, effect_set* peset, uint32
continue;
if(summon_type != 0 && summon_type != sumtype)
continue;
if(!pduel->game_field->is_player_can_spsummon(sumeffect, sumtype, topos, playerid, toplayer, this))
if(!pduel->game_field->is_player_can_spsummon(sumeffect, sumtype, topos, playerid, toplayer, this, peffect))
continue;
peset->push_back(peffect);
}
Expand Down
5 changes: 3 additions & 2 deletions field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2726,7 +2726,7 @@ int32_t field::is_player_can_spsummon(uint8_t playerid) {
}
return is_player_can_spsummon_count(playerid, 1);
}
int32_t field::is_player_can_spsummon(effect* peffect, uint32_t sumtype, uint8_t sumpos, uint8_t playerid, uint8_t toplayer, card* pcard) {
int32_t field::is_player_can_spsummon(effect* peffect, uint32_t sumtype, uint8_t sumpos, uint8_t playerid, uint8_t toplayer, card* pcard, effect* proc_effect) {
if(pcard->is_affected_by_effect(EFFECT_CANNOT_SPECIAL_SUMMON))
return FALSE;
if(pcard->is_status(STATUS_FORBIDDEN))
Expand Down Expand Up @@ -2758,7 +2758,8 @@ int32_t field::is_player_can_spsummon(effect* peffect, uint32_t sumtype, uint8_t
pduel->lua->add_param<PARAM_TYPE_INT>(sumpos);
pduel->lua->add_param<PARAM_TYPE_INT>(toplayer);
pduel->lua->add_param<PARAM_TYPE_EFFECT>(peffect);
if(pduel->lua->check_condition(eff->target, 7))
pduel->lua->add_param<PARAM_TYPE_EFFECT>(proc_effect);
if(pduel->lua->check_condition(eff->target, 8))
return FALSE;
}
eset.clear();
Expand Down
2 changes: 1 addition & 1 deletion field.h
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ class field {
int32_t is_player_can_mset(uint32_t sumtype, uint8_t playerid, card* pcard, uint8_t toplayer);
int32_t is_player_can_sset(uint8_t playerid, card* pcard);
int32_t is_player_can_spsummon(uint8_t playerid);
int32_t is_player_can_spsummon(effect* peffect, uint32_t sumtype, uint8_t sumpos, uint8_t playerid, uint8_t toplayer, card* pcard);
int32_t is_player_can_spsummon(effect* peffect, uint32_t sumtype, uint8_t sumpos, uint8_t playerid, uint8_t toplayer, card* pcard, effect* proc_effect = nullptr);
int32_t is_player_can_flipsummon(uint8_t playerid, card* pcard);
int32_t is_player_can_spsummon_monster(uint8_t playerid, uint8_t toplayer, uint8_t sumpos, uint32_t sumtype, card_data* pdata);
int32_t is_player_can_spsummon_count(uint8_t playerid, uint32_t count);
Expand Down

0 comments on commit dd9f84e

Please sign in to comment.