mirror of
https://github.com/GTNewHorizons/Tainted-Magic.git
synced 2026-11-22 12:59:56 +00:00
1 parent
6b2ceddd86
commit
cc77874e71
74 files changed
+1696
-1296
No files matched your search
@@ -17,7 +17,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemMaterial extends Item
|
||||
{
|
||||
public int SUBTYPES = 9;
|
||||
public int SUBTYPES = 10;
|
||||
public IIcon[] icons = new IIcon[SUBTYPES];
|
||||
|
||||
public ItemMaterial ()
|
||||
@@ -50,6 +50,8 @@ public class ItemMaterial extends Item
|
||||
return EnumRarity.uncommon;
|
||||
case 8 :
|
||||
return EnumRarity.uncommon;
|
||||
case 9 :
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
return EnumRarity.common;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -105,6 +107,7 @@ public class ItemVoidwalkerBoots extends ItemArmor implements IVisDiscountGear,
|
||||
@Override
|
||||
public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b)
|
||||
{
|
||||
l.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount") + ": " + getVisDiscount(s, p, null) + "%");
|
||||
}
|
||||
|
||||
public void onUpdate (ItemStack s, World w, Entity e, int j, boolean k)
|
||||
|
||||
@@ -241,10 +241,7 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable
|
||||
MovingObjectPosition mop = Minecraft.getMinecraft().objectMouseOver;
|
||||
float mul = Math.min(1.0F + (float) this.ticksInUse / 40.0F, 2.0F);
|
||||
|
||||
if (mop.entityHit != null)
|
||||
{
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketKatanaAttack(mop.entityHit, p, this.getAttackDamage(s) * mul, leech));
|
||||
}
|
||||
if (mop.entityHit != null) PacketHandler.INSTANCE.sendToServer(new PacketKatanaAttack(mop.entityHit, p, this.getAttackDamage(s) * mul, leech));
|
||||
p.swingItem();
|
||||
}
|
||||
p.worldObj.playSoundAtEntity(p, "thaumcraft:swing", 0.5F + (float) Math.random(), 0.5F + (float) Math.random());
|
||||
@@ -256,6 +253,7 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable
|
||||
case 0 :
|
||||
{
|
||||
EntityExplosiveOrb proj = new EntityExplosiveOrb(w, p);
|
||||
proj.strength = getAttackDamage(s) * 2.0F;
|
||||
proj.posX += proj.motionX;
|
||||
proj.posY += proj.motionY;
|
||||
proj.posZ += proj.motionZ;
|
||||
@@ -267,11 +265,10 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable
|
||||
{
|
||||
for (int a = 0; a < 50; a++)
|
||||
{
|
||||
EntityTaintBubble proj = new EntityTaintBubble(w, p, 5.0F, false);
|
||||
EntityTaintBubble proj = new EntityTaintBubble(w, p, 5.0F, getAttackDamage(s) * 1.5F, false);
|
||||
proj.posX += proj.motionX;
|
||||
proj.posY += proj.motionY;
|
||||
proj.posZ += proj.motionZ;
|
||||
proj.damage = getAttackDamage(s) * 0.2F;
|
||||
if (!w.isRemote) w.spawnEntityInWorld(proj);
|
||||
p.swingItem();
|
||||
}
|
||||
@@ -281,6 +278,8 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable
|
||||
break;
|
||||
}
|
||||
}
|
||||
s.stackTagCompound = new NBTTagCompound();
|
||||
s.stackTagCompound.setInteger("inscription", 2);
|
||||
}
|
||||
|
||||
private boolean isFullyCharged (EntityPlayer p)
|
||||
|
||||
@@ -52,8 +52,8 @@ public class ItemThaumicDisassembler extends Item
|
||||
{
|
||||
super.addInformation(s, p, l, b);
|
||||
|
||||
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("\u00A78" + StatCollector.translateToLocal("text.disassembler.mode") + ": " + getModeName(s));
|
||||
l.add("\u00A78" + StatCollector.translateToLocal("text.disassembler.efficiency") + ": " + (getMode(s) == 3 ? "\u00A7c" : "\u00A7a") + getEfficiency(s));
|
||||
l.add(" ");
|
||||
l.add("\u00A79" + "+20 " + StatCollector.translateToLocal("text.attackdamage"));
|
||||
}
|
||||
@@ -185,7 +185,7 @@ public class ItemThaumicDisassembler extends Item
|
||||
|
||||
if (s != null && s.getItem() instanceof ItemThaumicDisassembler)
|
||||
{
|
||||
String str = "\u00A78" + StatCollector.translateToLocal("text.mode") + ": " + getModeName(s) + (getMode(s) == 3 ? "\u00A7c" : "\u00A7a") + " (" + getEfficiency(s) + ")";
|
||||
String str = "\u00A78" + StatCollector.translateToLocal("text.disassembler.mode") + ": " + getModeName(s) + (getMode(s) == 3 ? "\u00A7c" : "\u00A7a") + " (" + getEfficiency(s) + ")";
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package taintedmagic.common.items.wand.foci;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.FocusUpgradeType;
|
||||
|
||||
public class FocusUpgrades
|
||||
{
|
||||
public static int ID = Short.MAX_VALUE;
|
||||
public static FocusUpgradeType sanity = new FocusUpgradeType(ID--, new ResourceLocation("taintedmagic:textures/foci/IconSanity.png"), "focus.upgrade.sanity.name", "focus.upgrade.sanity.text", new AspectList().add(Aspect.MIND, 1).add(Aspect.HEAL, 1));
|
||||
public static FocusUpgradeType bloodlust = new FocusUpgradeType(ID--, new ResourceLocation("taintedmagic:textures/misc/IconBloodlust.png"), "focus.upgrade.bloodlust.name", "focus.upgrade.bloodlust.text", new AspectList().add(Aspect.WEAPON, 1).add(Aspect.HEAL, 1));
|
||||
public static FocusUpgradeType antibody = new FocusUpgradeType(ID--, new ResourceLocation("taintedmagic:textures/foci/IconAntibody.png"), "focus.upgrade.antibody.name", "focus.upgrade.antibody.text", new AspectList().add(Aspect.TAINT, 1).add(Aspect.HEAL, 1));
|
||||
public static FocusUpgradeType corrosive = new FocusUpgradeType(ID--, new ResourceLocation("taintedmagic:textures/foci/IconCorrosive.png"), "focus.upgrade.corrosive.name", "focus.upgrade.corrosive.text", new AspectList().add(Aspect.TAINT, 1).add(Aspect.POISON, 1));
|
||||
public static FocusUpgradeType persistent = new FocusUpgradeType(ID--, new ResourceLocation("taintedmagic:textures/foci/IconPersistent.png"), "focus.upgrade.persistent.name", "focus.upgrade.persistent.text", new AspectList().add(Aspect.ARMOR, 1).add(Aspect.MOTION, 1).add(Aspect.ENERGY, 1));
|
||||
public static FocusUpgradeType maxima = new FocusUpgradeType(ID--, new ResourceLocation("taintedmagic:textures/foci/IconMaxima.png"), "focus.upgrade.maxima.name", "focus.upgrade.maxima.text", new AspectList().add(Aspect.LIGHT, 4).add(Aspect.AURA, 1).add(Aspect.ENERGY, 4));
|
||||
public static FocusUpgradeType glowpet = new FocusUpgradeType(ID--, new ResourceLocation("taintedmagic:textures/foci/IconGlowpet.png"), "focus.upgrade.glowpet.name", "focus.upgrade.glowpet.text", new AspectList().add(Aspect.MOTION, 1).add(Aspect.LIGHT, 4).add(Aspect.ENERGY, 4));
|
||||
public static FocusUpgradeType diffusion = new FocusUpgradeType(ID--, new ResourceLocation("taintedmagic:textures/foci/IconDiffusion.png"), "focus.upgrade.diffusion.name", "focus.upgrade.diffusion.text", new AspectList().add(Aspect.DARKNESS, 1).add(Aspect.ELDRITCH, 4).add(Aspect.AURA, 4));
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
package taintedmagic.common.items.wand.foci;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.entities.EntityDarkMatter;
|
||||
import taintedmagic.common.entities.EntityDiffusion;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.FocusUpgradeType;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.config.Config;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFocusDarkMatter extends ItemFocusBasic
|
||||
{
|
||||
IIcon depthIcon = null;
|
||||
|
||||
private static final AspectList cost = new AspectList().add(Aspect.ENTROPY, 20).add(Aspect.FIRE, 20);
|
||||
private static final AspectList costSanity = new AspectList().add(Aspect.ENTROPY, 20).add(Aspect.FIRE, 50).add(Aspect.ORDER, 50);
|
||||
private static final AspectList costCorrosive = new AspectList().add(Aspect.ENTROPY, 20).add(Aspect.FIRE, 50).add(Aspect.WATER, 20);
|
||||
|
||||
public ItemFocusDarkMatter ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemFocusDarkMatter");
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusDarkMatter");
|
||||
this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusDarkMatter_depth");
|
||||
}
|
||||
|
||||
public IIcon getFocusDepthLayerIcon (ItemStack s)
|
||||
{
|
||||
return this.depthIcon;
|
||||
}
|
||||
|
||||
public String getSortingHelper (ItemStack s)
|
||||
{
|
||||
return "ELDRITCH" + super.getSortingHelper(s);
|
||||
}
|
||||
|
||||
public int getFocusColor (ItemStack s)
|
||||
{
|
||||
return 0x000018;
|
||||
}
|
||||
|
||||
public AspectList getVisCost (ItemStack s)
|
||||
{
|
||||
return isUpgradedWith(s, FocusUpgrades.corrosive) ? costCorrosive : isUpgradedWith(s, FocusUpgrades.sanity) ? costSanity : cost;
|
||||
}
|
||||
|
||||
public int getActivationCooldown (ItemStack s)
|
||||
{
|
||||
return isUpgradedWith(s, FocusUpgrades.diffusion) ? -1 : 1000;
|
||||
}
|
||||
|
||||
public boolean isVisCostPerTick (ItemStack s)
|
||||
{
|
||||
return isUpgradedWith(s, FocusUpgrades.diffusion);
|
||||
}
|
||||
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation (ItemStack s)
|
||||
{
|
||||
return isUpgradedWith(s, FocusUpgrades.diffusion) ? ItemFocusBasic.WandFocusAnimation.CHARGE : ItemFocusBasic.WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop)
|
||||
{
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
|
||||
if (isUpgradedWith(wand.getFocusItem(s), FocusUpgrades.diffusion))
|
||||
{
|
||||
p.setItemInUse(s, 2147483647);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!w.isRemote)
|
||||
{
|
||||
if (wand.consumeAllVis(s, p, getVisCost(s), true, false))
|
||||
{
|
||||
EntityDarkMatter proj = new EntityDarkMatter(w, p, 14F + wand.getFocusPotency(s), isUpgradedWith(wand.getFocusItem(s), FocusUpgrades.corrosive));
|
||||
w.spawnEntityInWorld(proj);
|
||||
if (!isUpgradedWith(wand.getFocusItem(s), FocusUpgrades.sanity))
|
||||
{
|
||||
if (w.rand.nextInt(20) == 0)
|
||||
{
|
||||
Thaumcraft.addStickyWarpToPlayer(p, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
w.playSoundAtEntity(p, "thaumcraft:egattack", 0.4F, 1.0F + w.rand.nextFloat() * 0.1F);
|
||||
}
|
||||
p.swingItem();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
public void onUsingFocusTick (ItemStack s, EntityPlayer p, int i)
|
||||
{
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
if (!wand.consumeAllVis(s, p, getVisCost(s), false, false))
|
||||
{
|
||||
p.stopUsingItem();
|
||||
return;
|
||||
}
|
||||
if (!p.worldObj.isRemote && p.ticksExisted % 5 == 0) p.worldObj.playSoundAtEntity(p, "thaumcraft:wind", 0.33F, 5.0F * (float) Math.random());
|
||||
|
||||
if (!p.worldObj.isRemote && wand.consumeAllVis(s, p, getVisCost(s), true, false))
|
||||
{
|
||||
for (int a = 0; a < 2 + wand.getFocusPotency(s); a++)
|
||||
{
|
||||
EntityDiffusion proj = new EntityDiffusion(p.worldObj, p, isUpgradedWith(wand.getFocusItem(s), FocusUpgradeType.enlarge) ? 15.0F : 8.0F, 10F + wand.getFocusPotency(s), isUpgradedWith(wand.getFocusItem(s), FocusUpgrades.corrosive));
|
||||
proj.posX += proj.motionX;
|
||||
proj.posY += proj.motionY;
|
||||
proj.posZ += proj.motionZ;
|
||||
p.worldObj.spawnEntityInWorld(proj);
|
||||
if (!isUpgradedWith(wand.getFocusItem(s), FocusUpgrades.sanity))
|
||||
{
|
||||
if (p.worldObj.rand.nextInt(200) == 0)
|
||||
{
|
||||
Thaumcraft.addStickyWarpToPlayer(p, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank (ItemStack s, int r)
|
||||
{
|
||||
switch (r)
|
||||
{
|
||||
case 1 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency };
|
||||
case 2 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency };
|
||||
case 3 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency,
|
||||
FocusUpgrades.diffusion,
|
||||
FocusUpgrades.sanity };
|
||||
case 4 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency };
|
||||
case 5 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency,
|
||||
FocusUpgrades.corrosive };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,152 +0,0 @@
|
||||
package taintedmagic.common.items.wand.foci;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.entities.EntityEldritchOrbAttack;
|
||||
import taintedmagic.common.entities.EntityTaintBubble;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.FocusUpgradeType;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.entities.monster.EntityEldritchGuardian;
|
||||
import thaumcraft.common.entities.projectile.EntityEldritchOrb;
|
||||
import thaumcraft.common.entities.projectile.EntityEmber;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import thaumcraft.common.items.wands.WandManager;
|
||||
import thaumcraft.common.lib.network.PacketHandler;
|
||||
import thaumcraft.common.lib.network.misc.PacketMiscEvent;
|
||||
|
||||
public class ItemFocusEldritch extends ItemFocusBasic
|
||||
{
|
||||
public static FocusUpgradeType sanity = new FocusUpgradeType(57, new ResourceLocation("taintedmagic", "textures/foci/IconSanity.png"), "focus.upgrade.sanity.name", "focus.upgrade.sanity.text", new AspectList().add(Aspect.MIND, 1).add(Aspect.HEAL, 1));
|
||||
IIcon depthIcon = null;
|
||||
|
||||
private static final AspectList costBase = new AspectList().add(Aspect.ENTROPY, 20).add(Aspect.FIRE, 20);
|
||||
private static final AspectList costSane = new AspectList().add(Aspect.ENTROPY, 20).add(Aspect.FIRE, 50).add(Aspect.ORDER, 20);
|
||||
private static final AspectList costCorrosive = new AspectList().add(Aspect.ENTROPY, 50).add(Aspect.FIRE, 20).add(Aspect.WATER, 20);
|
||||
|
||||
long soundDelay = 0L;
|
||||
|
||||
public ItemFocusEldritch ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemFocusEldritch");
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusEldritch");
|
||||
this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusEldritch_depth");
|
||||
}
|
||||
|
||||
public IIcon getFocusDepthLayerIcon (ItemStack s)
|
||||
{
|
||||
return this.depthIcon;
|
||||
}
|
||||
|
||||
public String getSortingHelper (ItemStack s)
|
||||
{
|
||||
return "ELDRITCH" + super.getSortingHelper(s);
|
||||
}
|
||||
|
||||
public int getFocusColor (ItemStack s)
|
||||
{
|
||||
return 0x000018;
|
||||
}
|
||||
|
||||
public AspectList getVisCost (ItemStack s)
|
||||
{
|
||||
return isUpgradedWith(s, ItemFocusTaint.corrosive) ? costCorrosive : isUpgradedWith(s, sanity) ? costSane : costBase;
|
||||
}
|
||||
|
||||
public int getActivationCooldown (ItemStack s)
|
||||
{
|
||||
return 600;
|
||||
}
|
||||
|
||||
public boolean isVisCostPerTick (ItemStack s)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation (ItemStack s)
|
||||
{
|
||||
return ItemFocusBasic.WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop)
|
||||
{
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
|
||||
if (!w.isRemote)
|
||||
{
|
||||
int potency = wand.getFocusPotency(s);
|
||||
if (wand.consumeAllVis(s, p, getVisCost(s), true, false))
|
||||
{
|
||||
EntityEldritchOrbAttack orb = null;
|
||||
orb = new EntityEldritchOrbAttack(w, p, isUpgradedWith(wand.getFocusItem(s), ItemFocusTaint.corrosive));
|
||||
orb.dmg = (10F + potency);
|
||||
w.spawnEntityInWorld(orb);
|
||||
if (!isUpgradedWith(wand.getFocusItem(s), sanity))
|
||||
{
|
||||
Random rand = new Random();
|
||||
int randomInt = rand.nextInt(10);
|
||||
if (randomInt == 5)
|
||||
{
|
||||
Thaumcraft.addStickyWarpToPlayer(p, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
w.playSoundAtEntity(p, "thaumcraft:egattack", 0.4F, 1.0F + w.rand.nextFloat() * 0.1F);
|
||||
}
|
||||
p.swingItem();
|
||||
return s;
|
||||
}
|
||||
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank (ItemStack s, int rank)
|
||||
{
|
||||
switch (rank)
|
||||
{
|
||||
case 1 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency };
|
||||
case 2 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency };
|
||||
case 3 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency,
|
||||
ItemFocusTaint.corrosive };
|
||||
case 4 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency };
|
||||
case 5 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency,
|
||||
this.sanity };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,216 @@
|
||||
package taintedmagic.common.items.wand.foci;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.blocks.BlockLumos;
|
||||
import taintedmagic.common.entities.EntityGlowpet;
|
||||
import taintedmagic.common.registry.BlockRegistry;
|
||||
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.FXSparkle;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFocusLumos extends ItemFocusBasic
|
||||
{
|
||||
private static final AspectList cost = new AspectList().add(Aspect.AIR, 500).add(Aspect.FIRE, 500);
|
||||
private static final AspectList costGlowpet = new AspectList().add(Aspect.ORDER, 500).add(Aspect.AIR, 500).add(Aspect.FIRE, 1000);
|
||||
private static final AspectList costMaxima = new AspectList().add(Aspect.ORDER, 1000).add(Aspect.FIRE, 1500).add(Aspect.AIR, 500);
|
||||
|
||||
public ItemFocusLumos ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemFocusLumos");
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusLumos");
|
||||
}
|
||||
|
||||
public String getSortingHelper (ItemStack s)
|
||||
{
|
||||
return "GLOWPET" + super.getSortingHelper(s);
|
||||
}
|
||||
|
||||
public int getFocusColor (ItemStack s)
|
||||
{
|
||||
return 0xFFC27C;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b)
|
||||
{
|
||||
super.addInformation(s, p, l, b);
|
||||
if (this.isUpgradedWith(s, FocusUpgrades.maxima))
|
||||
{
|
||||
l.add(" ");
|
||||
l.add(EnumChatFormatting.BLUE + "+" + new String(this.isUpgradedWith(s, FocusUpgradeType.enlarge) ? Integer.toString(11 + this.getUpgradeLevel(s, FocusUpgradeType.enlarge)) : "11") + " " + StatCollector.translateToLocal("text.radius"));
|
||||
}
|
||||
if (this.isUpgradedWith(s, FocusUpgrades.glowpet))
|
||||
{
|
||||
l.add(" ");
|
||||
l.add(EnumChatFormatting.BLUE + new String(this.isUpgradedWith(s, FocusUpgradeType.extend) ? Integer.toString(1 + this.getUpgradeLevel(s, FocusUpgradeType.extend)) : "1") + "x " + StatCollector.translateToLocal("text.burnTime"));
|
||||
}
|
||||
}
|
||||
|
||||
public AspectList getVisCost (ItemStack s)
|
||||
{
|
||||
return isUpgradedWith(s, FocusUpgrades.maxima) ? this.costMaxima : isUpgradedWith(s, FocusUpgrades.glowpet) ? this.costGlowpet : this.cost;
|
||||
}
|
||||
|
||||
public int getActivationCooldown (ItemStack s)
|
||||
{
|
||||
return 1000;
|
||||
}
|
||||
|
||||
public boolean isVisCostPerTick (ItemStack s)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation (ItemStack s)
|
||||
{
|
||||
return ItemFocusBasic.WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop)
|
||||
{
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
|
||||
if (!w.isRemote)
|
||||
{
|
||||
if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && !p.isSneaking())
|
||||
{
|
||||
if (wand.consumeAllVis(s, p, getVisCost(s), true, false))
|
||||
{
|
||||
int x = mop.blockX;
|
||||
int y = mop.blockY;
|
||||
int z = mop.blockZ;
|
||||
|
||||
switch (mop.sideHit)
|
||||
{
|
||||
case 0 :
|
||||
y--;
|
||||
break;
|
||||
case 1 :
|
||||
y++;
|
||||
break;
|
||||
case 2 :
|
||||
z--;
|
||||
break;
|
||||
case 3 :
|
||||
z++;
|
||||
break;
|
||||
case 4 :
|
||||
x--;
|
||||
break;
|
||||
case 5 :
|
||||
x++;
|
||||
}
|
||||
w.setBlock(x, y, z, BlockRegistry.BlockLumos, 2, 3);
|
||||
w.playSoundAtEntity(p, "thaumcraft:ice", 0.3F, 1.1F + w.rand.nextFloat() * 0.1F);
|
||||
for (int a = 0; a < 9; a++)
|
||||
{
|
||||
FXSparkle fx = new FXSparkle(w, x + w.rand.nextFloat(), y + w.rand.nextFloat(), z + w.rand.nextFloat(), 1.75F, w.rand.nextInt(5), 3 + w.rand.nextInt(3));
|
||||
fx.setGravity(0.1F);
|
||||
ParticleEngine.instance.addEffect(w, fx);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isUpgradedWith(wand.getFocusItem(s), FocusUpgrades.glowpet))
|
||||
{
|
||||
if (wand.consumeAllVis(s, p, getVisCost(s), true, false))
|
||||
{
|
||||
EntityGlowpet pet = new EntityGlowpet(w, p, wand.getFocusExtend(s) + 1);
|
||||
w.spawnEntityInWorld(pet);
|
||||
w.playSoundAtEntity(pet, "taintedmagic:shard", 0.3F, 1.1F + w.rand.nextFloat() * 0.1F);
|
||||
for (int a = 0; a < 18; a++)
|
||||
{
|
||||
FXSparkle fx = new FXSparkle(w, pet.posX + w.rand.nextFloat(), pet.posY + w.rand.nextFloat(), pet.posZ + w.rand.nextFloat(), 1.75F, w.rand.nextInt(5), 3 + w.rand.nextInt(3));
|
||||
fx.setGravity(0.1F);
|
||||
ParticleEngine.instance.addEffect(w, fx);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (isUpgradedWith(wand.getFocusItem(s), FocusUpgrades.maxima))
|
||||
{
|
||||
int r = 11 + wand.getFocusEnlarge(s);
|
||||
if (wand.consumeAllVis(s, p, getVisCost(s), true, false))
|
||||
{
|
||||
for (int xOff = -r; xOff <= r; xOff++)
|
||||
{
|
||||
for (int yOff = -r; yOff <= r; yOff++)
|
||||
{
|
||||
for (int zOff = -r; zOff <= r; zOff++)
|
||||
{
|
||||
int x = (int) (p.posX + xOff);
|
||||
int y = (int) (p.posY + yOff);
|
||||
int z = (int) (p.posZ + zOff);
|
||||
|
||||
if (w.isAirBlock(x, y, z) && w.getBlock(x, y, z) != BlockRegistry.BlockLumos && w.getBlockLightValue(x, y, z) < 9)
|
||||
{
|
||||
BlockLumos src = (BlockLumos) BlockRegistry.BlockLumos;
|
||||
src.setGlowDuration(200);
|
||||
w.setBlock(x, y, z, src, 1, 3);
|
||||
if (w.rand.nextInt(12) == 0)
|
||||
{
|
||||
for (int a = 0; a < 9; a++)
|
||||
{
|
||||
FXSparkle fx = new FXSparkle(w, x + w.rand.nextFloat(), y + w.rand.nextFloat(), z + w.rand.nextFloat(), 1.75F, w.rand.nextInt(5), 3 + w.rand.nextInt(3));
|
||||
fx.setGravity(0.1F);
|
||||
ParticleEngine.instance.addEffect(w, fx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
w.playSoundAtEntity(p, "thaumcraft:ice", 0.3F, 1.1F + w.rand.nextFloat() * 0.1F);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
p.swingItem();
|
||||
return s;
|
||||
}
|
||||
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank (ItemStack s, int r)
|
||||
{
|
||||
switch (r)
|
||||
{
|
||||
case 1 :
|
||||
return new FocusUpgradeType[]{ FocusUpgrades.glowpet, FocusUpgrades.maxima, FocusUpgradeType.frugal };
|
||||
case 2 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, isUpgradedWith(s, FocusUpgrades.glowpet) ? FocusUpgradeType.extend : isUpgradedWith(s, FocusUpgrades.maxima) ? FocusUpgradeType.enlarge : null };
|
||||
case 3 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, isUpgradedWith(s, FocusUpgrades.glowpet) ? FocusUpgradeType.extend : isUpgradedWith(s, FocusUpgrades.maxima) ? FocusUpgradeType.enlarge : null };
|
||||
case 4 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, isUpgradedWith(s, FocusUpgrades.glowpet) ? FocusUpgradeType.extend : isUpgradedWith(s, FocusUpgrades.maxima) ? FocusUpgradeType.enlarge : null };
|
||||
case 5 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, isUpgradedWith(s, FocusUpgrades.glowpet) ? FocusUpgradeType.extend : isUpgradedWith(s, FocusUpgrades.maxima) ? FocusUpgradeType.enlarge : null };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean canApplyUpgrade (ItemStack s, EntityPlayer p, FocusUpgradeType t, int rank)
|
||||
{
|
||||
return !t.equals(FocusUpgradeType.enlarge) || ((ItemFocusBasic) s.getItem()).isUpgradedWith(s, FocusUpgrades.maxima);
|
||||
}
|
||||
}
|
||||
@@ -28,10 +28,7 @@ public class ItemFocusMageMace extends ItemFocusBasic
|
||||
public IIcon depthIcon = null;
|
||||
public IIcon ornIcon = null;
|
||||
|
||||
public int dmg;
|
||||
|
||||
public static FocusUpgradeType bloodlust = new FocusUpgradeType(58, new ResourceLocation("taintedmagic", "textures/misc/IconBloodlust.png"), "focus.upgrade.bloodlust.name", "focus.upgrade.bloodlust.text", new AspectList().add(Aspect.WEAPON, 1).add(Aspect.HEAL, 1));
|
||||
public static final AspectList costBase = new AspectList().add(Aspect.ENTROPY, 50);
|
||||
public static final AspectList cost = new AspectList().add(Aspect.ENTROPY, 50);
|
||||
public static final AspectList costBloodlust = new AspectList().add(Aspect.ENTROPY, 50).add(Aspect.ORDER, 20).add(Aspect.FIRE, 50);
|
||||
|
||||
public ItemFocusMageMace ()
|
||||
@@ -70,7 +67,7 @@ public class ItemFocusMageMace extends ItemFocusBasic
|
||||
|
||||
public AspectList getVisCost (ItemStack s)
|
||||
{
|
||||
return this.isUpgradedWith(s, bloodlust) ? this.costBloodlust : this.costBase;
|
||||
return this.isUpgradedWith(s, FocusUpgrades.bloodlust) ? this.costBloodlust : this.cost;
|
||||
}
|
||||
|
||||
public int getActivationCooldown (ItemStack s)
|
||||
@@ -125,13 +122,13 @@ public class ItemFocusMageMace extends ItemFocusBasic
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency,
|
||||
this.bloodlust };
|
||||
FocusUpgrades.bloodlust };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean canApplyUpgrade (ItemStack s, EntityPlayer p, FocusUpgradeType t, int rank)
|
||||
{
|
||||
return (!t.equals(this.bloodlust)) || (ThaumcraftApiHelper.isResearchComplete(p.getCommandSenderName(), "BLOODLUSTUPGRADE"));
|
||||
return (!t.equals(FocusUpgrades.bloodlust)) || (ThaumcraftApiHelper.isResearchComplete(p.getCommandSenderName(), "BLOODLUSTUPGRADE"));
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,14 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.helper.TaintedMagicHelper;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXWisp;
|
||||
import thaumcraft.codechicken.lib.vec.Vector3;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import thaumcraft.common.items.wands.WandManager;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -20,7 +25,7 @@ public class ItemFocusMeteorology extends ItemFocusBasic
|
||||
{
|
||||
IIcon depthIcon = null;
|
||||
|
||||
private static final AspectList costBase = new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000).add(Aspect.FIRE, 1000).add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000);
|
||||
private static final AspectList cost = new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000).add(Aspect.FIRE, 1000).add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000);
|
||||
|
||||
public ItemFocusMeteorology ()
|
||||
{
|
||||
@@ -57,7 +62,7 @@ public class ItemFocusMeteorology extends ItemFocusBasic
|
||||
|
||||
public int getActivationCooldown (ItemStack s)
|
||||
{
|
||||
return 1;
|
||||
return 30000;
|
||||
}
|
||||
|
||||
public boolean isVisCostPerTick (ItemStack s)
|
||||
@@ -72,14 +77,38 @@ public class ItemFocusMeteorology extends ItemFocusBasic
|
||||
|
||||
public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop)
|
||||
{
|
||||
WandManager.setCooldown(p, 30000);
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
wand.consumeAllVis(s, p, getVisCost(s), true, false);
|
||||
|
||||
w.getWorldInfo().setRainTime(w.isRaining() ? 24000 : 0);
|
||||
w.getWorldInfo().setRaining(!w.isRaining());
|
||||
if (wand.consumeAllVis(s, p, getVisCost(s), true, false))
|
||||
{
|
||||
w.getWorldInfo().setRainTime(w.isRaining() ? 24000 : 0);
|
||||
w.getWorldInfo().setRaining(!w.isRaining());
|
||||
p.playSound("thaumcraft:wand", 0.5F, 1.0F);
|
||||
|
||||
p.playSound("thaumcraft:wand", 0.5F, 1.0F);
|
||||
if (w.isRemote)
|
||||
{
|
||||
for (int i = 1; i < 200; i++)
|
||||
{
|
||||
double xp = (-Math.random() * 2.0F) + (Math.random() * 2.0F);
|
||||
double zp = (-Math.random() * 2.0F) + (Math.random() * 2.0F);
|
||||
double yp = (-Math.random() * 2.0F) + (Math.random() * 2.0F);
|
||||
double off = Math.random() * 0.1;
|
||||
|
||||
float green = p.worldObj.rand.nextFloat();
|
||||
float blue = p.worldObj.rand.nextFloat();
|
||||
|
||||
FXWisp ef = new FXWisp(w, p.posX + xp + off, p.posY + 10 + yp + off, p.posZ + zp + off, 0.5F + ((float) Math.random() * 0.25F), 0.25F, green, blue);
|
||||
ef.setGravity(0.75F);
|
||||
ef.shrink = true;
|
||||
ef.noClip = true;
|
||||
|
||||
Vector3 movement = TaintedMagicHelper.getDistanceBetween(ef, p);
|
||||
ef.addVelocity(movement.x * 0.5, movement.y * 0.5, movement.z * 0.5);
|
||||
|
||||
ParticleEngine.instance.addEffect(w, ef);
|
||||
}
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,12 +27,10 @@ import thaumcraft.common.items.wands.WandManager;
|
||||
|
||||
public class ItemFocusTaint extends ItemFocusBasic
|
||||
{
|
||||
public static FocusUpgradeType tainturgy = new FocusUpgradeType(55, new ResourceLocation("taintedmagic", "textures/foci/IconTainturgy.png"), "focus.upgrade.tainturgy.name", "focus.upgrade.tainturgy.text", new AspectList().add(Aspect.TAINT, 1).add(Aspect.HEAL, 1));
|
||||
public static FocusUpgradeType corrosive = new FocusUpgradeType(56, new ResourceLocation("taintedmagic", "textures/foci/IconCorrosive.png"), "focus.upgrade.corrosive.name", "focus.upgrade.corrosive.text", new AspectList().add(Aspect.TAINT, 1).add(Aspect.POISON, 1));
|
||||
IIcon depthIcon = null;
|
||||
|
||||
private static final AspectList costBase = new AspectList().add(Aspect.EARTH, 10).add(Aspect.WATER, 10);
|
||||
private static final AspectList costTainturgist = new AspectList().add(Aspect.EARTH, 10).add(Aspect.WATER, 10).add(Aspect.ORDER, 10);
|
||||
private static final AspectList cost = new AspectList().add(Aspect.EARTH, 10).add(Aspect.WATER, 10);
|
||||
private static final AspectList costAntibody = new AspectList().add(Aspect.EARTH, 10).add(Aspect.WATER, 10).add(Aspect.ORDER, 10);
|
||||
|
||||
public ItemFocusTaint ()
|
||||
{
|
||||
@@ -64,7 +62,7 @@ public class ItemFocusTaint extends ItemFocusBasic
|
||||
|
||||
public AspectList getVisCost (ItemStack s)
|
||||
{
|
||||
return isUpgradedWith(s, tainturgy) ? costTainturgist : costBase;
|
||||
return isUpgradedWith(s, FocusUpgrades.antibody) ? costAntibody : cost;
|
||||
}
|
||||
|
||||
public int getActivationCooldown (ItemStack s)
|
||||
@@ -86,7 +84,6 @@ public class ItemFocusTaint extends ItemFocusBasic
|
||||
{
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
p.setItemInUse(s, 2147483647);
|
||||
WandManager.setCooldown(p, -1);
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -98,27 +95,20 @@ public class ItemFocusTaint extends ItemFocusBasic
|
||||
p.stopUsingItem();
|
||||
return;
|
||||
}
|
||||
int range = 8;
|
||||
Vec3 vec3d = p.getLook(range);
|
||||
if (!p.worldObj.isRemote && p.ticksExisted % 5 == 0) p.worldObj.playSoundAtEntity(p, "thaumcraft:bubble", 0.33F, 5.0F * (float) Math.random());
|
||||
|
||||
int potency = wand.getFocusPotency(s);
|
||||
if ( (!p.worldObj.isRemote) && (wand.consumeAllVis(s, p, getVisCost(s), true, false)))
|
||||
if (!p.worldObj.isRemote && wand.consumeAllVis(s, p, getVisCost(s), true, false))
|
||||
{
|
||||
float scatter = isUpgradedWith(wand.getFocusItem(s), FocusUpgradeType.enlarge) ? 15.0F : 8.0F;
|
||||
for (int a = 0; a < 2 + wand.getFocusPotency(s); a++)
|
||||
{
|
||||
EntityTaintBubble orb = new EntityTaintBubble(p.worldObj, p, scatter, isUpgradedWith(wand.getFocusItem(s), this.corrosive));
|
||||
orb.posX += orb.motionX;
|
||||
orb.posY += orb.motionY;
|
||||
orb.posZ += orb.motionZ;
|
||||
orb.damage = 5F + potency;
|
||||
p.worldObj.spawnEntityInWorld(orb);
|
||||
if (!isUpgradedWith(wand.getFocusItem(s), tainturgy))
|
||||
EntityTaintBubble proj = new EntityTaintBubble(p.worldObj, p, isUpgradedWith(wand.getFocusItem(s), FocusUpgradeType.enlarge) ? 15.0F : 8.0F, 4F + wand.getFocusPotency(s), isUpgradedWith(wand.getFocusItem(s), FocusUpgrades.corrosive));
|
||||
proj.posX += proj.motionX;
|
||||
proj.posY += proj.motionY;
|
||||
proj.posZ += proj.motionZ;
|
||||
p.worldObj.spawnEntityInWorld(proj);
|
||||
if (!isUpgradedWith(wand.getFocusItem(s), FocusUpgrades.antibody))
|
||||
{
|
||||
Random rand = new Random();
|
||||
int randomInt = rand.nextInt(150);
|
||||
if (randomInt == 9)
|
||||
if (p.worldObj.rand.nextInt(150) == 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -150,7 +140,7 @@ public class ItemFocusTaint extends ItemFocusBasic
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency,
|
||||
tainturgy };
|
||||
FocusUpgrades.antibody };
|
||||
case 4 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
@@ -160,7 +150,7 @@ public class ItemFocusTaint extends ItemFocusBasic
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency,
|
||||
corrosive };
|
||||
FocusUpgrades.corrosive };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
+12
-22
@@ -24,25 +24,25 @@ import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFocusTaintedBlast extends ItemFocusBasic
|
||||
public class ItemFocusTaintedShockwave extends ItemFocusBasic
|
||||
{
|
||||
private static final AspectList costBase = new AspectList().add(Aspect.ENTROPY, 500).add(Aspect.EARTH, 500).add(Aspect.WATER, 500);
|
||||
private static final AspectList cost = new AspectList().add(Aspect.ENTROPY, 1000).add(Aspect.EARTH, 1000).add(Aspect.WATER, 1000).add(Aspect.ORDER, 500);
|
||||
|
||||
public static IIcon depthIcon;
|
||||
public static IIcon ornIcon;
|
||||
|
||||
public ItemFocusTaintedBlast ()
|
||||
public ItemFocusTaintedShockwave ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemFocusTaintedBlast");
|
||||
this.setUnlocalizedName("ItemFocusTaintedShockwave");
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusTaintedBlast");
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusTaintedShockwave");
|
||||
this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusTaint_depth");
|
||||
this.ornIcon = ir.registerIcon("taintedmagic:ItemFocusTaintedBlast_orn");
|
||||
this.ornIcon = ir.registerIcon("taintedmagic:ItemFocusTaintedShockwave_orn");
|
||||
}
|
||||
|
||||
public IIcon getFocusDepthLayerIcon (ItemStack s)
|
||||
@@ -67,7 +67,7 @@ public class ItemFocusTaintedBlast extends ItemFocusBasic
|
||||
|
||||
public AspectList getVisCost (ItemStack s)
|
||||
{
|
||||
return costBase;
|
||||
return cost;
|
||||
}
|
||||
|
||||
public int getActivationCooldown (ItemStack s)
|
||||
@@ -128,25 +128,15 @@ public class ItemFocusTaintedBlast extends ItemFocusBasic
|
||||
switch (rank)
|
||||
{
|
||||
case 1 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.enlarge };
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.enlarge };
|
||||
case 2 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.enlarge };
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.enlarge };
|
||||
case 3 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.enlarge };
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.enlarge };
|
||||
case 4 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.enlarge };
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.enlarge };
|
||||
case 5 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.enlarge };
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.enlarge };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package taintedmagic.common.items.wand.foci;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
@@ -10,11 +11,15 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.helper.TaintedMagicHelper;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXWisp;
|
||||
import thaumcraft.codechicken.lib.vec.Vector3;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import thaumcraft.common.items.wands.WandManager;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -22,7 +27,7 @@ public class ItemFocusTime extends ItemFocusBasic
|
||||
{
|
||||
IIcon depthIcon = null;
|
||||
|
||||
private static final AspectList costBase = new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000).add(Aspect.FIRE, 1000).add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000);
|
||||
private static final AspectList cost = new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000).add(Aspect.FIRE, 1000).add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000);
|
||||
|
||||
public ItemFocusTime ()
|
||||
{
|
||||
@@ -60,7 +65,7 @@ public class ItemFocusTime extends ItemFocusBasic
|
||||
|
||||
public int getActivationCooldown (ItemStack s)
|
||||
{
|
||||
return 1;
|
||||
return 30000;
|
||||
}
|
||||
|
||||
public boolean isVisCostPerTick (ItemStack s)
|
||||
@@ -75,13 +80,38 @@ public class ItemFocusTime extends ItemFocusBasic
|
||||
|
||||
public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop)
|
||||
{
|
||||
WandManager.setCooldown(p, 30000);
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
|
||||
if (wand.consumeAllVis(s, p, getVisCost(s), true, false))
|
||||
{
|
||||
w.setWorldTime(w.isDaytime() ? 14000 : 0);
|
||||
w.setWorldTime(w.isDaytime() ? 14000 : 24000);
|
||||
p.playSound("thaumcraft:wand", 0.5F, 1.0F);
|
||||
|
||||
if (w.isRemote)
|
||||
{
|
||||
for (int i = 1; i < 200; i++)
|
||||
{
|
||||
double xp = (-Math.random() * 2.0F) + (Math.random() * 2.0F);
|
||||
double zp = (-Math.random() * 2.0F) + (Math.random() * 2.0F);
|
||||
double yp = (-Math.random() * 2.0F) + (Math.random() * 2.0F);
|
||||
double off = Math.random() * 0.1;
|
||||
|
||||
float red = p.worldObj.rand.nextFloat();
|
||||
float green = p.worldObj.rand.nextFloat();
|
||||
float blue = p.worldObj.rand.nextFloat();
|
||||
|
||||
FXWisp ef = new FXWisp(w, p.posX + xp + off, p.posY + 10 + yp + off, p.posZ + zp + off, 0.5F + ((float) Math.random() * 0.25F), red, green, blue);
|
||||
ef.setGravity(0.75F);
|
||||
ef.shrink = true;
|
||||
ef.noClip = true;
|
||||
|
||||
Vector3 movement = TaintedMagicHelper.getDistanceBetween(ef, p);
|
||||
ef.addVelocity(movement.x * 0.5, movement.y * 0.5, movement.z * 0.5);
|
||||
|
||||
ParticleEngine.instance.addEffect(w, ef);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -25,10 +25,8 @@ import thaumcraft.common.lib.utils.EntityUtils;
|
||||
*/
|
||||
public class ItemFocusVisShard extends ItemFocusBasic
|
||||
{
|
||||
private static final AspectList cost = new AspectList().add(Aspect.FIRE, 1).add(Aspect.ENTROPY, 1).add(Aspect.AIR, 1);
|
||||
private static final AspectList costPersistant = new AspectList().add(Aspect.FIRE, 1).add(Aspect.ENTROPY, 1).add(Aspect.WATER, 1).add(Aspect.AIR, 1);
|
||||
|
||||
public static FocusUpgradeType persistant = new FocusUpgradeType(69, new ResourceLocation("taintedmagic:textures/foci/IconPersistant.png"), "focus.upgrade.persistant.name", "focus.upgrade.persistant.text", new AspectList().add(Aspect.ARMOR, 1).add(Aspect.MOTION, 1).add(Aspect.ENERGY, 1));
|
||||
private static final AspectList cost = new AspectList().add(Aspect.FIRE, 100).add(Aspect.ENTROPY, 100).add(Aspect.AIR, 100);
|
||||
private static final AspectList costPersistent = new AspectList().add(Aspect.FIRE, 100).add(Aspect.ENTROPY, 100).add(Aspect.WATER, 100).add(Aspect.AIR, 100);
|
||||
|
||||
public ItemFocusVisShard ()
|
||||
{
|
||||
@@ -71,9 +69,12 @@ public class ItemFocusVisShard extends ItemFocusBasic
|
||||
{
|
||||
if (!w.isRemote)
|
||||
{
|
||||
EntityHomingShard blast = new EntityHomingShard(w, p, (EntityLivingBase) look, wand.getFocusPotency(s), isUpgradedWith(wand.getFocusItem(s), persistant));
|
||||
w.spawnEntityInWorld(blast);
|
||||
w.playSoundAtEntity(blast, "taintedmagic:shard", 0.3F, 1.1F + w.rand.nextFloat() * 0.1F);
|
||||
if (wand.consumeAllVis(s, p, getVisCost(s), true, false))
|
||||
{
|
||||
EntityHomingShard blast = new EntityHomingShard(w, p, (EntityLivingBase) look, wand.getFocusPotency(s), isUpgradedWith(wand.getFocusItem(s), FocusUpgrades.persistent));
|
||||
w.spawnEntityInWorld(blast);
|
||||
w.playSoundAtEntity(blast, "taintedmagic:shard", 0.3F, 1.1F + w.rand.nextFloat() * 0.1F);
|
||||
}
|
||||
}
|
||||
p.swingItem();
|
||||
}
|
||||
@@ -82,7 +83,7 @@ public class ItemFocusVisShard extends ItemFocusBasic
|
||||
|
||||
public AspectList getVisCost (ItemStack s)
|
||||
{
|
||||
return isUpgradedWith(s, persistant) ? costPersistant : cost;
|
||||
return isUpgradedWith(s, FocusUpgrades.persistent) ? costPersistent : cost;
|
||||
}
|
||||
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank (ItemStack s, int r)
|
||||
@@ -109,7 +110,7 @@ public class ItemFocusVisShard extends ItemFocusBasic
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency,
|
||||
persistant };
|
||||
FocusUpgrades.persistent };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user