Merge branch 'Hub-level-blockout' into dev

This commit is contained in:
Philip W 2023-03-06 00:20:01 +00:00
commit 1cf40d1c05
103 changed files with 388 additions and 89 deletions

View File

@ -1,10 +1,15 @@
{ {
"version": "1.0", "version": "1.0",
"components": [ "components": [
"Microsoft.Net.Component.4.6.2.TargetingPack",
"Microsoft.VisualStudio.Component.VC.14.33.17.3.ARM64",
"Microsoft.VisualStudio.Component.VC.14.33.17.3.x86.x64",
"Microsoft.VisualStudio.Component.VC.Tools.ARM64", "Microsoft.VisualStudio.Component.VC.Tools.ARM64",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"Microsoft.VisualStudio.Component.Windows10SDK", "Microsoft.VisualStudio.Component.Windows10SDK",
"Microsoft.VisualStudio.Workload.CoreEditor", "Microsoft.VisualStudio.Workload.CoreEditor",
"Microsoft.VisualStudio.Workload.ManagedDesktop",
"Microsoft.VisualStudio.Workload.NativeCrossPlat",
"Microsoft.VisualStudio.Workload.NativeDesktop", "Microsoft.VisualStudio.Workload.NativeDesktop",
"Microsoft.VisualStudio.Workload.NativeGame", "Microsoft.VisualStudio.Workload.NativeGame",
"Microsoft.VisualStudio.Workload.Universal" "Microsoft.VisualStudio.Workload.Universal"

BIN
Content/Assets/Characters/Goat_Enemy/Goat_Body_low.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Assets/Characters/Goat_Enemy/Goat_Ears_low.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Assets/Characters/Goat_Enemy/Goat_Eyes_low.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Assets/Characters/Goat_Enemy/Goat_Horns_low.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Assets/Characters/Goat_Enemy/Goat_Tail_low.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Assets/Objects/Crystal/Crystal.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Assets/Objects/Crystal/Crystal_texture.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Assets/Objects/Rope_Bridge/lambert1.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/BlueprintAI/AI/AIBruh.uasset (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

BIN
Content/Blueprints/NotSkySphere.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Blueprints/StatusEffects/BP_DamageOverTime.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
Content/Levels/Build.umap (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Levels/Level_1.umap (Stored with Git LFS)

Binary file not shown.

BIN
Content/Levels/Tutorial.umap (Stored with Git LFS)

Binary file not shown.

BIN
Content/Levels/_GENERATED/kacpe/Box_191EAD20.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Levels/_GENERATED/kacpe/Box_296A6B44.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Levels/_GENERATED/kacpe/Box_67D70E40.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Levels/_GENERATED/kacpe/Box_93BF3D62.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Materials/Outline_rendering.uasset (Stored with Git LFS)

Binary file not shown.

BIN
Content/Music/Wind_and_Rope_Cue.uasset (Stored with Git LFS)

Binary file not shown.

View File

@ -5,6 +5,7 @@
#include "StatusSystem.h" #include "StatusSystem.h"
#include "Kismet/GameplayStatics.h" #include "Kismet/GameplayStatics.h"
#include "TurnBaseCombatV2.h"
#include "Components/TextBlock.h" #include "Components/TextBlock.h"
void UStatusEffect::Invoke(AActor* Character, float TimeOfInit) void UStatusEffect::Invoke(AActor* Character, float TimeOfInit)
@ -19,16 +20,33 @@ void UStatusEffect::OnExpiry(AActor* Character)
if (StatusSystem->GetActiveStatusEffect(this).StatusIcon == nullptr) return; if (StatusSystem->GetActiveStatusEffect(this).StatusIcon == nullptr) return;
StatusSystem->GetActiveStatusEffect(this).StatusIcon->RemoveFromParent(); StatusSystem->GetActiveStatusEffect(this).StatusIcon->RemoveFromParent();
StatusSystem->RemoveStatusEffect(this); StatusSystem->RemoveStatusEffect(this);
ATurnBaseCombatV2* CombatSystem = Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState());
CombatSystem->OnPlayerTurn.Remove(OnPlayerTurnDelegateHandle);
CombatSystem->OnEnemyTurn.Remove(OnEnemyTurnDelegateHandle);
} }
void UStatusEffect::OnPlayerTurn(AActor* Character) void UStatusEffect::OnPlayerTurn(AActor* Character, AActor* Enemy)
{ {
return; return;
} }
void UStatusEffect::OnEnemyTurn(AActor* Character) void UStatusEffect::OnEnemyTurn(AActor* Enemy, AActor* Character)
{ {
return; TickDown(Character);
}
void UStatusEffect::OnStatusEffectAdd(AActor* Character)
{
ATurnBaseCombatV2* CombatSystem = Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState());
OnPlayerTurnDelegateHandle = CombatSystem->OnPlayerTurn.AddUObject(this, &UStatusEffect::OnPlayerTurn);
OnEnemyTurnDelegateHandle = CombatSystem->OnEnemyTurn.AddUObject(this, &UStatusEffect::OnEnemyTurn);
}
void UStatusEffect::TickDown(AActor* Character)
{
UStatusSystem* StatusSystem = Cast<UStatusSystem>(Character->GetComponentByClass(UStatusSystem::StaticClass()));
UTextBlock* StatusText = Cast<UTextBlock>(StatusSystem->GetActiveStatusEffect(this).StatusIcon->GetWidgetFromName(TEXT("DurationText")));
StatusText->SetText(FText::FromString(FString::FromInt(BaseDuration)));
} }
void UStatusEffect::CheckForExpiry(const float TimeOfExpiry, AActor* Character) void UStatusEffect::CheckForExpiry(const float TimeOfExpiry, AActor* Character)

View File

@ -20,25 +20,34 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite) UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString Description; FString Description;
UPROPERTY(EditAnywhere, BlueprintReadWrite) UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool IsForCombatOnly = false;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float BaseDuration; float BaseDuration;
UPROPERTY(EditAnywhere, BlueprintReadWrite) UPROPERTY(EditAnywhere, BlueprintReadWrite)
UTexture2D* Icon; UTexture2D* Icon;
UFUNCTION() UFUNCTION()
virtual void Invoke(AActor* Character, float TimeOfExpiry); virtual void Invoke(AActor* Character, float TimeOfExpiry);
UFUNCTION() UFUNCTION()
virtual void OnExpiry(AActor* Character); virtual void OnExpiry(AActor* Character);
UFUNCTION() UFUNCTION()
virtual void OnPlayerTurn(AActor* Character); virtual void OnPlayerTurn(AActor* Character, AActor* Enemy);
UFUNCTION()
virtual void OnEnemyTurn(AActor* Enemy, AActor* Character);
UFUNCTION() UFUNCTION()
virtual void OnEnemyTurn(AActor* Character); virtual void OnStatusEffectAdd(AActor* Character);
UFUNCTION()
virtual void TickDown(AActor* Character);
protected: protected:
UPROPERTY() UPROPERTY()
FTimerHandle ExpiryTimerHandle; FTimerHandle ExpiryTimerHandle;
UFUNCTION() UFUNCTION()
void CheckForExpiry(float TimeOfExpiry, AActor* Character); void CheckForExpiry(float TimeOfExpiry, AActor* Character);
FDelegateHandle OnPlayerTurnDelegateHandle;
FDelegateHandle OnEnemyTurnDelegateHandle;
}; };

View File

@ -0,0 +1,17 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "DamageOverTime.h"
#include <the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.h>
void UDamageOverTime::OnEnemyTurn(AActor* Enemy, AActor* Character)
{
ATurnBaseCombatV2* CombatSystem = Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState());
CombatSystem->DamageEnemy(DamagePerTurn, "DOT");
BaseDuration -= 1.0f;
Super::OnEnemyTurn(Enemy, Character);
if (BaseDuration <= 0.0f)
{
OnExpiry(Character);
}
}

View File

@ -0,0 +1,23 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "../StatusEffect.h"
#include "DamageOverTime.generated.h"
/**
*
*/
UCLASS()
class THE_TWILIGHT_ABYSS_API UDamageOverTime : public UStatusEffect
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float DamagePerTurn = 6.0f;
//virtual void Invoke(AActor* Character, float TimeOfExpiry) override;
//virtual void OnExpiry(AActor* Character) override;
virtual void OnEnemyTurn(AActor* Enemy, AActor* Character) override;
};

View File

@ -3,6 +3,8 @@
#include "Thorns.h" #include "Thorns.h"
#include "the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.h"
void UThorns::Invoke(AActor* Character, float TimeOfExpiry) void UThorns::Invoke(AActor* Character, float TimeOfExpiry)
{ {
Super::Invoke(Character, TimeOfExpiry); Super::Invoke(Character, TimeOfExpiry);
@ -12,3 +14,15 @@ void UThorns::OnExpiry(AActor* Character)
{ {
Super::OnExpiry(Character); Super::OnExpiry(Character);
} }
void UThorns::OnEnemyTurn(AActor* Enemy, AActor* Character)
{
ATurnBaseCombatV2* CombatSystem = Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState());
CombatSystem->DamageEnemy(DamagePerTurn, "thorns");
BaseDuration -= 1.0f;
Super::OnEnemyTurn(Enemy, Character);
if (BaseDuration <= 0.0f)
{
OnExpiry(Character);
}
}

View File

@ -15,6 +15,10 @@ class THE_TWILIGHT_ABYSS_API UThorns : public UStatusEffect
GENERATED_BODY() GENERATED_BODY()
public: public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float DamagePerTurn = 3.0f;
virtual void Invoke(AActor* Character, float TimeOfExpiry) override; virtual void Invoke(AActor* Character, float TimeOfExpiry) override;
virtual void OnExpiry(AActor* Character) override; virtual void OnExpiry(AActor* Character) override;
virtual void OnEnemyTurn(AActor* Enemy, AActor* Character) override;
}; };

View File

@ -43,11 +43,21 @@ void UStatusSystem::AddStatusEffect(UStatusEffect* StatusEffect, const float Dur
FActiveStatusEffect NewStatusEffect; FActiveStatusEffect NewStatusEffect;
NewStatusEffect.StatusEffect = StatusEffect; NewStatusEffect.StatusEffect = StatusEffect;
NewStatusEffect.TimeInitiated = UGameplayStatics::GetRealTimeSeconds(GetWorld()); NewStatusEffect.TimeInitiated = UGameplayStatics::GetRealTimeSeconds(GetWorld());
NewStatusEffect.TimeTillExpiry = UGameplayStatics::GetRealTimeSeconds(GetWorld()) + StatusEffect->BaseDuration * DurationMultiplier; if (StatusEffect->IsForCombatOnly)
{
NewStatusEffect.TimeTillExpiry = StatusEffect->BaseDuration * DurationMultiplier;
}
else
{
NewStatusEffect.TimeTillExpiry = UGameplayStatics::GetRealTimeSeconds(GetWorld()) + StatusEffect->BaseDuration * DurationMultiplier;
}
NewStatusEffect.StatusIcon = CreateWidget<UUserWidget>(GetWorld(), HUDStatusIconWidget); NewStatusEffect.StatusIcon = CreateWidget<UUserWidget>(GetWorld(), HUDStatusIconWidget);
UImage* StatusIconImage = Cast<UImage>(NewStatusEffect.StatusIcon->GetWidgetFromName(TEXT("StatusIconImage"))); UImage* StatusIconImage = Cast<UImage>(NewStatusEffect.StatusIcon->GetWidgetFromName(TEXT("StatusIconImage")));
StatusIconImage->SetBrushFromTexture(StatusEffect->Icon); StatusIconImage->SetBrushFromTexture(StatusEffect->Icon);
StatusIconsBox->AddChild(NewStatusEffect.StatusIcon); StatusIconsBox->AddChild(NewStatusEffect.StatusIcon);
NewStatusEffect.StatusEffect->OnStatusEffectAdd(GetOwner());
UTextBlock* StatusText = Cast<UTextBlock>(NewStatusEffect.StatusIcon->GetWidgetFromName(TEXT("DurationText")));
StatusText->SetText(FText::FromString(FString::FromInt(NewStatusEffect.TimeTillExpiry)));
if (Invoke) NewStatusEffect.StatusEffect->Invoke(GetOwner(), NewStatusEffect.TimeTillExpiry); if (Invoke) NewStatusEffect.StatusEffect->Invoke(GetOwner(), NewStatusEffect.TimeTillExpiry);
ActiveStatusEffects.Add(NewStatusEffect); ActiveStatusEffects.Add(NewStatusEffect);

Some files were not shown because too many files have changed in this diff Show More