LOTS of alchemy changes...
This commit is contained in:
parent
64ccc50698
commit
2b749000b6
99 changed files with 7488 additions and 659 deletions
|
@ -1,24 +1,27 @@
|
|||
package WayofTime.alchemicalWizardry.common.rituals;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
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.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class RitualEffectJumping extends RitualEffect
|
||||
{
|
||||
public static final int aetherDrain = 10;
|
||||
public static final int terraeDrain = 10;
|
||||
|
||||
@Override
|
||||
public void performEffect(IMasterRitualStone ritualStone)
|
||||
{
|
||||
|
@ -37,55 +40,62 @@ public class RitualEffectJumping extends RitualEffect
|
|||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
||||
int range = 0;
|
||||
List<EntityLivingBase> livingList = SpellHelper.getLivingEntitiesInRange(world, x+0.5, y+0.5, z+0.5, range, range);
|
||||
|
||||
if (currentEssence < this.getCostPerRefresh())
|
||||
if (currentEssence < this.getCostPerRefresh() * livingList.size())
|
||||
{
|
||||
EntityPlayer entityOwner = SpellHelper.getPlayerForUsername(owner);
|
||||
|
||||
if (entityOwner == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80));
|
||||
SoulNetworkHandler.causeNauseaToPlayer(owner);
|
||||
} else
|
||||
{
|
||||
int d0 = 0;
|
||||
AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox((double) x, (double) y + 1, (double) z, (double) (x + 1), (double) (y + 2), (double) (z + 1)).expand(d0, d0, d0);
|
||||
List list = world.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb);
|
||||
Iterator iterator = list.iterator();
|
||||
EntityLivingBase entityplayer;
|
||||
boolean flag = false;
|
||||
|
||||
while (iterator.hasNext())
|
||||
int flag = 0;
|
||||
|
||||
boolean hasAether = this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, false);
|
||||
boolean hasTerrae = this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, false);
|
||||
|
||||
for(EntityLivingBase livingEntity : livingList)
|
||||
{
|
||||
entityplayer = (EntityLivingBase) iterator.next();
|
||||
|
||||
if (entityplayer instanceof EntityPlayer)
|
||||
if(livingEntity.isSneaking())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
hasAether = hasAether && this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, false);
|
||||
hasTerrae = hasTerrae && this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, false);
|
||||
|
||||
double motionY = 1.5 * (hasAether ? 2 : 1);
|
||||
|
||||
if (livingEntity instanceof EntityPlayer)
|
||||
{
|
||||
//PacketDispatcher.sendPacketToPlayer(PacketHandler.getPlayerVelocitySettingPacket(entityplayer.motionX, 1.5, entityplayer.motionZ), (Player) entityplayer);
|
||||
SpellHelper.setPlayerSpeedFromServer((EntityPlayer)entityplayer, entityplayer.motionX, 1.5, entityplayer.motionZ);
|
||||
entityplayer.motionY = 1.5;
|
||||
entityplayer.fallDistance = 0;
|
||||
flag = true;
|
||||
SpellHelper.setPlayerSpeedFromServer((EntityPlayer)livingEntity, livingEntity.motionX, motionY, livingEntity.motionZ);
|
||||
livingEntity.motionY = motionY;
|
||||
livingEntity.fallDistance = 0;
|
||||
flag++;
|
||||
} else
|
||||
//if (!(entityplayer.getEntityName().equals(owner)))
|
||||
{
|
||||
// double xDif = entityplayer.posX - xCoord;
|
||||
// double yDif = entityplayer.posY - (yCoord + 1);
|
||||
// double zDif = entityplayer.posZ - zCoord;
|
||||
//entityplayer.motionX=0.1*xDif;
|
||||
entityplayer.motionY = 1.5;
|
||||
//entityplayer.motionZ=0.1*zDif;
|
||||
entityplayer.fallDistance = 0;
|
||||
flag = true;
|
||||
//entityplayer.addPotionEffect(new PotionEffect(Potion.confusion.id, 80));
|
||||
livingEntity.motionY = motionY;
|
||||
livingEntity.fallDistance = 0;
|
||||
flag++;
|
||||
}
|
||||
|
||||
if(hasAether)
|
||||
{
|
||||
this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, true);
|
||||
}
|
||||
if(hasTerrae)
|
||||
{
|
||||
if(!livingEntity.isPotionActive(AlchemicalWizardry.customPotionFeatherFall))
|
||||
{
|
||||
livingEntity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFeatherFall.id, 3 * 20, 0));
|
||||
this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag)
|
||||
if (flag > 0)
|
||||
{
|
||||
data.currentEssence = currentEssence - this.getCostPerRefresh();
|
||||
data.currentEssence = currentEssence - this.getCostPerRefresh()*flag;
|
||||
data.markDirty();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue