Update John for Helicopter Animation

This commit is contained in:
Philip W 2024-01-27 11:09:42 +00:00
parent f08402f265
commit 2cdd70c507
10 changed files with 35 additions and 8 deletions

BIN
SeagullGame/Content/Items/BPI_Cube.uasset (Stored with Git LFS)

Binary file not shown.

BIN
SeagullGame/Content/John/BP_John.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
SeagullGame/Content/John/Helicopter.uasset (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -6,6 +6,14 @@
#include "GameFramework/Actor.h" #include "GameFramework/Actor.h"
#include "ItemActor.generated.h" #include "ItemActor.generated.h"
UENUM(BlueprintType)
enum class EItemType : uint8
{
Cube UMETA(DisplayName = "Cube"),
Apple UMETA(DisplayName = "Apple"),
Banana UMETA(DisplayName = "Banana"),
};
UCLASS() UCLASS()
class SEAGULLGAME_API AItemActor : public AActor class SEAGULLGAME_API AItemActor : public AActor
{ {
@ -17,6 +25,10 @@ public:
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Item") UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Item")
TSubclassOf<AItemActor> ItemNoPhysics; TSubclassOf<AItemActor> ItemNoPhysics;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Item")
float HungerValue = 10;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Item")
EItemType ItemType;
protected: protected:
// Called when the game starts or when spawned // Called when the game starts or when spawned

View File

@ -188,9 +188,10 @@ void ASeagullGameCharacter::OnPickupBoxEndOverlap(UPrimitiveComponent* Overlappe
} }
} }
void ASeagullGameCharacter::IncreaseJohnsHunger(float HungerAmount) void ASeagullGameCharacter::IncreaseJohnsHunger(const float HungerAmount)
{ {
JohnsCurrentHunger += HungerAmount; JohnsCurrentHunger += HungerAmount;
Score += HungerAmount * 10;
if (JohnsCurrentHunger > JohnsMaxHunger) if (JohnsCurrentHunger > JohnsMaxHunger)
{ {
JohnsCurrentHunger = JohnsMaxHunger; JohnsCurrentHunger = JohnsMaxHunger;

View File

@ -98,15 +98,17 @@ public:
AActor* ClosestItemActor; AActor* ClosestItemActor;
UPROPERTY(BlueprintReadOnly, Category = "Item") UPROPERTY(BlueprintReadOnly, Category = "Item")
UBoxComponent* PickupBox; UBoxComponent* PickupBox;
UPROPERTY(BlueprintReadOnly, Category = "Item")
EItemType CurrentCraving;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "John") UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "John")
float JohnsCurrentHunger = 0; float JohnsCurrentHunger = 0;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "John") UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "John")
float JohnsDefaultHunger = 100; float JohnsDefaultHunger = 250;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "John") UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "John")
float JohnsMaxHunger = 200; float JohnsMaxHunger = 500;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "John") UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "John")
float JohnsHungerDeclineAmount = 10.f; float JohnsHungerDeclineAmount = 1.f;
UFUNCTION(BlueprintCallable, Category = "John") UFUNCTION(BlueprintCallable, Category = "John")
void IncreaseJohnsHunger(float HungerAmount); void IncreaseJohnsHunger(float HungerAmount);