Created new Main Bounty Class
Seperates new properties and behaviours associated with only the main bounties and not any other bounties
This commit is contained in:
parent
c6db0146e4
commit
546e7b4a6d
BIN
EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset
(Stored with Git LFS)
Binary file not shown.
@ -93,26 +93,6 @@ void ABountyClass::CollectRewards_Implementation()
|
|||||||
UE_LOG(LogTemp, Warning, TEXT("The player has gained $%d for completing the bounty!"), RewardMoney);
|
UE_LOG(LogTemp, Warning, TEXT("The player has gained $%d for completing the bounty!"), RewardMoney);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ABountyClass::BuySpawnAmmoDrops()
|
|
||||||
{
|
|
||||||
FActorSpawnParameters SpawnParameters;
|
|
||||||
SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
|
|
||||||
for (FTransform Spawn : AmmoDropSpawnTransforms)
|
|
||||||
{
|
|
||||||
GetWorld()->SpawnActor<AActor>(AmmoDropClass, Spawn.GetLocation(), Spawn.GetRotation().Rotator(), SpawnParameters);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ABountyClass::BuySpawnHealthDrops()
|
|
||||||
{
|
|
||||||
FActorSpawnParameters SpawnParameters;
|
|
||||||
SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
|
|
||||||
for (FTransform Spawn : HealthDropSpawnTransforms)
|
|
||||||
{
|
|
||||||
GetWorld()->SpawnActor<AActor>(HealthDropClass, Spawn.GetLocation(), Spawn.GetRotation().Rotator(), SpawnParameters);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,9 +24,6 @@ protected:
|
|||||||
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
||||||
TArray<TSubclassOf<ACheckpointClass>> CheckpointsToSpawn;
|
TArray<TSubclassOf<ACheckpointClass>> CheckpointsToSpawn;
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
|
||||||
TArray<TSubclassOf<ABountyClass>> SideBountiesToSpawn;
|
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
||||||
int RewardMoney = 0;
|
int RewardMoney = 0;
|
||||||
|
|
||||||
@ -35,39 +32,6 @@ protected:
|
|||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
||||||
FString BountyDesc;
|
FString BountyDesc;
|
||||||
// ---------------- Bounty Alterations ----------------
|
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
|
||||||
FString CustomBountyAlteration_1_Description;
|
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
|
||||||
int CustomBountyAlteration_1_Cost = 2;
|
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
|
||||||
FString CustomBountyAlteration_2_Description;
|
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
|
||||||
int CustomBountyAlteration_2_Cost = 2;
|
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
|
||||||
FString CustomBountyAlteration_3_Description;
|
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
|
||||||
int CustomBountyAlteration_3_Cost = 2;
|
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
|
||||||
TArray<FTransform> AmmoDropSpawnTransforms;
|
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
|
||||||
TSubclassOf<AActor> AmmoDropClass;
|
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
|
||||||
TArray<FTransform> HealthDropSpawnTransforms;
|
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
|
||||||
TSubclassOf<AActor> HealthDropClass;
|
|
||||||
|
|
||||||
bool HasEnemyRadio = false;
|
|
||||||
|
|
||||||
// -----------------------------------------------
|
// -----------------------------------------------
|
||||||
|
|
||||||
bool Completed = false;
|
bool Completed = false;
|
||||||
@ -92,10 +56,6 @@ public:
|
|||||||
return Completed;
|
return Completed;
|
||||||
}
|
}
|
||||||
|
|
||||||
TArray<TSubclassOf<ABountyClass>> GetSideBountiesToSpawn()
|
|
||||||
{
|
|
||||||
return SideBountiesToSpawn;
|
|
||||||
}
|
|
||||||
FString GetBountyTitle()
|
FString GetBountyTitle()
|
||||||
{
|
{
|
||||||
return BountyTitle;
|
return BountyTitle;
|
||||||
@ -160,67 +120,4 @@ public:
|
|||||||
// Collect Money in C++, any other special reward will be implemented in BP if neccessary
|
// Collect Money in C++, any other special reward will be implemented in BP if neccessary
|
||||||
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
|
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
|
||||||
void CollectRewards();
|
void CollectRewards();
|
||||||
|
|
||||||
|
|
||||||
// ------------- Custom Bounty Alterations -------------
|
|
||||||
UFUNCTION(BlueprintImplementableEvent, Category = "Bounty")
|
|
||||||
void BuyCustomBountyAlteration_1();
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintImplementableEvent, Category = "Bounty")
|
|
||||||
void BuyCustomBountyAlteration_2();
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintImplementableEvent, Category = "Bounty")
|
|
||||||
void BuyCustomBountyAlteration_3();
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Bounty")
|
|
||||||
FString GetCustomBountyAlteration_1_Description()
|
|
||||||
{
|
|
||||||
return CustomBountyAlteration_1_Description;
|
|
||||||
}
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Bounty")
|
|
||||||
FString GetCustomBountyAlteration_2_Description()
|
|
||||||
{
|
|
||||||
return CustomBountyAlteration_2_Description;
|
|
||||||
}
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Bounty")
|
|
||||||
FString GetCustomBountyAlteration_3_Description()
|
|
||||||
{
|
|
||||||
return CustomBountyAlteration_3_Description;
|
|
||||||
}
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Bounty")
|
|
||||||
int GetCustomBountyAlteration_1_Cost()
|
|
||||||
{
|
|
||||||
return CustomBountyAlteration_1_Cost;
|
|
||||||
}
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Bounty")
|
|
||||||
int GetCustomBountyAlteration_2_Cost()
|
|
||||||
{
|
|
||||||
return CustomBountyAlteration_2_Cost;
|
|
||||||
}
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Bounty")
|
|
||||||
int GetCustomBountyAlteration_3_Cost()
|
|
||||||
{
|
|
||||||
return CustomBountyAlteration_3_Cost;
|
|
||||||
}
|
|
||||||
// ------------- Simple Bounty Alterations -------------
|
|
||||||
|
|
||||||
void BuySpawnAmmoDrops();
|
|
||||||
|
|
||||||
void BuySpawnHealthDrops();
|
|
||||||
|
|
||||||
void BuyEnemyRadio()
|
|
||||||
{
|
|
||||||
HasEnemyRadio = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Concerned Enemies will call this function, if true, play funny poop voice line and stop enemies from being concerned
|
|
||||||
bool CheckIfHasEnemyRadio()
|
|
||||||
{
|
|
||||||
return HasEnemyRadio;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
@ -54,13 +54,13 @@ void ABountyDirector::SpawnBountyAndItsSideBounties()
|
|||||||
const FAttachmentTransformRules AttachmentTransformRules(EAttachmentRule::SnapToTarget, true);
|
const FAttachmentTransformRules AttachmentTransformRules(EAttachmentRule::SnapToTarget, true);
|
||||||
BountyActor->AttachToComponent(BountyAttachmentPoint, AttachmentTransformRules);
|
BountyActor->AttachToComponent(BountyAttachmentPoint, AttachmentTransformRules);
|
||||||
|
|
||||||
ActiveBounty = Cast<ABountyClass>(BountyActor);
|
ActiveBounty = Cast<AMainBountyClass>(BountyActor);
|
||||||
if (!IsValid(ActiveBounty)) UE_LOG(LogTemp, Fatal, TEXT("Failed to Cast to Bounty class"));
|
if (!IsValid(ActiveBounty)) UE_LOG(LogTemp, Fatal, TEXT("Failed to Cast to Bounty class"));
|
||||||
|
|
||||||
// WHEN MARCEL STOPS PLAYING WITH THE CHARACTER, ADD THIS BOUNTY TO PLAYERS ARRAY OF ACTIVE BOUNTIES!!!!!
|
// WHEN MARCEL STOPS PLAYING WITH THE CHARACTER, ADD THIS BOUNTY TO PLAYERS ARRAY OF ACTIVE BOUNTIES!!!!!
|
||||||
ActiveBounty->CompletedFirstCheckpoint.AddDynamic(this, &ABountyDirector::DestroyActiveSideBounties);
|
ActiveBounty->CompletedFirstCheckpoint.AddDynamic(this, &ABountyDirector::DestroyActiveSideBounties);
|
||||||
ActiveSideBounties.Reset();
|
ActiveSideBounties.Reset();
|
||||||
for (TSubclassOf<ABountyClass> SideBountyClass : ActiveBounty->GetSideBountiesToSpawn())
|
for (TSubclassOf<ASideBountyClass> SideBountyClass : ActiveBounty->GetSideBountiesToSpawn())
|
||||||
{
|
{
|
||||||
if (!IsValid(SideBountyClass)) continue;
|
if (!IsValid(SideBountyClass)) continue;
|
||||||
AActor* SideBountyActor = GetWorld()->SpawnActor<AActor>(SideBountyClass, PlayerChar->GetActorLocation(), PlayerChar->GetActorRotation(), SpawnParams);
|
AActor* SideBountyActor = GetWorld()->SpawnActor<AActor>(SideBountyClass, PlayerChar->GetActorLocation(), PlayerChar->GetActorRotation(), SpawnParams);
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "BountyClass.h"
|
#include "MainBountyClass.h"
|
||||||
#include "SideBountyClass.h"
|
#include "SideBountyClass.h"
|
||||||
#include "EndlessVendetta/EndlessVendettaCharacter.h"
|
#include "EndlessVendetta/EndlessVendettaCharacter.h"
|
||||||
#include "GameFramework/Actor.h"
|
#include "GameFramework/Actor.h"
|
||||||
@ -21,12 +21,12 @@ class ENDLESSVENDETTA_API ABountyDirector : public AActor
|
|||||||
|
|
||||||
// Ordered Array of Main Bounties
|
// Ordered Array of Main Bounties
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
||||||
TArray<TSubclassOf<ABountyClass>> BountyClassArray;
|
TArray<TSubclassOf<AMainBountyClass>> BountyClassArray;
|
||||||
|
|
||||||
int CurrentBountyIndex = 0;
|
int CurrentBountyIndex = 0;
|
||||||
|
|
||||||
UPROPERTY(VisibleAnywhere, Category = "Bounty")
|
UPROPERTY(VisibleAnywhere, Category = "Bounty")
|
||||||
ABountyClass* ActiveBounty;
|
AMainBountyClass* ActiveBounty;
|
||||||
|
|
||||||
UPROPERTY(VisibleAnywhere, Category = "Bounty")
|
UPROPERTY(VisibleAnywhere, Category = "Bounty")
|
||||||
TArray<ASideBountyClass*> ActiveSideBounties;
|
TArray<ASideBountyClass*> ActiveSideBounties;
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "MainBountyClass.h"
|
||||||
|
|
||||||
|
void AMainBountyClass::BuySpawnAmmoDrops()
|
||||||
|
{
|
||||||
|
FActorSpawnParameters SpawnParameters;
|
||||||
|
SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
|
||||||
|
for (FTransform Spawn : AmmoDropSpawnTransforms)
|
||||||
|
{
|
||||||
|
GetWorld()->SpawnActor<AActor>(AmmoDropClass, Spawn.GetLocation(), Spawn.GetRotation().Rotator(), SpawnParameters);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AMainBountyClass::BuySpawnHealthDrops()
|
||||||
|
{
|
||||||
|
FActorSpawnParameters SpawnParameters;
|
||||||
|
SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
|
||||||
|
for (FTransform Spawn : HealthDropSpawnTransforms)
|
||||||
|
{
|
||||||
|
GetWorld()->SpawnActor<AActor>(HealthDropClass, Spawn.GetLocation(), Spawn.GetRotation().Rotator(), SpawnParameters);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,123 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "BountyClass.h"
|
||||||
|
#include "SideBountyClass.h"
|
||||||
|
#include "MainBountyClass.generated.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
UCLASS()
|
||||||
|
class ENDLESSVENDETTA_API AMainBountyClass : public ABountyClass
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
protected:
|
||||||
|
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
||||||
|
TArray<TSubclassOf<ASideBountyClass>> SideBountiesToSpawn;
|
||||||
|
|
||||||
|
// ---------------- Bounty Alterations ----------------
|
||||||
|
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
||||||
|
FString CustomBountyAlteration_1_Description;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
||||||
|
int CustomBountyAlteration_1_Cost = 2;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
||||||
|
FString CustomBountyAlteration_2_Description;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
||||||
|
int CustomBountyAlteration_2_Cost = 2;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
||||||
|
FString CustomBountyAlteration_3_Description;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
||||||
|
int CustomBountyAlteration_3_Cost = 2;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
||||||
|
TArray<FTransform> AmmoDropSpawnTransforms;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
||||||
|
TSubclassOf<AActor> AmmoDropClass;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
||||||
|
TArray<FTransform> HealthDropSpawnTransforms;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
|
||||||
|
TSubclassOf<AActor> HealthDropClass;
|
||||||
|
|
||||||
|
bool HasEnemyRadio = false;
|
||||||
|
|
||||||
|
public:
|
||||||
|
TArray<TSubclassOf<ASideBountyClass>> GetSideBountiesToSpawn()
|
||||||
|
{
|
||||||
|
return SideBountiesToSpawn;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------- Custom Bounty Alterations -------------
|
||||||
|
UFUNCTION(BlueprintImplementableEvent, Category = "Bounty")
|
||||||
|
void BuyCustomBountyAlteration_1();
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintImplementableEvent, Category = "Bounty")
|
||||||
|
void BuyCustomBountyAlteration_2();
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintImplementableEvent, Category = "Bounty")
|
||||||
|
void BuyCustomBountyAlteration_3();
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, Category = "Bounty")
|
||||||
|
FString GetCustomBountyAlteration_1_Description()
|
||||||
|
{
|
||||||
|
return CustomBountyAlteration_1_Description;
|
||||||
|
}
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, Category = "Bounty")
|
||||||
|
FString GetCustomBountyAlteration_2_Description()
|
||||||
|
{
|
||||||
|
return CustomBountyAlteration_2_Description;
|
||||||
|
}
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, Category = "Bounty")
|
||||||
|
FString GetCustomBountyAlteration_3_Description()
|
||||||
|
{
|
||||||
|
return CustomBountyAlteration_3_Description;
|
||||||
|
}
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, Category = "Bounty")
|
||||||
|
int GetCustomBountyAlteration_1_Cost()
|
||||||
|
{
|
||||||
|
return CustomBountyAlteration_1_Cost;
|
||||||
|
}
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, Category = "Bounty")
|
||||||
|
int GetCustomBountyAlteration_2_Cost()
|
||||||
|
{
|
||||||
|
return CustomBountyAlteration_2_Cost;
|
||||||
|
}
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, Category = "Bounty")
|
||||||
|
int GetCustomBountyAlteration_3_Cost()
|
||||||
|
{
|
||||||
|
return CustomBountyAlteration_3_Cost;
|
||||||
|
}
|
||||||
|
// ------------- Simple Bounty Alterations -------------
|
||||||
|
|
||||||
|
void BuySpawnAmmoDrops();
|
||||||
|
|
||||||
|
void BuySpawnHealthDrops();
|
||||||
|
|
||||||
|
void BuyEnemyRadio()
|
||||||
|
{
|
||||||
|
HasEnemyRadio = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Concerned Enemies will call this function, if true, play funny poop voice line and stop enemies from being concerned
|
||||||
|
bool CheckIfHasEnemyRadio()
|
||||||
|
{
|
||||||
|
return HasEnemyRadio;
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user