Added Win and Lose State Screens
This commit is contained in:
parent
3a1a2a106d
commit
c752b2fa36
BIN
COMP250_1_2101327_AI/Content/Blueprints/WinLoseStates/Lose.uasset
(Stored with Git LFS)
Normal file
BIN
COMP250_1_2101327_AI/Content/Blueprints/WinLoseStates/Lose.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
COMP250_1_2101327_AI/Content/Blueprints/WinLoseStates/Win.uasset
(Stored with Git LFS)
Normal file
BIN
COMP250_1_2101327_AI/Content/Blueprints/WinLoseStates/Win.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
COMP250_1_2101327_AI/Content/Main.umap
(Stored with Git LFS)
BIN
COMP250_1_2101327_AI/Content/Main.umap
(Stored with Git LFS)
Binary file not shown.
BIN
COMP250_1_2101327_AI/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset
(Stored with Git LFS)
BIN
COMP250_1_2101327_AI/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset
(Stored with Git LFS)
Binary file not shown.
@ -7,6 +7,5 @@ void UDefaultAttack::Init()
|
||||
{
|
||||
ActionCost = 5.0f;
|
||||
ActionName = "Punch";
|
||||
PreConditions.Add("PlayerHealth", 1);
|
||||
Effects.Add("PlayerHealth", 1);
|
||||
}
|
||||
|
@ -28,6 +28,10 @@ ATurnBaseCombatV2::ATurnBaseCombatV2()
|
||||
static ConstructorHelpers::FClassFinder<UStatusEffect> StatusEffectDotClassFinder(TEXT("/Game/Blueprints/StatusEffects/BP_DamageOverTime"));
|
||||
DOTStatusEffect = StatusEffectDotClassFinder.Class;
|
||||
|
||||
static ConstructorHelpers::FClassFinder<UUserWidget> WinClassFinder(TEXT("/Game/Blueprints/WinLoseStates/Win"));
|
||||
WinWidget = WinClassFinder.Class;
|
||||
static ConstructorHelpers::FClassFinder<UUserWidget> LoseClassFinder(TEXT("/Game/Blueprints/WinLoseStates/Lose"));
|
||||
LoseWidget = LoseClassFinder.Class;
|
||||
//static ConstructorHelpers::FClassFinder<UUserWidget> DeathScreenWidgetClass(TEXT("/Game/Blueprints/Death_UI/Death_UI"));
|
||||
//DeathScreenWidgetSubclass = DeathScreenWidgetClass.Class;
|
||||
}
|
||||
@ -86,18 +90,6 @@ void ATurnBaseCombatV2::EndCombat()
|
||||
}
|
||||
|
||||
HUD->RemoveFromParent();
|
||||
APawn* PlayerPawn = Cast<APawn>(GetWorld()->GetFirstPlayerController()->GetPawn());
|
||||
PlayerPawn->bUseControllerRotationYaw = true;
|
||||
PlayerPawn->bUseControllerRotationPitch = true;
|
||||
//Enable Character Movement
|
||||
if (ACharacter* PlayerCharacter = Cast<ACharacter>(GetWorld()->GetFirstPlayerController()->GetPawn()))
|
||||
{
|
||||
PlayerCharacter->EnableInput(GetWorld()->GetFirstPlayerController());
|
||||
}
|
||||
//Set to Game Mode Only
|
||||
APlayerController* PlayerController = GetWorld()->GetFirstPlayerController();
|
||||
PlayerController->SetInputMode(FInputModeGameOnly());
|
||||
PlayerController->bShowMouseCursor = false;
|
||||
}
|
||||
|
||||
void ATurnBaseCombatV2::BeginPlay()
|
||||
@ -231,12 +223,13 @@ void ATurnBaseCombatV2::ExecuteCast(FString Combo)
|
||||
{
|
||||
EndCombat();
|
||||
EnemyActor->Destroy();
|
||||
CreateWidget<UUserWidget>(GetWorld(), WinWidget)->AddToViewport();
|
||||
return;
|
||||
}
|
||||
if (*PlayerHealth <= 0)
|
||||
{
|
||||
DeathScreenWidget = CreateWidget<UUserWidget>(GetWorld(), DeathScreenWidgetSubclass);
|
||||
DeathScreenWidget->AddToViewport();
|
||||
EndCombat();
|
||||
CreateWidget<UUserWidget>(GetWorld(), LoseWidget)->AddToViewport();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -247,4 +247,9 @@ private:
|
||||
void ClearActionPlanWidget();
|
||||
UFUNCTION()
|
||||
void StealButtonOnClick();
|
||||
|
||||
UPROPERTY()
|
||||
TSubclassOf<UUserWidget> WinWidget;
|
||||
UPROPERTY()
|
||||
TSubclassOf<UUserWidget> LoseWidget;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user