Skywars fixes

This commit is contained in:
Sam 2018-01-31 12:00:46 +00:00 committed by Alexander Meech
parent 1f35045ea8
commit f5e0a91414
5 changed files with 41 additions and 21 deletions

View File

@ -164,7 +164,7 @@ public abstract class Skywars extends Game
ThrowableTNTModule tntModule = new ThrowableTNTModule() ThrowableTNTModule tntModule = new ThrowableTNTModule()
.setThrowAndDrop(true) .setThrowAndDrop(true)
.setThrowStrength(1.4); .setThrowStrength(1.6);
tntModule.register(this); tntModule.register(this);
ItemStack tntItem = tntModule.getTntItem().clone(); ItemStack tntItem = tntModule.getTntItem().clone();
@ -195,6 +195,7 @@ public abstract class Skywars extends Game
private void setupLoot() private void setupLoot()
{ {
new ChestLootModule() new ChestLootModule()
.setPreGenerateLoot(true)
.registerChestType("Island", WorldData.GetDataLocs("BROWN"), .registerChestType("Island", WorldData.GetDataLocs("BROWN"),
new ChestLootPool() new ChestLootPool()
@ -206,7 +207,6 @@ public abstract class Skywars extends Game
, ,
new ChestLootPool() new ChestLootPool()
.addItem(new ItemStack(Material.WOOD_SWORD))
.addItem(new ItemStack(Material.STONE_SWORD)) .addItem(new ItemStack(Material.STONE_SWORD))
.addEnchantment(Enchantment.DAMAGE_ALL, 1) .addEnchantment(Enchantment.DAMAGE_ALL, 1)
.setEnchantmentRarity(0.5) .setEnchantmentRarity(0.5)
@ -285,6 +285,7 @@ public abstract class Skywars extends Game
new ChestLootPool() new ChestLootPool()
.addItem(new ItemStack(Material.WOOD), 16, 32) .addItem(new ItemStack(Material.WOOD), 16, 32)
.addItem(new ItemStack(Material.COBBLESTONE), 16, 32) .addItem(new ItemStack(Material.COBBLESTONE), 16, 32)
.addItem(new ItemStack(Material.GLASS), 16, 32)
.setProbability(0.9) .setProbability(0.9)
, ,
@ -329,7 +330,6 @@ public abstract class Skywars extends Game
new ChestLootPool() new ChestLootPool()
.addItem(new ItemStack(Material.DIAMOND_SWORD), 30) .addItem(new ItemStack(Material.DIAMOND_SWORD), 30)
.addItem(new ItemStack(Material.DIAMOND), 1, 3) .addItem(new ItemStack(Material.DIAMOND), 1, 3)
.addItem(new ItemStack(Material.STICK), 1, 3)
.setProbability(0.4) .setProbability(0.4)
, ,
@ -356,19 +356,20 @@ public abstract class Skywars extends Game
new ChestLootPool() new ChestLootPool()
.addItem(new ItemStack(Material.WOOD), 16, 32) .addItem(new ItemStack(Material.WOOD), 16, 32)
.addItem(new ItemStack(Material.COBBLESTONE), 16, 32) .addItem(new ItemStack(Material.COBBLESTONE), 16, 32)
.addItem(new ItemStack(Material.GLASS), 16, 32)
.setProbability(0.9) .setProbability(0.9)
, ,
new ChestLootPool() new ChestLootPool()
.addItem(new ItemStack(Material.EXP_BOTTLE), 5, 10, 130) .addItem(new ItemStack(Material.EXP_BOTTLE), 5, 10, 130)
.addItem(new ItemStack(Material.ARROW), 4, 8, 160) .addItem(new ItemStack(Material.ARROW), 6, 10, 160)
.addItem(new ItemStack(Material.SNOW_BALL), 2, 5) .addItem(new ItemStack(Material.SNOW_BALL), 2, 5)
.addItem(new ItemStack(Material.EGG), 2, 5) .addItem(new ItemStack(Material.EGG), 2, 5)
.addItem(new ItemStack(Material.LAVA_BUCKET), 80) .addItem(new ItemStack(Material.LAVA_BUCKET), 60)
.addItem(new ItemStack(Material.WATER_BUCKET)) .addItem(new ItemStack(Material.WATER_BUCKET), 130)
.addItem(new ItemStack(Material.ENDER_PEARL), 1, 2) .addItem(new ItemStack(Material.ENDER_PEARL), 1, 2)
.addItem(new ItemStack(Material.MUSHROOM_SOUP)) .addItem(new ItemStack(Material.MUSHROOM_SOUP), 130)
.setAmountsPerChest(1, 3) .setAmountsPerChest(2, 3)
, ,
new ChestLootPool() new ChestLootPool()

View File

@ -11,8 +11,6 @@ import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.recharge.Recharge; import mineplex.core.recharge.Recharge;
import nautilus.game.arcade.game.GameTeam;
public class PerkFireBurst extends SkywarsPerk public class PerkFireBurst extends SkywarsPerk
{ {
@ -40,11 +38,10 @@ public class PerkFireBurst extends SkywarsPerk
} }
Location location = player.getLocation().add(0, LOCATION_Y_MODIFIER, 0); Location location = player.getLocation().add(0, LOCATION_Y_MODIFIER, 0);
GameTeam team = Manager.GetGame().GetTeam(player);
for (Player other : UtilPlayer.getNearby(location, _range, true)) for (Player other : UtilPlayer.getNearby(location, _range, true))
{ {
if (other.equals(player) || team.HasPlayer(other)) if (other.equals(player) || isTeamDamage(player, other))
{ {
continue; continue;
} }

View File

@ -17,6 +17,8 @@ import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilInv;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.games.skywars.TeamSkywars;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.Perk;
public abstract class SkywarsPerk extends Perk public abstract class SkywarsPerk extends Perk
@ -33,6 +35,12 @@ public abstract class SkywarsPerk extends Perk
public abstract void onUseItem(Player player); public abstract void onUseItem(Player player);
protected boolean isTeamDamage(Player player1, Player player2)
{
Game game = Manager.GetGame();
return game instanceof TeamSkywars && game.GetTeam(player1).equals(game.GetTeam(player2));
}
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
public void playerInteract(PlayerInteractEvent event) public void playerInteract(PlayerInteractEvent event)
{ {

View File

@ -22,6 +22,7 @@ import org.bukkit.potion.PotionEffectType;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
@ -36,10 +37,10 @@ public class ZombieGuardianModule extends Module
private static final ItemStack[] ARMOUR = private static final ItemStack[] ARMOUR =
{ {
new ItemStack(Material.GOLD_BOOTS), new ItemBuilder(Material.GOLD_BOOTS).setUnbreakable(true).build(),
new ItemStack(Material.GOLD_LEGGINGS), new ItemBuilder(Material.GOLD_LEGGINGS).setUnbreakable(true).build(),
new ItemStack(Material.GOLD_CHESTPLATE), new ItemBuilder(Material.GOLD_CHESTPLATE).setUnbreakable(true).build(),
new ItemStack(Material.GOLD_HELMET) new ItemBuilder(Material.GOLD_HELMET).setUnbreakable(true).build(),
}; };
private static final PotionEffect FIRE_RESISTANCE = new PotionEffect(PotionEffectType.FIRE_RESISTANCE, Integer.MAX_VALUE, 0, false, false); private static final PotionEffect FIRE_RESISTANCE = new PotionEffect(PotionEffectType.FIRE_RESISTANCE, Integer.MAX_VALUE, 0, false, false);
private static final int HEALTH = 15; private static final int HEALTH = 15;
@ -155,8 +156,7 @@ public class ZombieGuardianModule extends Module
return; return;
} }
event.AddMod("Negate", -event.GetDamage()); event.AddMod("Blast Protection", -event.GetDamage() + 8);
event.AddMod("Blast Protection", 5);
event.SetIgnoreArmor(true); event.SetIgnoreArmor(true);
} }

View File

@ -47,8 +47,7 @@ public class ChestLootModule extends Module
private final Map<ChestType, Set<ChestMetadata>> _chests; private final Map<ChestType, Set<ChestMetadata>> _chests;
private long _destroyAfterOpened; private long _destroyAfterOpened;
private boolean _autoRotateChests = true; private boolean _autoRotateChests = true, _spawnNearby, _preGenerateLoot;
private boolean _spawnNearby;
private int _spawnNearbyRadius = 8; private int _spawnNearbyRadius = 8;
public ChestLootModule() public ChestLootModule()
@ -92,6 +91,12 @@ public class ChestLootModule extends Module
return this; return this;
} }
public ChestLootModule setPreGenerateLoot(boolean preGenerateLoot)
{
_preGenerateLoot = preGenerateLoot;
return this;
}
public void addChestLocation(String typeName, Location location) public void addChestLocation(String typeName, Location location)
{ {
for (Entry<ChestType, Set<ChestMetadata>> entry : _chests.entrySet()) for (Entry<ChestType, Set<ChestMetadata>> entry : _chests.entrySet())
@ -180,6 +185,11 @@ public class ChestLootModule extends Module
ChestMetadata metadata = new ChestMetadata(block, chestType); ChestMetadata metadata = new ChestMetadata(block, chestType);
metadataSet.add(metadata); metadataSet.add(metadata);
if (_preGenerateLoot)
{
metadata.populateChest((Chest) block.getState());
}
} }
} }
@ -209,7 +219,11 @@ public class ChestLootModule extends Module
metadata.Opened = true; metadata.Opened = true;
metadata.OpenedAt = System.currentTimeMillis(); metadata.OpenedAt = System.currentTimeMillis();
metadata.populateChest((Chest) block.getState());
if (!_preGenerateLoot)
{
metadata.populateChest((Chest) block.getState());
}
} }
@EventHandler @EventHandler