feat(ArcherSkill): 弓箭手技能重构为阶梯体系支持1/3/6/10级完整升级

- 实现迅捷三连技能,支持1级基础3箭、10级升级为6支风暴连射
- 添加弱点锁定机制,6级后伤害逐箭递增且最后一箭必暴击
- 集成破甲易伤标记系统,使目标受到伤害增加30%持续4秒
- 优化技能释放逻辑,支持目标死亡后自动切换最近敌人
- 完善技能平衡性调整,3级箭矢速度提升35%总伤害增加25%

feat(StatusEffectController): 新增易伤状态管理系统

- 添加vulnerability相关属性和ApplyVulnerability方法
- 实现易伤效果的生命周期管理和伤害计算
- 集成到UnitBase的伤害结算流程中

docs: 更新角色技能说明文档支持新技能体系

- 将原弓箭猎人重命名为荒野猎手,更新技能描述
- 同步更新角色与技能对应关系表格
- 调整技能名称从穿透箭改为穿心猎矛等新命名
```
This commit is contained in:
huadexuan committed 2026-10-13 19:33:54 +08:00
1 parent a9869b7419
commit 8cbe8e000b
20 files changed
+1387 -26

No files matched your search

@@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:yousandi.cn,2023:
--- !u!221 &22100000
AnimatorOverrideController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: "\u8352\u91CE\u730E\u624B"
m_Controller: {fileID: 9100000, guid: 040acc435cecb4b16b965a1136ce6834, type: 2}
m_Clips:
- m_OriginalClip: {fileID: -203655887218126122, guid: 5072af719b9b1401787c6c55f048d8ed,
type: 3}
m_OverrideClip: {fileID: -203655887218126122, guid: 3cf486ef6ee70e743b217bd5f96516b8,
type: 3}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: C3wYvHmtAnJkCHk4Z1YjFYbgDB0VFLQNfBsdG26IX1e+WQdwwu5Amjs=
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 22100000
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: WywX5C+lV3+nhInJUxKkpAgr+PxhaulQSqdpWa5ZfYBndJtR0tIgUEY=
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,149 @@
fileFormatVersion: 2
guid: Xn8dtCn+USoM3y8Q1spG7or0i5ihQ5/VOTuLQmVn9ElNxLu+WwKV5R4=
ModelImporter:
serializedVersion: 22361
internalIDToNameTable: []
externalObjects: {}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
aCLCompressionLevel: 3
aCLCurvePrecision: 0.01
aCLFastSampleMode: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
tuanjieGIEnable: 0
tuanjieGIGenSDFFactor: 1
tuanjieGIGenSDFBias: 0.25
tuanjieGIDoubleSidedMode: 0
tuanjieGIGenFacetNums: 12
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
totalVerticesCount: 14728
totalTrianglesCount: 5000
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importPhysicalCameras: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
strictVertexDataChecks: 0
virtualGeometry:
virtualGeometry: 0
useTransparent: 0
setVGForeachMesh: 0
isFirstUse: 1
virtualGeometrySettings:
generateGeometryBuffer: 0
surfaceCompensation: 0
allMeshUse: 1
ignoreSimpleMesh: 0
transformScaleState: 0
isPossibleOverflow: 0
hasBoneData: 0
isBoneCountOverflow: 0
virtualGeometryPlatformSettings: []
selectedVGMeshes:
- index: 0
meshName: node_0
lodLevel: 0
meshGeometryBuffer: 0
supportVGMeshes:
- index: 0
meshName: node_0
lodLevel: 0
meshGeometryBuffer: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
overrideDefaultPose: 0
humanDescription:
serializedVersion: 3
human: []
skeleton: []
namedPoseList:
- name: Default
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
defaultPoseIndex: -1
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
importBlendShapeDeformPercent: 1
remapMaterialsIfMaterialImportModeIsNone: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

@@ -0,0 +1,163 @@
fileFormatVersion: 2
guid: WigcsH+oBn1GkOluyD9zP1q1crQXqgLJjAQC2mjZsBphsxbFlZfe0x0=
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 14
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
webStreaming: 0
priorityLevel: 0
uploadedMode: 2
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WeixinMiniGame
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
doOverrideTextureManagerOperations: 0
platformOperationGroupSettings:
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
@@ -0,0 +1,565 @@
fileFormatVersion: 2
guid: DClJsSKrBi3US/iRrb+5vjrAFyXbuqBpZLuP3awC3HzYgpKnYMf0Dik=
ModelImporter:
serializedVersion: 22361
internalIDToNameTable: []
externalObjects:
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: No Name
second: {fileID: 2100000, guid: bd8a85822b5d6db4f96f6d7db71daf98, type: 2}
materials:
materialImportMode: 1
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 3
aCLCompressionLevel: 3
aCLCurvePrecision: 0.01
aCLFastSampleMode: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations:
- serializedVersion: 18
name: "\u6295\u63B7"
takeName: mixamo.com
internalID: -203655887218126122
firstFrame: 0
lastFrame: 66
wrapMode: 0
orientationOffsetY: 0
level: 0
cycleOffset: 0
loop: 0
hasAdditiveReferencePose: 0
lockToRoot: 0
loopTime: 0
loopBlend: 0
loopBlendOrientation: 0
loopBlendPositionY: 0
loopBlendPositionXZ: 0
keepOriginalOrientation: 0
keepOriginalPositionY: 1
keepOriginalPositionXZ: 0
heightFromFeet: 0
mirror: 0
bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
curves: []
events:
- time: 0.28456584
functionName: OnAttackEffect
data:
objectReferenceParameter: {instanceID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0
intervals: []
transformMask: []
maskType: 3
maskSource: {instanceID: 0}
additiveReferencePoseFrame: 0
additiveType: 0
basePoseType: 0
additiveSelectedAnimation: {instanceID: 0}
additiveSelectedAnimationFrameIndex: 0
isReadable: 0
tuanjieGIEnable: 0
tuanjieGIGenSDFFactor: 1
tuanjieGIGenSDFBias: 0.25
tuanjieGIDoubleSidedMode: 0
tuanjieGIGenFacetNums: 12
meshes:
lODScreenPercentages: []
globalScale: 200
meshCompression: 0
totalVerticesCount: 9862
totalTrianglesCount: 4998
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importPhysicalCameras: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
strictVertexDataChecks: 0
virtualGeometry:
virtualGeometry: 0
useTransparent: 0
setVGForeachMesh: 0
isFirstUse: 1
virtualGeometrySettings:
generateGeometryBuffer: 0
surfaceCompensation: 0
allMeshUse: 1
ignoreSimpleMesh: 0
transformScaleState: 0
isPossibleOverflow: 0
hasBoneData: 0
isBoneCountOverflow: 0
virtualGeometryPlatformSettings:
- serializedVersion: 0
overridden: 0
ignorePlatformSupport: 0
buildTarget: DefaultVirtualGeometryPlatform
positionPrecision: -2147483648
normalPrecision: -2147483648
tangentPrecision: -2147483648
boneWeightPrecision: -2147483648
detailedTriangleCount: 0
detailedVertexCount: 0
rootPageSize: 0
streamablePageSize: 0
reserveTrianglePercent: 100
reserveDetailLevel: 0
- serializedVersion: 0
overridden: 0
ignorePlatformSupport: 0
buildTarget: Standalone
positionPrecision: -2147483648
normalPrecision: -2147483648
tangentPrecision: -2147483648
boneWeightPrecision: -2147483648
detailedTriangleCount: 0
detailedVertexCount: 0
rootPageSize: 0
streamablePageSize: 0
reserveTrianglePercent: 100
reserveDetailLevel: 0
- serializedVersion: 0
overridden: 0
ignorePlatformSupport: 0
buildTarget: iPhone
positionPrecision: -2147483648
normalPrecision: -2147483648
tangentPrecision: -2147483648
boneWeightPrecision: -2147483648
detailedTriangleCount: 0
detailedVertexCount: 0
rootPageSize: 0
streamablePageSize: 0
reserveTrianglePercent: 100
reserveDetailLevel: 0
- serializedVersion: 0
overridden: 0
ignorePlatformSupport: 0
buildTarget: Android
positionPrecision: -2147483648
normalPrecision: -2147483648
tangentPrecision: -2147483648
boneWeightPrecision: -2147483648
detailedTriangleCount: 0
detailedVertexCount: 0
rootPageSize: 0
streamablePageSize: 0
reserveTrianglePercent: 100
reserveDetailLevel: 0
selectedVGMeshes:
- index: 0
meshName: node_0
lodLevel: 0
meshGeometryBuffer: 0
supportVGMeshes:
- index: 0
meshName: node_0
lodLevel: 0
meshGeometryBuffer: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
overrideDefaultPose: 0
humanDescription:
serializedVersion: 3
human:
- boneName: mixamorig:Hips
humanName: Hips
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:LeftUpLeg
humanName: LeftUpperLeg
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:RightUpLeg
humanName: RightUpperLeg
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:LeftLeg
humanName: LeftLowerLeg
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:RightLeg
humanName: RightLowerLeg
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:LeftFoot
humanName: LeftFoot
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:RightFoot
humanName: RightFoot
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:Spine
humanName: Spine
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:Spine1
humanName: Chest
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:Neck
humanName: Neck
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:Head
humanName: Head
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:LeftShoulder
humanName: LeftShoulder
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:RightShoulder
humanName: RightShoulder
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:LeftArm
humanName: LeftUpperArm
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:RightArm
humanName: RightUpperArm
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:LeftForeArm
humanName: LeftLowerArm
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:RightForeArm
humanName: RightLowerArm
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:LeftHand
humanName: LeftHand
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:RightHand
humanName: RightHand
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:LeftToeBase
humanName: LeftToes
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:RightToeBase
humanName: RightToes
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: mixamorig:Spine2
humanName: UpperChest
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
skeleton:
- name: "\u8352\u91CE\u730E\u624B(Clone)"
parentName:
position: {x: 0, y: 0, z: 0}
rotation: {x: 0, y: 0, z: 0, w: 1}
scale: {x: 1, y: 1, z: 1}
- name: node_0
parentName: "\u8352\u91CE\u730E\u624B(Clone)"
position: {x: -0, y: 0, z: 0}
rotation: {x: 0, y: -0, z: -0, w: 1}
scale: {x: 1, y: 1, z: 1}
- name: mixamorig:Hips
parentName: "\u8352\u91CE\u730E\u624B(Clone)"
position: {x: 7.2759576e-10, y: 0.96161616, z: -0.017580768}
rotation: {x: -0, y: -0, z: 4.0927256e-10, w: 1}
scale: {x: 0.99999994, y: 1, z: 1}
- name: mixamorig:LeftUpLeg
parentName: mixamorig:Hips
position: {x: -0.122900926, y: -0.064272955, z: 0.019370982}
rotation: {x: 0.00049928314, y: -0.031455517, z: 0.99937916, w: 0.015862847}
scale: {x: 1.0000004, y: 1.0000004, z: 1}
- name: mixamorig:LeftLeg
parentName: mixamorig:LeftUpLeg
position: {x: 2.775558e-17, y: 0.42458522, z: 0}
rotation: {x: -0.070675656, y: 0.001526951, z: -0.021546036, w: 0.9972655}
scale: {x: 1.0000006, y: 1.0000005, z: 1.0000001}
- name: mixamorig:LeftFoot
parentName: mixamorig:LeftLeg
position: {x: 2.775558e-17, y: 0.36031312, z: 3.4694474e-18}
rotation: {x: 0.5864733, y: 0.058979593, z: -0.042879384, w: 0.8066796}
scale: {x: 1, y: 1, z: 0.9999998}
- name: mixamorig:LeftToeBase
parentName: mixamorig:LeftFoot
position: {x: -0, y: 0.19909826, z: 2.775558e-17}
rotation: {x: 0.23450264, y: 0.030121133, z: -0.007269758, w: 0.9716215}
scale: {x: 1.0000004, y: 1.0000002, z: 1.0000001}
- name: mixamorig:LeftToe_End
parentName: mixamorig:LeftToeBase
position: {x: 2.775558e-17, y: 0.07518335, z: 8.673618e-19}
rotation: {x: 0, y: -0, z: -0, w: 1}
scale: {x: 1, y: 1, z: 1}
- name: mixamorig:Spine
parentName: mixamorig:Hips
position: {x: -0, y: 0.11601777, z: -0.008428418}
rotation: {x: -0.03625217, y: 0.000000005805401, z: 5.291295e-10, w: 0.9993427}
scale: {x: 1, y: 1, z: 0.99999994}
- name: mixamorig:Spine1
parentName: mixamorig:Spine
position: {x: -0, y: 0.13571076, z: 0}
rotation: {x: -0.000000029802322, y: -0.0000000029290932, z: 1.5196491e-10,
w: 1}
scale: {x: 0.99999994, y: 0.99999994, z: 1}
- name: mixamorig:Spine2
parentName: mixamorig:Spine1
position: {x: -0, y: 0.15509796, z: 0}
rotation: {x: -0, y: -0.000000005462792, z: -0.0000000051386957, w: 1}
scale: {x: 1.0000001, y: 1.0000001, z: 1.0000001}
- name: mixamorig:Neck
parentName: mixamorig:Spine2
position: {x: -0, y: 0.17448525, z: 0.000000012214195}
rotation: {x: 0.0362522, y: 4.9456883e-11, z: -0.0000000013633452, w: 0.9993427}
scale: {x: 0.99999994, y: 1.0000001, z: 0.99999994}
- name: mixamorig:Head
parentName: mixamorig:Neck
position: {x: -0, y: 0.14759588, z: 0.017679807}
rotation: {x: 0.0000000037252903, y: 0.000000002910383, z: 0.0000000010913939,
w: 1}
scale: {x: 0.99999994, y: 0.9999999, z: 1.0000001}
- name: mixamorig:HeadTop_End
parentName: mixamorig:Head
position: {x: -0, y: 0.23794629, z: 0.028502438}
rotation: {x: 0, y: -0, z: -0, w: 1}
scale: {x: 1, y: 1, z: 1}
- name: mixamorig:LeftShoulder
parentName: mixamorig:Spine2
position: {x: -0.05832574, y: 0.1505866, z: -0.0022551804}
rotation: {x: 0.55615306, y: -0.4300368, z: 0.5748818, w: 0.41865632}
scale: {x: 1.0000004, y: 1.0000006, z: 1.0000006}
- name: mixamorig:LeftArm
parentName: mixamorig:LeftShoulder
position: {x: -0, y: 0.12277112, z: 0}
rotation: {x: -0.12750787, y: -0.052892506, z: -0.006906688, w: 0.9904022}
scale: {x: 1, y: 1.0000002, z: 1.0000002}
- name: mixamorig:LeftForeArm
parentName: mixamorig:LeftArm
position: {x: -1.0408341e-17, y: 0.32773098, z: 0}
rotation: {x: -0.0111816665, y: -0.027591016, z: -0.03239311, w: 0.9990318}
scale: {x: 0.9999997, y: 0.9999998, z: 0.9999998}
- name: mixamorig:LeftHand
parentName: mixamorig:LeftForeArm
position: {x: -5.551116e-17, y: 0.3340844, z: 1.1102232e-16}
rotation: {x: -0, y: -0, z: -1.1641532e-10, w: 1}
scale: {x: 1, y: 1, z: 1.0000001}
- name: mixamorig:RightShoulder
parentName: mixamorig:Spine2
position: {x: 0.05832574, y: 0.15051161, z: -0.0012226059}
rotation: {x: -0.56145275, y: -0.42600432, z: 0.5702429, w: -0.4220358}
scale: {x: 1.0000002, y: 1.0000002, z: 1.0000001}
- name: mixamorig:RightArm
parentName: mixamorig:RightShoulder
position: {x: -0, y: 0.12277112, z: 2.2204463e-16}
rotation: {x: 0.12768778, y: -0.06803748, z: 0.0033242106, w: -0.9894725}
scale: {x: 0.99999976, y: 1.0000001, z: 0.9999998}
- name: mixamorig:RightForeArm
parentName: mixamorig:RightArm
position: {x: -0, y: 0.32781148, z: 0}
rotation: {x: -0.0118109435, y: 0.011750162, z: 0.031905137, w: 0.9993521}
scale: {x: 1.0000002, y: 1.000001, z: 1.0000005}
- name: mixamorig:RightHand
parentName: mixamorig:RightForeArm
position: {x: -0, y: 0.335302, z: -1.1102232e-16}
rotation: {x: -2.3283064e-10, y: -0, z: -0.000000030053343, w: 1}
scale: {x: 0.99999994, y: 0.9999997, z: 1}
- name: mixamorig:RightUpLeg
parentName: mixamorig:Hips
position: {x: 0.122900926, y: -0.064272955, z: 0.017555349}
rotation: {x: -0.000482568, y: -0.030399304, z: 0.9994118, w: -0.015865445}
scale: {x: 1.0000002, y: 1.0000002, z: 0.99999994}
- name: mixamorig:RightLeg
parentName: mixamorig:RightUpLeg
position: {x: -0, y: 0.4245297, z: 1.387779e-17}
rotation: {x: -0.07598258, y: -0.0016407911, z: 0.02152683, w: 0.9968754}
scale: {x: 1.0000002, y: 1.0000004, z: 1.0000001}
- name: mixamorig:RightFoot
parentName: mixamorig:RightLeg
position: {x: 2.775558e-17, y: 0.36096406, z: 1.7347236e-17}
rotation: {x: 0.5934667, y: -0.057367228, z: 0.04246735, w: 0.8016874}
scale: {x: 1.0000002, y: 1.0000004, z: 1.0000002}
- name: mixamorig:RightToeBase
parentName: mixamorig:RightFoot
position: {x: -0, y: 0.20220801, z: 0}
rotation: {x: 0.23086213, y: -0.02866849, z: 0.0068053757, w: 0.9725402}
scale: {x: 1.0000004, y: 1.0000002, z: 1}
- name: mixamorig:RightToe_End
parentName: mixamorig:RightToeBase
position: {x: 2.775558e-17, y: 0.077429935, z: 8.673618e-19}
rotation: {x: 0, y: -0, z: -0, w: 1}
scale: {x: 1, y: 1, z: 1}
namedPoseList:
- name: Default
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 200
rootMotionBoneName:
defaultPoseIndex: -1
hasTranslationDoF: 0
hasExtraRoot: 1
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 3
humanoidOversampling: 1
avatarSetup: 1
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
importBlendShapeDeformPercent: 1
remapMaterialsIfMaterialImportModeIsNone: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,83 @@
%YAML 1.1
%TAG !u! tag:yousandi.cn,2023:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: "\u8352\u91CE\u730E\u624B"
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 0ccff60d18b826248b2fc07e18698733, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: XS4X5CKoW3k5QpCbmsLG2CCO1Np0NB761jJpBp8xLi1wzBSNDf7IFXg=
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

@@ -0,0 +1,177 @@
fileFormatVersion: 2
guid: DylM43yrUy//7x6SbZSq1Vql2uiQyUvgZpZV1oQA7DZCQ8veZ/iNRnE=
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 14
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
webStreaming: 0
priorityLevel: 0
uploadedMode: 2
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 512
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WeixinMiniGame
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: PlayableAds
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
doOverrideTextureManagerOperations: 0
platformOperationGroupSettings:
userData:
assetBundleName:
assetBundleVariant:
+20
View File
@@ -197,6 +197,10 @@ PrefabInstance:
type: 3}
insertIndex: -1
addedObject: {fileID: 7813477268924349148}
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: 7b0dd5b38a9cd144ea135f3743440958,
type: 3}
insertIndex: -1
addedObject: {fileID: 2129591520245958642}
m_SourcePrefab: {fileID: 100100000, guid: 7b0dd5b38a9cd144ea135f3743440958, type: 3}
--- !u!4 &2222026796505693691 stripped
Transform:
@@ -334,6 +338,7 @@ MonoBehaviour:
indicatorHeight: 0.35
stunIndicatorPrefab: {fileID: 2432573200162841629, guid: de288ea16be0c1544a4c6eb71e899570,
type: 3}
isStunImmune: 0
--- !u!114 &233433209084818606
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -387,6 +392,21 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
teamId: 0
--- !u!114 &2129591520245958642
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5200308054099318121}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a69b69bf0c7d044a5894f376f83f0c53, type: 3}
m_Name:
m_EditorClassIdentifier:
baseArrowCount: 3
arrowInterval: 0.12
baseProjectileSpeed: 22
--- !u!1001 &6707986314085581781
PrefabInstance:
m_ObjectHideFlags: 0
Binary file not shown.
+152 -21
View File
@@ -1,49 +1,180 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 弓箭手技能:迅捷三连 / 弱点锁定体系(1/3/6/10 级完整阶梯)
/// 1级【迅捷三连】:搭弓连续高速射出 3 支穿甲箭矢,单体快速倾泻火力
/// 3级【极速穿甲】:箭矢飞行速度 +35%,三连射总伤害提升 25%
/// 6级【弱点锁定】:伤害逐箭递增且第 3 箭必暴击;命中附加破甲标记,使目标受到的所有伤害 +30%(持续 4s)!
/// 10级【乱射风暴】:三连射升级为 6 支风暴连射;击杀目标后剩余箭矢自动散开弹射给周围其他敌人
/// </summary>
public class ArcherSkill : UnitSkill
{
[Min(1)]
public int volleyArrowCount = 3;
[Header("三连射配置")]
[Tooltip("基础箭矢数量")]
public int baseArrowCount = 3;
[Min(0f)]
public float volleyArrowDamageMultiplier = 0.7f;
[Tooltip("每支箭发射间隔(秒)")]
public float arrowInterval = 0.12f;
[Min(0f)]
public float volleyArrowInterval = 0.15f;
[Tooltip("技能箭矢基础速度")]
public float baseProjectileSpeed = 22f;
private Coroutine volleyCoroutine;
private Coroutine activeVolleyCoroutine;
private void EnsureUnit()
{
if (unit == null)
{
unit = GetComponent<UnitBase>();
}
}
public override void ReleaseSkill()
{
if (volleyCoroutine != null)
EnsureUnit();
if (unit == null) return;
WorldHealthBar healthBar = unit.GetComponent<WorldHealthBar>();
if (healthBar == null || healthBar.IsDead) return;
if (unit.Target == null) return;
if (activeVolleyCoroutine != null)
{
StopCoroutine(volleyCoroutine);
StopCoroutine(activeVolleyCoroutine);
}
volleyCoroutine = StartCoroutine(FireVolley());
activeVolleyCoroutine = StartCoroutine(FireVolleyRoutine());
}
private IEnumerator FireVolley()
private IEnumerator FireVolleyRoutine()
{
for (int i = 0; i < volleyArrowCount; i++)
EnsureUnit();
if (unit == null) yield break;
int level = unit.level;
// 10级升级为 6 支箭;其余等级为 3 支
int arrowCount = level >= 10 ? 6 : baseArrowCount;
// 3级+ 箭速提升 35%
float projSpeed = level >= 3 ? baseProjectileSpeed * 1.35f : baseProjectileSpeed;
Debug.Log($"<color=green>【弓箭手释放技能】</color> 准备倾泻 {arrowCount} 连射(等级: {level})!");
for (int i = 0; i < arrowCount; i++)
{
// 三连射优先攻击当前目标;目标阵亡后剩余箭矢改打最近敌人。
GameObject volleyTarget = unit.Target != null ? unit.Target : FindNearestOpponent();
if (volleyTarget == null)
// 目标死亡后自动切换给最近敌人
GameObject currentTarget = unit.Target;
if (currentTarget == null || !currentTarget.activeInHierarchy || IsTargetDead(currentTarget))
{
break;
currentTarget = unit.FindNearestEnemyForSkill();
}
unit.FireSkillProjectile(volleyTarget, volleyArrowDamageMultiplier);
yield return new WaitForSeconds(volleyArrowInterval);
if (currentTarget == null)
{
break; // 全场无敌人提前结束
}
// 计算该支箭的伤害倍率与暴击
float damageMultiplier = GetArrowDamageMultiplier(i, arrowCount, level);
bool isGuaranteedCrit = (level >= 6 && i == arrowCount - 1); // 6级+ 最后一箭必定暴击
bool applyVulnerability = (level >= 6 && i == arrowCount - 1); // 6级+ 最后一箭施加 4 秒 30% 易伤
// 发射技能箭矢
LaunchSkillArrow(currentTarget, damageMultiplier, projSpeed, isGuaranteedCrit, applyVulnerability);
yield return new WaitForSeconds(arrowInterval);
}
volleyCoroutine = null;
activeVolleyCoroutine = null;
}
private GameObject FindNearestOpponent()
private float GetArrowDamageMultiplier(int index, int totalCount, int level)
{
return unit.FindNearestEnemyForSkill();
// 1级:基础 70% 伤害/箭
float baseMult = 0.70f;
// 3级:三连射总伤害提升 25% (0.70 * 1.25 = 0.875)
if (level >= 3 && level < 6)
{
baseMult *= 1.25f;
}
// 6级+【弱点锁定】:伤害逐箭递增
if (level >= 6)
{
// 逐箭递增:例如第 1 箭 0.85,第 2 箭 1.05,最后一箭 1.35
float step = (float)index / Mathf.Max(1, totalCount - 1);
baseMult = Mathf.Lerp(0.85f, 1.35f, step);
}
return baseMult;
}
private void LaunchSkillArrow(GameObject targetObj, float damageMultiplier, float speed, bool forceCrit, bool applyVulnerability)
{
if (unit == null || unit.projectilePrefab == null || targetObj == null) return;
Transform spawnPoint = unit.projectileSpawnPoint != null ? unit.projectileSpawnPoint : unit.transform;
Vector3 spawnPos = spawnPoint.position;
Vector3 direction = (targetObj.transform.position + Vector3.up * 0.8f - spawnPos).normalized;
Quaternion rotation = Quaternion.LookRotation(direction);
GameObject arrowObj = Instantiate(unit.projectilePrefab, spawnPos, rotation);
float calculatedDamage = unit.attackPower * damageMultiplier;
if (forceCrit || (unit.critRate > 0f && Random.value < unit.critRate))
{
calculatedDamage *= unit.critMultiplier;
}
// 接管 Arrow 碰撞,挂载自定义伤害与易伤回调
var projectile = arrowObj.GetComponent<Projectile>();
if (projectile != null)
{
// 技能箭不二次积攒能量
projectile.Initialize(targetObj, calculatedDamage, unit.gameObject, speed, 5f, false);
}
// 6级+ 易伤监听逻辑:如果本箭命中了,自动给目标挂上 30% 易伤
if (applyVulnerability)
{
StartCoroutine(ApplyVulnerabilityWhenHit(targetObj, 4.0f, 0.30f));
}
}
private IEnumerator ApplyVulnerabilityWhenHit(GameObject targetObj, float duration, float ratio)
{
// 等待箭矢飞至命中(约 0.2 ~ 0.4 秒)
yield return new WaitForSeconds(0.25f);
if (targetObj != null && targetObj.activeInHierarchy)
{
var status = targetObj.GetComponentInParent<StatusEffectController>();
if (status != null)
{
status.ApplyVulnerability(duration, ratio);
Debug.Log($"<color=yellow>【弱点锁定】生效!</color> 目标 {targetObj.name} 陷入破甲易伤:受击伤害 +{ratio * 100:F0}%,持续 {duration} 秒!");
}
}
}
private bool IsTargetDead(GameObject targetObj)
{
if (targetObj == null) return true;
var bar = targetObj.GetComponentInParent<WorldHealthBar>();
return bar != null && bar.IsDead;
}
private void OnDestroy()
{
if (activeVolleyCoroutine != null)
{
StopCoroutine(activeVolleyCoroutine);
}
}
}
@@ -19,6 +19,23 @@ public class StatusEffectController : MonoBehaviour
/// <summary>是否处于眩晕免疫/霸体状态</summary>
public bool isStunImmune = false;
[Header("易伤状态")]
private float vulnerabilityRemaining = 0f;
private float vulnerabilityRatio = 0f;
public bool HasVulnerability => vulnerabilityRemaining > 0f;
public float VulnerabilityRatio => vulnerabilityRemaining > 0f ? vulnerabilityRatio : 0f;
/// <summary>
/// 施加破甲/易伤标记:使目标在持续时间内受到的所有伤害增加指定比例
/// </summary>
public void ApplyVulnerability(float duration, float ratio)
{
if (duration <= 0f || ratio <= 0f) return;
vulnerabilityRemaining = Mathf.Max(vulnerabilityRemaining, duration);
vulnerabilityRatio = Mathf.Max(vulnerabilityRatio, ratio);
}
private void Awake()
{
animator = GetComponent<Animator>();
@@ -50,6 +67,16 @@ public class StatusEffectController : MonoBehaviour
private void Update()
{
if (vulnerabilityRemaining > 0f)
{
vulnerabilityRemaining -= Time.deltaTime;
if (vulnerabilityRemaining <= 0f)
{
vulnerabilityRemaining = 0f;
vulnerabilityRatio = 0f;
}
}
if (!IsStunned)
{
return;
+6
View File
@@ -492,6 +492,12 @@ public class UnitBase : MonoBehaviour
damage *= (1f - cappedReduction);
}
// 破甲/易伤标记结算
if (statusEffectController != null && statusEffectController.HasVulnerability)
{
damage *= (1f + statusEffectController.VulnerabilityRatio);
}
healthBar.TakeDamage(ModifyIncomingDamage(damage, attacker), attacker);
return true;
}