mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 20:59:14 -08:00
Added zoneChangeCounter into LKI. Reimplemented Trostani. PersistTest and LastKnownInformationTest do work now.
This commit is contained in:
parent
cae473b6ca
commit
43e82b7a1a
4 changed files with 44 additions and 8 deletions
|
|
@ -28,11 +28,6 @@
|
|||
|
||||
package mage.sets.returntoravnica;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
|
|
@ -43,12 +38,17 @@ import mage.abilities.effects.Effect;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.PopulateEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
|
@ -103,6 +103,7 @@ class TrostaniSelesnyasVoiceTriggeredAbility extends TriggeredAbilityImpl {
|
|||
&& event.getTargetId() != this.getSourceId()) {
|
||||
Effect effect = this.getEffects().get(0);
|
||||
effect.setValue("lifeSource", event.getTargetId());
|
||||
effect.setValue("zoneChangeCounter", permanent.getZoneChangeCounter());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -139,9 +140,10 @@ class TrostaniSelesnyasVoiceEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
UUID creatureId = (UUID) getValue("lifeSource");
|
||||
Integer zoneChangeCounter = (Integer) getValue("zoneChangeCounter");
|
||||
Permanent creature = game.getPermanent(creatureId);
|
||||
if (creature == null) {
|
||||
creature = (Permanent) game.getLastKnownInformation(creatureId, Zone.BATTLEFIELD);
|
||||
if (creature == null || creature.getZoneChangeCounter() != zoneChangeCounter) {
|
||||
creature = (Permanent) game.getLastKnownInformation(creatureId, Zone.BATTLEFIELD, zoneChangeCounter);
|
||||
}
|
||||
if (creature != null) {
|
||||
int amount = creature.getToughness().getValue();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue