Added the interceptor, blood spray

feature/upgrades
Jers 10 months ago
parent c5d77baa69
commit c5bafe2735

Binary file not shown.

BIN
Content/Blueprints/BP_GameState.uasset (Stored with Git LFS)

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/Levels/BattleMap.umap (Stored with Git LFS)

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/Textures/omniflash.uasset (Stored with Git LFS)

Binary file not shown.

@ -0,0 +1,5 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "AbilityUpgrade.h"

@ -2,3 +2,23 @@
#include "SelectedUpgrade.h" #include "SelectedUpgrade.h"
UUpgrade* USelectedUpgrade::GetUpgradeData() const
{
return UpgradeData;
}
int32 USelectedUpgrade::IncreaseUpgradeLevel()
{
return ++TimesSelected;
}
int32 USelectedUpgrade::GetUpgradeLevel() const
{
return TimesSelected;
}
void USelectedUpgrade::SetUpgradeData(UUpgrade* UpgradeToAdd)
{
UpgradeData = UpgradeToAdd;
}

@ -3,7 +3,4 @@
#include "UnitUpgrade.h" #include "UnitUpgrade.h"
void UUnitUpgrade::ApplyToUnit(AUnit* Unit) void UUnitUpgrade::ApplyToUnit_Implementation(AUnit* Unit, int32 UpgradeLevel){}
{
}

@ -9,20 +9,38 @@ void UUpgradeSubsystem::ApplyUnitUpgrades(AUnit* Unit)
{ {
for (const auto Upgrade : SelectedUpgrades) for (const auto Upgrade : SelectedUpgrades)
{ {
UUnitUpgrade* UnitUpgrade = Cast<UUnitUpgrade>(Upgrade.UpgradeData); UUnitUpgrade* UnitUpgrade = Cast<UUnitUpgrade>(Upgrade->GetUpgradeData());
if(UnitUpgrade != nullptr) if(UnitUpgrade != nullptr)
{ {
for (const FString Tag : Upgrade.UpgradeData->GetApplicableTags()) for (const FString Tag : UnitUpgrade->GetApplicableTags())
{ {
if(Unit->UnitTags.Contains(Tag)) if(Unit->UnitTags.Contains(Tag))
{ {
UnitUpgrade->ApplyToUnit(Unit); UnitUpgrade->ApplyToUnit(Unit, Upgrade->GetUpgradeLevel());
} }
} }
} }
} }
} }
void UUpgradeSubsystem::AddUpgrade(UUpgrade* UpgradeToAdd)
{
for(const auto Upgrade : SelectedUpgrades)
{
if(Upgrade->GetUpgradeData() == UpgradeToAdd)
{
Upgrade->IncreaseUpgradeLevel();
return;
}
}
USelectedUpgrade* NewUpgrade = NewObject<USelectedUpgrade>();
NewUpgrade->SetUpgradeData(UpgradeToAdd);
NewUpgrade->IncreaseUpgradeLevel();
SelectedUpgrades.Add(NewUpgrade);
}
void UUpgradeSubsystem::ApplyGlobalUpgrades() void UUpgradeSubsystem::ApplyGlobalUpgrades()
{ {

@ -0,0 +1,17 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Upgrade.h"
#include "AbilityUpgrade.generated.h"
/**
*
*/
UCLASS()
class SPACEBATTLER_API UAbilityUpgrade : public UUpgrade
{
GENERATED_BODY()
};

@ -9,12 +9,26 @@
/** /**
* *
*/ */
USTRUCT(BlueprintType) UCLASS(BlueprintType)
struct FSelectedUpgrade class SPACEBATTLER_API USelectedUpgrade : public UObject
{ {
GENERATED_BODY() GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable)
UUpgrade* GetUpgradeData() const;
UFUNCTION(BlueprintCallable)
void SetUpgradeData(UUpgrade* UpgradeToAdd);
UPROPERTY(BlueprintReadWrite) UFUNCTION(BlueprintCallable)
int32 IncreaseUpgradeLevel();
UFUNCTION(BlueprintCallable)
int32 GetUpgradeLevel() const;
protected:
UPROPERTY(BlueprintReadWrite, meta=(ExposeOnSpawn=true))
UUpgrade* UpgradeData; UUpgrade* UpgradeData;
UPROPERTY(BlueprintReadWrite) UPROPERTY(BlueprintReadWrite)

@ -3,6 +3,7 @@
#pragma once #pragma once
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "UnitInfo.h"
#include "GameFramework/Character.h" #include "GameFramework/Character.h"
#include "Unit.generated.h" #include "Unit.generated.h"
@ -26,6 +27,9 @@ public:
// Called to bind functionality to input // Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
UUnitInfo* UnitInfo;
/** Please add a variable description */ /** Please add a variable description */
UPROPERTY(BlueprintReadWrite, Category="Unit Info Copy") UPROPERTY(BlueprintReadWrite, Category="Unit Info Copy")
double MaxHP; double MaxHP;

@ -10,11 +10,13 @@
/** /**
* *
*/ */
UCLASS() UCLASS(Blueprintable)
class SPACEBATTLER_API UUnitUpgrade : public UUpgrade class SPACEBATTLER_API UUnitUpgrade : public UUpgrade
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
void ApplyToUnit(AUnit* Unit); UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
void ApplyToUnit(AUnit* Unit, int32 UpgradeLevel);
virtual void ApplyToUnit_Implementation(AUnit* Unit, int32 UpgradeLevel);
}; };

@ -29,4 +29,10 @@ protected:
UPROPERTY(BlueprintReadWrite, EditAnywhere) UPROPERTY(BlueprintReadWrite, EditAnywhere)
TArray<FString> ApplicableTags; TArray<FString> ApplicableTags;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
int32 Cost;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
float CostPerLevelMultiplier;
}; };

@ -22,11 +22,14 @@ public:
UFUNCTION(BlueprintCallable) UFUNCTION(BlueprintCallable)
void ApplyGlobalUpgrades(); void ApplyGlobalUpgrades();
UFUNCTION(BlueprintCallable)
void AddUpgrade(UUpgrade* UpgradeToAdd);
protected: protected:
UPROPERTY(BlueprintReadWrite) UPROPERTY(BlueprintReadWrite)
int32 BattleTier; int32 BattleTier;
UPROPERTY(BlueprintReadWrite) UPROPERTY(BlueprintReadWrite)
TArray<FSelectedUpgrade> SelectedUpgrades; TArray<USelectedUpgrade*> SelectedUpgrades;
}; };

Loading…
Cancel
Save