[KLD] Added Speedway Fanatic. Added tests for crew keyword.

This commit is contained in:
LevelX2 2016-09-14 15:16:40 +02:00
parent 975e530d55
commit 3612332607
4 changed files with 212 additions and 2 deletions

View file

@ -41,6 +41,7 @@ import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.TappedPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.Target;
import mage.target.common.TargetControlledCreaturePermanent;
@ -77,6 +78,7 @@ public class CrewAbility extends SimpleActivatedAbility {
class CrewCost extends CostImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creature you control");
static {
filter.add(Predicates.not(new TappedPredicate()));
}
@ -104,6 +106,11 @@ class CrewCost extends CostImpl {
}
}
paid = sumPower >= value;
if (paid) {
for (UUID targetId : target.getTargets()) {
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.CREWED_VEHICLE, targetId, sourceId, controllerId));
}
}
}
return paid;
}
@ -124,4 +131,4 @@ class CrewCost extends CostImpl {
public CrewCost copy() {
return new CrewCost(this);
}
}
}

View file

@ -97,7 +97,7 @@ public class GameEvent implements Serializable {
CLASH, CLASHED,
DAMAGE_PLAYER,
/* DAMAGED_PLAYER
targetId the id of the damged player
targetId the id of the damaged player
sourceId sourceId of the ability which caused the damage
playerId the id of the damged player
amount amount of damage
@ -109,6 +109,12 @@ public class GameEvent implements Serializable {
GAIN_LIFE, GAINED_LIFE,
LOSE_LIFE, LOST_LIFE,
PLAY_LAND, LAND_PLAYED,
CREWED_VEHICLE,
/* CREWED_VEHICLE
targetId the id of the creature that crewed a vehicle
sourceId sourceId of the vehicle
playerId the id of the controlling player
*/
CAST_SPELL,
/* SPELL_CAST
x-Costs are already defined