diff --git a/resources/assets/iguanatweakstconstruct/lang/en_US.lang b/resources/assets/iguanatweakstconstruct/lang/en_US.lang index 58002c3..556c1d1 100644 --- a/resources/assets/iguanatweakstconstruct/lang/en_US.lang +++ b/resources/assets/iguanatweakstconstruct/lang/en_US.lang @@ -13,6 +13,12 @@ message.levelup.3=You are now accustomed to the weight of the %s message.levelup.4=You have become adept at handling the %s message.levelup.5=You are now an expert at using the %s ! message.levelup.6=You have mastered the %s! +message.levelup.7=You have grandmastered the %s! +message.levelup.8=You feel like you could fulfill mighty deeds with your %s! +message.levelup.9=You and your %s are living legends! +message.levelup.10=No god could stand in the way of you and your %s! +message.levelup.11=Your %s is pure awesome. +message.levelup.generic=Your %s has reached level %s message.levelup.newmodifier.1=You notice room for improvement message.levelup.newmodifier.2=More Bling for your Thing @@ -60,12 +66,21 @@ tooltip.level.skilllevel=Skill Level tooltip.level.advanced=Hold %s for XP tooltip.level.skillxp=Skill XP +tooltip.level.skill.0=Like new tooltip.level.skill.1=Clumsy tooltip.level.skill.2=Comfortable tooltip.level.skill.3=Accustomed tooltip.level.skill.4=Adept tooltip.level.skill.5=Expert tooltip.level.skill.6=Master +tooltip.level.skill.7=Grandmaster +tooltip.level.skill.8=Heroic +tooltip.level.skill.9=Legendary +tooltip.level.skill.10=Godlike +tooltip.level.skill.11=Awesome +tooltip.level.skill.42=boni +tooltip.level.skill.66=Jadedcat +tooltip.level.skill.99=Hacker tooltip.mobhead.level=Applicable up to: %s tooltip.uselessTool1=This tool cannot mine anything! diff --git a/src/main/java/iguanaman/iguanatweakstconstruct/leveling/LevelingLogic.java b/src/main/java/iguanaman/iguanatweakstconstruct/leveling/LevelingLogic.java index 3638c03..fa6feae 100644 --- a/src/main/java/iguanaman/iguanatweakstconstruct/leveling/LevelingLogic.java +++ b/src/main/java/iguanaman/iguanatweakstconstruct/leveling/LevelingLogic.java @@ -31,8 +31,6 @@ public abstract class LevelingLogic { public static final String TAG_BOOST_EXP = "HeadEXP"; // HeadEXP for downwards compatibility public static final String TAG_IS_BOOSTED = "HarvestLevelModified"; - public static final int MAX_LEVEL = 6; - public static int getLevel(NBTTagCompound tags) { return tags.getInteger(TAG_LEVEL); } public static int getHarvestLevel(NBTTagCompound tags) { return tags.hasKey("HarvestLevel") ? tags.getInteger("HarvestLevel") : -1; } public static long getXp(NBTTagCompound tags) { return tags.getLong(TAG_EXP); } @@ -41,7 +39,7 @@ public abstract class LevelingLogic { public static boolean hasXp(NBTTagCompound tags) { return tags.hasKey(TAG_EXP); } public static boolean hasBoostXp(NBTTagCompound tags) { return tags.hasKey(TAG_BOOST_EXP); } public static boolean isBoosted(NBTTagCompound tags) { return tags.getBoolean(TAG_IS_BOOSTED); } - public static boolean isMaxLevel(NBTTagCompound tags) { return getLevel(tags) >= MAX_LEVEL; } + public static boolean isMaxLevel(NBTTagCompound tags) { return getLevel(tags) >= Config.maxToolLevel; } /** * can only be boosted if: @@ -103,7 +101,7 @@ public abstract class LevelingLogic { boolean pickLeveled = false; // Update Tool XP - if (toolXP >= 0 && hasXp(tags) && level > 0 && level < MAX_LEVEL) + if (toolXP >= 0 && hasXp(tags) && level > 0 && !isMaxLevel(tags)) { // set new xp value tags.setLong(TAG_EXP, toolXP); @@ -262,10 +260,12 @@ public abstract class LevelingLogic { // tell the player how awesome he is if (!world.isRemote) { + // special message if(StatCollector.canTranslate("message.levelup." + level)) - { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_AQUA + StatCollector.translateToLocalFormatted("message.levelup." + level, stack.getDisplayName()))); - } + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_AQUA + StatCollector.translateToLocalFormatted("message.levelup." + level, stack.getDisplayName() + EnumChatFormatting.DARK_AQUA))); + // generic message + else + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_AQUA + StatCollector.translateToLocalFormatted("message.levelup.generic", stack.getDisplayName() + EnumChatFormatting.DARK_AQUA, LevelingTooltips.getLevelString(level)))); } // Add random bonuses on leveling up? diff --git a/src/main/java/iguanaman/iguanatweakstconstruct/leveling/LevelingTooltips.java b/src/main/java/iguanaman/iguanatweakstconstruct/leveling/LevelingTooltips.java index 0d4c2e5..d54b38c 100644 --- a/src/main/java/iguanaman/iguanatweakstconstruct/leveling/LevelingTooltips.java +++ b/src/main/java/iguanaman/iguanatweakstconstruct/leveling/LevelingTooltips.java @@ -61,23 +61,56 @@ public abstract class LevelingTooltips { { String str; if(!StatCollector.canTranslate("tooltip.level.skill." + level)) - str = "Unknown"; + str = "???"; else str = StatCollector.translateToLocal("tooltip.level.skill." + level); - return String.format("%s: %s%s", StatCollector.translateToLocal("tooltip.level.skilllevel"), getLevelColor(level), str); + return String.format("%s: %s", StatCollector.translateToLocal("tooltip.level.skilllevel"), getLevelString(level)); + } + + public static String getLevelString(int level) + { + return getLevelColor(level) + getRawLevelString(level) + EnumChatFormatting.RESET; + } + + private static String getRawLevelString(int level) + { + if(level <= 0) return ""; + + // try a basic translated string + if(StatCollector.canTranslate("tooltip.level.skill." + level)) + return StatCollector.translateToLocal("tooltip.level.skill." + level); + + // ok. try to find a modulo + int i = 1; + while(StatCollector.canTranslate("tooltip.level.skill." + i)) + i++; + + // get the modulo'd string + String str = StatCollector.translateToLocal("tooltip.level.skill." + (level%i)); + // and add +s! + for(int j = level/i; j > 0; j--) + str += '+'; + + return str; } public static String getLevelColor(int level) { - switch (level) + switch (level%12) { - case 1: return "\u00a74"; - case 2: return "\u00a76"; - case 3: return "\u00a7e"; - case 4: return "\u00a72"; - case 5: return "\u00a73"; - case 6: return "\u00a7d"; + case 0: return EnumChatFormatting.GRAY.toString(); + case 1: return EnumChatFormatting.DARK_RED.toString(); + case 2: return EnumChatFormatting.GOLD.toString(); + case 3: return EnumChatFormatting.YELLOW.toString(); + case 4: return EnumChatFormatting.DARK_GREEN.toString(); + case 5: return EnumChatFormatting.DARK_AQUA.toString(); + case 6: return EnumChatFormatting.LIGHT_PURPLE.toString(); + case 7: return EnumChatFormatting.WHITE.toString(); + case 8: return EnumChatFormatting.RED.toString(); + case 9: return EnumChatFormatting.DARK_PURPLE.toString(); + case 10:return EnumChatFormatting.AQUA.toString(); + case 11:return EnumChatFormatting.GREEN.toString(); default: return ""; } } diff --git a/src/main/java/iguanaman/iguanatweakstconstruct/mobheads/IguanaMobHeads.java b/src/main/java/iguanaman/iguanatweakstconstruct/mobheads/IguanaMobHeads.java index 329c010..71d4a52 100644 --- a/src/main/java/iguanaman/iguanatweakstconstruct/mobheads/IguanaMobHeads.java +++ b/src/main/java/iguanaman/iguanatweakstconstruct/mobheads/IguanaMobHeads.java @@ -44,7 +44,7 @@ public class IguanaMobHeads { integrateThermalExpansion(); skullItem = new IguanaSkull(); - GameRegistry.registerItem(skullItem, "skullItem"); + GameRegistry.registerItem(skullItem, "skull"); skullBlock = new IguanaSkullBlock(); GameRegistry.registerBlock(skullBlock, "skullBlock"); diff --git a/src/main/java/iguanaman/iguanatweakstconstruct/reference/Config.java b/src/main/java/iguanaman/iguanatweakstconstruct/reference/Config.java index 4acf2fb..99f31d4 100644 --- a/src/main/java/iguanaman/iguanatweakstconstruct/reference/Config.java +++ b/src/main/java/iguanaman/iguanatweakstconstruct/reference/Config.java @@ -13,6 +13,7 @@ public class Config { private Configuration configfile; // leveling + public static int maxToolLevel; public static int xpRequiredToolsPercentage; public static int xpRequiredWeaponsPercentage; public static float xpPerLevelMultiplier; @@ -115,6 +116,7 @@ public class Config { showMinimalTooltipXP = configfile.getBoolean("showMinimalTooltipXP", CATEGORY_Leveling, false, "Current XP% is shown after the level"); // levelup behaviour + maxToolLevel = configfile.getInt("maxToolLevel", CATEGORY_Leveling, 6, 1, 99, ""); toolLeveling = configfile.getBoolean("toolLeveling", CATEGORY_Leveling, true, "Can your skill with tools 'level up' as you use them?"); toolLevelingExtraModifiers = configfile.getBoolean("ExtraModifiers", CATEGORY_Leveling, true, "Removes modifiers on new tools and gives them through leveling (requires 'toolLeveling=true')"); toolLevelingRandomBonuses = configfile.getBoolean("RandomBonuses", CATEGORY_Leveling, true, "Gives a random bonus every level, if false and levelling is on modifiers are given at levels 2 and 4 (requires 'toolLeveling=true')"); @@ -231,91 +233,6 @@ public class Config { logBonusExtraChance = configfile.getBoolean("logBonusExtraChance", CATEGORY_Debug, true, "Logs how much the extra-chance from doing stuff you had when getting a random bonus on levelup."); - /** not implemented anymore **/ -/* - - // repairs - ConfigCategory repairsCategory = configfile.getCategory("repairs"); - repairsCategory.setComment("Changes to tool repairing"); - - Property repairCostScalingProperty = configfile.get("repairs", "repairCostScaling", false); - repairCostScalingProperty.comment = "Repairs are less effective the more a tool is repaired"; - repairCostScaling = repairCostScalingProperty.getBoolean(false); - - Property repairLimitActiveProperty = configfile.get("repairs", "repairLimitActive", false); - repairLimitActiveProperty.comment = "Number of times TC tools can be repaired is limited"; - repairLimitActive = repairLimitActiveProperty.getBoolean(false); - - Property repairLimitProperty = configfile.get("repairs", "repairLimit", 25); - repairLimitProperty.comment = "Number of times TC tools can be repaired (only if 'repairLimitActive' is true) (set to 0 to disable repairs)"; - repairLimit = Math.max(repairLimitProperty.getInt(25), 0); - repairLimitProperty.set(repairLimit); - - Property repairScalingModifierProperty = configfile.get("repairs", "repairScalingModifier", 5); - repairScalingModifierProperty.comment = "Repair cost doubles after this many repairs (only if 'repairCostScaling' is true)"; - repairScalingModifier = Math.max(repairScalingModifierProperty.getInt(5), 1); - repairScalingModifierProperty.set(repairScalingModifier); - - Property repairCostPercentageProperty = configfile.get("repairs", "repairCostPercentage", 100); - repairCostPercentageProperty.comment = "Increase or decrease repair costs (higher = more expensive)"; - repairCostPercentage = Math.max(repairCostPercentageProperty.getInt(100), 1); - repairCostPercentageProperty.set(repairCostPercentage); - - - - - // crafting - ConfigCategory craftingCategory = configfile.getCategory("crafting"); - craftingCategory.setComment("Allow Tinkers crafting to be done in a normal crafting window"); - - Property easyBlankPatternRecipeProperty = configfile.get("crafting", "easyBlankPatternRecipe", true); - easyBlankPatternRecipeProperty.comment = "Allows blank patterns to be crafted with 4 sticks in a square"; - easyBlankPatternRecipe = easyBlankPatternRecipeProperty.getBoolean(true); - - Property easyPartCraftingProperty = configfile.get("crafting", "easyPartCrafting", true); - easyPartCraftingProperty.comment = "Allows you to make tool parts in a normal crafting window"; - easyPartCrafting = easyPartCraftingProperty.getBoolean(true); - - Property easyPatternCraftingProperty = configfile.get("crafting", "easyPatternCrafting", true); - easyPatternCraftingProperty.comment = "Allows you to rotate the the tier 1 patterns in a normal crafting window"; - easyPatternCrafting = easyPatternCraftingProperty.getBoolean(true); - - Property easyToolCreationProperty = configfile.get("crafting", "easyToolCreation", true); - easyToolCreationProperty.comment = "Allows you create tinkers tools in a normal crafting window"; - easyToolCreation = easyToolCreationProperty.getBoolean(true); - - Property easyToolModificationProperty = configfile.get("crafting", "easyToolModification", true); - easyToolModificationProperty.comment = "Allows you add modifications to tools in a normal crafting window"; - easyToolModification = easyToolModificationProperty.getBoolean(true); - - - // modifiers - ConfigCategory modifiersCategory = configfile.getCategory("modifiers"); - modifiersCategory.setComment("Options relating to tool modifiers"); - - Property addCleanModifierProperty = configfile.get("modifiers", "addCleanModifier", true); - addCleanModifierProperty.comment = "Silky Cloth can be used to remove all modifiers from a tool (currently safe but not working)"; - addCleanModifier = addCleanModifierProperty.getBoolean(true); - - Property moreExpensiveSilkyClothProperty = configfile.get("modifiers", "moreExpensiveSilkyCloth", true); - moreExpensiveSilkyClothProperty.comment = "Silky Cloth needs gold ingots, instead of nuggets"; - moreExpensiveSilkyCloth = moreExpensiveSilkyClothProperty.getBoolean(true); - - Property moreExpensiveSilkyJewelProperty = configfile.get("modifiers", "moreExpensiveSilkyJewel", true); - moreExpensiveSilkyJewelProperty.comment = "Silky Jewel needs emerald prefix, instead of one emerald"; - moreExpensiveSilkyJewel = moreExpensiveSilkyJewelProperty.getBoolean(true); - - Property mossRepairSpeedProperty = configfile.get("modifiers", "mossRepairSpeed", 3); - mossRepairSpeedProperty.comment = "Rate tools with moss repair (TC default 3)"; - mossRepairSpeed = Math.max(mossRepairSpeedProperty.getInt(3), 0); - mossRepairSpeedProperty.set(mossRepairSpeed); - - Property redstoneEffectProperty = configfile.get("modifiers", "redstoneEffect", 4); - redstoneEffectProperty.comment = "Amount each piece of redstone increases mining speed (tinkers default is 8)"; - redstoneEffect = Math.max(redstoneEffectProperty.getInt(4), 1); - redstoneEffectProperty.set(redstoneEffect); -*/ - configfile.save(); }