diff --git a/.vs/CinderLoE/FileContentIndex/05b15299-8556-4205-8242-f476485eb464.vsidx b/.vs/CinderLoE/FileContentIndex/05b15299-8556-4205-8242-f476485eb464.vsidx new file mode 100644 index 0000000..70aef67 Binary files /dev/null and b/.vs/CinderLoE/FileContentIndex/05b15299-8556-4205-8242-f476485eb464.vsidx differ diff --git a/.vs/CinderLoE/FileContentIndex/270900c9-b034-40dc-9c8b-e612f68ec8bd.vsidx b/.vs/CinderLoE/FileContentIndex/270900c9-b034-40dc-9c8b-e612f68ec8bd.vsidx new file mode 100644 index 0000000..0db08f7 Binary files /dev/null and b/.vs/CinderLoE/FileContentIndex/270900c9-b034-40dc-9c8b-e612f68ec8bd.vsidx differ diff --git a/.vs/CinderLoE/FileContentIndex/929cf4a4-ede3-464b-8434-6980ae5dc3a6.vsidx b/.vs/CinderLoE/FileContentIndex/929cf4a4-ede3-464b-8434-6980ae5dc3a6.vsidx new file mode 100644 index 0000000..3b41a52 Binary files /dev/null and b/.vs/CinderLoE/FileContentIndex/929cf4a4-ede3-464b-8434-6980ae5dc3a6.vsidx differ diff --git a/.vs/CinderLoE/FileContentIndex/9346f760-3b0e-4e19-9df3-d8c876085444.vsidx b/.vs/CinderLoE/FileContentIndex/9346f760-3b0e-4e19-9df3-d8c876085444.vsidx new file mode 100644 index 0000000..742f2c4 Binary files /dev/null and b/.vs/CinderLoE/FileContentIndex/9346f760-3b0e-4e19-9df3-d8c876085444.vsidx differ diff --git a/.vs/CinderLoE/v17/.wsuo b/.vs/CinderLoE/v17/.wsuo new file mode 100644 index 0000000..5777b76 Binary files /dev/null and b/.vs/CinderLoE/v17/.wsuo differ diff --git a/.vs/CinderLoE/v17/DocumentLayout.backup.json b/.vs/CinderLoE/v17/DocumentLayout.backup.json new file mode 100644 index 0000000..c1b29df --- /dev/null +++ b/.vs/CinderLoE/v17/DocumentLayout.backup.json @@ -0,0 +1,41 @@ +{ + "Version": 1, + "WorkspaceRootPath": "C:\\Users\\Rober\\source\\repos\\CinderLoE\\", + "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Rober\\source\\repos\\CinderLoE\\src\\main\\java\\com\\zivilon\\cinder_loe\\items\\SarumanStaff.java||{3B902123-F8A7-4915-9F01-361F908088D0}", + "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\main\\java\\com\\zivilon\\cinder_loe\\items\\SarumanStaff.java||{3B902123-F8A7-4915-9F01-361F908088D0}" + } + ], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedWidth": 200, + "SelectedChildIndex": 1, + "Children": [ + { + "$type": "Bookmark", + "Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}" + }, + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "SarumanStaff.java", + "DocumentMoniker": "C:\\Users\\Rober\\source\\repos\\CinderLoE\\src\\main\\java\\com\\zivilon\\cinder_loe\\items\\SarumanStaff.java", + "RelativeDocumentMoniker": "src\\main\\java\\com\\zivilon\\cinder_loe\\items\\SarumanStaff.java", + "ToolTip": "C:\\Users\\Rober\\source\\repos\\CinderLoE\\src\\main\\java\\com\\zivilon\\cinder_loe\\items\\SarumanStaff.java", + "RelativeToolTip": "src\\main\\java\\com\\zivilon\\cinder_loe\\items\\SarumanStaff.java", + "ViewState": "AgIAAAAAAAAAAAAAAAAAABIAAAAkAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|", + "WhenOpened": "2025-02-06T19:41:35.514Z", + "EditorCaption": "" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/.vs/CinderLoE/v17/DocumentLayout.json b/.vs/CinderLoE/v17/DocumentLayout.json new file mode 100644 index 0000000..aedafbd --- /dev/null +++ b/.vs/CinderLoE/v17/DocumentLayout.json @@ -0,0 +1,41 @@ +{ + "Version": 1, + "WorkspaceRootPath": "C:\\Users\\Rober\\source\\repos\\CinderLoE\\", + "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Rober\\source\\repos\\CinderLoE\\sarustafffiles\\SarumanWhiteStaff.java||{3B902123-F8A7-4915-9F01-361F908088D0}", + "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:sarustafffiles\\SarumanWhiteStaff.java||{3B902123-F8A7-4915-9F01-361F908088D0}" + } + ], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedWidth": 200, + "SelectedChildIndex": 1, + "Children": [ + { + "$type": "Bookmark", + "Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}" + }, + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "SarumanWhiteStaff.java", + "DocumentMoniker": "C:\\Users\\Rober\\source\\repos\\CinderLoE\\sarustafffiles\\SarumanWhiteStaff.java", + "RelativeDocumentMoniker": "sarustafffiles\\SarumanWhiteStaff.java", + "ToolTip": "C:\\Users\\Rober\\source\\repos\\CinderLoE\\sarustafffiles\\SarumanWhiteStaff.java", + "RelativeToolTip": "sarustafffiles\\SarumanWhiteStaff.java", + "ViewState": "AgIAABgAAAAAAAAAAAAAACEAAAAAAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|", + "WhenOpened": "2025-02-07T20:25:48.927Z", + "EditorCaption": "" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/.vs/CinderLoE/v17/workspaceFileList.bin b/.vs/CinderLoE/v17/workspaceFileList.bin new file mode 100644 index 0000000..0f288d3 Binary files /dev/null and b/.vs/CinderLoE/v17/workspaceFileList.bin differ diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 0000000..6931e8a --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,13 @@ +{ + "ExpandedNodes": [ + "", + "\\src", + "\\src\\main", + "\\src\\main\\java", + "\\src\\main\\java\\com", + "\\src\\main\\java\\com\\zivilon", + "\\src\\main\\java\\com\\zivilon\\cinder_loe", + "\\src\\main\\java\\com\\zivilon\\cinder_loe\\items" + ], + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/cinder/FileContentIndex/1b89b329-ec80-4794-a5e1-03f8b8fb0911.vsidx b/.vs/cinder/FileContentIndex/1b89b329-ec80-4794-a5e1-03f8b8fb0911.vsidx new file mode 100644 index 0000000..4287622 Binary files /dev/null and b/.vs/cinder/FileContentIndex/1b89b329-ec80-4794-a5e1-03f8b8fb0911.vsidx differ diff --git a/.vs/cinder/v17/.suo b/.vs/cinder/v17/.suo new file mode 100644 index 0000000..290aaac Binary files /dev/null and b/.vs/cinder/v17/.suo differ diff --git a/.vs/cinder/v17/DocumentLayout.backup.json b/.vs/cinder/v17/DocumentLayout.backup.json new file mode 100644 index 0000000..a5f0e09 --- /dev/null +++ b/.vs/cinder/v17/DocumentLayout.backup.json @@ -0,0 +1,23 @@ +{ + "Version": 1, + "WorkspaceRootPath": "C:\\Users\\Rober\\source\\repos\\CinderLoE\\", + "Documents": [], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedWidth": 200, + "SelectedChildIndex": -1, + "Children": [ + { + "$type": "Bookmark", + "Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/.vs/cinder/v17/DocumentLayout.json b/.vs/cinder/v17/DocumentLayout.json new file mode 100644 index 0000000..a5f0e09 --- /dev/null +++ b/.vs/cinder/v17/DocumentLayout.json @@ -0,0 +1,23 @@ +{ + "Version": 1, + "WorkspaceRootPath": "C:\\Users\\Rober\\source\\repos\\CinderLoE\\", + "Documents": [], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedWidth": 200, + "SelectedChildIndex": -1, + "Children": [ + { + "$type": "Bookmark", + "Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/.vs/cinder/v17/fileList.bin b/.vs/cinder/v17/fileList.bin new file mode 100644 index 0000000..a4266b5 Binary files /dev/null and b/.vs/cinder/v17/fileList.bin differ diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000..52f0f34 Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/cinder.sln b/cinder.sln new file mode 100644 index 0000000..94ef329 --- /dev/null +++ b/cinder.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35527.113 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "cinder", "cinder.vbproj", "{B07ECCFF-D2C6-4E87-8988-7294AEDD8182}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B07ECCFF-D2C6-4E87-8988-7294AEDD8182}.Debug|x86.ActiveCfg = Debug|x86 + {B07ECCFF-D2C6-4E87-8988-7294AEDD8182}.Debug|x86.Build.0 = Debug|x86 + {B07ECCFF-D2C6-4E87-8988-7294AEDD8182}.Release|x86.ActiveCfg = Release|x86 + {B07ECCFF-D2C6-4E87-8988-7294AEDD8182}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/cinder.vbproj b/cinder.vbproj new file mode 100644 index 0000000..273d81e --- /dev/null +++ b/cinder.vbproj @@ -0,0 +1,855 @@ + + + + Debug + x86 + {B07ECCFF-D2C6-4E87-8988-7294AEDD8182} + Exe + + + cinder + ConsoleApplication + 512 + Console + v4.0 + Client + + + true + full + true + true + bin\Debug\ + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + x86 + + + pdbonly + false + true + true + bin\Release\ + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + x86 + + + On + + + Binary + + + Off + + + On + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cinder.vbproj.user b/cinder.vbproj.user new file mode 100644 index 0000000..e69de29 diff --git a/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..4a0bac5 Binary files /dev/null and b/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/obj/x86/Debug/cinder.vbproj.AssemblyReference.cache b/obj/x86/Debug/cinder.vbproj.AssemblyReference.cache new file mode 100644 index 0000000..ca1542e Binary files /dev/null and b/obj/x86/Debug/cinder.vbproj.AssemblyReference.cache differ diff --git a/src/main/java/com/zivilon/cinder_loe/CinderLoE.java b/src/main/java/com/zivilon/cinder_loe/CinderLoE.java index f8b8022..d79d3ed 100644 --- a/src/main/java/com/zivilon/cinder_loe/CinderLoE.java +++ b/src/main/java/com/zivilon/cinder_loe/CinderLoE.java @@ -285,6 +285,7 @@ public class CinderLoE { public static Item pallandoStaff; public static Item alatarStaff; public static Item sarumanStaff; + public static Item sarumanWhiteStaff; // Relics public static Item welfRelic; @@ -379,6 +380,7 @@ public class CinderLoE { //Misc EntityRegistry.registerModEntity(EntityWarDart.class, "WarDart", (entityID + 44), this, 64, 1, true); EntityRegistry.registerModEntity(SarumanFireball.class, "SarumanFireball", entityID + 0, this, 64, 10, true); + EntityRegistry.registerModEntity(SarumanWhiteFireball.class, "SarumanWhiteFireball", entityID + 61, this, 64, 10, true); EntityRegistry.registerModEntity(LOTREntitySauron.class, "LOTREntitySauron", (entityID + 28), this, 64, 1, true); EntityRegistry.registerModEntity(UtumnoSlaveTrader.class, "UtumnoSlaveTrader", (entityID + 30), this, 64, 1, true); @@ -555,6 +557,7 @@ public class CinderLoE { pallandoStaff = (new PallandoStaff()).setUnlocalizedName("lotr:pallandoStaff").setTextureName("lotr:pallandoStaff"); alatarStaff = (new AlatarStaff()).setUnlocalizedName("lotr:alatarStaff").setTextureName("lotr:alatarStaff"); sarumanStaff = (new SarumanStaff()).setUnlocalizedName("lotr:sarumanStaff").setTextureName("lotr:sarumanStaff"); + sarumanWhiteStaff = (new SarumanWhiteStaff()).setUnlocalizedName("lotr:sarumanWhiteStaff").setTextureName("lotr:sarumanStaff"); // Relics welfRelic = (new WoodElfRelic()).setUnlocalizedName("lotr:welfRelic").setTextureName("lotr:welfRelic"); unitLevelTool = (new unitLevelTool()).setUnlocalizedName("lotr:unitLevelTool").setTextureName("stick"); @@ -621,11 +624,13 @@ public class CinderLoE { ItemRegistration.register(pallandoStaff, "pallandoStaff", 6701); ItemRegistration.register(alatarStaff, "alatarStaff", 6702); ItemRegistration.register(sarumanStaff, "sarumanStaff", 6703); + ItemRegistration.register(sarumanWhiteStaff, "sarumanWhiteStaff", 6705); linkLOTRWeapon(radagastStaff, "radagastStaff"); linkLOTRWeapon(pallandoStaff, "pallandoStaff"); linkLOTRWeapon(alatarStaff, "alatarStaff"); linkLOTRWeapon(sarumanStaff, "sarumanStaff"); + linkLOTRWeapon(sarumanWhiteStaff, "sarumanWhiteStaff"); //Relics ItemRegistration.register(welfRelic, "welfRelic", 6704); @@ -961,6 +966,7 @@ public class CinderLoE { RenderingRegistry.registerEntityRenderingHandler(CorruptSkeletonArcher.class, new RenderCorruptSkeleton()); RenderingRegistry.registerEntityRenderingHandler(SarumanFireball.class, new RenderSarumanFireball()); + RenderingRegistry.registerEntityRenderingHandler(SarumanWhiteFireball.class, new RenderSarumanWhiteFireball()); RenderingRegistry.registerEntityRenderingHandler(Renegade.class, new RenderRenegade()); RenderingRegistry.registerEntityRenderingHandler(RenegadeCaptain.class, new RenderRenegade()); RenderingRegistry.registerEntityRenderingHandler(Wraith.class, new RenderWraith()); @@ -1192,6 +1198,7 @@ public class CinderLoE { CinderCore.registerItemFallback(Item.getIdFromItem(pallandoStaff), Item.getIdFromItem(LOTRMod.gandalfStaffWhite), "cinder_loe", "1.0"); CinderCore.registerItemFallback(Item.getIdFromItem(alatarStaff), Item.getIdFromItem(LOTRMod.gandalfStaffWhite), "cinder_loe", "1.0"); CinderCore.registerItemFallback(Item.getIdFromItem(sarumanStaff), Item.getIdFromItem(LOTRMod.gandalfStaffWhite), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(sarumanWhiteStaff), Item.getIdFromItem(LOTRMod.gandalfStaffWhite), "cinder_loe", "1.4"); // == Relics == CinderCore.registerItemFallback(Item.getIdFromItem(welfRelic), Item.getIdFromItem(LOTRMod.rhinoHorn), "cinder_loe", "1.2"); // == Specials == @@ -1263,6 +1270,7 @@ public class CinderLoE { CinderCore.registerEntityFallback(CorruptOrc.class, LOTREntityGundabadOrc.class, "cinder_loe", "1.2.3"); CinderCore.registerEntityFallback(SarumanFireball.class, LOTREntityGandalfFireball.class, "cinder_loe", "1.0"); + CinderCore.registerEntityFallback(SarumanWhiteFireball.class, LOTREntityGandalfFireball.class, "cinder_loe", "1.4"); CinderCore.registerEntityFallback(Renegade.class, LOTREntityBandit.class, "cinder_loe", "1.0"); CinderCore.registerEntityFallback(RenegadeCaptain.class, LOTREntityBandit.class, "cinder_loe", "1.1"); CinderCore.registerEntityFallback(Wraith.class, LOTREntityMarshWraith.class, "cinder_loe", "1.0"); diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderSarumanWhiteFireball.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderSarumanWhiteFireball.java new file mode 100644 index 0000000..ec581ab --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/client/render/RenderSarumanWhiteFireball.java @@ -0,0 +1,50 @@ +package com.zivilon.cinder_loe.client.render; + +import lotr.client.LOTRClientProxy; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import com.zivilon.cinder_loe.entity.SarumanWhiteFireball; + +public class RenderSarumanWhiteFireball extends Render { + public static final ResourceLocation particlesTexture = new ResourceLocation("cinder_loe:misc/particles.png"); + + protected ResourceLocation getEntityTexture(Entity entity) { + return particlesTexture; + } + + public void doRender(Entity entity, double d, double d1, double d2, float f, float f1) { + GL11.glPushMatrix(); + GL11.glTranslatef((float)d, (float)d1, (float)d2); + GL11.glEnable(32826); + bindEntityTexture(entity); + Tessellator tessellator = Tessellator.instance; + drawSprite(tessellator, 32 + ((SarumanWhiteFireball)entity).animationTick); + GL11.glDisable(32826); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glPopMatrix(); + } + + private void drawSprite(Tessellator tessellator, int index) { + float f = (index % 8 * 16 + 0) / 128.0F; + float f1 = (index % 8 * 16 + 16) / 128.0F; + float f2 = (index / 8 * 16 + 0) / 128.0F; + float f3 = (index / 8 * 16 + 16) / 128.0F; + float f4 = 1.0F; + float f5 = 0.5F; + float f6 = 0.25F; + GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + tessellator.setBrightness(15728880); + tessellator.addVertexWithUV((0.0F - f5), (0.0F - f6), 0.0D, f, f3); + tessellator.addVertexWithUV((f4 - f5), (0.0F - f6), 0.0D, f1, f3); + tessellator.addVertexWithUV((f4 - f5), (f4 - f6), 0.0D, f1, f2); + tessellator.addVertexWithUV((0.0F - f5), (f4 - f6), 0.0D, f, f2); + tessellator.draw(); + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/coremod/LOTRWeaponLinker.java b/src/main/java/com/zivilon/cinder_loe/coremod/LOTRWeaponLinker.java index 75f95db..469b3de 100644 --- a/src/main/java/com/zivilon/cinder_loe/coremod/LOTRWeaponLinker.java +++ b/src/main/java/com/zivilon/cinder_loe/coremod/LOTRWeaponLinker.java @@ -20,7 +20,7 @@ public class LOTRWeaponLinker implements IClassTransformer { // Can add any number of items, append with comma return addLinks(basicClass, "spearRedDwarf", "crossbowRedDwarf", "swordRedDwarf", "battleaxeRedDwarf", "pikeRedDwarf", "daggerRedDwarf", "daggerRedDwarfPoisoned", "hammerRedDwarf", - "radagastStaff", "alatarStaff", "pallandoStaff", "sarumanStaff", "maceWarlord", + "radagastStaff", "alatarStaff", "pallandoStaff", "sarumanStaff", "maceWarlord", "sarumanWhiteStaff", "spearLimwaith", "tridentLimwaith", "daggerLimwaith", "daggerLimwaithPoisoned", "truncheonLimwaith", "battleaxeLimwaith", "blowgunLimwaith", "frostblade", "spearsolidgold", "whip", "spearUnnamed", "welfRelic", "daggerVoid", "swordBree", diff --git a/src/main/java/com/zivilon/cinder_loe/entity/SarumanWhiteFireball.java b/src/main/java/com/zivilon/cinder_loe/entity/SarumanWhiteFireball.java new file mode 100644 index 0000000..f1882f2 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/SarumanWhiteFireball.java @@ -0,0 +1,92 @@ +package com.zivilon.cinder_loe.entity; + +import cpw.mods.fml.common.network.simpleimpl.IMessage; + +import lotr.common.LOTRLevelData; +import lotr.common.LOTRMod; +import lotr.common.entity.npc.LOTREntityNPC; +import lotr.common.entity.animal.LOTREntityHorse; +import lotr.common.entity.projectile.LOTREntityGandalfFireball; +import lotr.common.fac.LOTRFaction; +import lotr.common.network.LOTRPacketHandler; +import lotr.common.network.LOTRPacketWeaponFX; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; + +public class SarumanWhiteFireball extends LOTREntityGandalfFireball { + public SarumanWhiteFireball(World world) { + super(world); + } + + public SarumanWhiteFireball(World world, EntityLivingBase entityliving) { + super(world, entityliving); + } + + public SarumanWhiteFireball(World world, double d, double d1, double d2) { + super(world, d, d1, d2); + } + + protected void onImpact(MovingObjectPosition m) { + if (!this.worldObj.isRemote) + if (m.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + explode((Entity)null); + } else if (m.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) { + Entity entity = m.entityHit; + if (isEntityVulnerable(entity)) + explode(entity); + } + } + + private void explode(Entity target) { + if (this.worldObj.isRemote) + return; + this.worldObj.playSoundAtEntity((Entity)this, "lotr:item.gandalfFireball", 4.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + LOTRPacketWeaponFX packet = new LOTRPacketWeaponFX(LOTRPacketWeaponFX.Type.MACE_SAURON, (Entity)this); + LOTRPacketHandler.networkWrapper.sendToAllAround((IMessage)packet, LOTRPacketHandler.nearEntity((Entity)this, 64.0D)); + if (target != null && isEntityVulnerable(target)) + target.attackEntityFrom(DamageSource.causeMobDamage(getThrower()), 10.0F); + List entities = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, this.boundingBox.expand(6.0D, 6.0D, 6.0D)); + if (!entities.isEmpty()) + for (int i = 0; i < entities.size(); i++) { + EntityLivingBase entity = entities.get(i); + if (entity != target && isEntityVulnerable((Entity)entity)) { + float damage = 10.0F - getDistanceToEntity((Entity)entity) * 0.5F; + if (damage > 0.0F) + entity.attackEntityFrom(DamageSource.causeMobDamage(getThrower()), damage); + } + } + setDead(); + } + + private boolean isEntityVulnerable(Entity entity) { + if (entity == getThrower()) + return false; + if (!(entity instanceof EntityLivingBase)) + return false; + if (entity instanceof EntityPlayer) + return (LOTRLevelData.getData((EntityPlayer)entity).getAlignment(LOTRFaction.HIGH_ELF) < 0.0F); + return !LOTRFaction.HIGH_ELF.isGoodRelation(LOTRMod.getNPCFaction(entity)); + } + + protected float func_70182_d() { + return 1.5F; + } + + protected float getGravityVelocity() { + return 0.0F; + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/items/SarumanWhiteStaff.java b/src/main/java/com/zivilon/cinder_loe/items/SarumanWhiteStaff.java new file mode 100644 index 0000000..68984f6 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/items/SarumanWhiteStaff.java @@ -0,0 +1,46 @@ +package com.zivilon.cinder_loe.items; + +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import java.util.List; +import lotr.common.LOTRCreativeTabs; +import lotr.common.LOTRLevelData; +import lotr.common.LOTRMod; +import lotr.common.fac.LOTRFaction; +import lotr.common.network.LOTRPacketHandler; +import lotr.common.network.LOTRPacketWeaponFX; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.Potion; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +import com.zivilon.cinder_loe.items.WizardStaff; +import com.zivilon.cinder_loe.entity.SarumanWhiteFireball; + +public class SarumanWhiteStaff extends WizardStaff { + public SarumanWhiteStaff() { + super(); + } + + public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) { + entityplayer.swingItem(); + itemstack.damageItem(2, (EntityLivingBase)entityplayer); + world.playSoundAtEntity((Entity)entityplayer, "mob.ghast.fireball", 2.0F, (itemRand.nextFloat() - itemRand.nextFloat()) * 0.2F + 1.0F); + if (!world.isRemote) { + world.spawnEntityInWorld((Entity)new SarumanWhiteFireball(world, (EntityLivingBase)entityplayer)); + LOTRPacketWeaponFX packet = new LOTRPacketWeaponFX(LOTRPacketWeaponFX.Type.MACE_SAURON, (Entity)entityplayer); + LOTRPacketHandler.networkWrapper.sendToAllAround((IMessage)packet, LOTRPacketHandler.nearEntity((Entity)entityplayer, 64.0D)); + } + return itemstack; + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinEntityLivingBase.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinEntityLivingBase.java index a566896..66c73be 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinEntityLivingBase.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinEntityLivingBase.java @@ -199,26 +199,23 @@ public abstract class MixinEntityLivingBase extends Entity { @Dynamic private void check_cauldron() { - try { - Class target_class = EntityLivingBase.class; - - while (target_class != null) { - Method[] methods = target_class.getDeclaredMethods(); - - for (Method method : methods) { - if (method.getName().equals("damageEntity_CB")) { - cauldron_method = method; - return; - } - } + try { + Class target_class = EntityLivingBase.class; + Method[] methods = target_class.getDeclaredMethods(); + + for (Method method : methods) { + if (method.getName().equals("damageEntity_CB")) { + cauldron_method = method; + return; } - } catch (Exception e) { - e.printStackTrace(); } - - return; + } catch (Exception e) { + e.printStackTrace(); } + return; +} + @Dynamic public boolean entitydamage_cauldron(DamageSource source, float damage) { boolean return_value = true; diff --git a/src/main/resources/assets/cinder_loe/lang/en_GB.lang b/src/main/resources/assets/cinder_loe/lang/en_GB.lang index 9206c9c..2b6899c 100644 --- a/src/main/resources/assets/cinder_loe/lang/en_GB.lang +++ b/src/main/resources/assets/cinder_loe/lang/en_GB.lang @@ -1,2 +1,3 @@ item.lotr:sarumanStaff.name=Staff of Saruman of Many Colours +item.lotr:sarumanWhiteStaff.name=Staff of Saruman the White item.lotr:boarArmorRedDwarf.name=Red Dwarven Boar Armour diff --git a/src/main/resources/assets/cinder_loe/lang/en_US.lang b/src/main/resources/assets/cinder_loe/lang/en_US.lang index 399e4aa..5c645fd 100644 --- a/src/main/resources/assets/cinder_loe/lang/en_US.lang +++ b/src/main/resources/assets/cinder_loe/lang/en_US.lang @@ -102,6 +102,7 @@ item.lotr:radagastStaff.name=Staff of Radagast the Brown item.lotr:pallandoStaff.name=Staff of Pallando the Blue item.lotr:alatarStaff.name=Staff of Alatar the Blue item.lotr:sarumanStaff.name=Staff of Saruman of Many Colors +item.lotr:sarumanWhiteStaff.name=Staff of Saruman the White item.lotr:welfRelic.name=Horn of the Greenwood Stag diff --git a/src/main/resources/assets/cinder_loe/misc/particles.png b/src/main/resources/assets/cinder_loe/misc/particles.png index 49e035d..4c77142 100644 Binary files a/src/main/resources/assets/cinder_loe/misc/particles.png and b/src/main/resources/assets/cinder_loe/misc/particles.png differ diff --git a/src/main/resources/assets/lotr/textures/items/large/sarumanWhiteStaff.png b/src/main/resources/assets/lotr/textures/items/large/sarumanWhiteStaff.png new file mode 100644 index 0000000..0262cb5 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/large/sarumanWhiteStaff.png differ diff --git a/src/main/resources/assets/lotr/textures/items/sarumanWhiteStaff.png b/src/main/resources/assets/lotr/textures/items/sarumanWhiteStaff.png new file mode 100644 index 0000000..c5eb5b8 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/sarumanWhiteStaff.png differ