use of uk.co.wehavecookies56.kk.common.network.packet.client.SpawnAeroParticles in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class EntityAero method onUpdate.
@Override
public void onUpdate() {
if (player == null)
return;
int rotation = 0;
if (!world.isRemote)
PacketDispatcher.sendToAllAround(new SpawnAeroParticles(this, 1), player, 64.0D);
double r = 1.5D;
for (int a = 1; a <= 360; a += 15) {
double x = this.posX + (r * Math.cos(Math.toRadians(a)));
double z = this.posZ + (r * Math.sin(Math.toRadians(a)));
this.world.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, x, this.posY, z, 0.0D, 0.5D, 0.0D);
}
this.rotationYaw = (rotation + 1) % 360;
if (ticksExisted > 30)
setDead();
if (ticksExisted < 10)
player.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0D);
else
player.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.10000000149011612D);
AxisAlignedBB aabb = player.getEntityBoundingBox().grow(2, 2, 2);
List list = this.world.getEntitiesWithinAABBExcludingEntity(player, aabb);
if (!list.isEmpty())
for (int i = 0; i < list.size(); i++) {
Entity e = (Entity) list.get(i);
if (e instanceof EntityLivingBase) {
e.attackEntityFrom(DamageSource.causePlayerDamage(player), DamageCalculation.getMagicDamage(player, 1) * DamageCalculation.aeroMultiplier);
double d = e.posX - posX;
double d1;
for (d1 = e.posZ - posZ; d * d + d1 * d1 < 0.0001D; d1 = (Math.random() - Math.random()) * 0.01D) d = (Math.random() - Math.random()) * 0.01D;
((EntityLivingBase) e).knockBack(e, 1, d, d1);
e.motionY *= 1.2;
}
}
aabb.grow(-2, -2, -2);
super.onUpdate();
}
use of uk.co.wehavecookies56.kk.common.network.packet.client.SpawnAeroParticles in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class EntityAeroga method onUpdate.
@Override
public void onUpdate() {
if (player == null)
return;
int rotation = 0;
if (!world.isRemote)
PacketDispatcher.sendToAllAround(new SpawnAeroParticles(this, 3), player, 64.0D);
double r = 4D;
for (int a = 1; a <= 360; a += 15) {
double x = this.posX + (r * Math.cos(Math.toRadians(a)));
double z = this.posZ + (r * Math.sin(Math.toRadians(a)));
this.world.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, x, this.posY, z, 0.0D, 0.5D, 0.0D);
}
this.rotationYaw = (rotation + 1) % 360;
if (ticksExisted > 30)
setDead();
if (ticksExisted < 10)
player.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0D);
else
player.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.10000000149011612D);
AxisAlignedBB aabb = player.getEntityBoundingBox().grow(r, r, r);
List list = this.world.getEntitiesWithinAABBExcludingEntity(player, aabb);
if (!list.isEmpty())
for (int i = 0; i < list.size(); i++) {
Entity e = (Entity) list.get(i);
if (e instanceof EntityLivingBase) {
e.attackEntityFrom(DamageSource.causePlayerDamage(player), DamageCalculation.getMagicDamage(player, 3) * DamageCalculation.aeroMultiplier);
double d = e.posX - posX;
double d1;
for (d1 = e.posZ - posZ; d * d + d1 * d1 < 0.0001D; d1 = (Math.random() - Math.random()) * 0.01D) d = (Math.random() - Math.random()) * 0.01D;
((EntityLivingBase) e).knockBack(e, 1, d, d1);
e.motionY *= 1.2;
}
}
aabb.grow(-r, -r, -r);
super.onUpdate();
}
use of uk.co.wehavecookies56.kk.common.network.packet.client.SpawnAeroParticles in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class EntityAerora method onUpdate.
@Override
public void onUpdate() {
if (player == null)
return;
int rotation = 0;
if (!world.isRemote)
PacketDispatcher.sendToAllAround(new SpawnAeroParticles(this, 3), player, 64.0D);
double r = 3D;
for (int a = 1; a <= 360; a += 15) {
double x = this.posX + (r * Math.cos(Math.toRadians(a)));
double z = this.posZ + (r * Math.sin(Math.toRadians(a)));
this.world.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, x, this.posY, z, 0.0D, 0.5D, 0.0D);
}
this.rotationYaw = (rotation + 1) % 360;
if (ticksExisted > 30)
setDead();
if (ticksExisted < 10)
player.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0D);
else
player.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.10000000149011612D);
AxisAlignedBB aabb = player.getEntityBoundingBox().grow(r, r, r);
List list = this.world.getEntitiesWithinAABBExcludingEntity(player, aabb);
if (!list.isEmpty())
for (int i = 0; i < list.size(); i++) {
Entity e = (Entity) list.get(i);
if (e instanceof EntityLivingBase) {
e.attackEntityFrom(DamageSource.causePlayerDamage(player), DamageCalculation.getMagicDamage(player, 3) * DamageCalculation.aeroMultiplier);
double d = e.posX - posX;
double d1;
for (d1 = e.posZ - posZ; d * d + d1 * d1 < 0.0001D; d1 = (Math.random() - Math.random()) * 0.01D) d = (Math.random() - Math.random()) * 0.01D;
((EntityLivingBase) e).knockBack(e, 1, d, d1);
e.motionY *= 1.2;
}
}
aabb.grow(-r, -r, -r);
super.onUpdate();
}
use of uk.co.wehavecookies56.kk.common.network.packet.client.SpawnAeroParticles in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class MagicAero method process.
@Override
public void process(EntityPlayer player, Side side) {
if (!player.getCapability(ModCapabilities.CHEAT_MODE, null).getCheatMode())
player.getCapability(ModCapabilities.PLAYER_STATS, null).remMP(Constants.getCost(Strings.Spell_Aero));
World world = player.world;
if (!world.isRemote) {
switch(player.getCapability(ModCapabilities.MAGIC_STATE, null).getMagicLevel(Strings.Spell_Aero)) {
case 1:
world.spawnEntity(new EntityAero(world, player, player.posX, player.posY, player.posZ));
PacketDispatcher.sendToAllAround(new SpawnAeroParticles(player, 1), player, 64.0D);
break;
case 2:
world.spawnEntity(new EntityAerora(world, player, player.posX, player.posY, player.posZ));
PacketDispatcher.sendToAllAround(new SpawnAeroParticles(player, 2), player, 64.0D);
break;
case 3:
world.spawnEntity(new EntityAeroga(world, player, player.posX, player.posY, player.posZ));
PacketDispatcher.sendToAllAround(new SpawnAeroParticles(player, 3), player, 64.0D);
break;
}
PacketDispatcher.sendTo(new SyncMagicData(player.getCapability(ModCapabilities.MAGIC_STATE, null), player.getCapability(ModCapabilities.PLAYER_STATS, null)), (EntityPlayerMP) player);
}
}
Aggregations