调整舰炮的装甲和穿甲机制
This commit is contained in:
parent
830714878c
commit
3645f34051
5 changed files with 22 additions and 10 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -10,5 +10,5 @@
|
|||
"projectile_amount": 1,
|
||||
"BypassesArmor": 0.3,
|
||||
"SoundRadius": 14,
|
||||
"rpm": 1200
|
||||
"rpm": 2400
|
||||
}
|
Loading…
Add table
Reference in a new issue