forked from External/mage
fix Molten Disaster (#12307)
* add test case * unify KickedCondition for battlefield and stack usage * cleanup Molten Disaster to common classes
This commit is contained in:
parent
69e9f3de8a
commit
bdebf7020c
8 changed files with 164 additions and 141 deletions
|
|
@ -105,9 +105,7 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo
|
|||
|
||||
private void addKickerCostAndSetup(OptionalAdditionalCost newCost) {
|
||||
this.kickerCosts.add(newCost);
|
||||
this.kickerCosts.forEach(cost -> {
|
||||
cost.setCostType(VariableCostType.ADDITIONAL);
|
||||
});
|
||||
this.kickerCosts.forEach(cost -> cost.setCostType(VariableCostType.ADDITIONAL));
|
||||
}
|
||||
|
||||
private void resetKicker() {
|
||||
|
|
@ -124,10 +122,7 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo
|
|||
* Return total kicker activations with the specified Cost (blank for all kickers/multikickers)
|
||||
* Checks the start of the tags, to work for that blank method, which requires direct access
|
||||
*
|
||||
* @param game
|
||||
* @param source
|
||||
* @param needKickerCost use cost.getText(true)
|
||||
* @return
|
||||
*/
|
||||
public static int getKickedCounterStrict(Game game, Ability source, String needKickerCost) {
|
||||
Map<String, Object> costsTags = CardUtil.getSourceCostsTagsMap(game, source);
|
||||
|
|
@ -148,10 +143,6 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo
|
|||
|
||||
/**
|
||||
* Return total kicker activations (kicker + multikicker)
|
||||
*
|
||||
* @param game
|
||||
* @param source
|
||||
* @return
|
||||
*/
|
||||
public static int getKickedCounter(Game game, Ability source) {
|
||||
return getKickedCounterStrict(game, source, "");
|
||||
|
|
@ -159,10 +150,6 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo
|
|||
|
||||
/**
|
||||
* If spell was kicked
|
||||
*
|
||||
* @param game
|
||||
* @param source
|
||||
* @return
|
||||
*/
|
||||
public boolean isKicked(Game game, Ability source) {
|
||||
return isKicked(game, source, "");
|
||||
|
|
@ -171,10 +158,7 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo
|
|||
/**
|
||||
* If spell was kicked by specific kicker cost
|
||||
*
|
||||
* @param game
|
||||
* @param source
|
||||
* @param needKickerCost use cost.getText(true)
|
||||
* @return
|
||||
*/
|
||||
public boolean isKicked(Game game, Ability source, String needKickerCost) {
|
||||
return getKickedCounterStrict(game, source, needKickerCost) > 0;
|
||||
|
|
@ -287,10 +271,6 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo
|
|||
|
||||
/**
|
||||
* Find spell's kicked stats. Must be used on stack only, e.g. for SPELL_CAST events
|
||||
*
|
||||
* @param game
|
||||
* @param spellId
|
||||
* @return
|
||||
*/
|
||||
public static int getSpellKickedCount(Game game, UUID spellId) {
|
||||
Spell spell = game.getSpellOrLKIStack(spellId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue