forked from External/mage
Fixing issues with Changelings and general problems with creature types (ready to merge) (#7098)
* updated Changelings to use setIsAllCreatureTypes * updated Dr Julius Jumblemorph and Mistform Ultimus to not use changeling * added test for Mistform Ultimus * updated effects which give all creature types to controlled creatures * updated effects which give all creature types to targeted creatures * Update LoseAllCreatureTypesTargetEffect.java * updated effects which give all creature types to attached creatures * Update EgoErasure.java * added another test for changelings * updated two tokens I left out before * updated hasSubtype * updated shareCreatureTypes * fixed an incorrect test * cleaned up some cards which check for shared creature types * added new changeling test * fixed issue with shareCreatureTypes * fixed a text issue * added new tests for subtype effects * various individual card fixes and cleanups * fixed and updated various effects * many more fixes * a few more fixes * added test for One with the Stars * added changeling verify test * updated effects which add additional subtypes * more miscellaneous fixes * added additional test * some fixes for card type checks * updated methods for adding types to make it easier to avoid duplicates and illegal additions * small test update * fixed a recursive loop issue * fixed another error * fixed it for real this time * streamlined type removal process * streamlined subtype set generation
This commit is contained in:
parent
42e00b7a37
commit
8617bc128e
182 changed files with 2431 additions and 2820 deletions
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.watchers.common;
|
||||
|
||||
import mage.abilities.keyword.ChangelingAbility;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.game.Game;
|
||||
|
|
@ -30,22 +28,24 @@ public class ProwlWatcher extends Watcher {
|
|||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == EventType.DAMAGED_PLAYER) {
|
||||
DamagedPlayerEvent dEvent = (DamagedPlayerEvent) event;
|
||||
if (dEvent.isCombatDamage()) {
|
||||
Permanent creature = game.getPermanent(dEvent.getSourceId());
|
||||
if (creature != null && !allSubtypes.contains(creature.getControllerId())) {
|
||||
if (creature.getAbilities().containsKey(ChangelingAbility.getInstance().getId()) || creature.isAllCreatureTypes()) {
|
||||
allSubtypes.add(creature.getControllerId());
|
||||
} else {
|
||||
Set<SubType> subtypes = damagingSubtypes.getOrDefault(creature.getControllerId(), new LinkedHashSet<>());
|
||||
|
||||
subtypes.addAll(creature.getSubtype(game));
|
||||
damagingSubtypes.put(creature.getControllerId(), subtypes);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (event.getType() != EventType.DAMAGED_PLAYER) {
|
||||
return;
|
||||
}
|
||||
DamagedPlayerEvent dEvent = (DamagedPlayerEvent) event;
|
||||
if (!dEvent.isCombatDamage()) {
|
||||
return;
|
||||
}
|
||||
Permanent creature = game.getPermanent(dEvent.getSourceId());
|
||||
if (creature == null || allSubtypes.contains(creature.getControllerId())) {
|
||||
return;
|
||||
}
|
||||
if (creature.isAllCreatureTypes()) {
|
||||
allSubtypes.add(creature.getControllerId());
|
||||
return;
|
||||
}
|
||||
damagingSubtypes
|
||||
.computeIfAbsent(creature.getControllerId(), m -> new LinkedHashSet<>())
|
||||
.addAll(creature.getSubtype(game));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue