diff --git a/src/main/java/com/atsuishio/superbwarfare/config/server/ExplosionConfig.java b/src/main/java/com/atsuishio/superbwarfare/config/server/ExplosionConfig.java index 588b526cf..3227dfaad 100644 --- a/src/main/java/com/atsuishio/superbwarfare/config/server/ExplosionConfig.java +++ b/src/main/java/com/atsuishio/superbwarfare/config/server/ExplosionConfig.java @@ -16,11 +16,8 @@ public class ExplosionConfig { public static ModConfigSpec.IntValue MORTAR_SHELL_EXPLOSION_DAMAGE; public static ModConfigSpec.IntValue MORTAR_SHELL_EXPLOSION_RADIUS; - public static ModConfigSpec.IntValue DRONE_KAMIKAZE_HIT_DAMAGE; public static ModConfigSpec.IntValue DRONE_KAMIKAZE_EXPLOSION_DAMAGE; public static ModConfigSpec.IntValue DRONE_KAMIKAZE_EXPLOSION_RADIUS; - public static ModConfigSpec.IntValue DRONE_KAMIKAZE_HIT_DAMAGE_C4; - public static ModConfigSpec.IntValue DRONE_KAMIKAZE_HIT_DAMAGE_RPG; public static ModConfigSpec.IntValue C4_EXPLOSION_COUNTDOWN; public static ModConfigSpec.IntValue C4_EXPLOSION_DAMAGE; @@ -32,7 +29,7 @@ public class ExplosionConfig { public static ModConfigSpec.IntValue WIRE_GUIDE_MISSILE_DAMAGE; public static ModConfigSpec.IntValue WIRE_GUIDE_MISSILE_EXPLOSION_DAMAGE; public static ModConfigSpec.IntValue WIRE_GUIDE_MISSILE_EXPLOSION_RADIUS; - + public static ModConfigSpec.IntValue AGM_65_DAMAGE; public static ModConfigSpec.IntValue AGM_65_EXPLOSION_DAMAGE; public static ModConfigSpec.DoubleValue AGM_65_EXPLOSION_RADIUS; @@ -83,22 +80,12 @@ public class ExplosionConfig { builder.push("Drone Kamikaze"); - builder.comment("The hit damage of Drone Kamikaze"); - DRONE_KAMIKAZE_HIT_DAMAGE = builder.defineInRange("drone_kamikaze_hit_damage", 200, 1, 10000000); - - builder.comment("The hit damage of Drone Kamikaze with C4"); - DRONE_KAMIKAZE_HIT_DAMAGE_C4 = builder.defineInRange("drone_kamikaze_hit_damage_c4", 150, 1, 10000000); - - builder.comment("The hit damage of Drone Kamikaze with RPG"); - DRONE_KAMIKAZE_HIT_DAMAGE_RPG = builder.defineInRange("drone_kamikaze_hit_damage_rpg", 270, 1, 10000000); - builder.comment("The explosion damage of Drone Kamikaze"); DRONE_KAMIKAZE_EXPLOSION_DAMAGE = builder.defineInRange("drone_kamikaze_explosion_damage", 160, 1, 10000000); builder.comment("The explosion radius of Drone Kamikaze"); DRONE_KAMIKAZE_EXPLOSION_RADIUS = builder.defineInRange("drone_kamikaze_explosion_radius", 9, 1, 50); - builder.pop(); builder.push("C4"); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/DroneEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/DroneEntity.java index 415409e20..7f7e0f727 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/DroneEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/DroneEntity.java @@ -501,7 +501,6 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity { public void hitEntityCrash(Player player, Entity target) { if (lastTickSpeed > 0.12) { - var attachedEntity = this.entityData.get(ATTACHED_ENTITY); if (!attachedEntity.isEmpty() && 20 * lastTickSpeed > this.getHealth()) { var data = CustomData.DRONE_ATTACHMENT.values().stream().filter(d -> attachedEntity.equals(d.entityID)) @@ -515,27 +514,9 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity { target.invulnerableTime = 0; }); } else { - // TODO 非神风模式? + target.hurt(ModDamageTypes.causeDroneHitDamage(this.level().registryAccess(), this, player), (float) (5 * lastTickSpeed)); } } - } - - // TODO 清理这一坨 - if (this.entityData.get(KAMIKAZE_MODE) != 0 && 20 * lastTickSpeed > this.getHealth()) { - if (this.entityData.get(KAMIKAZE_MODE) == 1) { - var mortarShell = new MortarShellEntity(player, this.level()); - target.hurt(ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), mortarShell, player), ExplosionConfig.DRONE_KAMIKAZE_HIT_DAMAGE.get()); - target.invulnerableTime = 0; - } -// } else if (this.entityData.get(KAMIKAZE_MODE) == 2) { -// var c4 = new C4Entity(player, this.level()); -// target.hurt(ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), c4, player), ExplosionConfig.DRONE_KAMIKAZE_HIT_DAMAGE_C4.get()); -// target.invulnerableTime = 0; -// else if (this.entityData.get(KAMIKAZE_MODE) == 3) { -// var rpg = new RpgRocketEntity(player, this.level()); -// target.hurt(ModDamageTypes.causeCannonFireDamage(this.level().registryAccess(), rpg, player), ExplosionConfig.DRONE_KAMIKAZE_HIT_DAMAGE_RPG.get()); -// target.invulnerableTime = 0; -// } if (player != null && player.getMainHandItem().is(ModItems.MONITOR.get())) { var stack = player.getMainHandItem(); @@ -544,8 +525,6 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity { NBTTool.saveTag(stack, tag); } } - target.hurt(ModDamageTypes.causeDroneHitDamage(this.level().registryAccess(), this, player), (float) (5 * lastTickSpeed)); - this.hurt(new DamageSource(level().registryAccess().registryOrThrow(Registries.DAMAGE_TYPE).getHolderOrThrow(DamageTypes.EXPLOSION), Objects.requireNonNullElse(player, this)), (float) (((this.entityData.get(KAMIKAZE_MODE) != 0) ? 20 : 4) * lastTickSpeed)); } }