mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 20:32:06 -08:00
optimized some other watchers
This commit is contained in:
parent
3e26d94208
commit
01338b706e
9 changed files with 23 additions and 4 deletions
|
|
@ -95,6 +95,8 @@ class AngelicArbiterWatcher1 extends WatcherImpl<AngelicArbiterWatcher1> {
|
|||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (condition == true) //no need to check - condition has already occured
|
||||
return;
|
||||
if (event.getType() == EventType.SPELL_CAST && game.getActivePlayerId().equals(event.getPlayerId()) && game.getOpponents(controllerId).contains(event.getPlayerId()))
|
||||
condition = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,6 +138,8 @@ class RedSunsZenithWatcher extends WatcherImpl<RedSunsZenithWatcher> {
|
|||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (condition == true) //no need to check - condition has already occured
|
||||
return;
|
||||
if (event.getType() == EventType.DAMAGED_CREATURE) {
|
||||
Card card = game.getCard(sourceId);
|
||||
if (card != null && card.getSpellAbility().getId().equals(event.getSourceId()))
|
||||
|
|
|
|||
|
|
@ -127,6 +127,8 @@ class VengevineWatcher extends WatcherImpl<VengevineWatcher> {
|
|||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (condition == true) //no need to check - condition has already occured
|
||||
return;
|
||||
if (event.getType() == EventType.SPELL_CAST && event.getPlayerId().equals(controllerId)) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
if (spell != null && spell.getCardType().contains(CardType.CREATURE)) {
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class FleshAllergyEffect extends OneShotEffect<FleshAllergyEffect> {
|
|||
|
||||
public FleshAllergyEffect() {
|
||||
super(Outcome.DestroyPermanent);
|
||||
staticText = "Target creature gets +2/+2 until end of turn.\nLandfall - If you had a land enter the battlefield under your control this turn, that creature gets +4/+4 until end of turn instead";
|
||||
staticText = "Destroy target creature. Its controller loses life equal to the number of creatures that died this turn";
|
||||
}
|
||||
|
||||
public FleshAllergyEffect(final FleshAllergyEffect effect) {
|
||||
|
|
|
|||
|
|
@ -92,6 +92,8 @@ class TunnelIgnusWatcher extends WatcherImpl {
|
|||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (condition == true) //no need to check - condition has already occured
|
||||
return;
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).getToZone() == Constants.Zone.BATTLEFIELD) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent.getCardType().contains(CardType.LAND) && game.getOpponents(this.controllerId).contains(permanent.getControllerId())) {
|
||||
|
|
@ -101,9 +103,12 @@ class TunnelIgnusWatcher extends WatcherImpl {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (event.getType() == GameEvent.EventType.END_TURN_STEP_POST) {
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
super.reset();
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -93,6 +93,8 @@ class GroundswellWatcher extends WatcherImpl<GroundswellWatcher> {
|
|||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (condition == true) //no need to check - condition has already occured
|
||||
return;
|
||||
if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).getToZone() == Zone.BATTLEFIELD) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.controllerId)) {
|
||||
|
|
|
|||
|
|
@ -92,6 +92,8 @@ class SearingBlazeWatcher extends WatcherImpl<SearingBlazeWatcher> {
|
|||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (condition == true) //no need to check - condition has already occured
|
||||
return;
|
||||
if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).getToZone() == Zone.BATTLEFIELD) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.controllerId)) {
|
||||
|
|
|
|||
|
|
@ -87,6 +87,8 @@ class ArchiveTrapWatcher extends WatcherImpl<ArchiveTrapWatcher> {
|
|||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (condition == true) //no need to check - condition has already occured
|
||||
return;
|
||||
if (event.getType() == EventType.LIBRARY_SEARCHED && game.getOpponents(controllerId).contains(event.getPlayerId()))
|
||||
condition = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ public class BloodthirstWatcher extends WatcherImpl<BloodthirstWatcher> {
|
|||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (condition == true) //no need to check - condition has already occured
|
||||
return;
|
||||
if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
|
||||
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
|
||||
if (game.getOpponents(this.controllerId).contains(damageEvent.getPlayerId())) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue