Move screen shaking effect into a proper method in the client proxy, fix earthquake's version not working and add screen shake to meteor, lightning hammer and shockwave

This commit is contained in:
Electroblob77
2020-02-19 00:11:33 +00:00
parent 0328f41564
commit 794085660e
8 changed files with 61 additions and 22 deletions
@@ -1,5 +1,6 @@
package electroblob.wizardry.spell;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.entity.construct.EntityEarthquake;
import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.util.SpellModifiers;
@@ -7,6 +8,7 @@
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
@@ -53,6 +55,10 @@
world.spawnParticle(EnumParticleTypes.BLOCK_DUST, particleX, y,
particleZ, particleX - x, 0, particleZ - z, Block.getStateId(block));
}
WizardryUtilities.getEntitiesWithinRadius(15, x, y, z, world, EntityPlayer.class)
.forEach(p -> Wizardry.proxy.shakeScreen(p, 12));
}
return super.spawnConstruct(world, x, y, z, side, caster, modifiers);
@@ -41,12 +41,17 @@ public class Shockwave extends Spell {
for(EntityLivingBase target : targets){
if(target instanceof EntityPlayer && (!Wizardry.settings.playersMoveEachOther
|| ItemArtefact.isArtefactActive((EntityPlayer)target, WizardryItems.amulet_anchoring))){
if(target instanceof EntityPlayer){
if(!world.isRemote) caster.sendStatusMessage(new TextComponentTranslation("spell.resist",
target.getName(), this.getNameForTranslationFormatted()), true);
return false;
Wizardry.proxy.shakeScreen((EntityPlayer)target, 10);
if(!Wizardry.settings.playersMoveEachOther) continue;
if(ItemArtefact.isArtefactActive((EntityPlayer)target, WizardryItems.amulet_anchoring)){
if(!world.isRemote) caster.sendStatusMessage(new TextComponentTranslation("spell.resist",
target.getName(), this.getNameForTranslationFormatted()), true);
continue;
}
}
if(AllyDesignationSystem.isValidTarget(caster, target)){