Compare commits
No commits in common. "5e186c3d0690571a3bcdad57777806d72725c206" and "2984aaa4bed71f1d2b4f0c5a58a65fed38177137" have entirely different histories.
5e186c3d06
...
2984aaa4be
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ProjectFish/Content/UI/WBP_EnduranceBar.uasset
Normal file
BIN
ProjectFish/Content/UI/WBP_EnduranceBar.uasset
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -16,17 +16,11 @@ void APawnWithSkill::ApplyyEndurance_Implementation(float enduranceOffset)
|
|||||||
CurrentEndurance += enduranceOffset;;
|
CurrentEndurance += enduranceOffset;;
|
||||||
}
|
}
|
||||||
|
|
||||||
void APawnWithSkill::ApplyyTenacity_Implementation(float tenacityOffset)
|
|
||||||
{
|
|
||||||
CurrentTenacity += tenacityOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called when the game starts or when spawned
|
// Called when the game starts or when spawned
|
||||||
void APawnWithSkill::BeginPlay()
|
void APawnWithSkill::BeginPlay()
|
||||||
{
|
{
|
||||||
Super::BeginPlay();
|
Super::BeginPlay();
|
||||||
CurrentEndurance = MaxEndurance;
|
CurrentEndurance = MaxEndurance;
|
||||||
CurrentTenacity = MaxTenacity;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called every frame
|
// Called every frame
|
||||||
|
@ -16,8 +16,6 @@ public:
|
|||||||
APawnWithSkill();
|
APawnWithSkill();
|
||||||
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
|
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
|
||||||
void ApplyyEndurance(float enduranceOffset);
|
void ApplyyEndurance(float enduranceOffset);
|
||||||
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
|
|
||||||
void ApplyyTenacity(float tenacityOffset);
|
|
||||||
protected:
|
protected:
|
||||||
// Called when the game starts or when spawned
|
// Called when the game starts or when spawned
|
||||||
virtual void BeginPlay() override;
|
virtual void BeginPlay() override;
|
||||||
@ -34,14 +32,4 @@ public:
|
|||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category= Default, meta = (DisplayPriority = 0, ToolTip = "最大耐久度"))
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category= Default, meta = (DisplayPriority = 0, ToolTip = "最大耐久度"))
|
||||||
float MaxEndurance;
|
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;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -52,15 +52,13 @@ void USkill::InitSkill(APawnWithSkill* owner, USkillManager* skillManager, FSkil
|
|||||||
|
|
||||||
bool USkill::SkillTickAble()
|
bool USkill::SkillTickAble()
|
||||||
{
|
{
|
||||||
//剩余次数无限制或者拥有者没有被韧性眩晕
|
return RemainingEndurance >0 || RemainingEndurance == -1;
|
||||||
return (RemainingEndurance >0 || RemainingEndurance == -1) && Owner->CurrentTenacity > 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void USkill::TickSkill(float deltaTime)
|
void USkill::TickSkill(float deltaTime)
|
||||||
{
|
{
|
||||||
if (SkillTickAble())
|
RemainingTime -= deltaTime * SkillData.Speed;
|
||||||
RemainingTime -= deltaTime * SkillData.Speed;
|
if (RemainingTime <= 0 && SkillTickAble())
|
||||||
if (RemainingTime <= 0 )
|
|
||||||
{
|
{
|
||||||
RemainingTime = 0;
|
RemainingTime = 0;
|
||||||
if (RemainingEndurance >0)
|
if (RemainingEndurance >0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user