Make order of parameters the same for methods player.damage and permanent.damage

This commit is contained in:
Quercitron 2014-07-18 02:11:11 +04:00
parent f81af16fa4
commit e5b2b39701
139 changed files with 162 additions and 162 deletions

View file

@ -67,7 +67,7 @@ public abstract class RedirectionEffect extends ReplacementEffectImpl {
DamageEvent damageEvent = (DamageEvent)event;
Permanent permanent = game.getPermanent(redirectTarget.getFirstTarget());
if (permanent != null) {
permanent.damage(damageEvent.getAmount(), event.getSourceId(), game, damageEvent.isPreventable(), damageEvent.isCombatDamage(), event.getAppliedEffects());
permanent.damage(damageEvent.getAmount(), event.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable(), event.getAppliedEffects());
return true;
}
Player player = game.getPlayer(redirectTarget.getFirstTarget());

View file

@ -65,7 +65,7 @@ public class DamageAllControlledTargetEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getFirstTarget(), game)) {
permanent.damage(amount, source.getId(), game, true, false);
permanent.damage(amount, source.getId(), game, false, true);
}
return true;
}

View file

@ -72,7 +72,7 @@ public class DamageAllEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getId(), game);
for (Permanent permanent: permanents) {
permanent.damage(amount.calculate(game, source), source.getSourceId(), game, true, false);
permanent.damage(amount.calculate(game, source), source.getSourceId(), game, false, true);
}
return true;
}

View file

@ -80,7 +80,7 @@ public class DamageEverythingEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game);
for (Permanent permanent: permanents) {
permanent.damage(amount.calculate(game, source), source.getSourceId(), game, true, false);
permanent.damage(amount.calculate(game, source), source.getSourceId(), game, false, true);
}
for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) {
Player player = game.getPlayer(playerId);

View file

@ -74,7 +74,7 @@ public class DamageMultiEffect extends OneShotEffect {
for (UUID target: multiTarget.getTargets()) {
Permanent permanent = game.getPermanent(target);
if (permanent != null) {
permanent.damage(multiTarget.getTargetAmount(target), source.getSourceId(), game, true, false);
permanent.damage(multiTarget.getTargetAmount(target), source.getSourceId(), game, false, true);
}
else {
Player player = game.getPlayer(target);

View file

@ -61,7 +61,7 @@ public class DamageSelfEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
permanent.damage(amount, source.getId(), game, true, false);
permanent.damage(amount, source.getId(), game, false, true);
return true;
}
return false;

View file

@ -108,7 +108,7 @@ public class DamageTargetEffect extends OneShotEffect {
for (UUID targetId : target.getTargets()) {
Permanent permanent = game.getPermanent(targetId);
if (permanent != null) {
permanent.damage(amount.calculate(game, source), source.getSourceId(), game, preventable, false);
permanent.damage(amount.calculate(game, source), source.getSourceId(), game, false, preventable);
}
Player player = game.getPlayer(targetId);
if (player != null) {
@ -121,7 +121,7 @@ public class DamageTargetEffect extends OneShotEffect {
for (UUID targetId :this.getTargetPointer().getTargets(game, source)) {
Permanent permanent = game.getPermanent(targetId);
if (permanent != null) {
permanent.damage(amount.calculate(game, source), source.getSourceId(), game, preventable, false);
permanent.damage(amount.calculate(game, source), source.getSourceId(), game, false, preventable);
} else {
Player player = game.getPlayer(targetId);
if (player != null) {

View file

@ -61,8 +61,8 @@ public class FightTargetSourceEffect extends OneShotEffect {
// 20110930 - 701.10
if (creature1 != null && creature2 != null) {
if (creature1.getCardType().contains(CardType.CREATURE) && creature2.getCardType().contains(CardType.CREATURE)) {
creature1.damage(creature2.getPower().getValue(), creature2.getId(), game, true, false);
creature2.damage(creature1.getPower().getValue(), creature1.getId(), game, true, false);
creature1.damage(creature2.getPower().getValue(), creature2.getId(), game, false, true);
creature2.damage(creature1.getPower().getValue(), creature1.getId(), game, false, true);
return true;
}
}

View file

@ -61,8 +61,8 @@ public class FightTargetsEffect extends OneShotEffect {
// 20110930 - 701.10
if (creature1 != null && creature2 != null) {
if (creature1.getCardType().contains(CardType.CREATURE) && creature2.getCardType().contains(CardType.CREATURE)) {
creature1.damage(creature2.getPower().getValue(), creature2.getId(), game, true, false);
creature2.damage(creature1.getPower().getValue(), creature1.getId(), game, true, false);
creature1.damage(creature2.getPower().getValue(), creature2.getId(), game, false, true);
creature2.damage(creature1.getPower().getValue(), creature1.getId(), game, false, true);
return true;
}
}

View file

@ -81,9 +81,9 @@ public interface Permanent extends Card, Controllable {
boolean cantBeEnchantedBy(MageObject source, Game game);
boolean hasSummoningSickness();
int getDamage();
int damage(int damage, UUID sourceId, Game game, boolean preventable, boolean combat);
int damage(int damage, UUID sourceId, Game game, boolean combat, boolean preventable);
int damage(int damage, UUID sourceId, Game game, boolean preventable, boolean combat, ArrayList<UUID> appliedEffects);
int damage(int damage, UUID sourceId, Game game, boolean combat, boolean preventable, ArrayList<UUID> appliedEffects);
/**
* used in combat only to deal damage at the same time

View file

@ -586,13 +586,13 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
}
@Override
public int damage(int damageAmount, UUID sourceId, Game game, boolean preventable, boolean combat) {
return damage(damageAmount, sourceId, game, preventable, combat, false, null);
public int damage(int damage, UUID sourceId, Game game, boolean combat, boolean preventable) {
return damage(damage, sourceId, game, preventable, combat, false, null);
}
@Override
public int damage(int damageAmount, UUID sourceId, Game game, boolean preventable, boolean combat, ArrayList<UUID> appliedEffects) {
return damage(damageAmount, sourceId, game, preventable, combat, false, appliedEffects);
public int damage(int damage, UUID sourceId, Game game, boolean combat, boolean preventable, ArrayList<UUID> appliedEffects) {
return damage(damage, sourceId, game, preventable, combat, false, appliedEffects);
}
/**
* @param damageAmount