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:
@@ -0,0 +1,4 @@
|
||||
extends BulletBase
|
||||
|
||||
func ai():
|
||||
PresetBulletAI.lockLauncher(self, launcher, true)
|
||||
@@ -0,0 +1,5 @@
|
||||
extends BulletBase
|
||||
class_name RainbowCat
|
||||
|
||||
func ai():
|
||||
PresetBulletAI.forward(self, rotation)
|
||||
@@ -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()))
|
||||
@@ -50,6 +50,7 @@ func _ready():
|
||||
if autoDestroyOnHitMap:
|
||||
tryDestroy(true)
|
||||
)
|
||||
ai()
|
||||
func _process(_delta: float) -> void:
|
||||
if destroying: return
|
||||
if lifeTime > 0:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user