diff --git a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml
index 986497e0..a337877d 100644
--- a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml
+++ b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml
@@ -11,10 +11,14 @@
-
+
+
+
+
+
@@ -129,7 +133,7 @@
1705182847910
-
+
diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset
index 4f45626b..9e824917 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:84374622c6dc77769d398e52fdd2dcacc7eab0bc4c651ac6ec3b77a019ed52f7
-size 68984
+oid sha256:c99ec2b828cf671d0d33afa160e745375f0b82d79a8b49f2e9e74c0b68aedd7f
+size 76231
diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/WBP_Fade.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/WBP_Fade.uasset
new file mode 100644
index 00000000..fafe56ed
--- /dev/null
+++ b/EndlessVendetta/Content/FirstPerson/Blueprints/WBP_Fade.uasset
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0c7e25f0c142b4aa1486a6b3b02c8fb0bb62cb2e9e78541b3d7045f1d899d5e6
+size 50956
diff --git a/EndlessVendetta/Content/Levels/ControlTutorialLevel.umap b/EndlessVendetta/Content/Levels/ControlTutorialLevel.umap
index 359490de..6d77e195 100644
--- a/EndlessVendetta/Content/Levels/ControlTutorialLevel.umap
+++ b/EndlessVendetta/Content/Levels/ControlTutorialLevel.umap
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:40716dd78ee18731e93233dd0ed13c534868e5e9521a172e8a033011af33363d
-size 3336963
+oid sha256:9bae1373774782a35a5a728192412fe8577428a4ac37418a878beafe48aa8635
+size 3337229
diff --git a/EndlessVendetta/Content/Ships/LandingZone.uasset b/EndlessVendetta/Content/Ships/LandingZone.uasset
index b757b91a..32fb9317 100644
--- a/EndlessVendetta/Content/Ships/LandingZone.uasset
+++ b/EndlessVendetta/Content/Ships/LandingZone.uasset
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:db9d0fc8ce80a02b1e98bac5b9cde0ccfe6a8af33090148f6179911d95b82519
-size 95888
+oid sha256:4ea90e487ea5bf751b7573ac6ef2be781c1efdf4e0bae7c8b95f9fbf0c4169dd
+size 113548
diff --git a/EndlessVendetta/Content/Ships/WBP_LandingZone.uasset b/EndlessVendetta/Content/Ships/WBP_LandingZone.uasset
new file mode 100644
index 00000000..cffc2c94
--- /dev/null
+++ b/EndlessVendetta/Content/Ships/WBP_LandingZone.uasset
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a9f9779b6493926f2aae045f726131d3863402a296802a028f28a9f5b069efce
+size 43413
diff --git a/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset b/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset
index c2a34afc..c72cbe35 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:3547af12b2166749b5455dcae2735a5a1a5f04c5bc8baa3b4237b0e56d175b96
+size 14831
diff --git a/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset b/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset
index 01a79a1d..bf2e4391 100644
--- a/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset
+++ b/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:5f0f656076ea54ab67b8dfbc812f47028550c19f3b4db815d1937d0edbb5d02a
-size 53268
+oid sha256:01ef616c7a8bd90cd1b7a13efb18a56f33346efbae51efa31f09804478b7621d
+size 43456
diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp
index 5b4f0f94..0e80ae88 100644
--- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp
+++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp
@@ -213,6 +213,11 @@ void AEndlessVendettaCharacter::SetupPlayerInputComponent(class UInputComponent*
void AEndlessVendettaCharacter::Interact()
{
+ if (PlayerOnShip)
+ {
+ SpaceShip->PlayerInteracting();
+ return;
+ }
FHitResult OutHit;
FCollisionQueryParams QueryParams = FCollisionQueryParams::DefaultQueryParam;
QueryParams.AddIgnoredActor(this);
@@ -236,6 +241,7 @@ void AEndlessVendettaCharacter::Interact()
void AEndlessVendettaCharacter::SetCrouch()
{
+ if (PlayerOnShip) return;
Crouch();
}
@@ -279,6 +285,7 @@ float AEndlessVendettaCharacter::TakeDamage(const float DamageAmount, FDamageEve
void AEndlessVendettaCharacter::ToggleRecon()
{
+ if (PlayerOnShip) return;
if (!GadgetManager->IsValidReconGadget()) return;
if (IsValid(PrimaryWeapon)) EquipPrimary();
@@ -301,6 +308,7 @@ void AEndlessVendettaCharacter::ToggleRecon()
void AEndlessVendettaCharacter::ToggleCombat()
{
+ if (PlayerOnShip) return;
if (!GadgetManager->IsValidCombatGadget()) return;
if (IsValid(PrimaryWeapon)) EquipPrimary();
@@ -325,6 +333,7 @@ void AEndlessVendettaCharacter::ToggleCombat()
//When 1 is pressed it calls EquipPrimary
void AEndlessVendettaCharacter::EquipPrimary()
{
+ if (PlayerOnShip) return;
FActorSpawnParameters spawnParams;
spawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, true);
@@ -376,6 +385,7 @@ void AEndlessVendettaCharacter::EquipPrimary()
void AEndlessVendettaCharacter::EquipSecondary()
{
+ if (PlayerOnShip) return;
FActorSpawnParameters spawnParams;
spawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, true);
@@ -670,12 +680,19 @@ void AEndlessVendettaCharacter::UpdateInventorySize(int Cols, int Rows)
void AEndlessVendettaCharacter::EnterShip(FTransform TakeoffLoc)
{
+ PlayFadeScreen();
+ if (IsValid(PrimaryWeapon)) EquipPrimary();
+ if (IsValid(SecondaryWeapon)) EquipSecondary();
SpaceShip = GetWorld()->SpawnActor(SpaceShipClass, TakeoffLoc.GetLocation(), TakeoffLoc.Rotator());
PlayerOnShip = true;
}
void AEndlessVendettaCharacter::ExitShip(FTransform ExitLoc)
{
- UE_LOG(LogTemp, Warning, TEXT("Exitting Ship!!!"));
+ PlayFadeScreen();
+ SetActorLocation(ExitLoc.GetLocation());
+ GetController()->SetControlRotation(ExitLoc.Rotator());
+ SpaceShip->Destroy();
+ PlayerOnShip = false;
}
diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h
index 07d8cf43..3b1c9641 100644
--- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h
+++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h
@@ -124,6 +124,9 @@ protected:
FTimerHandle RegenHealthTimerHandle;
void Heal(const float Amount);
+ UFUNCTION(BlueprintImplementableEvent)
+ void PlayFadeScreen();
+
public:
int Money = 2000;
AGadgetManager* GadgetManager;
diff --git a/EndlessVendetta/Source/EndlessVendetta/SpaceShip/LandingZone.h b/EndlessVendetta/Source/EndlessVendetta/SpaceShip/LandingZone.h
index e273fff0..94314505 100644
--- a/EndlessVendetta/Source/EndlessVendetta/SpaceShip/LandingZone.h
+++ b/EndlessVendetta/Source/EndlessVendetta/SpaceShip/LandingZone.h
@@ -20,10 +20,12 @@ class ENDLESSVENDETTA_API ALandingZone : public AActor, public IInteractionInter
// Hides or shows key aesthetic features of LZ's based on if the player is landing or not
void UpdateAllLandingZones(bool Landing);
+
+
protected:
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Landing Zone")
bool IsHomeBase_LZ = false;
-
+
// Allows player to enter their ship through a LZ
void Interact() override;
void InteractPrompt() override;
@@ -32,6 +34,10 @@ public:
// Sets default values for this actor's properties
ALandingZone();
+ // Waypoint will display something along the lines of Press F to Land
+ UFUNCTION(BlueprintImplementableEvent)
+ void SuggestLandingWidget();
+
// Ran when a player takes off from any LZ in the world
UFUNCTION(BlueprintImplementableEvent)
void ShowWaypoint();
diff --git a/EndlessVendetta/Source/EndlessVendetta/SpaceShip/SpaceShip.cpp b/EndlessVendetta/Source/EndlessVendetta/SpaceShip/SpaceShip.cpp
index 1bfe5124..5eb4610a 100644
--- a/EndlessVendetta/Source/EndlessVendetta/SpaceShip/SpaceShip.cpp
+++ b/EndlessVendetta/Source/EndlessVendetta/SpaceShip/SpaceShip.cpp
@@ -12,6 +12,21 @@ ASpaceShip::ASpaceShip()
PrimaryActorTick.bCanEverTick = true;
}
+void ASpaceShip::SightCheck()
+{
+ FHitResult OutHit;
+ FCollisionObjectQueryParams ObjectQueryParams;
+ ObjectQueryParams.AddObjectTypesToQuery(ECollisionChannel::ECC_GameTraceChannel2);
+ FVector LT_Start = SeatComponent->GetComponentLocation();
+ FVector LT_End = LT_Start + (SeatComponent->GetForwardVector() * 50000);
+ GetWorld()->LineTraceSingleByObjectType(OutHit, LT_Start, LT_End, ObjectQueryParams);
+ ALandingZone* LZ = Cast(OutHit.GetActor());
+ if (!IsValid(LZ)) return;
+ Potential_LZ = LZ;
+ LZ->SuggestLandingWidget();
+}
+
+
// Called when the game starts or when spawned
void ASpaceShip::BeginPlay()
{
@@ -30,6 +45,8 @@ void ASpaceShip::Tick(float DeltaTime)
PlayersCharacter->SetActorLocation(SeatComponent->GetComponentLocation());
PlayersController->SetControlRotation(GetActorRotation());
+
+ SightCheck();
}
// Called to bind functionality to input
@@ -39,6 +56,12 @@ void ASpaceShip::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent
}
+void ASpaceShip::PlayerInteracting()
+{
+ if (IsValid(Potential_LZ)) Potential_LZ->Land();
+}
+
+
void ASpaceShip::MoveShip(FVector2D MovementVector)
{
// Get ships direction vectors, and ignore their pitch
@@ -47,7 +70,6 @@ void ASpaceShip::MoveShip(FVector2D MovementVector)
FVector RightVector = GetActorRightVector();
RightVector.Y += RightVector.Z;
RightVector.Z = 0;
- UE_LOG(LogTemp, Warning, TEXT("Forward:%f, Sideways:%f"), MovementVector.Y, MovementVector.X);
AddMovementInput(ForwardVector, MovementVector.Y, true);
AddMovementInput(RightVector, MovementVector.X, true);
}
diff --git a/EndlessVendetta/Source/EndlessVendetta/SpaceShip/SpaceShip.h b/EndlessVendetta/Source/EndlessVendetta/SpaceShip/SpaceShip.h
index f73ddf23..78f0ed03 100644
--- a/EndlessVendetta/Source/EndlessVendetta/SpaceShip/SpaceShip.h
+++ b/EndlessVendetta/Source/EndlessVendetta/SpaceShip/SpaceShip.h
@@ -3,6 +3,7 @@
#pragma once
#include "CoreMinimal.h"
+#include "LandingZone.h"
#include "GameFramework/Character.h"
#include "SpaceShip.generated.h"
@@ -16,6 +17,10 @@ class ENDLESSVENDETTA_API ASpaceShip : public ACharacter
AController* PlayersController;
UArrowComponent* SeatComponent;
+ ALandingZone* Potential_LZ;
+
+ void SightCheck();
+
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
@@ -30,6 +35,8 @@ public:
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
+ void PlayerInteracting();
+
void MoveShip(FVector2D MovementVector);
void RotateShip(FVector2D LookAxisVector);