Skip to content

Commit

Permalink
Balancing for kart bump
Browse files Browse the repository at this point in the history
  • Loading branch information
safalin1 committed Mar 10, 2024
1 parent 56866e7 commit cbf3fc0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
12 changes: 12 additions & 0 deletions src/scripting/ConVars.sp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions src/scripting/Minigames/KartBump.sp
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down Expand Up @@ -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;
}
Expand All @@ -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();
Expand Down

0 comments on commit cbf3fc0

Please sign in to comment.