diff --git a/Content/Blueprint/Level/Actor/Role/BP_Fox.uasset b/Content/Blueprint/Level/Actor/Role/BP_Fox.uasset index ffd54c3..80d15ee 100644 Binary files a/Content/Blueprint/Level/Actor/Role/BP_Fox.uasset and b/Content/Blueprint/Level/Actor/Role/BP_Fox.uasset differ diff --git a/Content/Blueprint/Level/Actor/Static/BP_Stone.uasset b/Content/Blueprint/Level/Actor/Static/BP_Stone.uasset index 6a06298..e536777 100644 Binary files a/Content/Blueprint/Level/Actor/Static/BP_Stone.uasset and b/Content/Blueprint/Level/Actor/Static/BP_Stone.uasset differ diff --git a/Content/Lua/Gas/Ability/Role/Fox/FoxUltimate.lua b/Content/Lua/Gas/Ability/Role/Fox/FoxUltimate.lua index 6cadc13..20a71bb 100644 --- a/Content/Lua/Gas/Ability/Role/Fox/FoxUltimate.lua +++ b/Content/Lua/Gas/Ability/Role/Fox/FoxUltimate.lua @@ -12,6 +12,7 @@ function FoxUltimate:ctor() self.active_recast_handle = nil self.active_accelerate_handle = nil + self.overlap_delegate_handle = nil self.tag_add_or_remove_delegate = nil end @@ -28,6 +29,8 @@ function FoxUltimate:K2_ActivateAbilityFromEvent(EventData) self.animation = owner.SpineAnimationComponent self.asc = AbilitySystemBlueprintLibrary.GetAbilitySystemComponent(owner) self.recast_tag = BusyGameplayLibrary.RequestGameplayTag("Ability.Flags.Recast") + self.owner = owner + local asc = self.asc @@ -58,8 +61,6 @@ function FoxUltimate:TriggerUltimate(asc) elseif self.ultimate_phase == 2 then -- 第二次激活,移除可重复释放的tag self.asc:RemoveActiveGameplayEffect(self.active_recast_handle, -1) - local _, recast_effect = self:GetAbilityEffectSpecHandle("Recast", asc, 1, nil) - self.active_recast_handle = asc:BP_ApplyGameplayEffectSpecToSelf(recast_effect) elseif self.ultimate_phase == 3 then self.asc:RemoveActiveGameplayEffect(self.active_recast_handle, -1) end @@ -172,6 +173,21 @@ function FoxUltimate:OnAnimationEvent(entry, event) self.active_accelerate_handle = self:MakeAccelerate(8.0, 0.5) elseif event.Name == "OnSpeedReset" then self.asc:RemoveActiveGameplayEffect(self.active_accelerate_handle, -1) + elseif event.Name == "OnDamageBegin" then + local collision = self.owner["TailCollision"] + collision:SetCollisionEnabled(1) + self.overlap_delegate_handle = collision.OnComponentBeginOverlap:Add(function() + if not self.asc:HasMatchingGameplayTag(self.recast_tag) then + local _, recast_effect = self:GetAbilityEffectSpecHandle("Recast", self.asc, 1, nil) + self.active_recast_handle = self.asc:BP_ApplyGameplayEffectSpecToSelf(recast_effect) + end + end) + elseif event.Name == "OnDamageEnd" then + self.owner["TailCollision"]:SetCollisionEnabled(0) + if self.overlap_delegate_handle ~= nil then + self.owner["TailCollision"].OnComponentBeginOverlap:Remove(self.overlap_delegate_handle) + self.overlap_delegate_handle = nil + end end end diff --git a/Content/Lua/Level/Actor/LevelFoxRole.lua b/Content/Lua/Level/Actor/LevelFoxRole.lua index af26855..a81cf4f 100644 --- a/Content/Lua/Level/Actor/LevelFoxRole.lua +++ b/Content/Lua/Level/Actor/LevelFoxRole.lua @@ -8,6 +8,13 @@ end function LevelFoxRole:ReceiveBeginPlay() self["SpineAnimationComponent"]:SetAnimation(0, "Idle/Front", true) self.last_animation = "Idle/Front" + + self["SpineBoneFollower"].Target = self + self["SpineBoneFollower"].BoneName = "tail" + self["SpineBoneFollower"].UseComponentTransform = true + self["SpineBoneFollower"].UseScale = true + + self["TailCollision"]:SetCollisionEnabled(0) end @@ -42,32 +49,6 @@ function LevelFoxRole:OnMove(location) self["MovementComponent"]:MoveTo(location) end -function LevelFoxRole:OnUltimateSkill() - print("LevelFoxRole:OnUltimateSkill") - local sprint_distance = 600 - local sprint_speed_rate = 3.8 - - -- 获取角色朝向 - local forward_direction = self["MovementComponent"]:GetForwardDirection() - - self["MovementComponent"]:SprintTo(sprint_distance, sprint_speed_rate) - - - local anim_comp = self["SpineAnimationComponent"] - if forward_direction.X >= 0 then - anim_comp:SetAnimation(0, "Ultimate/Right/UltimateStage1", false) - else - anim_comp:SetAnimation(0, "Ultimate/Left/UltimateStage1", false) - end - local anim_entry = anim_comp:GetCurrent(0) - - local anim_total_time = anim_entry:GetAnimationEnd() - local sprint_time = sprint_distance / (self:GetSpeed() * sprint_speed_rate) - - anim_comp:SetTimeScale(anim_total_time / sprint_time) - - print("hahhh", anim_total_time, sprint_time) -end return Class(nil, nil, LevelFoxRole) \ No newline at end of file diff --git a/Content/Resource/Spine/Role/Fox/Fox.uasset b/Content/Resource/Spine/Role/Fox/Fox.uasset index 2e01784..1433f0e 100644 Binary files a/Content/Resource/Spine/Role/Fox/Fox.uasset and b/Content/Resource/Spine/Role/Fox/Fox.uasset differ diff --git a/Content/Resource/Spine/Role/Fox/FoxData.uasset b/Content/Resource/Spine/Role/Fox/FoxData.uasset index 7bf38b4..4e88a80 100644 Binary files a/Content/Resource/Spine/Role/Fox/FoxData.uasset and b/Content/Resource/Spine/Role/Fox/FoxData.uasset differ diff --git a/Content/Resource/Spine/Role/Fox/Textures/Fox.uasset b/Content/Resource/Spine/Role/Fox/Textures/Fox.uasset index 8e2127c..c91935f 100644 Binary files a/Content/Resource/Spine/Role/Fox/Textures/Fox.uasset and b/Content/Resource/Spine/Role/Fox/Textures/Fox.uasset differ diff --git a/Source/BusyRabbit/Private/Level/Actor/BusyPawnBase.cpp b/Source/BusyRabbit/Private/Level/Actor/BusyPawnBase.cpp index 65198c9..978911b 100644 --- a/Source/BusyRabbit/Private/Level/Actor/BusyPawnBase.cpp +++ b/Source/BusyRabbit/Private/Level/Actor/BusyPawnBase.cpp @@ -16,7 +16,6 @@ ABusyPawnBase::ABusyPawnBase() RootScene = CreateDefaultSubobject(TEXT("RootScene")); SpineRoot = CreateDefaultSubobject(TEXT("SpineRoot")); - SphereComponent = CreateDefaultSubobject(TEXT("SphereComponent")); SpineRenderComponent = CreateDefaultSubobject(TEXT("SpineRenderComponent")); SpineAnimationComponent = CreateDefaultSubobject(TEXT("SpineAnimationComponent")); AbilitySystemComponent = CreateDefaultSubobject(TEXT("AbilitySystemComponent")); @@ -24,7 +23,6 @@ ABusyPawnBase::ABusyPawnBase() RootComponent = RootScene; SpineRoot->SetupAttachment(RootScene); - SphereComponent->SetupAttachment(SpineRoot); SpineRenderComponent->SetupAttachment(SpineRoot); SpineRoot->SetRelativeRotation(FRotator(0, 0, -90)); diff --git a/Source/BusyRabbit/Public/Level/Actor/BusyPawnBase.h b/Source/BusyRabbit/Public/Level/Actor/BusyPawnBase.h index 1b439a2..4f121c0 100644 --- a/Source/BusyRabbit/Public/Level/Actor/BusyPawnBase.h +++ b/Source/BusyRabbit/Public/Level/Actor/BusyPawnBase.h @@ -5,13 +5,11 @@ #include "BusyPawnBase.generated.h" struct FBusyPawnBaseConfig; -class USphereComponent; class USpineBoneFollowerComponent; class USpineSkeletonRendererComponent; class USpineSkeletonAnimationComponent; class UBusyPawnMovementComponent; - DECLARE_DYNAMIC_DELEGATE_TwoParams(FGameplayTagAddOrRemoveDelegate, const FGameplayTag&, Tag, const int32, Value); @@ -81,12 +79,6 @@ protected: UPROPERTY(EditDefaultsOnly) TObjectPtr RootScene; //场景根组件 - /*-----------------------------碰撞相关组件-----------------------------*/ - UPROPERTY(EditDefaultsOnly) - TObjectPtr SphereComponent; - /*-------------------------------------------------------------------*/ - - /*----------------------------spine相关组件----------------------------*/ UPROPERTY(EditDefaultsOnly) TObjectPtr SpineRoot;