Added Rune of Acceleration

This commit is contained in:
WayofTime 2014-11-18 15:49:42 -05:00
parent b3199cfb19
commit dbe51d7f7b
8 changed files with 59 additions and 21 deletions

View file

@ -21,6 +21,7 @@ public class BloodRune extends Block
private IIcon dislocationRuneIcon;
private IIcon orbCapacityRuneIcon;
private IIcon betterCapacityRuneIcon;
private IIcon accelerationRuneIcon;
public BloodRune()
{
@ -40,6 +41,7 @@ public class BloodRune extends Block
this.dislocationRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:DislocationRune");
this.orbCapacityRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:OrbCapacityRune");
this.betterCapacityRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:BetterCapacityRune");
this.accelerationRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:AccelerationRune");
}
public int getRuneEffect(int metaData)
@ -60,6 +62,9 @@ public class BloodRune extends Block
case 4: //Better Capacity rune
return 8;
case 5: //Acceleration rune
return 9;
}
return 0;
@ -79,6 +84,7 @@ public class BloodRune extends Block
par3List.add(new ItemStack(par1, 1, 2));
par3List.add(new ItemStack(par1, 1, 3));
par3List.add(new ItemStack(par1, 1, 4));
par3List.add(new ItemStack(par1, 1, 5));
} else
{
super.getSubBlocks(par1, par2CreativeTabs, par3List);
@ -106,6 +112,8 @@ public class BloodRune extends Block
case 4:
return this.betterCapacityRuneIcon;
case 5:
return this.accelerationRuneIcon;
default:
return blockIcon;
}

View file

@ -10,6 +10,7 @@ public class AltarUpgradeComponent
private int altarCapacitiveUpgrades;
private int orbCapacitiveUpgrades;
private int betterCapacitiveUpgrades;
private int accelerationUpgrades;
public AltarUpgradeComponent()
{
@ -21,6 +22,7 @@ public class AltarUpgradeComponent
altarCapacitiveUpgrades = 0;
orbCapacitiveUpgrades = 0;
betterCapacitiveUpgrades = 0;
accelerationUpgrades = 0;
}
public void addSpeedUpgrade()
@ -62,6 +64,11 @@ public class AltarUpgradeComponent
{
betterCapacitiveUpgrades++;
}
public void addAccelerationUpgrade()
{
accelerationUpgrades++;
}
public int getSpeedUpgrades()
{
@ -102,4 +109,9 @@ public class AltarUpgradeComponent
{
return this.betterCapacitiveUpgrades;
}
public int getAccelerationUpgrades()
{
return this.accelerationUpgrades;
}
}

View file

@ -192,6 +192,10 @@ public class UpgradedAltars
case 8:
upgrades.addBetterCapacitiveUpgrade();
break;
case 9:
upgrades.addAccelerationUpgrade();
break;
}
}
}

View file

@ -44,6 +44,10 @@ public class ItemBloodRuneBlock extends ItemBlock
case 4:
name = "betterCapacity";
break;
case 5:
name = "acceleration";
break;
default:
name = "broken";

View file

@ -1,10 +1,7 @@
package WayofTime.alchemicalWizardry.common.items.sigil;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
@ -14,10 +11,14 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade
public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade, IHolding
{
private static IIcon activeIcon;
private static IIcon passiveIcon;

View file

@ -56,6 +56,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
private float capacityMultiplier;
private float orbCapacityMultiplier;
private float dislocationMultiplier;
private int accelerationUpgrades;
private boolean isUpgraded;
private boolean isResultBlock;
private int bufferCapacity;
@ -169,6 +170,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
progress = par1NBTTagCompound.getInteger("progress");
isResultBlock = par1NBTTagCompound.getBoolean("isResultBlock");
lockdownDuration = par1NBTTagCompound.getInteger("lockdownDuration");
accelerationUpgrades = par1NBTTagCompound.getInteger("accelerationUpgrades");
}
public void setMainFluid(FluidStack fluid)
@ -246,6 +248,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
par1NBTTagCompound.setInteger("progress", progress);
par1NBTTagCompound.setInteger("bufferCapacity", bufferCapacity);
par1NBTTagCompound.setInteger("lockdownDuration", lockdownDuration);
par1NBTTagCompound.setInteger("accelerationUpgrades", this.accelerationUpgrades);
}
@Override
@ -567,18 +570,6 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
block.onNeighborBlockChange(worldObj, xCoord, yCoord, zCoord - 1, block);
}
int syphonMax = (int) (20 * this.dislocationMultiplier);
int fluidInputted = 0;
int fluidOutputted = 0;
fluidInputted = Math.min(syphonMax, -this.fluid.amount + capacity);
fluidInputted = Math.min(this.fluidInput.amount, fluidInputted);
this.fluid.amount += fluidInputted;
this.fluidInput.amount -= fluidInputted;
fluidOutputted = Math.min(syphonMax, this.bufferCapacity - this.fluidOutput.amount);
fluidOutputted = Math.min(this.fluid.amount, fluidOutputted);
this.fluidOutput.amount += fluidOutputted;
this.fluid.amount -= fluidOutputted;
if (AlchemicalWizardry.lockdownAltar)
{
List<EntityPlayer> list = SpellHelper.getPlayersInRange(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 15, 15);
@ -606,6 +597,21 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
}
}
}
if(worldObj.getWorldTime() % Math.max(20 - this.accelerationUpgrades, 1) == 0)
{
int syphonMax = (int) (20 * this.dislocationMultiplier);
int fluidInputted = 0;
int fluidOutputted = 0;
fluidInputted = Math.min(syphonMax, -this.fluid.amount + capacity);
fluidInputted = Math.min(this.fluidInput.amount, fluidInputted);
this.fluid.amount += fluidInputted;
this.fluidInput.amount -= fluidInputted;
fluidOutputted = Math.min(syphonMax, this.bufferCapacity - this.fluidOutput.amount);
fluidOutputted = Math.min(this.fluid.amount, fluidOutputted);
this.fluidOutput.amount += fluidOutputted;
this.fluid.amount -= fluidOutputted;
}
if (worldObj.getWorldTime() % 100 == 0)
{
@ -861,6 +867,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
this.capacityMultiplier = 1;
this.orbCapacityMultiplier = 1;
this.dislocationMultiplier = 1;
this.accelerationUpgrades = 0;
return;
}
@ -878,6 +885,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
this.orbCapacityMultiplier = 1;
this.dislocationMultiplier = 1;
this.upgradeLevel = upgradeState;
this.accelerationUpgrades = 0;
return;
}
@ -888,11 +896,11 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
this.sacrificeEfficiencyMultiplier = (float) (0.10 * upgrades.getSacrificeUpgrades());
this.selfSacrificeEfficiencyMultiplier = (float) (0.10 * upgrades.getSelfSacrificeUpgrades());
this.capacityMultiplier = (float) ((1 * Math.pow(1.10, upgrades.getBetterCapacitiveUpgrades()) + 0.20 * upgrades.getAltarCapacitiveUpgrades()));
//TODO finalize values
this.dislocationMultiplier = (float) (Math.pow(1.2, upgrades.getDisplacementUpgrades()));
this.orbCapacityMultiplier = (float) (1 + 0.02 * upgrades.getOrbCapacitiveUpgrades());
this.capacity = (int) (FluidContainerRegistry.BUCKET_VOLUME * 10 * capacityMultiplier);
this.bufferCapacity = (int) (FluidContainerRegistry.BUCKET_VOLUME * 1 * capacityMultiplier);
this.accelerationUpgrades = upgrades.getAccelerationUpgrades();
if (this.fluid.amount > this.capacity)
{

View file

@ -5,6 +5,7 @@ tile.bloodRune.fill.name=Rune of Augmented Capacity
tile.bloodRune.empty.name=Rune of Dislocation
tile.bloodRune.orb.name=Rune of the Orb
tile.bloodRune.betterCapacity.name=Rune of Superior Capacity
tile.bloodRune.acceleration.name=Rune of Acceleration
tile.speedRune.name=Speed Rune
tile.efficiencyRune.name=Efficiency Rune
tile.runeOfSacrifice.name=Rune of Sacrifice

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 B