diff --git a/changelog.txt b/changelog.txt index 9910ff14..2fd344e1 100644 --- a/changelog.txt +++ b/changelog.txt @@ -195,3 +195,7 @@ Additions: - Fixed a bug where breaking any block with shears would drop Atropa Belladona. - Removed logo from mcmod.info - reduces archive size. + +----------------------------------------------------------- 8.1.0 -------------------------------------------------------------- + +- Changed the way Salis Aevus and Salis Tempestas work, and added visual effects. diff --git a/src/main/java/taintedmagic/common/items/ItemSalis.java b/src/main/java/taintedmagic/common/items/ItemSalis.java index 6f0072d7..09739c21 100644 --- a/src/main/java/taintedmagic/common/items/ItemSalis.java +++ b/src/main/java/taintedmagic/common/items/ItemSalis.java @@ -1,18 +1,21 @@ package taintedmagic.common.items; import java.util.List; +import java.util.Random; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.item.EntityItem; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; import taintedmagic.common.TaintedMagic; +import thaumcraft.client.fx.ParticleEngine; +import thaumcraft.client.fx.particles.FXSparkle; public class ItemSalis extends Item { @@ -58,25 +61,67 @@ public String getUnlocalizedName (final ItemStack stack) { } @Override - public ItemStack onItemRightClick (final ItemStack stack, final World world, final EntityPlayer player) { - final int meta = stack.getItemDamage(); - switch (meta) { - // Weather - case 0 : { - world.getWorldInfo().setRainTime(world.isRaining() ? 24000 : 0); - world.getWorldInfo().setRaining(!world.isRaining()); - player.playSound("thaumcraft:wind", 0.3F, 1.0F + world.rand.nextFloat() * 0.5F); - player.inventory.decrStackSize(player.inventory.currentItem, 1); - return stack; + public boolean onEntityItemUpdate (final EntityItem entity) { + super.onEntityItemUpdate(entity); + final World world = entity.worldObj; + final int meta = entity.getEntityItem().getItemDamage(); + + if (entity.ticksExisted == 100) { + switch (meta) { + // Weather + case 0 : { + world.getWorldInfo().setRainTime(world.isRaining() ? 24000 : 0); + world.getWorldInfo().setRaining(!world.isRaining()); + if (world.isRaining() && world.rand.nextInt(10) == 0) { + world.getWorldInfo().setThundering(true); + } + break; + } + // Time + case 1 : { + world.setWorldTime(world.isDaytime() ? 14000 : 24000); + break; + } + } + world.playSoundAtEntity(entity, "thaumcraft:ice", 0.3F, 1.0F + world.rand.nextFloat() * 0.25F); + entity.setDead(); + if (world.isRemote) { + for (int i = 0; i < 200; i++) { + spawnParticles(entity, meta, true); + } + } + return false; + } + if (entity.ticksExisted % 30 == 1) { + world.playSoundAtEntity(entity, "thaumcraft:wind", 0.1F, 1.0F + world.rand.nextFloat() * 0.5F); } - // Time - case 1 : { - world.setWorldTime(world.isDaytime() ? 14000 : 24000); - player.playSound("thaumcraft:wind", 0.3F, 1.0F + world.rand.nextFloat() * 0.5F); - player.inventory.decrStackSize(player.inventory.currentItem, 1); - return stack; + if (world.isRemote) { + spawnParticles(entity, meta, false); } + return false; + } + + @SideOnly (Side.CLIENT) + private void spawnParticles (final EntityItem entity, final int meta, final boolean death) { + final Random rand = entity.worldObj.rand; + + final double theta = Math.random() * Math.PI; + final double phi = Math.random() * Math.PI * 2d; + + final double x = Math.cos(phi) * Math.sin(theta) * 0.25d; + final double y = Math.sin(phi) * Math.sin(theta) * 0.25d; + final double z = Math.cos(theta) * 0.25d; + + final FXSparkle fx = new FXSparkle(entity.worldObj, entity.posX + x, entity.boundingBox.maxY + y, entity.posZ + z, + 1.75f, meta == 0 ? 7 : 6, death ? 30 + rand.nextInt(5) : 3 + rand.nextInt(2)); + fx.setGravity(death ? 0f : -0.1f); + fx.noClip = true; + + if (death) { + fx.motionX = x * 3d; + fx.motionY = y * 3d; + fx.motionZ = z * 3d; } - return stack; + ParticleEngine.instance.addEffect(entity.worldObj, fx); } } diff --git a/src/main/resources/assets/taintedmagic/lang/en_US.lang b/src/main/resources/assets/taintedmagic/lang/en_US.lang index b594bcac..ccc2c0d7 100644 --- a/src/main/resources/assets/taintedmagic/lang/en_US.lang +++ b/src/main/resources/assets/taintedmagic/lang/en_US.lang @@ -263,12 +263,12 @@ tm.text.THAUMICDISASSEMBLER.1=You have constructed a high-tech magical multitool #SKYSALT tm.name.SKYSALT=Salis Tempestas tm.tag.SKYSALT=Susano'o -tm.text.SKYSALT.1=By combining a Fragment of Creation with some other magical ingredients, you have created a peculiar new type of salis.
When this salis is thrown into the air (via right-click), it instantly interacts with the primal aspects of the atmosphere. If the skies are stormy, they will soon become clear, or if the skies are clear, they will soon become stormy. +tm.text.SKYSALT.1=By combining a Fragment of Creation with some other magical ingredients, you have created a useful new type of salis.
When thrown into the world, the salis will begin to interact with the worlds creation magics. After a few seconds, the item will dissipate. When the salis dissipates, if the skies are stormy, they will become clear, or if the skies are clear, they will become stormy. #TIMESALT tm.name.TIMESALT=Salis Aevus tm.tag.TIMESALT=Amaterasu -tm.text.TIMESALT.1=By combining a Fragment of Creation with some other magical ingredients, you have created a peculiar new type of salis.
When this salis is thrown into the air (via right-click), it instantly interacts with the primal aspects of the space-time continuum. If it is nighttime, it will instantly become day, or if it is daytime, it will instantly become night. +tm.text.TIMESALT.1=By combining a Fragment of Creation with some other magical ingredients, you have created a useful new type of salis.
When thrown into the world, the salis will begin to interact with the world's creation magics. After a few seconds, the item will dissipate. When salis dissipates, if it is nighttime, it will become day, or if it is daytime, it will become night. #VOIDSASH tm.name.VOIDSASH=Voidwalker's Sash of Runic Shielding