Patch Explosion damage.
This commit is contained in:
parent
e13dc4b29e
commit
4528d33446
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
name: TwosideKeeper
|
||||
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
||||
version: 3.7.3c
|
||||
version: 3.7.3cr1
|
||||
commands:
|
||||
money:
|
||||
description: Tells the player the amount of money they are holding.
|
||||
|
@ -2801,6 +2801,26 @@ public class GenericFunctions {
|
||||
TwosideKeeper.log("Damage goes from "+dmg+"->"+(dmg+TwosideKeeper.CUSTOM_DAMAGE_IDENTIFIER),5);
|
||||
entity.damage(dmg+TwosideKeeper.CUSTOM_DAMAGE_IDENTIFIER,damager);
|
||||
//Bukkit.getPluginManager().callEvent(new EntityDamageByEntityEvent(damager,entity,DamageCause.CUSTOM,dmg+TwosideKeeper.CUSTOM_DAMAGE_IDENTIFIER));
|
||||
} else {
|
||||
if (entity instanceof Player) {
|
||||
double dodgechance = NewCombat.CalculateDodgeChance((Player)entity);
|
||||
Player p = (Player)entity;
|
||||
if (!p.hasPotionEffect(PotionEffectType.GLOWING)) {
|
||||
if (Math.random()<=dodgechance) {
|
||||
p.playSound(p.getLocation(), Sound.ENTITY_PLAYER_ATTACK_SWEEP, 3.0f, 1.0f);
|
||||
for (int i=0;i<p.getEquipment().getArmorContents().length;i++) {
|
||||
ItemStack equip = p.getEquipment().getArmorContents()[i];
|
||||
if (ArtifactAbility.containsEnchantment(ArtifactAbility.GRACEFULDODGE, equip)) {
|
||||
p.addPotionEffect(
|
||||
new PotionEffect(PotionEffectType.GLOWING,
|
||||
(int)(GenericFunctions.getAbilityValue(ArtifactAbility.GRACEFULDODGE, equip)*20),
|
||||
0)
|
||||
);
|
||||
}
|
||||
}
|
||||
p.setNoDamageTicks(10);
|
||||
|
||||
|
||||
} else {
|
||||
//Use old system if we cannot get a valid damager.
|
||||
if (entity.getHealth()>dmg && entity instanceof Player) {
|
||||
@ -2808,7 +2828,9 @@ public class GenericFunctions {
|
||||
entity.setHealth(((Player)entity).getHealth()-dmg);
|
||||
aPlugin.API.sendEntityHurtAnimation((Player)entity);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
||||
else {
|
||||
//List<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
//EntityDeathEvent ev = new EntityDeathEvent(entity,drops);
|
||||
//Bukkit.getPluginManager().callEvent(ev);
|
||||
@ -2819,6 +2841,26 @@ public class GenericFunctions {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (entity.getHealth()>dmg && entity instanceof Player) {
|
||||
if (!AttemptRevive((Player)entity,dmg)) {
|
||||
entity.setHealth(((Player)entity).getHealth()-dmg);
|
||||
aPlugin.API.sendEntityHurtAnimation((Player)entity);
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
//List<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
//EntityDeathEvent ev = new EntityDeathEvent(entity,drops);
|
||||
//Bukkit.getPluginManager().callEvent(ev);
|
||||
//entity.setHealth(0);
|
||||
if (entity instanceof Player && !AttemptRevive((Player)entity,Integer.MAX_VALUE)) {
|
||||
entity.damage(Integer.MAX_VALUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isViewingInventory(Player p) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
@ -2973,8 +3015,9 @@ public class GenericFunctions {
|
||||
p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION,20,0));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void DealExplosionDamageToEntities(Location l, double basedmg, double range) {
|
||||
List<Entity> nearbyentities = new ArrayList<Entity>();
|
||||
/*List<Entity> nearbyentities = new ArrayList<Entity>();
|
||||
nearbyentities.addAll(l.getWorld().getNearbyEntities(l, range, range, range));
|
||||
for (int i=0;i<nearbyentities.size();i++) {
|
||||
Entity ent = nearbyentities.get(i);
|
||||
@ -2989,8 +3032,13 @@ public class GenericFunctions {
|
||||
damage_mult*=TwosideKeeper.EXPLOSION_DMG_MULT;
|
||||
damage_mult*=CalculateBlastResistance((LivingEntity)nearbyentities.get(i));
|
||||
double dmg = basedmg * damage_mult;
|
||||
DealDamageToMob(dmg,(LivingEntity)nearbyentities.get(i),null,null,"Explosion");
|
||||
double dodgechance = 0.0;
|
||||
if (nearbyentities.get(i) instanceof Player) {
|
||||
Player p = (Player)nearbyentities.get(i);
|
||||
dodgechance = NewCombat.CalculateDodgeChance(p);
|
||||
}
|
||||
DealDamageToMob(dmg,(LivingEntity)nearbyentities.get(i),null,null,"Explosion");
|
||||
}*/
|
||||
}
|
||||
|
||||
private static double CalculateBlastResistance(LivingEntity l) {
|
||||
|
@ -234,7 +234,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
public static long HEALTH_REGENERATION_RATE=100; //The amount of ticks between each health regeneration event.
|
||||
public static long FOOD_HEAL_AMT=2; //1 Heart per food item consumed.
|
||||
public static double ENEMY_DMG_MULT=1.0f; //
|
||||
public static double EXPLOSION_DMG_MULT=1.2f; //
|
||||
public static double EXPLOSION_DMG_MULT=0.6f; //
|
||||
public static double HEADSHOT_ACC=1.0f; //How accurate headshots have to be. Lower values means more leniency on headshots. Higher values means more strict.
|
||||
public static double COMMON_DROP_RATE=0.1; // 1/10 chance
|
||||
public static double RARE_DROP_RATE=0.0078125; // 1/128 chance
|
||||
@ -5422,7 +5422,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
HEALTH_REGENERATION_RATE = getConfig().getLong("HEALTH/HEALTH_REGENERATION_RATE");
|
||||
FOOD_HEAL_AMT = getConfig().getInt("HEALTH/FOOD_HEAL_AMT");
|
||||
ENEMY_DMG_MULT = getConfig().getDouble("ENEMY/ENEMY_DMG_MULT");
|
||||
EXPLOSION_DMG_MULT = getConfig().getDouble("ENEMY/EXPLOSION_DMG_MULT");
|
||||
EXPLOSION_DMG_MULT = getConfig().getDouble("ENEMY/EXPLOSION_DMG_MULT")/2;
|
||||
HEADSHOT_ACC = getConfig().getDouble("ENEMY/HEADSHOT_ACC");
|
||||
RARE_DROP_RATE = getConfig().getDouble("ITEM/RARE_DROP_RATE");
|
||||
COMMON_DROP_RATE = getConfig().getDouble("ITEM/COMMON_DROP_RATE");
|
||||
|
Loading…
x
Reference in New Issue
Block a user