mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Done for this one
Most issues are fixed and the new guns are implemented. A few bugs are still present, but they're minor. There are some code `TODO` notes I added, notably in the `HbmPotions` class.
This commit is contained in:
parent
fb1c4fff40
commit
e392d04e3c
@ -15,7 +15,13 @@ public class PotionConfig {
|
||||
public static int phosphorusID = 70;
|
||||
public static int stabilityID = 71;
|
||||
public static int potionsicknessID = 72;
|
||||
public static int deathID = 72;
|
||||
public static int deathID = 73;
|
||||
|
||||
public static int paralysisID = 74;
|
||||
public static int fragileID = 75;
|
||||
public static int unconsciousID = 76;
|
||||
public static int perforatedID = 77;
|
||||
public static int hollowID = 78;
|
||||
|
||||
public static int potionSickness = 0;
|
||||
|
||||
@ -35,6 +41,12 @@ public class PotionConfig {
|
||||
potionsicknessID = CommonConfig.createConfigInt(config, CATEGORY_POTION, "8.10_potionsicknessID", "What potion ID the potion sickness effect will have", 72);
|
||||
deathID = CommonConfig.createConfigInt(config, CATEGORY_POTION, "8.11_deathID", "What potion ID the death effect will have", 73);
|
||||
|
||||
paralysisID = CommonConfig.createConfigInt(config, CATEGORY_POTION, "8.11_paralysisPotionID", "What potion ID will the paralysis effect have", 74);
|
||||
fragileID = CommonConfig.createConfigInt(config, CATEGORY_POTION, "8.12_fragilePotionID", "What potion ID will the fragility effect have", 75);
|
||||
unconsciousID = CommonConfig.createConfigInt(config, CATEGORY_POTION, "8.13_unconsciousPotionID", "What potion ID will the subconscious effect have", 76);
|
||||
perforatedID = CommonConfig.createConfigInt(config, CATEGORY_POTION, "8.14_perforatedPotionID", "What potion ID will the perforated effect have", 77);
|
||||
hollowID = CommonConfig.createConfigInt(config, CATEGORY_POTION, "8.15_hollowPotionID", "What potion ID will the hollow effect have", 78);
|
||||
|
||||
String s = CommonConfig.createConfigString(config, CATEGORY_POTION, "8.S0_potionSickness", "Valid configs include \"NORMAL\" and \"TERRARIA\", otherwise potion sickness is turned off", "OFF");
|
||||
|
||||
if("normal".equals(s.toLowerCase()))
|
||||
|
||||
@ -162,9 +162,9 @@ public class Gun50BMGFactory {
|
||||
bullet.incendiary = 10;
|
||||
|
||||
bullet.effects = new ArrayList<PotionEffect>();
|
||||
// bullet.effects.add(HbmPotion.getPotionNoCure(HbmPotion.fragile.id, 30 * 20, 2));
|
||||
// bullet.effects.add(HbmPotion.getPotionNoCure(HbmPotion.perforated.id, 30 * 20, 2));
|
||||
// bullet.effects.add(HbmPotion.getPotionNoCure(HbmPotion.lead.id, 30 * 20, 1));
|
||||
bullet.effects.add(HbmPotion.getPotionNoCure(HbmPotion.fragile.id, 30 * 20, 2));
|
||||
bullet.effects.add(HbmPotion.getPotionNoCure(HbmPotion.perforated.id, 30 * 20, 2));
|
||||
bullet.effects.add(HbmPotion.getPotionNoCure(HbmPotion.lead.id, 30 * 20, 1));
|
||||
|
||||
bullet.blockDamage = true;
|
||||
bullet.bImpact = (projectile, x, y, z) -> projectile.worldObj.newExplosion(projectile, x, y, z, 5.0F, true, false);
|
||||
@ -178,7 +178,7 @@ public class Gun50BMGFactory {
|
||||
|
||||
bullet.ammo.meta = 1;
|
||||
bullet.incendiary = 50;
|
||||
// bullet.effects.add(HbmPotion.getPotionNoCure(HbmPotion.phosphorus.id, 30 * 30, 2));
|
||||
bullet.effects.add(HbmPotion.getPotionNoCure(HbmPotion.phosphorus.id, 30 * 30, 2));
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -115,12 +115,11 @@ public class Gun9mmFactory {
|
||||
}
|
||||
|
||||
static final float inaccuracy = 1.15f;
|
||||
static byte i = 0;
|
||||
public static BulletConfiguration get9mmConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = new ComparableStack(ModItems.ammo_9mm, 1, i++);
|
||||
bullet.ammo = new ComparableStack(ModItems.ammo_9mm, 1, 0);
|
||||
bullet.spread *= inaccuracy;
|
||||
bullet.dmgMin = 10;
|
||||
bullet.dmgMax = 14;
|
||||
@ -132,7 +131,7 @@ public class Gun9mmFactory {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = new ComparableStack(ModItems.ammo_9mm, 1, i++);
|
||||
bullet.ammo = new ComparableStack(ModItems.ammo_9mm, 1, 1);
|
||||
bullet.spread *= inaccuracy;
|
||||
bullet.dmgMin = 18;
|
||||
bullet.dmgMax = 20;
|
||||
@ -147,7 +146,7 @@ public class Gun9mmFactory {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = new ComparableStack(ModItems.ammo_9mm, 1, i++);
|
||||
bullet.ammo = new ComparableStack(ModItems.ammo_9mm, 1, 2);
|
||||
bullet.spread *= inaccuracy;
|
||||
bullet.dmgMin = 22;
|
||||
bullet.dmgMax = 26;
|
||||
@ -162,7 +161,7 @@ public class Gun9mmFactory {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
|
||||
|
||||
bullet.ammo = new ComparableStack(ModItems.ammo_9mm, 1, i++);
|
||||
bullet.ammo = new ComparableStack(ModItems.ammo_9mm, 1, 3);
|
||||
bullet.velocity = 5;
|
||||
bullet.explosive = 7.5F;
|
||||
bullet.trail = 5;
|
||||
|
||||
@ -844,9 +844,8 @@ public class GunEnergyFactory {
|
||||
bullet.destroysBlocks = true;
|
||||
|
||||
bullet.effects = new ArrayList<PotionEffect>();
|
||||
// TODO
|
||||
// bullet.effects.add(new PotionEffect(HbmPotion.fragile.id, 60 * 20, 4));
|
||||
// bullet.effects.add(new PotionEffect(HbmPotion.perforated.id, 60 * 20, 4));
|
||||
bullet.effects.add(new PotionEffect(HbmPotion.fragile.id, 60 * 20, 4));
|
||||
bullet.effects.add(new PotionEffect(HbmPotion.perforated.id, 60 * 20, 4));
|
||||
|
||||
//bullet.instakill = true;
|
||||
//bullet.style = BulletConfiguration.STYLE_ORB;
|
||||
@ -875,9 +874,8 @@ public class GunEnergyFactory {
|
||||
bullet.doesPenetrate = true;
|
||||
|
||||
bullet.effects = new ArrayList<PotionEffect>();
|
||||
// TODO
|
||||
// bullet.effects.add(HbmPotion.getPotionNoCure(HbmPotion.hollow.id, 2 * 20, 0));
|
||||
// bullet.effects.add(HbmPotion.getPotionNoCure(HbmPotion.fragile.id, 5 * 20, 1));
|
||||
bullet.effects.add(HbmPotion.getPotionNoCure(HbmPotion.hollow.id, 2 * 20, 0));
|
||||
bullet.effects.add(HbmPotion.getPotionNoCure(HbmPotion.fragile.id, 5 * 20, 1));
|
||||
|
||||
bullet.bHit = (projectile, hit) -> {if (hit instanceof EntityLivingBase) ContaminationUtil.applyDigammaData(hit, 0.005F);};
|
||||
|
||||
@ -915,10 +913,9 @@ public class GunEnergyFactory {
|
||||
bullet.doesPenetrate = true;
|
||||
|
||||
bullet.effects = new ArrayList<PotionEffect>();
|
||||
// TODO
|
||||
// bullet.effects.add(HbmPotion.getPotionNoCure(HbmPotion.hollow.id, 5 * 20, 1));
|
||||
// bullet.effects.add(HbmPotion.getPotionNoCure(HbmPotion.fragile.id, 7 * 20, 2));
|
||||
// bullet.effects.add(HbmPotion.getPotionNoCure(HbmPotion.perforated.id, 3 * 20, 0));
|
||||
bullet.effects.add(HbmPotion.getPotionNoCure(HbmPotion.hollow.id, 5 * 20, 1));
|
||||
bullet.effects.add(HbmPotion.getPotionNoCure(HbmPotion.fragile.id, 7 * 20, 2));
|
||||
bullet.effects.add(HbmPotion.getPotionNoCure(HbmPotion.perforated.id, 3 * 20, 0));
|
||||
|
||||
bullet.bHurt = (projectile, hit) -> {if (hit instanceof EntityLivingBase) ContaminationUtil.applyDigammaData(hit, 0.01F);};
|
||||
|
||||
|
||||
@ -91,13 +91,14 @@ public class GunOSIPRFactory {
|
||||
return config;
|
||||
}
|
||||
|
||||
static final float inaccuracy = 1.5f;
|
||||
static final float inaccuracy = 1.25f;
|
||||
public static BulletConfiguration getPulseConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
|
||||
bullet.ammo = new ComparableStack(ModItems.gun_osipr_ammo);
|
||||
bullet.ammoCount = 30;
|
||||
bullet.doesRicochet = false;
|
||||
bullet.spread *= inaccuracy;
|
||||
bullet.dmgMin = 15;
|
||||
bullet.dmgMax = 21;
|
||||
|
||||
@ -122,7 +122,7 @@ public class BlastFurnaceRecipes {
|
||||
final HashMap<List<ItemStack>[], ItemStack> recipes = new HashMap<>();
|
||||
|
||||
for(Triplet<Object, Object, ItemStack> recipe : blastFurnaceRecipes) {
|
||||
if(isStackHidden(recipe.getZ())) {
|
||||
if(!isStackHidden(recipe.getZ())) {
|
||||
final ItemStack nothing = new ItemStack(ModItems.nothing).setStackDisplayName("If you're reading this, an error has occured! Check the console.");
|
||||
final List<ItemStack> in1 = new ArrayList<ItemStack>();
|
||||
final List<ItemStack> in2 = new ArrayList<ItemStack>();
|
||||
|
||||
@ -4269,11 +4269,11 @@ public class ModItems {
|
||||
gun_benelli = new ItemGunBase(Gun12GaugeFactory.getBenelliConfig()).setFull3D().setUnlocalizedName("gun_benelli").setCreativeTab(MainRegistry.weaponTab);
|
||||
gun_benelli_mod = new ItemGunBase(Gun12GaugeFactory.getBenelliModConfig()).setFull3D().setUnlocalizedName("gun_benelli_mod").setCreativeTab(MainRegistry.weaponTab);
|
||||
gun_twr = new ItemGunTWR(GunEnergyFactory.getTWRConfig()).setUnlocalizedName("gun_twr").setCreativeTab(MainRegistry.weaponTab);
|
||||
gun_hlr = new ItemEnergyGunBase(GunEnergyFactory.getHLRPrimaryConfig(), GunEnergyFactory.getHLRSecondaryConfig()).setFull3D().setUnlocalizedName("gun_hlr").setCreativeTab(MainRegistry.weaponTab);
|
||||
gun_hlr = new ItemGunEnergyBase(GunEnergyFactory.getHLRPrimaryConfig(), GunEnergyFactory.getHLRSecondaryConfig()).setFull3D().setUnlocalizedName("gun_hlr").setCreativeTab(MainRegistry.weaponTab);
|
||||
gun_mlr = new ItemGunBase(Gun556mmFactory.getMLRConfig()).setFull3D().setUnlocalizedName("gun_mlr").setCreativeTab(MainRegistry.weaponTab);
|
||||
gun_llr = new ItemGunBase(Gun9mmFactory.getLLRConfig()).setFull3D().setUnlocalizedName("gun_llr").setCreativeTab(MainRegistry.weaponTab);
|
||||
gun_lunatic_marksman = new ItemGunBase(Gun50BMGFactory.getLunaticMarksman()).setFull3D().setUnlocalizedName("gun_lunatic_marksman").setCreativeTab(MainRegistry.weaponTab);
|
||||
pagoda = new ItemPagoda();
|
||||
pagoda = ItemPagoda.getSingleton();
|
||||
|
||||
ToolMaterial matCrucible = EnumHelper.addToolMaterial("CRUCIBLE", 10, 3, 50.0F, 100.0F, 0);
|
||||
crucible = new ItemCrucible(5000, 1F, matCrucible).setUnlocalizedName("crucible").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":crucible");
|
||||
@ -7069,7 +7069,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(gun_lunatic_marksman, gun_lunatic_marksman.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_hlr, gun_hlr.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_twr, gun_twr.getUnlocalizedName());
|
||||
GameRegistry.registerItem(pagoda, pagoda.getUnlocalizedName());
|
||||
// GameRegistry.registerItem(pagoda, pagoda.getUnlocalizedName());
|
||||
|
||||
//Ammo
|
||||
//GameRegistry.registerItem(gun_revolver_pip_ammo, gun_revolver_pip_ammo.getUnlocalizedName());
|
||||
|
||||
329
src/main/java/com/hbm/items/weapon/ItemGunEnergyBase.java
Normal file
329
src/main/java/com/hbm/items/weapon/ItemGunEnergyBase.java
Normal file
@ -0,0 +1,329 @@
|
||||
package com.hbm.items.weapon;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.interfaces.IHoldableWeapon;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.HbmCollection;
|
||||
import com.hbm.packet.GunAnimationPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
|
||||
public class ItemGunEnergyBase extends ItemGunBase implements IBatteryItem
|
||||
{
|
||||
@SuppressWarnings("hiding")
|
||||
public GunConfiguration mainConfig;
|
||||
@SuppressWarnings("hiding")
|
||||
public GunConfiguration altConfig;
|
||||
public long maxCharge;
|
||||
public long chargeRate;
|
||||
|
||||
public ItemGunEnergyBase(GunConfiguration main)
|
||||
{
|
||||
super(main);
|
||||
if (main.dischargePerShot > main.maxCharge)
|
||||
throw new IllegalArgumentException("Energy consumption rate exceeds energy cap!");
|
||||
mainConfig = main;
|
||||
maxCharge = mainConfig.maxCharge;
|
||||
chargeRate = mainConfig.chargeRate;
|
||||
}
|
||||
|
||||
public ItemGunEnergyBase(GunConfiguration main, GunConfiguration alt)
|
||||
{
|
||||
super(main, alt);
|
||||
if (main.dischargePerShot > main.maxCharge || alt.dischargePerShot > main.maxCharge)
|
||||
throw new IllegalArgumentException("Energy consumption rate exceeds energy cap!");
|
||||
mainConfig = main;
|
||||
altConfig = alt;
|
||||
maxCharge = mainConfig.maxCharge;
|
||||
chargeRate = mainConfig.chargeRate;
|
||||
|
||||
}
|
||||
// FIXME not working anymore
|
||||
@Override
|
||||
public boolean hasAmmo(ItemStack stack, EntityPlayer player, boolean main)
|
||||
{
|
||||
return getCharge(stack) >= (main ? mainConfig.dischargePerShot : altConfig.dischargePerShot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool)
|
||||
{
|
||||
final GunConfiguration mainConfigEnergy = mainConfig, altConfigEnergy = altConfig;
|
||||
final long gunChargeMax = mainConfigEnergy.maxCharge;
|
||||
final long gunCurrentCharge = getGunCharge(stack);
|
||||
String gunChargeMaxString = BobMathUtil.getShortNumber(gunChargeMax);
|
||||
String gunCurrentChargeString = BobMathUtil.getShortNumber(gunCurrentCharge);
|
||||
list.add(I18nUtil.resolveKey(HbmCollection.charge, gunCurrentChargeString, gunChargeMaxString));
|
||||
list.add(I18nUtil.resolveKey(HbmCollection.chargeRate, BobMathUtil.getShortNumber(chargeRate)));
|
||||
// list.add(String.format("Ammo: %s / %s", Math.floorDiv(gunCurrentCharge, mainConfigEnergy.ammoRate), Math.floorDiv(gunChargeMax, mainConfigEnergy.ammoRate)));
|
||||
|
||||
list.add(I18nUtil.resolveKey(HbmCollection.ammo, I18nUtil.resolveKey(HbmCollection.ammoMag, Math.floorDiv(gunCurrentCharge, mainConfigEnergy.dischargePerShot), Math.floorDiv(gunChargeMax, mainConfigEnergy.dischargePerShot))));
|
||||
|
||||
// list.add(String.format("Ammo Type: Energy; %sHE per shot%s", Library.getShortNumber(mainConfigEnergy.ammoRate), altConfig != null ? "; " + Library.getShortNumber(altConfigEnergy.ammoRate) + "HE per alt shot" : ""));
|
||||
|
||||
list.add(I18nUtil.resolveKey(HbmCollection.ammoEnergy, BobMathUtil.getShortNumber(mainConfigEnergy.dischargePerShot)));
|
||||
if (altConfig != null)
|
||||
list.add(I18nUtil.resolveKey(HbmCollection.altAmmoEnergy, BobMathUtil.getShortNumber(altConfigEnergy.dischargePerShot)));
|
||||
|
||||
addAdditionalInformation(stack, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void useUpAmmo(EntityPlayer player, ItemStack stack, boolean main)
|
||||
{
|
||||
GunConfiguration config = (main ? mainConfig : (altConfig != null ? altConfig : null));
|
||||
|
||||
if (config == null)
|
||||
return;
|
||||
|
||||
dischargeBattery(stack, config.dischargePerShot);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void altFire(ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
super.altFire(stack, world, player);
|
||||
useUpAmmo(player, stack, false);
|
||||
}
|
||||
// TODO
|
||||
@Override
|
||||
protected void reload2(ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
// System.out.println("Started reload action");
|
||||
// if (getCharge(stack) >= getMaxCharge())
|
||||
// {
|
||||
// System.out.println("Reload not needed");
|
||||
// setIsReloading(stack, false);
|
||||
// return;
|
||||
// }
|
||||
// if (getReloadCycle(stack) < 0 && stack == player.getHeldItem())
|
||||
// {
|
||||
// System.out.println("Needs reload!");
|
||||
// boolean hasReloaded = false;
|
||||
// for (ItemStack playerSlot : player.inventory.mainInventory)
|
||||
// {
|
||||
//// ItemBatteryFast battery;
|
||||
// System.out.println("Checking slot...");
|
||||
// if (playerSlot == null || !(playerSlot.getItem() instanceof ItemBatteryFast))
|
||||
// continue;
|
||||
// System.out.println("Slot is good!");
|
||||
// hasReloaded = fastDischarge(player, stack, playerSlot);
|
||||
// }
|
||||
//
|
||||
// if (getCharge(stack) >= getMaxCharge())
|
||||
// setIsReloading(stack, false);
|
||||
// else
|
||||
// resetReloadCycle(stack);
|
||||
// System.out.println("Reload cycle complete");
|
||||
// if (hasReloaded && mainConfig.reloadSoundEnd)
|
||||
// world.playSoundAtEntity(player, mainConfig.reloadSound.isEmpty() ? "hbm.item.battery" : mainConfig.reloadSound, 1.0F, 1.0F);
|
||||
// }
|
||||
// else
|
||||
// setReloadCycle(stack, getReloadCycle(stack) - 1);
|
||||
//
|
||||
// if(stack != player.getHeldItem())
|
||||
// {
|
||||
// setReloadCycle(stack, 0);
|
||||
// setIsReloading(stack, false);
|
||||
// }
|
||||
|
||||
}
|
||||
// TODO
|
||||
@Override
|
||||
public boolean canReload(ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
// if (getCharge(stack) == getMaxCharge())
|
||||
// return false;
|
||||
// for (ItemStack playerStack : player.inventory.mainInventory)
|
||||
// {
|
||||
// if (playerStack == null || !(playerStack.getItem() instanceof ItemBatteryFast))
|
||||
// continue;
|
||||
//
|
||||
// return IBatteryItem.getChargeStatic(playerStack) > 0;
|
||||
// }
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startReloadAction(ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
System.out.println("Trying to start reload cycle");
|
||||
if (getCharge(stack) == getMaxCharge() || getIsReloading(stack))
|
||||
return;
|
||||
|
||||
if (!mainConfig.reloadSoundEnd)
|
||||
world.playSoundAtEntity(player, mainConfig.reloadSound.isEmpty() ? "hbm:item.battery" : mainConfig.reloadSound, 1.0F, 1.0F);
|
||||
|
||||
PacketDispatcher.wrapper.sendTo(new GunAnimationPacket(AnimType.RELOAD.ordinal()), (EntityPlayerMP) player);
|
||||
|
||||
setIsReloading(stack, true);
|
||||
resetReloadCycle(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void chargeBattery(ItemStack stack, long i)
|
||||
{
|
||||
if(stack.getItem() instanceof ItemGunEnergyBase)
|
||||
{
|
||||
if(stack.hasTagCompound())
|
||||
{
|
||||
stack.stackTagCompound.setLong("charge", stack.stackTagCompound.getLong("charge") + i);
|
||||
}
|
||||
else
|
||||
{
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCharge(ItemStack stack, long i)
|
||||
{
|
||||
if(stack.getItem() instanceof ItemGunEnergyBase)
|
||||
{
|
||||
if(stack.hasTagCompound())
|
||||
{
|
||||
stack.stackTagCompound.setLong("charge", i);
|
||||
}
|
||||
else
|
||||
{
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dischargeBattery(ItemStack stack, long i)
|
||||
{
|
||||
if(stack.getItem() instanceof ItemGunEnergyBase)
|
||||
{
|
||||
if(stack.hasTagCompound())
|
||||
{
|
||||
stack.stackTagCompound.setLong("charge", stack.stackTagCompound.getLong("charge") - i);
|
||||
}
|
||||
else
|
||||
{
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", this.maxCharge - i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getCharge(ItemStack stack)
|
||||
{
|
||||
if(stack.getItem() instanceof ItemGunEnergyBase)
|
||||
{
|
||||
if(stack.hasTagCompound())
|
||||
{
|
||||
return stack.stackTagCompound.getLong("charge");
|
||||
}
|
||||
else
|
||||
{
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", ((ItemGunEnergyBase) stack.getItem()).maxCharge);
|
||||
return stack.stackTagCompound.getLong("charge");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@Deprecated
|
||||
public static ItemStack getEmptyGun(Item itemIn)
|
||||
{
|
||||
if (itemIn instanceof ItemGunEnergyBase)
|
||||
{
|
||||
ItemStack stack = new ItemStack(itemIn);
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", 0);
|
||||
return stack.copy();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderHUD(Pre event, ElementType type, EntityPlayer player, ItemStack stack)
|
||||
{
|
||||
// ItemGunEnergyBase gun = (ItemGunEnergyBase)stack.getItem();
|
||||
if (type == ElementType.HOTBAR)
|
||||
{
|
||||
int ammoRemaining = (int)Math.floorDiv(getCharge(stack), mainConfig.dischargePerShot);
|
||||
int ammoMax = (int)Math.floorDiv(getMaxCharge(), mainConfig.dischargePerShot);
|
||||
int dura = getItemWear(stack) * 50 / mainConfig.durability;
|
||||
|
||||
RenderScreenOverlay.renderAmmo(event.resolution, Minecraft.getMinecraft().ingameGUI, new ItemStack(ModItems.battery_creative), ammoRemaining, ammoMax, dura, mainConfig.showAmmo);
|
||||
}
|
||||
if (type == ElementType.CROSSHAIRS)
|
||||
{
|
||||
event.setCanceled(true);
|
||||
|
||||
RenderScreenOverlay.renderCustomCrosshairs(event.resolution, Minecraft.getMinecraft().ingameGUI, !(mainConfig.hasSights && player.isSneaking()) ? ((IHoldableWeapon)player.getHeldItem().getItem()).getCrosshair() : Crosshair.NONE);
|
||||
}
|
||||
}
|
||||
|
||||
public static void writeNBTLong(ItemStack stack, String key, long value)
|
||||
{
|
||||
if (!stack.hasTagCompound())
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
|
||||
stack.stackTagCompound.setLong(key, value);
|
||||
}
|
||||
|
||||
public static long readNBTLong(ItemStack stack, String key)
|
||||
{
|
||||
if (!stack.hasTagCompound())
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
|
||||
return stack.stackTagCompound.getLong(key);
|
||||
}
|
||||
|
||||
public static void setGunCharge(ItemStack stack, long i)
|
||||
{
|
||||
writeNBTLong(stack, "charge", i);
|
||||
}
|
||||
|
||||
public static long getGunCharge(ItemStack stack)
|
||||
{
|
||||
return readNBTLong(stack, "charge");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public long getMaxCharge()
|
||||
{
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getChargeRate()
|
||||
{
|
||||
return chargeRate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getDischargeRate()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -24,16 +24,26 @@ import net.minecraft.world.World;
|
||||
|
||||
public class ItemPagoda extends Item implements IClickReceiver
|
||||
{
|
||||
private static ItemPagoda SELF;
|
||||
|
||||
private static final String KEY_CHARGE = "PAGODA_CHARGE", KEY_CHARGING = "PAGODA_CHARGING";
|
||||
private static final short MAX_CHARGE = 1200;
|
||||
private static final byte MAX_RADIUS = 20;
|
||||
public ItemPagoda()
|
||||
private ItemPagoda()
|
||||
{
|
||||
setMaxStackSize(1);
|
||||
setFull3D();
|
||||
setUnlocalizedName("pagoda");
|
||||
setCreativeTab(MainRegistry.weaponTab);
|
||||
}
|
||||
|
||||
public static ItemPagoda getSingleton()
|
||||
{
|
||||
if (SELF == null)
|
||||
SELF = new ItemPagoda();
|
||||
|
||||
return SELF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized boolean handleMouseInput(ItemStack stack, EntityPlayer player, int button, boolean state)
|
||||
|
||||
@ -9,32 +9,23 @@ import com.hbm.entity.projectile.EntityBulletBase;
|
||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.handler.HbmKeybinds;
|
||||
import com.hbm.interfaces.IHoldableWeapon;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.items.weapon.ItemGunBase;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.GunAnimationPacket;
|
||||
import com.hbm.packet.GunButtonPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.PlayerInformPacket;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.ChatBuilder;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
@ -56,28 +47,30 @@ public class ItemEnergyGunBase extends ItemGunBase implements IBatteryItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
list.add("Energy Stored: " + BobMathUtil.getShortNumber(getCharge(stack)) + "/" + BobMathUtil.getShortNumber(mainConfig.maxCharge) + "HE");
|
||||
list.add("Charge rate: " + BobMathUtil.getShortNumber(mainConfig.chargeRate) + "HE/t");
|
||||
|
||||
BulletConfiguration config = getConfig(stack);
|
||||
// BulletConfiguration config = getConfig(stack);
|
||||
//
|
||||
// list.add("");
|
||||
// list.add("Mode: " + I18nUtil.resolveKey(config.modeName));
|
||||
// list.add("Mode info:");
|
||||
// list.add("Average damage: " + ((config.dmgMax + config.dmgMin) / 2F));
|
||||
// list.add("Firing Rate: " + BobMathUtil.roundDecimal((1F / ((config.firingRate) / 20F)), 2) + " rounds per second");
|
||||
// list.add("Power Consumption per Shot: " + BobMathUtil.getShortNumber(config.dischargePerShot) + "HE");
|
||||
//
|
||||
// list.add("");
|
||||
// list.add("Name: " + mainConfig.name);
|
||||
// list.add("Manufacturer: " + mainConfig.manufacturer);
|
||||
//
|
||||
// if(!mainConfig.comment.isEmpty()) {
|
||||
// list.add("");
|
||||
// for(String s : mainConfig.comment)
|
||||
// list.add(EnumChatFormatting.ITALIC + s);
|
||||
// }
|
||||
|
||||
list.add("");
|
||||
list.add("Mode: " + I18nUtil.resolveKey(config.modeName));
|
||||
list.add("Mode info:");
|
||||
list.add("Average damage: " + ((float)(config.dmgMax + config.dmgMin) / 2F));
|
||||
list.add("Firing Rate: " + BobMathUtil.roundDecimal((1F / (((float)config.firingRate) / 20F)), 2) + " rounds per second");
|
||||
list.add("Power Consumption per Shot: " + BobMathUtil.getShortNumber(config.dischargePerShot) + "HE");
|
||||
|
||||
list.add("");
|
||||
list.add("Name: " + mainConfig.name);
|
||||
list.add("Manufacturer: " + mainConfig.manufacturer);
|
||||
|
||||
if(!mainConfig.comment.isEmpty()) {
|
||||
list.add("");
|
||||
for(String s : mainConfig.comment)
|
||||
list.add(EnumChatFormatting.ITALIC + s);
|
||||
}
|
||||
addAdditionalInformation(stack, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -114,6 +107,7 @@ public void addInformation(ItemStack stack, EntityPlayer player, List list, bool
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateServer(ItemStack stack, World world, EntityPlayer player, int slot, boolean isCurrentItem) {
|
||||
|
||||
if(getDelay(stack) > 0 && isCurrentItem)
|
||||
@ -134,6 +128,7 @@ public void addInformation(ItemStack stack, EntityPlayer player, List list, bool
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean tryShoot(ItemStack stack, World world, EntityPlayer player, boolean main) {
|
||||
|
||||
|
||||
@ -144,6 +139,7 @@ public void addInformation(ItemStack stack, EntityPlayer player, List list, bool
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fire(ItemStack stack, World world, EntityPlayer player) {
|
||||
|
||||
BulletConfiguration config = getConfig(stack);
|
||||
@ -159,7 +155,7 @@ public void addInformation(ItemStack stack, EntityPlayer player, List list, bool
|
||||
spawnProjectile(world, player, stack, BulletConfigSyncingUtil.getKey(config));
|
||||
}
|
||||
|
||||
setCharge(stack, getCharge(stack) - config.dischargePerShot);;
|
||||
setCharge(stack, getCharge(stack) - config.dischargePerShot);
|
||||
}
|
||||
|
||||
world.playSoundAtEntity(player, mainConfig.firingSound, 1.0F, mainConfig.firingPitch);
|
||||
@ -172,6 +168,7 @@ public void addInformation(ItemStack stack, EntityPlayer player, List list, bool
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void spawnProjectile(World world, EntityPlayer player, ItemStack stack, int config) {
|
||||
|
||||
EntityBulletBase bullet = new EntityBulletBase(world, config, player);
|
||||
@ -182,9 +179,10 @@ public void addInformation(ItemStack stack, EntityPlayer player, List list, bool
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startAction(ItemStack stack, World world, EntityPlayer player, boolean main) {
|
||||
|
||||
if(mainConfig.firingMode == mainConfig.FIRE_MANUAL && main && tryShoot(stack, world, player, main)) {
|
||||
if(mainConfig.firingMode == GunConfiguration.FIRE_MANUAL && main && tryShoot(stack, world, player, main)) {
|
||||
fire(stack, world, player);
|
||||
setDelay(stack, mainConfig.rateOfFire);
|
||||
|
||||
@ -218,10 +216,12 @@ public void addInformation(ItemStack stack, EntityPlayer player, List list, bool
|
||||
|
||||
// yummy boilerplate
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
return 1D - (double) getCharge(stack) / (double) getMaxCharge();
|
||||
}
|
||||
@ -321,10 +321,7 @@ public void addInformation(ItemStack stack, EntityPlayer player, List list, bool
|
||||
|
||||
event.setCanceled(true);
|
||||
|
||||
if(!(mainConfig.hasSights && player.isSneaking()))
|
||||
RenderScreenOverlay.renderCustomCrosshairs(event.resolution, Minecraft.getMinecraft().ingameGUI, ((IHoldableWeapon)player.getHeldItem().getItem()).getCrosshair());
|
||||
else
|
||||
RenderScreenOverlay.renderCustomCrosshairs(event.resolution, Minecraft.getMinecraft().ingameGUI, Crosshair.NONE);
|
||||
RenderScreenOverlay.renderCustomCrosshairs(event.resolution, Minecraft.getMinecraft().ingameGUI, (mainConfig.hasSights && player.isSneaking()) ? Crosshair.NONE : ((IHoldableWeapon)player.getHeldItem().getItem()).getCrosshair());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -14,46 +14,48 @@ import net.minecraft.util.EntityDamageSourceIndirect;
|
||||
|
||||
public class ModDamageSource extends DamageSource {
|
||||
|
||||
public static DamageSource nuclearBlast = (new DamageSource("nuclearBlast")).setExplosion();
|
||||
public static DamageSource mudPoisoning = (new DamageSource("mudPoisoning")).setDamageBypassesArmor();
|
||||
public static DamageSource acid = (new DamageSource("acid")).setDamageBypassesArmor();
|
||||
public static DamageSource euthanizedSelf = (new DamageSource("euthanizedSelf")).setDamageBypassesArmor();
|
||||
public static DamageSource euthanizedSelf2 = (new DamageSource("euthanizedSelf2")).setDamageBypassesArmor();
|
||||
public static DamageSource tauBlast = (new DamageSource("tauBlast")).setDamageBypassesArmor();
|
||||
public static DamageSource radiation = (new DamageSource("radiation")).setDamageBypassesArmor();
|
||||
public static DamageSource digamma = (new DamageSource("digamma")).setDamageIsAbsolute().setDamageBypassesArmor().setDamageAllowedInCreativeMode();
|
||||
public static DamageSource suicide = (new DamageSource("suicide")).setProjectile();
|
||||
public static DamageSource teleporter = (new DamageSource("teleporter")).setDamageIsAbsolute();
|
||||
public static DamageSource cheater = (new DamageSource("cheater")).setDamageIsAbsolute().setDamageBypassesArmor().setDamageAllowedInCreativeMode();
|
||||
public static DamageSource rubble = (new DamageSource("rubble")).setProjectile();
|
||||
public static DamageSource shrapnel = (new DamageSource("shrapnel")).setProjectile();
|
||||
public static DamageSource blackhole = (new DamageSource("blackhole")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource turbofan = (new DamageSource("blender")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource meteorite = (new DamageSource("meteorite")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource boxcar = (new DamageSource("boxcar")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource boat = (new DamageSource("boat")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource building = (new DamageSource("building")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource taint = (new DamageSource("taint")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource ams = (new DamageSource("ams")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource amsCore = (new DamageSource("amsCore")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource broadcast = (new DamageSource("broadcast")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource bang = (new DamageSource("bang")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource pc = (new DamageSource("pc")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource cloud = (new DamageSource("cloud")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource lead = (new DamageSource("lead")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource enervation = (new DamageSource("enervation")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource electricity = (new DamageSource("electricity")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource exhaust = (new DamageSource("exhaust")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource spikes = (new DamageSource("spikes")).setDamageBypassesArmor();
|
||||
public static DamageSource lunar = (new DamageSource("lunar")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource monoxide = (new DamageSource("monoxide")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource asbestos = (new DamageSource("asbestos")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource blacklung = (new DamageSource("blacklung")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource mku = (new DamageSource("mku")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource vacuum = (new DamageSource("vacuum")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource overdose = (new DamageSource("overdose")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource microwave = (new DamageSource("microwave")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource nuclearBlast = (new DamageSource("nuclearBlast")).setExplosion();
|
||||
public static final DamageSource mudPoisoning = (new DamageSource("mudPoisoning")).setDamageBypassesArmor();
|
||||
public static final DamageSource acid = (new DamageSource("acid")).setDamageBypassesArmor();
|
||||
public static final DamageSource euthanizedSelf = (new DamageSource("euthanizedSelf")).setDamageBypassesArmor();
|
||||
public static final DamageSource euthanizedSelf2 = (new DamageSource("euthanizedSelf2")).setDamageBypassesArmor();
|
||||
public static final DamageSource tauBlast = (new DamageSource("tauBlast")).setDamageBypassesArmor();
|
||||
public static final DamageSource radiation = (new DamageSource("radiation")).setDamageBypassesArmor();
|
||||
public static final DamageSource digamma = (new DamageSource("digamma")).setDamageIsAbsolute().setDamageBypassesArmor().setDamageAllowedInCreativeMode();
|
||||
public static final DamageSource suicide = (new DamageSource("suicide")).setProjectile();
|
||||
public static final DamageSource teleporter = (new DamageSource("teleporter")).setDamageIsAbsolute();
|
||||
public static final DamageSource cheater = (new DamageSource("cheater")).setDamageIsAbsolute().setDamageBypassesArmor().setDamageAllowedInCreativeMode();
|
||||
public static final DamageSource rubble = (new DamageSource("rubble")).setProjectile();
|
||||
public static final DamageSource shrapnel = (new DamageSource("shrapnel")).setProjectile();
|
||||
public static final DamageSource blackhole = (new DamageSource("blackhole")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource turbofan = (new DamageSource("blender")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource meteorite = (new DamageSource("meteorite")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource boxcar = (new DamageSource("boxcar")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource boat = (new DamageSource("boat")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource building = (new DamageSource("building")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource taint = (new DamageSource("taint")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource ams = (new DamageSource("ams")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource amsCore = (new DamageSource("amsCore")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource broadcast = (new DamageSource("broadcast")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource bang = (new DamageSource("bang")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource pc = (new DamageSource("pc")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource cloud = (new DamageSource("cloud")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource lead = (new DamageSource("lead")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource enervation = (new DamageSource("enervation")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource electricity = (new DamageSource("electricity")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource exhaust = (new DamageSource("exhaust")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource spikes = (new DamageSource("spikes")).setDamageBypassesArmor();
|
||||
public static final DamageSource lunar = (new DamageSource("lunar")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource monoxide = (new DamageSource("monoxide")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource asbestos = (new DamageSource("asbestos")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource blacklung = (new DamageSource("blacklung")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource mku = (new DamageSource("mku")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource vacuum = (new DamageSource("vacuum")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource overdose = (new DamageSource("overdose")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static final DamageSource microwave = (new DamageSource("microwave")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
|
||||
public static final DamageSource bleed = (new DamageSource("bleed")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
|
||||
public static final String s_bullet = "revolverBullet";
|
||||
public static final String s_emplacer = "chopperBullet";
|
||||
public static final String s_tau = "tau";
|
||||
|
||||
@ -943,6 +943,9 @@ public class ModEventHandler {
|
||||
props.lastDamage = player.ticksExisted;
|
||||
}
|
||||
|
||||
if (e.isPotionActive(HbmPotion.fragile))
|
||||
event.ammount *= e.getActivePotionEffect(HbmPotion.fragile).getAmplifier() + 1;
|
||||
|
||||
if(HbmLivingProps.getContagion(e) > 0 && event.ammount < 100)
|
||||
event.ammount *= 2F;
|
||||
|
||||
|
||||
@ -12,6 +12,7 @@ import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.util.ContaminationUtil;
|
||||
import com.hbm.util.ContaminationUtil.ContaminationType;
|
||||
import com.hbm.util.ContaminationUtil.HazardType;
|
||||
@ -21,10 +22,12 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.passive.EntityCow;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class HbmPotion extends Potion {
|
||||
@ -41,6 +44,13 @@ public class HbmPotion extends Potion {
|
||||
public static HbmPotion stability;
|
||||
public static HbmPotion potionsickness;
|
||||
public static HbmPotion death;
|
||||
|
||||
// Someone with better technical knowledge, implement these better
|
||||
public static HbmPotion paralysis;
|
||||
public static HbmPotion fragile;
|
||||
public static HbmPotion unconscious;
|
||||
public static HbmPotion perforated;
|
||||
public static HbmPotion hollow;
|
||||
|
||||
public HbmPotion(int id, boolean isBad, int color) {
|
||||
super(id, isBad, color);
|
||||
@ -59,6 +69,12 @@ public class HbmPotion extends Potion {
|
||||
stability = registerPotion(PotionConfig.stabilityID, false, 0xD0D0D0, "potion.hbm_stability", 2, 1);
|
||||
potionsickness = registerPotion(PotionConfig.potionsicknessID, false, 0xff8080, "potion.hbm_potionsickness", 3, 1);
|
||||
death = registerPotion(PotionConfig.deathID, false, 1118481, "potion.hbm_death", 4, 1);
|
||||
|
||||
paralysis = registerPotion(PotionConfig.paralysisID, true, 0x808080, "potion.hbm_paralysis", 7, 1);
|
||||
fragile = registerPotion(PotionConfig.fragileID, true, 0x00FFFF, "potion.hbm_fragile", 6, 1);
|
||||
unconscious = registerPotion(PotionConfig.unconsciousID, false, 0xFF80ED, "potion.hbm_unconscious", 0, 2);
|
||||
perforated = registerPotion(PotionConfig.perforatedID, true, 0xFF0000, "potion.hbm_perforated", 1, 2);
|
||||
hollow = registerPotion(PotionConfig.hollowID, true, 0x000000, "potion.hbm_hollow", 2, 2);
|
||||
}
|
||||
|
||||
public static HbmPotion registerPotion(int id, boolean isBad, int color, String name, int x, int y) {
|
||||
@ -79,7 +95,7 @@ public class HbmPotion extends Potion {
|
||||
field.set(null, newArray);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
MainRegistry.logger.catching(e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -98,6 +114,8 @@ public class HbmPotion extends Potion {
|
||||
return super.getStatusIconIndex();
|
||||
}
|
||||
|
||||
// TODO Possibly change to a switch since potions can be represented by integer IDs
|
||||
@Override
|
||||
public void performEffect(EntityLivingBase entity, int level) {
|
||||
|
||||
if(this == taint) {
|
||||
@ -120,7 +138,7 @@ public class HbmPotion extends Potion {
|
||||
}
|
||||
}
|
||||
if(this == radiation) {
|
||||
ContaminationUtil.contaminate(entity, HazardType.RADIATION, ContaminationType.CREATIVE, (float)(level + 1F) * 0.05F);
|
||||
ContaminationUtil.contaminate(entity, HazardType.RADIATION, ContaminationType.CREATIVE, (level + 1F) * 0.05F);
|
||||
}
|
||||
if(this == radaway) {
|
||||
|
||||
@ -163,15 +181,43 @@ public class HbmPotion extends Potion {
|
||||
|
||||
entity.setFire(1);
|
||||
}
|
||||
|
||||
// FIXME This effect is supposed to do as it sounds, but this method is super jank and probably doesn't even work right
|
||||
if (this == paralysis)
|
||||
{
|
||||
if (entity.getEntityAttribute(SharedMonsterAttributes.attackDamage) != null)
|
||||
func_111184_a(SharedMonsterAttributes.attackDamage, "648D7064-6A60-4F59-8ABE-C2C23A6DD7A9", -100, 2);
|
||||
|
||||
func_111184_a(SharedMonsterAttributes.movementSpeed, "7107DE5E-7CE8-4030-940E-514C1F160890", -100, 2);
|
||||
|
||||
if (entity.motionY > 0)
|
||||
entity.motionY = -2;
|
||||
}
|
||||
|
||||
// These two should be fine
|
||||
if (this == perforated)
|
||||
entity.attackEntityFrom(ModDamageSource.bleed, (level + 3));
|
||||
|
||||
if (this == hollow)
|
||||
{
|
||||
// if (level > 2)
|
||||
// ContaminationUtil.applyDigammaDirect(entity, (level + 1F) * 0.5F);
|
||||
// else
|
||||
// ContaminationUtil.applyDigammaData(entity, (level + 1F) * 0.25F);
|
||||
|
||||
ContaminationUtil.contaminate(entity, HazardType.DIGAMMA, ContaminationType.DIGAMMA, (level + 1F) > 2 ? 0.005F : 0.0025F);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Ditto
|
||||
@Override
|
||||
public boolean isReady(int par1, int par2) {
|
||||
|
||||
if(this == taint) {
|
||||
return par1 % 2 == 0;
|
||||
}
|
||||
|
||||
if(this == radiation || this == radaway || this == telekinesis || this == phosphorus) {
|
||||
if(this == radiation || this == radaway || this == telekinesis || this == phosphorus || this == hollow || this == paralysis || this == fragile) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -184,6 +230,9 @@ public class HbmPotion extends Potion {
|
||||
return k > 0 ? par1 % k == 0 : true;
|
||||
}
|
||||
|
||||
if (this == perforated)
|
||||
return par1 % 30 == 0;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -198,4 +247,20 @@ public class HbmPotion extends Potion {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static PotionEffect getPotionNoCure(int id, int dura, int level)
|
||||
{
|
||||
final PotionEffect potion = new PotionEffect(id, dura, level);
|
||||
potion.getCurativeItems().clear();
|
||||
return potion;
|
||||
}
|
||||
|
||||
public static PotionEffect getPotionWithCures(int id, int dura, int level, ItemStack...stacks)
|
||||
{
|
||||
final PotionEffect potion = new PotionEffect(id, dura, level);
|
||||
for (ItemStack stack : stacks)
|
||||
potion.addCurativeItem(stack);
|
||||
return potion;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -29,17 +29,16 @@ public class ItemRenderM2 extends ItemRenderBase
|
||||
GL11.glScalef(scale1, scale1, -scale1);
|
||||
// GL11.glRotatef(10, 1, 0, 0);
|
||||
GL11.glRotatef(-90, 0, 1, 0);
|
||||
GL11.glTranslatef(0, -2, -2);
|
||||
GL11.glRotatef(20, 1, 0, 0);
|
||||
GL11.glTranslatef(0, 0.5f, -5);
|
||||
GL11.glRotatef(30, 1, 0, 0);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
GL11.glRotatef(-90, 0, 1, 0);
|
||||
if (Minecraft.getMinecraft().thePlayer.isSneaking())
|
||||
{
|
||||
GL11.glTranslatef(-0.95f, -0.9f, -2);
|
||||
GL11.glRotatef(-5, 0, 1, 1);
|
||||
}
|
||||
else
|
||||
GL11.glTranslatef(-0.96f, -0.9f, -2);
|
||||
GL11.glRotatef(-5.6f, 0, 1, 1);
|
||||
} else
|
||||
GL11.glTranslatef(0, -1, -3);
|
||||
GL11.glRotatef(25, 1, 0, 0);
|
||||
break;
|
||||
|
||||
@ -593,6 +593,7 @@ death.attack.amsCore=%1$s was vaporized in the fire of a singularity.
|
||||
death.attack.asbestos=%1$s is now entitled to financial compensation.
|
||||
death.attack.bang=%1$s was blasted into bite-sized pieces.
|
||||
death.attack.blackhole=%1$s was spaghettified.
|
||||
death.attack.bleed=%1$s had their organs leak out of their perforations.
|
||||
death.attack.blender=%1$s was chopped in small, bite-sized pieces.
|
||||
death.attack.boat=%1$s was hit by a boat.
|
||||
death.attack.boil=%1$s was boiled alive by %2$s.
|
||||
@ -648,6 +649,10 @@ death.attack.taint=%1$s died from flux tumors.
|
||||
death.attack.tau=%1$s was riddeled by %2$s using negatively charged tauons.
|
||||
death.attack.tauBlast=%1$s charged the XVL1456 for too long and was blown into pieces.
|
||||
death.attack.teleporter=%1$s was teleported into nothingness.
|
||||
death.attack.twr0=%1$s was shattered into a million shards of light.
|
||||
death.attack.twr1=%1$s found out there was no exit.
|
||||
death.attack.twr2=%2$s shattered %1$s into a million shards of light.
|
||||
death.attack.twr3=%2$s showed %1$s that there was no exit.
|
||||
|
||||
desc.item.pileRod=§eUse on drilled graphite to insert$§eUse screwdriver to extract$
|
||||
desc.item.rtgDecay=Decays to: %s
|
||||
@ -930,7 +935,7 @@ gun.name.lunaGun=1978 Rāhula type Standard Issue Sidearm (Revision 2)
|
||||
gun.name.lunaHLR=1944 Chang'e type Light Machine Gun
|
||||
gun.name.lunaShotty=1978 Guan Yu type Scattergun (Revision 1)
|
||||
gun.name.lunaSMG=1956 Ānanda type Submachine Gun
|
||||
gun.name.lunaSniper=1909 Hou Yi type Anti-Material Rifle
|
||||
gun.name.lunaSniper=1915 Hou Yi type Anti-Material Rifle
|
||||
gun.name.lunaTWR=Time Warp Rifle
|
||||
gun.name.m2=Browning machine gun, cal. .50, M2, HB
|
||||
gun.name.m42=M-42 Tactical Nuclear Catapult
|
||||
@ -3415,6 +3420,8 @@ item.shimmer_head.name=Heavy Hammer Head
|
||||
item.shimmer_sledge.name=Shimmer Sledge
|
||||
item.singularity.name=Singularity
|
||||
item.singularity_counter_resonant.name=Contained Counter-Resonant Singularity
|
||||
item.singularity_micro.desc=A wee lad!
|
||||
item.singularity_micro.name=Micro-Singularity
|
||||
item.singularity_spark.name=Spark Singularity
|
||||
item.singularity_super_heated.name=Superheated Resonating Singularity
|
||||
item.siox.name=SiOX Cancer Medication
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 645 B |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Loading…
x
Reference in New Issue
Block a user