If a mandatory card has an effect that allows it to optionally change its level, this effect does not get used in OnSelectSum.
Example Card: Yamatako Orochi
LuckyBot tried to Synchro summon a Level 9 Monster with Yamatoko Orochi and two Level 1 non-tuners on the Field and could not do it, because the code (in general, not only for LuckyBot) never considers Yamatoko Orochi to be Level 8:
for (int k = 0; k < mandatoryCards.Count; ++k)
{
sumval -= mandatoryCards[k].OpParam1;
}
IList<ClientCard> selected = _ai.OnSelectSum(cards, sumval, min, max, _select_hint, mode);
(Yamatoko Orochi has OpParam1 = 1 and OpParam2 = 8)
I cannot quickly think of a good way to check for all combinations of mandatory cards and OpParams.
Something like this but there is probably a non-recursive way:
I noticed that
OnSelectSum
has a bug:If a mandatory card has an effect that allows it to optionally change its level, this effect does not get used in
OnSelectSum
. Example Card: Yamatako OrochiLuckyBot tried to Synchro summon a Level 9 Monster with Yamatoko Orochi and two Level 1 non-tuners on the Field and could not do it, because the code (in general, not only for LuckyBot) never considers Yamatoko Orochi to be Level 8:
(Yamatoko Orochi has
OpParam1 = 1
andOpParam2 = 8
)I cannot quickly think of a good way to check for all combinations of mandatory cards and
OpParam
s. Something like this but there is probably a non-recursive way:I opened a PR with this code to better understand what that code is supposed to do: #207