Added the method to create the Omega armours, though it wasn't a secret for a while! :D

Added the ability to enchant omega armour in such a way that there won't be a single best method
A bunch of other stuff I can't remember. Fun times!
This commit is contained in:
WayofTime 2015-04-11 15:43:06 -04:00
parent afa3988a21
commit b725f7b814
34 changed files with 477 additions and 146 deletions

View file

@ -2,8 +2,8 @@ package WayofTime.alchemicalWizardry.common.omega;
import net.minecraft.world.World;
public interface IEnchantmentGlyph
public interface IEnchantmentGlyph extends IStabilityGlyph
{
public int getSubtractedStabilityForFaceCount(World world, int x, int y, int z, int meta, int faceCount);
public int getEnchantability(World world, int x, int y, int z, int meta);
public int getEnchantmentLevel(World world, int x, int y, int z, int meta);
}

View file

@ -0,0 +1,8 @@
package WayofTime.alchemicalWizardry.common.omega;
import net.minecraft.world.World;
public interface IStabilityGlyph
{
public int getAdditionalStabilityForFaceCount(World world, int x, int y, int z, int meta, int faceCount);
}

View file

@ -38,7 +38,7 @@ public class OmegaParadigm
this.config = new ReagentRegenConfiguration(20, 10, 1);
}
public boolean convertPlayerArmour(EntityPlayer player, int x, int y, int z, int stability, int affinity, int enchantability)
public boolean convertPlayerArmour(EntityPlayer player, int x, int y, int z, int stability, int affinity, int enchantability, int enchantmentLevel)
{
ItemStack[] armours = player.inventory.armorInventory;
@ -49,12 +49,14 @@ public class OmegaParadigm
if(helmetStack != null && helmetStack.getItem() == ModItems.boundHelmet && chestStack != null && chestStack.getItem() == ModItems.boundPlate && leggingsStack != null && leggingsStack.getItem() == ModItems.boundLeggings && bootsStack != null && bootsStack.getItem() == ModItems.boundBoots)
{
System.out.println("Enchantability: " + enchantability);
long worldSeed = player.worldObj.getSeed();
Random rand = new Random(worldSeed + stability * (affinity + 7) * 94 + 84321*x - 17423*y + 76*z - 1623451*enchantability);
ItemStack omegaHelmetStack = helmet.getSubstituteStack(helmetStack, stability, affinity, enchantability, rand);
ItemStack omegaChestStack = chestPiece.getSubstituteStack(chestStack, stability, affinity, enchantability, rand);
ItemStack omegaLeggingsStack = leggings.getSubstituteStack(leggingsStack, stability, affinity, enchantability, rand);
ItemStack omegaBootsStack = boots.getSubstituteStack(bootsStack, stability, affinity, enchantability, rand);
Random rand = new Random(worldSeed + stability * (affinity + 7) * 94 + 84321*x - 17423*y + 76*z - 1623451*enchantability + 2 * enchantmentLevel);
ItemStack omegaHelmetStack = helmet.getSubstituteStack(helmetStack, stability, affinity, enchantability, enchantmentLevel, rand);
ItemStack omegaChestStack = chestPiece.getSubstituteStack(chestStack, stability, affinity, enchantability, enchantmentLevel, rand);
ItemStack omegaLeggingsStack = leggings.getSubstituteStack(leggingsStack, stability, affinity, enchantability, enchantmentLevel, rand);
ItemStack omegaBootsStack = boots.getSubstituteStack(bootsStack, stability, affinity, enchantability, enchantmentLevel, rand);
armours[3] = omegaHelmetStack;
armours[2] = omegaChestStack;

View file

@ -7,7 +7,7 @@ import WayofTime.alchemicalWizardry.api.Int3;
public class OmegaStructureHandler
{
public static final OmegaStructureParameters emptyParam = new OmegaStructureParameters(0, 0);
public static final OmegaStructureParameters emptyParam = new OmegaStructureParameters(0, 0, 0);
public static boolean isStructureIntact(World world, int x, int y, int z)
{
@ -155,6 +155,7 @@ public class OmegaStructureHandler
int tally = 0;
int enchantability = 0;
int enchantmentLevel = 0;
for (int i = 0; i < 2 * range + 1; i++)
{
@ -198,23 +199,27 @@ public class OmegaStructureHandler
{
indTally++;
}
Block block = world.getBlock(x - range + i, y - range + j, z - range + k);
int meta = 0;
int meta = world.getBlockMetadata(x - range + i, y - range + j, z - range + k);
if(block instanceof IEnchantmentGlyph)
{
tally -= ((IEnchantmentGlyph)block).getSubtractedStabilityForFaceCount(world, x-range+i, y-range+j, z-range+k, meta, indTally);
tally += ((IEnchantmentGlyph)block).getAdditionalStabilityForFaceCount(world, x-range+i, y-range+j, z-range+k, meta, indTally);
enchantability += ((IEnchantmentGlyph)block).getEnchantability(world, x-range+i, y-range+j, z-range+k, meta);
enchantmentLevel += ((IEnchantmentGlyph)block).getEnchantmentLevel(world, x-range+i, y-range+j, z-range+k, meta);
}else if(block instanceof IStabilityGlyph)
{
tally += ((IStabilityGlyph)block).getAdditionalStabilityForFaceCount(world, x-range+i, y-range+j, z-range+k, meta, indTally);
}else
{
tally += indTally;
}
}
}
}
}
return new OmegaStructureParameters(tally, enchantability);
return new OmegaStructureParameters(tally, enchantability, enchantmentLevel);
}
public static OmegaStructureParameters getStructureStabilityFactor(World world, int x, int y, int z, int expLim)

View file

@ -4,10 +4,12 @@ public class OmegaStructureParameters
{
public final int stability;
public final int enchantability;
public final int enchantmentLevel;
public OmegaStructureParameters(int stability, int enchantability)
public OmegaStructureParameters(int stability, int enchantability, int enchantmentLevel)
{
this.stability = stability;
this.enchantability = enchantability;
this.enchantmentLevel = enchantmentLevel;
}
}