forked from External/mage
xenodron mentionned that one of the use of setSourceId is to more easily find the Event that use non-standard sourceId. So reverting the change made in a previous commit. It was a non-functional change meant to ease new BatchEvent sharing sourceId, but I'll use setSourceId instead there.
43 lines
1.1 KiB
Java
43 lines
1.1 KiB
Java
package mage.game.events;
|
|
|
|
import java.util.UUID;
|
|
|
|
/**
|
|
* @author BetaSteward_at_googlemail.com
|
|
*/
|
|
public abstract class DamageEvent extends GameEvent {
|
|
|
|
protected boolean combat;
|
|
private boolean asThoughInfect = false;
|
|
private boolean asThoughWither = false;
|
|
|
|
public DamageEvent(EventType type, UUID targetId, UUID damageSourceId, UUID targetControllerId, int amount, boolean preventable, boolean combat) {
|
|
super(type, targetId, null, targetControllerId, amount, preventable);
|
|
this.combat = combat;
|
|
this.setSourceId(damageSourceId);
|
|
}
|
|
|
|
public boolean isCombatDamage() {
|
|
return combat;
|
|
}
|
|
|
|
public boolean isPreventable() {
|
|
return flag;
|
|
}
|
|
|
|
public void setAsThoughInfect(boolean asThoughInfect) {
|
|
this.asThoughInfect = asThoughInfect;
|
|
}
|
|
|
|
public boolean isAsThoughInfect() {
|
|
return asThoughInfect;
|
|
}
|
|
|
|
public void setAsThoughWither(boolean asThoughWither) {
|
|
this.asThoughWither = asThoughWither;
|
|
}
|
|
|
|
public boolean isAsThoughWither() {
|
|
return asThoughWither;
|
|
}
|
|
}
|