Просмотр исходного кода

dealNoInvulnerabilityTickDamage actually hurts things now

nossr50 6 лет назад
Родитель
Сommit
c46b7ed3bc

+ 1 - 0
Changelog.txt

@@ -39,6 +39,7 @@ Version 2.1.0
  ! (Skills) Sword's Bleed has been renamed to Rupture
  ! (Skills) Sword's Serrated Strikes now uses your Rupture rank to determine the damage/ticks for its bleed effect.
  ! (Skills) Sword's Rupture now ticks four times as fast
+ ! (Skills) Sword's Rupture will now deal lethal damage
  = (Skills) Fixed a bug where Rupture would apply an incorrect amount of bleed ticks
  ! (Skills) Sword's Rupture now reaches its max proc chance at level 20 (200 in Retro)
  ! (Skills) Sword's Rupture now has a max chance to proc of 33% instead of 70%

+ 5 - 4
src/main/java/com/gmail/nossr50/runnables/skills/BleedTimerTask.java

@@ -26,7 +26,7 @@ public class BleedTimerTask extends BukkitRunnable {
     public void run() {
         for(LivingEntity target : bleedList.keySet())
         {
-            mcMMO.p.getServer().broadcastMessage("Entity "+target.getName()+" has "+bleedList.get(target)+" ticks of bleed left");
+            //mcMMO.p.getServer().broadcastMessage("Entity "+target.getName()+" has "+bleedList.get(target)+" ticks of bleed left");
 
             if (bleedList.get(target) <= 0 || !target.isValid()) {
                 remove(target);
@@ -35,9 +35,6 @@ public class BleedTimerTask extends BukkitRunnable {
 
             double damage;
 
-            //Play Bleed Sound
-            SoundManager.worldSendSound(target.getWorld(), target.getLocation(), SoundType.BLEED);
-
             if (target instanceof Player) {
                 damage = AdvancedConfig.getInstance().getRuptureDamagePlayer();
 
@@ -61,7 +58,11 @@ public class BleedTimerTask extends BukkitRunnable {
                 MobHealthbarUtils.handleMobHealthbars(target, damage, mcMMO.p); //Update health bars
             }
 
+
             CombatUtils.dealNoInvulnerabilityTickDamage(target, damage, attackerMap.get(target));
+            //Play Bleed Sound
+            SoundManager.worldSendSound(target.getWorld(), target.getLocation(), SoundType.BLEED);
+
             ParticleEffectUtils.playBleedEffect(target);
             lowerBleedDurationTicks(target);
         }

+ 2 - 3
src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java

@@ -381,11 +381,10 @@ public final class CombatUtils {
             return;
         }
 
-        //target.damage(callFakeDamageEvent(attacker, target, cause, damage));
         double incDmg = callFakeDamageEvent(attacker, target, DamageCause.CUSTOM, damage);
 
-        if(incDmg > 0)
-            target.setHealth(incDmg);
+        double newHealth = Math.max(0, target.getHealth() - incDmg);
+        target.setHealth(newHealth);
     }
 
     /**