Implemented Side Bounty Class Functionality
This commit is contained in:
parent
52af66afec
commit
5e6f5e4b9e
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.
@ -3,3 +3,33 @@
|
|||||||
|
|
||||||
#include "SideBountyClass.h"
|
#include "SideBountyClass.h"
|
||||||
|
|
||||||
|
void ASideBountyClass::BeginPlay()
|
||||||
|
{
|
||||||
|
Super::BeginPlay();
|
||||||
|
|
||||||
|
MinCPsRequiredForCompletion = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ASideBountyClass::IncrementBountyCheckpoint()
|
||||||
|
{
|
||||||
|
Super::IncrementBountyCheckpoint();
|
||||||
|
|
||||||
|
if (Completed)
|
||||||
|
{
|
||||||
|
CompletedSideBounty.Broadcast(ActiveSBC_Index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ASideBountyClass::DestroyCheckpoints()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < BountyCheckpoints.Num(); i++)
|
||||||
|
{
|
||||||
|
if (BountyCheckpoints[i] == nullptr)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
BountyCheckpoints[i]->Destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -6,12 +6,30 @@
|
|||||||
#include "BountyClass.h"
|
#include "BountyClass.h"
|
||||||
#include "SideBountyClass.generated.h"
|
#include "SideBountyClass.generated.h"
|
||||||
|
|
||||||
/**
|
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FCompletedSideBounty, int, SB_Index);
|
||||||
*
|
|
||||||
*/
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
class ENDLESSVENDETTA_API ASideBountyClass : public ABountyClass
|
class ENDLESSVENDETTA_API ASideBountyClass : public ABountyClass
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly, Category = "Side Bounty")
|
||||||
|
TMap<int, TSubclassOf<ACheckpointClass>> ReplacementCheckpoints;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
|
public:
|
||||||
|
FCompletedSideBounty CompletedSideBounty;
|
||||||
|
|
||||||
|
int ActiveSBC_Index;
|
||||||
|
|
||||||
|
TMap<int, TSubclassOf<ACheckpointClass>> GetReplacementCheckpoints()
|
||||||
|
{
|
||||||
|
return ReplacementCheckpoints;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void IncrementBountyCheckpoint() override;
|
||||||
|
|
||||||
|
void DestroyCheckpoints();
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user