diff --git a/src/main/java/fox/spiteful/forbidden/Config.java b/src/main/java/fox/spiteful/forbidden/Config.java index a8ad102..d5ebd65 100644 --- a/src/main/java/fox/spiteful/forbidden/Config.java +++ b/src/main/java/fox/spiteful/forbidden/Config.java @@ -27,6 +27,9 @@ public class Config { public static int bloodSealPotionID = 70; + public static int hellfireUpgradeID; + public static int pandemoniumUpgradeID; + public static ItemStack thaumcraftResource; public static ItemStack thaumcraftTaintBlock; public static ItemStack thaumcraftOre; @@ -40,6 +43,7 @@ public class Config { public static boolean greedyEnch = true; public static boolean emeraldTrans = true; public static boolean wrathCrazy = false; + public static byte gluttony = 0; public static boolean crossMod = true; public static boolean crossWand = true; @@ -72,6 +76,10 @@ public class Config { voidEnchID = conf.get("enchantments", "Voidtouched", enchCount++).getInt(); impactEnchID = conf.get("enchantments", "Impact", enchCount++).getInt(); + int upgradeCount = 42; + hellfireUpgradeID = conf.get("focus upgrades", "Hellfire", upgradeCount).getInt(upgradeCount++); + pandemoniumUpgradeID = conf.get("focus upgrades", "Pandemonium", upgradeCount).getInt(upgradeCount++); + noLust = conf.get("general", "No Lust", noLust, "Enable to remove Luxuria aspect and related items.").getBoolean(false); silverfishEmeralds = conf.get("general", "Silverfish Drop Emerald Nuggets", silverfishEmeralds, "Disable to prevent Silverfish from dropping emerald nuggets.").getBoolean(true); greedyEnch = conf.get("general", "Capitalist Enchantment", greedyEnch, "Disable to remove the recipe and effects of the Capitalist enchantment.").getBoolean(true); @@ -84,6 +92,10 @@ public class Config { wrathEff = 4; wrathCrazy = conf.get("general", "Wrath Cage Cries Havoc", wrathCrazy, "Enable to let the Wrath Cage imprint on ANY non-boss mob. May break your game or make your game Awesome.").getBoolean(false); spork = conf.get("silly", "Spork of Doom", spork, "What is this? I don't even...").getBoolean(false); + gluttony = (byte)conf.get("silly", "Gluttony", gluttony, "Whether gluttony research is enabled. 0 = Enabled, 1 = Disabled, 2 = Hardcore").getInt(0); + if(gluttony < 0 || gluttony > 2) + gluttony = 0; + bloodSealPotionID = conf.get("potions", "Blood Seal", bloodSealPotionID).getInt(bloodSealPotionID); crossMod = conf.get("compatibility", "Cross-Mod Interaction", crossMod, "Disable to keep mods segregated.").getBoolean(true); @@ -141,6 +153,7 @@ public class Config { spawnerMobs.put("Blaze", Aspect.FIRE); spawnerMobs.put("LavaSlime", Aspect.FIRE); spawnerMobs.put("Witch", Aspect.MAGIC); + spawnerMobs.put("Villager", Aspect.GREED); spawnerMobs.put("Thaumcraft.Firebat", Aspect.FIRE); spawnerMobs.put("Thaumcraft.Wisp", Aspect.AURA); spawnerMobs.put("Thaumcraft.ThaumSlime", Aspect.TAINT); diff --git a/src/main/java/fox/spiteful/forbidden/items/ForbiddenItems.java b/src/main/java/fox/spiteful/forbidden/items/ForbiddenItems.java index 2ad2ebf..249242f 100644 --- a/src/main/java/fox/spiteful/forbidden/items/ForbiddenItems.java +++ b/src/main/java/fox/spiteful/forbidden/items/ForbiddenItems.java @@ -16,6 +16,8 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.oredict.OreDictionary; import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.wands.FocusUpgradeType; import thaumcraft.api.wands.StaffRod; import thaumcraft.api.wands.WandCap; import thaumcraft.api.wands.WandRod; @@ -43,6 +45,8 @@ public class ForbiddenItems { public static Item subCollar; public static Item ringFood; + public static Item blinkFocus; + public static Item bloodRapier; public static Item bloodwell; public static Item bloodOrb; @@ -176,5 +180,17 @@ public class ForbiddenItems { ringFood = new ItemRingNutrition().setUnlocalizedName("RingNutrition"); GameRegistry.registerItem(ringFood, "RingNutrition"); + blinkFocus = new ItemFocusBlink().setUnlocalizedName("BlinkFocus"); + GameRegistry.registerItem(blinkFocus, "BlinkFocus"); + + } + + public static FocusUpgradeType getUpgrade(int id, ResourceLocation icon, String name, String text, AspectList aspects){ + if (id >= FocusUpgradeType.types.length) { + FocusUpgradeType[] temp = new FocusUpgradeType[id+1]; + System.arraycopy(FocusUpgradeType.types, 0, temp, 0, FocusUpgradeType.types.length); + FocusUpgradeType.types = temp; + } + return new FocusUpgradeType(id, icon, name, text, aspects); } } \ No newline at end of file diff --git a/src/main/java/fox/spiteful/forbidden/items/wands/ItemFocusBlink.java b/src/main/java/fox/spiteful/forbidden/items/wands/ItemFocusBlink.java new file mode 100644 index 0000000..cb8aeb8 --- /dev/null +++ b/src/main/java/fox/spiteful/forbidden/items/wands/ItemFocusBlink.java @@ -0,0 +1,160 @@ +package fox.spiteful.forbidden.items.wands; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import fox.spiteful.forbidden.Config; +import fox.spiteful.forbidden.DarkAspects; +import fox.spiteful.forbidden.Forbidden; +import fox.spiteful.forbidden.items.ForbiddenItems; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.*; +import net.minecraft.world.World; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.wands.FocusUpgradeType; +import thaumcraft.api.wands.ItemFocusBasic; +import thaumcraft.common.items.wands.ItemWandCasting; +import thaumcraft.common.lib.utils.BlockUtils; + +import java.util.List; + +public class ItemFocusBlink extends ItemFocusBasic { + + private IIcon icon; + private IIcon ornament; + AspectList visCost = (new AspectList()).add(Aspect.ENTROPY, 300); + AspectList fireCost = (new AspectList()).add(Aspect.ENTROPY, 300).add(Aspect.FIRE, 100); + AspectList switchCost = (new AspectList()).add(Aspect.ENTROPY, 300).add(Aspect.ORDER, 100); + FocusUpgradeType hellfire = ForbiddenItems.getUpgrade(Config.hellfireUpgradeID, new ResourceLocation("forbidden", "textures/misc/hellfire.png"), "forbidden.upgrade.hellfire.name", "forbidden.upgrade.hellfire.text", (new AspectList()).add(DarkAspects.NETHER, 1)); + FocusUpgradeType pandemonium = ForbiddenItems.getUpgrade(Config.pandemoniumUpgradeID, new ResourceLocation("forbidden", "textures/misc/pandemonium.png"), "forbidden.upgrade.pandemonium.name", "forbidden.upgrade.pandemonium.text", (new AspectList()).add(Aspect.DARKNESS, 1)); + + public ItemFocusBlink(){ + super(); + setCreativeTab(Forbidden.tab); + } + + @Override + public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition wut) { + MovingObjectPosition mop = BlockUtils.getTargetBlock(world, (player.prevPosX + (player.posX - player.prevPosX)), + (player.prevPosY + (player.posY - player.prevPosY) + 1.62 - player.yOffset), + (player.prevPosZ + (player.posZ - player.prevPosZ)), + (player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw)), + (player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch)), false, 128.0); + if(mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && mop.sideHit != -1){ + ItemWandCasting wand = (ItemWandCasting)itemstack.getItem(); + if(wand.consumeAllVis(itemstack, player, getVisCost(itemstack), false, false)){ + double ex = mop.hitVec.xCoord; + double wy = mop.hitVec.yCoord; + double zee = mop.hitVec.zCoord; + switch(mop.sideHit){ + case 0: wy -= 2.0; + break; + case 1: break; + case 2: zee -= 0.5; + break; + case 3: zee += 0.5; + break; + case 4: ex -= 0.5; + break; + case 5: ex += 0.5; + break; + } + world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) player.posX, (int) player.posY, (int) player.posZ, 0); + for (int k = 0; k < 8; ++k) + { + world.spawnParticle("smoke", player.posX + (world.rand.nextDouble() - 0.5D) * (double)player.width, player.posY + world.rand.nextDouble() * (double)player.height - 0.25D, player.posZ + (world.rand.nextDouble() - 0.5D) * (double)player.width, 0, 0, 0); + } + double range = 3.0 + 1.5 * wand.getFocusEnlarge(itemstack); + if(this.isUpgradedWith(wand.getFocusItem(itemstack), hellfire)) { + List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(ex - range, wy - range, zee - range, ex + range, wy + range, zee + range)); + for (EntityLivingBase entity : entities) { + if(entity == player) + continue; + for (int k = 0; k < 8; ++k) { + world.spawnParticle("flame", entity.posX + (world.rand.nextDouble() - 0.5D) * (double) entity.width, entity.posY + world.rand.nextDouble() * (double) entity.height - 0.25D, entity.posZ + (world.rand.nextDouble() - 0.5D) * (double) entity.width, 0, 0, 0); + } + int potency = wand.getFocusPotency(itemstack); + entity.attackEntityFrom((new EntityDamageSource("fireball", player)).setFireDamage(), 3 + 3 * potency); + entity.setFire(3 + 3 * potency); + } + } + else if(this.isUpgradedWith(wand.getFocusItem(itemstack), pandemonium)){ + List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(ex - range, wy - range, zee - range, ex + range, wy + range, zee + range)); + for (EntityLivingBase entity : entities) { + if(!(entity instanceof IMob)) + continue; + for (int k = 0; k < 8; ++k) { + world.spawnParticle("smoke", entity.posX + (world.rand.nextDouble() - 0.5D) * (double) entity.width, entity.posY + world.rand.nextDouble() * (double) entity.height - 0.25D, entity.posZ + (world.rand.nextDouble() - 0.5D) * (double) entity.width, 0, 0, 0); + } + entity.setPositionAndUpdate(player.posX, player.posY, player.posZ); + } + } + player.setPositionAndUpdate(ex, wy, zee); + world.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)player.posX, (int)player.posY, (int)player.posZ, 0); + for (int k = 0; k < 8; ++k) + { + world.spawnParticle("flame", player.posX + (world.rand.nextDouble() - 0.5D) * (double)player.width, player.posY + world.rand.nextDouble() * (double)player.height - 0.25D, player.posZ + (world.rand.nextDouble() - 0.5D) * (double)player.width, 0, 0, 0); + } + wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, false); + player.swingItem(); + } + } + return itemstack; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister ir) { + this.icon = ir.registerIcon("forbidden:focus_blink"); + this.ornament = ir.registerIcon("forbidden:focus_blink_orn"); + } + + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamageForRenderPass(int par1, int renderPass) { + return renderPass == 1 ? this.icon : this.ornament; + } + + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() { + return true; + } + + @Override + public int getFocusColor(ItemStack item){ + return 0x909090; + } + + @Override + public IIcon getOrnament(ItemStack focusstack) { + return ornament; + } + + @Override + public AspectList getVisCost(ItemStack item){ + return this.isUpgradedWith(item, hellfire) ? fireCost : this.isUpgradedWith(item, pandemonium) ? switchCost : visCost; + } + + @Override + public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack item, int rank){ + switch(rank){ + case 1: + return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + case 2: + return new FocusUpgradeType[] {hellfire, pandemonium, FocusUpgradeType.frugal}; + case 3: + case 4: + case 5: + if(this.isUpgradedWith(item, hellfire)) + return new FocusUpgradeType[] {FocusUpgradeType.potency, FocusUpgradeType.frugal, FocusUpgradeType.enlarge}; + else if(this.isUpgradedWith(item, pandemonium)) + return new FocusUpgradeType[] {FocusUpgradeType.frugal, FocusUpgradeType.enlarge}; + else + return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + default: + return null; + } + } +} diff --git a/src/main/resources/assets/forbidden/lang/en_US.lang b/src/main/resources/assets/forbidden/lang/en_US.lang index 7697e0d..6ba6158 100644 --- a/src/main/resources/assets/forbidden/lang/en_US.lang +++ b/src/main/resources/assets/forbidden/lang/en_US.lang @@ -80,6 +80,7 @@ item.WandCaps.manasteel.name=Manasteel Cap item.WandCaps.manasteel_inert.name=Inert Manasteel Cap item.WandCaps.elementium.name=Elementium Cap item.WandCaps.elementium_inert.name=Inert Elementium Cap +item.BlinkFocus.name=Wand Focus: Blink # # Blocks tile.ArcaneCake.name=Thaumic Cake @@ -105,11 +106,17 @@ enchantment.impact=Impact # Potions potion.blood_seal=Blood Seal # +# Focus Upgrades +forbidden.upgrade.hellfire.name=Hellfire +forbidden.upgrade.hellfire.text=This upgrade unleashes a burst of fire upon teleporting to a location. +forbidden.upgrade.pandemonium.name=Pandemonium +forbidden.upgrade.pandemonium.text=This upgrade teleports all surrounding enemies to your previous location upon teleporting to a location. +# # Tooltips -tooltip.currentowner=Current owner: +tooltip.currentowner=Current owner: tooltip.divineorb=Stores raw Life Essence tooltip.creativeonly=Creative Only -tooltip.collar.owner=Owner: +tooltip.collar.owner=Owner: # # Messages message.collar.alreadywearing=%s is already wearing something around their neck! @@ -135,7 +142,7 @@ forbidden.research_page.SKULLAXE.1=Some monsters just really boil your blood. Sk # forbidden.research_name.RINGFOOD=Ring of Nutrition forbidden.research_text.RINGFOOD=Cheese puffs prevent scurvy, right? -forbidden.research_page.RINGFOOD.1=People keep scolding you. They insist that you can't just eat cookies all day or that "nutrition doesn't work like that." Well, you've had it with these naysayers.

The Ring of Nutrition provides a boost to the food and saturation values of most foods you eat as long as the ring is worn on your finger.

Side effects may include nausea, headaches, cramping, vertigo, diabetes, and sudden interest in homeopathy. +forbidden.research_page.RINGFOOD.1=People keep scolding you. They insist that you can't just eat cookies all day or that "nutrition doesn't work like that." Well, you've had it with these naysayers.

The Ring of Nutrition provides a boost to the food and saturation values of most foods you eat while wearing the ring on your finger.

(Side effects may include nausea, headaches, cramping, vertigo, diabetes, and sudden interest in homeopathy.) # forbidden.research_name.ARCANECAKE=Thaumic Cake forbidden.research_text.ARCANECAKE=Let them eat cake. diff --git a/src/main/resources/assets/forbidden/textures/items/focus_blink.png b/src/main/resources/assets/forbidden/textures/items/focus_blink.png new file mode 100644 index 0000000..20b11d2 Binary files /dev/null and b/src/main/resources/assets/forbidden/textures/items/focus_blink.png differ diff --git a/src/main/resources/assets/forbidden/textures/items/focus_blink_orn.png b/src/main/resources/assets/forbidden/textures/items/focus_blink_orn.png new file mode 100644 index 0000000..a74f9d8 Binary files /dev/null and b/src/main/resources/assets/forbidden/textures/items/focus_blink_orn.png differ diff --git a/src/main/resources/assets/forbidden/textures/misc/hellfire.png b/src/main/resources/assets/forbidden/textures/misc/hellfire.png new file mode 100644 index 0000000..7a42949 Binary files /dev/null and b/src/main/resources/assets/forbidden/textures/misc/hellfire.png differ diff --git a/src/main/resources/assets/forbidden/textures/misc/pandemonium.png b/src/main/resources/assets/forbidden/textures/misc/pandemonium.png new file mode 100644 index 0000000..1952d1f Binary files /dev/null and b/src/main/resources/assets/forbidden/textures/misc/pandemonium.png differ