mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-29 23:41:54 +08:00
ddd89f1334
实现鸡毛弓武器系统,包括武器脚本、箭矢脚本和场景配置 修改实体伤害处理逻辑,分离普通伤害和子弹伤害方法 更新公鸡角色配置,添加鸡毛弓作为默认武器
21 lines
572 B
GDScript
21 lines
572 B
GDScript
@tool
|
|
extends Weapon
|
|
|
|
func update(to: int, origin: Dictionary, _entity: EntityBase):
|
|
origin["atk"] += 0.05 * to * soulLevel
|
|
origin["count"] = 1 * soulLevel
|
|
origin["self"] += 0.1 * to
|
|
return origin
|
|
func attack(entity: EntityBase):
|
|
entity.takeDamage(readStore("self"))
|
|
var weaponPos = entity.findWeaponAnchor("normal")
|
|
for i in BulletBase.generate(
|
|
ComponentManager.getBullet("Bow"),
|
|
entity,
|
|
weaponPos,
|
|
weaponPos.angle_to_point(get_global_mouse_position())
|
|
):
|
|
var bullet: Bow = i
|
|
bullet.count = readStore("count")
|
|
bullet.atk = readStore("atk")
|