From f1bd07a25f6fb9efb229b873a255628dbbd719bb Mon Sep 17 00:00:00 2001 From: Atsuihsio <842960157@qq.com> Date: Mon, 19 Aug 2024 21:00:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BB=B6=E9=95=BF=E6=88=98=E6=9C=AF=E5=86=B2?= =?UTF-8?q?=E5=88=BA=E6=8C=81=E7=BB=AD=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../event/PlayerEventHandler.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/net/mcreator/superbwarfare/event/PlayerEventHandler.java b/src/main/java/net/mcreator/superbwarfare/event/PlayerEventHandler.java index abc614d8c..e53ff684c 100644 --- a/src/main/java/net/mcreator/superbwarfare/event/PlayerEventHandler.java +++ b/src/main/java/net/mcreator/superbwarfare/event/PlayerEventHandler.java @@ -139,7 +139,6 @@ public class PlayerEventHandler { .orElse(new ModVariables.PlayerVariables()).breathTime - 1, 0, 100); capability.syncPlayerVariables(player); }); - player.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SLOWDOWN, 2, 3, false, false)); } else { player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { capability.breathTime = Mth.clamp(player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null) @@ -175,16 +174,16 @@ public class PlayerEventHandler { if (stack.is(ModTags.Items.GUN)) { double weight = stack.getOrCreateTag().getDouble("weight"); if (weight == 0) { - sprint_cost = 4; - } else if (weight == 1) { - sprint_cost = 6; - } else if (weight == 2) { - sprint_cost = 8; - } else { sprint_cost = 3; + } else if (weight == 1) { + sprint_cost = 4; + } else if (weight == 2) { + sprint_cost = 5; + } else { + sprint_cost = 2; } } else { - sprint_cost = 3; + sprint_cost = 2; } if (!player.isSprinting()) { @@ -207,14 +206,14 @@ public class PlayerEventHandler { if (player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).tacticalSprint) { player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { - capability.tacticalSprintTime = Mth.clamp(player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).tacticalSprintTime - sprint_cost, 0, 600); + capability.tacticalSprintTime = Mth.clamp(player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).tacticalSprintTime - sprint_cost, 0, 1000); capability.syncPlayerVariables(player); }); player.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SPEED, 2, 0, false, false)); } else { player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { - capability.tacticalSprintTime = Mth.clamp(player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).tacticalSprintTime + 5, 0, 600); + capability.tacticalSprintTime = Mth.clamp(player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).tacticalSprintTime + 7, 0, 1000); capability.syncPlayerVariables(player); }); } @@ -227,11 +226,12 @@ public class PlayerEventHandler { }); } - if (player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).tacticalSprintTime == 600) { + if (player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).tacticalSprintTime == 1000) { player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { capability.tacticalSprintExhaustion = false; capability.syncPlayerVariables(player); }); + player.getPersistentData().putBoolean("canTacticalSprint", true); } }