Implemented Akim, the Soaring Wind, and new CreatedTokenEvent (#6431)

* Implemented Akim, the Soaring Wind, and new CreatedTokenEvent, that can be used to for TriggeredEvents.

* Formatting, and added Condition to Akim triggered Ability.

* Added Condition and ConditionHint to Akim.
This commit is contained in:
AsterAether 2020-04-22 04:20:11 +02:00 committed by GitHub
parent c066ad41e8
commit e1fd213e0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 193 additions and 1 deletions

View file

@ -0,0 +1,12 @@
package mage.game.events;
import mage.game.permanent.PermanentToken;
import java.util.UUID;
public class CreatedTokenEvent extends GameEvent {
public CreatedTokenEvent(UUID sourceId, PermanentToken tokenPerm) {
super(EventType.CREATED_TOKEN, tokenPerm.getId(), sourceId, tokenPerm.getControllerId());
}
}

View file

@ -316,7 +316,7 @@ public class GameEvent implements Serializable {
*/
LOST_CONTROL,
GAIN_CONTROL, GAINED_CONTROL,
CREATE_TOKEN,
CREATE_TOKEN, CREATED_TOKEN,
/* REGENERATE
targetId id of the creature to regenerate
sourceId sourceId of the effect doing the regeneration

View file

@ -8,6 +8,7 @@ import mage.cards.Card;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.CreateTokenEvent;
import mage.game.events.CreatedTokenEvent;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
@ -208,6 +209,9 @@ public abstract class TokenImpl extends MageObjectImpl implements Token {
((TokenImpl) token).lastAddedTokenId = permanent.getId();
}
game.addSimultaneousEvent(new ZoneChangeEvent(permanent, permanent.getControllerId(), Zone.OUTSIDE, Zone.BATTLEFIELD));
if (permanent instanceof PermanentToken) {
game.addSimultaneousEvent(new CreatedTokenEvent(event.getSourceId(), (PermanentToken) permanent));
}
if (attacking && game.getCombat() != null && game.getActivePlayerId().equals(permanent.getControllerId())) {
game.getCombat().addAttackingCreature(permanent.getId(), game, attackedPlayer);
}