GravityStomp/GravityStomp/Source/GravityStompGame/Player/GSPlayerController.cpp

76 lines
1.6 KiB
C++

// Gravity Stomp Copyright Kevin Poretti
#include "Player/GSPlayerController.h"
// GS includes
#include "GSPlayerState.h"
void AGSPlayerController::Client_GameStarted_Implementation()
{
SetIgnoreMoveInput(false);
// enable all actions on pawn
OnGameStarted();
}
void AGSPlayerController::Client_OnKill_Implementation(AGSPlayerState* KillerPlayerState,
AGSPlayerState* VictimPlayerState)
{
OnKill(KillerPlayerState, VictimPlayerState);
}
void AGSPlayerController::Client_OnDeath_Implementation(AGSPlayerState* KillerPlayerState,
AGSPlayerState* VictimPlayerState)
{
OnDeath(KillerPlayerState, VictimPlayerState);
}
void AGSPlayerController::Client_WarmupStarted_Implementation()
{
// wait for server to tell us we can move
SetIgnoreMoveInput(true);
OnWarmupStarted();
}
void AGSPlayerController::Client_GameRestarted_Implementation()
{
OnGameRestarted();
}
void AGSPlayerController::ClientGameEnded_Implementation(AActor* EndGameFocus, bool bIsWinner)
{
Super::ClientGameEnded_Implementation(EndGameFocus, bIsWinner);
SetIgnoreMoveInput(true);
APawn* MyPawn = GetPawn();
if(MyPawn) // pawn may be null if we died and then the round ended
{
// disable all actions on character
MyPawn->TurnOff();
}
OnGameEnded(bIsWinner);
}
void AGSPlayerController::UnFreeze()
{
Super::UnFreeze();
ServerRestartPlayer();
}
void AGSPlayerController::AcknowledgePossession(APawn* P)
{
GetPlayerState<AGSPlayerState>()->UpdateTeamColor();
OnAcknowledgePossession();
Super::AcknowledgePossession(P);
}