Added lens of the killer

Closes #315
This commit is contained in:
Ellpeck 2016-11-02 18:49:57 +01:00
parent 89f953df03
commit 9b5ead76a2
13 changed files with 84 additions and 8 deletions

View file

@ -16,6 +16,6 @@ bootytoast=actuallyadditions:itemWorm@0
#Patreon stuff
ftog_thorgal=actuallyadditions:itemCrystal@0
minetechniker=actuallyadditions:itemCrystalEmpowered@2
3pixel=actuallyadditions:itemCrystal@3
3pixel=actuallyadditions:itemMoreDamageLens
kirindave=actuallyadditions:itemCrystalEmpowered@3
theonewhohunts=actuallyadditions:itemCrystalEmpowered@4

View file

@ -83,6 +83,7 @@ public final class ActuallyAdditionsAPI{
public static LensConversion lensDefaultConversion;
public static Lens lensDetonation;
public static Lens lensDeath;
public static Lens lensEvenMoarDeath;
public static Lens lensColor;
public static Lens lensDisruption;
public static Lens lensDisenchanting;

View file

@ -148,6 +148,7 @@ public final class InitBooklet{
new BookletChapter("additionalRecipes", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(Items.LEATHER), new PageReconstructor(1, LensRecipeHandler.recipeSoulSand).setNoText(), new PageReconstructor(2, LensRecipeHandler.recipeLeather).setNoText(), new PageReconstructor(3, LensRecipeHandler.recipeNetherWart).setNoText(), new PageReconstructor(4, LensRecipeHandler.recipePrismarine).setNoText()).setSpecial();
new BookletChapter("lensColor", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemColorLens), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeColorLens).setNoText());
new BookletChapter("lensDeath", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemDamageLens), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeDamageLens).setNoText());
new BookletChapter("lensMoreDeath", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemMoreDamageLens), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLensMoreDeath).setNoText());
new BookletChapter("lensDetonation", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemExplosionLens), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeExplosionLens).setNoText());
new BookletChapter("lensDisenchanting", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemDisenchantingLens), new PageTextOnly(1).addTextReplacement("<energy>", LensDisenchanting.ENERGY_USE), new PageCrafting(2, ItemCrafting.recipeDisenchantingLens).setNoText()).setSpecial();
new BookletChapter("lensMining", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemMiningLens), new PageTextOnly(1).addTextReplacement("<energy>", LensMining.ENERGY_USE), new PageCrafting(2, ItemCrafting.recipeMiningLens).setNoText()).setImportant();

View file

@ -139,6 +139,7 @@ public enum ConfigCrafting{
CHEST_TO_CRATE_UPGRADE("Chest To Crate Upgrade", ConfigCategories.ITEMS_CRAFTING),
DISENCHANTING_LENS("Disenchanting Lens", ConfigCategories.ITEMS_CRAFTING),
MINING_LENS("Mining Lens", ConfigCategories.ITEMS_CRAFTING),
MORE_DEATH_LENS("Killer Lens", ConfigCategories.ITEMS_CRAFTING),
CRATE_KEEPER("Crate Keeper", ConfigCategories.ITEMS_CRAFTING),
DRILL_CORE("Drill Core", ConfigCategories.ITEMS_CRAFTING),
ATOMIC_RECONSTRUCTOR("Atomic Reconstructor", ConfigCategories.BLOCKS_CRAFTING),

View file

@ -21,7 +21,9 @@ import de.ellpeck.actuallyadditions.mod.items.metalists.*;
import de.ellpeck.actuallyadditions.mod.util.RecipeUtil;
import de.ellpeck.actuallyadditions.mod.util.Util;
import net.minecraft.block.IGrowable;
import net.minecraft.enchantment.EnchantmentData;
import net.minecraft.init.Blocks;
import net.minecraft.init.Enchantments;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
@ -91,6 +93,7 @@ public final class ItemCrafting{
public static IRecipe recipeMiningLens;
public static IRecipe recipeBag;
public static IRecipe recipeVoidBag;
public static IRecipe recipeLensMoreDeath;
public static void init(){
@ -188,6 +191,18 @@ public final class ItemCrafting{
recipeMiningLens = RecipeUtil.lastIRecipe();
}
//Killer Lens
if(ConfigCrafting.MORE_DEATH_LENS.isEnabled()){
ItemStack enchBook = new ItemStack(Items.ENCHANTED_BOOK);
Items.ENCHANTED_BOOK.addEnchantment(enchBook, new EnchantmentData(Enchantments.SHARPNESS, 5));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemMoreDamageLens),
new ItemStack(Items.DIAMOND_SWORD),
new ItemStack(InitItems.itemDamageLens),
enchBook));
recipeLensMoreDeath = RecipeUtil.lastIRecipe();
}
//Filter
if(ConfigCrafting.FILTER.isEnabled()){
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemFilter),

View file

@ -157,6 +157,7 @@ public class CreativeTab extends CreativeTabs{
this.add(InitItems.itemColorLens);
this.add(InitItems.itemExplosionLens);
this.add(InitItems.itemDamageLens);
this.add(InitItems.itemMoreDamageLens);
this.add(InitItems.itemDisenchantingLens);
this.add(InitItems.itemMiningLens);
this.add(InitItems.itemLaserWrench);

View file

@ -144,6 +144,7 @@ public final class InitItems{
public static Item itemColorLens;
public static Item itemExplosionLens;
public static Item itemDamageLens;
public static Item itemMoreDamageLens;
public static Item itemDisenchantingLens;
public static Item itemMiningLens;
@ -236,6 +237,7 @@ public final class InitItems{
itemColorLens = new ItemLens("itemColorLens", ActuallyAdditionsAPI.lensColor);
itemExplosionLens = new ItemLens("itemExplosionLens", ActuallyAdditionsAPI.lensDetonation);
itemDamageLens = new ItemLens("itemDamageLens", ActuallyAdditionsAPI.lensDeath);
itemMoreDamageLens = new ItemLens("itemMoreDamageLens", ActuallyAdditionsAPI.lensEvenMoarDeath);
itemDisenchantingLens = new ItemLens("itemDisenchantingLens", ActuallyAdditionsAPI.lensDisenchanting);
itemMiningLens = new ItemLens("itemMiningLens", ActuallyAdditionsAPI.lensMining);
itemCrystal = new ItemCrystal("itemCrystal", false);

View file

@ -24,19 +24,27 @@ public class LensDeath extends Lens{
@Override
public boolean invoke(IBlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile){
int use = 150; //Per Block (because it doesn't only activate when something is hit like the other lenses!)
if(tile.getEnergy() >= use){
tile.extractEnergy(use);
ArrayList<EntityLivingBase> entities = (ArrayList<EntityLivingBase>)tile.getWorldObject().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), hitBlock.getX()+1, hitBlock.getY()+1, hitBlock.getZ()+1));
for(EntityLivingBase entity : entities){
int use = this.getUsePerEntity();
if(tile.getEnergy() >= use){
tile.extractEnergy(use);
ArrayList<EntityLivingBase> entities = (ArrayList<EntityLivingBase>)tile.getWorldObject().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), hitBlock.getX()+1, hitBlock.getY()+1, hitBlock.getZ()+1));
for(EntityLivingBase entity : entities){
entity.attackEntityFrom(DamageSources.DAMAGE_ATOMIC_RECONSTRUCTOR, 20F);
this.onAttacked(entity, tile);
}
}
return hitBlock != null && !hitState.getBlock().isAir(hitState, tile.getWorldObject(), hitBlock);
}
protected void onAttacked(EntityLivingBase entity, IAtomicReconstructor tile){
entity.attackEntityFrom(DamageSources.DAMAGE_ATOMIC_RECONSTRUCTOR, 20F);
}
protected int getUsePerEntity(){
return 350;
}
@Override
public float[] getColor(){
return new float[]{188F/255F, 222F/255F, 1F};

View file

@ -0,0 +1,36 @@
/*
* This file ("LensEvenMoarDeath.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
* © 2015-2016 Ellpeck
*/
package de.ellpeck.actuallyadditions.mod.items.lens;
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import net.minecraft.entity.EntityLivingBase;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
public class LensEvenMoarDeath extends LensDeath{
@Override
protected void onAttacked(EntityLivingBase entity, IAtomicReconstructor tile){
try{
ReflectionHelper.setPrivateValue(EntityLivingBase.class, entity, 100, 37);
}
catch(Exception e){
ModUtil.LOGGER.error("A Damage Lens at "+tile.getX()+", "+tile.getY()+", "+tile.getZ()+" in World "+tile.getWorldObject().provider.getDimension()+" threw an Exception! Don't let that happen again!", e);
}
super.onAttacked(entity, tile);
}
@Override
protected int getUsePerEntity(){
return 2500;
}
}

View file

@ -19,6 +19,7 @@ public final class Lenses{
ActuallyAdditionsAPI.lensDefaultConversion = new LensConversion();
ActuallyAdditionsAPI.lensDetonation = new LensDetonation();
ActuallyAdditionsAPI.lensDeath = new LensDeath();
ActuallyAdditionsAPI.lensEvenMoarDeath = new LensEvenMoarDeath();
ActuallyAdditionsAPI.lensColor = new LensColor();
ActuallyAdditionsAPI.lensDisruption = new LensDisruption();
ActuallyAdditionsAPI.lensDisenchanting = new LensDisenchanting();

View file

@ -512,6 +512,7 @@ item.actuallyadditions.itemVoidBag.name=Void Sack
item.actuallyadditions.itemMiscCrystallizedCanolaSeed.name=Crystallized Canola Seed
item.actuallyadditions.itemMiscEmpoweredCanolaSeed.name=Empowered Canola Seed
item.actuallyadditions.itemMiningLens.name=Lens of the Miner
item.actuallyadditions.itemMoreDamageLens.name=Lens of the Killer
#Tooltips
tooltip.actuallyadditions.onSuffix.desc=On
@ -1049,4 +1050,7 @@ booklet.actuallyadditions.chapter.farmer.name=Farmer
booklet.actuallyadditions.chapter.farmer.text.1=The <item>Farmer<r> is a block that can, once placed in the world, <imp>plant and harvest<r> crops like Wheat, Potatoes, Canola <imp>and more<r>. <n>The <imp>left side<r> of its GUI is reserved for <item>seeds<r>, while the <imp>right side<r> will contain the <imp>harvested goods<r>. <n>It will farm in a <imp>9x9 area<r> in front of it. <n>For every operation, it uses <imp><energy> RF<r>. <n><n><n><i>my fam
booklet.actuallyadditions.chapter.reviews.name=What people think
booklet.actuallyadditions.chapter.reviews.text.1="Actually Additions, to me, is quite magical in a way." <n> -<item>Saphrym<r> <n><n>"Actually quite cool. Lots of nice little additions. Gonna be in the pack." <n> -<item>Direwolf20<r> <n><n>"Mod Dev quite rude and arrogant" <n> -<item>Bubb1e0seven<r> <n><n>"A whimsical breath of fresh air in a stuffy tech-mod world." <n> -<item>mezz<r>
booklet.actuallyadditions.chapter.reviews.text.1="Actually Additions, to me, is quite magical in a way." <n> -<item>Saphrym<r> <n><n>"Actually quite cool. Lots of nice little additions. Gonna be in the pack." <n> -<item>Direwolf20<r> <n><n>"Mod Dev quite rude and arrogant" <n> -<item>Bubb1e0seven<r> <n><n>"A whimsical breath of fresh air in a stuffy tech-mod world." <n> -<item>mezz<r>
booklet.actuallyadditions.chapter.lensMoreDeath.name=Lens of the Killer
booklet.actuallyadditions.chapter.lensMoreDeath.text.1=The <item>Lens of the Killer<r> works much like the <item>Lens of Certain Death<r>, however it will also <imp>drop experience<r> and <imp>player-kill loot<r>. <n>This means, however, that it will use <imp>a lot more power<r>. <n><n>To pick up the experience it drops, you might want to try an <item>Experience Solidifier<r>.

View file

@ -0,0 +1,6 @@
{
"parent": "actuallyadditions:item/standardItem",
"textures": {
"layer0": "actuallyadditions:items/itemMoreDamageLens"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B