Collar of Pain added

This commit is contained in:
Jeremy Diamond committed 2014-11-17 04:40:36 -08:00
1 parent ce6e5597e0
commit b885af2e87
7 files changed
+166 -5

No files matched your search

@@ -3,8 +3,13 @@ package fox.spiteful.forbidden;
import java.util.*;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import baubles.api.BaublesApi;
import baubles.common.lib.PlayerHandler;
import cpw.mods.fml.common.eventhandler.EventPriority;
import fox.spiteful.forbidden.blocks.BlockBlackFlower;
import fox.spiteful.forbidden.compat.Compat;
import fox.spiteful.forbidden.items.ItemRidingCrop;
import fox.spiteful.forbidden.items.ItemSubCollar;
import fox.spiteful.forbidden.items.ItemTaintPickaxe;
import fox.spiteful.forbidden.potions.DarkPotions;
import fox.spiteful.forbidden.tiles.SubTileEuclidaisy;
@@ -392,6 +397,34 @@ public class FMEventHandler {
}
}
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onFeelPain(LivingHurtEvent event){
if(!Config.noLust && event.ammount > 0 && event.entityLiving instanceof EntityPlayer){
EntityPlayer player = (EntityPlayer)event.entityLiving;
ItemStack amulet = PlayerHandler.getPlayerBaubles(player).getStackInSlot(0);
if(amulet != null && amulet.getItem() == ForbiddenItems.subCollar){
int doses = 3 * (int)event.ammount;
if(event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer){
EntityPlayer dom = (EntityPlayer)event.source.getEntity();
int chance = 1;
if(dom.getHeldItem() != null && dom.getHeldItem().getItem() instanceof ItemRidingCrop) {
doses += 3;
chance += 3;
}
if(player.worldObj.provider.dimensionId == -1 && randy.nextInt(30) < chance){
EntityItem ent = player.entityDropItem(new ItemStack(ForbiddenItems.deadlyShards, 1, 4), 1.0F);
ent.motionY += player.worldObj.rand.nextFloat() * 0.05F;
ent.motionX += (player.worldObj.rand.nextFloat() - player.worldObj.rand.nextFloat()) * 0.1F;
ent.motionZ += (player.worldObj.rand.nextFloat() - player.worldObj.rand.nextFloat()) * 0.1F;
}
}
for(int x = 0;x < doses; x++){
((ItemSubCollar)ForbiddenItems.subCollar).addVis(amulet, primals[randy.nextInt(6)], 1, true);
}
}
}
}
@SubscribeEvent
public void onTooltip(ItemTooltipEvent event) {
if (event.itemStack.getItem() instanceof ItemWandCasting) {
@@ -17,6 +17,7 @@ import thaumcraft.api.wands.WandCap;
import fox.spiteful.forbidden.blocks.ForbiddenBlocks;
import fox.spiteful.forbidden.enchantments.DarkEnchantments;
import fox.spiteful.forbidden.items.ForbiddenItems;
import thaumcraft.common.config.ConfigItems;
public class ForbiddenRecipes {
public static void addRecipes() {
@@ -25,6 +26,8 @@ public class ForbiddenRecipes {
ForbiddenResearch.recipes.put("WandRodTainted", ThaumcraftApi.addInfusionCraftingRecipe("ROD_tainted", new ItemStack(ForbiddenItems.wandCore, 1, 0), 5, (new AspectList()).add(Aspect.TAINT, 24).add(Aspect.MAGIC, 12).add(Aspect.ENTROPY, 12), ItemApi.getItem("itemResource", 12), new ItemStack[] { ItemApi.getItem("itemResource", 14), new ItemStack(ForbiddenItems.deadlyShards, 1, 2), new ItemStack(ForbiddenItems.deadlyShards, 1, 2), new ItemStack(ForbiddenItems.deadlyShards, 1, 2), new ItemStack(ForbiddenItems.deadlyShards, 1, 2), new ItemStack(ForbiddenItems.deadlyShards, 1, 2), new ItemStack(ForbiddenItems.deadlyShards, 1, 2) }));
ForbiddenResearch.recipes.put("SkullAxe", ThaumcraftApi.addInfusionCraftingRecipe("SKULLAXE", new ItemStack(ForbiddenItems.skullAxe), 1, (new AspectList()).add(DarkAspects.WRATH, 8).add(Aspect.WEAPON, 8).add(DarkAspects.NETHER, 8), ItemApi.getItem("itemAxeThaumium", 0), new ItemStack[] { new ItemStack(ForbiddenItems.deadlyShards, 1, 0), new ItemStack(ForbiddenItems.deadlyShards, 1, 0), new ItemStack(Items.diamond), new ItemStack(Items.skull, 1, 1) }));
if(!Config.noLust)
ForbiddenResearch.recipes.put("SubCollar", ThaumcraftApi.addInfusionCraftingRecipe("SUBCOLLAR", new ItemStack(ForbiddenItems.subCollar), 7, (new AspectList()).add(DarkAspects.LUST, 8).add(Aspect.TRAP, 8).add(DarkAspects.NETHER, 4).add(Aspect.FLESH, 4), new ItemStack(ConfigItems.itemAmuletVis, 1, 1), new ItemStack[] { new ItemStack(ForbiddenItems.deadlyShards, 1, 4), new ItemStack(ForbiddenItems.deadlyShards, 1, 4), new ItemStack(ForbiddenItems.deadlyShards, 1, 4), new ItemStack(Items.lead, 1), new ItemStack(ConfigItems.itemBaubleBlanks, 1, 2) }));
ForbiddenResearch.recipes.put("ArcaneCake", ThaumcraftApi.addInfusionCraftingRecipe("ARCANECAKE", new ItemStack(ForbiddenItems.arcaneCakeItem), 3, (new AspectList()).add(DarkAspects.GLUTTONY, 12).add(Aspect.HUNGER, 24).add(Aspect.CRAFT, 24), new ItemStack(Items.cake), new ItemStack[] { ItemApi.getItem("itemResource", 14), new ItemStack(Items.egg), new ItemStack(Items.milk_bucket), new ItemStack(Items.egg), new ItemStack(Items.sugar), new ItemStack(Items.sugar) }));
ForbiddenResearch.recipes.put("MorphPick", ThaumcraftApi.addInfusionCraftingRecipe("MORPHTOOLS", new ItemStack(ForbiddenItems.morphPickaxe), 6, (new AspectList()).add(Aspect.EXCHANGE, 32).add(DarkAspects.ENVY, 16).add(Aspect.TOOL, 16), ItemApi.getItem("itemPickThaumium", 0), new ItemStack[] { new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(Items.diamond), ItemApi.getItem("itemResource", 3), ItemApi.getBlock("blockMagicalLog", 1) }));
ForbiddenResearch.recipes.put("MorphSword", ThaumcraftApi.addInfusionCraftingRecipe("MORPHTOOLS", new ItemStack(ForbiddenItems.morphSword), 6, (new AspectList()).add(Aspect.EXCHANGE, 32).add(DarkAspects.ENVY, 16).add(Aspect.WEAPON, 16), ItemApi.getItem("itemSwordThaumium", 0), new ItemStack[] { new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(Items.diamond), ItemApi.getItem("itemResource", 3), ItemApi.getBlock("blockMagicalLog", 1) }));
@@ -53,8 +53,10 @@ public class ForbiddenResearch {
else
(new DarkResearchItem("NETHERSHARDS", "FORBIDDEN", new AspectList(), -8, -2, 0, new ItemStack(ForbiddenItems.deadlyShards, 1, 0))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.NETHERSHARDS.1"), new ResearchPage("forbidden.research_page.NETHERSHARDS.2b"), new ResearchPage("forbidden.research_page.NETHERSHARDS.3") }).setStub().setRound().setAutoUnlock().registerResearchItem();
(new DarkResearchItem("RIDINGCROP", "FORBIDDEN", new AspectList(), -8, -1, 0, new ItemStack(ForbiddenItems.ridingCrop))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.RIDINGCROP.1"), new ResearchPage((IRecipe) recipes.get("RidingCrop")) }).setStub().setRound().setAutoUnlock().registerResearchItem();
(new DarkResearchItem("RIDINGCROP", "FORBIDDEN", new AspectList(), -9, -1, 0, new ItemStack(ForbiddenItems.ridingCrop))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.RIDINGCROP.1"), new ResearchPage((IRecipe) recipes.get("RidingCrop")) }).setStub().setRound().setAutoUnlock().registerResearchItem();
(new DarkResearchItem("HELLFIRE", "FORBIDDEN", (new AspectList()).add(Aspect.FIRE, 3).add(DarkAspects.NETHER, 4).add(Aspect.TRAVEL, 2), -5, 2, 1, new ItemStack(Blocks.fire))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.HELLFIRE.1") }).setRound().registerResearchItem();
if(!Config.noLust)
(new DarkResearchItem("SUBCOLLAR", "FORBIDDEN", (new AspectList()).add(Aspect.AURA, 3).add(DarkAspects.LUST, 8).add(Aspect.MAGIC, 3).add(Aspect.TRAP, 6).add(Aspect.FLESH, 4), -8, -1, 3, new ItemStack(ForbiddenItems.subCollar))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.SUBCOLLAR.1"), new ResearchPage((InfusionRecipe) recipes.get("SubCollar")) }).setParents(new String[] { "VISAMULET", "INFAUXSION" }).setHidden().setAspectTriggers(new Aspect[]{DarkAspects.LUST}).registerResearchItem();
(new DarkResearchItem("SKULLAXE", "FORBIDDEN", (new AspectList()).add(Aspect.WEAPON, 3).add(DarkAspects.WRATH, 4).add(DarkAspects.NETHER, 1), -8, 1, 2, new ItemStack(ForbiddenItems.skullAxe))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.SKULLAXE.1"), new ResearchPage((InfusionRecipe) recipes.get("SkullAxe")) }).setParents(new String[] { "THAUMIUM", "INFAUXSION" }).setConcealed().registerResearchItem();
ThaumcraftApi.addWarpToResearch("SKULLAXE", 1);
@@ -49,9 +49,10 @@ public class ForbiddenItems {
public static Item morphAxe;
public static Item crystalwell;
public static Item ridingCrop;
public static Item boundShears;
public static Item bloodRapier;
public static Item subCollar;
public static Item boundShears;
public static Item bloodRapier;
public static Item bloodwell;
public static Item bloodOrb;
public static Item boundwell;
@@ -160,6 +161,9 @@ public class ForbiddenItems {
boundwell = new ItemBoundwell().setUnlocalizedName("Boundwell");
GameRegistry.registerItem(boundwell, "Boundwell");
bloodRapier = new ItemBloodRapier().setUnlocalizedName("BloodRapier");
GameRegistry.registerItem(bloodRapier, "BloodRapier");
} catch (Throwable e) {
e.printStackTrace();
}
@@ -171,8 +175,10 @@ public class ForbiddenItems {
ridingCrop = new ItemRidingCrop(ToolMaterial.WOOD).setUnlocalizedName("RidingCrop");
GameRegistry.registerItem(ridingCrop, "RidingCrop");
bloodRapier = new ItemBloodRapier().setUnlocalizedName("BloodRapier");
GameRegistry.registerItem(bloodRapier, "BloodRapier");
if(!Config.noLust) {
subCollar = new ItemSubCollar().setUnlocalizedName("SubCollar");
GameRegistry.registerItem(subCollar, "SubCollar");
}
// boundShears = new ItemBoundShears(Config.boundShearsID,
// ThaumcraftApi.toolMatThaumium).setUnlocalizedName("BoundShears");
@@ -0,0 +1,112 @@
package fox.spiteful.forbidden.items;
import baubles.common.lib.PlayerHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import fox.spiteful.forbidden.Forbidden;
import fox.spiteful.forbidden.compat.Compat;
import fox.spiteful.forbidden.potions.DarkPotions;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.common.items.baubles.ItemAmuletVis;
import java.text.DecimalFormat;
import java.util.Iterator;
import java.util.List;
public class ItemSubCollar extends ItemAmuletVis {
public IIcon icon;
DecimalFormat myFormatter = new DecimalFormat("#######.##");
public ItemSubCollar(){
super();
maxStackSize = 1;
setCreativeTab(Forbidden.tab);
}
@Override
public String getUnlocalizedName(ItemStack stack) {
return "item." + "SubCollar";
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister ir) {
icon = ir.registerIcon("forbidden:collar");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1) {
return icon;
}
@Override
public boolean canEquip(ItemStack itemstack, EntityLivingBase player) {
return true;
}
public int getMaxVis(ItemStack stack) {
return 25000;
}
@Override
public EnumRarity getRarity(ItemStack itemstack) {
return EnumRarity.rare;
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
//list.add(EnumChatFormatting.DARK_RED + StatCollector.translateToLocal("item.SubCollar.text"));
list.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("item.capacity.text") + " " + this.getMaxVis(stack) / 100);
if(stack.hasTagCompound()) {
Iterator count = Aspect.getPrimalAspects().iterator();
while(count.hasNext()) {
Aspect aspect = (Aspect)count.next();
if(stack.stackTagCompound.hasKey(aspect.getTag())) {
String amount = this.myFormatter.format((double)((float)stack.stackTagCompound.getInteger(aspect.getTag()) / 100.0F));
list.add("\u00a7" + aspect.getChatcolor() + aspect.getName() + EnumChatFormatting.RESET + " x " + amount);
}
}
}
}
/**
* Returns true if the item can be used on the given entity, e.g. shears on sheep.
*/
@Override
public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity)
{
if (entity.worldObj.isRemote)
{
return false;
}
if (entity instanceof EntityPlayer)
{
EntityPlayer sub = (EntityPlayer)entity;
IInventory baubles = PlayerHandler.getPlayerBaubles(sub);
if(baubles.getStackInSlot(0) == null) {
baubles.setInventorySlotContents(0, itemstack.copy());
itemstack.stackSize = 0;
sub.addChatMessage(new ChatComponentText(player.getDisplayName() + " places a collar around your neck."));
return true;
}
}
return false;
}
}