mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 12:52:06 -08:00
* Renegade Krasis - Fixed that check if Renegade Krasis was evolved did not always work correctly.
This commit is contained in:
parent
9602c57bdf
commit
f3e8a93316
5 changed files with 81 additions and 69 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue