mirror of
https://github.com/correl/mage.git
synced 2025-04-08 09:11:04 -09:00
- Added Ruric Thar, the Unbowed. Little fix.
This commit is contained in:
parent
111f198f3d
commit
4feb0638bd
2 changed files with 126 additions and 2 deletions
Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai
Mage.Sets/src/mage/sets/dragonsmaze
|
@ -1102,8 +1102,7 @@ public class ComputerPlayer6 extends ComputerPlayer<ComputerPlayer6> implements
|
|||
for (Permanent blocker : possibleBlockers) {
|
||||
int blockerValue = eval.evaluate(blocker, game);
|
||||
if (attacker.getPower().getValue() <= blocker.getToughness().getValue()
|
||||
&& attacker.getToughness().getValue() <= blocker.getPower().getValue()
|
||||
&& attacker.getPower().getValue() == 0) {
|
||||
&& attacker.getToughness().getValue() <= blocker.getPower().getValue()) {
|
||||
safeToAttack = false;
|
||||
}
|
||||
|
||||
|
@ -1126,6 +1125,9 @@ public class ComputerPlayer6 extends ComputerPlayer<ComputerPlayer6> implements
|
|||
|| attacker.getAbilities().contains(new IndestructibleAbility())) {
|
||||
safeToAttack = true;
|
||||
}
|
||||
if (attacker.getPower().getValue() == 0) {
|
||||
safeToAttack = false;
|
||||
}
|
||||
if (safeToAttack) {
|
||||
attackingPlayer.declareAttacker(attacker.getId(), defenderId, game);
|
||||
}
|
||||
|
|
122
Mage.Sets/src/mage/sets/dragonsmaze/RuricTharTheUnbowed.java
Normal file
122
Mage.Sets/src/mage/sets/dragonsmaze/RuricTharTheUnbowed.java
Normal file
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.dragonsmaze;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.AttacksEachTurnStaticAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
import mage.abilities.keyword.ReachAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class RuricTharTheUnbowed extends CardImpl<RuricTharTheUnbowed> {
|
||||
|
||||
public RuricTharTheUnbowed(UUID ownerId) {
|
||||
super(ownerId, 99, "Ruric Thar, the Unbowed", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{R}{G}");
|
||||
this.expansionSetCode = "DGM";
|
||||
this.supertype.add("Legendary");
|
||||
this.subtype.add("Ogre");
|
||||
this.subtype.add("Warrior");
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(6);
|
||||
|
||||
// Vigilance
|
||||
this.addAbility(VigilanceAbility.getInstance());
|
||||
|
||||
// Reach
|
||||
this.addAbility(ReachAbility.getInstance());
|
||||
|
||||
// Ruric Thar, the Unbowed attacks each turn if able.
|
||||
this.addAbility(new AttacksEachTurnStaticAbility());
|
||||
|
||||
// Whenever a player casts a noncreature spell, Ruric Thar deals 6 damage to that player.
|
||||
this.addAbility(new RuricTharTheUnbowedAbility());
|
||||
}
|
||||
|
||||
public RuricTharTheUnbowed(final RuricTharTheUnbowed card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RuricTharTheUnbowed copy() {
|
||||
return new RuricTharTheUnbowed(this);
|
||||
}
|
||||
}
|
||||
|
||||
class RuricTharTheUnbowedAbility extends TriggeredAbilityImpl<RuricTharTheUnbowedAbility> {
|
||||
|
||||
public RuricTharTheUnbowedAbility() {
|
||||
super(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(6), false);
|
||||
}
|
||||
|
||||
public RuricTharTheUnbowedAbility(final RuricTharTheUnbowedAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RuricTharTheUnbowedAbility copy() {
|
||||
return new RuricTharTheUnbowedAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
if (spell != null
|
||||
&& !spell.getCardType().contains(CardType.CREATURE)) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever a player casts a noncreature spell, Ruric Thar deals 6 damage to that player.";
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue