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

feat(武器): 添加彩虹猫之刃武器及相关资源

添加彩虹猫之刃武器,包含以下内容:
- 新增彩虹猫子弹和武器贴图资源
- 实现彩虹猫子弹和武器逻辑脚本
- 添加武器预制体和相关动画效果
- 在公鸡角色中默认装备该武器
- 修改子弹基类添加AI调用逻辑
This commit is contained in:
2025-09-21 08:26:29 +08:00
parent 73c59be0e8
commit f58a8ea014
13 changed files with 271 additions and 6 deletions
+4
View File
@@ -0,0 +1,4 @@
extends BulletBase
func ai():
PresetBulletAI.lockLauncher(self, launcher, true)
+5
View File
@@ -0,0 +1,5 @@
extends BulletBase
class_name RainbowCat
func ai():
PresetBulletAI.forward(self, rotation)
+13
View File
@@ -0,0 +1,13 @@
@tool
extends Weapon
func update(to, origin, _entity):
origin["atk"] += 7 * to * soulLevel
origin["count"] = 1 * soulLevel
return origin
func attack(entity: EntityBase):
var weaponPos = entity.findWeaponAnchor("normal")
for i in BulletBase.generate(preload("res://components/Bullets/Meowmere.tscn"), entity, weaponPos, weaponPos.angle_to_point(get_global_mouse_position())):
i.damage = readStore("atk")
for i in readStore("count"):
BulletBase.generate(preload("res://components/Bullets/RainbowCat.tscn"), entity, weaponPos, weaponPos.angle_to_point(get_global_mouse_position()))
+1
View File
@@ -50,6 +50,7 @@ func _ready():
if autoDestroyOnHitMap:
tryDestroy(true)
)
ai()
func _process(_delta: float) -> void:
if destroying: return
if lifeTime > 0:
+1 -1
View File
@@ -327,7 +327,7 @@ func tryHeal(count: float):
playSound("heal")
healed.emit(heal(count * fields.get(FieldStore.Entity.HEAL_ABILITY)))
healthChanged.emit(health)
func findWeaponAnchor(weaponName: String):
func findWeaponAnchor(weaponName: String) -> Vector2:
var anchor = $"%weapons".get_node_or_null(weaponName)
if anchor is Node2D:
return anchor.global_position