Online commit to continue work portably. Updated Earth Wave and world

shop behavior slightly.
testdev
sigonasr2 8 years ago
parent 06bd56e661
commit 22816a8022
  1. BIN
      TwosideKeeper.jar
  2. 4
      src/sig/plugin/TwosideKeeper/CustomDamage.java
  3. 2
      src/sig/plugin/TwosideKeeper/HelperStructures/ArtifactAbility.java
  4. 31
      src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java
  5. 24
      src/sig/plugin/TwosideKeeper/HelperStructures/CustomItem.java
  6. 85
      src/sig/plugin/TwosideKeeper/HelperStructures/Effects/EarthWaveTask.java
  7. 2
      src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java
  8. 45
      src/sig/plugin/TwosideKeeper/TwosideKeeper.java

Binary file not shown.

@ -428,7 +428,7 @@ public class CustomDamage {
if (MonsterController.getMonsterDifficulty(((Monster)getDamagerEntity(damager)))==MonsterDifficulty.HELLFIRE) { if (MonsterController.getMonsterDifficulty(((Monster)getDamagerEntity(damager)))==MonsterDifficulty.HELLFIRE) {
for (int i=0;i<4;i++) { for (int i=0;i<4;i++) {
if (Math.random()<=0.2) { 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)); 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); 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); pd.last_shovelspell=TwosideKeeper.getServerTickTime()+GenericFunctions.GetModifiedCooldown(TwosideKeeper.ERUPTION_COOLDOWN,p);
} }
} }

@ -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), 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}, 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), 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), 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 //Axe abilities

@ -3044,7 +3044,7 @@ public class GenericFunctions {
} }
} }
public static boolean isArmoredMob(Monster m) { public static boolean isArmoredMob(LivingEntity m) {
if (m.getType()==EntityType.ZOMBIE || if (m.getType()==EntityType.ZOMBIE ||
m.getType()==EntityType.PIG_ZOMBIE || m.getType()==EntityType.PIG_ZOMBIE ||
m.getType()==EntityType.SKELETON) { m.getType()==EntityType.SKELETON) {
@ -3063,24 +3063,25 @@ public class GenericFunctions {
b==Material.GRASS || b==Material.GRASS ||
b==Material.GRAVEL || b==Material.GRAVEL ||
b==Material.CLAY || b==Material.CLAY ||
b==Material.HARD_CLAY || //b==Material.HARD_CLAY ||
b==Material.STAINED_CLAY || //b==Material.STAINED_CLAY ||
b==Material.ENDER_STONE || b==Material.ENDER_STONE ||
b==Material.SOIL || b==Material.SOIL ||
b==Material.SNOW || b==Material.SNOW_BLOCK ||
b==Material.SOUL_SAND || b==Material.SOUL_SAND ||
b==Material.STONE || b==Material.STONE ||
b==Material.COBBLESTONE || b==Material.COBBLESTONE ||
b==Material.NETHERRACK || b==Material.NETHERRACK
b==Material.WOOL || //b==Material.WOOL ||
b==Material.WOOD || //b==Material.WOOD ||
b==Material.COAL_ORE || //b==Material.COAL_ORE ||
b==Material.DIAMOND_ORE || //b==Material.DIAMOND_ORE ||
b==Material.GOLD_ORE || //b==Material.GOLD_ORE ||
b==Material.IRON_ORE || //b==Material.IRON_ORE ||
b==Material.REDSTONE_ORE || //b==Material.REDSTONE_ORE ||
b==Material.LAPIS_ORE || //b==Material.LAPIS_ORE ||
b==Material.EMERALD_ORE) { //b==Material.EMERALD_ORE
) {
return true; return true;
} else { } else {
return false; return false;
@ -3533,7 +3534,7 @@ public class GenericFunctions {
double damage_mult=Math.max(0d, 1 - l.distanceSquared(ent.getLocation())/rangeSquared); double damage_mult=Math.max(0d, 1 - l.distanceSquared(ent.getLocation())/rangeSquared);
damage_mult*=TwosideKeeper.EXPLOSION_DMG_MULT; damage_mult*=TwosideKeeper.EXPLOSION_DMG_MULT;
damage_mult*=CalculateBlastResistance((LivingEntity)ent); 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; dmg = basedmg * damage_mult;
if (ent instanceof Player) {TwosideKeeper.log("Damage is "+dmg, 5);} if (ent instanceof Player) {TwosideKeeper.log("Damage is "+dmg, 5);}
CustomDamage.ApplyDamage(dmg, damager, (LivingEntity)ent, null, "Explosion", CustomDamage.NONE); CustomDamage.ApplyDamage(dmg, damager, (LivingEntity)ent, null, "Explosion", CustomDamage.NONE);

@ -111,6 +111,30 @@ public class CustomItem {
TwosideKeeper.EXPLODING_ARROW_RECIPE = ExplodingArrowRecipe(); TwosideKeeper.EXPLODING_ARROW_RECIPE = ExplodingArrowRecipe();
TwosideKeeper.POISON_ARROW_RECIPE = PoisonArrowRecipe(); TwosideKeeper.POISON_ARROW_RECIPE = PoisonArrowRecipe();
TwosideKeeper.PIERCING_ARROW_RECIPE = PiercingArrowRecipe(); 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<String> worldShopLore = new ArrayList<String>();
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() { private static ShapelessRecipe PiercingArrowRecipe() {

@ -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;y<radius;y++) { //Start at the top y.
Block b = centerpoint.getBlock().getRelative(radius, 0, y);
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;y<radius;y++) { //Start at the top y.
Block b = centerpoint.getBlock().getRelative(-radius, 0, y);
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");
}
}
}
}
}

@ -140,7 +140,7 @@ public class WorldShop {
price = pricelist.get(item.getType().name()); price = pricelist.get(item.getType().name());
} }
if (TwosideKeeper.DEAL_OF_THE_DAY_ITEM.isSimilar(item)) { if (TwosideKeeper.DEAL_OF_THE_DAY_ITEM.isSimilar(item)) {
price*=0.8; return price;
} }
return ModifyPriceBasedOnLocation(price); return ModifyPriceBasedOnLocation(price);
} }

@ -186,6 +186,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
import sig.plugin.TwosideKeeper.HelperStructures.Common.Habitation; import sig.plugin.TwosideKeeper.HelperStructures.Common.Habitation;
import sig.plugin.TwosideKeeper.HelperStructures.Common.RecipeCategory; import sig.plugin.TwosideKeeper.HelperStructures.Common.RecipeCategory;
import sig.plugin.TwosideKeeper.HelperStructures.Common.RecipeLinker; import sig.plugin.TwosideKeeper.HelperStructures.Common.RecipeLinker;
import sig.plugin.TwosideKeeper.HelperStructures.Effects.EarthWaveTask;
import sig.plugin.TwosideKeeper.HelperStructures.Effects.LavaPlume; import sig.plugin.TwosideKeeper.HelperStructures.Effects.LavaPlume;
import sig.plugin.TwosideKeeper.HelperStructures.Utils.BlockUtils; import sig.plugin.TwosideKeeper.HelperStructures.Utils.BlockUtils;
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemUtils; import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemUtils;
@ -344,6 +345,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
public static ShapelessRecipe TRAPPING_ARROW_RECIPE; public static ShapelessRecipe TRAPPING_ARROW_RECIPE;
public static ShapelessRecipe EXPLODING_ARROW_RECIPE; public static ShapelessRecipe EXPLODING_ARROW_RECIPE;
public static ShapelessRecipe PIERCING_ARROW_RECIPE; public static ShapelessRecipe PIERCING_ARROW_RECIPE;
public static ShapelessRecipe WORLD_SHOP_RECIPE;
public static CustomPotion STRENGTHENING_VIAL; public static CustomPotion STRENGTHENING_VIAL;
public static CustomPotion LIFE_VIAL; public static CustomPotion LIFE_VIAL;
public static CustomPotion HARDENING_VIAL; public static CustomPotion HARDENING_VIAL;
@ -356,7 +358,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
public static final int DODGE_COOLDOWN=100; public static final int DODGE_COOLDOWN=100;
public static final int DEATHMARK_COOLDOWN=240; public static final int DEATHMARK_COOLDOWN=240;
public static final int EARTHWAVE_COOLDOWN=300; public static final int EARTHWAVE_COOLDOWN=100;
public static final int ERUPTION_COOLDOWN=100; public static final int ERUPTION_COOLDOWN=100;
public static final int LINEDRIVE_COOLDOWN=240; public static final int LINEDRIVE_COOLDOWN=240;
public static final int REJUVENATE_COOLDOWN=2400; public static final int REJUVENATE_COOLDOWN=2400;
@ -977,11 +979,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
ArrowQuiver.updateQuiverLore(quiver); ArrowQuiver.updateQuiverLore(quiver);
}break; }break;
case "WITHER":{ case "WITHER":{
Monster m = MonsterController.convertMonster((Monster)p.getWorld().spawnEntity(p.getLocation(),EntityType.WITHER), MonsterDifficulty.ELITE); LivingEntity m = MonsterController.convertMonster((Monster)p.getWorld().spawnEntity(p.getLocation(),EntityType.WITHER), MonsterDifficulty.ELITE);
}break; }break;
} }
} }
Monster m = MonsterController.convertMonster((Monster)p.getWorld().spawnEntity(p.getLocation(),EntityType.ZOMBIE), MonsterDifficulty.ELITE); LivingEntity m = MonsterController.convertMonster((Monster)p.getWorld().spawnEntity(p.getLocation(),EntityType.ZOMBIE), MonsterDifficulty.ELITE);
/* /*
StackTraceElement[] stacktrace = new Throwable().getStackTrace(); StackTraceElement[] stacktrace = new Throwable().getStackTrace();
StringBuilder stack = new StringBuilder("Mini stack tracer:"); StringBuilder stack = new StringBuilder("Mini stack tracer:");
@ -2187,6 +2189,43 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
} }
} }
//Check for Earth Wave attack.
if ((ev.getAction()==Action.RIGHT_CLICK_AIR || ev.getAction()==Action.RIGHT_CLICK_BLOCK) && !p.isOnGround()) {
ItemStack weapon = p.getEquipment().getItemInMainHand();
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
double dmg = 0;
if (GenericFunctions.isArtifactEquip(weapon) &&
weapon.toString().contains("SPADE")) {
if (ArtifactAbility.containsEnchantment(ArtifactAbility.EARTHWAVE, weapon) &&
pd.last_shovelspell<TwosideKeeper.getServerTickTime()) {
dmg = GenericFunctions.getAbilityValue(ArtifactAbility.EARTHWAVE, weapon);
int falldist = 0;
Location checkloc = p.getLocation().clone();
while (checkloc.add(0,-1,0).getBlock().getType()==Material.AIR) {
falldist++;
}
if (falldist>1) {
//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. //Check for a Sword left click.
if (ev.getAction()==Action.LEFT_CLICK_AIR || ev.getAction()==Action.LEFT_CLICK_BLOCK) { if (ev.getAction()==Action.LEFT_CLICK_AIR || ev.getAction()==Action.LEFT_CLICK_BLOCK) {
//log("SHOP? "+TwosideKeeperAPI.isWorldShop(ev.getClickedBlock()),0); //log("SHOP? "+TwosideKeeperAPI.isWorldShop(ev.getClickedBlock()),0);

Loading…
Cancel
Save