Add a shooting delay after firing a Charged Shot

This commit is contained in:
Kiloku 2025-01-19 09:27:50 -03:00 committed by Lywx
parent 0169c08350
commit 6d9b263fc1

View File

@ -305,6 +305,13 @@ void OnLivesCounterDraw(IEvent* ev){
HUD_LivesCount2_Draw(258.0f, SCREEN_HEIGHT - 20, gLifeCount[gPlayerNum]);
}
void OnPlayerShootChargedPre(PlayerActionPreShootChargedEvent* ev){
if (CVarGetInteger("gRapidFire", 0) == 1) {
ev->player->shotTimer = 4;
}
}
void PortEnhancements_Init() {
PortEnhancements_Register();
@ -323,6 +330,7 @@ void PortEnhancements_Init() {
REGISTER_LISTENER(PlayerActionBoostEvent, OnPlayerBoost, EVENT_PRIORITY_NORMAL);
REGISTER_LISTENER(PlayerActionBrakeEvent, OnPlayerBrake, EVENT_PRIORITY_NORMAL);
REGISTER_LISTENER(PlayerActionPostShootEvent, OnPlayerShootPost, EVENT_PRIORITY_NORMAL);
REGISTER_LISTENER(PlayerActionPreShootChargedEvent, OnPlayerShootChargedPre, EVENT_PRIORITY_NORMAL);
}
void PortEnhancements_Register() {