添加爆炸屏幕抖动强度设置
This commit is contained in:
parent
8e278bf3cd
commit
bb502af25e
6 changed files with 45 additions and 18 deletions
|
@ -58,5 +58,21 @@ public class DisplayClothConfig {
|
||||||
.setTooltip(Component.translatable("config.superbwarfare.client.display.stamina_hud.des"))
|
.setTooltip(Component.translatable("config.superbwarfare.client.display.stamina_hud.des"))
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
category.addEntry(entryBuilder
|
||||||
|
.startIntSlider(Component.translatable("config.superbwarfare.client.display.weapon_screen_shake"), DisplayConfig.WEAPON_SCREEN_SHAKE.get(),
|
||||||
|
0, 100)
|
||||||
|
.setDefaultValue(100)
|
||||||
|
.setSaveConsumer(DisplayConfig.WEAPON_SCREEN_SHAKE::set)
|
||||||
|
.setTooltip(Component.translatable("config.superbwarfare.client.display.weapon_screen_shake.des"))
|
||||||
|
.build());
|
||||||
|
|
||||||
|
category.addEntry(entryBuilder
|
||||||
|
.startIntSlider(Component.translatable("config.superbwarfare.client.display.explosion_screen_shake"), DisplayConfig.EXPLOSION_SCREEN_SHAKE.get(),
|
||||||
|
0, 100)
|
||||||
|
.setDefaultValue(100)
|
||||||
|
.setSaveConsumer(DisplayConfig.EXPLOSION_SCREEN_SHAKE::set)
|
||||||
|
.setTooltip(Component.translatable("config.superbwarfare.client.display.explosion_screen_shake.des"))
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,8 @@ public class DisplayConfig {
|
||||||
public static ModConfigSpec.BooleanValue CAMERA_ROTATE;
|
public static ModConfigSpec.BooleanValue CAMERA_ROTATE;
|
||||||
public static ModConfigSpec.BooleanValue ARMOR_PLATE_HUD;
|
public static ModConfigSpec.BooleanValue ARMOR_PLATE_HUD;
|
||||||
public static ModConfigSpec.BooleanValue STAMINA_HUD;
|
public static ModConfigSpec.BooleanValue STAMINA_HUD;
|
||||||
|
public static ModConfigSpec.IntValue WEAPON_SCREEN_SHAKE;
|
||||||
|
public static ModConfigSpec.IntValue EXPLOSION_SCREEN_SHAKE;
|
||||||
|
|
||||||
public static void init(ModConfigSpec.Builder builder) {
|
public static void init(ModConfigSpec.Builder builder) {
|
||||||
builder.push("display");
|
builder.push("display");
|
||||||
|
@ -32,6 +34,12 @@ public class DisplayConfig {
|
||||||
builder.comment("Set true to enable stamina hud");
|
builder.comment("Set true to enable stamina hud");
|
||||||
STAMINA_HUD = builder.define("stamina_hud", true);
|
STAMINA_HUD = builder.define("stamina_hud", true);
|
||||||
|
|
||||||
|
builder.comment("The strength of screen shaking while firing with a weapon");
|
||||||
|
WEAPON_SCREEN_SHAKE = builder.defineInRange("weapon_screen_shake", 100, 0, 100);
|
||||||
|
|
||||||
|
builder.comment("The strength of screen shaking while exploding");
|
||||||
|
EXPLOSION_SCREEN_SHAKE = builder.defineInRange("explosion_screen_shake", 100, 0, 100);
|
||||||
|
|
||||||
builder.pop();
|
builder.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -216,20 +216,12 @@ public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity,
|
||||||
.multiply(0.3f, ModDamageTypes.CANNON_FIRE)
|
.multiply(0.3f, ModDamageTypes.CANNON_FIRE)
|
||||||
.multiply(0.04f, ModTags.DamageTypes.PROJECTILE_ABSOLUTE)
|
.multiply(0.04f, ModTags.DamageTypes.PROJECTILE_ABSOLUTE)
|
||||||
.custom((source, damage) -> getSourceAngle(source, 3) * damage)
|
.custom((source, damage) -> getSourceAngle(source, 3) * damage)
|
||||||
.custom((source, damage) -> {
|
.custom((source, damage) -> switch (source.getDirectEntity()) {
|
||||||
if (source.getDirectEntity() instanceof C4Entity) {
|
case C4Entity ignored -> 10f * damage;
|
||||||
return 10f * damage;
|
case MelonBombEntity ignored -> 8f * damage;
|
||||||
}
|
case GunGrenadeEntity ignored -> 3f * damage;
|
||||||
if (source.getDirectEntity() instanceof MelonBombEntity) {
|
case CannonShellEntity ignored -> 3f * damage;
|
||||||
return 8f * damage;
|
case null, default -> damage;
|
||||||
}
|
|
||||||
if (source.getDirectEntity() instanceof GunGrenadeEntity) {
|
|
||||||
return 3f * damage;
|
|
||||||
}
|
|
||||||
if (source.getDirectEntity() instanceof CannonShellEntity) {
|
|
||||||
return 3f * damage;
|
|
||||||
}
|
|
||||||
return damage;
|
|
||||||
})
|
})
|
||||||
.reduce(12);
|
.reduce(12);
|
||||||
}
|
}
|
||||||
|
|
|
@ -735,12 +735,15 @@ public class ClientEventHandler {
|
||||||
public static void handleShakeClient(double time, double radius, double amplitude, double x, double y, double z) {
|
public static void handleShakeClient(double time, double radius, double amplitude, double x, double y, double z) {
|
||||||
Player player = Minecraft.getInstance().player;
|
Player player = Minecraft.getInstance().player;
|
||||||
if (player == null) return;
|
if (player == null) return;
|
||||||
|
double shakeStrength = DisplayConfig.EXPLOSION_SCREEN_SHAKE.get() / 100.0;
|
||||||
|
if (shakeStrength <= 0.0) return;
|
||||||
|
|
||||||
shakeTime = time;
|
shakeTime = time;
|
||||||
shakeRadius = radius;
|
shakeRadius = radius;
|
||||||
shakeAmplitude = amplitude * Mth.DEG_TO_RAD;
|
shakeAmplitude = amplitude * Mth.DEG_TO_RAD * shakeStrength;
|
||||||
shakePos[0] = x;
|
shakePos[0] = x * shakeStrength;
|
||||||
shakePos[1] = y;
|
shakePos[1] = y * shakeStrength;
|
||||||
shakePos[2] = z;
|
shakePos[2] = z * shakeStrength;
|
||||||
shakeType = 2 * (Math.random() - 0.5);
|
shakeType = 2 * (Math.random() - 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -543,6 +543,10 @@
|
||||||
"config.superbwarfare.client.display.armor_plate_hud.des": "Display the durability of the bulletproof insert currently equipped on the chest armor in the lower left corner when turned on",
|
"config.superbwarfare.client.display.armor_plate_hud.des": "Display the durability of the bulletproof insert currently equipped on the chest armor in the lower left corner when turned on",
|
||||||
"config.superbwarfare.client.display.stamina_hud": "Stamina HUD",
|
"config.superbwarfare.client.display.stamina_hud": "Stamina HUD",
|
||||||
"config.superbwarfare.client.display.stamina_hud.des": "Display Stamina HUD when tactical sprinting or holding breath",
|
"config.superbwarfare.client.display.stamina_hud.des": "Display Stamina HUD when tactical sprinting or holding breath",
|
||||||
|
"config.superbwarfare.client.display.weapon_screen_shake": "Weapon Screen Shake Strength",
|
||||||
|
"config.superbwarfare.client.display.weapon_screen_shake.des": "The strength of the screen shake caused by weapons",
|
||||||
|
"config.superbwarfare.client.display.explosion_screen_shake": "Explosion Screen Shake Strength",
|
||||||
|
"config.superbwarfare.client.display.explosion_screen_shake.des": "The strength of the screen shake caused by explosions",
|
||||||
"config.superbwarfare.client.vehicle": "Control Vehicle",
|
"config.superbwarfare.client.vehicle": "Control Vehicle",
|
||||||
"config.superbwarfare.client.vehicle.invert_aircraft_control": "Invert Aircraft Control",
|
"config.superbwarfare.client.vehicle.invert_aircraft_control": "Invert Aircraft Control",
|
||||||
"config.superbwarfare.client.vehicle.left_click_reload.des": "Set TRUE to invert aircraft control",
|
"config.superbwarfare.client.vehicle.left_click_reload.des": "Set TRUE to invert aircraft control",
|
||||||
|
|
|
@ -544,6 +544,10 @@
|
||||||
"config.superbwarfare.client.display.armor_plate_hud.des": "开启时,在左下角显示当前装备在胸甲上的防弹插板的耐久度",
|
"config.superbwarfare.client.display.armor_plate_hud.des": "开启时,在左下角显示当前装备在胸甲上的防弹插板的耐久度",
|
||||||
"config.superbwarfare.client.display.stamina_hud": "耐力信息",
|
"config.superbwarfare.client.display.stamina_hud": "耐力信息",
|
||||||
"config.superbwarfare.client.display.stamina_hud.des": "在战术冲刺或屏息时,显示耐力条",
|
"config.superbwarfare.client.display.stamina_hud.des": "在战术冲刺或屏息时,显示耐力条",
|
||||||
|
"config.superbwarfare.client.display.weapon_screen_shake": "武器屏幕抖动",
|
||||||
|
"config.superbwarfare.client.display.weapon_screen_shake.des": "武器开火时,屏幕抖动的强度",
|
||||||
|
"config.superbwarfare.client.display.explosion_screen_shake": "爆炸屏幕抖动",
|
||||||
|
"config.superbwarfare.client.display.explosion_screen_shake.des": "爆炸时,屏幕抖动的强度",
|
||||||
"config.superbwarfare.client.vehicle": "载具控制",
|
"config.superbwarfare.client.vehicle": "载具控制",
|
||||||
"config.superbwarfare.client.vehicle.invert_aircraft_control": "飞行器鼠标反转",
|
"config.superbwarfare.client.vehicle.invert_aircraft_control": "飞行器鼠标反转",
|
||||||
"config.superbwarfare.client.vehicle.left_click_reload.des": "开启飞行器鼠标反转",
|
"config.superbwarfare.client.vehicle.left_click_reload.des": "开启飞行器鼠标反转",
|
||||||
|
|
Loading…
Add table
Reference in a new issue