Blast-Furnace Hellkite - fixed game error on offering an artifact lands and treasures (#9940, #10218)

This commit is contained in:
Oleg Agafonov 2023-06-11 11:05:06 +04:00
parent d3b976cc46
commit ce3cf742c9
2 changed files with 50 additions and 40 deletions

View file

@ -50,9 +50,6 @@ public class OfferingAbility extends StaticAbility implements AlternateManaPayme
private final FilterControlledPermanent filter;
/**
* @param subtype name of the subtype that can be offered
*/
public OfferingAbility(FilterControlledPermanent filter) {
super(Zone.ALL, null);
this.filter = filter;
@ -226,7 +223,10 @@ class OfferingCostReductionEffect extends CostModificationEffectImpl {
Permanent toOffer = game.getPermanent(getTargetPointer().getFirst(game, source));
if (toOffer != null) {
toOffer.sacrifice(source, game);
CardUtil.reduceCost((SpellAbility) abilityToModify, toOffer.getSpellAbility().getManaCosts());
if (toOffer.getSpellAbility() != null) {
// artifact land don't have spell ability
CardUtil.reduceCost((SpellAbility) abilityToModify, toOffer.getSpellAbility().getManaCosts());
}
}
game.getState().setValue("offering_" + source.getSourceId(), null);
game.getState().setValue("offering_ok_" + source.getSourceId(), null);