diff --git a/COMP250_1_2101327_AI/Content/Blueprints/WinLoseStates/Lose.uasset b/COMP250_1_2101327_AI/Content/Blueprints/WinLoseStates/Lose.uasset new file mode 100644 index 0000000..8785e50 --- /dev/null +++ b/COMP250_1_2101327_AI/Content/Blueprints/WinLoseStates/Lose.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a356aa1f707fa6bc42d04ab44201468a56e569bd99e9e36f0bd8311cb0a4dd22 +size 36512 diff --git a/COMP250_1_2101327_AI/Content/Blueprints/WinLoseStates/Win.uasset b/COMP250_1_2101327_AI/Content/Blueprints/WinLoseStates/Win.uasset new file mode 100644 index 0000000..16be995 --- /dev/null +++ b/COMP250_1_2101327_AI/Content/Blueprints/WinLoseStates/Win.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c8fdaed375f36d8b87c4a57f3dd6fe3bcf8facb134412b429e26692d782e745 +size 37006 diff --git a/COMP250_1_2101327_AI/Content/Main.umap b/COMP250_1_2101327_AI/Content/Main.umap index fa0fc15..ea9bada 100644 --- a/COMP250_1_2101327_AI/Content/Main.umap +++ b/COMP250_1_2101327_AI/Content/Main.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ea44d851fecbed5e482837f20b5e2a8f4d741460b1ac4dc30af5bcc660570916 +oid sha256:93e571ef4dfc7c3b7c9ce7eb819b3ef9cf2d5fffb1973ff44e7da8f785052c0a size 40330 diff --git a/COMP250_1_2101327_AI/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset b/COMP250_1_2101327_AI/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset index 0f99058..018fba7 100644 --- a/COMP250_1_2101327_AI/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset +++ b/COMP250_1_2101327_AI/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bc35eb2d43a47427d30aba0196f9eac90d089dd3abca319528c5d25c83510d0d -size 72364642 +oid sha256:e6054a106552cfe46f8c4e83fa9879b7ffd1f425b8e76ea7567b71524d6fd513 +size 66790690 diff --git a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/DefaultAttack.cpp b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/DefaultAttack.cpp index c33526e..855f494 100644 --- a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/DefaultAttack.cpp +++ b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/DefaultAttack.cpp @@ -7,6 +7,5 @@ void UDefaultAttack::Init() { ActionCost = 5.0f; ActionName = "Punch"; - PreConditions.Add("PlayerHealth", 1); Effects.Add("PlayerHealth", 1); } diff --git a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/TurnBasedCombatV2/TurnBaseCombatV2.cpp b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/TurnBasedCombatV2/TurnBaseCombatV2.cpp index 6e07894..8404303 100644 --- a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/TurnBasedCombatV2/TurnBaseCombatV2.cpp +++ b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/TurnBasedCombatV2/TurnBaseCombatV2.cpp @@ -28,6 +28,10 @@ ATurnBaseCombatV2::ATurnBaseCombatV2() static ConstructorHelpers::FClassFinder StatusEffectDotClassFinder(TEXT("/Game/Blueprints/StatusEffects/BP_DamageOverTime")); DOTStatusEffect = StatusEffectDotClassFinder.Class; + static ConstructorHelpers::FClassFinder WinClassFinder(TEXT("/Game/Blueprints/WinLoseStates/Win")); + WinWidget = WinClassFinder.Class; + static ConstructorHelpers::FClassFinder LoseClassFinder(TEXT("/Game/Blueprints/WinLoseStates/Lose")); + LoseWidget = LoseClassFinder.Class; //static ConstructorHelpers::FClassFinder DeathScreenWidgetClass(TEXT("/Game/Blueprints/Death_UI/Death_UI")); //DeathScreenWidgetSubclass = DeathScreenWidgetClass.Class; } @@ -86,18 +90,6 @@ void ATurnBaseCombatV2::EndCombat() } HUD->RemoveFromParent(); - APawn* PlayerPawn = Cast(GetWorld()->GetFirstPlayerController()->GetPawn()); - PlayerPawn->bUseControllerRotationYaw = true; - PlayerPawn->bUseControllerRotationPitch = true; - //Enable Character Movement - if (ACharacter* PlayerCharacter = Cast(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(GetWorld(), WinWidget)->AddToViewport(); return; } if (*PlayerHealth <= 0) { - DeathScreenWidget = CreateWidget(GetWorld(), DeathScreenWidgetSubclass); - DeathScreenWidget->AddToViewport(); + EndCombat(); + CreateWidget(GetWorld(), LoseWidget)->AddToViewport(); return; } diff --git a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/TurnBasedCombatV2/TurnBaseCombatV2.h b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/TurnBasedCombatV2/TurnBaseCombatV2.h index 90b512e..00e6962 100644 --- a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/TurnBasedCombatV2/TurnBaseCombatV2.h +++ b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/TurnBasedCombatV2/TurnBaseCombatV2.h @@ -247,4 +247,9 @@ private: void ClearActionPlanWidget(); UFUNCTION() void StealButtonOnClick(); + + UPROPERTY() + TSubclassOf WinWidget; + UPROPERTY() + TSubclassOf LoseWidget; };