1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-06 03:37:13 +08:00

feat(Bear): 添加新的攻击类型和音效资源

为Bear角色新增第4种攻击类型,包含环形弹幕攻击效果
添加对应的攻击音效资源文件
更新攻击冷却时间映射和AI逻辑以支持新攻击
This commit is contained in:
2025-09-13 22:03:28 +08:00
parent 63590367a4
commit 15913108bf
4 changed files with 34 additions and 2 deletions
+5 -1
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=28 format=3 uid="uid://m60bwhdpbem8"]
[gd_scene load_steps=29 format=3 uid="uid://m60bwhdpbem8"]
[ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_3ves7"]
[ext_resource type="Script" path="res://scripts/Contents/Characters/Bear.gd" id="2_kh2af"]
@@ -11,6 +11,7 @@
[ext_resource type="AudioStream" uid="uid://dhcm3pjj82xhg" path="res://resources/sounds/bossAttack/Bear/ForeverRainbow.ogg" id="5_vej16"]
[ext_resource type="Texture2D" uid="uid://d2mwi15jqmnek" path="res://resources/characters/bear/bear-walk-e.svg" id="6_rwuah"]
[ext_resource type="AudioStream" uid="uid://cqh2yvwcy83gg" path="res://resources/sounds/bossAttack/Bear/Sprint.ogg" id="6_x3jmu"]
[ext_resource type="AudioStream" uid="uid://ce8xjsh68momv" path="res://resources/sounds/bossAttack/Bear/Arrow7-2.ogg" id="7_0r2df"]
[ext_resource type="Texture2D" uid="uid://cli2fyulk3dsg" path="res://resources/characters/bear/bear-walk-f.svg" id="7_f0c6w"]
[ext_resource type="Texture2D" uid="uid://dadi3ud01bqxk" path="res://resources/characters/bear/bear-walk-g.svg" id="8_4c7bp"]
[ext_resource type="Texture2D" uid="uid://017nthmejh3g" path="res://resources/characters/bear/bear-walk-h.svg" id="9_bcby1"]
@@ -123,6 +124,9 @@ stream = ExtResource("5_vej16")
[node name="attack3" type="AudioStreamPlayer2D" parent="sounds" index="8"]
stream = ExtResource("6_x3jmu")
[node name="attack4" type="AudioStreamPlayer2D" parent="sounds" index="9"]
stream = ExtResource("7_0r2df")
[node name="texture" parent="." index="2"]
position = Vector2(0, -80)
sprite_frames = SubResource("SpriteFrames_6tgxs")
Binary file not shown.
@@ -0,0 +1,19 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://ce8xjsh68momv"
path="res://.godot/imported/Arrow7-2.ogg-99c64aada4ff27a3b602fb6e2559ff06.oggvorbisstr"
[deps]
source_file="res://resources/sounds/bossAttack/Bear/Arrow7-2.ogg"
dest_files=["res://.godot/imported/Arrow7-2.ogg-99c64aada4ff27a3b602fb6e2559ff06.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
+10 -1
View File
@@ -10,12 +10,13 @@ func register():
attackCooldownMap[1] = 10000
attackCooldownMap[2] = 8000
attackCooldownMap[3] = 13000
attackCooldownMap[4] = 4500
sprintMultiplier = 60
func spawn():
texture.play("walk")
func ai():
PresetEntityAI.follow(self, currentFocusedBoss, 200)
for i in range(4):
for i in len(attackCooldownMap.keys()):
tryAttack(i)
func attack(type):
var weaponPos = findWeaponAnchor("normal")
@@ -48,6 +49,14 @@ func attack(type):
canRunAi = true
await sprintTo(currentFocusedBoss.position + MathTool.randv2_range(400), 0.25)
return false
elif type == 4:
playSound("attack4")
var count = randi_range(8, 12)
for i in range(count):
for bullet in BulletBase.generate(preload("res://components/Bullets/BossAttack/Bear/ArrowSeven.tscn"), self, findWeaponAnchor("normal"), deg_to_rad(360.0 / count * i)):
bullet.tracer = currentFocusedBoss
await TickTool.millseconds(830.0 / count)
return false
return true
func sprint():
move(Vector2(sign((currentFocusedBoss.position - position).x * sprintMultiplier), 0), true)