diff --git a/build.properties b/build.properties index 03699dc..98567a3 100644 --- a/build.properties +++ b/build.properties @@ -1,3 +1,3 @@ -mod_version=r7.1 +mod_version=r7.2 mod_name=Tainted-Magic minecraft_version=1.7.10 \ No newline at end of file diff --git a/src/main/java/taintedmagic/client/ClientProxy.java b/src/main/java/taintedmagic/client/ClientProxy.java index d45ba0c..9bfafac 100644 --- a/src/main/java/taintedmagic/client/ClientProxy.java +++ b/src/main/java/taintedmagic/client/ClientProxy.java @@ -1,7 +1,6 @@ package taintedmagic.client; import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import net.minecraftforge.client.MinecraftForgeClient; @@ -10,11 +9,10 @@ import taintedmagic.client.handler.HUDHandler; import taintedmagic.client.renderer.RenderItemKatana; import taintedmagic.client.renderer.RenderTaintBubble; import taintedmagic.common.CommonProxy; -import taintedmagic.common.TaintedMagic; import taintedmagic.common.entities.EntityEldritchOrbAttack; import taintedmagic.common.entities.EntityTaintBubble; +import taintedmagic.common.helper.TaintedMagicHelper; import taintedmagic.common.helper.Vector3; -import taintedmagic.common.items.tools.ItemKatana; import taintedmagic.common.registry.ItemRegistry; import thaumcraft.client.fx.ParticleEngine; import thaumcraft.client.fx.particles.FXWisp; @@ -70,7 +68,7 @@ public class ClientProxy extends CommonProxy ef.setGravity(0.0F); ef.shrink = true; ef.noClip = true; - Vector3 movement = getDistanceVectorBetween(ef, p); + Vector3 movement = TaintedMagicHelper.getDistanceBetween(ef, p); ef.addVelocity(movement.x * 2.5, 0, movement.z * 2.5); ParticleEngine.instance.addEffect(w, ef); @@ -78,12 +76,30 @@ public class ClientProxy extends CommonProxy } } - public static Vector3 getDistanceVectorBetween (Entity e, Entity target) + @Override + public void spawnWindParticles (World w) { - Vector3 fromPosition = new Vector3(e.posX, e.posY, e.posZ); - Vector3 toPosition = new Vector3(target.posX, target.posY, target.posZ); - Vector3 dist = fromPosition.sub(toPosition); - dist.normalize(); - return dist; + EntityPlayer p = getClientPlayer(); + + for (int i = 1; i < 150; i++) + { + double xp = (-Math.random() * 5.0F) + (Math.random() * 5.0F); + double zp = (-Math.random() * 5.0F) + (Math.random() * 5.0F); + double yp = (-Math.random() * 5.0F) + (Math.random() * 5.0F); + double off = Math.random() * 0.1; + + float red = (0.8F + p.worldObj.rand.nextFloat() * 0.5F); + float green = (0.8F + p.worldObj.rand.nextFloat() * 0.5F); + float blue = (0.6F + p.worldObj.rand.nextFloat() * 0.5F); + + FXWisp ef = new FXWisp(w, p.posX + xp + off, p.posY + yp + off, p.posZ + zp + off, 0.25F + ((float) Math.random() * 0.25F), red, green, blue); + ef.setGravity(0.0F); + ef.shrink = true; + ef.noClip = true; + Vector3 movement = TaintedMagicHelper.getDistanceBetween(ef, p); + ef.addVelocity(movement.x * 0.5, 0, movement.z * 0.5); + + ParticleEngine.instance.addEffect(w, ef); + } } } diff --git a/src/main/java/taintedmagic/client/handler/HUDHandler.java b/src/main/java/taintedmagic/client/handler/HUDHandler.java index d7e6f68..cefae17 100644 --- a/src/main/java/taintedmagic/client/handler/HUDHandler.java +++ b/src/main/java/taintedmagic/client/handler/HUDHandler.java @@ -1,9 +1,11 @@ package taintedmagic.client.handler; import net.minecraft.client.Minecraft; -import net.minecraft.item.ItemStack; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; +import taintedmagic.common.items.tools.ItemKatana; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class HUDHandler @@ -14,7 +16,14 @@ public class HUDHandler if (event.type == ElementType.ALL) { Minecraft mc = Minecraft.getMinecraft(); - ItemStack equippedStack = mc.thePlayer.getCurrentEquippedItem(); + EntityPlayer p = mc.thePlayer; + ScaledResolution r = event.resolution; + float pt = event.partialTicks; + + if (mc.currentScreen == null) + { + ItemKatana.renderHUD(r, p, pt); + } } } } diff --git a/src/main/java/taintedmagic/client/helper/TaintedMagicClientHelper.java b/src/main/java/taintedmagic/client/helper/TaintedMagicClientHelper.java new file mode 100644 index 0000000..051616b --- /dev/null +++ b/src/main/java/taintedmagic/client/helper/TaintedMagicClientHelper.java @@ -0,0 +1,44 @@ +package taintedmagic.client.helper; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; + +import org.lwjgl.opengl.GL11; + +import thaumcraft.client.lib.UtilsFX; + +public class TaintedMagicClientHelper +{ + /** + * TC method to draw runes on runed staves + */ + public static void drawRune (double x, double y, double z, int rune, EntityPlayer player) + { + GL11.glPushMatrix(); + UtilsFX.bindTexture("textures/misc/script.png"); + float r = MathHelper.sin( (player.ticksExisted + rune * 5) / 5.0F) * 0.1F + 0.88F; + float g = MathHelper.sin( (player.ticksExisted + rune * 5) / 7.0F) * 0.1F + 0.63F; + float alpha = MathHelper.sin( (player.ticksExisted + rune * 5) / 10.0F) * 0.3F; + + GL11.glColor4f(r, g, 0.2F, alpha + 0.6F); + GL11.glRotated(90.0D, 0.0D, 0.0D, 1.0D); + GL11.glTranslated(x, y, z); + + Tessellator tessellator = Tessellator.instance; + float f = 0.0625F * rune; + float f1 = f + 0.0625F; + float f2 = 0.0F; + float f3 = 1.0F; + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_F(r, g, 0.2F, alpha + 0.6F); + tessellator.addVertexWithUV(-0.06D - alpha / 40.0F, 0.06D + alpha / 40.0F, 0.0D, f1, f3); + tessellator.addVertexWithUV(0.06D + alpha / 40.0F, 0.06D + alpha / 40.0F, 0.0D, f1, f2); + tessellator.addVertexWithUV(0.06D + alpha / 40.0F, -0.06D - alpha / 40.0F, 0.0D, f, f2); + tessellator.addVertexWithUV(-0.06D - alpha / 40.0F, -0.06D - alpha / 40.0F, 0.0D, f, f3); + tessellator.draw(); + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/taintedmagic/client/model/ModelKatana.java b/src/main/java/taintedmagic/client/model/ModelKatana.java index 7f2a573..306601f 100644 --- a/src/main/java/taintedmagic/client/model/ModelKatana.java +++ b/src/main/java/taintedmagic/client/model/ModelKatana.java @@ -10,9 +10,9 @@ import net.minecraft.client.model.ModelRenderer; */ public class ModelKatana extends ModelBase { - ModelRenderer blade; - ModelRenderer grip1; - ModelRenderer grip2; + public ModelRenderer blade; + public ModelRenderer grip1; + public ModelRenderer grip2; public ModelKatana () { diff --git a/src/main/java/taintedmagic/client/renderer/RenderItemKatana.java b/src/main/java/taintedmagic/client/renderer/RenderItemKatana.java index b420cbe..30be09c 100644 --- a/src/main/java/taintedmagic/client/renderer/RenderItemKatana.java +++ b/src/main/java/taintedmagic/client/renderer/RenderItemKatana.java @@ -2,19 +2,20 @@ package taintedmagic.client.renderer; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; +import net.minecraft.util.MathHelper; import net.minecraftforge.client.IItemRenderer; -import net.minecraftforge.client.IItemRenderer.ItemRenderType; import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; +import org.lwjgl.opengl.GL21; -import taintedmagic.client.model.ModelKatana; -import taintedmagic.client.model.ModelSaya; +import taintedmagic.client.helper.TaintedMagicClientHelper; import taintedmagic.common.TaintedMagic; import taintedmagic.common.items.tools.ItemKatana; -import thaumcraft.common.config.ConfigItems; +import thaumcraft.client.lib.UtilsFX; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -44,41 +45,6 @@ public class RenderItemKatana implements IItemRenderer GL11.glScalef(1.4F, 1.4F, 1.4F); - GL11.glPushMatrix(); - - if (t == ItemRenderType.ENTITY) - { - GL11.glScalef(0.5F, 0.5F, 0.5F); - GL11.glTranslatef(0F, 0.5F, 0F); - GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F); - } - - else if (t == ItemRenderType.EQUIPPED_FIRST_PERSON) - { - GL11.glScalef(2F, 2F, 2F); - GL11.glTranslatef(2.25F, 1.75F, -0.2F); - GL11.glRotatef(-10F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-10F, 0.0F, 0.0F, 1.0F); - } - else if (t == ItemRenderType.INVENTORY) - { - GL11.glScalef(0.4F, 0.4F, 0.4F); - GL11.glRotatef(-65, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(-50, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(1F, 1F, 0.0F); - } - else - { - GL11.glRotatef(60, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-40, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(70, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, 2F, 0.65F); - } - - Minecraft.getMinecraft().renderEngine.bindTexture(ItemKatana.getTexture(s)); - ItemKatana.katana.render(0.0625F); - GL11.glPopMatrix(); - if (p.getHeldItem() == null || ! (p.getHeldItem() == s)) { GL11.glPushMatrix(); @@ -104,8 +70,82 @@ public class RenderItemKatana implements IItemRenderer ItemKatana.saya.render(0.0625F); GL11.glPopMatrix(); } - GL11.glScalef(1.0F, 1.0F, 1.0F); + GL11.glPushMatrix(); + + if (t == ItemRenderType.ENTITY) + { + GL11.glScalef(0.5F, 0.5F, 0.5F); + GL11.glTranslatef(0F, 0.5F, 0F); + GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F); + } + + else if (t == ItemRenderType.EQUIPPED_FIRST_PERSON) + { + if (p.isUsingItem()) + { + GL11.glTranslatef(5.0F, 1.0F, -0.2F); + GL11.glRotatef(155.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-20.0F, 1.0F, 0.0F, 0.0F); + GL11.glTranslatef(0.0F, -0.25F, 0.0F); + } + GL11.glScalef(1.5F, 1.5F, 1.5F); + GL11.glTranslatef(2.0F, 1.85F, -0.25F); + GL11.glRotatef(-10F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-10F, 0.0F, 0.0F, 1.0F); + } + else if (t == ItemRenderType.INVENTORY) + { + GL11.glScalef(0.4F, 0.4F, 0.4F); + GL11.glRotatef(-65, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(-50, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(1F, 1F, 0.0F); + } + else + { + GL11.glRotatef(60, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-40, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(70, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(0.0F, 2F, 0.65F); + } + + Minecraft.getMinecraft().renderEngine.bindTexture(ItemKatana.getTexture(s)); + + ItemKatana.katana.render(0.0625F); + + // Runes + if (ItemKatana.hasAnyInscription(s)) + { + GL11.glPushMatrix(); + int j = 200; + int k = j % 65536; + int l = j / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, k / 1.0F, l / 1.0F); + + GL11.glEnable(GL11.GL_BLEND); + + GL11.glBlendFunc(770, 1); + GL11.glRotated(90.0D, 0.0D, 1.0D, 0.0D); + for (int a = 0; a < 14; a++) + { + int rune = (a * 3) % 16; + TaintedMagicClientHelper.drawRune(-1.65D + a * 0.14D, 0D, -0.03D, rune, p); + } + GL11.glRotated(180.0D, 0.0D, 1.0D, 0.0D); + for (int a = 0; a < 14; a++) + { + int rune = (a + 1 * 3) % 16; + TaintedMagicClientHelper.drawRune(-1.65D + a * 0.14D, 0D, -0.03D, rune, p); + } + GL11.glBlendFunc(770, 771); + GL11.glDisable(GL11.GL_BLEND); + + GL11.glPopMatrix(); + } + + GL11.glPopMatrix(); + + GL11.glScalef(1.0F, 1.0F, 1.0F); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glPopMatrix(); diff --git a/src/main/java/taintedmagic/client/renderer/RenderTaintBubble.java b/src/main/java/taintedmagic/client/renderer/RenderTaintBubble.java index ebd7232..d62ebc9 100644 --- a/src/main/java/taintedmagic/client/renderer/RenderTaintBubble.java +++ b/src/main/java/taintedmagic/client/renderer/RenderTaintBubble.java @@ -33,22 +33,21 @@ public class RenderTaintBubble extends Render GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); GL11.glDepthMask(true); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F); Minecraft.getMinecraft().renderEngine.bindTexture(texture); - int p = (int) (8.0F * (bubble.ticksExisted / bubble.duration)); + int p = (int) (7.0F * ((float) bubble.ticksExisted / (float) bubble.duration)); float f2 = 0; float f3 = 1; - float f4 = (6 + p) / 16F; - float f5 = f4 + 0.125F; + float f4 = p / 8.0F; + float f5 = (p + 1) / 8.0F; float f6 = 1.0F; float f7 = 0.5F; float f8 = 0.5F; - float fc = bubble.ticksExisted / bubble.duration; - - float s = 0.25F + fc; + float s = 0.5F; GL11.glScalef(s, s, s); @@ -56,9 +55,9 @@ public class RenderTaintBubble extends Render GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); t.startDrawingQuads(); - t.setBrightness(220); + t.setBrightness(240); t.setNormal(0.0F, 1.0F, 0.0F); - t.setColorRGBA_F(0.3F, 0.0F, 0.3F, 1F); + t.setColorRGBA_F(1.0F, 1.0F, 1.0F, 0.9F); t.addVertexWithUV(-f7, -f8, 0.0D, f2, f5); t.addVertexWithUV(f6 - f7, -f8, 0.0D, f3, f5); @@ -68,7 +67,7 @@ public class RenderTaintBubble extends Render t.draw(); GL11.glDisable(GL11.GL_BLEND); - + GL11.glDisable(32826); GL11.glPopMatrix(); } diff --git a/src/main/java/taintedmagic/common/CommonProxy.java b/src/main/java/taintedmagic/common/CommonProxy.java index ab98b55..3ebcbc9 100644 --- a/src/main/java/taintedmagic/common/CommonProxy.java +++ b/src/main/java/taintedmagic/common/CommonProxy.java @@ -30,4 +30,8 @@ public class CommonProxy public void spawnShockwaveParticles (World w) { } + + public void spawnWindParticles (World w) + { + } } diff --git a/src/main/java/taintedmagic/common/TaintedMagic.java b/src/main/java/taintedmagic/common/TaintedMagic.java index c0d772b..a20a968 100644 --- a/src/main/java/taintedmagic/common/TaintedMagic.java +++ b/src/main/java/taintedmagic/common/TaintedMagic.java @@ -20,6 +20,7 @@ import taintedmagic.common.handler.UpdateHandler; import taintedmagic.common.lib.LibCreativeTab; import taintedmagic.common.lib.LibRecipes; import taintedmagic.common.lib.LibStrings; +import taintedmagic.common.network.PacketHandler; import taintedmagic.common.registry.BlockRegistry; import taintedmagic.common.registry.ItemRegistry; import taintedmagic.common.registry.ModEntityRegistry; @@ -63,6 +64,7 @@ public class TaintedMagic proxy.registerClientHandlers(); + PacketHandler.init(); ItemRegistry.init(); BlockRegistry.init(); ModEntityRegistry.init(); diff --git a/src/main/java/taintedmagic/common/helper/TaintedMagicHelper.java b/src/main/java/taintedmagic/common/helper/TaintedMagicHelper.java index 0fe0678..cac9119 100644 --- a/src/main/java/taintedmagic/common/helper/TaintedMagicHelper.java +++ b/src/main/java/taintedmagic/common/helper/TaintedMagicHelper.java @@ -1,5 +1,6 @@ package taintedmagic.common.helper; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import taintedmagic.api.IBloodlust; @@ -12,4 +13,21 @@ public class TaintedMagicHelper { return new AspectList().add(Aspect.FIRE, amount).add(Aspect.WATER, amount).add(Aspect.EARTH, amount).add(Aspect.AIR, amount).add(Aspect.ORDER, amount).add(Aspect.ENTROPY, amount); } + + public static Vector3 getDistanceBetween (Entity e, Entity target) + { + Vector3 fromPosition = new Vector3(e.posX, e.posY, e.posZ); + Vector3 toPosition = new Vector3(target.posX, target.posY, target.posZ); + Vector3 dist = fromPosition.sub(toPosition); + dist.normalize(); + return dist; + } + + public static double getDistanceTo (double x, double y, double z, EntityPlayer p) + { + double var7 = p.posX + 0.5D - x; + double var9 = p.posY + 0.5D - y; + double var11 = p.posZ + 0.5D - z; + return var7 * var7 + var9 * var9 + var11 * var11; + } } diff --git a/src/main/java/taintedmagic/common/items/tools/ItemKatana.java b/src/main/java/taintedmagic/common/items/tools/ItemKatana.java index b8c3e77..0507550 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemKatana.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemKatana.java @@ -2,8 +2,11 @@ package taintedmagic.common.items.tools; import java.util.List; +import net.minecraft.block.Block; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -12,11 +15,15 @@ import net.minecraft.item.EnumAction; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; @@ -24,13 +31,21 @@ import net.minecraftforge.client.event.RenderPlayerEvent; import net.minecraftforge.common.MinecraftForge; import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; import taintedmagic.client.model.ModelKatana; import taintedmagic.client.model.ModelSaya; import taintedmagic.common.TaintedMagic; +import taintedmagic.common.entities.EntityTaintBubble; +import taintedmagic.common.helper.TaintedMagicHelper; +import taintedmagic.common.helper.Vector3; +import taintedmagic.common.network.PacketAttackEntityFromClient; +import taintedmagic.common.network.PacketHandler; import thaumcraft.api.IRepairable; import thaumcraft.api.IWarpingGear; +import thaumcraft.api.wands.FocusUpgradeType; import thaumcraft.common.config.Config; +import thaumcraft.common.entities.projectile.EntityEmber; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -51,6 +66,7 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable this.setCreativeTab(TaintedMagic.tabTaintedMagic); this.setUnlocalizedName("ItemKatana"); this.setHasSubtypes(true); + this.setMaxStackSize(1); MinecraftForge.EVENT_BUS.register(this); } @@ -69,16 +85,54 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable } if (s.getItemDamage() == 2) { - e.addPotionEffect(new PotionEffect(Potion.wither.getId(), 60)); + e.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 120, 2)); e.addPotionEffect(new PotionEffect(Config.potionBlurredID, 120)); } } catch (Exception ex) { } - e.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) p), getAttackDamage(s)); + if (hasAnyInscription(s)) + { + switch (getInscription(s)) + { + case 0 : + { + e.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) p).setFireDamage().setDamageBypassesArmor(), getAttackDamage(s)); + e.setFire(5); + break; + } + case 1 : + { + e.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) p).setMagicDamage().setDamageBypassesArmor(), getAttackDamage(s)); + + try + { + e.addPotionEffect(new PotionEffect(Config.potionTaintPoisonID, 100)); + } + catch (Exception ex) + { + } + break; + } + case 2 : + { + e.attackEntityFrom(new DamageSource("wind").setMagicDamage().setDamageBypassesArmor(), getAttackDamage(s)); + + try + { + e.addPotionEffect(new PotionEffect(Potion.wither.id, 60)); + } + catch (Exception ex) + { + } + break; + } + } + } + else e.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) p), getAttackDamage(s)); } - p.worldObj.playSoundAtEntity(p, "thaumcraft:swing", 1.0F, 1.0F); + p.worldObj.playSoundAtEntity(p, "thaumcraft:swing", 0.5F + (float) Math.random(), 0.5F + (float) Math.random()); return super.hitEntity(s, e, p); } @@ -89,6 +143,18 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable return true; } + @Override + public boolean canHarvestBlock (Block b, ItemStack s) + { + return false; + } + + @Override + public EnumAction getItemUseAction (ItemStack s) + { + return EnumAction.bow; + } + @SideOnly (Side.CLIENT) public void getSubItems (Item item, CreativeTabs c, List l) { @@ -107,12 +173,11 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable if (s.getItemDamage() == 1) l.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("enchantment.special.sapgreat")); l.add(" "); l.add("\u00A79+" + getAttackDamage(s) + " " + StatCollector.translateToLocal("text.attackdamage")); - } - @Override - public EnumAction getItemUseAction (ItemStack s) - { - return EnumAction.block; + if (s.hasTagCompound() && s.stackTagCompound.hasKey("inscription")) + { + l.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("text.katana.inscription." + s.stackTagCompound.getInteger("inscription"))); + } } @Override @@ -128,13 +193,119 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable case 0 : return 14.25F; case 1 : - return 17.75F; + return 17.55F; case 2 : - return 20.5F; + return 20.75F; } return 0; } + @Override + public int getMaxItemUseDuration (ItemStack s) + { + return 72000; + } + + @Override + public ItemStack onItemRightClick (ItemStack s, World w, EntityPlayer p) + { + p.setItemInUse(s, getMaxItemUseDuration(s)); + return s; + } + + @Override + public void onUsingTick (ItemStack s, EntityPlayer p, int i) + { + super.onUsingTick(s, p, i); + float j = 1.0F + (Math.min(1.0F * (float) p.getItemInUseDuration() / 30, 1.0F) + ((float) Math.random() * 0.25F)); + if (p.ticksExisted % 5 == 0) p.worldObj.playSoundAtEntity(p, "thaumcraft:wind", j * 0.1F, j); + } + + @Override + public void onPlayerStoppedUsing (ItemStack s, World w, EntityPlayer p, int i) + { + super.onPlayerStoppedUsing(s, w, p, i); + if (!hasAnyInscription(s) || castType(p) == 0 || p.isSneaking()) + { + if (w.isRemote) + { + MovingObjectPosition mop = Minecraft.getMinecraft().objectMouseOver; + float mul = Math.min(1.0F + (float) p.getItemInUseDuration() / 40.0F, 2.0F); + + if (mop.entityHit != null) PacketHandler.INSTANCE.sendToServer(new PacketAttackEntityFromClient(mop.entityHit, p, this.getAttackDamage(s) * mul)); + + p.swingItem(); + } + p.worldObj.playSoundAtEntity(p, "thaumcraft:swing", 0.5F + (float) Math.random(), 0.5F + (float) Math.random()); + } + else if (hasAnyInscription(s) && castType(p) == 1 && !p.isSneaking()) + { + switch (getInscription(s)) + { + case 0 : + { + for (int a = 0; a < 50; a++) + { + EntityEmber proj = new EntityEmber(p.worldObj, p, 5.0F); + proj.posX += proj.motionX; + proj.posY += proj.motionY; + proj.posZ += proj.motionZ; + proj.damage = 10.0F; + p.worldObj.spawnEntityInWorld(proj); + p.swingItem(); + } + break; + } + case 1 : + { + for (int a = 0; a < 50; a++) + { + EntityTaintBubble proj = new EntityTaintBubble(p.worldObj, p, 5.0F, false); + proj.posX += proj.motionX; + proj.posY += proj.motionY; + proj.posZ += proj.motionZ; + proj.damage = 10.0F; + p.worldObj.spawnEntityInWorld(proj); + p.swingItem(); + } + break; + } + case 2 : + { + List ents = p.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(p.posX, p.posY, p.posZ, p.posX + 1, p.posY + 1, p.posZ + 1).expand(5.0D, 5.0D, 5.0D)); + if (ents != null && ents.size() > 0) + { + for (int a = 0; a < ents.size(); a++) + { + EntityLivingBase e = ents.get(a); + + if (e != p && e.isEntityAlive() && !e.isEntityInvulnerable()) + { + double dist = TaintedMagicHelper.getDistanceTo(e.posX, e.posY, e.posZ, p); + if (dist < 2) e.attackEntityFrom(DamageSource.causePlayerDamage(p).setMagicDamage().setDamageBypassesArmor(), 5.0F); + Vector3 movement = TaintedMagicHelper.getDistanceBetween(e, p); + e.addVelocity(movement.x * 3, 0.8, movement.z * 3); + } + } + } + p.swingItem(); + TaintedMagic.proxy.spawnWindParticles(w); + break; + } + default : + break; + } + } + } + + public int castType (EntityPlayer p) + { + float f = Math.min((float) p.getItemInUseDuration() / 15.0F, 2.0F); + + if (f == 2.0F) return 1; + else return 0; + } + @SideOnly (Side.CLIENT) @SubscribeEvent public void onPlayerRender (RenderPlayerEvent.Specials.Post event) @@ -155,7 +326,7 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable int lightmapX = light % 65536; int lightmapY = light / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); - + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); if (p.getHeldItem() == null || p.getHeldItem().getItem() != this) @@ -194,6 +365,86 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable } } + @SideOnly (Side.CLIENT) + public static void renderHUD (ScaledResolution r, EntityPlayer p, float pt) + { + Minecraft mc = Minecraft.getMinecraft(); + ItemStack s = mc.thePlayer.getCurrentEquippedItem(); + Tessellator t = Tessellator.instance; + + if (s != null && s.getItem() instanceof ItemKatana) + { + float tickFract = Math.min((float) p.getItemInUseDuration() / 30.0F, 1.0F); + + int x = r.getScaledWidth() / 2 + 725; + int x2 = x + 16; + int y = r.getScaledHeight() / 2 + (p.capabilities.isCreativeMode ? 810 : 755); + int y2 = y + 16; + + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + + float sc = 0.315F; + + GL11.glScalef(sc, sc, sc); + + mc.renderEngine.bindTexture(new ResourceLocation("thaumcraft:textures/misc/script.png")); + + for (int rune = 0; rune < 16; rune++) + { + float red = MathHelper.sin( (p.ticksExisted + rune * 5) / 5.0F) * 0.1F + 0.8F; + float green = MathHelper.sin( (p.ticksExisted + rune * 5) / 7.0F) * 0.1F + 0.7F; + float alpha = MathHelper.sin( (p.ticksExisted + rune * 5) / 10.0F) * 0.3F; + + float f = 0.0625F * rune; + float f1 = f + 0.0625F; + float f2 = 0.0F; + float f3 = 1.0F; + + t.startDrawingQuads(); + + t.setBrightness(240); + t.setColorRGBA_F(red, green, 0.4F, alpha + 0.7F); + t.addVertexWithUV(x + (rune * 16) - alpha, y2 + alpha, 0, f, f3); + t.addVertexWithUV(x2 + (rune * 16) + alpha, y2 + alpha, 0, f1, f3); + t.addVertexWithUV(x2 + (rune * 16) + alpha, y - alpha, 0, f1, f2); + t.addVertexWithUV(x + (rune * 16) - alpha, y - alpha, 0, f, f2); + + t.draw(); + + if ((int) (16 * tickFract) > rune) + { + t.startDrawingQuads(); + + t.setBrightness(240); + t.setColorRGBA_F(1.0F - (0.0625F * rune), 0.0F + (0.0625F * rune), 0.0F, 0.9F + alpha); + t.addVertexWithUV(x + (rune * 16) - alpha, y2 + alpha, 0, f, f3); + t.addVertexWithUV(x2 + (rune * 16) + alpha, y2 + alpha, 0, f1, f3); + t.addVertexWithUV(x2 + (rune * 16) + alpha, y - alpha, 0, f1, f2); + t.addVertexWithUV(x + (rune * 16) - alpha, y - alpha, 0, f, f2); + + t.draw(); + } + } + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + } + + public static boolean hasAnyInscription (ItemStack s) + { + return s.hasTagCompound() && s.stackTagCompound.hasKey("inscription"); + } + + public static int getInscription (ItemStack s) + { + if (s.hasTagCompound() && s.stackTagCompound.hasKey("inscription")) return s.stackTagCompound.getInteger("inscription"); + else return 0; + } + public static ResourceLocation getTexture (ItemStack s) { switch (s.getItemDamage()) diff --git a/src/main/java/taintedmagic/common/items/tools/ItemThaumicDisassembler.java b/src/main/java/taintedmagic/common/items/tools/ItemThaumicDisassembler.java index 0d27c0b..4cd2e30 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemThaumicDisassembler.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemThaumicDisassembler.java @@ -45,10 +45,10 @@ public class ItemThaumicDisassembler extends Item { super.addInformation(s, p, l, b); - l.add(StatCollector.translateToLocal("text.mode") + ": " + EnumChatFormatting.BLUE + getModeName(s)); - l.add(StatCollector.translateToLocal("text.efficiency") + ": " + EnumChatFormatting.BLUE + getEfficiency(s)); + l.add("\u00A78" + StatCollector.translateToLocal("text.mode") + ": " + getModeName(s)); + l.add("\u00A78" + StatCollector.translateToLocal("text.efficiency") + ": " + (getMode(s) == 3 ? "\u00A7c" : "\u00A7a") + getEfficiency(s)); l.add(" "); - l.add(EnumChatFormatting.BLUE + "+20 " + StatCollector.translateToLocal("text.attackdamage")); + l.add("\u00A79" + "+20 " + StatCollector.translateToLocal("text.attackdamage")); } @Override @@ -144,13 +144,13 @@ public class ItemThaumicDisassembler extends Item switch (mode) { case 0 : - return StatCollector.translateToLocal("text.disassembler.normal"); + return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.normal"); case 1 : - return StatCollector.translateToLocal("text.disassembler.slow"); + return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.slow"); case 2 : - return StatCollector.translateToLocal("text.disassembler.fast"); + return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.fast"); case 3 : - return StatCollector.translateToLocal("text.disassembler.off"); + return "\u00A7c" + StatCollector.translateToLocal("text.disassembler.off"); } return null; } diff --git a/src/main/java/taintedmagic/common/items/wand/ItemFocusTaint.java b/src/main/java/taintedmagic/common/items/wand/ItemFocusTaint.java index 75547c2..ece88ec 100644 --- a/src/main/java/taintedmagic/common/items/wand/ItemFocusTaint.java +++ b/src/main/java/taintedmagic/common/items/wand/ItemFocusTaint.java @@ -79,7 +79,7 @@ public class ItemFocusTaint extends ItemFocusBasic public ItemFocusBasic.WandFocusAnimation getAnimation (ItemStack s) { - return ItemFocusBasic.WandFocusAnimation.WAVE; + return ItemFocusBasic.WandFocusAnimation.CHARGE; } public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) @@ -100,7 +100,7 @@ public class ItemFocusTaint extends ItemFocusBasic } int range = 8; Vec3 vec3d = p.getLook(range); - if (!p.worldObj.isRemote && p.ticksExisted % 20 == 0) p.worldObj.playSoundAtEntity(p, "thaumcraft:bubble", 0.33F, 2.0F); + if (!p.worldObj.isRemote && p.ticksExisted % 5 == 0) p.worldObj.playSoundAtEntity(p, "thaumcraft:bubble", 0.33F, 2F * (float)Math.random()); int potency = wand.getFocusPotency(s); if ( (!p.worldObj.isRemote) && (wand.consumeAllVis(s, p, getVisCost(s), true, false))) diff --git a/src/main/java/taintedmagic/common/items/wand/ItemFocusTaintedBlast.java b/src/main/java/taintedmagic/common/items/wand/ItemFocusTaintedBlast.java index 7756db4..a2c98ba 100644 --- a/src/main/java/taintedmagic/common/items/wand/ItemFocusTaintedBlast.java +++ b/src/main/java/taintedmagic/common/items/wand/ItemFocusTaintedBlast.java @@ -2,11 +2,7 @@ package taintedmagic.common.items.wand; import java.util.Iterator; import java.util.List; -import java.util.Random; -import org.lwjgl.opengl.GL11; - -import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -15,28 +11,19 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import taintedmagic.common.TaintedMagic; -import taintedmagic.common.entities.EntityEldritchOrbAttack; +import taintedmagic.common.helper.TaintedMagicHelper; import taintedmagic.common.helper.Vector3; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.wands.FocusUpgradeType; import thaumcraft.api.wands.ItemFocusBasic; -import thaumcraft.client.fx.ParticleEngine; -import thaumcraft.client.fx.particles.FXWisp; -import thaumcraft.common.Thaumcraft; -import thaumcraft.common.entities.projectile.EntityPrimalOrb; import thaumcraft.common.items.wands.ItemWandCasting; -import thaumcraft.common.items.wands.WandManager; -import thaumcraft.common.lib.network.PacketHandler; -import thaumcraft.common.lib.network.fx.PacketFXSonic; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemFocusTaintedBlast extends ItemFocusBasic { @@ -125,13 +112,13 @@ public class ItemFocusTaintedBlast extends ItemFocusBasic { if (eo.isEntityAlive() && !eo.isEntityInvulnerable()) { - double d = getDistanceTo(eo.posX, eo.posY, eo.posZ, p); + double d = TaintedMagicHelper.getDistanceTo(eo.posX, eo.posY, eo.posZ, p); if (d < 7.0D) { eo.attackEntityFrom(DamageSource.magic, 2.0F); } } - Vector3 movement = getDistanceBetween(eo, p); + Vector3 movement = TaintedMagicHelper.getDistanceBetween(eo, p); eo.addVelocity(movement.x * 3, 0.8, movement.z * 3); } } @@ -142,24 +129,6 @@ public class ItemFocusTaintedBlast extends ItemFocusBasic return null; } - public static Vector3 getDistanceBetween (Entity e, Entity e2) - { - Vector3 fromPosition = new Vector3(e.posX, e.posY, e.posZ); - Vector3 toPosition = new Vector3(e2.posX, e2.posY, e2.posZ); - Vector3 dist = fromPosition.sub(toPosition); - dist.normalize(); - return dist; - - } - - public static double getDistanceTo (double x, double y, double z, EntityPlayer p) - { - double var7 = p.posX + 0.5D - x; - double var9 = p.posY + 0.5D - y; - double var11 = p.posZ + 0.5D - z; - return var7 * var7 + var9 * var9 + var11 * var11; - } - public FocusUpgradeType[] getPossibleUpgradesByRank (ItemStack s, int rank) { switch (rank) diff --git a/src/main/java/taintedmagic/common/lib/LibRecipes.java b/src/main/java/taintedmagic/common/lib/LibRecipes.java index 74de630..8963614 100644 --- a/src/main/java/taintedmagic/common/lib/LibRecipes.java +++ b/src/main/java/taintedmagic/common/lib/LibRecipes.java @@ -443,6 +443,66 @@ public class LibRecipes new ItemStack(Items.emerald), new ItemStack(Items.iron_ingot), new ItemStack(ItemRegistry.ItemMaterial, 1, 0) })); + + ResearchRegistry.recipes.put("ItemKatanaThaumium:inscription0", ThaumcraftApi.addInfusionCraftingRecipe("INSCRIPTIONFIRE", new Object[]{ + "inscription", + new NBTTagInt(0) }, 8, new AspectList().add(Aspect.FIRE, 64).add(Aspect.LIGHT, 64).add(Aspect.METAL, 16), new ItemStack(ItemRegistry.ItemKatana, 1, 0), new ItemStack[]{ + ItemApi.getItem("itemFocusFire", 0), + new ItemStack(Items.coal), + new ItemStack(Blocks.netherrack), + new ItemStack(Items.fire_charge), + new ItemStack(Items.blaze_powder), + ItemApi.getItem("itemResource", 1) })); + + ResearchRegistry.recipes.put("ItemKatanaThaumium:inscription1", ThaumcraftApi.addInfusionCraftingRecipe("INSCRIPTIONTAINT", new Object[]{ + "inscription", + new NBTTagInt(1) }, 8, new AspectList().add(Aspect.TAINT, 64).add(Aspect.FLESH, 64).add(Aspect.METAL, 16), new ItemStack(ItemRegistry.ItemKatana, 1, 0), new ItemStack[]{ + new ItemStack(ItemRegistry.ItemFocusTaint), + new ItemStack(ItemRegistry.ItemMaterial, 1, 4), + ItemApi.getBlock("blockJar", 1), + ItemApi.getBlock("blockCustomPlant", 5), + ItemApi.getItem("itemBottleTaint", 0), + ItemApi.getItem("itemResource", 11) })); + + ResearchRegistry.recipes.put("ItemKatanaThaumium:inscription2", ThaumcraftApi.addInfusionCraftingRecipe("INSCRIPTIONWIND", new Object[]{ + "inscription", + new NBTTagInt(2) }, 8, new AspectList().add(Aspect.AIR, 64).add(Aspect.FLIGHT, 64).add(Aspect.METAL, 16), new ItemStack(ItemRegistry.ItemKatana, 1, 0), new ItemStack[]{ + ItemApi.getItem("itemShard", 0), + ItemApi.getItem("itemResource", 6), + new ItemStack(Items.feather), + ItemApi.getItem("itemShard", 6), + new ItemStack(Blocks.tnt), + ItemApi.getItem("itemWispEssence", 0) })); + + ResearchRegistry.recipes.put("ItemKatana:inscription0", ThaumcraftApi.addInfusionCraftingRecipe("INSCRIPTIONFIRE", new Object[]{ + "inscription", + new NBTTagInt(0) }, 8, new AspectList().add(Aspect.FIRE, 64).add(Aspect.LIGHT, 64).add(Aspect.METAL, 16), new ItemStack(ItemRegistry.ItemKatana, 1, 32767), new ItemStack[]{ + ItemApi.getItem("itemFocusFire", 0), + new ItemStack(Items.coal), + new ItemStack(Blocks.netherrack), + new ItemStack(Items.fire_charge), + new ItemStack(Items.blaze_powder), + ItemApi.getItem("itemResource", 1) })); + + ResearchRegistry.recipes.put("ItemKatana:inscription1", ThaumcraftApi.addInfusionCraftingRecipe("INSCRIPTIONTAINT", new Object[]{ + "inscription", + new NBTTagInt(1) }, 8, new AspectList().add(Aspect.TAINT, 64).add(Aspect.FLESH, 64).add(Aspect.METAL, 16), new ItemStack(ItemRegistry.ItemKatana, 1, 32767), new ItemStack[]{ + new ItemStack(ItemRegistry.ItemFocusTaint), + new ItemStack(ItemRegistry.ItemMaterial, 1, 4), + ItemApi.getBlock("blockJar", 1), + ItemApi.getBlock("blockCustomPlant", 5), + ItemApi.getItem("itemBottleTaint", 0), + ItemApi.getItem("itemResource", 11) })); + + ResearchRegistry.recipes.put("ItemKatana:inscription2", ThaumcraftApi.addInfusionCraftingRecipe("INSCRIPTIONWIND", new Object[]{ + "inscription", + new NBTTagInt(2) }, 8, new AspectList().add(Aspect.AIR, 64).add(Aspect.FLIGHT, 64).add(Aspect.METAL, 16), new ItemStack(ItemRegistry.ItemKatana, 1, 32767), new ItemStack[]{ + ItemApi.getItem("itemShard", 0), + ItemApi.getItem("itemResource", 6), + new ItemStack(Items.feather), + ItemApi.getItem("itemShard", 6), + new ItemStack(Blocks.tnt), + ItemApi.getItem("itemWispEssence", 0) })); } public static void initArcane () @@ -470,7 +530,6 @@ public class LibRecipes ResearchRegistry.recipes.put("ItemHelmetCultistRobe", ThaumcraftApi.addArcaneCraftingRecipe("CRIMSONROBES", ItemApi.getItem("itemHelmetCultistRobe", 0), new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.EARTH, 5).add(Aspect.AIR, 5).add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), new Object[]{ "AAA", "ABA", - " ", Character.valueOf('A'), new ItemStack(ItemRegistry.ItemMaterial, 1, 2), Character.valueOf('B'), @@ -548,7 +607,7 @@ public class LibRecipes ResearchRegistry.recipes.put("ItemMagicFunguar", ThaumcraftApi.addShapelessArcaneCraftingRecipe("MAGICFUNGUAR", new ItemStack(ItemRegistry.ItemMagicFunguar), new AspectList().add(Aspect.ORDER, 1).add(Aspect.WATER, 1).add(Aspect.EARTH, 1).add(Aspect.AIR, 1).add(Aspect.FIRE, 1).add(Aspect.ENTROPY, 1), new Object[]{ new ItemStack(ConfigBlocks.blockCustomPlant, 1, 5), - ItemApi.getItem("itemShard", 32767), + new ItemStack(ConfigItems.itemShard, 32767), new ItemStack(Blocks.brown_mushroom), new ItemStack(Blocks.red_mushroom), new ItemStack(Items.blaze_powder) })); diff --git a/src/main/java/taintedmagic/common/lib/LibStrings.java b/src/main/java/taintedmagic/common/lib/LibStrings.java index 07cd553..d948759 100644 --- a/src/main/java/taintedmagic/common/lib/LibStrings.java +++ b/src/main/java/taintedmagic/common/lib/LibStrings.java @@ -5,6 +5,6 @@ public class LibStrings // LibStrings public static final String MODID = "TaintedMagic"; public static final String NAME = "Tainted Magic"; - public static final String VERSION = "r7.1"; + public static final String VERSION = "r7.2"; public static final String DEPENDENCIES = "required-after:Forge@[10.13.2.1291,);required-after:Thaumcraft@[4.2.3.5,);after:ThaumicTinkerer"; } diff --git a/src/main/java/taintedmagic/common/network/PacketAttackEntityFromClient.java b/src/main/java/taintedmagic/common/network/PacketAttackEntityFromClient.java new file mode 100644 index 0000000..aa7ed7b --- /dev/null +++ b/src/main/java/taintedmagic/common/network/PacketAttackEntityFromClient.java @@ -0,0 +1,67 @@ +package taintedmagic.common.network; + +import io.netty.buffer.ByteBuf; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; + +public class PacketAttackEntityFromClient implements IMessage, IMessageHandler +{ + private int entityID; + private int playerID; + private int dimensionID; + private float dmg; + + public PacketAttackEntityFromClient () + { + } + + public PacketAttackEntityFromClient (Entity e, EntityPlayer p, float dmg) + { + this.entityID = e.getEntityId(); + this.playerID = p.getEntityId(); + this.dimensionID = e.dimension; + this.dmg = dmg; + } + + @Override + public IMessage onMessage (PacketAttackEntityFromClient message, MessageContext ctx) + { + World w = DimensionManager.getWorld(message.dimensionID); + if (w == null) return null; + + Entity e = w.getEntityByID(message.entityID); + Entity p = w.getEntityByID(message.playerID); + + if (e != null && e instanceof EntityLivingBase && p != null && p instanceof EntityPlayer) + { + e.attackEntityFrom(DamageSource.causeIndirectMagicDamage(p, e), message.dmg); + } + + return null; + } + + @Override + public void fromBytes (ByteBuf buf) + { + this.entityID = buf.readInt(); + this.playerID = buf.readInt(); + this.dimensionID = buf.readInt(); + this.dmg = buf.readFloat(); + } + + @Override + public void toBytes (ByteBuf buf) + { + buf.writeInt(this.entityID); + buf.writeInt(this.playerID); + buf.writeInt(this.dimensionID); + buf.writeFloat(this.dmg); + } +} diff --git a/src/main/java/taintedmagic/common/network/PacketHandler.java b/src/main/java/taintedmagic/common/network/PacketHandler.java new file mode 100644 index 0000000..b339c0f --- /dev/null +++ b/src/main/java/taintedmagic/common/network/PacketHandler.java @@ -0,0 +1,16 @@ +package taintedmagic.common.network; + +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; +import cpw.mods.fml.relauncher.Side; + +public class PacketHandler +{ + public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel("TAINTEDMAGIC".toLowerCase()); + + public static void init () + { + int i = 0; + INSTANCE.registerMessage(PacketAttackEntityFromClient.class, PacketAttackEntityFromClient.class, i++, Side.SERVER); + } +} diff --git a/src/main/java/taintedmagic/common/registry/ResearchRegistry.java b/src/main/java/taintedmagic/common/registry/ResearchRegistry.java index 7e6c8ac..8b060c5 100644 --- a/src/main/java/taintedmagic/common/registry/ResearchRegistry.java +++ b/src/main/java/taintedmagic/common/registry/ResearchRegistry.java @@ -244,7 +244,7 @@ public class ResearchRegistry new ResearchPage((InfusionRecipe) recipes.get("ItemShadowFortressLeggings")) }).registerResearchItem(); ThaumcraftApi.addWarpToResearch("SHADOWFORTRESSARMOR", 3); - new TaintedMagicResearchItem("CAP_cloth", TM, new AspectList().add(Aspect.MAGIC, 4).add(Aspect.CLOTH, 4), 7, 1, 0, new ItemStack(ItemRegistry.ItemWandCap, 1, 1)).setParentsHidden("CAP_gold", "ENCHFABRIC").setConcealed().setSecondary().setPages(new ResearchPage[]{ + new TaintedMagicResearchItem("CAP_cloth", TM, new AspectList().add(Aspect.MAGIC, 4).add(Aspect.CLOTH, 4), 5, -3, 0, new ItemStack(ItemRegistry.ItemWandCap, 1, 1)).setParentsHidden("CAP_gold", "ENCHFABRIC").setConcealed().setSecondary().setPages(new ResearchPage[]{ new ResearchPage("1"), new ResearchPage((IArcaneRecipe) recipes.get("ItemWandCap:1")) }).registerResearchItem(); @@ -269,7 +269,7 @@ public class ResearchRegistry new TaintedMagicResearchItem("BLOODLUSTUPGRADE", TM, new AspectList().add(Aspect.MAGIC, 4).add(Aspect.HEAL, 8).add(Aspect.WEAPON, 8), 1, -4, 0, new ResourceLocation("taintedmagic:textures/foci/IconBloodlust.png")).setParentsHidden("MACEFOCUS", "FOCALMANIPULATION").setConcealed().setParents("CRYSTALDAGGER").setSecondary().setPages(new ResearchPage[]{ new ResearchPage("1") }).registerResearchItem(); - new TaintedMagicResearchItem("THAUMIUMKATANA", TM, new AspectList().add(Aspect.METAL, 8).add(Aspect.MAGIC, 4).add(Aspect.WEAPON, 6), 8, 1, 0, new ItemStack(ItemRegistry.ItemKatana, 1, 0)).setParentsHidden("ARMORFORTRESS").setConcealed().setSecondary().setPages(new ResearchPage[]{ + new TaintedMagicResearchItem("THAUMIUMKATANA", TM, new AspectList().add(Aspect.METAL, 8).add(Aspect.MAGIC, 4).add(Aspect.WEAPON, 6), 7, 1, 0, new ItemStack(ItemRegistry.ItemKatana, 1, 0)).setParentsHidden("ARMORFORTRESS").setConcealed().setPages(new ResearchPage[]{ new ResearchPage("1"), new ResearchPage((InfusionRecipe) recipes.get("ItemKatana:0")) }).registerResearchItem(); @@ -282,5 +282,18 @@ public class ResearchRegistry new ResearchPage("1"), new ResearchPage((InfusionRecipe) recipes.get("ItemKatana:2")) }).registerResearchItem(); ThaumcraftApi.addWarpToResearch("SHADOWMETALKATANA", 6); + + new TaintedMagicResearchItem("INSCRIPTIONFIRE", TM, new AspectList().add(Aspect.FIRE, 8).add(Aspect.LIGHT, 4).add(Aspect.METAL, 6), 9, 1, 0, new ResourceLocation("taintedmagic:textures/misc/IconINSCRIPTIONFIRE.png")).setParents("THAUMIUMKATANA").setParentsHidden("FOCUSFIRE").setConcealed().setPages(new ResearchPage[]{ + new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemKatanaThaumium:inscription0")) }).setSecondary().registerResearchItem(); + + new TaintedMagicResearchItem("INSCRIPTIONTAINT", TM, new AspectList().add(Aspect.TAINT, 8).add(Aspect.FLESH, 4).add(Aspect.METAL, 6), 9, 2, 0, new ResourceLocation("taintedmagic:textures/misc/IconINSCRIPTIONTAINT.png")).setParents("THAUMIUMKATANA").setParentsHidden("TAINTFOCUS").setConcealed().setPages(new ResearchPage[]{ + new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemKatanaThaumium:inscription1")) }).setSecondary().registerResearchItem(); + ThaumcraftApi.addWarpToResearch("INSCRIPTIONTAINT", 4); + + new TaintedMagicResearchItem("INSCRIPTIONWIND", TM, new AspectList().add(Aspect.AIR, 8).add(Aspect.MOTION, 4).add(Aspect.METAL, 6), 8, 3, 0, new ResourceLocation("taintedmagic:textures/misc/IconINSCRIPTIONWIND.png")).setParents("THAUMIUMKATANA").setConcealed().setPages(new ResearchPage[]{ + new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemKatanaThaumium:inscription2")) }).setSecondary().registerResearchItem(); } } diff --git a/src/main/resources/assets/taintedmagic/lang/en_US.lang b/src/main/resources/assets/taintedmagic/lang/en_US.lang index 9c45474..9c873ac 100644 --- a/src/main/resources/assets/taintedmagic/lang/en_US.lang +++ b/src/main/resources/assets/taintedmagic/lang/en_US.lang @@ -17,8 +17,8 @@ text.bloodlust=Bloodlust #=========FOCAL UPGRADES============== -focus.upgrade.tainturgist.name=Tainturgist -focus.upgrade.tainturgist.text=This upgrade will stop the bubbles from infecting you with Flux Flu. +focus.upgrade.tainturgy.name=Tainturgy +focus.upgrade.tainturgy.text=This upgrade will stop the bubbles from infecting you with Flux Flu. focus.upgrade.corrosive.name=Corrosive focus.upgrade.corrosive.text=This upgrade will cause the focus to inflict a Wither effect upon contact. @@ -71,6 +71,9 @@ item.ItemWarpedGoggles.name=Warped Goggles of Revealing item.ItemKatana.0.name=Thaumium Fortress Blade item.ItemKatana.1.name=Voidmetal Fortress Blade item.ItemKatana.2.name=Shadowmetal Fortress Blade +text.katana.inscription.0=Volcanic Inscription +text.katana.inscription.1=Tainted Inscription +text.katana.inscription.2=Stormbound Inscription item.ItemVoidFortressHelmet.name=Void Fortress Helm item.ItemVoidFortressChestplate.name=Void Fortress Cuirass @@ -79,10 +82,10 @@ item.ItemVoidFortressLeggings.name=Void Fortress Thigh Guards item.ItemThaumicDisassembler.name=Thaumic Disassembler text.mode=Mode text.efficiency=Efficiency -text.disassembler.normal=normal -text.disassembler.fast=fast -text.disassembler.slow=slow -text.disassembler.off=off +text.disassembler.normal=Normal +text.disassembler.fast=Fast +text.disassembler.slow=Slow +text.disassembler.off=Off text.modeToggle=Mode toggled to item.ItemShadowmetalPick.name=Shadowmetal Pickaxe @@ -140,7 +143,7 @@ tm.text.TAINTEDMAGIC.2=taintedmagic:textures/misc/PageTAINTEDMAGIC.png:0:25 tm.name.SHADOWMETAL=Shadowmetal tm.tag.SHADOWMETAL=I have seen the truth -tm.text.SHADOWMETAL.1=Once upon a time you were doing some crucible work. After having made a mess of the wrong aspects, you ran to grab a cloth to clean up the flux. Just as you ran by the crucible, a chunk of stone slipped out of your bag, landing in the bubbling mess...
When you returned there was nothing less than a shining block of Shadow Ore floating above your crucible.
This metal seems promising, all it takes is a mundane furnace to smelt it, resulting in a Shadowmetal Ingot. You think you will need to obtain more warp before it will become usable, maybe the whispers can give you more information, but who knows. +tm.text.SHADOWMETAL.1=Once upon a time you were doing some crucible work. You accidentally dropped a block of stone into a bubbling mess and the result was Shadowmetal Ore.
This metal seems promising, all it takes is a mundane furnace to smelt it, resulting in a Shadowmetal Ingot. It is extremely hard and has a very high durability. You think you will need to research some more before it is usable, maybe the whispers can give you more information... but who knows. #CAP_shadowmetal @@ -304,7 +307,7 @@ tm.text.CRIMSONBLADE.1=This seems to be the conclusion of your studies on the Cr tm.name.SHADOWFORTRESSARMOR=Shadow Fortress Armor tm.tag.SHADOWFORTRESSARMOR=If you wear robes, you are weak -tm.text.SHADOWFORTRESSARMOR.1=After having discovered Thaumium and Void Fortress Armor, you thought to yourself that Shadowmetal would be the perfect candidate to be made into Fortress Armor.
It worked perfectly. By replacing the preceding material with Blocks of Shadowmetal, you have created an extremely powerful suit of armor that will drastically reduce damage taken. Also, during the night, the armor will become charged by the moon, and become even more powerful, reducing even more damage.
Like normal fortress armor, this armor can be enhanced by various different faceplates and modifications. +tm.text.SHADOWFORTRESSARMOR.1=After having discovered Thaumium and Void Fortress Armor, you thought to yourself that Shadowmetal would be the perfect candidate to be made into Fortress Armor.
It worked perfectly. While this suit of armor did not inherit the auto-repair ability, it is drastically more protective than the Void Fortress Armor. It also seems that wearing multiple pieces of this armor will increase its protection significantly.
Like normal fortress armor, this armor can be enhanced by various different faceplates and modifications. #CAP_cloth @@ -352,16 +355,34 @@ tm.text.VOIDSENTBLOOD.1=While you love Crimson Cult robes, they are inferior to tm.name.THAUMIUMKATANA=Thaumium Fortress Blade tm.tag.THAUMIUMKATANA=Nothing will survive -tm.text.THAUMIUMKATANA.1=Using a design similar to Thaumium Fortress Armor, you have designed a blade that will fit the set perfectly.
By improving the construction process of a Thaumium Sword, you have not only increased the damage it will deal, but its durability as well. The Thaumium Fortress Blade is a high damage sword that is so strong, it will never take damage from use.
The blade will remain sheathed at your hip when it is not in use as long as it's in your inventory. +tm.text.THAUMIUMKATANA.1=Using a design similar to Thaumium Fortress Armor, you have designed a blade that will fit the set perfectly.
By improving the construction process of a Thaumium Sword, you have increased the damage it will deal. This blade will also never take damage from use.
Furthermore, you can charge your blade by holding down right click. Upon releasing, a strike will be delivered with increased damage based on how charged the blade is. At full charge, the blade has the potential to deal up to 2 times its attack damage. The blade will remain sheathed at your hip when it is not in use. #VOIDMETALKATANA tm.name.VOIDMETALKATANA=Voidmetal Fortress Blade tm.tag.VOIDMETALKATANA=Void samurai -tm.text.VOIDMETALKATANA.1=By using the same construction process as the Thaumium Fortress blade, but substituting the material for Voidmetal, you have created a Fortress Blade that is even more powerful. The Voidmetal Fortress Blade is not only sharper and stronger than its Thaumium counterpart, but also possesses the Greater Sapping effect which will weaken anything you hit.
They do say that this much Voidmetal is not healthy for ones body, but you care not. +tm.text.VOIDMETALKATANA.1=By using the same construction process as the Thaumium Fortress blade, but substituting the material for Voidmetal, you have created a Fortress Blade that is even more powerful.
The Voidmetal Fortress Blade is not only sharper and stronger than its Thaumium counterpart, but also possesses the Greater Sapping effect which will weaken anything you hit.
They do say that this much Voidmetal is not healthy for ones body, but you care not. #SHADOWMETALKATANA tm.name.SHADOWMETALKATANA=Shadowmetal Fortress Blade tm.tag.SHADOWMETALKATANA=Chakra blades -tm.text.SHADOWMETALKATANA.1=After having discovered Shadowmetal Fortress Armor, you were certain that you could make a Fortress Blade from Shadowmetal as well.
The results were astounding. By following the same construction process as the Thaumium and Voidmetal Fortress Blades, you have created the strongest, and sharpest Fortress Blade you have ever laid eyes upon.
This blade is not only sharper and stronger than its counterparts, it will also inflict a withering effect while simultaneously blurring the vision of whatever you hit. \ No newline at end of file +tm.text.SHADOWMETALKATANA.1=After having discovered Shadowmetal Fortress Armor, you were certain that you could make a Fortress Blade from Shadowmetal as well.
The results were astounding. By following the same construction process as the Thaumium and Voidmetal Fortress Blades, you have created the strongest, and sharpest Fortress Blade you have ever laid eyes upon.
This blade is not only sharper and stronger than its counterparts, it will also inflict a slowing effect while simultaneously blurring the vision of whatever you hit. + +#INSCRIPTIONFIRE + +tm.name.INSCRIPTIONFIRE=Volcanic Inscription +tm.tag.INSCRIPTIONFIRE=Thaumium Fortress Blade upgrade +tm.text.INSCRIPTIONFIRE.1=You have upgraded your Fortress Blade by inscribing runes upon it.
This inscription will convert damage dealt into fire damage, which will bypass armor. Any target hit will be set aflame.
Furthermore, when releasing a fully charged strike, a cloud of fire will be emit from your blade. One would hold down shift to cancel this effect and release a normal strike. + +#INSCRIPTIONTAINT + +tm.name.INSCRIPTIONTAINT=Tainted Inscription +tm.tag.INSCRIPTIONTAINT=Thaumium Fortress Blade upgrade +tm.text.INSCRIPTIONTAINT.1=You have upgraded your Fortress Blade by inscribing runes upon it.
This inscription will cause your blade to deal magic damage, bypassing armor. Anything you hit will also be inflicted with Taint Poison.
Moreover, if you release a fully charged strike, a cloud of taint will be emit from your blade. One would hold down shift to cancel this effect and release a normal strike. + +#INSCRIPTIONWIND + +tm.name.INSCRIPTIONWIND=Stormbound Inscription +tm.tag.INSCRIPTIONWIND=Thaumium Fortress Blade upgrade +tm.text.INSCRIPTIONWIND.1=You have upgraded your Fortress Blade by inscribing runes upon it.
This inscription will allow you to deal wind damage, which bypasses armor. Your target will also gain a withering effect.
Incidentally, when releasing a fully charged strike, a burst of charged air will be shot in all directions, knocking back and damaging all nearby enemies. One would hold down shift to cancel this effect and release a normal strike. \ No newline at end of file diff --git a/src/main/resources/assets/taintedmagic/textures/entities/EntityTaintBubble.png b/src/main/resources/assets/taintedmagic/textures/entities/EntityTaintBubble.png index f20b03f..6d81407 100644 Binary files a/src/main/resources/assets/taintedmagic/textures/entities/EntityTaintBubble.png and b/src/main/resources/assets/taintedmagic/textures/entities/EntityTaintBubble.png differ diff --git a/src/main/resources/assets/taintedmagic/textures/misc/IconINSCRIPTIONFIRE.png b/src/main/resources/assets/taintedmagic/textures/misc/IconINSCRIPTIONFIRE.png new file mode 100644 index 0000000..afdbb40 Binary files /dev/null and b/src/main/resources/assets/taintedmagic/textures/misc/IconINSCRIPTIONFIRE.png differ diff --git a/src/main/resources/assets/taintedmagic/textures/misc/IconINSCRIPTIONTAINT.png b/src/main/resources/assets/taintedmagic/textures/misc/IconINSCRIPTIONTAINT.png new file mode 100644 index 0000000..58034dc Binary files /dev/null and b/src/main/resources/assets/taintedmagic/textures/misc/IconINSCRIPTIONTAINT.png differ diff --git a/src/main/resources/assets/taintedmagic/textures/misc/IconINSCRIPTIONWIND.png b/src/main/resources/assets/taintedmagic/textures/misc/IconINSCRIPTIONWIND.png new file mode 100644 index 0000000..6ba8277 Binary files /dev/null and b/src/main/resources/assets/taintedmagic/textures/misc/IconINSCRIPTIONWIND.png differ diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index cdf8e35..14089e4 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "TaintedMagic", "name": "Tainted Magic", "description": "A TC4 addon that brings you to the dark side of Thaumaturgy...", - "version": "r7.1", + "version": "r7.2", "mcversion": "1.7.10", "url": "http://bitly.com/1HV2VSK", "updateUrl": "",