Skip to content

Commit

Permalink
game: Implement g_flightCost and g_flightCostPct cvar and put TODOs a…
Browse files Browse the repository at this point in the history
…bout ki regen and ki boost
  • Loading branch information
LegendaryGuard committed Dec 2, 2024
1 parent 2f4e9e8 commit 69c2cd4
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions source/game/g_active.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,19 +428,21 @@ void ClientTimerActions( gentity_t *ent, int msec ) {
}
}

// BFP - Ki up/down when flying/ki use
// BFP - Decrease ki when flying
if ( client->ps.powerups[PW_FLIGHT] > 0 ) {

// BFP - TODO: Add cvar for flight cost

if ( client->ps.ammo[WP_KI] > 0 ) {
client->ps.ammo[WP_KI]--;

if ( client->pers.cmd.buttons & BUTTON_KI_USE )
client->ps.ammo[WP_KI]--;
client->ps.ammo[WP_KI] -= (int) (g_flightCost.value + ( g_flightCostPct.value * 10 ));
}
} else {
client->ps.ammo[WP_KI]++;
}

// BFP - Regenerate ki
// BFP - TODO: Add cvar for ki regen
client->ps.ammo[WP_KI]++;

// BFP - Ki boost consumption
// BFP - TODO: Add cvar for boost cost (consumption must be per milliseconds, maybe pml.msec?)
if ( client->pers.cmd.buttons & BUTTON_KI_USE ) {
client->ps.ammo[WP_KI]--;
}

// BFP - if ki drops to 0, disable flight
Expand Down

0 comments on commit 69c2cd4

Please sign in to comment.