foul-magics/Mage/src/main/java/mage/abilities/effects/common/CrewsVehicleSourceTriggeredAbility.java
Alexander Novotny fae63d9d4b
Add additional ability icons (#10549)
* Slightly revamped basic card icons

All icon classes which were just static text have been removed, and instead replaced with a static instance.

A new icon for reach has been added

Some icons have been reused for new abilities (hexproof for shroud and ward, infect for toxic)

When a card would have two icons of the same type, the icons are instead combines into one with a combined hover tooltip.

* Fixed missing capitalization on ward, hexproof
2023-07-04 01:22:07 +04:00

44 lines
1.4 KiB
Java

package mage.abilities.effects.common;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.icon.CardIconImpl;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.targetpointer.FixedTarget;
public class CrewsVehicleSourceTriggeredAbility extends TriggeredAbilityImpl {
public CrewsVehicleSourceTriggeredAbility(Effect effect) {
super(Zone.BATTLEFIELD, effect, false);
this.addIcon(CardIconImpl.ABILITY_CREW);
setTriggerPhrase("Whenever {this} crews a Vehicle, ");
}
public CrewsVehicleSourceTriggeredAbility(final CrewsVehicleSourceTriggeredAbility ability) {
super(ability);
}
@Override
public CrewsVehicleSourceTriggeredAbility copy() {
return new CrewsVehicleSourceTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.CREWED_VEHICLE;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getTargetId().equals(getSourceId())) {
for (Effect effect : getEffects()) {
// set the vehicle id as target
effect.setTargetPointer(new FixedTarget(event.getSourceId(), game));
}
return true;
}
return false;
}
}