From 5e718620656c4c9278b2d8507f2579efa1386f51 Mon Sep 17 00:00:00 2001 From: KACPER SZELEST Date: Thu, 30 Nov 2023 09:22:09 +0000 Subject: [PATCH 01/17] Updated read.me Added storyboard --- readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/readme.md b/readme.md index aeaae7ea..65546301 100644 --- a/readme.md +++ b/readme.md @@ -12,3 +12,6 @@ https://docs.google.com/presentation/d/18K_XKPOnZg56S7NocoEVEdA8lVHvtSVWkflCJFtD ## Endless Vendetta Script https://docs.google.com/document/d/1MvQ3F871koZ53Iz9kEm1RQPiGyirKYcUlOa3ygn4et8/edit?usp=sharing +## Storyboard +https://docs.google.com/presentation/d/19U0EaM-FMOQF1PJK32SKJUJZpXn9ee6TqFE8gCitA64/edit?usp=sharing + From 73fd6c48cfdba13f36bd9edc6bb26c3f57673db7 Mon Sep 17 00:00:00 2001 From: KACPER SZELEST Date: Thu, 30 Nov 2023 09:23:00 +0000 Subject: [PATCH 02/17] Updated read.me added the asset list --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index 65546301..5068be59 100644 --- a/readme.md +++ b/readme.md @@ -15,3 +15,5 @@ https://docs.google.com/document/d/1MvQ3F871koZ53Iz9kEm1RQPiGyirKYcUlOa3ygn4et8/ ## Storyboard https://docs.google.com/presentation/d/19U0EaM-FMOQF1PJK32SKJUJZpXn9ee6TqFE8gCitA64/edit?usp=sharing +## Asset List +https://docs.google.com/document/d/1Fdbr4cpkdt6jJFpZQmIbvP3FGk25JDIMfuRHyolwX_Y/edit?usp=sharing From 2899b9f4a8c7fb646cd25ab1542867dcd974d0e0 Mon Sep 17 00:00:00 2001 From: RAFAL SWIERCZEK Date: Thu, 30 Nov 2023 09:33:28 +0000 Subject: [PATCH 03/17] Deleted Old LOS Test Class --- .../Architecture/Floor_400x400.uasset | 4 +- .../Materials/M_Wood_Pine.uasset | 4 +- .../Materials/M_Wood_Walnut.uasset | 4 +- .../Props/MaterialSphere.uasset | 4 +- .../Recon/VisionLink/VisionLink.cpp | 1 - .../Recon/VisionLink/VisionLink.h | 1 - .../VisionLink/VisionLinkEnemyLOSTest.cpp | 74 ------------------- .../Recon/VisionLink/VisionLinkEnemyLOSTest.h | 30 -------- 8 files changed, 8 insertions(+), 114 deletions(-) delete mode 100644 EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.cpp delete mode 100644 EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.h diff --git a/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset b/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset index c2a34afc..9fe9e00c 100644 --- a/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset +++ b/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4c0ecf0ac0702cc2bd355ec050232a61c49e10f102448efbeb735a51824adef6 -size 14948 +oid sha256:1dab05352d920eb93c5a61a681634f187e65971458c68dd559602b2510811889 +size 14831 diff --git a/EndlessVendetta/Content/StarterContent/Materials/M_Wood_Pine.uasset b/EndlessVendetta/Content/StarterContent/Materials/M_Wood_Pine.uasset index fb828784..eafee70c 100644 --- a/EndlessVendetta/Content/StarterContent/Materials/M_Wood_Pine.uasset +++ b/EndlessVendetta/Content/StarterContent/Materials/M_Wood_Pine.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:196eb4590144ea90058b1a8b48d4662f2ba04302d4184e5e68698a3e715cc50e -size 29377 +oid sha256:b12c6d7285dd95b1c5669e07fc665f8859a17ee78c51f139170726848c06ee67 +size 31142 diff --git a/EndlessVendetta/Content/StarterContent/Materials/M_Wood_Walnut.uasset b/EndlessVendetta/Content/StarterContent/Materials/M_Wood_Walnut.uasset index 1d3466c4..2e926194 100644 --- a/EndlessVendetta/Content/StarterContent/Materials/M_Wood_Walnut.uasset +++ b/EndlessVendetta/Content/StarterContent/Materials/M_Wood_Walnut.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:da10621d164f621c3c598d9d293d707a2879d7caf8c0525652a06b38323820f0 -size 20139 +oid sha256:8491e0b8978a41999e0f4fc6520cab088fcbe6ddf8b51655f34753aa45234c66 +size 20495 diff --git a/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset b/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset index 89145d94..56bddfc9 100644 --- a/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset +++ b/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b7943b84a70f66da9ce4c738e5748bd6853c3af285ea2f99a76efa584cb31301 -size 47710 +oid sha256:3a8777c01491888bba9f40eda9d2bed76a611f0e80f75917501ce69c1a321342 +size 47333 diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp index 1dbe1dd7..890916c0 100644 --- a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp @@ -6,7 +6,6 @@ #include "CollisionDebugDrawingPublic.h" #include "Kismet/KismetMathLibrary.h" #include "Camera/CameraComponent.h" -#include "VisionLinkEnemyLOSTest.h" #include "GameFramework/Character.h" void AVisionLink::BeginPlay() diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.h b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.h index 2a3b7789..40d5c103 100644 --- a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.h +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.h @@ -3,7 +3,6 @@ #pragma once #include "CoreMinimal.h" -#include "VisionLinkEnemyLOSTest.h" #include "EndlessVendetta/GadgetSystem/ReconGadget.h" #include "VisionLink.generated.h" diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.cpp b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.cpp deleted file mode 100644 index eb11bf58..00000000 --- a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "VisionLinkEnemyLOSTest.h" - -#include "Components/BoxComponent.h" -#include "Kismet/KismetMathLibrary.h" - -// Sets default values -AVisionLinkEnemyLOSTest::AVisionLinkEnemyLOSTest() -{ - // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. - PrimaryActorTick.bCanEverTick = true; - -} - -// Called when the game starts or when spawned -void AVisionLinkEnemyLOSTest::BeginPlay() -{ - Super::BeginPlay(); - -} - -// Called every frame -void AVisionLinkEnemyLOSTest::Tick(float DeltaTime) -{ - Super::Tick(DeltaTime); - -} - -void AVisionLinkEnemyLOSTest::TestLOS(TArray EnemiesInLink, AActor* LOSActor) -{ - // Get all overlapping Actors - UBoxComponent* CollisionBox = Cast(GetComponentByClass(UBoxComponent::StaticClass())); - if (!IsValid(CollisionBox)) - { - Destroy(); - return; - } - TArray OverlappingEnemies; - CollisionBox->GetOverlappingActors(OverlappingEnemies); - if (OverlappingEnemies.IsEmpty()) - { - Destroy(); - return; - } - - for (int i = 0; i < OverlappingEnemies.Num(); i++) - { - // Overlapping Enemies Array should only contain enemies which aren't already in the link - if (!OverlappingEnemies[i]->ActorHasTag(FName("Enemy")) || EnemiesInLink.Contains(OverlappingEnemies[i]->GetUniqueID())) - { - UE_LOG(LogTemp, Warning, TEXT("enemy name: %s"), *OverlappingEnemies[i]->GetName()); - OverlappingEnemies.RemoveAt(i); - } - } - if (OverlappingEnemies.IsEmpty()) - { - Destroy(); - return; - } - - /*for (AActor* Enemy : OverlappingEnemies) - { - FRotator LookAtRotation = UKismetMathLibrary::FindLookAtRotation(LOSActor->GetActorLocation(), Enemy->GetActorLocation()); - UE_LOG(LogTemp, Warning, TEXT("Look at Rotation: %f"), LookAtRotation.Yaw); - }*/ - - Destroy(); - - -} - - diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.h b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.h deleted file mode 100644 index add35b97..00000000 --- a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.h +++ /dev/null @@ -1,30 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "GameFramework/Actor.h" -#include "VisionLinkEnemyLOSTest.generated.h" - -UCLASS() -class ENDLESSVENDETTA_API AVisionLinkEnemyLOSTest : public AActor -{ - GENERATED_BODY() - - -protected: - // Called when the game starts or when spawned - virtual void BeginPlay() override; - -public: - UPROPERTY(EditDefaultsOnly, Category = "Vision Link") - float SpawnOffset = 0; - - // Sets default values for this actor's properties - AVisionLinkEnemyLOSTest(); - - // Called every frame - virtual void Tick(float DeltaTime) override; - - void TestLOS(TArray EnemiesInLink, AActor* LOS_Actor); -}; From 354b3b2a113fe6b24413e374ca5f21d7b5fbebf0 Mon Sep 17 00:00:00 2001 From: RAFAL SWIERCZEK Date: Thu, 30 Nov 2023 09:45:03 +0000 Subject: [PATCH 04/17] Deleted Text Background Asset --- .../Content/BountySystem/Waypoint/TextBackground.png | 3 --- .../Content/BountySystem/Waypoint/TextBackground.uasset | 3 --- 2 files changed, 6 deletions(-) delete mode 100644 EndlessVendetta/Content/BountySystem/Waypoint/TextBackground.png delete mode 100644 EndlessVendetta/Content/BountySystem/Waypoint/TextBackground.uasset diff --git a/EndlessVendetta/Content/BountySystem/Waypoint/TextBackground.png b/EndlessVendetta/Content/BountySystem/Waypoint/TextBackground.png deleted file mode 100644 index d5781e4c..00000000 --- a/EndlessVendetta/Content/BountySystem/Waypoint/TextBackground.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8d3cccd91fdbe7e0090f451048771e56d36dbe24c3cb716b63d99261f414f868 -size 2232177 diff --git a/EndlessVendetta/Content/BountySystem/Waypoint/TextBackground.uasset b/EndlessVendetta/Content/BountySystem/Waypoint/TextBackground.uasset deleted file mode 100644 index c80f44a0..00000000 --- a/EndlessVendetta/Content/BountySystem/Waypoint/TextBackground.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c06aa560dd0dffcca87ab60abe3a290e98e28c94ef52e58338c9e985c83d1ac0 -size 1854378 From 331259cc1ba8473165cfec23504cf09e5508c466 Mon Sep 17 00:00:00 2001 From: RAFAL SWIERCZEK Date: Thu, 30 Nov 2023 10:15:38 +0000 Subject: [PATCH 05/17] Bugfix Equipped Guns Block LOS for Vision Link --- EndlessVendetta/Content/Levels/TrainingFacility.umap | 4 ++-- .../GadgetClasses/Recon/VisionLink/VisionLink.cpp | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/EndlessVendetta/Content/Levels/TrainingFacility.umap b/EndlessVendetta/Content/Levels/TrainingFacility.umap index 19053416..174ac378 100644 --- a/EndlessVendetta/Content/Levels/TrainingFacility.umap +++ b/EndlessVendetta/Content/Levels/TrainingFacility.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9085d76489c04f7d273f580154acee8bbe53b285514f36e2770d3be3e9407730 -size 679662 +oid sha256:7711a7f6afcfd75419a73d627b6359ec3fb76c48d9dbb34e50b2a2318ee05b7d +size 679380 diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp index 890916c0..09cbf980 100644 --- a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp @@ -6,6 +6,7 @@ #include "CollisionDebugDrawingPublic.h" #include "Kismet/KismetMathLibrary.h" #include "Camera/CameraComponent.h" +#include "EndlessVendetta/EndlessVendettaCharacter.h" #include "GameFramework/Character.h" void AVisionLink::BeginPlay() @@ -46,9 +47,16 @@ void AVisionLink::SendOutPingPulse() GetWorld()->GetTimerManager().SetTimer(PulseHandle, this, &AVisionLink::SendOutPingPulse, TimeInbetweenPingPulses, false); PlayPingPulseAnim(TimeInbetweenPingPulses); - UCameraComponent* PlayerCamComp = Cast(GetWorld()->GetFirstPlayerController()->GetCharacter()->GetComponentByClass(UCameraComponent::StaticClass())); + ACharacter* PlayersCharacter = GetWorld()->GetFirstPlayerController()->GetCharacter(); + UCameraComponent* PlayerCamComp = Cast(PlayersCharacter->GetComponentByClass(UCameraComponent::StaticClass())); + + // Ignored Actors TArray ActorsToIgnore; - ActorsToIgnore.Add(GetWorld()->GetFirstPlayerController()->GetCharacter()); + AEndlessVendettaCharacter* EV_Character = Cast(PlayersCharacter); + if ( IsValid(EV_Character) && IsValid(EV_Character->PrimaryWeaponActor)) ActorsToIgnore.Add(EV_Character->PrimaryWeaponActor); + if ( IsValid(EV_Character) && IsValid(EV_Character->SecondaryWeaponActor)) ActorsToIgnore.Add(EV_Character->SecondaryWeaponActor); + ActorsToIgnore.Add(PlayersCharacter); + TestLOS(PlayerCamComp->GetComponentTransform(), ActorsToIgnore); } From 0c8dbbf03bb43decb1a27d0f98c824f5f09b6e33 Mon Sep 17 00:00:00 2001 From: RAFAL SWIERCZEK Date: Thu, 30 Nov 2023 10:20:23 +0000 Subject: [PATCH 06/17] Bugfix VisionLink Marking Dead Enemies --- .../GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp index 09cbf980..eca0e33f 100644 --- a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp @@ -82,7 +82,7 @@ void AVisionLink::TestLOS(FTransform StartingPos, TArray &ActorsToIgnor if (!GetWorld()->LineTraceSingleByChannel(outHit, StartingPos.GetLocation(), LT_EndPoint, ECC_Camera, QueryParams)) continue; AActor* HitActor = outHit.GetActor(); - if (!HitActor->ActorHasTag(FName("Enemy"))) continue; + if (!HitActor->ActorHasTag(FName("Enemy")) || HitActor->ActorHasTag("Dead")) continue; //DrawDebugLine(GetWorld(), outHit.TraceStart, outHit.ImpactPoint, FColor::Blue, false, 3, 0, 3); ActorsToIgnore.Add(HitActor); From d9763b3bf275d5b0dfad117740fcc9da3019204a Mon Sep 17 00:00:00 2001 From: MH261677 Date: Thu, 30 Nov 2023 11:55:28 +0000 Subject: [PATCH 07/17] Added Stamina Bar to player --- .../Content/FirstPerson/Blueprints/WBP_Crosshair.uasset | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/WBP_Crosshair.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/WBP_Crosshair.uasset index 939e70d9..ffee6be9 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/WBP_Crosshair.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/WBP_Crosshair.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:13ff21aa89e2ded711aff8ee6617abc2d565d222c39ce3878969fdfe44d5a81f -size 75992 +oid sha256:0908a7f0cb894de06719e8a5629d195998cdc4598cac022f8dd3eb0a3b889d2e +size 89225 From b9a8bf4f85d08807d0e3febbff9d68a893344602 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Thu, 30 Nov 2023 11:55:40 +0000 Subject: [PATCH 08/17] Added Stamina and SprintSpeed values to player header --- .../Source/EndlessVendetta/EndlessVendettaCharacter.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h index 9a14b875..f893d625 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h @@ -83,6 +83,13 @@ public: UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stats") float DefaultHealth = 100.0f; + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stats") + float MaxStamina = 100.0f; + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stats") + float StaminaDecreaseRate = 10.0f; + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stats") + int SprintSpeed = 50; + AActor* PrimaryWeaponActor; AActor* SecondaryWeaponActor; bool bIsPrimaryWeaponCreated = false; From 08e7fcecba30a4053197f366f9df5da6cda403ba Mon Sep 17 00:00:00 2001 From: MH261677 Date: Thu, 30 Nov 2023 12:19:43 +0000 Subject: [PATCH 09/17] Added Sprint Basic Function and Binds To Shift Key --- .../Blueprints/BP_FirstPersonCharacter.uasset | 4 ++-- .../FirstPerson/Input/Actions/IA_Sprint.uasset | 3 +++ .../Content/FirstPerson/Input/IMC_Default.uasset | 4 ++-- .../EndlessVendetta/EndlessVendettaCharacter.cpp | 12 ++++++++++++ .../EndlessVendetta/EndlessVendettaCharacter.h | 7 +++++++ 5 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Sprint.uasset diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset index 68f6e73f..9916b65d 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b0a493fd95d8b0b43306329298c058cfa2f164ec071457bc575a8eafee95f1b1 -size 53936 +oid sha256:b286c36bff935d0bb4a21224449c4dbd84f2dd72c29fb14da3e97822f0a9c9d0 +size 54078 diff --git a/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Sprint.uasset b/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Sprint.uasset new file mode 100644 index 00000000..68e93308 --- /dev/null +++ b/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Sprint.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:467d285447b71f9b4417bde598153ef906f87de4d2244f0b3cbaac1b712d693b +size 1360 diff --git a/EndlessVendetta/Content/FirstPerson/Input/IMC_Default.uasset b/EndlessVendetta/Content/FirstPerson/Input/IMC_Default.uasset index 6f199667..c5bb3d48 100644 --- a/EndlessVendetta/Content/FirstPerson/Input/IMC_Default.uasset +++ b/EndlessVendetta/Content/FirstPerson/Input/IMC_Default.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:750ab013f24a45539806fd40e9cd2a328ff31b40c5d3edcce0676fb3bf6935ee -size 18664 +oid sha256:4b09c7676dc66a56a9f2dd750aa646db53db086cb9604fed17e025259b4821db +size 19248 diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index 04a8f415..7187b03a 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -134,6 +134,7 @@ void AEndlessVendettaCharacter::SetupPlayerInputComponent(class UInputComponent* //Moving EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AEndlessVendettaCharacter::Move); + EnhancedInputComponent->BindAction(SprintAction, ETriggerEvent::Triggered, this, &AEndlessVendettaCharacter::Sprint); //Looking EnhancedInputComponent->BindAction(LookAction, ETriggerEvent::Triggered, this, &AEndlessVendettaCharacter::Look); @@ -430,6 +431,17 @@ void AEndlessVendettaCharacter::StopFire() } } +void AEndlessVendettaCharacter::Sprint() +{ + MoveGroundSpeed *= 2; + // bIsPlayerSprinting = true; + // if (bIsPlayerSprinting) + // { + // MoveGroundSpeed *= 2; + // bIsPlayerSprinting = false; + // } +} + void AEndlessVendettaCharacter::GunRightClick() { if (IsValid(PrimaryWeapon) && !bIsScoped) diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h index f893d625..5ba68440 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h @@ -73,6 +73,9 @@ class AEndlessVendettaCharacter : public ACharacter UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true")) UInputAction* InteractAction; + UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true")) + UInputAction* SprintAction; + public: AEndlessVendettaCharacter(); @@ -114,6 +117,8 @@ public: bool bIsPlayerMoving = false; + bool bIsPlayerSprinting = false; + double MoveGroundSpeed; /** Look Input Action */ @@ -156,6 +161,8 @@ public: UFUNCTION(BlueprintCallable, Category = "Weapons") void StopFire(); + void Sprint(); + UArrowComponent* ScopedLocationArrow; UPROPERTY(EditAnywhere, Category = "Dont Touch") From 92ab1c3d6b1cd7ba5042c4c8ed45ff9ce0c8b707 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Thu, 30 Nov 2023 13:01:23 +0000 Subject: [PATCH 10/17] Populated Sprint and UnSprint Functions --- .../Blueprints/BP_FirstPersonCharacter.uasset | 4 +- .../EndlessVendettaCharacter.cpp | 43 +++++++++++++------ .../EndlessVendettaCharacter.h | 10 ++++- 3 files changed, 42 insertions(+), 15 deletions(-) diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset index 9916b65d..51f16bdb 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b286c36bff935d0bb4a21224449c4dbd84f2dd72c29fb14da3e97822f0a9c9d0 -size 54078 +oid sha256:017155c3e85841098dd90809087103d777592a4dc37f146560ab46b4910a522c +size 54599 diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index 7187b03a..dd877626 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -69,6 +69,8 @@ void AEndlessVendettaCharacter::BeginPlay() } InventoryComponent = Cast(GetWorld()->GetFirstPlayerController()->GetComponentByClass(UInventoryComponent::StaticClass())); + WalkSpeed = CharacterMovement->MaxWalkSpeed; + OriginalWalkSpeed = CharacterMovement->MaxWalkSpeed; } void AEndlessVendettaCharacter::Tick(float DeltaTime) @@ -134,7 +136,8 @@ void AEndlessVendettaCharacter::SetupPlayerInputComponent(class UInputComponent* //Moving EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AEndlessVendettaCharacter::Move); - EnhancedInputComponent->BindAction(SprintAction, ETriggerEvent::Triggered, this, &AEndlessVendettaCharacter::Sprint); + EnhancedInputComponent->BindAction(SprintAction, ETriggerEvent::Started, this, &AEndlessVendettaCharacter::Sprint); + EnhancedInputComponent->BindAction(SprintAction, ETriggerEvent::Completed, this, &AEndlessVendettaCharacter::StopSprint); //Looking EnhancedInputComponent->BindAction(LookAction, ETriggerEvent::Triggered, this, &AEndlessVendettaCharacter::Look); @@ -431,17 +434,6 @@ void AEndlessVendettaCharacter::StopFire() } } -void AEndlessVendettaCharacter::Sprint() -{ - MoveGroundSpeed *= 2; - // bIsPlayerSprinting = true; - // if (bIsPlayerSprinting) - // { - // MoveGroundSpeed *= 2; - // bIsPlayerSprinting = false; - // } -} - void AEndlessVendettaCharacter::GunRightClick() { if (IsValid(PrimaryWeapon) && !bIsScoped) @@ -523,6 +515,33 @@ void AEndlessVendettaCharacter::Move(const FInputActionValue& Value) } } +void AEndlessVendettaCharacter::Sprint() +{ + bIsPlayerSprinting = true; + if (bIsPlayerSprinting) + { + CharacterMovement->MaxWalkSpeed = SprintSpeed; + MaxStamina -= StaminaDecreaseRate; + UE_LOG(LogTemp, Display, TEXT("Walk Speed: %f"), WalkSpeed); + if (MaxStamina <= 0) + { + CharacterMovement->MaxWalkSpeed = OriginalWalkSpeed; + bIsPlayerSprinting = false; + } + } +} + +void AEndlessVendettaCharacter::StopSprint() +{ + bIsPlayerSprinting = false; + if (!bIsPlayerSprinting) + { + UE_LOG(LogTemp, Display, TEXT("Player stopped sprinting")); + CharacterMovement->MaxWalkSpeed = OriginalWalkSpeed; + MaxStamina++; + } +} + void AEndlessVendettaCharacter::Look(const FInputActionValue& Value) { // input is a Vector2D diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h index 5ba68440..8a7ff928 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h @@ -86,12 +86,18 @@ public: UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stats") float DefaultHealth = 100.0f; + //STAMINA AND SPRINT SPEED UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stats") float MaxStamina = 100.0f; UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stats") float StaminaDecreaseRate = 10.0f; UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stats") - int SprintSpeed = 50; + float SprintSpeed = 1200; + + //Getting the charMovementComp + UCharacterMovementComponent* CharacterMovement = GetCharacterMovement(); + float WalkSpeed; + float OriginalWalkSpeed; AActor* PrimaryWeaponActor; AActor* SecondaryWeaponActor; @@ -117,6 +123,7 @@ public: bool bIsPlayerMoving = false; + UPROPERTY(VisibleAnywhere) bool bIsPlayerSprinting = false; double MoveGroundSpeed; @@ -162,6 +169,7 @@ public: void StopFire(); void Sprint(); + void StopSprint(); UArrowComponent* ScopedLocationArrow; From 0f07c0197b9e9f02e814dd48cc46bf66b37758ae Mon Sep 17 00:00:00 2001 From: MH261677 Date: Thu, 30 Nov 2023 14:01:26 +0000 Subject: [PATCH 11/17] Fixed Sprinting Action Buttons --- .../Content/FirstPerson/Input/Actions/IA_Sprint.uasset | 2 +- EndlessVendetta/Content/FirstPerson/Input/IMC_Default.uasset | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Sprint.uasset b/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Sprint.uasset index 68e93308..1a2ea734 100644 --- a/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Sprint.uasset +++ b/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Sprint.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:467d285447b71f9b4417bde598153ef906f87de4d2244f0b3cbaac1b712d693b +oid sha256:6e25b72a06c43ac63140b164e9ee5e2a8222f021ac5bd045149a27c2d8f073a1 size 1360 diff --git a/EndlessVendetta/Content/FirstPerson/Input/IMC_Default.uasset b/EndlessVendetta/Content/FirstPerson/Input/IMC_Default.uasset index c5bb3d48..4764655f 100644 --- a/EndlessVendetta/Content/FirstPerson/Input/IMC_Default.uasset +++ b/EndlessVendetta/Content/FirstPerson/Input/IMC_Default.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4b09c7676dc66a56a9f2dd750aa646db53db086cb9604fed17e025259b4821db +oid sha256:8576231cc54d32ecfa8c00c7570ec51bb9d741dabc85bc0b4ef684bbc8209d04 size 19248 From 7f2cc14922a6224a84e7df44206a129768c20aa4 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Thu, 30 Nov 2023 14:01:43 +0000 Subject: [PATCH 12/17] Added Stamina Consume System & Finalised Sprinting Values --- .../FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset | 4 ++-- .../Content/FirstPerson/Blueprints/WBP_Crosshair.uasset | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset index 51f16bdb..76991298 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:017155c3e85841098dd90809087103d777592a4dc37f146560ab46b4910a522c -size 54599 +oid sha256:76a05bba142f49ac64cd4ccb3c1ba1998bb54ba39510c42f8204dd22d3c1fcd2 +size 54132 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/WBP_Crosshair.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/WBP_Crosshair.uasset index ffee6be9..29ebde67 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/WBP_Crosshair.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/WBP_Crosshair.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0908a7f0cb894de06719e8a5629d195998cdc4598cac022f8dd3eb0a3b889d2e -size 89225 +oid sha256:8ac7733948c885fda46dd009dd75dfe5c79abf1262e9aadcf17c401bb8f64ecf +size 93512 From 39bd245f57a2d4be080bb71f48e301967fa38cde Mon Sep 17 00:00:00 2001 From: MH261677 Date: Thu, 30 Nov 2023 14:02:02 +0000 Subject: [PATCH 13/17] Added FOV when sprinting and finished Sprinting System --- .../EndlessVendettaCharacter.cpp | 33 ++++++++++++++----- .../EndlessVendettaCharacter.h | 10 ++++-- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index dd877626..53a1e62e 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -71,12 +71,12 @@ void AEndlessVendettaCharacter::BeginPlay() InventoryComponent = Cast(GetWorld()->GetFirstPlayerController()->GetComponentByClass(UInventoryComponent::StaticClass())); WalkSpeed = CharacterMovement->MaxWalkSpeed; OriginalWalkSpeed = CharacterMovement->MaxWalkSpeed; + CurrentStamina = MaxStamina; } void AEndlessVendettaCharacter::Tick(float DeltaTime) { Super::Tick(DeltaTime); - WeaponPickUpSystem(); MoveGroundSpeed = Cast(GetComponentByClass(UMovementComponent::StaticClass()))->Velocity.Size(); @@ -89,6 +89,27 @@ void AEndlessVendettaCharacter::Tick(float DeltaTime) { bIsPlayerMoving = false; } + //PLAYER STAMINA HANDLING + if (bIsPlayerSprinting) + { + CurrentStamina -= FMath::Clamp(StaminaDecreaseRate, 0.0f, 100.0f); + if (CurrentStamina <= 0.0f) + { + bIsPlayerSprinting = false; + this->GetFirstPersonCameraComponent()->SetFieldOfView(90); + CurrentStamina = 0.0f; + CharacterMovement->MaxWalkSpeed = OriginalWalkSpeed; + } + } + if (!bIsPlayerSprinting) + { + if(CurrentStamina >= 100.0f) + { + CurrentStamina = 100.0f; + return; + } + CurrentStamina += FMath::Clamp(StaminaRegenRate, 0.0f, 100.0f); + } } void AEndlessVendettaCharacter::RegenHealth() @@ -521,13 +542,7 @@ void AEndlessVendettaCharacter::Sprint() if (bIsPlayerSprinting) { CharacterMovement->MaxWalkSpeed = SprintSpeed; - MaxStamina -= StaminaDecreaseRate; - UE_LOG(LogTemp, Display, TEXT("Walk Speed: %f"), WalkSpeed); - if (MaxStamina <= 0) - { - CharacterMovement->MaxWalkSpeed = OriginalWalkSpeed; - bIsPlayerSprinting = false; - } + this->GetFirstPersonCameraComponent()->SetFieldOfView(100); } } @@ -538,7 +553,7 @@ void AEndlessVendettaCharacter::StopSprint() { UE_LOG(LogTemp, Display, TEXT("Player stopped sprinting")); CharacterMovement->MaxWalkSpeed = OriginalWalkSpeed; - MaxStamina++; + this->GetFirstPersonCameraComponent()->SetFieldOfView(90); } } diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h index 8a7ff928..ca2e5a99 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h @@ -88,11 +88,15 @@ public: //STAMINA AND SPRINT SPEED UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stats") - float MaxStamina = 100.0f; + float MaxStamina = 100; UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stats") - float StaminaDecreaseRate = 10.0f; + float CurrentStamina; UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stats") - float SprintSpeed = 1200; + float StaminaDecreaseRate = 0.2; + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stats") + float StaminaRegenRate = 0.05; + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stats") + float SprintSpeed = 900; //Getting the charMovementComp UCharacterMovementComponent* CharacterMovement = GetCharacterMovement(); From 91f9003ff0de7c7045560c0bbcbeec262f6f4a03 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Thu, 30 Nov 2023 14:52:50 +0000 Subject: [PATCH 14/17] Tweaked Movement and Jumping Values to feel better --- .../Blueprints/BP_FirstPersonCharacter.uasset | 4 ++-- .../EndlessVendettaCharacter.cpp | 21 ++++++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset index 76991298..af1aeccc 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:76a05bba142f49ac64cd4ccb3c1ba1998bb54ba39510c42f8204dd22d3c1fcd2 -size 54132 +oid sha256:29a9b2fccbf432819ea9a64b75f802f6b121dd5e7a2c34ada69ecf08057f1ace +size 54773 diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index 53a1e62e..6e3adfb6 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -89,6 +89,15 @@ void AEndlessVendettaCharacter::Tick(float DeltaTime) { bIsPlayerMoving = false; } + if (bPressedJump) + { + UE_LOG(LogTemp, Display, TEXT("Player Jumped")); + if(CurrentStamina <= 0.0f) + { + CurrentStamina -= 20.0f; + UE_LOG(LogTemp, Display, TEXT("Current Stam: %f"), CurrentStamina); + } + } //PLAYER STAMINA HANDLING if (bIsPlayerSprinting) { @@ -110,6 +119,16 @@ void AEndlessVendettaCharacter::Tick(float DeltaTime) } CurrentStamina += FMath::Clamp(StaminaRegenRate, 0.0f, 100.0f); } + //make your own jump and call the default character jump + // if (bPressedJump) + // { + // UE_LOG(LogTemp, Display, TEXT("Player Jumped")); + // if(CurrentStamina <= 0.0f) + // { + // CurrentStamina -= 20.0f; + // UE_LOG(LogTemp, Display, TEXT("Current Stam: %f"), CurrentStamina); + // } + // } } void AEndlessVendettaCharacter::RegenHealth() @@ -154,7 +173,7 @@ void AEndlessVendettaCharacter::SetupPlayerInputComponent(class UInputComponent* //Jumping EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Triggered, this, &ACharacter::Jump); EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Completed, this, &ACharacter::StopJumping); - + //Moving EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AEndlessVendettaCharacter::Move); EnhancedInputComponent->BindAction(SprintAction, ETriggerEvent::Started, this, &AEndlessVendettaCharacter::Sprint); From c9acf07ccdce77e68607ac780a19975e493f74b3 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Thu, 30 Nov 2023 15:26:20 +0000 Subject: [PATCH 15/17] Added Stamina Consume To Jumping & Fixed Jumping Bugs --- .../Blueprints/BP_FirstPersonCharacter.uasset | 2 +- .../EndlessVendettaCharacter.cpp | 41 ++++++++++++------- .../EndlessVendettaCharacter.h | 4 ++ 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset index af1aeccc..ea9b685a 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:29a9b2fccbf432819ea9a64b75f802f6b121dd5e7a2c34ada69ecf08057f1ace +oid sha256:58139ccad1a63dd9fa03404f0fb0b7af3f742d844b0ed7da0e081b96319600b9 size 54773 diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index 6e3adfb6..1fb28751 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -78,7 +78,6 @@ void AEndlessVendettaCharacter::Tick(float DeltaTime) { Super::Tick(DeltaTime); WeaponPickUpSystem(); - MoveGroundSpeed = Cast(GetComponentByClass(UMovementComponent::StaticClass()))->Velocity.Size(); if (MoveGroundSpeed > 0) @@ -91,11 +90,9 @@ void AEndlessVendettaCharacter::Tick(float DeltaTime) } if (bPressedJump) { - UE_LOG(LogTemp, Display, TEXT("Player Jumped")); if(CurrentStamina <= 0.0f) { CurrentStamina -= 20.0f; - UE_LOG(LogTemp, Display, TEXT("Current Stam: %f"), CurrentStamina); } } //PLAYER STAMINA HANDLING @@ -119,16 +116,6 @@ void AEndlessVendettaCharacter::Tick(float DeltaTime) } CurrentStamina += FMath::Clamp(StaminaRegenRate, 0.0f, 100.0f); } - //make your own jump and call the default character jump - // if (bPressedJump) - // { - // UE_LOG(LogTemp, Display, TEXT("Player Jumped")); - // if(CurrentStamina <= 0.0f) - // { - // CurrentStamina -= 20.0f; - // UE_LOG(LogTemp, Display, TEXT("Current Stam: %f"), CurrentStamina); - // } - // } } void AEndlessVendettaCharacter::RegenHealth() @@ -171,8 +158,8 @@ void AEndlessVendettaCharacter::SetupPlayerInputComponent(class UInputComponent* if (UEnhancedInputComponent* EnhancedInputComponent = CastChecked(PlayerInputComponent)) { //Jumping - EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Triggered, this, &ACharacter::Jump); - EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Completed, this, &ACharacter::StopJumping); + EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Started, this, &AEndlessVendettaCharacter::Jumping); + EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Completed, this, &AEndlessVendettaCharacter::StopJump); //Moving EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AEndlessVendettaCharacter::Move); @@ -576,6 +563,30 @@ void AEndlessVendettaCharacter::StopSprint() } } +void AEndlessVendettaCharacter::Jumping() +{ + if (CurrentStamina > 20.0f) + { + bHasPlayerJumped = true; + if (bHasPlayerJumped) + { + Super::Jump(); + if (!CharacterMovement->IsFalling()) + { + CurrentStamina -= 20.0f; + } + bHasPlayerJumped = false; + } + } +} + +void AEndlessVendettaCharacter::StopJump() +{ + Super::StopJumping(); + UE_LOG(LogTemp, Display, TEXT("Player has stopped jumping")); + bHasPlayerJumped = false; +} + void AEndlessVendettaCharacter::Look(const FInputActionValue& Value) { // input is a Vector2D diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h index ca2e5a99..8bfa7c05 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h @@ -175,6 +175,10 @@ public: void Sprint(); void StopSprint(); + void Jumping(); + void StopJump(); + bool bHasPlayerJumped = false; + UArrowComponent* ScopedLocationArrow; UPROPERTY(EditAnywhere, Category = "Dont Touch") From b3b2dac792bf7e6e9b74cdc3d21c41b7de43aff4 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Thu, 30 Nov 2023 15:38:16 +0000 Subject: [PATCH 16/17] Added FOV Fixes to sprint bar --- .../EndlessVendettaCharacter.cpp | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index 1fb28751..438d89e8 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -86,6 +86,7 @@ void AEndlessVendettaCharacter::Tick(float DeltaTime) } else if (MoveGroundSpeed <= 0) { + this->GetFirstPersonCameraComponent()->SetFieldOfView(90); bIsPlayerMoving = false; } if (bPressedJump) @@ -96,15 +97,18 @@ void AEndlessVendettaCharacter::Tick(float DeltaTime) } } //PLAYER STAMINA HANDLING - if (bIsPlayerSprinting) + if (MoveGroundSpeed > 0) { - CurrentStamina -= FMath::Clamp(StaminaDecreaseRate, 0.0f, 100.0f); - if (CurrentStamina <= 0.0f) + if (bIsPlayerSprinting) { - bIsPlayerSprinting = false; - this->GetFirstPersonCameraComponent()->SetFieldOfView(90); - CurrentStamina = 0.0f; - CharacterMovement->MaxWalkSpeed = OriginalWalkSpeed; + CurrentStamina -= FMath::Clamp(StaminaDecreaseRate, 0.0f, 100.0f); + if (CurrentStamina <= 0.0f) + { + bIsPlayerSprinting = false; + this->GetFirstPersonCameraComponent()->SetFieldOfView(90); + CurrentStamina = 0.0f; + CharacterMovement->MaxWalkSpeed = OriginalWalkSpeed; + } } } if (!bIsPlayerSprinting) @@ -547,8 +551,11 @@ void AEndlessVendettaCharacter::Sprint() bIsPlayerSprinting = true; if (bIsPlayerSprinting) { - CharacterMovement->MaxWalkSpeed = SprintSpeed; - this->GetFirstPersonCameraComponent()->SetFieldOfView(100); + if (MoveGroundSpeed > 0) + { + CharacterMovement->MaxWalkSpeed = SprintSpeed; + this->GetFirstPersonCameraComponent()->SetFieldOfView(100); + } } } @@ -565,7 +572,7 @@ void AEndlessVendettaCharacter::StopSprint() void AEndlessVendettaCharacter::Jumping() { - if (CurrentStamina > 20.0f) + if (CurrentStamina > 10.0f) { bHasPlayerJumped = true; if (bHasPlayerJumped) @@ -573,7 +580,7 @@ void AEndlessVendettaCharacter::Jumping() Super::Jump(); if (!CharacterMovement->IsFalling()) { - CurrentStamina -= 20.0f; + CurrentStamina -= 10.0f; } bHasPlayerJumped = false; } From cc68442e4686468eb9e249989a36f9a003bfe280 Mon Sep 17 00:00:00 2001 From: KACPER SZELEST Date: Mon, 4 Dec 2023 10:59:44 +0000 Subject: [PATCH 17/17] Updated read.me Added the mayor dialogue tree for the beginning of the game --- readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/readme.md b/readme.md index 5068be59..43d60662 100644 --- a/readme.md +++ b/readme.md @@ -17,3 +17,6 @@ https://docs.google.com/presentation/d/19U0EaM-FMOQF1PJK32SKJUJZpXn9ee6TqFE8gCit ## Asset List https://docs.google.com/document/d/1Fdbr4cpkdt6jJFpZQmIbvP3FGk25JDIMfuRHyolwX_Y/edit?usp=sharing + +## Dialogue tree +https://drive.google.com/file/d/11lsDzHkY9VMklJm8PkwArHKXqH1wdvxN/view?usp=sharing