diff --git a/src/main/java/com/atsuishio/superbwarfare/config/server/VehicleConfig.java b/src/main/java/com/atsuishio/superbwarfare/config/server/VehicleConfig.java index e61ed38ec..d25fe2ce6 100644 --- a/src/main/java/com/atsuishio/superbwarfare/config/server/VehicleConfig.java +++ b/src/main/java/com/atsuishio/superbwarfare/config/server/VehicleConfig.java @@ -40,6 +40,7 @@ public class VehicleConfig { public static ForgeConfigSpec.IntValue ANNIHILATOR_MAX_ENERGY; public static ForgeConfigSpec.IntValue LASER_TOWER_HP; + public static ForgeConfigSpec.IntValue LASER_TOWER_COOLDOWN; public static ForgeConfigSpec.IntValue LASER_TOWER_DAMAGE; public static ForgeConfigSpec.IntValue LASER_TOWER_SHOOT_COST; public static ForgeConfigSpec.IntValue LASER_TOWER_MAX_ENERGY; @@ -198,6 +199,9 @@ public class VehicleConfig { builder.comment("The damage of Laser Tower"); LASER_TOWER_DAMAGE = builder.defineInRange("laser_tower_damage", 15, 1, 10000000); + builder.comment("The cooldown time(ticks) of Laser Tower"); + LASER_TOWER_COOLDOWN = builder.defineInRange("laser_tower_cooldown", 40, 15, 10000000); + builder.comment("The energy cost of Laser Tower per shoot"); LASER_TOWER_SHOOT_COST = builder.defineInRange("laser_tower_shoot_cost", 5000, 0, 2147483647); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/LaserTowerEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/LaserTowerEntity.java index 96f439977..75b9e3b77 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/LaserTowerEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/LaserTowerEntity.java @@ -251,7 +251,7 @@ public class LaserTowerEntity extends EnergyVehicleEntity implements GeoEntity, } public void autoAim() { - if (this.getEnergy() <= 0 || !entityData.get(ACTIVE) || this.entityData.get(COOL_DOWN) > 30) { + if (this.getEnergy() <= 0 || !entityData.get(ACTIVE)) { return; } @@ -296,8 +296,7 @@ public class LaserTowerEntity extends EnergyVehicleEntity implements GeoEntity, } if (this.entityData.get(COOL_DOWN) == 0 && VectorTool.calculateAngle(getViewVector(1), targetVec) < 1 && checkNoClip(target)) { - - this.entityData.set(COOL_DOWN, 40); + this.entityData.set(COOL_DOWN, VehicleConfig.LASER_TOWER_COOLDOWN.get()); if (level() instanceof ServerLevel serverLevel) { this.level().playSound(this, getOnPos(), ModSounds.LASER_TOWER_SHOOT.get(), SoundSource.PLAYERS, 2, random.nextFloat() * 0.1f + 1);