implemented Neyith of the Dire Hunt

This commit is contained in:
Evan Kranzler 2020-06-30 21:29:59 -04:00
parent 00c5162682
commit 73026b57b1
6 changed files with 182 additions and 6 deletions

View file

@ -308,6 +308,7 @@ public class GameEvent implements Serializable {
DESTROYED_PERMANENT,
SACRIFICE_PERMANENT, SACRIFICED_PERMANENT,
FIGHTED_PERMANENT,
BATCH_FIGHT,
EXPLOITED_CREATURE,
EVOLVED_CREATURE,
EMBALMED_CREATURE,

View file

@ -152,6 +152,8 @@ public interface Permanent extends Card, Controllable {
boolean fight(Permanent fightTarget, Ability source, Game game);
boolean fight(Permanent fightTarget, Ability source, Game game,boolean batchTrigger);
boolean entersBattlefield(UUID sourceId, Game game, Zone fromZone, boolean fireEvent);
String getValue(GameState state);

View file

@ -1559,10 +1559,24 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
@Override
public boolean fight(Permanent fightTarget, Ability source, Game game) {
return this.fight(fightTarget, source, game, true);
}
@Override
public boolean fight(Permanent fightTarget, Ability source, Game game, boolean batchTrigger) {
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.FIGHTED_PERMANENT, fightTarget.getId(), getId(), source.getControllerId()));
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.FIGHTED_PERMANENT, getId(), fightTarget.getId(), source.getControllerId()));
damage(fightTarget.getPower().getValue(), fightTarget.getId(), game, false, true);
damage(fightTarget.getPower().getValue(), fightTarget.getId(), game);
fightTarget.damage(getPower().getValue(), getId(), game);
if (!batchTrigger) {
return true;
}
Set<MageObjectReference> morSet = new HashSet<>();
morSet.add(new MageObjectReference(this, game));
morSet.add(new MageObjectReference(fightTarget, game));
String data = UUID.randomUUID().toString();
game.getState().setValue("batchFight_" + data, morSet);
game.fireEvent(GameEvent.getEvent(EventType.BATCH_FIGHT, getId(), getId(), source.getControllerId(), data, 0));
return true;
}