mirror of
https://github.com/correl/mage.git
synced 2024-12-26 19:16:54 +00:00
Fixed NPE in kicker ability (Fixed Issue 232)
This commit is contained in:
parent
01338b706e
commit
cc661a3100
1 changed files with 5 additions and 2 deletions
|
@ -29,6 +29,7 @@
|
||||||
package mage.abilities.keyword;
|
package mage.abilities.keyword;
|
||||||
|
|
||||||
import mage.Constants.Zone;
|
import mage.Constants.Zone;
|
||||||
|
import mage.abilities.Mode;
|
||||||
import mage.abilities.StaticAbility;
|
import mage.abilities.StaticAbility;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
|
@ -63,10 +64,12 @@ public class KickerAbility extends StaticAbility<KickerAbility> {
|
||||||
@Override
|
@Override
|
||||||
public boolean activate(Game game, boolean noMana) {
|
public boolean activate(Game game, boolean noMana) {
|
||||||
Player player = game.getPlayer(this.getControllerId());
|
Player player = game.getPlayer(this.getControllerId());
|
||||||
String message = "Use kicker - " + getEffects().get(0).getText(null) + "?";
|
|
||||||
|
String message = "Use kicker - " + getRule() + "?";
|
||||||
Card card = game.getCard(sourceId);
|
Card card = game.getCard(sourceId);
|
||||||
// replace by card name or just plain "this"
|
// replace by card name or just plain "this"
|
||||||
message = message.replace("{this}", card == null ? "this" : card.getName());
|
String text = card == null ? "this" : card.getName();
|
||||||
|
message = message.replace("{this}", text).replace("{source}", text);
|
||||||
if (player.chooseUse(getEffects().get(0).getOutcome(), message, game)) {
|
if (player.chooseUse(getEffects().get(0).getOutcome(), message, game)) {
|
||||||
int bookmark = game.bookmarkState();
|
int bookmark = game.bookmarkState();
|
||||||
if (super.activate(game, noMana)) {
|
if (super.activate(game, noMana)) {
|
||||||
|
|
Loading…
Reference in a new issue