mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Fixing several issues related to Bleed/Rupture
Rupture now keeps track of who applied the damage and attributes it correctly in events Rupture's bleed timer task no longer caps at the low value of 10 ticks internally Ruptures bleed check code has had some minor refactoring
This commit is contained in:
parent
e5e86246f3
commit
3e5c4bc617
@ -35,9 +35,10 @@ Version 2.1.0
|
||||
+ (Events) Starting an XP event will now use the title API (toggle this in advanced.yml)
|
||||
+ (Sound) Volume and Pitch of sounds can now be configured in the new sounds.yml file
|
||||
+ (MySQL) Added support for SSL for MySQL/MariaDB (On by default)
|
||||
! (Skills) Taming's Gore now uses Bleed Rank 1 for its DoT
|
||||
! (Skills) Sword's Rupture now ticks four times as fast
|
||||
! (Skills) Taming's Gore now uses Rupture Rank 1 for its DoT
|
||||
! (Skills) Sword's Bleed has been renamed to Rupture
|
||||
! (Skills) Sword's Rupture now ticks four times as fast
|
||||
= (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%
|
||||
! (Skills) Sword's Rupture now deals 50% more damage at above Rank 3 and can last much longer! The base damage for Bleed has been increased as well (update your advanced.yml admins)
|
||||
|
@ -4,7 +4,6 @@ import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.skills.swords.Swords;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.TextComponentFactory;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
@ -43,7 +42,7 @@ public class SwordsCommand extends SkillCommand {
|
||||
|
||||
// SWORDS_RUPTURE
|
||||
if (canBleed) {
|
||||
bleedLength = UserManager.getPlayer(player).getSwordsManager().getBleedTicks();
|
||||
bleedLength = UserManager.getPlayer(player).getSwordsManager().getRuptureBleedTicks();
|
||||
|
||||
String[] bleedStrings = calculateAbilityDisplayValues(skillValue, SubSkillType.SWORDS_RUPTURE, isLucky);
|
||||
bleedChance = bleedStrings[0];
|
||||
@ -69,7 +68,7 @@ public class SwordsCommand extends SkillCommand {
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
int ruptureTicks = UserManager.getPlayer(player).getSwordsManager().getBleedTicks();
|
||||
int ruptureTicks = UserManager.getPlayer(player).getSwordsManager().getRuptureBleedTicks();
|
||||
double ruptureDamagePlayers = RankUtils.getRank(player, SubSkillType.SWORDS_RUPTURE) >= 3 ? AdvancedConfig.getInstance().getRuptureDamagePlayer() * 1.5D : AdvancedConfig.getInstance().getRuptureDamagePlayer();
|
||||
double ruptureDamageMobs = RankUtils.getRank(player, SubSkillType.SWORDS_RUPTURE) >= 3 ? AdvancedConfig.getInstance().getRuptureDamageMobs() * 1.5D : AdvancedConfig.getInstance().getRuptureDamageMobs();
|
||||
|
||||
|
@ -511,7 +511,7 @@ public class mcMMO extends JavaPlugin {
|
||||
// Cleanup the backups folder
|
||||
new CleanBackupsTask().runTaskAsynchronously(mcMMO.p);
|
||||
|
||||
// Bleed timer (Runs every two seconds)
|
||||
// Bleed timer (Runs every 0.5 seconds)
|
||||
new BleedTimerTask().runTaskTimer(this, 1 * Misc.TICK_CONVERSION_FACTOR, 1 * (Misc.TICK_CONVERSION_FACTOR / 2));
|
||||
|
||||
// Old & Powerless User remover
|
||||
|
@ -17,9 +17,10 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class BleedTimerTask extends BukkitRunnable {
|
||||
private final static int MAX_BLEED_TICKS = 10;
|
||||
private final static int MAX_BLEED_TICKS = 100; //The cap has been raised :)
|
||||
private static Map<LivingEntity, Integer> bleedList = new HashMap<LivingEntity, Integer>();
|
||||
private static Map<LivingEntity, Integer> bleedDamage = new HashMap<LivingEntity, Integer>();
|
||||
private static Map<LivingEntity, LivingEntity> attackerMap = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
@ -73,7 +74,8 @@ public class BleedTimerTask extends BukkitRunnable {
|
||||
bleedIterator.remove();
|
||||
}
|
||||
|
||||
CombatUtils.dealNoInvulnerabilityTickDamage(entity, damage, null);
|
||||
|
||||
CombatUtils.dealNoInvulnerabilityTickDamage(entity, damage, attackerMap.get(entity));
|
||||
ParticleEffectUtils.playBleedEffect(entity);
|
||||
}
|
||||
}
|
||||
@ -86,9 +88,10 @@ public class BleedTimerTask extends BukkitRunnable {
|
||||
*/
|
||||
public static void bleedOut(LivingEntity entity) {
|
||||
if (bleedList.containsKey(entity)) {
|
||||
CombatUtils.dealNoInvulnerabilityTickDamage(entity, bleedList.get(entity) * 2, null);
|
||||
CombatUtils.dealNoInvulnerabilityTickDamage(entity, bleedList.get(entity) * 2, attackerMap.get(entity));
|
||||
bleedList.remove(entity);
|
||||
bleedDamage.remove(entity);
|
||||
attackerMap.remove(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,6 +104,7 @@ public class BleedTimerTask extends BukkitRunnable {
|
||||
if (bleedList.containsKey(entity)) {
|
||||
bleedList.remove(entity);
|
||||
bleedDamage.remove(entity);
|
||||
attackerMap.remove(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,20 +114,21 @@ public class BleedTimerTask extends BukkitRunnable {
|
||||
* @param entity LivingEntity to add
|
||||
* @param ticks Number of bleeding ticks
|
||||
*/
|
||||
public static void add(LivingEntity entity, int ticks, int bleedRank) {
|
||||
public static void add(LivingEntity entity, LivingEntity attacker, int ticks, int bleedRank) {
|
||||
int newTicks = ticks;
|
||||
|
||||
if (bleedList.containsKey(entity)) {
|
||||
newTicks += bleedList.get(entity);
|
||||
bleedList.put(entity, Math.min(newTicks, MAX_BLEED_TICKS));
|
||||
bleedList.put(entity, Math.min(MAX_BLEED_TICKS, newTicks));
|
||||
|
||||
//Override the current bleed rank only if this one is higher
|
||||
if(bleedDamage.get(entity) < bleedRank)
|
||||
bleedDamage.put(entity, bleedRank);
|
||||
}
|
||||
else {
|
||||
bleedList.put(entity, Math.min(newTicks, MAX_BLEED_TICKS));
|
||||
bleedList.put(entity, Math.min(MAX_BLEED_TICKS, newTicks));
|
||||
bleedDamage.put(entity, bleedRank);
|
||||
attackerMap.put(entity, attacker);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,12 +61,7 @@ public class SwordsManager extends SkillManager {
|
||||
}
|
||||
}
|
||||
|
||||
if (getSkillLevel() >= AdvancedConfig.getInstance().getMaxBonusLevel(SubSkillType.SWORDS_RUPTURE)) {
|
||||
BleedTimerTask.add(target, getBleedTicks(), RankUtils.getRank(getPlayer(), SubSkillType.SWORDS_RUPTURE));
|
||||
}
|
||||
else {
|
||||
BleedTimerTask.add(target, getBleedTicks(), RankUtils.getRank(getPlayer(), SubSkillType.SWORDS_RUPTURE));
|
||||
}
|
||||
BleedTimerTask.add(target, getRuptureBleedTicks(), RankUtils.getRank(getPlayer(), SubSkillType.SWORDS_RUPTURE));
|
||||
|
||||
if (mcMMOPlayer.useChatNotifications()) {
|
||||
NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Bleeding");
|
||||
@ -74,7 +69,7 @@ public class SwordsManager extends SkillManager {
|
||||
}
|
||||
}
|
||||
|
||||
public int getBleedTicks()
|
||||
public int getRuptureBleedTicks()
|
||||
{
|
||||
int bleedTicks = 2 * RankUtils.getRank(getPlayer(), SubSkillType.SWORDS_RUPTURE);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user