mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 04:09:54 -08:00
* Test of Faith - Fixed that +1/+1 counters that a blocker got during combat already counted for damage dealt to the attacker.
This commit is contained in:
parent
ff3d9d463a
commit
90774fea0b
3 changed files with 135 additions and 8 deletions
|
|
@ -220,6 +220,7 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
|||
Permanent blocker = game.getPermanent(blockers.get(0));
|
||||
Permanent attacker = game.getPermanent(attackers.get(0));
|
||||
if (blocker != null && attacker != null) {
|
||||
int blockerDamage = blocker.getPower().getValue(); // must be set before attacker damage marking because of effects like Test of Faith
|
||||
if (blocked && canDamage(attacker, first)) {
|
||||
int damage = attacker.getPower().getValue();
|
||||
if (hasTrample(attacker)) {
|
||||
|
|
@ -247,8 +248,7 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
|||
}
|
||||
}
|
||||
if (canDamage(blocker, first)) {
|
||||
if (blocker.getBlocking() == 1) { // blocking several creatures handled separately
|
||||
int blockerDamage = blocker.getPower().getValue();
|
||||
if (blocker.getBlocking() == 1) { // blocking several creatures handled separately
|
||||
attacker.markDamage(blockerDamage, blocker.getId(), game, true, true);
|
||||
}
|
||||
}
|
||||
|
|
@ -264,6 +264,16 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
|||
Player player = game.getPlayer(attacker.getControllerId());
|
||||
int damage = attacker.getPower().getValue();
|
||||
if (canDamage(attacker, first)) {
|
||||
// must be set before attacker damage marking because of effects like Test of Faith
|
||||
Map<UUID, Integer> blockerPower = new HashMap<UUID, Integer>();
|
||||
for (UUID blockerId: blockerOrder) {
|
||||
Permanent blocker = game.getPermanent(blockerId);
|
||||
if (canDamage(blocker, first)) {
|
||||
if (blocker.getBlocking() == 1) { // blocking several creatures handled separately
|
||||
blockerPower.put(blockerId, blocker.getPower().getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
Map<UUID, Integer> assigned = new HashMap<UUID, Integer>();
|
||||
if (blocked) {
|
||||
for (UUID blockerId: blockerOrder) {
|
||||
|
|
@ -288,11 +298,9 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
|||
}
|
||||
}
|
||||
for (UUID blockerId: blockerOrder) {
|
||||
Permanent blocker = game.getPermanent(blockerId);
|
||||
if (canDamage(blocker, first)) {
|
||||
if (blocker.getBlocking() == 1) { // blocking several creatures handled separately
|
||||
attacker.markDamage(blocker.getPower().getValue(), blocker.getId(), game, true, true);
|
||||
}
|
||||
Integer power = blockerPower.get(blockerId);
|
||||
if (power != null) {
|
||||
attacker.markDamage(power.intValue(), blockerId, game, true, true);
|
||||
}
|
||||
}
|
||||
for (Map.Entry<UUID, Integer> entry : assigned.entrySet()) {
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ public class CombatDamageStep extends Step<CombatDamageStep> {
|
|||
|
||||
@Override
|
||||
public boolean skipStep(Game game, UUID activePlayerId) {
|
||||
if (game.getCombat().noAttackers())
|
||||
if (game.getCombat().noAttackers()) {
|
||||
return true;
|
||||
}
|
||||
return super.skipStep(game, activePlayerId);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue