Implemented Side Bounties Awarding Favours
This commit is contained in:
parent
fa679b06b4
commit
147dcaef6f
@ -67,7 +67,8 @@ void ABountyDirector::SpawnBountyAndItsSideBounties()
|
||||
SideBountyActor->AttachToComponent(BountyAttachmentPoint, AttachmentTransformRules);
|
||||
ASideBountyClass* SideBounty = Cast<ASideBountyClass>(SideBountyActor);
|
||||
if (!IsValid(SideBounty)) UE_LOG(LogTemp, Fatal, TEXT("A SideBounty for %s has been set to a wrong type"), *ActiveBounty->GetBountyTitle());
|
||||
ActiveSideBounties.Add(SideBounty);
|
||||
int i = ActiveSideBounties.Add(SideBounty);
|
||||
ActiveSideBounties[i]->CompletedSideBounty.AddDynamic(this, &ABountyDirector::EarnFavours);
|
||||
// ONCE AGAIN WHEN MARCEL STOPS PLAYING WITH THE CHARACTER, ADD THIS SIDE BOUNTY TO PLAYERS ARRAY OF ACTIVE BOUNTIES!!!!!
|
||||
}
|
||||
}
|
||||
@ -119,5 +120,11 @@ void ABountyDirector::DestroyActiveSideBounties()
|
||||
UpdateBountyDisplay();
|
||||
}
|
||||
|
||||
void ABountyDirector::EarnFavours(int FavoursEarned)
|
||||
{
|
||||
UE_LOG(LogTemp, Warning, TEXT("Earned %d favours"), FavoursEarned);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -52,6 +52,9 @@ protected:
|
||||
UFUNCTION()
|
||||
void DestroyActiveSideBounties();
|
||||
|
||||
UFUNCTION()
|
||||
void EarnFavours(int FavoursEarned);
|
||||
|
||||
public:
|
||||
// Called every frame
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
|
@ -16,8 +16,7 @@ void ASideBountyClass::IncrementBountyCheckpoint()
|
||||
|
||||
if (Completed)
|
||||
{
|
||||
|
||||
CompletedSideBounty.Broadcast(ActiveSBC_Index);
|
||||
CompletedSideBounty.Broadcast(FavoursEarnedForCompletion);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,30 +6,22 @@
|
||||
#include "BountyClass.h"
|
||||
#include "SideBountyClass.generated.h"
|
||||
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FCompletedSideBounty, int, SB_Index);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FCompletedSideBounty, int, FavoursEarned);
|
||||
|
||||
UCLASS()
|
||||
class ENDLESSVENDETTA_API ASideBountyClass : public ABountyClass
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, Category = "Side Bounty")
|
||||
TMap<int, TSubclassOf<ACheckpointClass>> ReplacementCheckpoints;
|
||||
|
||||
protected:
|
||||
UPROPERTY(EditDefaultsOnly, Category = "Side Bounty")
|
||||
int FavoursEarnedForCompletion = 1;
|
||||
|
||||
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