@ -1,8 +1,24 @@
package sig.plugin.TwosideKeeper.HelperStructures ;
import java.text.DecimalFormat ;
import java.util.ArrayList ;
import java.util.HashMap ;
import java.util.List ;
import org.apache.commons.lang.WordUtils ;
import org.bukkit.ChatColor ;
import org.bukkit.enchantments.Enchantment ;
import org.bukkit.entity.Player ;
import org.bukkit.inventory.ItemStack ;
import org.bukkit.inventory.meta.ItemMeta ;
import net.md_5.bungee.api.chat.ClickEvent ;
import net.md_5.bungee.api.chat.ComponentBuilder ;
import net.md_5.bungee.api.chat.HoverEvent ;
import net.md_5.bungee.api.chat.TextComponent ;
import sig.plugin.TwosideKeeper.AwakenedArtifact ;
import sig.plugin.TwosideKeeper.TwosideKeeper ;
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions ;
public enum ArtifactAbility {
//Enum Structure:
@ -10,59 +26,422 @@ public enum ArtifactAbility {
//Temporary abilities: Work for 1 level and wear off afterward.
//Weapon Abilities
DAMAGE ( "Strike" , "Improves Base Damage by [VAL]" , 1 . 0 , 1 . 0 , 100 ) ,
ARMOR_PEN ( "Piercing" , "[VAL]% of your damage is ignored by resistances. ([PENDMG] damage)" , 1 . 0 , 1 . 0 , 100 , 1 ) ,
EXECUTION ( "Execute" , "Deals [VAL] extra damage for every 20% of target's missing health." , 2 . 0 , 1 . 0 , 100 , 1 ) ,
LIFESTEAL ( "Lifesteal" , "Heals [VAL]% of the damage dealt to targets back to your health pool." , 1 . 0 , 1 . 0 , 100 , 1 ) ,
DAMAGE ( "Strike" , "Improves Base Damage by [VAL]" , new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 1 ) ,
ARMOR_PEN ( "Piercing" , "[VAL]% of your damage is ignored by resistances. ([PENDMG] damage)" , new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 1 ) ,
EXECUTION ( "Execute" , "Deals [VAL] extra damage for every 20% of target's missing health." , new double [ ] { 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 1 ) ,
LIFESTEAL ( "Lifesteal" , "Heals [VAL]% of the damage dealt to targets back to your health pool." , new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 1 ) ,
CRITICAL ( "Critical" , "[VAL]% chance to deal double damage." , new double [ ] { 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 1 ) ,
CRIT_DMG ( "Crit Damage" , "Critical Strikes deal [VAL]% damage." , new double [ ] { 210 . 0 , 210 . 0 , 210 . 0 , 210 . 0 , 210 . 0 , 210 . 0 , 210 . 0 , 210 . 0 , 210 . 0 , 210 . 0 } ,
new double [ ] { 5 . 0 , 5 . 0 , 5 . 0 , 5 . 0 , 5 . 0 , 5 . 0 , 5 . 0 , 5 . 0 , 5 . 0 , 5 . 0 } , 100 , 1 ) ,
PROVOKE ( "Provoke" , "Your attacks provoke enemies for [VAL] seconds." , new double [ ] { 3 . 0 , 3 . 0 , 3 . 0 , 3 . 0 , 3 . 0 , 3 . 0 , 3 . 0 , 3 . 0 , 3 . 0 , 3 . 0 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 10 ) ,
HIGHWINDER ( "Highwinder" , "While moving, you deal [VAL] extra damage for every 1m of speed." , new double [ ] { 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 } ,
new double [ ] { 0 . 7 , 0 . 7 , 0 . 7 , 0 . 7 , 0 . 7 , 0 . 7 , 0 . 7 , 0 . 7 , 0 . 7 , 0 . 7 } , 100 , 15 ) ,
COMBO ( "Belligerent" , "[VAL]% more damage for each successive strike on a mob. Resets on a failed swing or after 5 seconds of no combat." , new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 30 ) ,
//Bow Abilities
MARKSMAN ( "Marksman" , "Increases headshot hitbox size by [VAL]% ." , new double [ ] { 8 . 0 , 8 . 0 , 8 . 0 , 8 . 0 , 8 . 0 , 8 . 0 , 8 . 0 , 8 . 0 , 8 . 0 , 8 . 0 } ,
new double [ ] { 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 } , 100 , 1 ) ,
SIEGESTANCE ( "Siege Stance" , "Activate by Sneaking for three seconds. Sneak again to de-activate.\n\n"
+ "Applies Slowness V and Resistance VI. While in Siege Stance you fire clusters of 7 arrows per shot. Each arrow deals [VAL] damage." , new double [ ] { 3 . 0 , 3 . 0 , 3 . 0 , 3 . 0 , 3 . 0 , 3 . 0 , 3 . 0 , 3 . 0 , 3 . 0 , 3 . 0 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 20 ) ,
ARROWSHOWER ( "Arrow Shower" , "Shift-Left Click to activate. Applies Slowness X for three seconds while firing arrows into the sky and onto enemies in a large area in front of you. Each arrow deals [VAL] damage." , new double [ ] { 0 . 7 , 0 . 7 , 0 . 7 , 0 . 7 , 0 . 7 , 0 . 7 , 0 . 7 , 0 . 7 , 0 . 7 , 0 . 7 } ,
new double [ ] { 0 . 4 , 0 . 4 , 0 . 4 , 0 . 4 , 0 . 4 , 0 . 4 , 0 . 4 , 0 . 4 , 0 . 4 , 0 . 4 } , 100 , 40 ) ,
TARGETING ( "Targeting" , "Left-click a mob to target them. Fire arrows to release homing missiles at your target. Each missile explodes and deals [VAL] damage." , new double [ ] { 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 } ,
new double [ ] { 0 . 3 , 0 . 3 , 0 . 3 , 0 . 3 , 0 . 3 , 0 . 3 , 0 . 3 , 0 . 3 , 0 . 3 , 0 . 3 } , 100 , 75 ) ,
ENDERTURRET ( "Ender Turret" , "Place Eyes of Ender in your hotbar to use as ammo. Each eye fired launches forward and upward before releasing a barrage of homing missiles that lock onto enemy targets. Each missile explodes and deals [VAL] damage." , new double [ ] { 25 , 25 , 25 , 25 , 25 , 25 , 25 , 25 , 25 , 25 } ,
new double [ ] { 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 } , 100 , 100 ) ,
//Armor abilities
DAMAGE_REDUCTION ( "Defense" , "Increases Base Damage reduction by [VAL]%" , 1 . 0 , 2 . 0 , 100 , 1 ) ,
HEALTH ( "Health" , "Increases Maximum Health by [VAL]." , 1 . 0 , 1 . 0 , 100 , 1 ) ,
HEALTH_REGEN ( "Regeneration" , "Regenerates an extra [VAL] health every 5 seconds." , 0 . 5 , 1 . 0 , 100 , 1 ) ,
STATUS_EFFECT_RESISTANCE ( "Resistance" , "When a debuff is applied" , 0 . 5 , 1 . 0 , 100 , 1 ) ,
SURVIVOR ( "Survivor" , "Taking fatal damage will not kill you and instead consume this ability, removes all debuffs, and leaving you with 1 HP." , - 1 , 0 , 1 , 10 ) ,
DAMAGE_REDUCTION ( "Defense" , "Increases Base Damage reduction by [VAL]%" , new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } ,
new double [ ] { 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 } , 100 , 1 ) ,
HEALTH ( "Health" , "Increases Maximum Health by [VAL]." , new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 1 ) ,
HEALTH_REGEN ( "Regeneration" , "Regenerates an extra [VAL] health every 5 seconds." , new double [ ] { 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 , 0 . 5 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 1 ) ,
STATUS_EFFECT_RESISTANCE ( "Resistance" , "When a debuff is applied, there is a [VAL]% chance to remove it." , new double [ ] { 20 , 20 , 20 , 20 , 20 , 20 , 20 , 20 , 20 , 20 } ,
new double [ ] { 4 . 0 , 4 . 0 , 4 . 0 , 4 . 0 , 4 . 0 , 4 . 0 , 4 . 0 , 4 . 0 , 4 . 0 , 4 . 0 } , 100 , 1 ) ,
SHADOWWALKER ( "Shadow Walker" , "Increases your speed in dark areas. Damage Reduction increases by [VAL]% in dark areas. Dodge chance increases by [DODGEVAL]% in dark areas." , new double [ ] { 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 } ,
new double [ ] { 1 . 5 , 1 . 5 , 1 . 5 , 1 . 5 , 1 . 5 , 1 . 5 , 1 . 5 , 1 . 5 , 1 . 5 , 1 . 5 } , 100 , 5 ) ,
SURVIVOR ( "Survivor" , "Taking fatal damage will not kill you and instead consume this ability, removes all debuffs, and leaving you with 1 HP." , new double [ ] { - 1 . 0 , - 1 . 0 , - 1 . 0 , - 1 . 0 , - 1 . 0 , - 1 . 0 , - 1 . 0 , - 1 . 0 , - 1 . 0 , - 1 . 0 } ,
new double [ ] { 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 } , 1 , 10 ) ,
DODGE ( "Dodge" , "You have a [VAL]% chance to dodge incoming damage from any damage source." , new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } ,
new double [ ] { 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 } , 100 , 20 ) ,
GRACEFULDODGE ( "Graceful Dodge" , "You have a [VAL]% chance to dodge incoming damage from attacks that deal [FATALDMG] or more damage." , new double [ ] { 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 } ,
new double [ ] { 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 } , 100 , 45 ) ,
//Pickaxe abilities
SCAVENGE ( "Scavenge" , "Breaks off resources from armor. [VAL]% chance per hit." , new double [ ] { 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 20 ) ,
//Shovel abilities
SUPPRESS ( "Suppression" , "Suppresses a mob on hit for [VAL] seconds.\n\n"
+ "Suppression prevents movement, attacking, and teleportation." , new double [ ] { 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 10 ) ,
//Axe abilities
BREAKDOWN ( "Break Down" , "Breaks down armor on mobs. Each hit has a [VAL]% chance to remove a piece of armor from a mob." , new double [ ] { 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 1 ) ,
BUTCHERY ( "Butchery" , "Broken down armor have a [VAL]% chance to drop onto the ground." , new double [ ] { 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 } ,
new double [ ] { 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 , 0 . 8 } , 100 , 5 ) ,
//Scythe abilities
DEATHMARK ( "Death Mark" , "Applies a Death Mark stack to a target. Death marks last for 5 seconds, and refresh on each hit.\n\nMarks can be detonated at any time by right-clicking. Each death mark stack applied deals [VAL] damage." , new double [ ] { 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 } ,
new double [ ] { 0 . 6 , 0 . 6 , 0 . 6 , 0 . 6 , 0 . 6 , 0 . 6 , 0 . 6 , 0 . 6 , 0 . 6 , 0 . 6 } , 100 , 10 ) ,
AOE ( "Area of Effect" , "Deals damage to targets up to [VAL]m from the main target hit." , new double [ ] { 0 . 2 , 0 . 2 , 0 . 2 , 0 . 2 , 0 . 2 , 0 . 2 , 0 . 2 , 0 . 2 , 0 . 2 , 0 . 2 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 1 ) ,
//General abilities
GREED ( "Greed" , "Increases Drop rate by [VAL]% . Health is halved, health regeneration is halved, and damage reduction is halved. Consumes one level of Greed per level up." , new double [ ] { 50 , 50 , 50 , 50 , 50 , 50 , 50 , 50 , 50 , 50 } ,
new double [ ] { 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 } , 100 , 10 ) ,
GROWTH ( "Growth" , "Increases artifact EXP gained by [VAL]% . Health is halved, health regeneration is halved, and damage reduction is halved. Consumes one level of Growth per level up." , new double [ ] { 100 , 100 , 100 , 100 , 100 , 100 , 100 , 100 , 100 , 100 } ,
new double [ ] { 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 , 2 . 0 } , 100 , 10 ) ,
REMOVE_CURSE ( "Remove Curse" , "Removes a level of a curse from the Artifact." , new double [ ] { - 1 . 0 , - 1 . 0 , - 1 . 0 , - 1 . 0 , - 1 . 0 , - 1 . 0 , - 1 . 0 , - 1 . 0 , - 1 . 0 , - 1 . 0 } ,
new double [ ] { 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 } , 1 , 1 ) ,
PRESERVATION ( "Preservation" , "Potential decays [VAL]% slower." , new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } ,
new double [ ] { 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 } , 1 , 20 ) ,
EXP_MULT ( "Mega XP" , "Increases experience dropped from monsters by [VAL]% ." , new double [ ] { 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 20 ) ,
//Bad stuff
REDUCEDMG ( "Weakness" , "[VAL]% Decrease in Base Damage." , new double [ ] { 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 3 ) ,
REDUCEDEF ( "Imperil" , "[VAL]% Decrease in Damage Reduction" , new double [ ] { 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 5 ) ,
LIFE_REDUCTION ( "Health Cut" , "[VAL]% decrease in maximum health." , new double [ ] { 30 , 30 , 30 , 30 , 30 , 30 , 30 , 30 , 30 , 30 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 5 ) ,
LOWER_DEFENSE ( "Debilitate" , "[VAL]% decrease in damage reduction." , new double [ ] { 30 , 30 , 30 , 30 , 30 , 30 , 30 , 30 , 30 , 30 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 5 ) ,
TELEPORT ( "Teleport" , "[VAL]% chance to teleport the player to a random location on artifact experience gain." , new double [ ] { 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 10 ) ,
DRAINING ( "Draining" , "[VAL]% chance to remove a level of experience on artifact experience gain." , new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 10 ) ,
NOREGEN ( "Weary" , "No health regenerates." , new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 15 ) ,
STARVATION ( "Starvation" , "[VAL]% chance to cause [HUNGERVAL] seconds of Hunger on experience gain." , new double [ ] { 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 } ,
new double [ ] { 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 , 0 . 1 } , 100 , 15 ) ,
BURN ( "Flammable" , "All burn damage deals x[VAL] damage." , new double [ ] { 4 . 0 , 4 . 0 , 4 . 0 , 4 . 0 , 4 . 0 , 4 . 0 , 4 . 0 , 4 . 0 , 4 . 0 , 4 . 0 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 100 , 25 ) ,
FROZEN ( "Frozen" , "Player will be inflicted with increasing levels of slowness and fatigue until finally frozen and killed." , new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 1 , 45 ) ,
PETRIFICATION ( "Petrification" , "Player will be inflicted with increasing levels of slowness and fatigue until finally petrified and killed." , new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } ,
new double [ ] { 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 } , 1 , 45 ) ,
;
static int LINE_SIZE = 50 ;
String name ;
String desc ;
double baseval ;
double decayval ;
double [ ] baseval ;
double [ ] decayval ;
int maxlv ;
int requirement ;
ArtifactAbility ( String name , String desc , double baseval , double decayval , int maxlv ) {
ArtifactAbility ( String name , String desc , double [ ] baseval , double [ ] decayval , int maxlv , int requirement ) {
this . name = name ;
this . desc = desc ;
this . baseval = baseval ;
this . decayval = decayval ;
this . maxlv = maxlv ;
this . requirement = requirement ;
AwakenedArtifact . ability_map . put ( this , this . name ) ;
AwakenedArtifact . name_map . put ( this . name , this ) ;
}
public String GetName ( ) {
return this . name ;
}
public String GetDescription ( ) {
return this . desc ;
}
public double GetBaseValue ( int tier ) {
return this . baseval [ tier - 1 ] ;
}
public double calculateValue ( int lv ) {
public double GetDecayValue ( int tier ) {
return this . decayval [ tier - 1 ] ;
}
public int GetMaxLevel ( ) {
return maxlv ;
}
public int GetMinLevel ( ) {
return requirement ;
}
public static double calculateValue ( ArtifactAbility ability , int artifacttier , int abilitylevel ) {
double sum = 0 ;
for ( int i = 0 ; i < lv ; i + + ) {
sum + = 1 / ( 1 + this . decayval * i ) ;
if ( artifacttier < = 0 ) { artifacttier = 1 ; }
TwosideKeeper . log ( "Ability " + ability . GetName ( ) , 4 ) ;
for ( int i = 0 ; i < abilitylevel ; i + + ) {
TwosideKeeper . log ( "Old Sum:" + sum + "::i:" + i , 5 ) ;
sum + = 1 / ( 1 + ( ability . GetDecayValue ( artifacttier ) * i ) ) ;
TwosideKeeper . log ( "New Sum:" + sum + "::i:" + i , 5 ) ;
}
TwosideKeeper . log ( "Sum is " + sum , 5 ) ;
TwosideKeeper . log ( "Base value is " + ability . GetBaseValue ( artifacttier ) , 4 ) ;
return sum * ability . GetBaseValue ( artifacttier ) ;
}
static HashMap < ArtifactAbility , Integer > getEnchantments ( ItemStack item ) {
HashMap < ArtifactAbility , Integer > abilities = new HashMap < ArtifactAbility , Integer > ( ) ;
if ( GenericFunctions . isArtifactEquip ( item ) ) {
List < String > lore = item . getItemMeta ( ) . getLore ( ) ;
//From Element 7 and onwards, we know these are abilities added to the item. Retrieve them.
for ( int i = 7 ; i < lore . size ( ) ; i + + ) {
String [ ] splitstring = lore . get ( i ) . split ( " " ) ;
TwosideKeeper . log ( splitstring . length + "" , 5 ) ;
String newstring = "" ;
TwosideKeeper . log ( lore . get ( i ) , 5 ) ;
for ( int j = 1 ; j < splitstring . length - 1 ; j + + ) {
if ( newstring . equalsIgnoreCase ( "" ) ) {
newstring + = splitstring [ j ] ;
} else {
newstring + = " " + splitstring [ j ] ;
}
}
TwosideKeeper . log ( newstring , 5 ) ;
//This is the name of the enchantment. Now connect it with the name map we made.
abilities . put ( AwakenedArtifact . name_map . get ( ChatColor . stripColor ( newstring ) ) , Integer . parseInt ( splitstring [ splitstring . length - 1 ] ) ) ;
}
}
return sum * this . baseval ;
return abilities ;
}
public String displayDescription ( int lv , double playerdmgval ) { //Level to display information for.
String msg = this . desc ;
public static int getEnchantmentLevel ( ArtifactAbility ability , ItemStack item ) {
//Get the enchantment level of a particular enchantment.
HashMap enchants = getEnchantments ( item ) ;
if ( enchants . containsKey ( ability ) ) {
return ( int ) enchants . get ( ability ) ;
} else {
return 0 ;
}
}
static ItemStack applyEnchantment ( ArtifactAbility ability , int lv , ItemStack item ) {
ItemMeta m = item . getItemMeta ( ) ;
List < String > lore = m . getLore ( ) ;
if ( containsEnchantment ( ability , item ) ) {
//We just need to find the line and upgrade it then.
for ( int i = 0 ; i < lore . size ( ) ; i + + ) {
if ( lore . get ( i ) . contains ( ability . GetName ( ) ) ) {
//This is the line! Modify it.
lore . set ( i , ChatColor . YELLOW + " " + ability . GetName ( ) + " " + ( lv ) ) ;
break ;
}
}
m . setLore ( lore ) ;
item . setItemMeta ( m ) ;
return item ;
} else {
//Otherwise we are just appending it.
lore . add ( ChatColor . YELLOW + " " + ability . GetName ( ) + " " + lv ) ;
m . setLore ( lore ) ;
item . setItemMeta ( m ) ;
return item ;
}
}
static boolean hasCurse ( ItemStack item ) {
HashMap < ArtifactAbility , Integer > map = getEnchantments ( item ) ;
if ( map . containsKey ( REDUCEDMG ) | |
map . containsKey ( REDUCEDEF ) | |
map . containsKey ( LIFE_REDUCTION ) | |
map . containsKey ( LOWER_DEFENSE ) | |
map . containsKey ( TELEPORT ) | |
map . containsKey ( DRAINING ) | |
map . containsKey ( NOREGEN ) | |
map . containsKey ( STARVATION ) | |
map . containsKey ( BURN ) | |
map . containsKey ( FROZEN ) | |
map . containsKey ( PETRIFICATION ) ) {
return true ;
} else {
return false ;
}
}
static boolean containsEnchantment ( ArtifactAbility ability , ItemStack item ) {
return getEnchantments ( item ) . containsKey ( ability ) ;
}
public static ItemStack upgradeEnchantment ( Player p , ItemStack item , ArtifactAbility ability ) {
//Verifies that the enchantment can be upgraded firstly.
//Get the level we are upgrading to.
int level = getEnchantmentLevel ( ability , item ) ;
if ( AwakenedArtifact . getAP ( item ) > 0 ) {
if ( ability . GetMaxLevel ( ) > level & & ability . GetMinLevel ( ) < = AwakenedArtifact . getLV ( item ) ) {
//This is allowed. Proceed.
item = applyEnchantment ( ability , level + 1 , item ) ;
AwakenedArtifact . addAP ( item , - 1 ) ;
p . sendMessage ( ChatColor . AQUA + "Successfully applied " + ChatColor . BLUE + ability . GetName ( ) + " " + ( level + 1 ) + ChatColor . AQUA + " to your artifact!" ) ;
int apamt = AwakenedArtifact . getAP ( item ) ;
if ( apamt > 0 ) {
TextComponent tc = new TextComponent ( " You have " + ChatColor . GREEN + apamt + ChatColor . WHITE + " ability point" + ( ( apamt = = 1 ) ? "" : "s" ) + " remaining! Click " ) ;
TextComponent ac = new TextComponent ( ChatColor . GREEN + "[HERE]" + ChatColor . WHITE ) ;
ac . setHoverEvent ( new HoverEvent ( HoverEvent . Action . SHOW_TEXT , new ComponentBuilder ( ChatColor . ITALIC + "Click to add another skill point!" ) . create ( ) ) ) ;
ac . setClickEvent ( new ClickEvent ( ClickEvent . Action . RUN_COMMAND , "/awakenedartifact" ) ) ;
tc . addExtra ( ac ) ;
tc . addExtra ( " to open up the ability upgrade menu." ) ;
p . spigot ( ) . sendMessage ( tc ) ;
}
} else {
if ( ability . GetMaxLevel ( ) < = level ) {
p . sendMessage ( ChatColor . RED + "This ability cannot be upgraded any further!" ) ;
} else {
p . sendMessage ( ChatColor . RED + "You need to reach level " + ability . GetMinLevel ( ) + " on your artifact item first!" ) ;
}
}
} else {
p . sendMessage ( ChatColor . RED + "Insufficient AP to level up this upgrade! Earn more AP first!" ) ;
}
return item ;
}
public static TextComponent DisplayAbility ( ArtifactAbility ability , double playerdmgval , ItemStack targetitem , int slot ) {
boolean unlocked = true ;
String lockedreason = "" ;
if ( AwakenedArtifact . getLV ( targetitem ) < ability . GetMinLevel ( ) | | getEnchantmentLevel ( ability , targetitem ) > = ability . GetMaxLevel ( ) ) {
unlocked = false ;
if ( AwakenedArtifact . getLV ( targetitem ) < ability . GetMinLevel ( ) ) {
lockedreason = ChatColor . GRAY + "" + ChatColor . ITALIC + "Your Artifact needs to reach Level " + ability . GetMinLevel ( ) + " to obtain this ability." ;
} else if ( getEnchantmentLevel ( ability , targetitem ) > = ability . GetMaxLevel ( ) ) {
lockedreason = ChatColor . GRAY + "" + ChatColor . ITALIC + "Your Artifact has reached the maximum level for this ability!" ;
}
}
int enchantlevel = 0 ;
if ( containsEnchantment ( ability , targetitem ) ) {
enchantlevel = getEnchantmentLevel ( ability , targetitem ) ;
}
String displaystring = "" ;
if ( enchantlevel > 0 ) {
displaystring = displayDescriptionUpgrade ( ability , targetitem . getEnchantmentLevel ( Enchantment . LUCK ) , enchantlevel , enchantlevel + 1 , playerdmgval ) ;
} else {
displaystring = displayDescription ( ability , targetitem . getEnchantmentLevel ( Enchantment . LUCK ) , enchantlevel + 1 , playerdmgval ) ;
}
TextComponent tc = new TextComponent ( ( ( unlocked ) ? ChatColor . GREEN : ChatColor . RED ) + "[" + ability . GetName ( ) + " " + ( enchantlevel + 1 ) + "] " ) ;
tc . setHoverEvent ( new HoverEvent ( HoverEvent . Action . SHOW_TEXT , new ComponentBuilder ( WordUtils . wrap ( ChatColor . BLUE + ability . GetName ( ) + "\n\n" + displaystring + ( ( lockedreason . equalsIgnoreCase ( "" ) ) ? "" : "\n\n" ) , LINE_SIZE , "\n" , true ) + WordUtils . wrap ( lockedreason , LINE_SIZE , "\n" + net . md_5 . bungee . api . ChatColor . GRAY , true ) ) . create ( ) ) ) ;
if ( slot ! = 0 ) {
//Apply the enchantment to the proper item slot.
tc . setClickEvent ( new ClickEvent ( ClickEvent . Action . RUN_COMMAND , "/awakenedartifact levelup " + ability . name ( ) + " " + slot ) ) ;
} else {
tc . setClickEvent ( new ClickEvent ( ClickEvent . Action . RUN_COMMAND , "/awakenedartifact levelup " + ability . name ( ) ) ) ;
}
if ( getEnchantmentLevel ( ability , targetitem ) < ability . GetMaxLevel ( ) ) {
return tc ;
} else {
return new TextComponent ( "" ) ; //We don't want to display enchantments that are capped in the menu.
}
}
public static TextComponent GenerateMenu ( UpgradePath path , double playerdmgval , ItemStack targetitem ) {
return GenerateMenu ( path , playerdmgval , targetitem , 0 ) ;
}
public static TextComponent GenerateMenu ( UpgradePath path , double playerdmgval , ItemStack targetitem , int slot ) {
TextComponent msg1 = new TextComponent ( "Choose an ability to upgrade " + ( ( targetitem . hasItemMeta ( ) & & targetitem . getItemMeta ( ) . hasDisplayName ( ) ) ? targetitem . getItemMeta ( ) . getDisplayName ( ) : GenericFunctions . UserFriendlyMaterialName ( targetitem ) ) + ChatColor . RESET + ":\n\n" ) ;
int i = 0 ;
TextComponent text = new TextComponent ( "" ) ;
switch ( path ) {
//Populate menu lists.
case ARMOR :
text = DisplayAbility ( DAMAGE_REDUCTION , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( HEALTH , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( HEALTH_REGEN , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( STATUS_EFFECT_RESISTANCE , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( SHADOWWALKER , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( SURVIVOR , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( DODGE , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( GRACEFULDODGE , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
break ;
case BOW :
text = DisplayAbility ( DAMAGE , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( ARMOR_PEN , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( EXECUTION , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( MARKSMAN , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( CRITICAL , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( CRIT_DMG , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( SIEGESTANCE , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( ARROWSHOWER , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( TARGETING , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( ENDERTURRET , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
break ;
case TOOL :
text = DisplayAbility ( DAMAGE , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( ARMOR_PEN , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( EXECUTION , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( LIFESTEAL , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( CRITICAL , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( CRIT_DMG , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
if ( targetitem . getType ( ) . toString ( ) . contains ( "PICKAXE" ) ) {
text = DisplayAbility ( SCAVENGE , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
} else if ( targetitem . getType ( ) . toString ( ) . contains ( "SPADE" ) ) {
text = DisplayAbility ( SUPPRESS , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
} else if ( targetitem . getType ( ) . toString ( ) . contains ( "AXE" ) ) {
text = DisplayAbility ( BREAKDOWN , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( BUTCHERY , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
} else if ( targetitem . getType ( ) . toString ( ) . contains ( "HOE" ) ) {
text = DisplayAbility ( DEATHMARK , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( AOE , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
}
break ;
case WEAPON :
text = DisplayAbility ( DAMAGE , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( ARMOR_PEN , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( EXECUTION , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( LIFESTEAL , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( CRITICAL , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( CRIT_DMG , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( PROVOKE , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( HIGHWINDER , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( COMBO , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
break ;
}
text = DisplayAbility ( GREED , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( GROWTH , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( REMOVE_CURSE , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( PRESERVATION , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
text = DisplayAbility ( EXP_MULT , playerdmgval , targetitem , slot ) ; msg1 . addExtra ( text ) ; if ( ! text . getText ( ) . equalsIgnoreCase ( "" ) ) { + + i ; } if ( i % 4 = = 0 ) { msg1 . addExtra ( "\n" ) ; }
return msg1 ;
}
public static String displayDescription ( ArtifactAbility ability , int tier , int abilitylv , double playerdmgval ) { //Level to display information for.
String msg = ability . GetDescription ( ) ;
DecimalFormat df = new DecimalFormat ( "0.00" ) ;
msg . replace ( "[VAL]" , df . format ( calculateValue ( lv ) ) ) ;
msg . replace ( "[PENDMG]" , df . format ( calculateValue ( lv ) / 100 * playerdmgval ) ) ; //Based on multiplying [VAL] by the base damage value.
msg = msg . replace ( "[VAL]" , df . format ( calculateValue ( ability , tier , abilitylv ) ) ) ;
msg = msg . replace ( "[PENDMG]" , df . format ( calculateValue ( ability , tier , abilitylv ) / 100 * playerdmgval ) ) ; //Based on multiplying [VAL] by the base damage value.
msg = msg . replace ( "[HUNGERVAL]" , df . format ( 10 * abilitylv ) ) ;
msg = msg . replace ( "[FATALDMG]" , df . format ( 120 * abilitylv ) ) ;
return msg ;
}
public String displayDescriptionUpgrade ( int fromlv , int tolv , double playerdmgval ) { //Level to display information for.
String msg = this . desc ;
public static String displayDescriptionUpgrade ( ArtifactAbility ability , int tier , int fromlv , int tolv , double playerdmgval ) { //Level to display information for.
String msg = ability . GetDescription ( ) ;
DecimalFormat df = new DecimalFormat ( "0.00" ) ;
msg . replace ( "[VAL]" , DisplayChangedValue ( df . format ( calculateValue ( fromlv ) ) , df . format ( calculateValue ( tolv ) ) ) ) ;
msg . replace ( "[PENDMG]" , DisplayChangedValue ( df . format ( calculateValue ( fromlv ) / 100 * playerdmgval ) , df . format ( calculateValue ( tolv ) / 100 * playerdmgval ) ) ) ; //Based on multiplying [VAL] by the base damage value.
msg = msg . replace ( "[VAL]" , DisplayChangedValue ( df . format ( calculateValue ( ability , tier , fromlv ) ) , df . format ( calculateValue ( ability , tier , tolv ) ) ) ) ;
msg = msg . replace ( "[PENDMG]" , DisplayChangedValue ( df . format ( calculateValue ( ability , tier , fromlv ) / 100 * playerdmgval ) , df . format ( calculateValue ( ability , tier , tolv ) / 100 * playerdmgval ) ) ) ; //Based on multiplying [VAL] by the base damage value.
msg = msg . replace ( "[HUNGERVAL]" , DisplayBadChangedValue ( df . format ( 10 * fromlv ) , df . format ( 10 * tolv ) ) ) ;
msg = msg . replace ( "[FATALDMG]" , DisplayChangedValue ( df . format ( 120 - fromlv ) , df . format ( 120 - tolv ) ) ) ;
return msg ;
}
String DisplayChangedValue ( String val1 , String val2 ) {
static String DisplayChangedValue ( String val1 , String val2 ) {
return ChatColor . DARK_GRAY + "" + ChatColor . STRIKETHROUGH + val1 + ChatColor . RESET + ChatColor . GREEN + val2 + ChatColor . DARK_GREEN + ChatColor . BOLD + "^" + ChatColor . RESET ;
}
static String DisplayBadChangedValue ( String val1 , String val2 ) {
return ChatColor . DARK_RED + "" + ChatColor . STRIKETHROUGH + val1 + ChatColor . RESET + ChatColor . RED + val2 + ChatColor . DARK_RED + ChatColor . BOLD + "v" + ChatColor . RESET ;
}
}