Compare commits

..

No commits in common. "5e186c3d0690571a3bcdad57777806d72725c206" and "2984aaa4bed71f1d2b4f0c5a58a65fed38177137" have entirely different histories.

10 changed files with 3 additions and 23 deletions

Binary file not shown.

Binary file not shown.

View File

@ -16,17 +16,11 @@ void APawnWithSkill::ApplyyEndurance_Implementation(float enduranceOffset)
CurrentEndurance += enduranceOffset;;
}
void APawnWithSkill::ApplyyTenacity_Implementation(float tenacityOffset)
{
CurrentTenacity += tenacityOffset;
}
// Called when the game starts or when spawned
void APawnWithSkill::BeginPlay()
{
Super::BeginPlay();
CurrentEndurance = MaxEndurance;
CurrentTenacity = MaxTenacity;
}
// Called every frame

View File

@ -16,8 +16,6 @@ public:
APawnWithSkill();
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
void ApplyyEndurance(float enduranceOffset);
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
void ApplyyTenacity(float tenacityOffset);
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
@ -34,14 +32,4 @@ public:
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;
};

View File

@ -52,15 +52,13 @@ void USkill::InitSkill(APawnWithSkill* owner, USkillManager* skillManager, FSkil
bool USkill::SkillTickAble()
{
//剩余次数无限制或者拥有者没有被韧性眩晕
return (RemainingEndurance >0 || RemainingEndurance == -1) && Owner->CurrentTenacity > 0;
return RemainingEndurance >0 || RemainingEndurance == -1;
}
void USkill::TickSkill(float deltaTime)
{
if (SkillTickAble())
RemainingTime -= deltaTime * SkillData.Speed;
if (RemainingTime <= 0 )
RemainingTime -= deltaTime * SkillData.Speed;
if (RemainingTime <= 0 && SkillTickAble())
{
RemainingTime = 0;
if (RemainingEndurance >0)