More progress on getting sigils to follow the events

This commit is contained in:
WayofTime 2014-11-07 15:55:00 -05:00
parent 39b4243a82
commit 369ca6440f
5 changed files with 22 additions and 36 deletions

View file

@ -110,18 +110,12 @@ public class SigilOfElementalAffinity extends EnergyItems
NBTTagCompound tag = par1ItemStack.stackTagCompound;
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
if (tag.getBoolean("isActive"))
if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{
par1ItemStack.setItemDamage(1);
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true));
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true));
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{
}
}
} else
{
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
@ -158,6 +152,7 @@ public class SigilOfElementalAffinity extends EnergyItems
{
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{
par1ItemStack.stackTagCompound.setBoolean("isActive", false);
}
}
}

View file

@ -140,15 +140,10 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade
NBTTagCompound tag = par1ItemStack.stackTagCompound;
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
if (tag.getBoolean("isActive"))
if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{
par1ItemStack.setItemDamage(1);
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay);
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed());
}
} else
{
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
@ -175,7 +170,10 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade
{
if (par2World.getWorldTime() % tickDelay == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer)
{
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed());
if(!EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed()))
{
par1ItemStack.stackTagCompound.setBoolean("isActive", false);
}
}
int range = 5;
int verticalRange = 2;

View file

@ -109,17 +109,11 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade
NBTTagCompound tag = par1ItemStack.stackTagCompound;
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
if (tag.getBoolean("isActive"))
if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{
par1ItemStack.setItemDamage(1);
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1));
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{
}
}
} else
{
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
@ -154,6 +148,7 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade
{
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{
par1ItemStack.stackTagCompound.setBoolean("isActive", false);
}
}
}

View file

@ -109,15 +109,10 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade
NBTTagCompound tag = par1ItemStack.stackTagCompound;
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
if (tag.getBoolean("isActive"))
if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{
par1ItemStack.setItemDamage(1);
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay);
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed());
}
} else
{
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
@ -145,7 +140,10 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade
{
if (par2World.getWorldTime() % tickDelay == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer)
{
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed());
if(!EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed()))
{
par1ItemStack.stackTagCompound.setBoolean("isActive", false);
}
}
int range = 5;

View file

@ -112,15 +112,10 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade
NBTTagCompound tag = par1ItemStack.stackTagCompound;
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
if (tag.getBoolean("isActive"))
if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{
par1ItemStack.setItemDamage(1);
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay);
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed());
}
} else
{
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
@ -148,8 +143,13 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade
{
if (par2World.getWorldTime() % tickDelay == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer)
{
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, this.getLPUsed(par1ItemStack));
this.setLPUsed(par1ItemStack, 0);
if(EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, this.getLPUsed(par1ItemStack)))
{
this.setLPUsed(par1ItemStack, 0);
}else
{
par1ItemStack.stackTagCompound.setBoolean("isActive", false);
}
}
if (!par3EntityPlayer.onGround && !par3EntityPlayer.isSneaking())
{