Rename, move and comment resolving ability event creation.

Should be clearer now.
This commit is contained in:
emerald000 2020-05-03 18:56:35 -04:00
parent 111114e338
commit 3465493ccf
4 changed files with 5 additions and 3 deletions

View file

@ -152,6 +152,9 @@ public abstract class AbilityImpl implements Ability {
boolean result = true;
//20100716 - 117.12
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) {
for (UUID modeId : this.getModes().getSelectedModes()) {
this.getModes().setActiveMode(modeId);

View file

@ -150,7 +150,7 @@ public class GameEvent implements Serializable {
SPELL_CAST,
ACTIVATE_ABILITY, ACTIVATED_ABILITY,
TRIGGERED_ABILITY,
RESOLVED_ABILITY,
RESOLVING_ABILITY,
COPY_STACKOBJECT, COPIED_STACKOBJECT,
/* ADD_MANA
targetId id of the ability that added the mana

View file

@ -82,7 +82,6 @@ public class StackAbility extends StackObjImpl implements Ability {
@Override
public boolean resolve(Game game) {
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);
game.getStack().remove(this, game);
return result;

View file

@ -22,7 +22,7 @@ public class AbilityResolvedWatcher extends Watcher {
@Override
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);
}
}