diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmallCannonShellEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmallCannonShellEntity.java index e3a0e72e7..7b44b5e1a 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmallCannonShellEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmallCannonShellEntity.java @@ -60,6 +60,9 @@ public class SmallCannonShellEntity extends FastThrowableProjectile implements G this.explosionDamage = explosionDamage; this.explosionRadius = explosionRadius; this.aa = aa; + if (aa) { + crushProjectile(getDeltaMovement()); + } } public SmallCannonShellEntity setBlockInteraction(Explosion.BlockInteraction blockInteraction) { diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Hpj11Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Hpj11Entity.java index 97be13d73..54e66b5cd 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Hpj11Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Hpj11Entity.java @@ -33,7 +33,6 @@ import net.minecraft.world.entity.projectile.Projectile; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Explosion; import net.minecraft.world.level.Level; -import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.Vec2; import net.minecraft.world.phys.Vec3; import net.neoforged.api.distmarker.Dist; @@ -49,7 +48,6 @@ import software.bernie.geckolib.animatable.instance.AnimatableInstanceCache; import software.bernie.geckolib.animation.AnimatableManager; import software.bernie.geckolib.util.GeckoLibUtil; -import java.util.Comparator; import java.util.Optional; import java.util.UUID; import java.util.function.Consumer; @@ -301,7 +299,7 @@ public class Hpj11Entity extends ContainerMobileVehicleEntity implements GeoEnti Vec3 targetPos = target.getBoundingBox().getCenter(); Vec3 targetVel = target.getDeltaMovement(); - Vec3 targetVec = RangeTool.calculateFiringSolution(barrelRootPos, targetPos, targetVel, 30, 0.03); + Vec3 targetVec = RangeTool.calculateFiringSolution(barrelRootPos, targetPos, targetVel, 20, 0.03); double d0 = targetVec.x; double d1 = targetVec.y; @@ -319,7 +317,6 @@ public class Hpj11Entity extends ContainerMobileVehicleEntity implements GeoEnti if (target.distanceTo(this) <= 144 && VectorTool.calculateAngle(getViewVector(1), targetVec) < 10) { if (checkNoClip(this, target, barrelRootPos) && entityData.get(AMMO) > 0) { vehicleShoot(player, 0); - findEntityOnPath(barrelRootPos, targetVec, 0.3); } else { changeTargetTimer++; } @@ -356,34 +353,6 @@ public class Hpj11Entity extends ContainerMobileVehicleEntity implements GeoEnti return !projectile.getOwner().isAlliedTo(this.getOwner()) || (projectile.getOwner().getTeam() != null && projectile.getOwner().getTeam().getName().equals("TDM")); } - public void findEntityOnPath(Vec3 pos, Vec3 toVec, double size) { - for (Entity target : level().getEntitiesOfClass(Entity.class, new AABB(pos, pos).inflate(0.125).expandTowards(toVec.scale(30)), e -> true).stream().sorted(Comparator.comparingDouble(e -> e.distanceToSqr(pos))).toList()) { - var condition = target instanceof Projectile && isThreateningEntity(this, target, size, pos) && smokeFilter(target); - if (condition) { - causeAirExplode(target.position()); - target.discard(); - } - } - } - - private void causeAirExplode(Vec3 vec3) { - CustomExplosion explosion = new CustomExplosion(this.level(), this, - ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), - this, - this.getOwner()), - VehicleConfig.HPJ11_EXPLOSION_DAMAGE.get().floatValue(), - vec3.x, - vec3.y, - vec3.z, - VehicleConfig.HPJ11_EXPLOSION_RADIUS.get().floatValue(), - ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP). - setDamageMultiplier(1.25f); - explosion.explode(); - EventHooks.onExplosionStart(this.level(), explosion); - explosion.finalizeExplosion(false); - ParticleTool.spawnMediumExplosionParticles(this.level(), vec3); - } - public float getGunRot() { return this.gunRot; } @@ -479,7 +448,7 @@ public class Hpj11Entity extends ContainerMobileVehicleEntity implements GeoEnti Vector4f worldPosition = transformPosition(transform, 0f, 0.4f, 0); entityToSpawn.setPos(worldPosition.x, worldPosition.y, worldPosition.z); - entityToSpawn.shoot(getLookAngle().x, getLookAngle().y, getLookAngle().z, 30, 0.75f); + entityToSpawn.shoot(getLookAngle().x, getLookAngle().y, getLookAngle().z, 20, 0.25f); level().addFreshEntity(entityToSpawn); this.entityData.set(GUN_ROTATE, entityData.get(GUN_ROTATE) + 0.5f); diff --git a/src/main/resources/data/superbwarfare/vehicles/a_10a.json b/src/main/resources/data/superbwarfare/vehicles/a_10a.json index c6da75f3f..369bc0f89 100644 --- a/src/main/resources/data/superbwarfare/vehicles/a_10a.json +++ b/src/main/resources/data/superbwarfare/vehicles/a_10a.json @@ -91,6 +91,10 @@ "Value": 1.5, "Source": "@superbwarfare:gun_grenade" }, + { + "Type": "Multiply", + "Value": 0.75 + }, { "Type": "Reduce", "Value": 7 diff --git a/src/main/resources/data/superbwarfare/vehicles/ah_6.json b/src/main/resources/data/superbwarfare/vehicles/ah_6.json index ac144bff6..144e3579b 100644 --- a/src/main/resources/data/superbwarfare/vehicles/ah_6.json +++ b/src/main/resources/data/superbwarfare/vehicles/ah_6.json @@ -96,6 +96,10 @@ "Value": 3, "Source": "@superbwarfare:mortar_shell" }, + { + "Type": "Multiply", + "Value": 0.8 + }, { "Type": "Reduce", "Value": 2 diff --git a/src/main/resources/data/superbwarfare/vehicles/prism_tank.json b/src/main/resources/data/superbwarfare/vehicles/prism_tank.json index ea46cda86..1d421a5b9 100644 --- a/src/main/resources/data/superbwarfare/vehicles/prism_tank.json +++ b/src/main/resources/data/superbwarfare/vehicles/prism_tank.json @@ -7,7 +7,7 @@ "DamageModifiers": [ { "Type": "Multiply", - "Value": 0.2 + "Value": 0.17 }, { "Type": "Multiply",