diff --git a/changelog b/changelog index b57ae1165..ae800e046 100644 --- a/changelog +++ b/changelog @@ -1,5 +1,5 @@ ## Changed -* Any bullet that can ricochet (or at least runs the code for it) can now also break glass +* Any bullet that can ricochet (or at least runs the code for it) can now also break glass, as well as destroy red barrels * Removed three old achievements which no longer work due to the gun changes * AJR armor plating now uses niobium instead of saturnite, and yields twice as many items per recipe * Due to the gating change, the saturnite anvil now has a tier equivalent to a bronze anvil @@ -8,6 +8,15 @@ * Obviously shot will always fare worse against higher tier armor, in those cases either use flechettes, slugs, any of the high tier rounds or a different caliber entirely * Bombers and cargo planes now use interpolation, making their movement smoother and fixing potential desyncs due to TPS * Trenchmaster armor no longer displays benefits that no longer exist +* Legendaries are no longer found in red rooms, rather they have a whole new system of being discovered and crafted + * "Recipes" are still subject to change, but the base system is final + * There will some day be a completely new dungeon for those, but for now I used what I had +* Glyphids now make use of the same resistance system as armors, their armor is no longer completely ignored by the new guns + * Different damage types have different resistances + * Damage resistance remains the same, while damage threshold is determined by the glyphid's armor - breaking the armor off will decrease the damage threshold + * Balancing might still be off, however glyhids shouldn't be too tanky +* I still haven't bothered to fix the bolter. It's like the son I don't love +* Changed some of the sounds of the guns that still used the default black powder noise ## Fixed * Fixed 9mm soft points being called ".9mm" @@ -26,4 +35,6 @@ * Fixed the second UZI dealing more damage than it should * Potentially fixed an issue where artillery rockets would sometimes get stuck mid-air * Fixed the artillery rocket turret's grace range not being 250 as advertised -* Fixed black powder shotshells using smokeless powder instead of smokeful powder \ No newline at end of file +* Fixed black powder shotshells using smokeless powder instead of smokeful powder +* Fixed the ballistic gauntlet not working with the new system + * Since base damage is now bound to weapons, the ballistic gauntlet now has a base damage of 15 \ No newline at end of file diff --git a/src/main/java/api/hbm/entity/IResistanceProvider.java b/src/main/java/api/hbm/entity/IResistanceProvider.java new file mode 100644 index 000000000..4f5935d12 --- /dev/null +++ b/src/main/java/api/hbm/entity/IResistanceProvider.java @@ -0,0 +1,15 @@ +package api.hbm.entity; + +import net.minecraft.util.DamageSource; + +/** + * Allows custom entities to specify threshold and resistance values based on incoming damage, type and piercing values, along with whatever other internal stats + * the entity has (like glyphid armor). Obviously only works for our own custom entities implementing this, everything else will have to work with the less powerful + * (but still very useful) entity stats in the DamageResistanceHandler. + * + * @author hbm + */ +public interface IResistanceProvider { + + public float[] getCurrentDTDR(DamageSource damage, float amount, float pierceDT, float pierce); +} diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index 17183e61f..cc6d8cec0 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -112,6 +112,7 @@ public class ModBlocks { public static Block cluster_depth_tungsten; public static Block stone_keyhole; + public static Block stone_keyhole_meta; public static Block stone_depth_nether; public static Block ore_depth_nether_neodymium; @@ -1279,6 +1280,7 @@ public class ModBlocks { ore_alexandrite = new BlockDepthOre().setBlockName("ore_alexandrite").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ore_alexandrite"); stone_keyhole = new BlockKeyhole().setBlockName("stone_keyhole").setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":stone_keyhole"); + stone_keyhole_meta = new BlockRedBrickKeyhole(Material.rock).setCreativeTab(null).setBlockName("stone_keyhole_meta").setResistance(10_000); ore_bedrock = new BlockBedrockOreTE().setBlockName("ore_bedrock").setCreativeTab(null); ore_volcano = new BlockFissure().setBlockName("ore_volcano").setLightLevel(1F).setCreativeTab(MainRegistry.blockTab); @@ -2423,6 +2425,7 @@ public class ModBlocks { //Secret register(stone_keyhole); + register(stone_keyhole_meta); //Resource-bearing Stones register(stone_resource); diff --git a/src/main/java/com/hbm/blocks/generic/BlockKeyhole.java b/src/main/java/com/hbm/blocks/generic/BlockKeyhole.java index 4f3368d92..f267857fd 100644 --- a/src/main/java/com/hbm/blocks/generic/BlockKeyhole.java +++ b/src/main/java/com/hbm/blocks/generic/BlockKeyhole.java @@ -108,6 +108,14 @@ public class BlockKeyhole extends BlockStone { } } + if(world.rand.nextInt(1) == 0) { + int r = world.rand.nextInt(4); + if(r == 0) world.setBlock(x + width, y + 2, z, ModBlocks.stone_keyhole_meta, 4, 3); + if(r == 1) world.setBlock(x - width, y + 2, z, ModBlocks.stone_keyhole_meta, 5, 3); + if(r == 2) world.setBlock(x, y + 2, z + width, ModBlocks.stone_keyhole_meta, 2, 3); + if(r == 3) world.setBlock(x, y + 2, z - width, ModBlocks.stone_keyhole_meta, 3, 3); + } + for(int i = -width + 1; i <= width - 1; i++) { for(int j = -width + 1; j <= width - 1; j++) { //Floor and ceiling @@ -213,9 +221,7 @@ public class BlockKeyhole extends BlockStone { public static void spawnPedestalItem(World world, int x, int y, int z) { world.setBlock(x, y, z, ModBlocks.pedestal); TileEntityPedestal pedestal = (TileEntityPedestal) world.getTileEntity(x, y, z); - WeightedRandomChestContent content = world.rand.nextInt(20) == 0 ? - (WeightedRandomChestContent) WeightedRandom.getRandomItem(world.rand, ItemPool.getPool(ItemPoolsRedRoom.POOL_RED_WEAPON)) : - (WeightedRandomChestContent) WeightedRandom.getRandomItem(world.rand, ItemPool.getPool(ItemPoolsRedRoom.POOL_RED_PEDESTAL)); + WeightedRandomChestContent content = (WeightedRandomChestContent) WeightedRandom.getRandomItem(world.rand, ItemPool.getPool(ItemPoolsRedRoom.POOL_RED_PEDESTAL)); pedestal.item = content.theItemId.copy(); } } diff --git a/src/main/java/com/hbm/blocks/generic/BlockRedBrickKeyhole.java b/src/main/java/com/hbm/blocks/generic/BlockRedBrickKeyhole.java new file mode 100644 index 000000000..bef78f2f2 --- /dev/null +++ b/src/main/java/com/hbm/blocks/generic/BlockRedBrickKeyhole.java @@ -0,0 +1,161 @@ +package com.hbm.blocks.generic; + +import java.util.List; +import java.util.Random; + +import com.hbm.blocks.ModBlocks; +import com.hbm.blocks.generic.BlockPedestal.TileEntityPedestal; +import com.hbm.itempool.ItemPool; +import com.hbm.itempool.ItemPoolsRedRoom; +import com.hbm.items.ModItems; +import com.hbm.items.tool.ItemModDoor; +import com.hbm.lib.Library; +import com.hbm.lib.RefStrings; +import com.hbm.main.MainRegistry; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class BlockRedBrickKeyhole extends Block { + + protected IIcon iconFront; + protected IIcon iconTop; + + public BlockRedBrickKeyhole(Material material) { + super(material); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { + this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":stone_keyhole_meta"); + this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":brick_red_top"); + this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":brick_base"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) { + return side == meta ? (side == 0 || side == 1 ? this.iconTop : this.iconFront) : this.blockIcon; + } + + @Override + public Item getItemDropped(int i, Random rand, int j) { + return null; + } + + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) { + return new ItemStack(ModBlocks.brick_red); + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) { + int l = BlockPistonBase.determineOrientation(world, x, y, z, player); + world.setBlockMetadataWithNotify(x, y, z, l, 2); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { + + if(player.getHeldItem() != null) { + boolean cracked = player.getHeldItem().getItem() == ModItems.key_red_cracked; + if((player.getHeldItem().getItem() == ModItems.key_red || cracked) && side != 0 && side != 1) { + if(cracked) player.getHeldItem().stackSize--; + if(world.isRemote) return true; + ForgeDirection dir = ForgeDirection.getOrientation(side); + generateRoom(world, x - dir.offsetX * 4, y - 2, z - dir.offsetZ * 4, dir); + int b = 0; + if(side == 2) b = 1; + if(side == 5) b = 2; + if(side == 3) b = 3; + if(side == 4) b = 0; + ItemModDoor.placeDoorBlock(world, x, y - 1, z, b, ModBlocks.door_red); + world.playSoundAtEntity(player, "hbm:block.lockOpen", 1.0F, 1.0F); + player.triggerAchievement(MainRegistry.achRedRoom); + return true; + } + } + + return false; + } + + protected static void generateRoom(World world, int x, int y, int z, ForgeDirection dir) { + + int size = 9; + int height = 5; + int width = size / 2; + + //Outer Edges, top and bottom + for(int i = -width; i <= width; i++) { + world.setBlock(x + i, y, z + width, ModBlocks.brick_red, 6, 3); + world.setBlock(x + i, y, z - width, ModBlocks.brick_red, 6, 3); + world.setBlock(x + width, y, z + i, ModBlocks.brick_red, 6, 3); + world.setBlock(x - width, y, z + i, ModBlocks.brick_red, 6, 3); + world.setBlock(x + i, y + height - 1, z + width, ModBlocks.brick_red, 6, 3); + world.setBlock(x + i, y + height - 1, z - width, ModBlocks.brick_red, 6, 3); + world.setBlock(x + width, y + height - 1, z + i, ModBlocks.brick_red, 6, 3); + world.setBlock(x - width, y + height - 1, z + i, ModBlocks.brick_red, 6, 3); + } + + for(int i = 1; i <= height - 2; i++) { + //Outer edges, sides + world.setBlock(x + width, y + i, z + width, ModBlocks.brick_red, 6, 3); + world.setBlock(x + width, y + i, z - width, ModBlocks.brick_red, 6, 3); + world.setBlock(x - width, y + i, z + width, ModBlocks.brick_red, 6, 3); + world.setBlock(x - width, y + i, z - width, ModBlocks.brick_red, 6, 3); + + //Walls + for(int j = -width + 1; j <= width - 1; j++) { + if(dir != Library.POS_X) world.setBlock(x + width, y + i, z + j, ModBlocks.brick_red, 6, 3); + if(dir != Library.NEG_X) world.setBlock(x - width, y + i, z + j, ModBlocks.brick_red, 6, 3); + if(dir != Library.POS_Z) world.setBlock(x + j, y + i, z + width, ModBlocks.brick_red, 6, 3); + if(dir != Library.NEG_Z) world.setBlock(x + j, y + i, z - width, ModBlocks.brick_red, 6, 3); + } + } + + for(int i = -width + 1; i <= width - 1; i++) { + for(int j = -width + 1; j <= width - 1; j++) { + //Floor and ceiling + world.setBlock(x + i, y, z + j, ModBlocks.brick_red, 6, 3); + world.setBlock(x + i, y + height - 1, z + j, ModBlocks.brick_red, 6, 3); + + for(int k = 1; k <= height - 2; k++) { + world.setBlock(x + i, y + k, z + j, Blocks.air); + } + } + } + + spawnPedestalItem(world, x, y + 1, z, ItemPool.getPool(ItemPoolsRedRoom.POOL_BLACK_SLAB)); + if(world.rand.nextBoolean()) spawnPedestalItem(world, x + 2, y + 1, z, ItemPool.getPool(ItemPoolsRedRoom.POOL_BLACK_PART)); + if(world.rand.nextBoolean()) spawnPedestalItem(world, x - 2, y + 1, z, ItemPool.getPool(ItemPoolsRedRoom.POOL_BLACK_PART)); + if(world.rand.nextBoolean()) spawnPedestalItem(world, x, y + 1, z + 2, ItemPool.getPool(ItemPoolsRedRoom.POOL_BLACK_PART)); + if(world.rand.nextBoolean()) spawnPedestalItem(world, x, y + 1, z - 2, ItemPool.getPool(ItemPoolsRedRoom.POOL_BLACK_PART)); + + //Clear dropped items + List items = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x + 0.5, y, z + 0.5, x + 0.5, y + height, z + 0.5).expand(size / 2D, 0, size / 2D)); + for(EntityItem item : items) item.setDead(); + } + + public static void spawnPedestalItem(World world, int x, int y, int z, WeightedRandomChestContent[] pool) { + world.setBlock(x, y, z, ModBlocks.pedestal); + TileEntityPedestal pedestal = (TileEntityPedestal) world.getTileEntity(x, y, z); + pedestal.item = ItemPool.getStack(pool, world.rand).copy(); + } +} diff --git a/src/main/java/com/hbm/blocks/generic/DecoBlock.java b/src/main/java/com/hbm/blocks/generic/DecoBlock.java index c8c393c4e..9037b4f6a 100644 --- a/src/main/java/com/hbm/blocks/generic/DecoBlock.java +++ b/src/main/java/com/hbm/blocks/generic/DecoBlock.java @@ -9,6 +9,8 @@ import com.hbm.tileentity.deco.TileEntityDecoBlock; import api.hbm.block.IToolable; import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -52,6 +54,8 @@ public class DecoBlock extends BlockContainer implements IToolable { return true; } + @Override @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) { return true; } + @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { if(this == ModBlocks.steel_scaffold || this == ModBlocks.steel_beam || this == ModBlocks.steel_wall || this == ModBlocks.steel_corner) return null; diff --git a/src/main/java/com/hbm/crafting/WeaponRecipes.java b/src/main/java/com/hbm/crafting/WeaponRecipes.java index 1496381ee..0bad1c9af 100644 --- a/src/main/java/com/hbm/crafting/WeaponRecipes.java +++ b/src/main/java/com/hbm/crafting/WeaponRecipes.java @@ -41,6 +41,7 @@ public class WeaponRecipes { CraftingManager.addRecipeAuto(new ItemStack(ModItems.part_stock, 1, Mats.MAT_PVC.id), new Object[] { "WWW", " W", 'W', PVC.ingot() }); CraftingManager.addRecipeAuto(new ItemStack(ModItems.part_grip, 1, Mats.MAT_PVC.id), new Object[] { "W ", " W", " W", 'W', PVC.ingot() }); CraftingManager.addRecipeAuto(new ItemStack(ModItems.part_grip, 1, Mats.MAT_RUBBER.id), new Object[] { "W ", " W", " W", 'W', RUBBER.ingot() }); + CraftingManager.addRecipeAuto(new ItemStack(ModItems.part_grip, 1, Mats.MAT_IVORY.id), new Object[] { "W ", " W", " W", 'W', Items.bone }); CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.casing, EnumCasingType.SHOTSHELL, 2), new Object[] { "P", "C", 'P', GUNMETAL.plate(), 'C', DictFrame.fromOne(ModItems.casing, EnumCasingType.LARGE) }); CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.casing, EnumCasingType.BUCKSHOT, 2), new Object[] { "P", "C", 'P', ANY_PLASTIC.ingot(), 'C', DictFrame.fromOne(ModItems.casing, EnumCasingType.LARGE) }); @@ -86,6 +87,17 @@ public class WeaponRecipes { CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.STONE_AP, 6), new Object[] { "C", "P", "G", 'C', Items.flint, 'P', Items.paper, 'G', Items.gunpowder }); CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.STONE_SHOT, 6), new Object[] { "C", "P", "G", 'C', Blocks.gravel, 'P', Items.paper, 'G', Items.gunpowder }); CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.STONE_IRON, 6), new Object[] { "C", "P", "G", 'C', IRON.ingot(), 'P', Items.paper, 'G', Items.gunpowder }); + + //Nitra! + CraftingManager.addShapelessAuto(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.M357_SP, 6), new Object[] { DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.M357_SP), ModItems.nitra }); + CraftingManager.addShapelessAuto(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.M44_SP, 6), new Object[] { DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.M44_SP), ModItems.nitra }); + CraftingManager.addShapelessAuto(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.P9_SP, 12), new Object[] { DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.P9_SP), ModItems.nitra }); + CraftingManager.addShapelessAuto(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.P22_SP, 32), new Object[] { DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.P22_SP), ModItems.nitra }); + CraftingManager.addShapelessAuto(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.R556_SP, 8), new Object[] { DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.R556_SP), ModItems.nitra }); + CraftingManager.addShapelessAuto(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.R762_SP, 6), new Object[] { DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.R762_SP), ModItems.nitra }); + CraftingManager.addShapelessAuto(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.BMG50_SP, 4), new Object[] { DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.BMG50_SP), ModItems.nitra }); + CraftingManager.addShapelessAuto(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G40_HE, 2), new Object[] { DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G40_HE), ModItems.nitra }); + CraftingManager.addShapelessAuto(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_HE, 1), new Object[] { DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_HE), ModItems.nitra }); //Missiles CraftingManager.addShapelessAuto(new ItemStack(ModItems.missile_taint, 1), new Object[] { ModItems.missile_assembly, ModItems.bucket_mud, ModItems.powder_spark_mix, ModItems.powder_magic }); diff --git a/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphid.java b/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphid.java index bec1e5c4e..48e6eab5e 100644 --- a/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphid.java +++ b/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphid.java @@ -3,21 +3,26 @@ package com.hbm.entity.mob.glyphid; import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.Locale; import com.hbm.blocks.ModBlocks; import com.hbm.config.MobConfig; import com.hbm.entity.logic.EntityWaypoint; import com.hbm.entity.mob.EntityParasiteMaggot; +import com.hbm.entity.mob.glyphid.GlyphidStats.StatBundle; import com.hbm.entity.pathfinder.PathFinderUtils; import com.hbm.explosion.vanillant.ExplosionVNT; import com.hbm.explosion.vanillant.standard.*; import com.hbm.handler.pollution.PollutionHandler; import com.hbm.handler.pollution.PollutionHandler.PollutionType; import com.hbm.items.ModItems; +import com.hbm.lib.ModDamageSource; import com.hbm.main.ResourceManager; import com.hbm.packet.PacketDispatcher; import com.hbm.packet.toclient.AuxParticlePacketNT; +import com.hbm.util.DamageResistanceHandler.DamageClass; +import api.hbm.entity.IResistanceProvider; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import net.minecraft.block.Block; import net.minecraft.entity.Entity; @@ -40,7 +45,7 @@ import net.minecraft.world.World; import javax.annotation.Nullable; -public class EntityGlyphid extends EntityMob { +public class EntityGlyphid extends EntityMob implements IResistanceProvider { //I might have overdone it a little bit @@ -123,12 +128,25 @@ public class EntityGlyphid extends EntityMob { this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getGrunt().damage * (variant == TYPE_RADIOACTIVE ? 5D : 1D)); } - public float getDivisorPerArmorPoint() { - return GlyphidStats.getStats().getGrunt().divisor; + public StatBundle getStats() { + return GlyphidStats.getStats().statsGrunt; } - public float getDamageThreshold() { - return GlyphidStats.getStats().getGrunt().damageThreshold; + @Override + public float[] getCurrentDTDR(DamageSource damage, float amount, float pierceDT, float pierce) { + if(damage.isDamageAbsolute() || damage.isUnblockable()) return new float[] {0F, 0F}; + StatBundle stats = this.getStats(); + float threshold = stats.thresholdMultForArmor * getGlyphidArmor() / 5F; + + if(damage == ModDamageSource.nuclearBlast) return new float[] {threshold * 0.25F, 0F}; // nukes shred shrough glyphids + if(damage.damageType.equals(DamageClass.LASER.name().toLowerCase(Locale.US))) return new float[] {threshold * 0.5F, stats.resistanceMult * 0.5F}; //lasers are quite powerful too + if(damage.damageType.equals(DamageClass.ELECTRIC.name().toLowerCase(Locale.US))) return new float[] {threshold * 0.25F, stats.resistanceMult * 0.25F}; //electricity even more so + if(damage.damageType.equals(DamageClass.SUBATOMIC.name().toLowerCase(Locale.US))) return new float[] {0F, stats.resistanceMult * 0.1F}; //and particles are almsot commpletely unaffected + + if(damage.isFireDamage()) return new float[] {0F, stats.resistanceMult * 0.2F}; //fire ignores DT and most DR + if(damage.isExplosion()) return new float[] {threshold * 0.5F, stats.resistanceMult * 0.35F}; //explosions are still subject to DT and reduce DR by a fair amount + + return new float[] {threshold, stats.resistanceMult}; } @Override @@ -295,47 +313,43 @@ public class EntityGlyphid extends EntityMob { protected boolean canDespawn() { return entityToAttack == null && getCurrentTask() == TASK_IDLE && this.ticksExisted > 100; } + + @Override + public void onDeath(DamageSource source) { + + if(doesInfectedSpawnMaggots() && this.dataWatcher.getWatchableObjectByte(DW_SUBTYPE) == TYPE_INFECTED) { + + int j = 2 + this.rand.nextInt(3); + + for(int k = 0; k < j; ++k) { + float f = ((float) (k % 2) - 0.5F) * 0.5F; + float f1 = ((float) (k / 2) - 0.5F) * 0.5F; + EntityParasiteMaggot maggot = new EntityParasiteMaggot(worldObj); + maggot.setLocationAndAngles(this.posX + (double) f, this.posY + 0.5D, this.posZ + (double) f1, this.rand.nextFloat() * 360.0F, 0.0F); + maggot.motionX = f; + maggot.motionZ = f1; + maggot.velocityChanged = true; + this.worldObj.spawnEntityInWorld(maggot); + } + + worldObj.playSoundEffect(posX, posY, posZ, "mob.zombie.woodbreak", 2.0F, 0.95F + worldObj.rand.nextFloat() * 0.2F); + + NBTTagCompound vdat = new NBTTagCompound(); + vdat.setString("type", "giblets"); + vdat.setInteger("ent", this.getEntityId()); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(vdat, posX, posY + height * 0.5, posZ), new TargetPoint(dimension, posX, posY + height * 0.5, posZ, 150)); + + } + } @Override public boolean attackEntityFrom(DamageSource source, float amount) { - - if(source.getEntity() instanceof EntityGlyphid) { - return false; - } - - boolean alive = this.getHealth() > 0; + if(source.getEntity() instanceof EntityGlyphid) return false; boolean wasAttacked = GlyphidStats.getStats().handleAttack(this, source, amount); - - if(alive && this.getHealth() <= 0) { - if(doesInfectedSpawnMaggots() && this.dataWatcher.getWatchableObjectByte(DW_SUBTYPE) == TYPE_INFECTED) { - - int j = 2 + this.rand.nextInt(3); - - for(int k = 0; k < j; ++k) { - float f = ((float) (k % 2) - 0.5F) * 0.5F; - float f1 = ((float) (k / 2) - 0.5F) * 0.5F; - EntityParasiteMaggot maggot = new EntityParasiteMaggot(worldObj); - maggot.setLocationAndAngles(this.posX + (double) f, this.posY + 0.5D, this.posZ + (double) f1, this.rand.nextFloat() * 360.0F, 0.0F); - maggot.motionX = f; - maggot.motionZ = f1; - maggot.velocityChanged = true; - this.worldObj.spawnEntityInWorld(maggot); - } - - worldObj.playSoundEffect(posX, posY, posZ, "mob.zombie.woodbreak", 2.0F, 0.95F + worldObj.rand.nextFloat() * 0.2F); - - NBTTagCompound vdat = new NBTTagCompound(); - vdat.setString("type", "giblets"); - vdat.setInteger("ent", this.getEntityId()); - PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(vdat, posX, posY + height * 0.5, posZ), new TargetPoint(dimension, posX, posY + height * 0.5, posZ, 150)); - - } - } - return wasAttacked; } - /** Provides a direct entrypoint from outside to access the superclass' implementation because otherwise we end up wwith infinite recursion */ + /** Provides a direct entrypoint from outside to access the superclass' implementation because otherwise we end up with infinite recursion */ public boolean attackSuperclass(DamageSource source, float amount) { /*NBTTagCompound data = new NBTTagCompound(); @@ -356,22 +370,6 @@ public class EntityGlyphid extends EntityMob { return this.rand.nextInt(100) <= Math.min(Math.pow(amount * 0.6, 2), 100); } - public float calculateDamage(float amount) { - - byte armor = this.dataWatcher.getWatchableObjectByte(DW_ARMOR); - float divisor = 1; - - for(int i = 0; i < 5; i++) { - if((armor & (1 << i)) > 0) { - divisor += getDivisorPerArmorPoint(); - } - } - - amount /= divisor; - - return amount; - } - public void breakOffArmor() { byte armor = this.dataWatcher.getWatchableObjectByte(DW_ARMOR); List indices = Arrays.asList(0, 1, 2, 3, 4); @@ -388,6 +386,16 @@ public class EntityGlyphid extends EntityMob { } } } + + public int getGlyphidArmor() { + int total = 0; + byte armor = this.dataWatcher.getWatchableObjectByte(DW_ARMOR); + List indices = Arrays.asList(0, 1, 2, 3, 4); + for(Integer i : indices) { + total += (armor & (1 << i)) != 0 ? 1 : 0; + } + return total; + } @Override protected void updateArmSwingProgress() { diff --git a/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBehemoth.java b/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBehemoth.java index ed07a28eb..743f2aadf 100644 --- a/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBehemoth.java +++ b/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBehemoth.java @@ -1,6 +1,7 @@ package com.hbm.entity.mob.glyphid; import com.hbm.entity.effect.EntityMist; +import com.hbm.entity.mob.glyphid.GlyphidStats.StatBundle; import com.hbm.entity.projectile.EntityChemical; import com.hbm.inventory.fluid.Fluids; import com.hbm.items.ModItems; @@ -40,9 +41,10 @@ public class EntityGlyphidBehemoth extends EntityGlyphid { this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(GlyphidStats.getStats().getBehemoth().speed); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getBehemoth().damage); } - - @Override public float getDivisorPerArmorPoint() { return GlyphidStats.getStats().getBehemoth().divisor; } - @Override public float getDamageThreshold() { return GlyphidStats.getStats().getBehemoth().damageThreshold; } + + public StatBundle getStats() { + return GlyphidStats.getStats().statsBehemoth; + } public int timer = 120; int breathTime = 0; diff --git a/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBlaster.java b/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBlaster.java index fb0b7c320..37f622f3a 100644 --- a/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBlaster.java +++ b/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBlaster.java @@ -1,5 +1,6 @@ package com.hbm.entity.mob.glyphid; +import com.hbm.entity.mob.glyphid.GlyphidStats.StatBundle; import com.hbm.main.ResourceManager; import net.minecraft.entity.SharedMonsterAttributes; @@ -30,9 +31,10 @@ public class EntityGlyphidBlaster extends EntityGlyphidBombardier { this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(GlyphidStats.getStats().getBlaster().speed); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getBlaster().damage); } - - @Override public float getDivisorPerArmorPoint() { return GlyphidStats.getStats().getBlaster().divisor; } - @Override public float getDamageThreshold() { return GlyphidStats.getStats().getBlaster().damageThreshold; } + + public StatBundle getStats() { + return GlyphidStats.getStats().statsBlaster; + } @Override public boolean isArmorBroken(float amount) { diff --git a/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBombardier.java b/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBombardier.java index 6a2f437cf..7fce71444 100644 --- a/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBombardier.java +++ b/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBombardier.java @@ -1,5 +1,6 @@ package com.hbm.entity.mob.glyphid; +import com.hbm.entity.mob.glyphid.GlyphidStats.StatBundle; import com.hbm.entity.projectile.EntityAcidBomb; import com.hbm.main.ResourceManager; @@ -32,9 +33,10 @@ public class EntityGlyphidBombardier extends EntityGlyphid { this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(GlyphidStats.getStats().getBombardier().speed); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getBombardier().damage); } - - @Override public float getDivisorPerArmorPoint() { return GlyphidStats.getStats().getBombardier().divisor; } - @Override public float getDamageThreshold() { return GlyphidStats.getStats().getBombardier().damageThreshold; } + + public StatBundle getStats() { + return GlyphidStats.getStats().statsBombardier; + } @Override public void onUpdate() { diff --git a/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBrawler.java b/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBrawler.java index 7799040e2..acd51c8e0 100644 --- a/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBrawler.java +++ b/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBrawler.java @@ -1,6 +1,7 @@ package com.hbm.entity.mob.glyphid; +import com.hbm.entity.mob.glyphid.GlyphidStats.StatBundle; import com.hbm.main.ResourceManager; @@ -116,9 +117,11 @@ public class EntityGlyphidBrawler extends EntityGlyphid { this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(GlyphidStats.getStats().getBrawler().speed); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getBrawler().damage); } - - @Override public float getDivisorPerArmorPoint() { return GlyphidStats.getStats().getBrawler().divisor; } - @Override public float getDamageThreshold() { return GlyphidStats.getStats().getBrawler().damageThreshold; } + + public StatBundle getStats() { + return GlyphidStats.getStats().statsBrawler; + } + @Override public boolean attackEntityFrom(DamageSource source, float amount) { diff --git a/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBrenda.java b/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBrenda.java index a4b2f8367..1f9263302 100644 --- a/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBrenda.java +++ b/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidBrenda.java @@ -1,6 +1,7 @@ package com.hbm.entity.mob.glyphid; import com.hbm.entity.effect.EntityMist; +import com.hbm.entity.mob.glyphid.GlyphidStats.StatBundle; import com.hbm.inventory.fluid.Fluids; import com.hbm.items.ModItems; import com.hbm.main.ResourceManager; @@ -36,9 +37,10 @@ public class EntityGlyphidBrenda extends EntityGlyphid { this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(GlyphidStats.getStats().getBrenda().speed); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getBrenda().damage); } - - @Override public float getDivisorPerArmorPoint() { return GlyphidStats.getStats().getBrenda().divisor; } - @Override public float getDamageThreshold() { return GlyphidStats.getStats().getBrenda().damageThreshold; } + + public StatBundle getStats() { + return GlyphidStats.getStats().statsBrenda; + } @Override public boolean isArmorBroken(float amount) { diff --git a/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidDigger.java b/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidDigger.java index 1e044dcca..6e443333d 100644 --- a/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidDigger.java +++ b/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidDigger.java @@ -2,6 +2,7 @@ package com.hbm.entity.mob.glyphid; import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.ModBlocks; +import com.hbm.entity.mob.glyphid.GlyphidStats.StatBundle; import com.hbm.entity.projectile.EntityRubble; import com.hbm.lib.Library; import com.hbm.main.ResourceManager; @@ -43,9 +44,10 @@ public class EntityGlyphidDigger extends EntityGlyphid { this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(GlyphidStats.getStats().getDigger().speed); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getDigger().damage); } - - @Override public float getDivisorPerArmorPoint() { return GlyphidStats.getStats().getDigger().divisor; } - @Override public float getDamageThreshold() { return GlyphidStats.getStats().getDigger().damageThreshold; } + + public StatBundle getStats() { + return GlyphidStats.getStats().statsDigger; + } public int timer = 0; diff --git a/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidNuclear.java b/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidNuclear.java index daad80877..8b2128de0 100644 --- a/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidNuclear.java +++ b/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidNuclear.java @@ -3,6 +3,7 @@ package com.hbm.entity.mob.glyphid; import com.hbm.blocks.ModBlocks; import com.hbm.entity.logic.EntityWaypoint; import com.hbm.entity.mob.EntityParasiteMaggot; +import com.hbm.entity.mob.glyphid.GlyphidStats.StatBundle; import com.hbm.explosion.vanillant.ExplosionVNT; import com.hbm.explosion.vanillant.standard.BlockAllocatorStandard; import com.hbm.explosion.vanillant.standard.BlockMutatorDebris; @@ -53,9 +54,10 @@ public class EntityGlyphidNuclear extends EntityGlyphid { this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(GlyphidStats.getStats().getNuclear().speed); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getNuclear().damage); } - - @Override public float getDivisorPerArmorPoint() { return GlyphidStats.getStats().getNuclear().divisor; } - @Override public float getDamageThreshold() { return GlyphidStats.getStats().getNuclear().damageThreshold; } + + public StatBundle getStats() { + return GlyphidStats.getStats().statsNuclear; + } @Override public void onUpdate() { diff --git a/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidScout.java b/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidScout.java index ece0ee982..dbe0c8884 100644 --- a/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidScout.java +++ b/src/main/java/com/hbm/entity/mob/glyphid/EntityGlyphidScout.java @@ -3,6 +3,7 @@ package com.hbm.entity.mob.glyphid; import com.hbm.blocks.ModBlocks; import com.hbm.config.MobConfig; import com.hbm.entity.logic.EntityWaypoint; +import com.hbm.entity.mob.glyphid.GlyphidStats.StatBundle; import com.hbm.handler.pollution.PollutionHandler; import com.hbm.main.ResourceManager; import com.hbm.world.feature.GlyphidHive; @@ -61,9 +62,10 @@ public class EntityGlyphidScout extends EntityGlyphid { this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(GlyphidStats.getStats().getScout().speed); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getScout().damage); } - - @Override public float getDivisorPerArmorPoint() { return GlyphidStats.getStats().getScout().divisor; } - @Override public float getDamageThreshold() { return GlyphidStats.getStats().getScout().damageThreshold; } + + public StatBundle getStats() { + return GlyphidStats.getStats().statsScout; + } @Override public boolean isArmorBroken(float amount) { diff --git a/src/main/java/com/hbm/entity/mob/glyphid/GlyphidStats.java b/src/main/java/com/hbm/entity/mob/glyphid/GlyphidStats.java index b8dd780bb..9332cb602 100644 --- a/src/main/java/com/hbm/entity/mob/glyphid/GlyphidStats.java +++ b/src/main/java/com/hbm/entity/mob/glyphid/GlyphidStats.java @@ -28,15 +28,24 @@ public abstract class GlyphidStats { public final double health; public final double speed; public final double damage; - public final float divisor; - public final float damageThreshold; + @Deprecated public final float divisor; + @Deprecated public final float damageThreshold; + /** Base threshold is calculated using this number * the glyphid's armor */ + public final float thresholdMultForArmor; + public final float resistanceMult; public StatBundle(double health, double speed, double damage, float divisor, float damageThreshold) { + this(health, speed, damage, divisor, damageThreshold, 0F, 0F); + } + + public StatBundle(double health, double speed, double damage, float divisor, float damageThreshold, float thresholdMultPerArmor, float resistanceMult) { this.health = health; this.speed = speed; this.damage = damage; this.divisor = divisor; this.damageThreshold = damageThreshold; + this.thresholdMultForArmor = thresholdMultPerArmor; + this.resistanceMult = resistanceMult; } } @@ -74,7 +83,7 @@ public abstract class GlyphidStats { if(armor != 0) { //if at least one bit of armor is present - if(amount < glyphid.getDamageThreshold()) return false; + if(amount < glyphid.getStats().damageThreshold) return false; //chances of armor being broken off if(amount > 1 && glyphid.isArmorBroken(amount)) { @@ -82,11 +91,11 @@ public abstract class GlyphidStats { amount *= 0.25F; } - amount -= glyphid.getDamageThreshold(); + amount -= glyphid.getStats().damageThreshold; if(amount < 0) return true; } - amount = glyphid.calculateDamage(amount); + //amount = glyphid.calculateDamage(amount); } if(source.isFireDamage()) { @@ -111,65 +120,22 @@ public abstract class GlyphidStats { public static class GlyphidStatsNT extends GlyphidStats { public GlyphidStatsNT() { - this.statsGrunt = new StatBundle(20D, 1D, 2D, 0.25F, 0F); - this.statsBombardier = new StatBundle(15D, 1D, 2D, 0.25F, 0F); - this.statsBrawler = new StatBundle(35D, 1D, 10D, 0.5F, 0.5F); - this.statsDigger = new StatBundle(50D, 1D, 10D, 0.5F, 0.5F); - this.statsBlaster = new StatBundle(35D, 1D, 10D, 0.5F, 0.5F); - this.statsBehemoth = new StatBundle(125D, 0.8D, 25D, 1.5F, 2F); - this.statsBrenda = new StatBundle(250D, 1.2D, 50D, 2.5F, 5F); - this.statsNuclear = new StatBundle(100D, 0.8D, 50D, 2.5F, 5F); - this.statsScout = new StatBundle(20D, 1.5D, 5D, 0.5F, 0F); + this.statsGrunt = new StatBundle(20D, 1D, 2D, 0.25F, 0F, 1F, 0.1F); + this.statsBombardier = new StatBundle(15D, 1D, 2D, 0.25F, 0F, 1F, 0.1F); + this.statsBrawler = new StatBundle(35D, 1D, 10D, 0.5F, 0.5F, 2F, 0.15F); + this.statsDigger = new StatBundle(50D, 1D, 10D, 0.5F, 0.5F, 3F, 0.20F); + this.statsBlaster = new StatBundle(35D, 1D, 10D, 0.5F, 0.5F, 2F, 0.15F); + this.statsBehemoth = new StatBundle(125D, 0.8D, 25D, 1.5F, 2F, 5F, 0.35F); + this.statsBrenda = new StatBundle(250D, 1.2D, 50D, 2.5F, 5F, 10F, 0.5F); + this.statsNuclear = new StatBundle(100D, 0.8D, 50D, 2.5F, 5F, 10F, 0.5F); + this.statsScout = new StatBundle(20D, 1.5D, 5D, 0.5F, 0F, 0.5F, 0.5F); } @Override public boolean handleAttack(EntityGlyphid glyphid, DamageSource source, float amount) { - // Completely immune to acid from other glyphids if((source == ModDamageSource.acid || ModDamageSource.s_acid.equals(source.getDamageType())) && source.getSourceOfDamage() instanceof EntityGlyphid) return false; - - // If damage is armor piercing or nuclear damage, don't apply any armor calculation - if(isNuclearDamage(source) || source.isDamageAbsolute() || source.isUnblockable()) { - if(source == DamageSource.inWall) amount *= 15F; - return glyphid.attackSuperclass(source, amount); - // This ensures that nukes will remain hyper-effective - } - - // If damage is fire damage, reduce damage above 5 then ignore armor - if(source.isFireDamage()) { - if(glyphid.getDataWatcher().getWatchableObjectByte(glyphid.DW_SUBTYPE) == glyphid.TYPE_RADIOACTIVE) return false; - float dmg = Math.min(amount, 5F); - if(amount > 5) dmg += (amount - 5F) * 0.1F; - return glyphid.attackSuperclass(source, dmg); - // This ensures that afterburn and flamethrowers remain effective wihin reason - } - - // If damage is explosive, reduce by 25% then ignore armor - if(source.isExplosion()) { - amount *= 0.5F; - return glyphid.attackSuperclass(source, amount); - // This ensures that explosions remain mostly effective - } - - byte armor = glyphid.getDataWatcher().getWatchableObjectByte(glyphid.DW_ARMOR); - amount -= glyphid.getDamageThreshold(); - if(amount < 0) return armor == 0; // if armor is present, knockback from 0 damage attacks is negated - - if(armor != 0) { - if(glyphid.isArmorBroken(amount)) { - glyphid.breakOffArmor(); - amount *= 0.5F; - } - - amount = glyphid.calculateDamage((float) Math.min(amount, Math.sqrt(amount) * 50D / 7D)); - // This ensures that higher numbers have a diminishing effect - } - return glyphid.attackSuperclass(source, amount); } - - public boolean isNuclearDamage(DamageSource source) { - return source == ModDamageSource.nuclearBlast || source == ModDamageSource.radiation; - } } } diff --git a/src/main/java/com/hbm/itempool/ItemPoolsRedRoom.java b/src/main/java/com/hbm/itempool/ItemPoolsRedRoom.java index 7dae73826..690f2580e 100644 --- a/src/main/java/com/hbm/itempool/ItemPoolsRedRoom.java +++ b/src/main/java/com/hbm/itempool/ItemPoolsRedRoom.java @@ -3,6 +3,7 @@ package com.hbm.itempool; import static com.hbm.lib.HbmChestContents.weighted; import com.hbm.blocks.ModBlocks; +import com.hbm.items.ItemEnums.EnumSecretType; import com.hbm.items.ModItems; import net.minecraft.util.WeightedRandomChestContent; @@ -10,7 +11,8 @@ import net.minecraft.util.WeightedRandomChestContent; public class ItemPoolsRedRoom { public static final String POOL_RED_PEDESTAL = "POOL_RED_PEDESTAL"; - public static final String POOL_RED_WEAPON = "POOL_RED_WEAPON"; + public static final String POOL_BLACK_SLAB = "POOL_BLACK_SLAB"; + public static final String POOL_BLACK_PART = "POOL_BLACK_PART"; public static void init() { @@ -41,16 +43,18 @@ public class ItemPoolsRedRoom { }}; //pedestal weapons - new ItemPool(POOL_RED_WEAPON) {{ + new ItemPool(POOL_BLACK_SLAB) {{ this.pool = new WeightedRandomChestContent[] { - weighted(ModItems.gun_light_revolver_dani, 0, 1, 1, 10), - weighted(ModItems.gun_maresleg_broken, 0, 1, 1, 10), - weighted(ModItems.gun_heavy_revolver_lilmac, 0, 1, 1, 10), - weighted(ModItems.gun_flamer_daybreaker, 0, 1, 1, 5), - weighted(ModItems.gun_autoshotgun_sexy, 0, 1, 1, 5), - weighted(ModItems.gun_minigun_lacunae, 0, 1, 1, 5), - weighted(ModItems.gun_hangman, 0, 1, 1, 5), - weighted(ModItems.gun_folly, 0, 1, 1, 1), + weighted(ModItems.clay_tablet, 0, 1, 1, 10) + }; + }}; + + //pedestal weapons + new ItemPool(POOL_BLACK_PART) {{ + this.pool = new WeightedRandomChestContent[] { + weighted(ModItems.item_secret, EnumSecretType.SELENIUM_STEEL.ordinal(), 4, 4, 10), + weighted(ModItems.item_secret, EnumSecretType.CONTROLLER.ordinal(), 1, 1, 10), + weighted(ModItems.item_secret, EnumSecretType.CANISTER.ordinal(), 1, 1, 10), }; }}; } diff --git a/src/main/java/com/hbm/items/weapon/sedna/BulletConfig.java b/src/main/java/com/hbm/items/weapon/sedna/BulletConfig.java index 2f5325075..5336620ed 100644 --- a/src/main/java/com/hbm/items/weapon/sedna/BulletConfig.java +++ b/src/main/java/com/hbm/items/weapon/sedna/BulletConfig.java @@ -5,6 +5,7 @@ import java.util.List; import java.util.function.BiConsumer; import java.util.function.Consumer; +import com.hbm.blocks.bomb.BlockDetonatable; import com.hbm.entity.projectile.EntityBulletBaseMK4; import com.hbm.entity.projectile.EntityBulletBeamBase; import com.hbm.interfaces.NotableComments; @@ -17,6 +18,9 @@ import com.hbm.particle.SpentCasing; import com.hbm.util.BobMathUtil; import com.hbm.util.EntityDamageUtil; import com.hbm.util.TrackerUtil; + +import api.hbm.block.IFuckingExplode; + import com.hbm.util.DamageResistanceHandler.DamageClass; import net.minecraft.block.Block; @@ -169,6 +173,9 @@ public class BulletConfig implements Cloneable { bullet.setPosition(mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord); return; } + if(b instanceof BlockDetonatable) { + ((BlockDetonatable) b).onShot(bullet.worldObj, mop.blockX, mop.blockY, mop.blockZ); + } ForgeDirection dir = ForgeDirection.getOrientation(mop.sideHit); Vec3 face = Vec3.createVectorHelper(dir.offsetX, dir.offsetY, dir.offsetZ); diff --git a/src/main/java/com/hbm/items/weapon/sedna/factory/Orchestras.java b/src/main/java/com/hbm/items/weapon/sedna/factory/Orchestras.java index 6768da3e8..30bf580f7 100644 --- a/src/main/java/com/hbm/items/weapon/sedna/factory/Orchestras.java +++ b/src/main/java/com/hbm/items/weapon/sedna/factory/Orchestras.java @@ -837,6 +837,10 @@ public class Orchestras { int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex); boolean aiming = ItemGunBaseNT.getIsAiming(stack); + if(type == AnimType.EQUIP) { + if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:turret.howard_reload", 1F, 1F); + } + if(type == AnimType.CYCLE) { if(timer == 0) { SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory); diff --git a/src/main/java/com/hbm/items/weapon/sedna/factory/XFactory50.java b/src/main/java/com/hbm/items/weapon/sedna/factory/XFactory50.java index 5552e958a..60d12e163 100644 --- a/src/main/java/com/hbm/items/weapon/sedna/factory/XFactory50.java +++ b/src/main/java/com/hbm/items/weapon/sedna/factory/XFactory50.java @@ -46,7 +46,7 @@ public class XFactory50 { ModItems.gun_m2 = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig() .dura(3_000).draw(10).inspect(31).crosshair(Crosshair.L_CIRCLE).smoke(LAMBDA_SMOKE) .rec(new Receiver(0) - .dmg(7.5F).delay(2).dry(10).auto(true).spread(0.005F).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F) + .dmg(7.5F).delay(2).dry(10).auto(true).spread(0.005F).sound("hbm:turret.chekhov_fire", 1.0F, 1.0F) .mag(new MagazineBelt().addConfigs(bmg50_sp, bmg50_fmj, bmg50_jhp, bmg50_ap, bmg50_du)) .offset(1, -0.0625 * 2.5, -0.25D) .setupStandardFire().recoil(LAMBDA_RECOIL_M2)) diff --git a/src/main/java/com/hbm/items/weapon/sedna/factory/XFactory762mm.java b/src/main/java/com/hbm/items/weapon/sedna/factory/XFactory762mm.java index f72d23aa4..95ae89433 100644 --- a/src/main/java/com/hbm/items/weapon/sedna/factory/XFactory762mm.java +++ b/src/main/java/com/hbm/items/weapon/sedna/factory/XFactory762mm.java @@ -68,7 +68,7 @@ public class XFactory762mm { ModItems.gun_minigun = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig() .dura(50_000).draw(20).inspect(20).crosshair(Crosshair.L_CIRCLE).smoke(LAMBDA_SMOKE) .rec(new Receiver(0) - .dmg(6F).delay(1).auto(true).dry(15).spread(0.01F).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F) + .dmg(6F).delay(1).auto(true).dry(15).spread(0.01F).sound("hbm:weapon.calShoot", 1.0F, 1.0F) .mag(new MagazineBelt().addConfigs(r762_sp, r762_fmj, r762_jhp, r762_ap, r762_du)) .offset(1, -0.0625 * 2.5, -0.25D) .setupStandardFire().recoil(LAMBDA_RECOIL_MINIGUN)) diff --git a/src/main/java/com/hbm/main/ModEventHandler.java b/src/main/java/com/hbm/main/ModEventHandler.java index 699707de6..7c9f208b1 100644 --- a/src/main/java/com/hbm/main/ModEventHandler.java +++ b/src/main/java/com/hbm/main/ModEventHandler.java @@ -26,7 +26,7 @@ import com.hbm.entity.mob.EntityCreeperNuclear; import com.hbm.entity.mob.EntityQuackos; import com.hbm.entity.mob.ai.EntityAIFireGun; import com.hbm.entity.mob.EntityCreeperTainted; -import com.hbm.entity.projectile.EntityBulletBaseNT; +import com.hbm.entity.projectile.EntityBulletBaseMK4; import com.hbm.entity.projectile.EntityBurningFOEQ; import com.hbm.entity.train.EntityRailCarBase; import com.hbm.extprop.HbmLivingProps; @@ -34,8 +34,6 @@ import com.hbm.extprop.HbmPlayerProps; import com.hbm.handler.ArmorModHandler; import com.hbm.handler.BobmazonOfferFactory; import com.hbm.handler.BossSpawnHandler; -import com.hbm.handler.BulletConfigSyncingUtil; -import com.hbm.handler.BulletConfiguration; import com.hbm.handler.EntityEffectHandler; import com.hbm.hazard.HazardSystem; import com.hbm.interfaces.IBomb; @@ -54,13 +52,15 @@ import com.hbm.items.armor.ItemModShackles; import com.hbm.items.food.ItemConserve.EnumFoodType; import com.hbm.items.tool.ItemGuideBook.BookType; import com.hbm.items.weapon.ItemGunBase; +import com.hbm.items.weapon.sedna.BulletConfig; import com.hbm.items.weapon.sedna.ItemGunBaseNT; -import com.hbm.lib.HbmCollection; +import com.hbm.items.weapon.sedna.factory.XFactory12ga; import com.hbm.lib.ModDamageSource; import com.hbm.lib.RefStrings; import com.hbm.packet.PacketDispatcher; import com.hbm.packet.toclient.PermaSyncPacket; import com.hbm.packet.toclient.PlayerInformPacket; +import com.hbm.particle.helper.BlackPowderCreator; import com.hbm.potion.HbmPotion; import com.hbm.saveddata.AuxSavedData; import com.hbm.tileentity.machine.TileEntityMachineRadarNT; @@ -840,44 +840,48 @@ public class ModEventHandler { ((ArmorFSB)e.inventory.armorInventory[2].getItem()).handleFall(e); } + // only for the ballistic gauntlet! contains dangerous conditional returns! @SubscribeEvent public void onPlayerPunch(AttackEntityEvent event) { EntityPlayer player = event.entityPlayer; ItemStack chestplate = player.inventory.armorInventory[2]; - if(!player.worldObj.isRemote && player.getHeldItem() == null && chestplate != null && ArmorModHandler.hasMods(chestplate)) { + if(!player.worldObj.isRemote && chestplate != null && ArmorModHandler.hasMods(chestplate)) { + + if(player.getHeldItem() != null && player.getHeldItem().getAttributeModifiers().containsKey(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName())) return; + ItemStack[] mods = ArmorModHandler.pryMods(chestplate); ItemStack servo = mods[ArmorModHandler.servos]; if(servo != null && servo.getItem() == ModItems.ballistic_gauntlet) { - //TODO: fix this shit - /*BulletConfig firedConfig = null; + BulletConfig firedConfig = null; + BulletConfig[] gauntletConfigs = new BulletConfig[] {XFactory12ga.g12_bp, XFactory12ga.g12_bp_magnum, XFactory12ga.g12_bp_slug, XFactory12ga.g12, XFactory12ga.g12_slug, XFactory12ga.g12_flechette, XFactory12ga.g12_magnum, XFactory12ga.g12_explosive, XFactory12ga.g12_phosphorus}; - for(Integer config : HbmCollection.g12) { - BulletConfiguration cfg = BulletConfigSyncingUtil.pullConfig(config); + for(BulletConfig config : gauntletConfigs) { - if(InventoryUtil.doesPlayerHaveAStack(player, cfg.ammo, true, true)) { - firedConfig = cfg; + if(InventoryUtil.doesPlayerHaveAStack(player, config.ammo, true, true)) { + firedConfig = config; break; } } if(firedConfig != null) { - int bullets = firedConfig.bulletsMin; + int bullets = firedConfig.projectilesMin; - if(firedConfig.bulletsMax > firedConfig.bulletsMin) { - bullets += player.getRNG().nextInt(firedConfig.bulletsMax - firedConfig.bulletsMin); + if(firedConfig.projectilesMax > firedConfig.projectilesMin) { + bullets += player.getRNG().nextInt(firedConfig.projectilesMax - firedConfig.projectilesMin); } for(int i = 0; i < bullets; i++) { - EntityBulletBaseNT bullet = new EntityBulletBaseNT(player.worldObj, BulletConfigSyncingUtil.getKey(firedConfig), player); - player.worldObj.spawnEntityInWorld(bullet); + EntityBulletBaseMK4 mk4 = new EntityBulletBaseMK4(player, firedConfig, 15F, 0F, -0.1875, -0.0625, 0.5); + player.worldObj.spawnEntityInWorld(mk4); + if(i == 0 && firedConfig.blackPowder) BlackPowderCreator.composeEffect(player.worldObj, mk4.posX, mk4.posY, mk4.posZ, mk4.motionX, mk4.motionY, mk4.motionZ, 10, 0.25F, 0.5F, 10, 0.25F); } player.worldObj.playSoundAtEntity(player, "hbm:weapon.shotgunShoot", 1.0F, 1.0F); - }*/ + } } } } diff --git a/src/main/java/com/hbm/main/NEIConfig.java b/src/main/java/com/hbm/main/NEIConfig.java index 752a4392a..f479e4fb0 100644 --- a/src/main/java/com/hbm/main/NEIConfig.java +++ b/src/main/java/com/hbm/main/NEIConfig.java @@ -7,9 +7,11 @@ import com.hbm.blocks.ModBlocks; import com.hbm.blocks.generic.BlockPlushie.TileEntityPlushie; import com.hbm.config.CustomMachineConfigJSON; import com.hbm.handler.nei.CustomMachineHandler; +import com.hbm.items.ItemEnums.EnumSecretType; import com.hbm.items.ModItems; import com.hbm.items.machine.ItemBattery; import com.hbm.items.weapon.sedna.ItemGunBaseNT; +import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmoSecret; import com.hbm.lib.RefStrings; import codechicken.nei.api.API; @@ -38,13 +40,14 @@ public class NEIConfig implements IConfigureNEI { for(Item item : ItemGunBaseNT.secrets) { API.hideItem(new ItemStack(item)); } - API.hideItem(ItemBattery.getEmptyBattery(ModItems.ammo_secret)); + + for(int i = 0; i < EnumAmmoSecret.values().length; i++) API.hideItem(new ItemStack(ModItems.ammo_secret, 1, i)); //Some things are even beyond my control...or are they? API.hideItem(ItemBattery.getEmptyBattery(ModItems.memory)); API.hideItem(ItemBattery.getFullBattery(ModItems.memory)); - API.hideItem(new ItemStack(ModItems.item_secret)); + for(int i = 0; i < EnumSecretType.values().length; i++) API.hideItem(new ItemStack(ModItems.item_secret, 1, i)); API.hideItem(new ItemStack(ModBlocks.machine_electric_furnace_on)); API.hideItem(new ItemStack(ModBlocks.machine_difurnace_on)); API.hideItem(new ItemStack(ModBlocks.machine_nuke_furnace_on)); diff --git a/src/main/java/com/hbm/util/DamageResistanceHandler.java b/src/main/java/com/hbm/util/DamageResistanceHandler.java index dc5efea0f..974c81ef0 100644 --- a/src/main/java/com/hbm/util/DamageResistanceHandler.java +++ b/src/main/java/com/hbm/util/DamageResistanceHandler.java @@ -8,6 +8,7 @@ import java.util.Map.Entry; import com.hbm.items.ModItems; import com.hbm.util.Tuple.Quartet; +import api.hbm.entity.IResistanceProvider; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -310,6 +311,13 @@ public class DamageResistanceHandler { float dt = 0; float dr = 0; + if(entity instanceof IResistanceProvider) { + IResistanceProvider irp = (IResistanceProvider) entity; + float[] res = irp.getCurrentDTDR(damage, amount, pierceDT, pierce); + dt += res[0]; + dr += res[1]; + } + /// SET HANDLING /// Quartet wornSet = new Quartet( entity.getEquipmentInSlot(4) != null ? entity.getEquipmentInSlot(4).getItem() : null, diff --git a/src/main/resources/assets/hbm/lang/de_DE.lang b/src/main/resources/assets/hbm/lang/de_DE.lang index 57070d426..d575a1e74 100644 --- a/src/main/resources/assets/hbm/lang/de_DE.lang +++ b/src/main/resources/assets/hbm/lang/de_DE.lang @@ -4902,7 +4902,8 @@ tile.stone_cracked.name=Rissiger Stein tile.stone_depth.name=Tiefenfels tile.stone_depth_nether.name=Nether-Tiefenfels tile.stone_gneiss.name=Graphitschiefer -tile.stone_keyhole.name=Seltsamer Stein +tile.stone_keyhole.name=Seltsamer Ziegel (Roter Raum) +tile.stone_keyhole_meta.name=Strange Red Room Brick tile.stone_porous.name=Poröser Stein tile.stone_resource.asbestos.name=Chrysotil tile.stone_resource.bauxite.name=Bauxit diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 0acb14598..e4827ae6e 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -6014,6 +6014,7 @@ tile.stone_depth.name=Depth Rock tile.stone_depth_nether.name=Nether Depth Rock tile.stone_gneiss.name=Graphitic Schist tile.stone_keyhole.name=Strange Stone +tile.stone_keyhole_meta.name=Strange Red Room Brick tile.stone_porous.name=Porous Stone tile.stone_resource.asbestos.name=Chrysotile tile.stone_resource.bauxite.name=Bauxite diff --git a/src/main/resources/assets/hbm/textures/blocks/stone_keyhole_meta.png b/src/main/resources/assets/hbm/textures/blocks/stone_keyhole_meta.png new file mode 100644 index 000000000..a8f0e071f Binary files /dev/null and b/src/main/resources/assets/hbm/textures/blocks/stone_keyhole_meta.png differ diff --git a/src/main/resources/assets/hbm/textures/gui/guide_pedestal.png b/src/main/resources/assets/hbm/textures/gui/guide_pedestal.png index 1e939e6c6..8574c7aed 100644 Binary files a/src/main/resources/assets/hbm/textures/gui/guide_pedestal.png and b/src/main/resources/assets/hbm/textures/gui/guide_pedestal.png differ