mirror of
https://github.com/taoneill/war.git
synced 2024-11-23 18:55:28 +01:00
Closes gh-97. Closes gh-171. Closes gh-108. Closes gh-85. Closes gh-67. Zonemakers see magic walls when on a team, which should work instead of forcing zonemakers to use /zonemaker to enable zonemaker mode. Friendly fire setting should now get persisted properly. When a bouncing arrow hits you you shouldn't get a friendly fire message anymore. No scoring can occur if other teams are empty.
This commit is contained in:
parent
eb2e7ed91c
commit
04b917807c
@ -582,7 +582,7 @@ public class War extends JavaPlugin {
|
||||
p.teleport(warzone.getTeleport());
|
||||
this.msg(player, "You have left the warzone. Your inventory has (hopefully) been restored.");
|
||||
}
|
||||
team.setPoints(0);
|
||||
team.resetPoints();
|
||||
team.getPlayers().clear();
|
||||
}
|
||||
|
||||
@ -1235,7 +1235,7 @@ public class War extends JavaPlugin {
|
||||
wandBearers.put(player.getName(), zoneName);
|
||||
player.getInventory().addItem(new ItemStack(Material.WOOD_SWORD, 1, (byte) 8));
|
||||
//player.getWorld().dropItem(player.getLocation(), new ItemStack(Material.WOOD_SWORD));
|
||||
this.msg(player, "You now have a wand for zone " + zoneName + ". Left-click for corner 1. Right-click for corner 2.");
|
||||
this.msg(player, "You now have a wand for zone " + zoneName + ". Left-click with wodden sword for corner 1. Right-click for corner 2.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ public class WarBlockListener extends BlockListener {
|
||||
}
|
||||
war.msg(player, "You have team " + lostFlagTeam.getName() + "'s flag. Reach your team spawn or flag to capture it!");
|
||||
} else {
|
||||
war.msg(player, "You can't steal team " + lostFlagTeam.getName() + "'s flag since there are no players there.");
|
||||
war.msg(player, "You can't steal team " + lostFlagTeam.getName() + "'s flag since no players are on that team.");
|
||||
}
|
||||
}
|
||||
event.setCancelled(true);
|
||||
|
@ -105,6 +105,8 @@ public class WarEntityListener extends EntityListener {
|
||||
"in the other teams in that warzone.");
|
||||
} else if (defenderTeam == null) {
|
||||
war.badMsg(a, "Your target is not in a team.");
|
||||
} else if (attacker != null && defender != null && attacker.getEntityId() == defender.getEntityId()) {
|
||||
// You just hit yourself, probably with a bouncing arrow
|
||||
} else if (attackerTeam == defenderTeam) {
|
||||
war.badMsg(a, "Your target is on your team.");
|
||||
} else if (attackerWarzone != defenderWarzone) {
|
||||
@ -113,9 +115,6 @@ public class WarEntityListener extends EntityListener {
|
||||
event.setCancelled(true); // can't attack someone inside a warzone if you're not in a team
|
||||
}
|
||||
|
||||
// if(event.isCancelled() && event instanceof EntityDamageByProjectileEvent) {
|
||||
// //((EntityDamageByProjectileEvent)event).setBounce(true);
|
||||
// }
|
||||
} else if (defender instanceof Player && event instanceof EntityDamageByProjectileEvent) {
|
||||
// attacked by dispenser arrow most probably
|
||||
// Detect death, prevent it and respawn the player
|
||||
|
@ -261,7 +261,8 @@ public class WarPlayerListener extends PlayerListener {
|
||||
|
||||
// Zone walls
|
||||
Warzone nearbyZone = war.zoneOfZoneWallAtProximity(playerLoc);
|
||||
if(nearbyZone != null && !isMaker) { // zone makers don't get bothered with guard walls
|
||||
Team currentTeam = war.getPlayerTeam(player.getName());
|
||||
if(nearbyZone != null && (!isMaker || (isMaker && currentTeam != null))) { // zone makers don't get bothered with guard walls
|
||||
nearbyZone.protectZoneWallAgainstPlayer(player);
|
||||
} else { // zone makers still need to delete their walls
|
||||
// make sure to delete any wall guards as you leave
|
||||
|
@ -349,7 +349,19 @@ public class Team {
|
||||
}
|
||||
|
||||
public void addPoint() {
|
||||
if (players.size()!=0) points++;
|
||||
boolean atLeastOnePlayerOnTeam = players.size() != 0;
|
||||
boolean atLeastOnePlayerOnOtherTeam = false;
|
||||
for(Team team : warzone.getTeams()) {
|
||||
if(!team.getName().equals(this.getName())
|
||||
&& team.getPlayers().size() > 0) {
|
||||
atLeastOnePlayerOnOtherTeam = true;
|
||||
}
|
||||
}
|
||||
if (atLeastOnePlayerOnTeam && atLeastOnePlayerOnOtherTeam) {
|
||||
points++;
|
||||
} else if (!atLeastOnePlayerOnOtherTeam) {
|
||||
this.teamcast("Can't score until at least one player joins another team.");
|
||||
}
|
||||
}
|
||||
|
||||
public int getPoints() {
|
||||
@ -402,8 +414,8 @@ public class Team {
|
||||
this.spawnVolume = volume;
|
||||
}
|
||||
|
||||
public void setPoints(int score) {
|
||||
if (players.size()!=0) this.points = score;
|
||||
public void resetPoints() {
|
||||
this.points = 0;
|
||||
}
|
||||
|
||||
public void setFlagVolume(Volume flagVolume) {
|
||||
|
@ -932,7 +932,7 @@ public class Warzone {
|
||||
if(zoneEmpty) {
|
||||
// reset the zone for a new game when the last player leaves
|
||||
for(Team team : this.getTeams()) {
|
||||
team.setPoints(0);
|
||||
team.resetPoints();
|
||||
team.setRemainingLives(this.getLifePool());
|
||||
}
|
||||
this.getVolume().resetBlocksAsJob();
|
||||
|
@ -38,7 +38,7 @@ public class ScoreCapReachedJob implements Runnable {
|
||||
}
|
||||
}
|
||||
}
|
||||
t.setPoints(0);
|
||||
t.resetPoints();
|
||||
t.getPlayers().clear(); // empty the team
|
||||
}
|
||||
}
|
||||
|
@ -338,7 +338,7 @@ public class WarzoneMapper {
|
||||
warzoneConfig.setString("teamFlags", teamFlagsStr);
|
||||
|
||||
// ff
|
||||
warzoneConfig.setBoolean("firendlyFire", warzone.getFriendlyFire());
|
||||
warzoneConfig.setBoolean("friendlyFire", warzone.getFriendlyFire());
|
||||
|
||||
// loadout
|
||||
String loadoutStr = "";
|
||||
|
Loading…
Reference in New Issue
Block a user