mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +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;
|
||||
//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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue