mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
a72c0032d5
添加新的武器"齿轮回旋镖"及其配套子弹资源: 1. 实现齿轮武器的基本逻辑,包括攻击和属性计算 2. 添加齿轮子弹的旋转、减速和回旋行为 3. 包含相关资源文件(图片、场景、脚本) 4. 将新武器添加到公鸡角色的武器库中
21 lines
675 B
GDScript
21 lines
675 B
GDScript
@tool
|
|
extends Weapon
|
|
|
|
func update(to: int, origin: Dictionary, _entity: EntityBase):
|
|
origin["atk"] += 2 * to * soulLevel
|
|
origin["rotate"] += 1 * to * soulLevel
|
|
return origin
|
|
func attack(entity: EntityBase):
|
|
var weaponPos = entity.findWeaponAnchor("normal")
|
|
for bullet in BulletBase.generate(
|
|
ComponentManager.getBullet("Cogwheel"),
|
|
entity,
|
|
weaponPos,
|
|
weaponPos.angle_to_point(get_global_mouse_position()),
|
|
):
|
|
if bullet is CogwheelBullet:
|
|
bullet.initialRotate = readStore("rotate")
|
|
bullet.rotateSpeed = readStore("rotate")
|
|
bullet.baseDamage = readStore("atk")
|
|
return true
|