forked from External/mage
WIP: Implement Role mechanic (#10816)
* [WOE] Implement Embereth Veteran * add SBA for role tokens * [WOE] Implement Cursed Courtier * [WOE] Implement Conceited Witch * [WOE] Implement Besotted Knight * [WOE] Implement Syr Armont, the Redeemer * [WOE] Implement Living Lectern * add role test * [WOE] Implement Lord Skitter's Blessing * [WOE] Implement Faunsbane Troll * [WOE] Implement Twisted Fealty * [WOC] Implement Ellivere of the Wild Court * [WOE] Implement Monstrous Rage * [WOE] Implement Spellbook Vendor * add verify skips * extra fix
This commit is contained in:
parent
bf508aca9b
commit
b20bdcede7
28 changed files with 1230 additions and 6 deletions
|
|
@ -0,0 +1,51 @@
|
|||
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.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
* @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;
|
||||
}
|
||||
roleType.createToken(permanent, game, source);
|
||||
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");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue