diff --git a/Content/Assets/Items/RepairKit_BP.uasset b/Content/Assets/Items/RepairKit_BP.uasset index 9715730..e073c4d 100644 --- a/Content/Assets/Items/RepairKit_BP.uasset +++ b/Content/Assets/Items/RepairKit_BP.uasset Binary files differ diff --git a/Content/Assets/NewTargetSystem/Targets_BP.uasset b/Content/Assets/NewTargetSystem/Targets_BP.uasset index aead2de..ba3d0cc 100644 --- a/Content/Assets/NewTargetSystem/Targets_BP.uasset +++ b/Content/Assets/NewTargetSystem/Targets_BP.uasset Binary files differ diff --git a/Content/Assets/NormieAsset/Test_anim.uasset b/Content/Assets/NormieAsset/Test_anim.uasset index 1af695d..176bf63 100644 --- a/Content/Assets/NormieAsset/Test_anim.uasset +++ b/Content/Assets/NormieAsset/Test_anim.uasset Binary files differ diff --git a/Content/Levels/MainMenu_Level.umap b/Content/Levels/MainMenu_Level.umap index 389e61a..fd0853e 100644 --- a/Content/Levels/MainMenu_Level.umap +++ b/Content/Levels/MainMenu_Level.umap Binary files differ diff --git a/Content/Levels/StartMap.umap b/Content/Levels/StartMap.umap index 850fea2..8e6f10d 100644 --- a/Content/Levels/StartMap.umap +++ b/Content/Levels/StartMap.umap Binary files differ diff --git a/Content/Matchmaking_Widget.uasset b/Content/Matchmaking_Widget.uasset deleted file mode 100644 index 45b1e4b..0000000 --- a/Content/Matchmaking_Widget.uasset +++ /dev/null Binary files differ diff --git a/Content/NewGameMode_BP.uasset b/Content/NewGameMode_BP.uasset deleted file mode 100644 index 9b1769d..0000000 --- a/Content/NewGameMode_BP.uasset +++ /dev/null Binary files differ diff --git a/Content/PlaneTest/Targets_BP.uasset b/Content/PlaneTest/Targets_BP.uasset deleted file mode 100644 index 5d99570..0000000 --- a/Content/PlaneTest/Targets_BP.uasset +++ /dev/null Binary files differ diff --git a/Content/ScoreGameMode_BP.uasset b/Content/ScoreGameMode_BP.uasset index b1bf758..25c7c07 100644 --- a/Content/ScoreGameMode_BP.uasset +++ b/Content/ScoreGameMode_BP.uasset Binary files differ diff --git a/Source/SkyFrontier/Private/DamageSystem.cpp b/Source/SkyFrontier/Private/DamageSystem.cpp index 2109ad6..fa034bd 100644 --- a/Source/SkyFrontier/Private/DamageSystem.cpp +++ b/Source/SkyFrontier/Private/DamageSystem.cpp @@ -5,6 +5,9 @@ { PrimaryComponentTick.bCanEverTick = false; PrimaryComponentTick.bStartWithTickEnabled = false; + SetIsReplicated(true); + ShootingDamage = 20; + MissileDamage = 50; } diff --git a/Source/SkyFrontier/Private/HealthSystem.cpp b/Source/SkyFrontier/Private/HealthSystem.cpp index f63c56b..f15c573 100644 --- a/Source/SkyFrontier/Private/HealthSystem.cpp +++ b/Source/SkyFrontier/Private/HealthSystem.cpp @@ -1,11 +1,14 @@ #include "HealthSystem.h" #include "Net/UnrealNetwork.h" #include "Engine/Engine.h" +#include "Components/ActorComponent.h" UHealthSystem::UHealthSystem() { PrimaryComponentTick.bCanEverTick = false; PrimaryComponentTick.bStartWithTickEnabled = false; + SetIsReplicated(true); + MaxHealth = 100; } void UHealthSystem::BeginPlay() diff --git a/Source/SkyFrontier/Private/PointsComponent.cpp b/Source/SkyFrontier/Private/PointsComponent.cpp index 9d8b267..c950c74 100644 --- a/Source/SkyFrontier/Private/PointsComponent.cpp +++ b/Source/SkyFrontier/Private/PointsComponent.cpp @@ -5,43 +5,30 @@ { PrimaryComponentTick.bCanEverTick = false; PrimaryComponentTick.bStartWithTickEnabled = false; + SetIsReplicated(true); } void UPointsComponent::BeginPlay() { Super::BeginPlay(); - P1Points = 0; - P2Points = 0; + Points = 0; } void UPointsComponent::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const { Super::GetLifetimeReplicatedProps(OutLifetimeProps); - DOREPLIFETIME(UPointsComponent, P1Points); - DOREPLIFETIME(UPointsComponent, P2Points); + DOREPLIFETIME(UPointsComponent, Points); } -int UPointsComponent::GetP1Points() const +int UPointsComponent::GetPoints() const { - return P1Points; + return Points; } -int UPointsComponent::GetP2Points() const +void UPointsComponent::AddPoints_Implementation(const int PointsToAdd) { - return P2Points; -} - -void UPointsComponent::AddP1Points_Implementation(const int PointsToAdd) -{ - P1Points += PointsToAdd; - - OnPointsReceiveEvent.Broadcast(PointsToAdd); -} - -void UPointsComponent::AddP2Points_Implementation(const int PointsToAdd) -{ - P2Points += PointsToAdd; + Points += PointsToAdd; OnPointsReceiveEvent.Broadcast(PointsToAdd); } \ No newline at end of file diff --git a/Source/SkyFrontier/Private/ScoreAttackGameMode.cpp b/Source/SkyFrontier/Private/ScoreAttackGameMode.cpp index 049579b..93c8f34 100644 --- a/Source/SkyFrontier/Private/ScoreAttackGameMode.cpp +++ b/Source/SkyFrontier/Private/ScoreAttackGameMode.cpp @@ -42,12 +42,12 @@ if (PointsComponent1 && PointsComponent2 && !bGameEnded) { - if (PointsComponent1->P1Points >= GoalScore) + if (PointsComponent1->Points >= GoalScore) { UE_LOG(LogTemp, Warning, TEXT("Player 1 Wins!")); bGameEnded = true; } - else if (PointsComponent2->P2Points >= GoalScore) + else if (PointsComponent2->Points >= GoalScore) { UE_LOG(LogTemp, Warning, TEXT("Player 2 Wins!")); bGameEnded = true; diff --git a/Source/SkyFrontier/Public/HealthSystem.h b/Source/SkyFrontier/Public/HealthSystem.h index 81f696d..93d1e4e 100644 --- a/Source/SkyFrontier/Public/HealthSystem.h +++ b/Source/SkyFrontier/Public/HealthSystem.h @@ -17,7 +17,6 @@ public: // Sets default values for this component's properties UHealthSystem(); - UFUNCTION(BlueprintPure) float GetHealth() const; UFUNCTION(BlueprintPure) @@ -25,7 +24,6 @@ UFUNCTION(BlueprintPure) float GetShield() const; - UFUNCTION(BlueprintCallable) void TakeDamage(float Amount); UFUNCTION(BlueprintCallable) diff --git a/Source/SkyFrontier/Public/PointsComponent.h b/Source/SkyFrontier/Public/PointsComponent.h index b0cee5c..5248c0f 100644 --- a/Source/SkyFrontier/Public/PointsComponent.h +++ b/Source/SkyFrontier/Public/PointsComponent.h @@ -16,14 +16,10 @@ UPointsComponent(); UFUNCTION(BlueprintCallable, Category = "Points") - int GetP1Points() const; - UFUNCTION(BlueprintCallable, Category = "Points") -int GetP2Points() const; + int GetPoints() const; UFUNCTION(Server, Reliable, BlueprintCallable, Category = "Points") - void AddP1Points(int PointsToAdd); - UFUNCTION(Server, Reliable, BlueprintCallable, Category = "Points") - void AddP2Points(int PointsToAdd); + void AddPoints(int PointsToAdd); protected: // Functions @@ -39,7 +35,5 @@ public: UPROPERTY(Replicated, VisibleAnywhere, Category = "Points") - int P1Points; - UPROPERTY(Replicated, VisibleAnywhere, Category = "Points") - int P2Points; + int Points; }; \ No newline at end of file