1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-31 16:31:54 +08:00

feat(武器系统): 添加七彩矢武器及其相关资源

添加新的七彩矢武器系统,包括武器脚本、子弹特效、着色器和动画资源
为Rooster角色添加新武器选项
实现光效追踪和颜色渐变效果
调整窗口模式为2(全屏)
This commit is contained in:
2025-09-07 09:25:51 +08:00
parent 2d42eaea9a
commit 94589131fa
18 changed files with 445 additions and 2 deletions
@@ -0,0 +1,42 @@
extends BulletBase
@export var allColor: GradientTexture1D = null
@onready var superlight: Node2D = $"%superlight"
@onready var trail: GPUParticles2D = $"%trail"
var myColor: Color
var tracer: EntityBase = null
var forwardTime: float = 500
var forwarded: bool = false
func register():
speed = 1
damage = 5
penerate = 1
func spawn():
myColor = allColor.gradient.sample(randf())
superlight.material = superlight.material.duplicate()
trail.process_material = trail.process_material.duplicate()
setColor(myColor)
func ai():
superlight.global_rotation_degrees = 90
PresetBulletAI.forward(self, rotation)
if timeLived() <= forwardTime:
speed = 10 * ((forwardTime - timeLived()) / forwardTime)
elif forwarded:
if timeLived() < forwardTime + 1000:
speed = clamp((timeLived() - forwardTime) / 75, 0, 30)
if is_instance_valid(tracer):
PresetBulletAI.trace(self, tracer.position, 0.1)
else:
forwarded = true
func setColor(color: Color):
texture.self_modulate = color
var mat: ParticleProcessMaterial = trail.process_material
mat.color = color
superlight.material.set_shader_parameter("color", color)
+7 -1
View File
@@ -1,2 +1,8 @@
extends EntityBase
class_name Bear
class_name Bear # 攻击方式模仿泰拉瑞亚光之女皇
func ai():
pass
func attack(type):
if type == 0:
pass
+15
View File
@@ -0,0 +1,15 @@
@tool
extends Weapon
class_name Arrow7Weapon
func update(to: int, origin: Dictionary, _entity: EntityBase):
origin["atk"] += 5 * to
origin["count"] += 1 * to
return origin
func attack(entity: EntityBase):
var weaponPos = entity.findWeaponAnchor("normal")
for i in range(readStore("count")):
for bullet in BulletBase.generate(preload("res://components/Bullets/BossAttack/Bear/ArrowSeven.tscn"), entity, weaponPos, deg_to_rad(randf_range(0, 360))):
bullet.damage = readStore("atk")
bullet.tracer = EntityTool.findClosetEntity(entity.position, get_tree(), false, true)
return true