"i was in the war" congratulations, i'm gonna be in the next one and

they have laser beams now
This commit is contained in:
Bob 2024-11-14 22:50:38 +01:00
parent 5e57c86f57
commit d66b75b76c
6 changed files with 78 additions and 32 deletions

View File

@ -35,6 +35,8 @@ public class EntityBulletBeamBase extends Entity implements IEntityAdditionalSpa
this.setSize(0.5F, 0.5F); this.setSize(0.5F, 0.5F);
} }
public EntityLivingBase getThrower() { return this.thrower; }
public EntityBulletBeamBase(EntityLivingBase entity, BulletConfig config, float baseDamage, float angularInaccuracy, double sideOffset, double heightOffset, double frontOffset) { public EntityBulletBeamBase(EntityLivingBase entity, BulletConfig config, float baseDamage, float angularInaccuracy, double sideOffset, double heightOffset, double frontOffset) {
this(entity.worldObj); this(entity.worldObj);

View File

@ -211,6 +211,31 @@ public class BulletConfig implements Cloneable {
} }
}; };
public static BiConsumer<EntityBulletBeamBase, MovingObjectPosition> LAMBDA_STANDARD_BEAM_HIT = (bullet, mop) -> {
if(mop.typeOfHit == mop.typeOfHit.ENTITY) {
Entity entity = mop.entityHit;
if(entity instanceof EntityLivingBase && ((EntityLivingBase) entity).getHealth() <= 0) return;
DamageSource damageCalc = bullet.config.getDamage(bullet, bullet.getThrower(), false);
if(!(entity instanceof EntityLivingBase)) {
EntityDamageUtil.attackEntityFromIgnoreIFrame(entity, damageCalc, bullet.damage);
return;
}
EntityLivingBase living = (EntityLivingBase) entity;
if(bullet.config.armorPiercingPercent == 0) {
EntityDamageUtil.attackEntityFromIgnoreIFrame(entity, damageCalc, bullet.damage);
} else {
DamageSource damagePiercing = bullet.config.getDamage(bullet, bullet.getThrower(), true);
EntityDamageUtil.attackArmorPiercing(living, damageCalc, damagePiercing, bullet.damage, bullet.config.armorPiercingPercent);
}
}
};
public static BiConsumer<EntityBulletBeamBase, MovingObjectPosition> LAMBDA_BEAM_HIT = (beam, mop) -> { public static BiConsumer<EntityBulletBeamBase, MovingObjectPosition> LAMBDA_BEAM_HIT = (beam, mop) -> {
if(mop.typeOfHit == mop.typeOfHit.ENTITY) { if(mop.typeOfHit == mop.typeOfHit.ENTITY) {

View File

@ -1034,5 +1034,24 @@ public class Orchestras {
if(entity.worldObj.isRemote) return; if(entity.worldObj.isRemote) return;
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex); AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex); int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
if(type == AnimType.RELOAD) {
if(timer == 2) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallRemove", 1F, 1F);
if(timer == 18) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.impact", 0.25F, 1F);
if(timer == 30) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magInsert", 1F, 1F);
if(timer == 38) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
}
if(type == AnimType.INSPECT) {
if(timer == 2) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallRemove", 1F, 1F);
if(timer == 12) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magInsert", 1F, 1F);
if(timer == 20) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
}
if(type == AnimType.JAMMED) {
if(timer == 2) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallRemove", 1F, 1F);
if(timer == 22) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magInsert", 1F, 1F);
if(timer == 30) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
}
}; };
} }

View File

@ -91,9 +91,9 @@ public class XFactoryEnergy {
energy_tesla_blacklightning = new BulletConfig().setItem(EnumAmmo.CAPACITOR_BLACKLIGHTNING).setSpread(0.0F).setLife(5).setRenderRotations(false).setDoesPenetrate(true) energy_tesla_blacklightning = new BulletConfig().setItem(EnumAmmo.CAPACITOR_BLACKLIGHTNING).setSpread(0.0F).setLife(5).setRenderRotations(false).setDoesPenetrate(true)
.setDamage(5F).setOnBeamImpact(LAMBDA_LIGHTNING_HIT); .setDamage(5F).setOnBeamImpact(LAMBDA_LIGHTNING_HIT);
energy_las = new BulletConfig().setItem(EnumAmmo.CAPACITOR).setSpread(0.0F).setLife(5).setRenderRotations(false).setDoesPenetrate(true); energy_las = new BulletConfig().setItem(EnumAmmo.CAPACITOR).setSpread(0.0F).setLife(5).setRenderRotations(false).setOnBeamImpact(BulletConfig.LAMBDA_STANDARD_BEAM_HIT);
energy_las_overcharge = new BulletConfig().setItem(EnumAmmo.CAPACITOR_OVERCHARGE).setSpread(0.0F).setLife(5).setRenderRotations(false).setDoesPenetrate(true); energy_las_overcharge = new BulletConfig().setItem(EnumAmmo.CAPACITOR_OVERCHARGE).setSpread(0.0F).setLife(5).setRenderRotations(false).setDoesPenetrate(true).setOnBeamImpact(BulletConfig.LAMBDA_STANDARD_BEAM_HIT);
energy_las_blacklightning = new BulletConfig().setItem(EnumAmmo.CAPACITOR_BLACKLIGHTNING).setSpread(0.0F).setLife(5).setRenderRotations(false).setDoesPenetrate(true); energy_las_blacklightning = new BulletConfig().setItem(EnumAmmo.CAPACITOR_BLACKLIGHTNING).setSpread(0.0F).setLife(5).setRenderRotations(false).setDoesPenetrate(true).setOnBeamImpact(BulletConfig.LAMBDA_STANDARD_BEAM_HIT);
ModItems.gun_tesla_cannon = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig() ModItems.gun_tesla_cannon = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(2_000).draw(10).inspect(33).reloadSequential(true).crosshair(Crosshair.CIRCLE) .dura(2_000).draw(10).inspect(33).reloadSequential(true).crosshair(Crosshair.CIRCLE)
@ -107,9 +107,9 @@ public class XFactoryEnergy {
).setUnlocalizedName("gun_tesla_cannon"); ).setUnlocalizedName("gun_tesla_cannon");
ModItems.gun_lasrifle = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig() ModItems.gun_lasrifle = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(2_000).draw(10).inspect(33).reloadSequential(true).crosshair(Crosshair.CIRCLE) .dura(2_000).draw(10).inspect(26).reloadSequential(true).crosshair(Crosshair.CIRCLE)
.rec(new Receiver(0) .rec(new Receiver(0)
.dmg(15F).delay(10).reload(20).jam(19).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F) .dmg(15F).delay(8).reload(44).jam(36).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 24).addConfigs(energy_las, energy_las_overcharge, energy_las_blacklightning)) .mag(new MagazineFullReload(0, 24).addConfigs(energy_las, energy_las_overcharge, energy_las_blacklightning))
.offset(0.75, -0.0625 * 1.5, -0.1875) .offset(0.75, -0.0625 * 1.5, -0.1875)
.setupBeamFire().recoil(Lego.LAMBDA_STANDARD_RECOIL)) .setupBeamFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -143,7 +143,7 @@ public class XFactoryEnergy {
case EQUIP: return new BusAnimation() case EQUIP: return new BusAnimation()
.addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN)); .addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
case CYCLE: return new BusAnimation() case CYCLE: return new BusAnimation()
.addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, ItemGunBaseNT.getIsAiming(stack) ? -0.5 : -1, 50, IType.SIN_DOWN).addPos(0, 0, 0, 150, IType.SIN_FULL)) .addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, -0.5, 50, IType.SIN_DOWN).addPos(0, 0, 0, 150, IType.SIN_FULL))
.addBus("CYCLE", new BusAnimationSequence().addPos(0, 0, 0, 150).addPos(0, 0, 22.5, 350)) .addBus("CYCLE", new BusAnimationSequence().addPos(0, 0, 0, 150).addPos(0, 0, 22.5, 350))
.addBus("COUNT", new BusAnimationSequence().addPos(amount, 0, 0, 0)); .addBus("COUNT", new BusAnimationSequence().addPos(amount, 0, 0, 0));
case RELOAD: return new BusAnimation() case RELOAD: return new BusAnimation()

View File

@ -2024,58 +2024,58 @@ vt 0.024036 0.230847
vt 0.030765 0.259434 vt 0.030765 0.259434
vt 0.028962 0.275939 vt 0.028962 0.275939
vt 0.024036 0.288021 vt 0.024036 0.288021
vt 0.338462 0.169811 vt 0.261538 0.169811
vt 0.030769 0.150943 vt 0.030769 0.150943
vt 0.338462 0.150943 vt 0.261538 0.150943
vt 0.338462 0.075472 vt 0.261538 0.075472
vt 0.030769 0.056604 vt 0.030769 0.056604
vt 0.338462 0.056604 vt 0.261538 0.056604
vt 0.338462 0.018868 vt 0.261538 0.018868
vt 0.030769 -0.000000 vt 0.030769 -0.000000
vt 0.338462 -0.000000 vt 0.261538 -0.000000
vt 0.338462 0.188679 vt 0.261538 0.188679
vt 0.030769 0.169811 vt 0.030769 0.169811
vt 0.338462 0.094340 vt 0.261538 0.094340
vt 0.030769 0.075472 vt 0.030769 0.075472
vt 0.338462 0.132075 vt 0.261538 0.132075
vt 0.030769 0.113208 vt 0.030769 0.113208
vt 0.338462 0.113208 vt 0.261538 0.113208
vt 0.338462 0.037736 vt 0.261538 0.037736
vt 0.030769 0.018868 vt 0.030769 0.018868
vt 0.338462 0.207547 vt 0.261538 0.207547
vt 0.030769 0.188679 vt 0.030769 0.188679
vt 0.030769 0.094340 vt 0.030769 0.094340
vt 0.030769 0.132075 vt 0.030769 0.132075
vt 0.030769 0.037736 vt 0.030769 0.037736
vt 0.338462 0.226415 vt 0.261538 0.226415
vt 0.030769 0.207547 vt 0.030769 0.207547
vt 0.030769 0.415094 vt 0.030769 0.415094
vt 0.338462 0.433962 vt 0.261538 0.433962
vt 0.030769 0.433962 vt 0.030769 0.433962
vt 0.030769 0.320755 vt 0.030769 0.320755
vt 0.338462 0.339623 vt 0.261538 0.339623
vt 0.030769 0.339623 vt 0.030769 0.339623
vt 0.030769 0.358491 vt 0.030769 0.358491
vt 0.338462 0.377358 vt 0.261538 0.377358
vt 0.030769 0.377358 vt 0.030769 0.377358
vt 0.030769 0.264151 vt 0.030769 0.264151
vt 0.338462 0.283019 vt 0.261538 0.283019
vt 0.030769 0.283019 vt 0.030769 0.283019
vt 0.338462 0.452830 vt 0.261538 0.452830
vt 0.030769 0.452830 vt 0.030769 0.452830
vt 0.338462 0.396226 vt 0.261538 0.396226
vt 0.030769 0.396226 vt 0.030769 0.396226
vt 0.338462 0.301887 vt 0.261538 0.301887
vt 0.030769 0.301887 vt 0.030769 0.301887
vt 0.030769 0.226415 vt 0.030769 0.226415
vt 0.338462 0.245283 vt 0.261538 0.245283
vt 0.030769 0.245283 vt 0.030769 0.245283
vt 0.338462 0.415094 vt 0.261538 0.415094
vt 0.338462 0.320755 vt 0.261538 0.320755
vt 0.338462 0.358491 vt 0.261538 0.358491
vt 0.338462 0.264151 vt 0.261538 0.264151
vt 0.030769 0.226415 vt 0.030769 0.226415
vt 0.338462 0.226415 vt 0.261538 0.226415
vn 0.0000 0.0000 1.0000 vn 0.0000 0.0000 1.0000
vn -1.0000 0.0000 0.0000 vn -1.0000 0.0000 0.0000
vn -0.8660 0.5000 0.0000 vn -0.8660 0.5000 0.0000

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB