mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(角色): 添加狗角色音效和攻击冷却随机化
添加狗角色的受伤音效文件并配置导入设置 修改狗的攻击冷却时间为3000-5000毫秒随机值 调整狗角色的受伤音效播放几率为30% 为狗角色添加碰撞检测形状
This commit is contained in:
@@ -77,6 +77,7 @@ var inventoryMax = {
|
||||
@export var level: int = 1
|
||||
@export var currentInvinsible: bool = false
|
||||
@export var useStatic: bool = false
|
||||
@export var hurtAudioRate: float = 1
|
||||
|
||||
@onready var animatree: AnimationTree = $"%animatree"
|
||||
@onready var texture: AnimatedSprite2D = $"%texture"
|
||||
@@ -239,7 +240,8 @@ func takeDamage(bullet: BulletBase, crit: bool):
|
||||
storeEnergy(damage * 0.35)
|
||||
damage = 0
|
||||
else:
|
||||
playSound("hurt")
|
||||
if MathTool.rate(hurtAudioRate):
|
||||
playSound("hurt")
|
||||
storeEnergy(damage * -0.5)
|
||||
position += Vector2.from_angle(bullet.position.angle_to_point(position)) * bullet.knockback
|
||||
hit.emit(damage, bullet, crit)
|
||||
|
||||
Reference in New Issue
Block a user