调整舰炮的装甲和穿甲机制

This commit is contained in:
Atsuihsio 2024-11-08 15:40:44 +08:00
parent 830714878c
commit 3645f34051
5 changed files with 22 additions and 10 deletions

View file

@ -134,12 +134,18 @@ public class Mk42Entity extends Entity implements GeoEntity, ICannonEntity {
if (source.is(ModDamageTypes.PROJECTILE_BOOM)) {
amount *= 0.25f;
}
if (amount < 32) {
if (source.is(ModDamageTypes.CANNON_FIRE)) {
amount *= 1.4f;
}
if (source.is(ModDamageTypes.GUN_FIRE_ABSOLUTE)) {
amount *= 1.6f;
}
if (amount < 3) {
return false;
}
this.level().playSound(null, this.getOnPos(), ModSounds.HIT.get(), SoundSource.PLAYERS, 1, 1);
this.entityData.set(HEALTH, this.entityData.get(HEALTH) - 0.5f * amount);
this.entityData.set(HEALTH, this.entityData.get(HEALTH) - 0.5f * (amount - 5));
return true;
}

View file

@ -140,12 +140,18 @@ public class Mle1934Entity extends Entity implements GeoEntity, ICannonEntity {
if (source.is(ModDamageTypes.PROJECTILE_BOOM)) {
amount *= 0.25f;
}
if (amount < 32) {
if (source.is(ModDamageTypes.CANNON_FIRE)) {
amount *= 1.4f;
}
if (source.is(ModDamageTypes.GUN_FIRE_ABSOLUTE)) {
amount *= 1.6f;
}
if (amount < 3) {
return false;
}
this.level().playSound(null, this.getOnPos(), ModSounds.HIT.get(), SoundSource.PLAYERS, 1, 1);
this.entityData.set(HEALTH, this.entityData.get(HEALTH) - 0.5f * amount);
this.entityData.set(HEALTH, this.entityData.get(HEALTH) - 0.5f * (amount - 5));
return true;
}

View file

@ -155,11 +155,11 @@ public class MinigunItem extends GunItem implements GeoItem, AnimatedItem {
double cooldown = 0;
if (entity.wasInPowderSnow) {
cooldown = 0.75;
cooldown = 0.15;
} else if (entity.isInWaterOrRain()) {
cooldown = 0.2;
cooldown = 0.04;
} else if (entity.isOnFire() || entity.isInLava()) {
cooldown = -0.5;
cooldown = -0.1;
}
if (entity instanceof ServerPlayer serverPlayer && entity.level() instanceof ServerLevel serverLevel && itemstack.getOrCreateTag().getDouble("heat") > 4 && entity.isInWaterOrRain()) {
@ -177,7 +177,7 @@ public class MinigunItem extends GunItem implements GeoItem, AnimatedItem {
1, 0.1, 0.1, 0.1, 0.002, true, serverPlayer);
}
itemstack.getOrCreateTag().putDouble("heat", Mth.clamp(itemstack.getOrCreateTag().getDouble("heat") - 0.25 - cooldown, 0, 55));
itemstack.getOrCreateTag().putDouble("heat", Mth.clamp(itemstack.getOrCreateTag().getDouble("heat") - 0.05 - cooldown, 0, 55));
if (itemstack.getOrCreateTag().getDouble("overheat") > 0) {
itemstack.getOrCreateTag().putDouble("overheat", (itemstack.getOrCreateTag().getDouble("overheat") - 1));

View file

@ -116,7 +116,7 @@ public class ShootMessage {
if ((player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables())).rifleAmmo > 0
|| player.getInventory().hasAnyMatching(s -> s.is(ModItems.CREATIVE_AMMO_BOX.get()))) {
tag.putDouble("heat", (tag.getDouble("heat") + 0.5));
tag.putDouble("heat", (tag.getDouble("heat") + 0.1));
if (tag.getDouble("heat") >= 50.5) {
tag.putDouble("overheat", 40);
player.getCooldowns().addCooldown(stack.getItem(), 40);

View file

@ -10,5 +10,5 @@
"projectile_amount": 1,
"BypassesArmor": 0.3,
"SoundRadius": 14,
"rpm": 1200
"rpm": 2400
}