From 91746ff942177656424ab04223cedb0e36eca21d Mon Sep 17 00:00:00 2001 From: Jeremy Diamond Date: Mon, 16 Feb 2015 22:12:54 -0800 Subject: [PATCH] Blink Focus --- .../java/fox/spiteful/forbidden/Config.java | 13 ++ .../forbidden/items/ForbiddenItems.java | 16 ++ .../forbidden/items/wands/ItemFocusBlink.java | 160 ++++++++++++++++++ .../assets/forbidden/lang/en_US.lang | 13 +- .../forbidden/textures/items/focus_blink.png | Bin 0 -> 513 bytes .../textures/items/focus_blink_orn.png | Bin 0 -> 394 bytes .../forbidden/textures/misc/hellfire.png | Bin 0 -> 1259 bytes .../forbidden/textures/misc/pandemonium.png | Bin 0 -> 781 bytes 8 files changed, 199 insertions(+), 3 deletions(-) create mode 100644 src/main/java/fox/spiteful/forbidden/items/wands/ItemFocusBlink.java create mode 100644 src/main/resources/assets/forbidden/textures/items/focus_blink.png create mode 100644 src/main/resources/assets/forbidden/textures/items/focus_blink_orn.png create mode 100644 src/main/resources/assets/forbidden/textures/misc/hellfire.png create mode 100644 src/main/resources/assets/forbidden/textures/misc/pandemonium.png 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 0000000000000000000000000000000000000000..20b11d29b3a7ee95eb6aaa15f8d41993d002ed32 GIT binary patch literal 513 zcmV+c0{;DpP)H;LN@>a0cuG^K~y+TrIRtL!cY`M-9vU^ zB{m`=B0)sNPDCUG2_lGyh=oY7uokhmw6K!2sX}_oY#|Go&v{_bpA`RN@ksLW?wPrh zo04T&rEk_(#RwMy+U>S_y`IM7u?B;I8jXf3m5Pd-<^aRtP{-p@x7$sR$3yq~U8mDY zj^n6auje2i0E(~ItDeuNk|a?SMGAsIm&--l?N+?6R;wS73{b1pwA<|zhN03lRUF4U zpU?7rU-S9g09@CVZQClB%NZmCG@DKB_j^--BDOuxGg(X~6VnzTT)gLz0lM9;R;!ii zb+K5OD2%EA zY&O$ovnh5!h@;UcQ>KVq00N>7LPn%811z;#Ev?sU9S#R$6-5^J1k9J<%=KJK&wD;#x{_mgp_22jd1F{}Y@kiAW00000NkvXXu0mjf D(3;ls literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..a74f9d843ac399ae685aae21dc1e901ba5a6331d GIT binary patch literal 394 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=DDyK$uZbZ`*dDAbW|YuPggq4i0t}_28KcrUHeeN?apKg7ec#$`gxH83GbB^Gfvm zTtgJfjP*?Q3=Q2sJDCGjefD&546*QkJLzWLAp-%|&$1k>suJ!Kr>o=@a)3nyouUrPmxLGmV2JXGu)h{vEbjDi?t=n3o@kwye2Z_O_+0V zoz9otY&VZHUJYlh-ZEjWOXRe3ud;eix+-#QaptzN$Wl2H=#VRt_W9-tOXeTUKa~{A zl(;5ThyUEk^L;-1l<|Ny kpKXRnXyM11`Twrom(S|-HS!Jm2lPIJr>mdKI;Vst0HLpykN^Mx literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..7a429490229736894679ff2c153539bdb76b8fd4 GIT binary patch literal 1259 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGh)&Kwv)&Y=jd7J1;MAa*k@H7+qRNAp5A000D9Nkltz?O6DbPP(az=j&N=hV1xTen$Di}_^QV`WmzgBq5L-ApI_galndLFLv$O9whHsf;$Qf_R2uk^<=*=ms zm{aoSoH{u<`Pvu3IL9JQdpXQIJw2T!M>uwMb+x0Z88|Ol-EK07dV&e!HjMS;xXKd8 zx3;!?Le81UV=iNukNI>k|Kj3e1i6z*OiatJt1A_K5CJ&_K=zz{RA`8VN~tzI=NO2| zj~b6ObZ~I+Q+Q%`celO5DzM!AdTs3U2=I-m=P+-heRz2Ih2}sti=rRKutiNPa9x17 zlZCL0YF}2>0JbamnqFJavyVzmGe_si?rduYu(C2%;=Bbcx3~*I5Zi$4ae;$71)(Xn z?S6OO2l|dNV9v{FsRDeAX1Ia@7be;^AbYbcv42A}DaH!#X(9xjBc*I_$-v&;UXBJV z4-OGZjy-LQBbuL|&%6%g)Vv&2(7#m+3kzx7h%X~KK>jOAKjGj1dxo;^8mbD&K7)_T zSIt&|XSrY^o_UJ^#HPYI0=zib`72y-`kOgmD3CaNF9tz`{v06tjl_pY=lzGgrKP2Y zH$n48@;Qlche|kA(0zHwQ2YD)g=VV{oQH2`!7~SJZf-i~1&g}LXWBOa&IUe+c8Vd_ z03RD9+|Yd*NGk4cpT{+G-%#Ws$m-XB1%$W>ghG;Ij(81p9Iz;~2of?8NQ( z8yF56T3K1iV0BM0{sbjA91-wY$hGdfm;(?qj%T`^bDGoP5f2bFl9~ddwVP_f?(6{z5%>(p11#R1o z{abNyanYH>jhcLe97jwe)R#j+17iqez%`J=Zh}B;9A08h$IK?=bI(8-;w;%UsA3M+ z>>vEn$(o@!8~wKc4&@K1)L%*XB(~MxLQ!s0)@U?p7@r4Z$;HOTMji($tNZ>}$^w5; z>AoGqr*#-tH!yxxyf#)B#j5^TUtiC)auaYJzo$r?kwya(FaSXfo8lvFJb2FA{V_i< zk|kG=pKXrSEAR*b+yWdP)N2bPDNB8 zb~7$DE-^7j^FlWO00N0gL_t(oN8MIiOH@%5Hp;`Cea?6SjX;?6F)yg&trRP@2S-u- z5qXVzkwT4{E-Hfd5EO-APvQ?y5CR|iS3R~oYt8JF%Xj|T#5!SwB6|bl`Jbl5R2<{31VA5Khq3S*6`6^C$v~>b zH(@aNKtQtw0SI6)_(+L0$)TUU6TfE;V1SjWJ40d^VDB^UoQTrq%~Ily+!8#_AHdx0 z-zqMcrsG67ZE$PjL=0k?KvY$cdNoZ)j<07$G-_$w^m#IWq~%8++n|`?VB2aFf?WZwm%TQ25BGBmad&0v z@KN|Z2?%*%>xLAI9Vd(9mj($}cvtYIh-AaT4n0wJ+=nI#80?!RS(TlTUyTXg8McL#-OFBYI$|}WjG6xfW}|Z_mYXD{ zU6bx=hSNb1$cIvNnkf*md(ICHa#~?Odt28!l%2PG^MJZGNK$ylRoxNk$d(nt(H6XE z>blE+QQK)~K?bAL`2R1{xIPoPS$#A