mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
[40K] Implemented Sautekh Immortal
This commit is contained in:
parent
1cc00630dd
commit
91b36d4106
3 changed files with 62 additions and 10 deletions
50
Mage.Sets/src/mage/cards/s/SautekhImmortal.java
Normal file
50
Mage.Sets/src/mage/cards/s/SautekhImmortal.java
Normal file
|
@ -0,0 +1,50 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.dynamicvalue.common.CreaturesDiedThisTurnCount;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.hint.common.CreaturesDiedThisTurnHint;
|
||||
import mage.abilities.keyword.FlashAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.watchers.common.CreaturesDiedWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SautekhImmortal extends CardImpl {
|
||||
|
||||
public SautekhImmortal(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}{B}");
|
||||
|
||||
this.subtype.add(SubType.NECRON);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Flash
|
||||
this.addAbility(FlashAbility.getInstance());
|
||||
|
||||
// Elite Troops -- Sautekh Immortal enters the battlefield with a +1/+1 counter on it for each creature that died this turn.
|
||||
this.addAbility(new EntersBattlefieldAbility(
|
||||
new AddCountersSourceEffect(
|
||||
CounterType.P1P1.createInstance(0),
|
||||
CreaturesDiedThisTurnCount.instance, true
|
||||
).setText("with a +1/+1 counter on it for each creature that died this turn.")
|
||||
).withFlavorWord("Elite Troops").addHint(CreaturesDiedThisTurnHint.instance), new CreaturesDiedWatcher());
|
||||
}
|
||||
|
||||
private SautekhImmortal(final SautekhImmortal card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SautekhImmortal copy() {
|
||||
return new SautekhImmortal(this);
|
||||
}
|
||||
}
|
|
@ -122,6 +122,7 @@ public final class Warhammer40000 extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Reverberate", 207, Rarity.RARE, mage.cards.r.Reverberate.class));
|
||||
cards.add(new SetCardInfo("Royal Warden", 52, Rarity.RARE, mage.cards.r.RoyalWarden.class));
|
||||
cards.add(new SetCardInfo("Rugged Highlands", 292, Rarity.COMMON, mage.cards.r.RuggedHighlands.class));
|
||||
cards.add(new SetCardInfo("Sautekh Immortal", 54, Rarity.UNCOMMON, mage.cards.s.SautekhImmortal.class));
|
||||
cards.add(new SetCardInfo("Screamer-Killer", 84, Rarity.RARE, mage.cards.s.ScreamerKiller.class));
|
||||
cards.add(new SetCardInfo("Skorpekh Destroyer", 57, Rarity.UNCOMMON, mage.cards.s.SkorpekhDestroyer.class));
|
||||
cards.add(new SetCardInfo("Skorpekh Lord", 58, Rarity.RARE, mage.cards.s.SkorpekhLord.class));
|
||||
|
|
|
@ -4,6 +4,7 @@ import mage.constants.WatcherScope;
|
|||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.util.CardUtil;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -24,17 +25,17 @@ public class CreaturesDiedWatcher extends Watcher {
|
|||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
|
||||
if (event.getType() != GameEvent.EventType.ZONE_CHANGE) {
|
||||
return;
|
||||
}
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (zEvent.isDiesEvent()
|
||||
&& zEvent.getTarget() != null
|
||||
&& zEvent.getTarget().isCreature(game)) {
|
||||
int amount = getAmountOfCreaturesDiedThisTurnByController(zEvent.getTarget().getControllerId());
|
||||
amountOfCreaturesThatDiedByController.put(zEvent.getTarget().getControllerId(), amount + 1);
|
||||
amount = getAmountOfCreaturesDiedThisTurnByOwner(zEvent.getTarget().getOwnerId());
|
||||
amountOfCreaturesThatDiedByOwner.put(zEvent.getTarget().getOwnerId(), amount + 1);
|
||||
}
|
||||
if (!zEvent.isDiesEvent()
|
||||
|| zEvent.getTarget() == null
|
||||
|| !zEvent.getTarget().isCreature(game)) {
|
||||
return;
|
||||
}
|
||||
amountOfCreaturesThatDiedByController.compute(zEvent.getTarget().getControllerId(), CardUtil::setOrIncrementValue);
|
||||
amountOfCreaturesThatDiedByOwner.compute(zEvent.getTarget().getOwnerId(), CardUtil::setOrIncrementValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue