Pushing before merging

This commit is contained in:
WayofTime 2014-10-09 07:48:45 -04:00
parent 297567a417
commit 1d99b70f14
31 changed files with 588 additions and 262 deletions

View file

@ -64,7 +64,7 @@ public class RitualEffectFlight extends RitualEffect
{
continue;
}
entity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFlight.id, hasAether ? 100 : 20, 0));
entity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFlight.id, hasAether ? 30*20 : 20, 0));
entityCount ++;
}

View file

@ -0,0 +1,131 @@
package WayofTime.alchemicalWizardry.common.rituals;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.FoodStats;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
public class RitualEffectFullStomach extends RitualEffect
{
@Override
public void performEffect(IMasterRitualStone ritualStone)
{
String owner = ritualStone.getOwner();
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
int z = ritualStone.getZCoord();
if (world.getWorldTime() % 20 != 0)
{
return;
}
double horizRange = 5;
double vertRange = 5;
List<EntityPlayer> playerList = SpellHelper.getPlayersInRange(world, x+0.5, y+0.5, z+0.5, horizRange, vertRange);
if(playerList == null)
{
return;
}
if (currentEssence < this.getCostPerRefresh() * playerList.size())
{
SoulNetworkHandler.causeNauseaToPlayer(owner);
} else
{
TileEntity tile = world.getTileEntity(x, y+1, z);
IInventory inventory = null;
if(tile instanceof IInventory)
{
inventory = (IInventory)tile;
}else
{
tile = world.getTileEntity(x, y-1, z);
if(tile instanceof IInventory)
{
inventory = (IInventory)tile;
}
}
int count = 0;
if(inventory != null)
{
for(EntityPlayer player : playerList)
{
FoodStats foodStats = player.getFoodStats();
float satLevel = foodStats.getSaturationLevel();
for(int i=0; i<inventory.getSizeInventory(); i++)
{
ItemStack stack = inventory.getStackInSlot(i);
if(stack != null && stack.getItem() instanceof ItemFood)
{
ItemFood foodItem = (ItemFood)stack.getItem();
int regularHeal = foodItem.func_150905_g(stack);
float saturatedHeal = foodItem.func_150906_h(stack);
if(saturatedHeal + satLevel <= 20)
{
foodStats.setFoodSaturationLevel(saturatedHeal + satLevel);
inventory.decrStackSize(i, 1);
count++;
break;
}
}
}
}
}
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh() * count);
}
}
@Override
public int getCostPerRefresh()
{
return 100;
}
@Override
public List<RitualComponent> getRitualComponentList()
{
ArrayList<RitualComponent> animalGrowthRitual = new ArrayList();
animalGrowthRitual.add(new RitualComponent(0, 0, 2, RitualComponent.DUSK));
animalGrowthRitual.add(new RitualComponent(2, 0, 0, RitualComponent.DUSK));
animalGrowthRitual.add(new RitualComponent(0, 0, -2, RitualComponent.DUSK));
animalGrowthRitual.add(new RitualComponent(-2, 0, 0, RitualComponent.DUSK));
animalGrowthRitual.add(new RitualComponent(0, 0, 1, RitualComponent.WATER));
animalGrowthRitual.add(new RitualComponent(1, 0, 0, RitualComponent.WATER));
animalGrowthRitual.add(new RitualComponent(0, 0, -1, RitualComponent.WATER));
animalGrowthRitual.add(new RitualComponent(-1, 0, 0, RitualComponent.WATER));
animalGrowthRitual.add(new RitualComponent(1, 0, 2, RitualComponent.EARTH));
animalGrowthRitual.add(new RitualComponent(-1, 0, 2, RitualComponent.EARTH));
animalGrowthRitual.add(new RitualComponent(1, 0, -2, RitualComponent.EARTH));
animalGrowthRitual.add(new RitualComponent(-1, 0, -2, RitualComponent.EARTH));
animalGrowthRitual.add(new RitualComponent(2, 0, 1, RitualComponent.AIR));
animalGrowthRitual.add(new RitualComponent(2, 0, -1, RitualComponent.AIR));
animalGrowthRitual.add(new RitualComponent(-2, 0, 1, RitualComponent.AIR));
animalGrowthRitual.add(new RitualComponent(-2, 0, -1, RitualComponent.AIR));
return animalGrowthRitual;
}
}

View file

@ -28,16 +28,8 @@ public class RitualEffectGrowth extends RitualEffect
public void performEffect(IMasterRitualStone ritualStone)
{
String owner = ritualStone.getOwner();
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
data = new LifeEssenceNetwork(owner);
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
@ -105,8 +97,7 @@ public class RitualEffectGrowth extends RitualEffect
if(hasVirtus)
this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, true);
data.currentEssence = currentEssence - this.getCostPerRefresh()*flag;
data.markDirty();
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()*flag);
}
}
}

View file

@ -16,6 +16,7 @@ import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
public class RitualEffectHarvest extends RitualEffect
@ -24,16 +25,8 @@ public class RitualEffectHarvest extends RitualEffect
public void performEffect(IMasterRitualStone ritualStone)
{
String owner = ritualStone.getOwner();
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
data = new LifeEssenceNetwork(owner);
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
@ -78,8 +71,7 @@ public class RitualEffectHarvest extends RitualEffect
if (flag > 0)
{
data.currentEssence = currentEssence - this.getCostPerRefresh() * Math.min(maxCount, flag);
data.markDirty();
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh() * Math.min(maxCount, flag));
}
}
}

View file

@ -29,16 +29,8 @@ public class RitualEffectHealing extends RitualEffect
public void performEffect(IMasterRitualStone ritualStone)
{
String owner = ritualStone.getOwner();
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
data = new LifeEssenceNetwork(owner);
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
@ -128,8 +120,7 @@ public class RitualEffectHealing extends RitualEffect
{
this.canDrainReagent(ritualStone, ReagentRegistry.praesidiumReagent, praesidiumDrain, true);
}
data.currentEssence = currentEssence - cost * entityCount;
data.markDirty();
SoulNetworkHandler.syphonFromNetwork(owner, cost * entityCount);
}
}
}

View file

@ -27,22 +27,14 @@ public class RitualEffectItemSuction extends RitualEffect
{
public static final int reductusDrain = 1;
public static final int timeDelayMin = 10;
public static final int timeDelayMin = 60;
@Override
public void performEffect(IMasterRitualStone ritualStone)
{
String owner = ritualStone.getOwner();
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
data = new LifeEssenceNetwork(owner);
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
@ -150,8 +142,7 @@ public class RitualEffectItemSuction extends RitualEffect
if(count>0)
{
data.currentEssence = currentEssence - this.getCostPerRefresh()*Math.min(count, 100);
data.markDirty();
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()*Math.min(count, 100));
return;
}
}

View file

@ -26,16 +26,8 @@ public class RitualEffectJumping extends RitualEffect
public void performEffect(IMasterRitualStone ritualStone)
{
String owner = ritualStone.getOwner();
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
data = new LifeEssenceNetwork(owner);
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
@ -87,7 +79,7 @@ public class RitualEffectJumping extends RitualEffect
{
if(!livingEntity.isPotionActive(AlchemicalWizardry.customPotionFeatherFall))
{
livingEntity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFeatherFall.id, 3 * 20, 0));
livingEntity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFeatherFall.id, 5 * 20, 0));
this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, true);
}
}
@ -95,8 +87,7 @@ public class RitualEffectJumping extends RitualEffect
if (flag > 0)
{
data.currentEssence = currentEssence - this.getCostPerRefresh()*flag;
data.markDirty();
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()*flag);
}
}
}

View file

@ -37,63 +37,13 @@ public class RitualEffectLava extends RitualEffect
public void performEffect(IMasterRitualStone ritualStone)
{
String owner = ritualStone.getOwner();
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
data = new LifeEssenceNetwork(owner);
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
int z = ritualStone.getZCoord();
Block block = world.getBlock(x, y + 1, z);
if (world.isAirBlock(x, y + 1, z) && !(block instanceof BlockSpectralContainer))
{
if (currentEssence < this.getCostPerRefresh())
{
SoulNetworkHandler.causeNauseaToPlayer(owner);
} else
{
for (int i = 0; i < 10; i++)
{
SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 3, x, y, z);
}
world.setBlock(x, y + 1, z, Blocks.lava, 0, 3);
data.currentEssence = currentEssence - this.getCostPerRefresh();
data.markDirty();
}
}else
{
boolean hasSanctus = this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false);
if(!hasSanctus)
{
return;
}
TileEntity tile = world.getTileEntity(x, y + 1, z);
if(tile instanceof IFluidHandler)
{
int amount = ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.LAVA, 1000), false);
if(amount >= 1000)
{
((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.LAVA, 1000), true);
this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true);
data.currentEssence = currentEssence - this.getCostPerRefresh();
data.markDirty();
}
}
}
if(this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, false) && SoulNetworkHandler.canSyphonFromOnlyNetwork(owner, fireFuseCost))
{
@ -120,6 +70,7 @@ public class RitualEffectLava extends RitualEffect
continue;
}
}
entity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFireFuse.id,100,0));
this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, true);
SoulNetworkHandler.syphonFromNetwork(owner, fireFuseCost);
@ -127,6 +78,47 @@ public class RitualEffectLava extends RitualEffect
}
}
Block block = world.getBlock(x, y + 1, z);
if (world.isAirBlock(x, y + 1, z) && !(block instanceof BlockSpectralContainer))
{
if (currentEssence < this.getCostPerRefresh())
{
SoulNetworkHandler.causeNauseaToPlayer(owner);
} else
{
for (int i = 0; i < 10; i++)
{
SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 3, x, y, z);
}
world.setBlock(x, y + 1, z, Blocks.lava, 0, 3);
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh());
}
}else
{
boolean hasSanctus = this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false);
if(!hasSanctus)
{
return;
}
TileEntity tile = world.getTileEntity(x, y + 1, z);
if(tile instanceof IFluidHandler)
{
int amount = ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.LAVA, 1000), false);
if(amount >= 1000)
{
((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.LAVA, 1000), true);
this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true);
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh());
}
}
}
}
@Override

View file

@ -30,16 +30,8 @@ public class RitualEffectLeap extends RitualEffect
public void performEffect(IMasterRitualStone ritualStone)
{
String owner = ritualStone.getOwner();
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
data = new LifeEssenceNetwork(owner);
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
@ -82,7 +74,7 @@ public class RitualEffectLeap extends RitualEffect
double motionY = hasTerrae ? 0.6 : 1.2;
double speed = hasAether ? 6.0 : 3.0;
if (!(hasTenebrae || hasSanctus) && livingEntity instanceof EntityPlayer)
if (!(hasTenebrae || hasSanctus)|| livingEntity instanceof EntityPlayer)
{
livingEntity.motionY = motionY;
livingEntity.fallDistance = 0;
@ -173,8 +165,7 @@ public class RitualEffectLeap extends RitualEffect
if (flag > 0)
{
data.currentEssence = currentEssence - this.getCostPerRefresh() * flag;
data.markDirty();
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh() * flag);
}
}
}

View file

@ -15,6 +15,7 @@ import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
@ -24,16 +25,8 @@ public class RitualEffectLifeConduit extends RitualEffect
public void performEffect(IMasterRitualStone ritualStone)
{
String owner = ritualStone.getOwner();
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
data = new LifeEssenceNetwork(owner);
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
@ -90,7 +83,7 @@ public class RitualEffectLifeConduit extends RitualEffect
{
entityOwner.setHealth(2.0f);
}
data.currentEssence = currentEssence - fillAmount*2;
SoulNetworkHandler.syphonFromNetwork(owner, fillAmount*2);
}
}

View file

@ -31,16 +31,8 @@ public class RitualEffectMagnetic extends RitualEffect
public void performEffect(IMasterRitualStone ritualStone)
{
String owner = ritualStone.getOwner();
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
data = new LifeEssenceNetwork(owner);
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
@ -114,8 +106,7 @@ public class RitualEffectMagnetic extends RitualEffect
//TODO
//Allow swapping code. This means the searched block is an ore.
BlockTeleposer.swapBlocks(world, world, x + i, j, z + k, xRep, yRep, zRep);
data.currentEssence = currentEssence - this.getCostPerRefresh();
data.markDirty();
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh());
if(hasPotentia)
{

View file

@ -19,6 +19,7 @@ import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
public class RitualEffectSoulBound extends RitualEffect
@ -27,16 +28,8 @@ public class RitualEffectSoulBound extends RitualEffect
public void performEffect(IMasterRitualStone ritualStone)
{
String owner = ritualStone.getOwner();
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
data = new LifeEssenceNetwork(owner);
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
@ -91,8 +84,7 @@ public class RitualEffectSoulBound extends RitualEffect
}
}
data.currentEssence = currentEssence - this.getCostPerRefresh();
data.markDirty();
SoulNetworkHandler.syphonFromNetwork(owner, getCostPerRefresh());
} else
{
ritualStone.setCooldown(ritualStone.getCooldown() - 1);

View file

@ -24,16 +24,8 @@ public class RitualEffectSpawnWard extends RitualEffect
public void performEffect(IMasterRitualStone ritualStone)
{
String owner = ritualStone.getOwner();
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
data = new LifeEssenceNetwork(owner);
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
@ -91,8 +83,7 @@ public class RitualEffectSpawnWard extends RitualEffect
}
data.currentEssence = currentEssence - this.getCostPerRefresh();
data.markDirty();
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh());
}
}

View file

@ -10,10 +10,12 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityMeteor;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry;
@ -24,16 +26,8 @@ public class RitualEffectSummonMeteor extends RitualEffect
public void performEffect(IMasterRitualStone ritualStone)
{
String owner = ritualStone.getOwner();
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
data = new LifeEssenceNetwork(owner);
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
@ -70,20 +64,36 @@ public class RitualEffectSummonMeteor extends RitualEffect
int meteorID = MeteorRegistry.getParadigmIDForItem(entityItem.getEntityItem());
EntityMeteor meteor = new EntityMeteor(world, x + 0.5f, 257, z + 0.5f, meteorID);
meteor.motionY = -1.0f;
if(this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, 1000, true))
{
meteor.hasTerrae = true;
}
if(this.canDrainReagent(ritualStone, ReagentRegistry.orbisTerraeReagent, 1000, true))
{
meteor.hasOrbisTerrae = true;
}
if(this.canDrainReagent(ritualStone, ReagentRegistry.crystallosReagent, 1000, true))
{
meteor.hasCrystallos = true;
}
if(this.canDrainReagent(ritualStone, ReagentRegistry.incendiumReagent, 1000, true))
{
meteor.hasIncendium = true;
}
if(this.canDrainReagent(ritualStone, ReagentRegistry.tenebraeReagent, 1000, true))
{
meteor.hasTennebrae = true;
}
entityItem.setDead();
world.spawnEntityInWorld(meteor);
ritualStone.setActive(false);
break;
}
}
// EnergyBlastProjectile proj = new EnergyBlastProjectile(world, x, y+20, z);
// proj.motionX = 0.0d;
// proj.motionZ = 0.0d;
// proj.motionY = -1.0d;
// world.spawnEntityInWorld(proj);
data.currentEssence = currentEssence - this.getCostPerRefresh();
data.markDirty();
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh());
}
}

View file

@ -16,6 +16,7 @@ import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralContainer;
@ -28,16 +29,8 @@ public class RitualEffectSupression extends RitualEffect
public void performEffect(IMasterRitualStone ritualStone)
{
String owner = ritualStone.getOwner();
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
data = new LifeEssenceNetwork(owner);
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
@ -105,8 +98,7 @@ public class RitualEffectSupression extends RitualEffect
}
data.currentEssence = currentEssence - this.getCostPerRefresh()*costMod;
data.markDirty();
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()*costMod);
if(world.getWorldTime() % 100 == 0)
{

View file

@ -33,16 +33,8 @@ public class RitualEffectUnbinding extends RitualEffect
public void performEffect(IMasterRitualStone ritualStone)
{
String owner = ritualStone.getOwner();
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
data = new LifeEssenceNetwork(owner);
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
@ -171,8 +163,7 @@ public class RitualEffectUnbinding extends RitualEffect
if(drain)
{
data.currentEssence = currentEssence - this.getCostPerRefresh();
data.markDirty();
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh());
}
}

View file

@ -24,16 +24,8 @@ public class RitualEffectVeilOfEvil extends RitualEffect
public void performEffect(IMasterRitualStone ritualStone)
{
String owner = ritualStone.getOwner();
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
data = new LifeEssenceNetwork(owner);
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
@ -91,8 +83,7 @@ public class RitualEffectVeilOfEvil extends RitualEffect
}
data.currentEssence = currentEssence - this.getCostPerRefresh();
data.markDirty();
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh());
}
}

View file

@ -30,16 +30,8 @@ public class RitualEffectWellOfSuffering extends RitualEffect
public void performEffect(IMasterRitualStone ritualStone)
{
String owner = ritualStone.getOwner();
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
data = new LifeEssenceNetwork(owner);
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
@ -99,8 +91,7 @@ public class RitualEffectWellOfSuffering extends RitualEffect
}
}
data.currentEssence = currentEssence - this.getCostPerRefresh() * entityCount;
data.markDirty();
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh() * entityCount);
}
}