diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index e97cce8..fcbf51c 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/sig/plugin/TwosideKeeper/CustomDamage.java b/src/sig/plugin/TwosideKeeper/CustomDamage.java index c5b1067..0e2987d 100644 --- a/src/sig/plugin/TwosideKeeper/CustomDamage.java +++ b/src/sig/plugin/TwosideKeeper/CustomDamage.java @@ -428,7 +428,7 @@ public class CustomDamage { if (MonsterController.getMonsterDifficulty(((Monster)getDamagerEntity(damager)))==MonsterDifficulty.HELLFIRE) { for (int i=0;i<4;i++) { if (Math.random()<=0.2) { - Monster mm = MonsterController.spawnAdjustedMonster(MonsterType.ENDERMITE, getDamagerEntity(damager).getLocation().add(0,1,0)); + LivingEntity mm = MonsterController.spawnAdjustedMonster(MonsterType.ENDERMITE, getDamagerEntity(damager).getLocation().add(0,1,0)); mm.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,Integer.MAX_VALUE,2)); } } @@ -997,7 +997,7 @@ public class CustomDamage { } SoundUtils.playLocalSound(p, Sound.ENTITY_FIREWORK_LARGE_BLAST, 1.0f, 1.0f); - aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), 100); + aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GenericFunctions.GetModifiedCooldown(TwosideKeeper.ERUPTION_COOLDOWN,p)); pd.last_shovelspell=TwosideKeeper.getServerTickTime()+GenericFunctions.GetModifiedCooldown(TwosideKeeper.ERUPTION_COOLDOWN,p); } } diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/ArtifactAbility.java b/src/sig/plugin/TwosideKeeper/HelperStructures/ArtifactAbility.java index 509cea6..ba2149f 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/ArtifactAbility.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/ArtifactAbility.java @@ -90,7 +90,7 @@ public enum ArtifactAbility { new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},10,10,UpgradePath.SHOVEL), ERUPTION("Eruption","Sneak while Left-clicking a mob to damage mobs for [VAL] damage and knock them up. The eruption also destroys the ground beneath you.",new double[]{11.0,12.0,13.0,14.0,16.0,18.0,20.0,23,26.0,29,32.0,35.0,37.5,39.5,50}, new double[]{1.0,0.925,0.85,0.775,0.7,0.625,0.55,0.475,0.45,0.425,0.4,0.375,0.35,0.325,0.3},100,40,UpgradePath.SHOVEL), - EARTHWAVE("Earth Wave","While in combat, destroy a block to send a wave of earth towards your enemies. Enemies standing inside of the waves take [VAL] damage every second.",new double[]{10,12,14,16,18,20,22,24,26,30,35,40,45,50,70}, + EARTHWAVE("Earth Wave","While in mid-air, right-click to instantly slam into the ground and launch soft blocks. This attack ignores fall damage. The larger the fall, the larger the wave.\n\nDeals [VAL] damage to every enemy hit by the wave. Deals double damage and knocks up on soft blocks.",new double[]{10,12,14,16,18,20,22,24,26,30,35,40,45,50,70}, new double[]{2.4,2.2,2.0,1.9,1.8,1.7,1.6,1.5,1.4,1.2,1.1,1.0,0.9,0.8,0.7},100,100,UpgradePath.SHOVEL), //Axe abilities diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java index f257fdd..d143253 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java @@ -3044,7 +3044,7 @@ public class GenericFunctions { } } - public static boolean isArmoredMob(Monster m) { + public static boolean isArmoredMob(LivingEntity m) { if (m.getType()==EntityType.ZOMBIE || m.getType()==EntityType.PIG_ZOMBIE || m.getType()==EntityType.SKELETON) { @@ -3063,24 +3063,25 @@ public class GenericFunctions { b==Material.GRASS || b==Material.GRAVEL || b==Material.CLAY || - b==Material.HARD_CLAY || - b==Material.STAINED_CLAY || + //b==Material.HARD_CLAY || + //b==Material.STAINED_CLAY || b==Material.ENDER_STONE || b==Material.SOIL || - b==Material.SNOW || + b==Material.SNOW_BLOCK || b==Material.SOUL_SAND || b==Material.STONE || b==Material.COBBLESTONE || - b==Material.NETHERRACK || - b==Material.WOOL || - b==Material.WOOD || - b==Material.COAL_ORE || - b==Material.DIAMOND_ORE || - b==Material.GOLD_ORE || - b==Material.IRON_ORE || - b==Material.REDSTONE_ORE || - b==Material.LAPIS_ORE || - b==Material.EMERALD_ORE) { + b==Material.NETHERRACK + //b==Material.WOOL || + //b==Material.WOOD || + //b==Material.COAL_ORE || + //b==Material.DIAMOND_ORE || + //b==Material.GOLD_ORE || + //b==Material.IRON_ORE || + //b==Material.REDSTONE_ORE || + //b==Material.LAPIS_ORE || + //b==Material.EMERALD_ORE + ) { return true; } else { return false; @@ -3533,7 +3534,7 @@ public class GenericFunctions { double damage_mult=Math.max(0d, 1 - l.distanceSquared(ent.getLocation())/rangeSquared); damage_mult*=TwosideKeeper.EXPLOSION_DMG_MULT; damage_mult*=CalculateBlastResistance((LivingEntity)ent); - TwosideKeeper.log("dmg mult is "+damage_mult,2); + TwosideKeeper.log("dmg mult is "+damage_mult,4); dmg = basedmg * damage_mult; if (ent instanceof Player) {TwosideKeeper.log("Damage is "+dmg, 5);} CustomDamage.ApplyDamage(dmg, damager, (LivingEntity)ent, null, "Explosion", CustomDamage.NONE); diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/CustomItem.java b/src/sig/plugin/TwosideKeeper/HelperStructures/CustomItem.java index 9f8550b..b605e37 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/CustomItem.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/CustomItem.java @@ -111,6 +111,30 @@ public class CustomItem { TwosideKeeper.EXPLODING_ARROW_RECIPE = ExplodingArrowRecipe(); TwosideKeeper.POISON_ARROW_RECIPE = PoisonArrowRecipe(); TwosideKeeper.PIERCING_ARROW_RECIPE = PiercingArrowRecipe(); + TwosideKeeper.WORLD_SHOP_RECIPE = WorldShopRecipe(); + } + + private static ShapelessRecipe WorldShopRecipe() { + ItemStack item_ItemCube = WorldShop(); + + ShapedRecipe ItemCube = new ShapedRecipe(item_ItemCube); + ItemCube.shape("ppp","pcp","ppp"); + ItemCube.setIngredient('p', Material.WOOD, -1); + ItemCube.setIngredient('c', Material.CHEST); + return ItemCube; + } + + private static ItemStack WorldShop() { + ItemStack worldShop = new ItemStack(Material.CHEST); + List worldShopLore = new ArrayList(); + worldShopLore.add("You can substitute the dirt block"); + worldShopLore.add("with any block to create any type"); + worldShopLore.add("of World Shop!"); + ItemMeta item_ItemCube_meta=worldShop.getItemMeta(); + item_ItemCube_meta.setLore(worldShopLore); + item_ItemCube_meta.setDisplayName("Item Cube"); + worldShop.setItemMeta(item_ItemCube_meta); + return worldShop.clone(); } private static ShapelessRecipe PiercingArrowRecipe() { diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Effects/EarthWaveTask.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Effects/EarthWaveTask.java new file mode 100644 index 0000000..65bed45 --- /dev/null +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Effects/EarthWaveTask.java @@ -0,0 +1,85 @@ +package sig.plugin.TwosideKeeper.HelperStructures.Effects; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.FallingBlock; +import org.bukkit.entity.Player; +import org.bukkit.util.Vector; + +import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions; + +public class EarthWaveTask implements Runnable{ + Location centerpoint; + int radius; + double vel; + double dmg; + Player damager; + + public EarthWaveTask(Location center, int radius, double vel, double dmg, Player damager) { + this.centerpoint=center; + this.radius=radius; + this.vel=vel; + this.dmg=dmg; + this.damager=damager; + } + + @Override + public void run() { + if (!damager.isDead()) { + for (int x=-radius;x<=radius;x++) { //Start at the top y. + Block b = centerpoint.getBlock().getRelative(x, 0, -radius); + if (GenericFunctions.isSoftBlock(b) && b.getRelative(0, 1, 0).getType()==Material.AIR) { + FallingBlock fb = centerpoint.getWorld().spawnFallingBlock(b.getLocation().add(0,0,0), b.getType(), b.getData()); + fb.setVelocity(new Vector(0,vel,0)); + b.setType(Material.AIR); + aPlugin.API.sendSoundlessExplosion(b.getLocation().add(0,1,0), 1f); + GenericFunctions.DealDamageToNearbyMobs(b.getLocation(), dmg*2, 2, true, vel/1.5d, damager, damager.getEquipment().getItemInMainHand(), false, "Earth Wave"); + } else { + aPlugin.API.sendSoundlessExplosion(b.getLocation().add(0,1,0), 0.1f); + GenericFunctions.DealDamageToNearbyMobs(b.getLocation(), dmg, 2, true, vel/4d, damager, damager.getEquipment().getItemInMainHand(), false, "Earth Wave"); + } + } + for (int x=-radius;x<=radius;x++) { //Start at the top y. + Block b = centerpoint.getBlock().getRelative(x, 0, radius); + if (GenericFunctions.isSoftBlock(b) && b.getRelative(0, 1, 0).getType()==Material.AIR) { + FallingBlock fb = centerpoint.getWorld().spawnFallingBlock(b.getLocation().add(0,0,0), b.getType(), b.getData()); + fb.setVelocity(new Vector(0,vel,0)); + b.setType(Material.AIR); + aPlugin.API.sendSoundlessExplosion(b.getLocation().add(0,1,0), 1f); + GenericFunctions.DealDamageToNearbyMobs(b.getLocation(), dmg*2, 2, true, vel/1.5d, damager, damager.getEquipment().getItemInMainHand(), false, "Earth Wave"); + } else { + aPlugin.API.sendSoundlessExplosion(b.getLocation().add(0,1,0), 0.1f); + GenericFunctions.DealDamageToNearbyMobs(b.getLocation(), dmg, 2, true, vel/4d, damager, damager.getEquipment().getItemInMainHand(), false, "Earth Wave"); + } + } + for (int y=-radius+1;y1) { + //Now that we have the fall distance, create an Earth Wave around us the size of falldist/2. + GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.LEVITATION, falldist, -124, p, true); + p.setVelocity(new Vector(0,-50,0)); + double vel = Math.pow(falldist, 0.2); + int counter=0; + falldist = Math.min(falldist, 20); //Limit the maximum distance to 20 blocks out. + while (falldist>0) { + Bukkit.getScheduler().scheduleSyncDelayedTask(this, new EarthWaveTask(checkloc,counter+1,vel,dmg,p), counter*4); + falldist--; + counter++; + SoundUtils.playGlobalSound(checkloc, Sound.BLOCK_CHORUS_FLOWER_DEATH, 1.0f, 1.0f); + } + SoundUtils.playLocalSound(p, Sound.ENTITY_FIREWORK_LARGE_BLAST, 1.0f, 1.0f); + + /*aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GenericFunctions.GetModifiedCooldown(TwosideKeeper.ERUPTION_COOLDOWN,p)); + pd.last_shovelspell=TwosideKeeper.getServerTickTime()+GenericFunctions.GetModifiedCooldown(TwosideKeeper.ERUPTION_COOLDOWN,p);*/ + } + } + } + } + //Check for a Sword left click. if (ev.getAction()==Action.LEFT_CLICK_AIR || ev.getAction()==Action.LEFT_CLICK_BLOCK) { //log("SHOP? "+TwosideKeeperAPI.isWorldShop(ev.getClickedBlock()),0);