New conf.json option "warZoneFriendlyFire", defaults to disabled; if enabled, allies and fellow faction members can hurt each other in war zones

This commit is contained in:
Brettflan 2011-06-10 07:38:14 -05:00
parent 19b1ceabdd
commit cbd0ee42ba
2 changed files with 7 additions and 1 deletions

View File

@ -80,6 +80,7 @@ public class Conf {
public static boolean warZoneBlockFireballs = false; public static boolean warZoneBlockFireballs = false;
public static boolean warZoneBlockTNT = true; public static boolean warZoneBlockTNT = true;
public static boolean warZonePowerLoss = true; public static boolean warZonePowerLoss = true;
public static boolean warZoneFriendlyFire = false;
public static boolean wildernessDenyBuild = false; public static boolean wildernessDenyBuild = false;
public static boolean wildernessDenyUseage = false; public static boolean wildernessDenyUseage = false;

View File

@ -156,11 +156,16 @@ public class FactionsEntityListener extends EntityListener {
return true; return true;
} }
Faction locFaction = Board.getFactionAt(new FLocation(attacker));
// so we know from above that the defender isn't in a safezone... what about the attacker, sneaky dog that he might be? // so we know from above that the defender isn't in a safezone... what about the attacker, sneaky dog that he might be?
if (Board.getFactionAt(new FLocation(attacker)).isSafeZone()) { if (locFaction.isSafeZone()) {
attacker.sendMessage("You can't hurt other players while you are in a SafeZone."); attacker.sendMessage("You can't hurt other players while you are in a SafeZone.");
return false; return false;
} }
else if (locFaction.isWarZone() && Conf.warZoneFriendlyFire) {
return true;
}
Relation relation = defender.getRelation(attacker); Relation relation = defender.getRelation(attacker);