Spell Work
Finished the spell blocks enough to allow further expansion. Need to work on textures, as well as the orientation mechanics of the blocks. Also need to look at Vazkii's block renderer to verify a few feature additions.
This commit is contained in:
parent
1393a24b6e
commit
5dcef131dc
22 changed files with 765 additions and 85 deletions
|
@ -7,7 +7,6 @@ public class ItemBloodRuneBlock extends ItemBlock
|
|||
|
||||
{
|
||||
public ItemBloodRuneBlock(int par1)
|
||||
|
||||
{
|
||||
super(par1);
|
||||
setHasSubtypes(true);
|
||||
|
|
|
@ -1,49 +1,52 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellModifierOffensive;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigm;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffectFire;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancementPotency;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancementPower;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
public class ItemComplexSpellCrystal extends EnergyItems
|
||||
import java.util.List;
|
||||
|
||||
public class ItemComplexSpellCrystal extends EnergyItems
|
||||
{
|
||||
|
||||
public ItemComplexSpellCrystal(int id)
|
||||
{
|
||||
super(id);
|
||||
this.maxStackSize = 1;
|
||||
//setMaxDamage(1000);
|
||||
setEnergyUsed(50);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
public ItemComplexSpellCrystal(int par1)
|
||||
{
|
||||
par3List.add("I feel lighter already...");
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
super(par1);
|
||||
this.setMaxStackSize(1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AirSigil");
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BlankSpell");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Crystal of infinite possibilities.");
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
|
||||
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
|
||||
par3List.add("Coords: " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord"));
|
||||
par3List.add("Bound Dimension: " + getDimensionID(par1ItemStack));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -56,18 +59,50 @@ public class ItemComplexSpellCrystal extends EnergyItems
|
|||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if(par2World.isRemote)
|
||||
if (!par2World.isRemote)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
SpellParadigm parad = new SpellParadigmSelf();
|
||||
parad.addBufferedEffect(new SpellEffectFire());
|
||||
parad.modifyBufferedEffect(new SpellModifierOffensive());
|
||||
parad.applyEnhancement(new SpellEnhancementPower());
|
||||
parad.applyEnhancement(new SpellEnhancementPotency());
|
||||
parad.castSpell(par2World, par3EntityPlayer, par1ItemStack);
|
||||
//World world = MinecraftServer.getServer().worldServers[getDimensionID(par1ItemStack)];
|
||||
World world = DimensionManager.getWorld(getDimensionID(par1ItemStack));
|
||||
|
||||
if (world != null)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
|
||||
TileEntity tileEntity = world.getBlockTileEntity(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord"));
|
||||
|
||||
if (tileEntity instanceof TESpellParadigmBlock)
|
||||
{
|
||||
TESpellParadigmBlock tileParad = (TESpellParadigmBlock) tileEntity;
|
||||
|
||||
tileParad.castSpell(par2World, par3EntityPlayer, par1ItemStack);
|
||||
} else
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
} else
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
} else
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
// if (!par2World.isRemote)
|
||||
// {
|
||||
// //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage));
|
||||
// par2World.spawnEntityInWorld(new FireProjectile(par2World, par3EntityPlayer, 10));
|
||||
// }
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
public int getDimensionID(ItemStack itemStack)
|
||||
{
|
||||
if (itemStack.stackTagCompound == null)
|
||||
{
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
return itemStack.stackTagCompound.getInteger("dimensionId");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemSpellEffectBlock extends ItemBlock
|
||||
|
||||
{
|
||||
public ItemSpellEffectBlock(int par1)
|
||||
{
|
||||
super(par1);
|
||||
setHasSubtypes(true);
|
||||
this.setUnlocalizedName("itemSpellEffectBlock");
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack itemstack)
|
||||
|
||||
{
|
||||
String name = "";
|
||||
|
||||
switch (itemstack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "fire";
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
name = "fill";
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
name = "empty";
|
||||
break;
|
||||
|
||||
case 3:
|
||||
name = "test";
|
||||
break;
|
||||
|
||||
default:
|
||||
name = "broken";
|
||||
}
|
||||
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
public int getMetadata(int par1)
|
||||
|
||||
{
|
||||
return par1;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemSpellEnhancementBlock extends ItemBlock
|
||||
|
||||
{
|
||||
public ItemSpellEnhancementBlock(int par1)
|
||||
{
|
||||
super(par1);
|
||||
setHasSubtypes(true);
|
||||
this.setUnlocalizedName("itemSpellEnhancementBlock");
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack itemstack)
|
||||
|
||||
{
|
||||
String name = "";
|
||||
|
||||
switch (itemstack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
name = "power1";
|
||||
break;
|
||||
|
||||
case 1:
|
||||
name = "power2";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
name = "power3";
|
||||
break;
|
||||
|
||||
case 3:
|
||||
name = "power4";
|
||||
break;
|
||||
|
||||
case 4:
|
||||
name = "power5";
|
||||
break;
|
||||
|
||||
case 5:
|
||||
name = "cost1";
|
||||
break;
|
||||
|
||||
case 6:
|
||||
name = "cost2";
|
||||
break;
|
||||
|
||||
case 7:
|
||||
name = "cost3";
|
||||
break;
|
||||
|
||||
case 8:
|
||||
name = "cost4";
|
||||
break;
|
||||
|
||||
case 9:
|
||||
name = "cost5";
|
||||
break;
|
||||
|
||||
case 10:
|
||||
name = "potency1";
|
||||
break;
|
||||
|
||||
case 11:
|
||||
name = "potency2";
|
||||
break;
|
||||
|
||||
case 12:
|
||||
name = "potency3";
|
||||
break;
|
||||
|
||||
case 13:
|
||||
name = "potency4";
|
||||
break;
|
||||
|
||||
case 14:
|
||||
name = "potency5";
|
||||
break;
|
||||
|
||||
default:
|
||||
name = "broken";
|
||||
}
|
||||
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
public int getMetadata(int par1)
|
||||
|
||||
{
|
||||
return par1;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemSpellModifierBlock extends ItemBlock
|
||||
|
||||
{
|
||||
public ItemSpellModifierBlock(int par1)
|
||||
{
|
||||
super(par1);
|
||||
setHasSubtypes(true);
|
||||
this.setUnlocalizedName("itemSpellModifierBlock");
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack itemstack)
|
||||
|
||||
{
|
||||
String name = "";
|
||||
|
||||
switch (itemstack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "power";
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
name = "efficiency";
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
name = "potency";
|
||||
break;
|
||||
|
||||
default:
|
||||
name = "broken";
|
||||
}
|
||||
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
public int getMetadata(int par1)
|
||||
|
||||
{
|
||||
return par1;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemSpellParadigmBlock extends ItemBlock
|
||||
|
||||
{
|
||||
public ItemSpellParadigmBlock(int par1)
|
||||
{
|
||||
super(par1);
|
||||
setHasSubtypes(true);
|
||||
this.setUnlocalizedName("itemSpellParadigmBlock");
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack itemstack)
|
||||
|
||||
{
|
||||
String name = "";
|
||||
|
||||
switch (itemstack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "projectile";
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
name = "self";
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
name = "melee";
|
||||
break;
|
||||
|
||||
default:
|
||||
name = "broken";
|
||||
}
|
||||
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
public int getMetadata(int par1)
|
||||
{
|
||||
return par1;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue