From cbf3fc0c8f117cf2d33664e3693a4a3f80d1ded5 Mon Sep 17 00:00:00 2001 From: Safalin Date: Sun, 10 Mar 2024 20:20:59 +0000 Subject: [PATCH] Balancing for kart bump --- src/scripting/ConVars.sp | 12 ++++++++++++ src/scripting/Minigames/KartBump.sp | 12 ++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/scripting/ConVars.sp b/src/scripting/ConVars.sp index 54349ab..111b28f 100644 --- a/src/scripting/ConVars.sp +++ b/src/scripting/ConVars.sp @@ -14,6 +14,9 @@ ConVar g_hConVarTFFlamethrowerBurstAmmo; ConVar g_hConVarTFParachuteToggle; ConVar g_hConVarTFParachuteAirControl; ConVar g_hConVarTFWeaponSpreads; +ConVar g_hConVarTFKartDashSpeed; +ConVar g_hConVarTFKartBoostImpactForce; +ConVar g_hConVarTFKartDamageToForce; ConVar g_hConVarFriendlyFire; ConVar g_hConVarServerTimelimit; ConVar g_hConVarAntiFloodTime; @@ -46,6 +49,9 @@ void InitializeConVars() g_hConVarFriendlyFire = FindConVar("mp_friendlyfire"); g_hConVarServerTimelimit = FindConVar("mp_timelimit"); g_hConVarAntiFloodTime = FindConVar("sm_flood_time"); + g_hConVarTFKartDashSpeed = FindConVar("tf_halloween_kart_dash_speed"); + g_hConVarTFKartBoostImpactForce = FindConVar("tf_halloween_kart_boost_impact_force"); + g_hConVarTFKartDamageToForce = FindConVar("tf_halloween_kart_damage_to_force"); g_hConVarPluginMaxRounds = CreateConVar("mtf2_maxrounds", "4", "Sets the maximum rounds to be played. 0 = no limit (not recommended).", 0, true, 0.0); g_hConVarPluginIntermissionEnabled = CreateConVar("mtf2_intermission_enabled", "1", "Controls whether or not intermission is to be held half way through the maximum round count. Having Intermission enabled assumes you have a intermission integration enabled - for example the SourceMod Mapchooser integration.", 0, true, 0.0, true, 1.0); @@ -85,6 +91,9 @@ void ResetConVars() g_hConVarTFWeaponSpreads.RestoreDefault(); g_hConVarTFParachuteToggle.RestoreDefault(); g_hConVarTFParachuteAirControl.RestoreDefault(); + g_hConVarTFKartDashSpeed.RestoreDefault(); + g_hConVarTFKartBoostImpactForce.RestoreDefault(); + g_hConVarTFKartDamageToForce.RestoreDefault(); g_hConVarFriendlyFire.RestoreDefault(); // Debugging: @@ -126,6 +135,9 @@ void PrepareConVars() g_hConVarTFParachuteToggle.BoolValue = false; g_hConVarTFParachuteAirControl.FloatValue = 10.0; g_hConVarTFFlamethrowerBurstAmmo.IntValue = 0; + g_hConVarTFKartDashSpeed.IntValue = 2000; + g_hConVarTFKartBoostImpactForce.FloatValue = 1.2; + g_hConVarTFKartDamageToForce.FloatValue = 500.0; g_hConVarServerGravity.IntValue = 800; g_hConVarHostTimescale.FloatValue = 1.0; diff --git a/src/scripting/Minigames/KartBump.sp b/src/scripting/Minigames/KartBump.sp index 989eea1..06ca29c 100644 --- a/src/scripting/Minigames/KartBump.sp +++ b/src/scripting/Minigames/KartBump.sp @@ -47,8 +47,6 @@ public void Minigame32_OnMinigameSelected(int client) player.Class = TFClass_Scout; player.ResetWeapon(false); - player.Status = PlayerStatus_Winner; - g_iMinigame32PlayerIndex++; float vel[3] = { 0.0, 0.0, 0.0 }; @@ -89,11 +87,15 @@ public void Minigame32_OnPlayerDeath(int client, int attacker) if (player.IsValid && player.IsParticipating) { - player.Status = PlayerStatus_Failed; + if (player.Status == PlayerStatus_NotWon) + { + // Only fail players if they haven't already bumped someone off + player.Status = PlayerStatus_Failed; + } Player attackerPlayer = new Player(attacker); - if (attackerPlayer.IsValid) + if (attackerPlayer.IsValid && attacker != client) { attackerPlayer.Status = PlayerStatus_Winner; } @@ -110,8 +112,6 @@ public void Minigame32_OnMinigameFinish() if (player.IsValid && player.IsParticipating) { - player.Status = (player.IsAlive ? PlayerStatus_Winner : PlayerStatus_Failed); - SDKUnhook(i, SDKHook_PreThink, Minigame32_RemoveLeftClick); player.RemoveCondition(TFCond_HalloweenKart); player.Respawn();