Initial 1.11.2 update

This commit is contained in:
Electroblob
2018-02-07 21:15:50 +00:00
parent 67f6be0671
commit 3df5597dcc
368 changed files with 17234 additions and 15082 deletions
@@ -15,10 +15,12 @@ public final class Constants {
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. */
/** 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. */
/**
* 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 spell duration is increased for each level of duration upgrade. */
public static final float DURATION_INCREASE_PER_LEVEL = 0.25f;
@@ -34,11 +36,15 @@ public final class Constants {
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;
/** 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. */
/**
* 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;
/** 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. */
/**
* 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;
}
@@ -10,24 +10,27 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public enum Element {
/** 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.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);
/** Display colour for this element */
private final Style colour;
/** Unlocalised name for this element */
private final String unlocalisedName;
/** 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){
this.colour = colour;
this.unlocalisedName = name;
@@ -39,7 +42,7 @@ public enum Element {
public String getDisplayName(){
return net.minecraft.client.resources.I18n.format("element." + getUnlocalisedName());
}
/** Returns the {@link Style} object representing the colour of this element. */
public Style getColour(){
return colour;
@@ -4,14 +4,11 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public enum SpellType {
ATTACK("attack"),
DEFENCE("defence"),
UTILITY("utility"),
MINION("minion");
ATTACK("attack"), DEFENCE("defence"), UTILITY("utility"), MINION("minion");
private final String unlocalisedName;
SpellType(String name){
this.unlocalisedName = name;
}
@@ -8,12 +8,12 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public enum Tier {
BASIC(700, 3, 12, new Style().setColor(TextFormatting.WHITE), "basic"),
APPRENTICE(1000, 4, 5, new Style().setColor(TextFormatting.AQUA), "apprentice"),
ADVANCED(1500, 5, 2, new Style().setColor(TextFormatting.DARK_BLUE), "advanced"),
MASTER(2500, 6, 1, new Style().setColor(TextFormatting.DARK_PURPLE), "master");
BASIC(700, 3, 12, new Style().setColor(TextFormatting.WHITE), "basic"), APPRENTICE(1000, 4, 5,
new Style().setColor(TextFormatting.AQUA), "apprentice"), ADVANCED(1500, 5, 2,
new Style().setColor(TextFormatting.DARK_BLUE),
"advanced"), MASTER(2500, 6, 1, new Style().setColor(TextFormatting.DARK_PURPLE), "master");
/** Maximum mana a wand of this tier can store. */
public final int maxCharge;
/** Just an ordinal. Shouldn't really be needed but no point changing it now. */
@@ -25,9 +25,9 @@ public enum Tier {
/** 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){
this.maxCharge = maxCharge;
this.level = ordinal();
@@ -38,15 +38,15 @@ public enum Tier {
}
@SideOnly(Side.CLIENT)
public String getDisplayName() {
public String getDisplayName(){
return net.minecraft.client.resources.I18n.format("tier." + unlocalisedName);
}
@SideOnly(Side.CLIENT)
public String getDisplayNameWithFormatting() {
public String getDisplayNameWithFormatting(){
return this.getFormattingCode() + net.minecraft.client.resources.I18n.format("tier." + unlocalisedName);
}
public String getUnlocalisedName(){
return unlocalisedName;
}
@@ -54,28 +54,31 @@ public enum Tier {
public String getFormattingCode(){
return colour.getFormattingCode();
}
/** Returns a random tier based on the standard weighting. Currently, the standard weighting is: Basic (Novice) 60%,
/**
* Returns a random tier based on the standard weighting. Currently, the standard weighting is: Basic (Novice) 60%,
* Apprentice 25%, Advanced 10%, Master 5%. If an array of tiers is given, it picks a tier from the array, with the
* same relative weights for each. For example, if the array contains APPRENTICE and MASTER, then the weighting will
* become: Apprentice 83.3%, Master 16.7%. */
* become: Apprentice 83.3%, Master 16.7%.
*/
public static Tier getWeightedRandomTier(Random random, Tier... tiers){
if(tiers.length == 0) tiers = values();
int totalWeight = 0;
for(Tier tier : tiers) totalWeight += tier.weight;
for(Tier tier : tiers)
totalWeight += tier.weight;
int randomiser = random.nextInt(totalWeight);
int cumulativeWeight = 0;
for(Tier tier : tiers){
cumulativeWeight += tier.weight;
if(randomiser < cumulativeWeight) return tier;
}
// This will never happen, but it might as well be a sensible result.
return tiers[tiers.length-1];
return tiers[tiers.length - 1];
}
}