* Renegade Krasis - Fixed that check if Renegade Krasis was evolved did not always work correctly.

This commit is contained in:
LevelX2 2015-11-07 21:21:03 +01:00
parent 9602c57bdf
commit f3e8a93316
5 changed files with 81 additions and 69 deletions

View file

@ -27,12 +27,10 @@
*/
package mage.abilities.effects.common.counter;
import java.util.List;
import java.util.UUID;
import mage.MageObject;
import mage.constants.Outcome;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.counters.Counter;
import mage.filter.FilterPermanent;
import mage.game.Game;
@ -67,21 +65,16 @@ public class AddCountersAllEffect extends OneShotEffect {
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller != null && sourceObject != null) {
if (counter != null) {
UUID controllerId = source.getControllerId();
List<Permanent> permanents = game.getBattlefield().getAllActivePermanents();
for (Permanent permanent : permanents) {
if (filter.match(permanent, source.getSourceId(), controllerId, game)) {
permanent.addCounters(counter.copy(), game);
if (!game.isSimulation())
game.informPlayers(new StringBuilder(sourceObject.getName()).append(": ")
.append(controller.getLogName()).append(" puts ")
.append(counter.getCount()).append(" ").append(counter.getName().toLowerCase())
.append(" counter on ").append(permanent.getName()).toString());
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
permanent.addCounters(counter.copy(), game);
if (!game.isSimulation()) {
game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " puts " + counter.getCount() + " " + counter.getName().toLowerCase()
+ " counter on " + permanent.getLogName());
}
}
}
}
return true;
}
}
return false;
}

View file

@ -166,9 +166,8 @@ class EvolveEffect extends OneShotEffect {
if (triggeringCreature != null) {
Permanent sourceCreature = game.getPermanent(source.getSourceId());
if (sourceCreature != null && EvolveAbility.isPowerOrThoughnessGreater(sourceCreature, triggeringCreature)) {
game.getState().setValue("EvolveAddCounterActive", Boolean.TRUE);
sourceCreature.addCounters(CounterType.P1P1.createInstance(), game);
game.getState().setValue("EvolveAddCounterActive", Boolean.FALSE);
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.EVOLVED_CREATURE, sourceCreature.getId(), source.getSourceId(), source.getControllerId()));
}
return true;
}

View file

@ -214,6 +214,7 @@ public class GameEvent implements Serializable {
SACRIFICE_PERMANENT, SACRIFICED_PERMANENT,
FIGHTED_PERMANENT,
EXPLOITED_CREATURE,
EVOLVED_CREATURE,
ATTACH, ATTACHED,
UNATTACH, UNATTACHED,
ADD_COUNTER, COUNTER_ADDED,