forked from External/mage
Refactor: move player.damage params to default (same as permanent.damage);
This commit is contained in:
parent
76387057b7
commit
11976b5c89
228 changed files with 1104 additions and 1454 deletions
|
|
@ -1,22 +1,20 @@
|
|||
|
||||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.constants.Outcome;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class DamageEverythingEffect extends OneShotEffect {
|
||||
|
|
@ -48,7 +46,7 @@ public class DamageEverythingEffect extends OneShotEffect {
|
|||
public DamageEverythingEffect(DynamicValue amount, FilterPermanent filter) {
|
||||
this(amount, filter, null);
|
||||
}
|
||||
|
||||
|
||||
public DamageEverythingEffect(DynamicValue amount, FilterPermanent filter, UUID damageSource) {
|
||||
super(Outcome.Damage);
|
||||
this.amount = amount;
|
||||
|
|
@ -78,13 +76,13 @@ public class DamageEverythingEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
int damage = amount.calculate(game, source, this);
|
||||
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game);
|
||||
for (Permanent permanent: permanents) {
|
||||
permanent.damage(damage, damageSource == null ? source.getSourceId(): damageSource, game, false, true);
|
||||
for (Permanent permanent : permanents) {
|
||||
permanent.damage(damage, damageSource == null ? source.getSourceId() : damageSource, game, false, true);
|
||||
}
|
||||
for (UUID playerId: game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.damage(damage, damageSource == null ? source.getSourceId(): damageSource, game, false, true);
|
||||
player.damage(damage, damageSource == null ? source.getSourceId() : damageSource, game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue