diff --git a/Project/Content/Core/AbilitySystem/GE_CrystalHeal.uasset b/Project/Content/Core/AbilitySystem/GE_CrystalHeal.uasset new file mode 100644 index 0000000..ce54ec8 --- /dev/null +++ b/Project/Content/Core/AbilitySystem/GE_CrystalHeal.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e8a67584ec74875fe4aabb0ce488ca4f5218171c77dce9fdc2026c2214c4bc6 +size 13691 diff --git a/Project/Content/Core/AbilitySystem/GE_CrystalMana.uasset b/Project/Content/Core/AbilitySystem/GE_CrystalMana.uasset new file mode 100644 index 0000000..638d85c --- /dev/null +++ b/Project/Content/Core/AbilitySystem/GE_CrystalMana.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0da214109d2ef94853402999b23355509eb407d743fd82b5808ac43141bf2b6 +size 13254 diff --git a/Project/Content/Core/Pickups/BP_HealthCrystal.uasset b/Project/Content/Core/Pickups/BP_HealthCrystal.uasset new file mode 100644 index 0000000..c5191e9 --- /dev/null +++ b/Project/Content/Core/Pickups/BP_HealthCrystal.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:867f9694bc84970eb6373196e244519df8f325d02f9f7901cd0534107ac28dc4 +size 41427 diff --git a/Project/Content/Core/Pickups/BP_HealthPotion_RawEffect.uasset b/Project/Content/Core/Pickups/BP_HealthPotion_RawEffect.uasset index 95c9752..076be4f 100644 --- a/Project/Content/Core/Pickups/BP_HealthPotion_RawEffect.uasset +++ b/Project/Content/Core/Pickups/BP_HealthPotion_RawEffect.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1ba43c30f9059ee9bdfcc53789e8f97c34ab6ef213c79b2534f70d0892a0721c -size 46379 +oid sha256:44b3285008cf6a0a72c6c57f18c7ed3c380da31b0f2d833993fb3fa829de02a9 +size 40761 diff --git a/Project/Content/Core/Pickups/BP_ManaCrystal.uasset b/Project/Content/Core/Pickups/BP_ManaCrystal.uasset new file mode 100644 index 0000000..743fae7 --- /dev/null +++ b/Project/Content/Core/Pickups/BP_ManaCrystal.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:925967b849df86b5a0205b90f3f2b7119804f7231edf888e0a7b8420f2251015 +size 41495 diff --git a/Project/Content/Core/Pickups/BP_ManaPotion_RawEffect.uasset b/Project/Content/Core/Pickups/BP_ManaPotion_RawEffect.uasset index 03c70c4..7e56302 100644 --- a/Project/Content/Core/Pickups/BP_ManaPotion_RawEffect.uasset +++ b/Project/Content/Core/Pickups/BP_ManaPotion_RawEffect.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9895a29978f430d250a63dc180d2082b4c039f598161a385e389b88f2c9597d1 -size 49171 +oid sha256:63d1d0ae623f7841e744a409baf9611c4764f57297c429ed8d15866038f41dad +size 40996 diff --git a/Project/Content/Levels/StartupMap.umap b/Project/Content/Levels/StartupMap.umap index 0dbb1e5..559db73 100644 --- a/Project/Content/Levels/StartupMap.umap +++ b/Project/Content/Levels/StartupMap.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:486a8343f43f9e0546fd092a420873c910bd5954e0ede77882281ec5a3c5c7f7 -size 77507 +oid sha256:61b51c0fca352d0624d8b7e77ed61d6e67216879b904cd2201e200b7a39da2bf +size 80877 diff --git a/Project/Content/MaterialLibrary/M_Crystal.uasset b/Project/Content/MaterialLibrary/M_Crystal.uasset new file mode 100644 index 0000000..ef83bbd --- /dev/null +++ b/Project/Content/MaterialLibrary/M_Crystal.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:461070ebf4e60dc534207e945c16aca6f2181de6894587a619e76ee04c2c5505 +size 29218 diff --git a/Project/Content/Pickups/HealthCrystal/Materials/MI_HealthCrystal.uasset b/Project/Content/Pickups/HealthCrystal/Materials/MI_HealthCrystal.uasset index 2373adc..6a0049b 100644 --- a/Project/Content/Pickups/HealthCrystal/Materials/MI_HealthCrystal.uasset +++ b/Project/Content/Pickups/HealthCrystal/Materials/MI_HealthCrystal.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d9e466093a2f228d1d0f9f436d7292c10522a680fb15bf9462f9bfe2d3d174fb -size 12339 +oid sha256:e4c20923b61a597b67530d701efae564bfa155e15a889021cb6489561795b746 +size 12276 diff --git a/Project/Content/Pickups/HealthCrystal/Materials/M_HealthCrystal.uasset b/Project/Content/Pickups/HealthCrystal/Materials/M_HealthCrystal.uasset deleted file mode 100644 index b5c6de9..0000000 --- a/Project/Content/Pickups/HealthCrystal/Materials/M_HealthCrystal.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:be2d520e7162d45f417f4dbbe80690843961767b52fd94d895c982bbd2df4374 -size 16646 diff --git a/Project/Content/Pickups/MI_CrystalMana.uasset b/Project/Content/Pickups/MI_CrystalMana.uasset new file mode 100644 index 0000000..cfbfd4f --- /dev/null +++ b/Project/Content/Pickups/MI_CrystalMana.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0bf677a536daa07655d2ccb9f7e4f66307d5a3d02c0e5de7f46028d00c8aabba +size 12839 diff --git a/Project/Source/Gasa/AbilitySystem/GasaAttributeSet.cpp b/Project/Source/Gasa/AbilitySystem/GasaAttributeSet.cpp index 119eca9..d8588df 100644 --- a/Project/Source/Gasa/AbilitySystem/GasaAttributeSet.cpp +++ b/Project/Source/Gasa/AbilitySystem/GasaAttributeSet.cpp @@ -8,9 +8,9 @@ UGasaAttributeSet::UGasaAttributeSet() { - InitHealth( 100.f ); + InitHealth( 50.f ); InitMaxHealth( 100.f ); - InitMana( 50.f ); + InitMana( 25.f ); InitMaxMana( 50.f ); } diff --git a/Project/Source/Gasa/AbilitySystem/GasaEffectActor.cpp b/Project/Source/Gasa/AbilitySystem/GasaEffectActor.cpp index f4b4783..fc73561 100644 --- a/Project/Source/Gasa/AbilitySystem/GasaEffectActor.cpp +++ b/Project/Source/Gasa/AbilitySystem/GasaEffectActor.cpp @@ -17,8 +17,7 @@ void AGasaEffectActor::ApplyEffectToActor(AActor* Actor, TSubclassOfMakeEffectContext(); Context.AddSourceObject(Actor); - + FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( EffectClass, 1.0f, Context ); - if (Spec.IsValid()) - AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); + AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); } diff --git a/Project/Source/Gasa/AbilitySystem/GasaEffectActor.h b/Project/Source/Gasa/AbilitySystem/GasaEffectActor.h index 49d3be8..24ae180 100644 --- a/Project/Source/Gasa/AbilitySystem/GasaEffectActor.h +++ b/Project/Source/Gasa/AbilitySystem/GasaEffectActor.h @@ -13,7 +13,10 @@ class GASA_API AGasaEffectActor : public AGasaActor public: UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects") - TSoftClassPtr InstantEffectClass; + TSubclassOf InstantEffectClass; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects") + TSubclassOf DurationEffectClass; AGasaEffectActor(); diff --git a/Project/Source/Gasa/Game/GasaGameState.cpp b/Project/Source/Gasa/Game/GasaGameState.cpp index 2cfadd6..772b6be 100644 --- a/Project/Source/Gasa/Game/GasaGameState.cpp +++ b/Project/Source/Gasa/Game/GasaGameState.cpp @@ -96,14 +96,11 @@ void AGasaGameState::BeginPlay() GI->NotifyGameFrameworkClassReady(EGameFrameworkClassFlag::GameState); #if ENABLE_COG - for (local_persist int32 do_once = 0; do_once == 0; ++ do_once ) - { - CogWindowManager = NewObject(this); - CogWindowManagerRef = CogWindowManager; + CogWindowManager = NewObject(this); + CogWindowManagerRef = CogWindowManager; - // Add all the built-in windows - Cog::AddAllWindows(*CogWindowManager); - } + // Add all the built-in windows + Cog::AddAllWindows(*CogWindowManager); #endif //ENABLE_COG } diff --git a/Project/Source/Gasa/Game/GasaGameState.cpp~ b/Project/Source/Gasa/Game/GasaGameState.cpp~ new file mode 100644 index 0000000..772b6be --- /dev/null +++ b/Project/Source/Gasa/Game/GasaGameState.cpp~ @@ -0,0 +1,147 @@ +#include "GasaGameState.h" + +#include "CogAll.h" +#include "CogWindowManager.h" +#include "GasaPlayerState.h" +#include "GasaGameInstance.h" +#include "Net/UnrealNetwork.h" +#include "Networking/GasaNetLibrary_Inlines.h" +using namespace Gasa; + +AGasaGameState::AGasaGameState() +{ + // Enable ticking + PrimaryActorTick.bCanEverTick = true; + PrimaryActorTick.SetTickFunctionEnable(true); + PrimaryActorTick.bStartWithTickEnabled = true; + + // Replication + bReplicates = true; + bNetLoadOnClient = false; + NetDormancy = DORM_Awake; + NetCullDistanceSquared = NetCullDist_Default; + NetUpdateFrequency = 10.0f; + MinNetUpdateFrequency = 1.0f; + NetPriority = 5.0f; +} + +#pragma region GameFramework +void AGasaGameState::OnGameFrameworkInitialized() +{ + NetLog("Received gameplay framework initialization."); + if (IsServer()) + { + if (PlayerArray.Num() > 0) + { + ListenServerHost = Cast(PlayerArray[0]); + } + else + { + NetLog("Was not able to assign HostingPlayer!", ELogV::Error); + } + } + BP_OnGameFrameworkInitialized(); +} +#pragma endregion GameFramework + +#pragma region Networking +void AGasaGameState::Client_OnRep_OnlinePlayers() +{ +} +#pragma endregion Networking + +#pragma region Seamless Travel +void AGasaGameState::Multicast_R_NotifySeamlessTravelEnd_Implementation() +{ + NetLog("Multicast_R_NotifySeamlessTravelEnd_Implementation"); + BP_Event_OnSeamlessTravelEnd.Broadcast(); + Event_OnSeamlessTravelEnd.Broadcast(); +} +#pragma endregion Seamless Travel + +#pragma region GameStateBase +void AGasaGameState::HandleBeginPlay() +{ + Super::HandleBeginPlay(); + NetLog("HandleBeginPlay: Directly called from GM"); +} + +void AGasaGameState::SeamlessTravelTransitionCheckpoint(bool bToTransitionMap) +{ + Super::SeamlessTravelTransitionCheckpoint(bToTransitionMap); + NetLog("SeamlessTravelTransitionCheckpoint"); + NetLog(FString("ToTransitionMap: ") + FString(bToTransitionMap ? "true" : "false")); + + if (bToTransitionMap) + { + Event_OnSeamlessTravelStart.Broadcast(); + } + else + { + Multicast_R_NotifySeamlessTravelEnd(); + } +} +#pragma endregion GameStateBase + +#pragma region Actor +void AGasaGameState::BeginPlay() +{ + Super::BeginPlay(); + NetLog("BeginPlay"); + + // Notified as initialized here as any possible components should also be initialized by this point. + UGasaGameInstance* + GI = GetGameInstance(); + GI->Event_OnGameFrameworkInitialized.AddDynamic(this, & ThisClass::OnGameFrameworkInitialized); + GI->NotifyGameFrameworkClassReady(EGameFrameworkClassFlag::GameState); + +#if ENABLE_COG + CogWindowManager = NewObject(this); + CogWindowManagerRef = CogWindowManager; + + // Add all the built-in windows + Cog::AddAllWindows(*CogWindowManager); +#endif //ENABLE_COG +} + +void AGasaGameState::PostInitializeComponents() +{ + NetLog("PostInitializeComponents"); + Super::PostInitializeComponents(); + + if ( ! GetWorld()->IsEditorWorld() && IsServer()) + { + OnlinePlayers.Empty(); +#if 0 + const auto GI = Cast(GetGameInstance()); + if (GI != nullptr) + { + int32 NumConnections = GI->SessionSettings.bPublicGame + ? GI->SessionSettings.PublicConnections + : GI->SessionSettings.PrivateConnections; + OnlinePlayers.Init(nullptr, NumConnections); + } +#endif + } +} + +void AGasaGameState::Tick(float DeltaSeconds) +{ + Super::Tick(DeltaSeconds); + +#if ENABLE_COG + if (CogWindowManager) + CogWindowManager->Tick(DeltaSeconds); +#endif //ENABLE_COG +} +#pragma endregion Actor + +#pragma region UObject +void AGasaGameState::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const +{ + Super::GetLifetimeReplicatedProps(OutLifetimeProps); + + DOREPLIFETIME(AGasaGameState, ListenServerHost); + DOREPLIFETIME(AGasaGameState, OnlinePlayers); +} +#pragma endregion UObject