mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
Revert "[WOE] Implement Embereth Veteran"
This reverts commit bd1b657e24.
This commit is contained in:
parent
bd1b657e24
commit
e8e243db8c
6 changed files with 0 additions and 211 deletions
|
|
@ -1,64 +0,0 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.RoleType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class CreateRoleAttachedTargetEffect extends OneShotEffect {
|
||||
|
||||
private final RoleType roleType;
|
||||
|
||||
public CreateRoleAttachedTargetEffect(RoleType roleType) {
|
||||
super(Outcome.Benefit);
|
||||
this.roleType = roleType;
|
||||
}
|
||||
|
||||
private CreateRoleAttachedTargetEffect(final CreateRoleAttachedTargetEffect effect) {
|
||||
super(effect);
|
||||
this.roleType = effect.roleType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CreateRoleAttachedTargetEffect copy() {
|
||||
return new CreateRoleAttachedTargetEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
Token token = roleType.createToken();
|
||||
token.putOntoBattlefield(1, game, source);
|
||||
for (UUID tokenId : token.getLastAddedTokenIds()) {
|
||||
Permanent aura = game.getPermanent(tokenId);
|
||||
if (aura == null || !aura.hasSubtype(SubType.AURA, game)) {
|
||||
continue;
|
||||
}
|
||||
aura.getAbilities().get(0).getTargets().get(0).add(source.getFirstTarget(), game);
|
||||
aura.getAbilities().get(0).getEffects().get(0).apply(game, aura.getAbilities().get(0));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
return "create a " + roleType.getName() + " Role token attached to " +
|
||||
getTargetPointer().describeTargets(mode.getTargets(), "it");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
package mage.constants;
|
||||
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.game.permanent.token.YoungHeroRoleToken;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public enum RoleType {
|
||||
YOUNG_HERO("Young Hero", YoungHeroRoleToken::new);
|
||||
|
||||
private final String name;
|
||||
private final Supplier<Token> supplier;
|
||||
|
||||
RoleType(String name, Supplier<Token> supplier) {
|
||||
this.name = name;
|
||||
this.supplier = supplier;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Token createToken() {
|
||||
return supplier.get();
|
||||
}
|
||||
}
|
||||
|
|
@ -40,7 +40,6 @@ public enum SubType {
|
|||
CARTOUCHE("Cartouche", SubTypeSet.EnchantmentType),
|
||||
CLASS("Class", SubTypeSet.EnchantmentType),
|
||||
CURSE("Curse", SubTypeSet.EnchantmentType),
|
||||
ROLE("Role", SubTypeSet.EnchantmentType),
|
||||
RUNE("Rune", SubTypeSet.EnchantmentType),
|
||||
SAGA("Saga", SubTypeSet.EnchantmentType),
|
||||
SHARD("Shard", SubTypeSet.EnchantmentType),
|
||||
|
|
|
|||
|
|
@ -1,62 +0,0 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.SourceMatchesFilterCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.constants.*;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.ToughnessPredicate;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class YoungHeroRoleToken extends TokenImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterCreaturePermanent();
|
||||
|
||||
static {
|
||||
filter.add(new ToughnessPredicate(ComparisonType.FEWER_THAN, 4));
|
||||
}
|
||||
|
||||
private static final Condition condition = new SourceMatchesFilterCondition(filter);
|
||||
|
||||
public YoungHeroRoleToken() {
|
||||
super("Young Hero", "Young Hero Role token");
|
||||
cardType.add(CardType.ENCHANTMENT);
|
||||
subtype.add(SubType.AURA);
|
||||
subtype.add(SubType.ROLE);
|
||||
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
Ability ability = new EnchantAbility(auraTarget);
|
||||
ability.addTarget(auraTarget);
|
||||
ability.addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Enchanted creature has "Whenever this creature attacks, if its toughness is 3 or less, put a +1/+1 counter on it."
|
||||
this.addAbility(new SimpleStaticAbility(new GainAbilityAttachedEffect(
|
||||
new ConditionalInterveningIfTriggeredAbility(
|
||||
new AttacksTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance())),
|
||||
condition, "Whenever this creature attacks, if its toughness is 3 or less, put a +1/+1 counter on it."
|
||||
), AttachmentType.AURA
|
||||
)));
|
||||
}
|
||||
|
||||
private YoungHeroRoleToken(final YoungHeroRoleToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public YoungHeroRoleToken copy() {
|
||||
return new YoungHeroRoleToken(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue