57 lines
1.7 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "PawnWithSkill.generated.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnReceiveDamage);
UCLASS()
class PROJECTFISH_API APawnWithSkill : public APawn
{
GENERATED_BODY()
public:
// Sets default values for this pawn's properties
APawnWithSkill();
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
void ApplyyEndurance(float enduranceOffset);
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
void ApplyyTenacity(float tenacityOffset);
void SetDamageReduce(int32 damageReduce);
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
UPROPERTY(BlueprintReadWrite, meta = (ToolTip = "当前耐久度"))
float CurrentEndurance;
UPROPERTY(BlueprintReadWrite, meta = (ToolTip = "减伤值"))
float DamageReduce;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category= Default, meta = (DisplayPriority = 0, ToolTip = "最大耐久度"))
float MaxEndurance;
UPROPERTY(BlueprintReadWrite, meta = (ToolTip = "当前韧性"))
float CurrentTenacity;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category= Default, meta = (DisplayPriority = 0, ToolTip = "最大韧性"))
float MaxTenacity;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category= Default, meta = (DisplayPriority = 0, ToolTip = "韧性归零时眩晕时长"))
float TenacityStun_Time = 5;
UPROPERTY(BlueprintAssignable)
FOnReceiveDamage OnReceiveDamage;
};