From f189907ff8f22d9e3aa937544ca85215e76e3e2c Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 19 Feb 2013 13:02:08 -0500 Subject: [PATCH] Added visual effects for ability enabling. Also readded chat messages for people who have particle effects disabled. --- .../gmail/nossr50/skills/archery/DazeEventHandler.java | 1 + .../gmail/nossr50/skills/swords/BleedEventHandler.java | 4 ++++ .../com/gmail/nossr50/skills/utilities/SkillTools.java | 10 ++++++++-- src/main/resources/locale/locale_en_US.properties | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/archery/DazeEventHandler.java b/src/main/java/com/gmail/nossr50/skills/archery/DazeEventHandler.java index 274cc23a6..72f554890 100644 --- a/src/main/java/com/gmail/nossr50/skills/archery/DazeEventHandler.java +++ b/src/main/java/com/gmail/nossr50/skills/archery/DazeEventHandler.java @@ -48,6 +48,7 @@ public class DazeEventHandler { } protected void sendAbilityMessages() { + defender.sendMessage(LocaleLoader.getString("Combat.TouchedFuzzy")); manager.getMcMMOPlayer().getPlayer().sendMessage(LocaleLoader.getString("Combat.TargetDazed")); } } diff --git a/src/main/java/com/gmail/nossr50/skills/swords/BleedEventHandler.java b/src/main/java/com/gmail/nossr50/skills/swords/BleedEventHandler.java index 427852577..332e98b8d 100644 --- a/src/main/java/com/gmail/nossr50/skills/swords/BleedEventHandler.java +++ b/src/main/java/com/gmail/nossr50/skills/swords/BleedEventHandler.java @@ -8,11 +8,13 @@ import com.gmail.nossr50.skills.runnables.BleedTimer; import com.gmail.nossr50.skills.utilities.SkillTools; public class BleedEventHandler { + private SwordsManager manager; private int skillLevel; private LivingEntity defender; protected int skillModifier; protected BleedEventHandler(SwordsManager manager, LivingEntity defender) { + this.manager = manager; this.skillLevel = manager.getSkillLevel(); this.defender = defender; @@ -37,6 +39,8 @@ public class BleedEventHandler { } protected void sendAbilityMessages() { + manager.getMcMMOPlayer().getPlayer().sendMessage(LocaleLoader.getString("Swords.Combat.Bleeding")); + if (defender instanceof Player) { ((Player) defender).sendMessage(LocaleLoader.getString("Swords.Combat.Bleeding.Started")); } diff --git a/src/main/java/com/gmail/nossr50/skills/utilities/SkillTools.java b/src/main/java/com/gmail/nossr50/skills/utilities/SkillTools.java index 56d8288a7..a41205bcc 100644 --- a/src/main/java/com/gmail/nossr50/skills/utilities/SkillTools.java +++ b/src/main/java/com/gmail/nossr50/skills/utilities/SkillTools.java @@ -3,6 +3,7 @@ package com.gmail.nossr50.skills.utilities; import java.util.ArrayList; import java.util.List; +import org.bukkit.Effect; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.enchantments.Enchantment; @@ -12,8 +13,10 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.plugin.PluginManager; +import org.bukkit.potion.Potion; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +import org.bukkit.potion.PotionType; import org.getspout.spoutapi.SpoutManager; import org.getspout.spoutapi.player.SpoutPlayer; @@ -196,6 +199,7 @@ public class SkillTools { profile.setAbilityMode(ability, false); profile.setAbilityInformed(ability, false); + player.playEffect(player.getEyeLocation(), Effect.POTION_BREAK, new Potion(PotionType.STRENGTH)); player.sendMessage(ability.getAbilityOff()); sendSkillMessage(player, ability.getAbilityPlayerOff(player)); @@ -385,11 +389,13 @@ public class SkillTools { } if (!profile.getAbilityMode(ability) && cooldownOver(profile.getSkillDATS(ability), ability.getCooldown(), player)) { - player.sendMessage(ability.getAbilityOn()); + int ticks = PerksUtils.handleActivationPerks(player, 2 + (profile.getSkillLevel(type) / abilityLengthIncreaseLevel), ability.getMaxTicks()); + player.playEffect(player.getEyeLocation(), Effect.POTION_BREAK, new Potion(PotionType.POISON)); + player.sendMessage(ability.getAbilityOn()); SkillTools.sendSkillMessage(player, ability.getAbilityPlayer(player)); - profile.setSkillDATS(ability, System.currentTimeMillis() + (PerksUtils.handleActivationPerks(player, 2 + (profile.getSkillLevel(type) / abilityLengthIncreaseLevel), ability.getMaxTicks()) * Misc.TIME_CONVERSION_FACTOR)); + profile.setSkillDATS(ability, System.currentTimeMillis() + (ticks * Misc.TIME_CONVERSION_FACTOR)); profile.setAbilityMode(ability, true); if (ability == AbilityType.BERSERK) { diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index 0d5d21c9a..e8430c3e6 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -254,6 +254,7 @@ Swords.Combat.Bleed.Length=[[RED]]Bleed Length: [[YELLOW]]{0} ticks Swords.Combat.Bleed.Note=[[GRAY]]NOTE: [[YELLOW]]1 Tick happens every 2 seconds Swords.Combat.Bleeding.Started=[[DARK_RED]] You're bleeding! Swords.Combat.Bleeding.Stopped=[[GRAY]]The bleeding has [[GREEN]]stopped[[GRAY]]! +Swords.Combat.Bleeding=[[GREEN]]**ENEMY BLEEDING** Swords.Combat.Counter.Chance=[[RED]]Counter Attack Chance: [[YELLOW]]{0} Swords.Combat.Counter.Hit=[[DARK_RED]]Hit with a counter-attack! Swords.Combat.Countered=[[GREEN]]**COUNTER-ATTACKED**