添加重 木几 木仓 伤害的配置文件

This commit is contained in:
Atsuihsio 2025-03-11 03:31:51 +08:00
parent dc84d8d3b4
commit 1df4291026
3 changed files with 20 additions and 7 deletions

View file

@ -35,6 +35,8 @@ public class VehicleConfig {
public static ForgeConfigSpec.IntValue MLE1934_HE_EXPLOSION_DAMAGE; public static ForgeConfigSpec.IntValue MLE1934_HE_EXPLOSION_DAMAGE;
public static ForgeConfigSpec.IntValue MLE1934_HE_EXPLOSION_RADIUS; public static ForgeConfigSpec.IntValue MLE1934_HE_EXPLOSION_RADIUS;
public static ForgeConfigSpec.IntValue HEAVY_MACHINE_GUN_DAMAGE;
public static ForgeConfigSpec.IntValue ANNIHILATOR_HP; public static ForgeConfigSpec.IntValue ANNIHILATOR_HP;
public static ForgeConfigSpec.IntValue ANNIHILATOR_SHOOT_COST; public static ForgeConfigSpec.IntValue ANNIHILATOR_SHOOT_COST;
public static ForgeConfigSpec.IntValue ANNIHILATOR_MAX_ENERGY; public static ForgeConfigSpec.IntValue ANNIHILATOR_MAX_ENERGY;
@ -42,7 +44,6 @@ public class VehicleConfig {
public static ForgeConfigSpec.IntValue SPEEDBOAT_HP; public static ForgeConfigSpec.IntValue SPEEDBOAT_HP;
public static ForgeConfigSpec.IntValue SPEEDBOAT_ENERGY_COST; public static ForgeConfigSpec.IntValue SPEEDBOAT_ENERGY_COST;
public static ForgeConfigSpec.IntValue SPEEDBOAT_MAX_ENERGY; public static ForgeConfigSpec.IntValue SPEEDBOAT_MAX_ENERGY;
public static ForgeConfigSpec.IntValue SPEEDBOAT_GUN_DAMAGE;
public static ForgeConfigSpec.IntValue AH_6_HP; public static ForgeConfigSpec.IntValue AH_6_HP;
public static ForgeConfigSpec.IntValue AH_6_MIN_ENERGY_COST; public static ForgeConfigSpec.IntValue AH_6_MIN_ENERGY_COST;
@ -150,6 +151,13 @@ public class VehicleConfig {
builder.pop(); builder.pop();
builder.push("HeavyMachineGun");
builder.comment("The gun damage of 12.7mm HMG");
HEAVY_MACHINE_GUN_DAMAGE = builder.defineInRange("heavy_machine_gun_damage", 25, 1, 10000000);
builder.pop();
builder.push("annihilator"); builder.push("annihilator");
builder.comment("The HealthPoint of Annihilator"); builder.comment("The HealthPoint of Annihilator");
@ -174,9 +182,6 @@ public class VehicleConfig {
builder.comment("The max energy storage of Speedboat"); builder.comment("The max energy storage of Speedboat");
SPEEDBOAT_MAX_ENERGY = builder.defineInRange("speedboat_max_energy", 1000000, 0, 2147483647); SPEEDBOAT_MAX_ENERGY = builder.defineInRange("speedboat_max_energy", 1000000, 0, 2147483647);
builder.comment("The gun damage of Speedboat");
SPEEDBOAT_GUN_DAMAGE = builder.defineInRange("speedboat_gun_damage", 25, 1, 10000000);
builder.pop(); builder.pop();
builder.push("ah_6"); builder.push("ah_6");

View file

@ -90,7 +90,7 @@ public class SpeedboatEntity extends ContainerMobileVehicleEntity implements Geo
return new VehicleWeapon[][]{ return new VehicleWeapon[][]{
new VehicleWeapon[]{ new VehicleWeapon[]{
new ProjectileWeapon() new ProjectileWeapon()
.damage(VehicleConfig.SPEEDBOAT_GUN_DAMAGE.get()) .damage(VehicleConfig.HEAVY_MACHINE_GUN_DAMAGE.get())
.headShot(2) .headShot(2)
.zoom(false) .zoom(false)
.icon(ModUtils.loc("textures/screens/vehicle_weapon/gun_12_7mm.png")) .icon(ModUtils.loc("textures/screens/vehicle_weapon/gun_12_7mm.png"))

View file

@ -14,11 +14,13 @@ import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.network.message.ShakeClientMessage; import com.atsuishio.superbwarfare.network.message.ShakeClientMessage;
import com.atsuishio.superbwarfare.tools.*; import com.atsuishio.superbwarfare.tools.*;
import com.mojang.math.Axis; import com.mojang.math.Axis;
import net.minecraft.ChatFormatting;
import net.minecraft.client.CameraType; import net.minecraft.client.CameraType;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleTypes; import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.network.protocol.Packet; import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.network.protocol.game.ClientGamePacketListener;
import net.minecraft.network.protocol.game.ClientboundStopSoundPacket; import net.minecraft.network.protocol.game.ClientboundStopSoundPacket;
@ -77,6 +79,7 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
public static final float MAX_HEALTH = 500; public static final float MAX_HEALTH = 500;
public static final int MAX_ENERGY = 5000000; public static final int MAX_ENERGY = 5000000;
public static final int SHOOT_COST = 10000;
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
public float turretYRot; public float turretYRot;
@ -140,7 +143,7 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
new VehicleWeapon[]{ new VehicleWeapon[]{
// 机枪 // 机枪
new ProjectileWeapon() new ProjectileWeapon()
.damage(VehicleConfig.SPEEDBOAT_GUN_DAMAGE.get()) .damage(VehicleConfig.HEAVY_MACHINE_GUN_DAMAGE.get())
.headShot(2) .headShot(2)
.zoom(false) .zoom(false)
.bypassArmorRate(0.4f) .bypassArmorRate(0.4f)
@ -355,8 +358,13 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
@Override @Override
public void vehicleShoot(Player player, int type) { public void vehicleShoot(Player player, int type) {
if (reloadCoolDown == 0 && type == 0) { if (reloadCoolDown == 0 && type == 0) {
Matrix4f transform = getBarrelTransform();
if (!this.canConsume(SHOOT_COST)) {
player.displayClientMessage(Component.translatable("tips.superbwarfare.annihilator.energy_not_enough").withStyle(ChatFormatting.RED), true);
return;
}
Matrix4f transform = getBarrelTransform();
Vector4f worldPosition = transformPosition(transform, 0, 0, 0); Vector4f worldPosition = transformPosition(transform, 0, 0, 0);
var cannonShell = (CannonShellWeapon) getWeapon(0); var cannonShell = (CannonShellWeapon) getWeapon(0);