mirror of
https://github.com/correl/mage.git
synced 2025-01-13 19:11:33 +00:00
Rename, move and comment resolving ability event creation.
Should be clearer now.
This commit is contained in:
parent
111114e338
commit
3465493ccf
4 changed files with 5 additions and 3 deletions
|
@ -152,6 +152,9 @@ public abstract class AbilityImpl implements Ability {
|
||||||
boolean result = true;
|
boolean result = true;
|
||||||
//20100716 - 117.12
|
//20100716 - 117.12
|
||||||
if (checkIfClause(game)) {
|
if (checkIfClause(game)) {
|
||||||
|
// Ability has started resolving. Fire event.
|
||||||
|
// Used for abilities counting the number of resolutions like Ashling the Pilgrim.
|
||||||
|
game.fireEvent(new GameEvent(GameEvent.EventType.RESOLVING_ABILITY, this.getOriginalId(), this.getSourceId(), this.getControllerId()));
|
||||||
if (this instanceof TriggeredAbility) {
|
if (this instanceof TriggeredAbility) {
|
||||||
for (UUID modeId : this.getModes().getSelectedModes()) {
|
for (UUID modeId : this.getModes().getSelectedModes()) {
|
||||||
this.getModes().setActiveMode(modeId);
|
this.getModes().setActiveMode(modeId);
|
||||||
|
|
|
@ -150,7 +150,7 @@ public class GameEvent implements Serializable {
|
||||||
SPELL_CAST,
|
SPELL_CAST,
|
||||||
ACTIVATE_ABILITY, ACTIVATED_ABILITY,
|
ACTIVATE_ABILITY, ACTIVATED_ABILITY,
|
||||||
TRIGGERED_ABILITY,
|
TRIGGERED_ABILITY,
|
||||||
RESOLVED_ABILITY,
|
RESOLVING_ABILITY,
|
||||||
COPY_STACKOBJECT, COPIED_STACKOBJECT,
|
COPY_STACKOBJECT, COPIED_STACKOBJECT,
|
||||||
/* ADD_MANA
|
/* ADD_MANA
|
||||||
targetId id of the ability that added the mana
|
targetId id of the ability that added the mana
|
||||||
|
|
|
@ -82,7 +82,6 @@ public class StackAbility extends StackObjImpl implements Ability {
|
||||||
@Override
|
@Override
|
||||||
public boolean resolve(Game game) {
|
public boolean resolve(Game game) {
|
||||||
if (ability.getTargets().stillLegal(ability, game) || !canFizzle()) {
|
if (ability.getTargets().stillLegal(ability, game) || !canFizzle()) {
|
||||||
game.fireEvent(new GameEvent(GameEvent.EventType.RESOLVED_ABILITY, ability.getOriginalId(), ability.getSourceId(), ability.getControllerId()));
|
|
||||||
boolean result = ability.resolve(game);
|
boolean result = ability.resolve(game);
|
||||||
game.getStack().remove(this, game);
|
game.getStack().remove(this, game);
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class AbilityResolvedWatcher extends Watcher {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.RESOLVED_ABILITY) {
|
if (event.getType() == GameEvent.EventType.RESOLVING_ABILITY) {
|
||||||
resolutionMap.merge(event.getTargetId().toString() + game.getState().getZoneChangeCounter(event.getSourceId()), 1, Integer::sum);
|
resolutionMap.merge(event.getTargetId().toString() + game.getState().getZoneChangeCounter(event.getSourceId()), 1, Integer::sum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue