mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-31 16:31:54 +08:00
feat(武器系统): 添加核弹武器及相关资源
实现核弹武器功能,包括: - 添加核弹控制器武器脚本和场景 - 实现核弹子弹逻辑和爆炸效果 - 添加相关图片、音效资源 - 更新角色武器库包含核弹 - 调整武器名称颜色配置
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
extends BulletBase
|
||||
class_name NuclearBomb
|
||||
|
||||
@onready var label: Label = $"%label"
|
||||
@onready var anchor: Node2D = $"%anchor"
|
||||
|
||||
var countdown = 10000
|
||||
var radius = 500
|
||||
|
||||
func spawn():
|
||||
hitbox.disabled = true
|
||||
hitbox.shape.radius = radius
|
||||
anchor.global_rotation = 0
|
||||
func ai():
|
||||
speed *= 0.99
|
||||
PresetBulletAI.forward(self, rotation)
|
||||
label.text = "NUCLEAR WARNING %.1f" % ((countdown - timeLived()) / 1000)
|
||||
if timeLived() > countdown:
|
||||
tryDestroy()
|
||||
func destroy(_b):
|
||||
EffectController.create(preload("res://components/Effects/NuclearExplosion.tscn"), global_position).shot()
|
||||
hitbox.disabled = false
|
||||
await TickTool.frame(5)
|
||||
@@ -0,0 +1,14 @@
|
||||
@tool
|
||||
extends Weapon
|
||||
|
||||
func update(to: int, origin: Dictionary, _entity: EntityBase):
|
||||
origin["atk"] += 25 * to * soulLevel
|
||||
origin["radius"] += 20 * to * soulLevel
|
||||
return origin
|
||||
func attack(entity: EntityBase):
|
||||
var weaponPos = entity.findWeaponAnchor("normal")
|
||||
for j in BulletBase.generate(preload("res://components/Bullets/NuclearBomb.tscn"), entity, weaponPos, weaponPos.angle_to_point(get_global_mouse_position())):
|
||||
var bullet: NuclearBomb = j
|
||||
bullet.damage = readStore("atk")
|
||||
bullet.radius = readStore("radius")
|
||||
return true
|
||||
Reference in New Issue
Block a user