mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
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:
parent
c066ad41e8
commit
e1fd213e0f
5 changed files with 193 additions and 1 deletions
12
Mage/src/main/java/mage/game/events/CreatedTokenEvent.java
Normal file
12
Mage/src/main/java/mage/game/events/CreatedTokenEvent.java
Normal 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());
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue