what a funky

This commit is contained in:
Bob 2022-07-09 21:27:20 +02:00
parent bae605d189
commit dc0556ba30
11 changed files with 92 additions and 17 deletions

View File

@ -25,6 +25,7 @@ import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.ReflectionHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@ -252,7 +253,9 @@ public class EntityBulletBase extends Entity implements IProjectile {
MovingObjectPosition movement = this.worldObj.func_147447_a(vecOrigin, vecDestination, false, true, false);
vecOrigin = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
vecDestination = Vec3.createVectorHelper(this.posX + this.motionX * this.config.velocity, this.posY + this.motionY * this.config.velocity, this.posZ + this.motionZ * this.config.velocity);
MovingObjectPosition impact = null;
Entity victim = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX * this.config.velocity, this.motionY * this.config.velocity, this.motionZ * this.config.velocity).expand(1.0D, 1.0D, 1.0D));
@ -273,6 +276,7 @@ public class EntityBulletBase extends Entity implements IProjectile {
if (d1 < d0 || d0 == 0.0D) {
victim = entity1;
impact = movingobjectposition1;
d0 = d1;
}
}
@ -295,25 +299,29 @@ public class EntityBulletBase extends Entity implements IProjectile {
DamageSource damagesource = this.config.getDamage(this, shooter);
if(!worldObj.isRemote) {
if(!config.doesPenetrate) {
if(!worldObj.isRemote) {
if(!config.doesPenetrate) {
this.setPosition(movement.hitVec.xCoord, movement.hitVec.yCoord, movement.hitVec.zCoord);
onEntityImpact(victim);
} else {
onEntityHurt(victim);
}
}
onEntityImpact(victim);
} else {
onEntityHurt(victim);
}
}
float damage = rand.nextFloat() * (config.dmgMax - config.dmgMin) + config.dmgMin;
if(overrideDamage != 0)
damage = overrideDamage;
boolean headshot = false;
if(victim instanceof EntityLivingBase) {
EntityLivingBase living = (EntityLivingBase) victim;
double head = living.height - living.getEyeHeight();
if(movement.hitVec != null && movement.hitVec.yCoord > living.height - head) {
if(!!living.isEntityAlive() && impact.hitVec != null && impact.hitVec.yCoord > (living.posY + living.height - head * 2)) {
damage *= this.config.headshotMult;
headshot = true;
}
}
@ -324,8 +332,26 @@ public class EntityBulletBase extends Entity implements IProjectile {
float dmg = (float) damage + lastDamage.getFloat(victim);
victim.attackEntityFrom(damagesource, dmg);
if(!victim.attackEntityFrom(damagesource, dmg)) {
headshot = false;
}
} catch (Exception x) { }
}
if(!worldObj.isRemote && headshot) {
if(victim instanceof EntityLivingBase) {
EntityLivingBase living = (EntityLivingBase) victim;
double head = living.height - living.getEyeHeight();
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "vanillaburst");
data.setInteger("count", 15);
data.setDouble("motion", 0.1D);
data.setString("mode", "blockdust");
data.setInteger("block", Block.getIdFromBlock(Blocks.redstone_block));
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, living.posX, living.posY + living.height - head, living.posZ), new TargetPoint(living.dimension, living.posX, living.posY, living.posZ, 50));
worldObj.playSoundEffect(victim.posX, victim.posY, victim.posZ, "mob.zombie.woodbreak", 1.0F, 0.95F + rand.nextFloat() * 0.2F);
}
}
//handle block collision

View File

@ -24,6 +24,11 @@ public class BulletConfigSyncingUtil {
public static int NIGHT2_REVOLVER = i++;
public static int SATURNITE_REVOLVER = i++;
public static int DESH_REVOLVER = i++;
public static int IRON_HS = i++;
public static int STEEL_HS = i++;
public static int GOLD_HS = i++;
public static int DESH_HS = i++;
public static int G20_NORMAL = i++;
public static int G20_SLUG = i++;
@ -276,6 +281,11 @@ public class BulletConfigSyncingUtil {
configSet.put(SATURNITE_REVOLVER, Gun357MagnumFactory.getRevSteelConfig().setToFire(3));
configSet.put(DESH_REVOLVER, Gun357MagnumFactory.getRevDeshConfig());
configSet.put(IRON_HS, Gun357MagnumFactory.getRevIronConfig().setHeadshot(3F));
configSet.put(STEEL_HS, Gun357MagnumFactory.getRevSteelConfig().setHeadshot(3F));
configSet.put(GOLD_HS, Gun357MagnumFactory.getRevGoldConfig().setHeadshot(3F));
configSet.put(DESH_HS, Gun357MagnumFactory.getRevDeshConfig().setHeadshot(3F));
configSet.put(G20_NORMAL, Gun20GaugeFactory.get20GaugeConfig());
configSet.put(G20_SLUG, Gun20GaugeFactory.get20GaugeSlugConfig());
configSet.put(G20_FLECHETTE, Gun20GaugeFactory.get20GaugeFlechetteConfig());
@ -514,7 +524,6 @@ public class BulletConfigSyncingUtil {
}
public static BulletConfiguration pullConfig(int key) {
return configSet.get(key);
}

View File

@ -185,6 +185,27 @@ public class Gun357MagnumFactory {
return config;
}
public static GunConfiguration getRevolverBioConfig() {
GunConfiguration config = getBaseConfig();
config.durability = 100000;
config.firingSound = "hbm:weapon.deagleShoot";
config.reloadDuration = 53;
config.crosshair = Crosshair.CIRCLE;
config.name = "RI No. 2 Mark 1";
config.manufacturer = "Ryan Industries";
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.IRON_HS);
config.config.add(BulletConfigSyncingUtil.STEEL_HS);
config.config.add(BulletConfigSyncingUtil.GOLD_HS);
config.config.add(BulletConfigSyncingUtil.DESH_HS);
return config;
}
//// // // // // ////// ////// //////
// // // // // // // // //
//// // // // // //// // //////

View File

@ -151,7 +151,7 @@ public class Fluids {
CRYOGEL = new FluidType( "CRYOGEL", 0x32ffff, 2, 0, 0, EnumSymbol.CROYGENIC).setTemp(-170);
HYDROGEN = new FluidTypeCombustible( "HYDROGEN", 0x4286f4, 3, 4, 0, EnumSymbol.CROYGENIC).setCombustionEnergy(FuelGrade.HIGH, 10_000).setHeatEnergy(5_000).addTraits(FluidTrait.LIQUID);
OXYGEN = new FluidType( "OXYGEN", 0x98bdf9, 3, 0, 0, EnumSymbol.CROYGENIC);
XENON = new FluidType( "XENON", 0xba45e8, 0, 0, 0, EnumSymbol.ASPHYXIANT);
XENON = new Gas( "XENON", 0xba45e8, 0, 0, 0, EnumSymbol.ASPHYXIANT);
BALEFIRE = new FluidType( "BALEFIRE", 0x28e02e, 4, 4, 3, EnumSymbol.RADIATION).setTemp(1500).addTraits(FluidTrait.CORROSIVE);
MERCURY = new FluidType( "MERCURY", 0x808080, 2, 0, 0, EnumSymbol.NONE);
PAIN = new FluidType( "PAIN", 0x938541, 2, 0, 1, EnumSymbol.ACID).setTemp(300).addTraits(FluidTrait.CORROSIVE);

View File

@ -5,6 +5,7 @@ import com.hbm.packet.AuxButtonPacket;
import com.hbm.packet.PacketDispatcher;
import com.hbm.tileentity.turret.TileEntityTurretArty;
import com.hbm.tileentity.turret.TileEntityTurretBaseNT;
import com.hbm.util.I18nUtil;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.entity.player.InventoryPlayer;
@ -17,6 +18,15 @@ public class GUITurretArty extends GUITurretBase {
public GUITurretArty(InventoryPlayer invPlayer, TileEntityTurretBaseNT tedf) {
super(invPlayer, tedf);
}
@Override
public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f);
TileEntityTurretArty arty = (TileEntityTurretArty) turret;
String mode = arty.mode == arty.MODE_ARTILLERY ? "artillery" : arty.mode == arty.MODE_CANNON ? "cannon" : "manual";
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 151, guiTop + 16, 18, 18, mouseX, mouseY, I18nUtil.resolveKeyArray("turret.arty." + mode));
}
@Override
protected void mouseClicked(int x, int y, int i) {

View File

@ -4369,7 +4369,7 @@ public class ModItems {
gun_revolver_silver = new ItemGunBase(Gun44MagnumFactory.getSilverConfig()).setUnlocalizedName("gun_revolver_silver").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_silver");
gun_revolver_red = new ItemGunBase(Gun44MagnumFactory.getRedConfig()).setUnlocalizedName("gun_revolver_red").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_red");
gun_deagle = new ItemGunBase(Gun50AEFactory.getDeagleConfig()).setUnlocalizedName("gun_deagle").setFull3D().setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_deagle");
gun_bio_revolver = new ItemGunBio(Gun50AEFactory.getDeagleConfig()).setUnlocalizedName("gun_bio_revolver").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_bio_revolver");
gun_bio_revolver = new ItemGunBio(Gun357MagnumFactory.getRevolverBioConfig()).setUnlocalizedName("gun_bio_revolver").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_bio_revolver");
gun_flechette = new ItemGunBase(Gun556mmFactory.getSPIWConfig(), Gun556mmFactory.getGLauncherConfig()).setUnlocalizedName("gun_flechette").setFull3D().setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_flechette");
gun_ar15 = new ItemGunBase(Gun50BMGFactory.getAR15Config()).setUnlocalizedName("gun_ar15").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_ar15");
//gun_calamity_ammo = new ItemCustomLore().setUnlocalizedName("gun_calamity_ammo").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_calamity_ammo");

View File

@ -769,6 +769,10 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
if(type == ElementType.HOTBAR) {
BulletConfiguration bcfg = BulletConfigSyncingUtil.pullConfig(gun.mainConfig.config.get(ItemGunBase.getMagType(stack)));
if(bcfg == null) {
return;
}
Item ammo = bcfg.ammo;
int count = ItemGunBase.getMag(stack);
int max = gcfg.ammoCap;

View File

@ -27,8 +27,7 @@ public class ItemGunBio extends ItemGunBase {
public static List<double[]> smokeNodes = new ArrayList();
@Override
public void startActionClient(ItemStack stack, World world, EntityPlayer player, boolean main) {
}
public void startActionClient(ItemStack stack, World world, EntityPlayer player, boolean main) { }
@Override
@SideOnly(Side.CLIENT)
@ -58,7 +57,7 @@ public class ItemGunBio extends ItemGunBase {
double alpha = (System.currentTimeMillis() - ItemGunBio.lastShot) / 2000D;
alpha = (1 - alpha) * 0.5D;
if(this.getReloadCycle(stack) > 0) alpha = 0;
if(this.getIsReloading(stack)) alpha = 0;
smokeNodes.add(new double[] {0, 0, 0, alpha});
}

View File

@ -91,7 +91,7 @@ public class TileEntityTurretArty extends TileEntityTurretBaseNT implements IGUI
@Override
public double getDecetorRange() {
return this.mode == this.MODE_CANNON ? 128D : 3000D;
return this.mode == this.MODE_CANNON ? 250D : 3000D;
}
@Override

View File

@ -3818,6 +3818,9 @@ tool.ability.silktouch=Behutsamkeit
tool.ability.smelter=Auto-Ofen
turret.animals=Passive anzielen: %s
turret.arty.artillery=Artilleriemodus$Puffer: 250m$Reichweite: 3.000m
turret.arty.cannon=Kanonenmodus$Puffer: 32m$Reichweite: 250m
turret.arty.manual=Manueller Modus$Reichweite: 3.000m
turret.machines=Maschinen anzielen: %s
turret.mobs=Mobs anzielen: %s
turret.none=Keine

View File

@ -4245,6 +4245,9 @@ tool.ability.silktouch=Silk Touch
tool.ability.smelter=Auto-Smelter
turret.animals=Target Passive: %s
turret.arty.artillery=§eArtillery Mode$Grace: 250m$Range: 3,000m
turret.arty.cannon=§eCannon Mode$Grace: 32m$Range: 250m
turret.arty.manual=§eManual Mode$Range: 3,000m
turret.machines=Target Machines: %s
turret.mobs=Target Mobs: %s
turret.none=None