That's one heck of a commit you've got there...
I may have got a bit behind with version control. A lot behind, in fact. Maybe I'll go back and split this sometime - then again, I probably won't. But hey, at least it's here!
This commit is contained in:
@@ -5,23 +5,25 @@ import electroblob.wizardry.WizardryEventHandler;
|
||||
/** Stores various global constants used in Wizardry. */
|
||||
public final class Constants {
|
||||
|
||||
/** The amount of mana a crystal shard is worth */
|
||||
// 100 doesn't divide nicely by 9 so we're calling this 10. I guess you lose a little bit by smashing a crystal.
|
||||
public static final int MANA_PER_SHARD = 10;
|
||||
/** The amount of mana each magic crystal is worth */
|
||||
public static final int MANA_PER_CRYSTAL = 100;
|
||||
/** The amount of mana each mana flask can hold */
|
||||
public static final int MANA_PER_FLASK = 700;
|
||||
/** The amount of mana a grand magic crystal is worth */
|
||||
public static final int GRAND_CRYSTAL_MANA = 400;
|
||||
/** The maximum number of one type of wand upgrade which can be applied to a wand. */
|
||||
public static final int UPGRADE_STACK_LIMIT = 3;
|
||||
/** The fraction by which cooldowns are reduced for each level of cooldown upgrade. */
|
||||
public static final float COOLDOWN_REDUCTION_PER_LEVEL = 0.15f;
|
||||
/** The fraction by which maximum charge is increased for each level of storage upgrade. */
|
||||
public static final float STORAGE_INCREASE_PER_LEVEL = 0.15f;
|
||||
/** The fraction by which damage is increased for each tier of matching wand. */
|
||||
public static final float DAMAGE_INCREASE_PER_TIER = 0.15f;
|
||||
/**
|
||||
* The fraction by which costs are reduced for each piece of matching armour. Note that changing this value will not
|
||||
* affect continuous spells, since they are handled differently.
|
||||
*/
|
||||
public static final float COST_REDUCTION_PER_ARMOUR = 0.2f;
|
||||
/** The fraction by which potency is increased for each tier of matching wand. */
|
||||
public static final float POTENCY_INCREASE_PER_TIER = 0.15f;
|
||||
/** The fraction by which costs are reduced for each piece of matching armour. */
|
||||
public static final float COST_REDUCTION_PER_ARMOUR = 0.15f;
|
||||
/** The extra fraction by which costs are reduced for a full set of elemental armour. */
|
||||
public static final float FULL_ARMOUR_SET_BONUS = 0.2f;
|
||||
/** The fraction by which spell duration is increased for each level of duration upgrade. */
|
||||
public static final float DURATION_INCREASE_PER_LEVEL = 0.25f;
|
||||
/** The fraction by which spell range is increased for each level of range upgrade. */
|
||||
@@ -32,7 +34,7 @@ public final class Constants {
|
||||
public static final double FROST_SLOWNESS_PER_LEVEL = 0.5;
|
||||
/** The fraction by which movement speed is reduced per level of decay effect. */
|
||||
public static final double DECAY_SLOWNESS_PER_LEVEL = 0.2;
|
||||
/** The fraction by which dig speed is reduced per level of frost effect. */
|
||||
/** The fraction by which dig speed is reduced per level of frostbite effect. */
|
||||
public static final float FROST_FATIGUE_PER_LEVEL = 0.45f;
|
||||
/** The number of ticks between each mana increase for wands with the condenser upgrade. */
|
||||
public static final int CONDENSER_TICK_INTERVAL = 50;
|
||||
@@ -40,11 +42,13 @@ public final class Constants {
|
||||
* The amount of mana given for a kill for each level of siphon upgrade. A random amount from 0 to this number - 1
|
||||
* is also added. See {@link WizardryEventHandler#onLivingDeathEvent} for more details.
|
||||
*/
|
||||
public static final int SIPHON_MANA_PER_LEVEL = 3;
|
||||
public static final int SIPHON_MANA_PER_LEVEL = 5;
|
||||
/**
|
||||
* The number of ticks between the spawning of patches of decay when an entity has the decay effect. Note that decay
|
||||
* won't spawn again if something is already standing in it.
|
||||
*/
|
||||
public static final int DECAY_SPREAD_INTERVAL = 8;
|
||||
/** The fraction by which potency is increased per level of the empowerment effect. */
|
||||
public static final float EMPOWERMENT_POTENCY_PER_LEVEL = 0.25f;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package electroblob.wizardry.constants;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.Style;
|
||||
@@ -10,19 +10,18 @@ import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public enum Element {
|
||||
public enum Element implements IStringSerializable {
|
||||
|
||||
/**
|
||||
* The 'default' element, with {@link electroblob.wizardry.spell.MagicMissile MagicMissile} being its only spell.
|
||||
*/
|
||||
MAGIC(new Style().setColor(TextFormatting.GRAY), "simple", Wizardry.MODID),
|
||||
FIRE(new Style().setColor(TextFormatting.DARK_RED), "fire", Wizardry.MODID),
|
||||
ICE(new Style().setColor(TextFormatting.AQUA), "ice", Wizardry.MODID),
|
||||
LIGHTNING(new Style().setColor(TextFormatting.DARK_AQUA), "lightning", Wizardry.MODID),
|
||||
NECROMANCY(new Style().setColor(TextFormatting.DARK_PURPLE), "necromancy", Wizardry.MODID),
|
||||
EARTH(new Style().setColor(TextFormatting.DARK_GREEN), "earth", Wizardry.MODID),
|
||||
SORCERY(new Style().setColor(TextFormatting.GREEN), "sorcery", Wizardry.MODID),
|
||||
HEALING(new Style().setColor(TextFormatting.YELLOW), "healing", Wizardry.MODID);
|
||||
/** The 'default' element, with {@link electroblob.wizardry.registry.Spells#magic_missile magic missile} being its
|
||||
* only spell. */
|
||||
MAGIC(new Style().setColor(TextFormatting.GRAY), "magic"),
|
||||
FIRE(new Style().setColor(TextFormatting.DARK_RED), "fire"),
|
||||
ICE(new Style().setColor(TextFormatting.AQUA), "ice"),
|
||||
LIGHTNING(new Style().setColor(TextFormatting.DARK_AQUA), "lightning"),
|
||||
NECROMANCY(new Style().setColor(TextFormatting.DARK_PURPLE), "necromancy"),
|
||||
EARTH(new Style().setColor(TextFormatting.DARK_GREEN), "earth"),
|
||||
SORCERY(new Style().setColor(TextFormatting.GREEN), "sorcery"),
|
||||
HEALING(new Style().setColor(TextFormatting.YELLOW), "healing");
|
||||
|
||||
/** Display colour for this element */
|
||||
private final Style colour;
|
||||
@@ -31,16 +30,31 @@ public enum Element {
|
||||
/** The {@link ResourceLocation} for this element's 8x8 icon (displayed in the arcane workbench GUI) */
|
||||
private final ResourceLocation icon;
|
||||
|
||||
private Element(Style colour, String name, String modid){
|
||||
Element(Style colour, String name){
|
||||
this(colour, name, Wizardry.MODID);
|
||||
}
|
||||
|
||||
Element(Style colour, String name, String modid){
|
||||
this.colour = colour;
|
||||
this.unlocalisedName = name;
|
||||
this.icon = new ResourceLocation(modid, "textures/gui/element_icon_" + unlocalisedName + ".png");
|
||||
}
|
||||
|
||||
/** Returns the element with the given name, or throws an {@link java.lang.IllegalArgumentException} if no such
|
||||
* element exists. */
|
||||
public static Element fromName(String name){
|
||||
|
||||
for(Element element : values()){
|
||||
if(element.unlocalisedName.equals(name)) return element;
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("No such element with unlocalised name: " + name);
|
||||
}
|
||||
|
||||
/** Returns the translated display name of this element, without formatting. */
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getDisplayName(){
|
||||
return I18n.format("element." + getUnlocalisedName());
|
||||
return net.minecraft.client.resources.I18n.format("element." + getName());
|
||||
}
|
||||
|
||||
/** Returns the {@link Style} object representing the colour of this element. */
|
||||
@@ -55,11 +69,12 @@ public enum Element {
|
||||
|
||||
/** Returns the translated display name for wizards of this element, shown in the trading GUI. */
|
||||
public ITextComponent getWizardName(){
|
||||
return new TextComponentTranslation("element." + getUnlocalisedName() + ".wizard");
|
||||
return new TextComponentTranslation("element." + getName() + ".wizard");
|
||||
}
|
||||
|
||||
/** Returns this element's unlocalised name. */
|
||||
public String getUnlocalisedName(){
|
||||
/** Returns this element's unlocalised name. Also used as the serialised string in block properties. */
|
||||
@Override
|
||||
public String getName(){
|
||||
return unlocalisedName;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package electroblob.wizardry.constants;
|
||||
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -21,8 +20,23 @@ public enum SpellType {
|
||||
this.unlocalisedName = name;
|
||||
}
|
||||
|
||||
/** Returns the spell type with the given name, or throws an {@link java.lang.IllegalArgumentException} if no such
|
||||
* spell type exists. */
|
||||
public static SpellType fromName(String name){
|
||||
|
||||
for(SpellType type : values()){
|
||||
if(type.unlocalisedName.equals(name)) return type;
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("No such spell type with unlocalised name: " + name);
|
||||
}
|
||||
|
||||
public String getUnlocalisedName(){
|
||||
return unlocalisedName;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getDisplayName(){
|
||||
return I18n.format("spelltype." + unlocalisedName);
|
||||
return net.minecraft.client.resources.I18n.format("spelltype." + unlocalisedName);
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,20 @@
|
||||
package electroblob.wizardry.constants;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.Style;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public enum Tier {
|
||||
|
||||
BASIC(700, 3, 12, new Style().setColor(TextFormatting.WHITE), "basic"),
|
||||
APPRENTICE(1000, 5, 5, new Style().setColor(TextFormatting.AQUA), "apprentice"),
|
||||
ADVANCED(1500, 7, 2, new Style().setColor(TextFormatting.DARK_BLUE), "advanced"),
|
||||
MASTER(2500, 9, 1, new Style().setColor(TextFormatting.DARK_PURPLE), "master");
|
||||
NOVICE(700, 3, 12, 0, new Style().setColor(TextFormatting.WHITE), "novice"),
|
||||
APPRENTICE(1000, 5, 5, 6000, new Style().setColor(TextFormatting.AQUA), "apprentice"),
|
||||
ADVANCED(1500, 7, 2, 9000, new Style().setColor(TextFormatting.DARK_BLUE), "advanced"),
|
||||
MASTER(2500, 9, 1, 15000, new Style().setColor(TextFormatting.DARK_PURPLE), "master");
|
||||
|
||||
/** Maximum mana a wand of this tier can store. */
|
||||
public final int maxCharge;
|
||||
@@ -23,29 +24,59 @@ public enum Tier {
|
||||
public final int upgradeLimit;
|
||||
/** The weight given to this tier in the standard weighting. */
|
||||
public final int weight;
|
||||
/** The progression required for a wand to be upgraded to this tier. */
|
||||
public final int progression;
|
||||
/** The colour of text associated with this tier. */
|
||||
// Changed to a Style object for consistency.
|
||||
private final Style colour;
|
||||
|
||||
private final String unlocalisedName;
|
||||
|
||||
private Tier(int maxCharge, int upgradeLimit, int weight, Style colour, String name){
|
||||
Tier(int maxCharge, int upgradeLimit, int weight, int progression, Style colour, String name){
|
||||
this.maxCharge = maxCharge;
|
||||
this.level = ordinal();
|
||||
this.upgradeLimit = upgradeLimit;
|
||||
this.weight = weight;
|
||||
this.progression = progression;
|
||||
this.colour = colour;
|
||||
this.unlocalisedName = name;
|
||||
}
|
||||
|
||||
/** Returns the tier with the given name, or throws an {@link java.lang.IllegalArgumentException} if no such
|
||||
* tier exists. */
|
||||
public static Tier fromName(String name){
|
||||
|
||||
for(Tier tier : values()){
|
||||
if(tier.unlocalisedName.equals(name)) return tier;
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("No such tier with unlocalised name: " + name);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getDisplayName(){
|
||||
return I18n.format("tier." + unlocalisedName);
|
||||
return net.minecraft.client.resources.I18n.format("tier." + unlocalisedName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a {@code TextComponentTranslation} which will be translated to the display name of the tier, without
|
||||
* formatting (i.e. not coloured).
|
||||
*/
|
||||
public TextComponentTranslation getNameForTranslation(){
|
||||
return new TextComponentTranslation("tier." + unlocalisedName);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getDisplayNameWithFormatting(){
|
||||
return this.getFormattingCode() + I18n.format("tier." + unlocalisedName);
|
||||
return this.getFormattingCode() + net.minecraft.client.resources.I18n.format("tier." + unlocalisedName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a {@code TextComponentTranslation} which will be translated to the display name of the tier, with
|
||||
* formatting (i.e. coloured).
|
||||
*/
|
||||
public ITextComponent getNameForTranslationFormatted(){
|
||||
return new TextComponentTranslation("tier." + unlocalisedName).setStyle(this.colour);
|
||||
}
|
||||
|
||||
public String getUnlocalisedName(){
|
||||
|
||||
Reference in New Issue
Block a user