forked from External/mage
Update *.sh and *.java files to use Unix line endings
This commit is contained in:
parent
a6d03c925f
commit
9c7982e8f6
273 changed files with 26704 additions and 26704 deletions
|
|
@ -1,42 +1,42 @@
|
|||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Styxo
|
||||
*/
|
||||
public class LoseHalfLifeTargetEffect extends OneShotEffect {
|
||||
|
||||
public LoseHalfLifeTargetEffect() {
|
||||
super(Outcome.Damage);
|
||||
staticText = "that player loses half their life, rounded up";
|
||||
}
|
||||
|
||||
public LoseHalfLifeTargetEffect(final LoseHalfLifeTargetEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoseHalfLifeTargetEffect copy() {
|
||||
return new LoseHalfLifeTargetEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (player != null) {
|
||||
Integer amount = (int) Math.ceil(player.getLife() / 2f);
|
||||
if (amount > 0) {
|
||||
player.loseLife(amount, game, false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Styxo
|
||||
*/
|
||||
public class LoseHalfLifeTargetEffect extends OneShotEffect {
|
||||
|
||||
public LoseHalfLifeTargetEffect() {
|
||||
super(Outcome.Damage);
|
||||
staticText = "that player loses half their life, rounded up";
|
||||
}
|
||||
|
||||
public LoseHalfLifeTargetEffect(final LoseHalfLifeTargetEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoseHalfLifeTargetEffect copy() {
|
||||
return new LoseHalfLifeTargetEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (player != null) {
|
||||
Integer amount = (int) Math.ceil(player.getLife() / 2f);
|
||||
if (amount > 0) {
|
||||
player.loseLife(amount, game, false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue