From 9cc5c7bd946fb07b5197d9a192a32fec2110c8ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=A8=E8=90=BD=E5=9F=BA=E5=9B=B4=E8=99=BE?= <3161880837@qq.com> Date: Wed, 17 Dec 2025 22:21:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=AD=A6=E5=99=A8=E7=B3=BB=E7=BB=9F):=20?= =?UTF-8?q?=E4=B8=BA=E7=BA=A2=E6=B0=B4=E6=99=B6=E6=AD=A6=E5=99=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=B0=B4=E6=99=B6=E7=A2=8E=E7=89=87=E5=BC=B9=E5=B0=84?= =?UTF-8?q?=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增水晶碎片子弹类型,当红水晶爆炸时会向随机方向发射碎片 修改红水晶武器配置,添加碎片数量和伤害百分比属性 更新武器描述以反映新功能 --- components/Bullets/CrystalBlock.tscn | 26 ++++++++++++++++++++ components/Weapons/RedCrystal.tscn | 9 +++++-- scripts/Contents/Bullets/CrystalBlock.gd | 5 ++++ scripts/Contents/Bullets/CrystalBlock.gd.uid | 1 + scripts/Contents/Bullets/RedCrystal.gd | 4 +++ scripts/Contents/Weapons/RedCrystal.gd | 2 ++ 6 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 components/Bullets/CrystalBlock.tscn create mode 100644 scripts/Contents/Bullets/CrystalBlock.gd create mode 100644 scripts/Contents/Bullets/CrystalBlock.gd.uid diff --git a/components/Bullets/CrystalBlock.tscn b/components/Bullets/CrystalBlock.tscn new file mode 100644 index 0000000..015ff87 --- /dev/null +++ b/components/Bullets/CrystalBlock.tscn @@ -0,0 +1,26 @@ +[gd_scene load_steps=5 format=3 uid="uid://b3anl1y0phmdv"] + +[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_wqonw"] +[ext_resource type="Script" uid="uid://2fv75mmhvjuc" path="res://scripts/Contents/Bullets/CrystalBlock.gd" id="2_42ni1"] +[ext_resource type="Texture2D" uid="uid://c7hyatbuieaj" path="res://resources/bullets/purple-crystal/frames/0.svg" id="3_ktit7"] + +[sub_resource type="SpriteFrames" id="SpriteFrames_1xf7i"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("3_ktit7") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] + +[node name="CrystalBlock" instance=ExtResource("1_wqonw")] +script = ExtResource("2_42ni1") +displayName = "水晶碎块" +lifeTime = 1000.0 + +[node name="texture" parent="." index="0"] +modulate = Color(1.2888849, 0.4489804, 0.4489804, 0.5) +scale = Vector2(0.7, 0.7) +sprite_frames = SubResource("SpriteFrames_1xf7i") diff --git a/components/Weapons/RedCrystal.tscn b/components/Weapons/RedCrystal.tscn index d80fb11..2f0ace0 100644 --- a/components/Weapons/RedCrystal.tscn +++ b/components/Weapons/RedCrystal.tscn @@ -12,14 +12,19 @@ displayName = "红水晶簇" typeTopic = 1 store = { "atk": 45, +"count": 1, +"percent": 0.5, "radius": 150.0 } storeType = { "atk": 1, +"count": 1, +"percent": 2, "radius": 1 } -descriptionTemplate = "发射[b]红水晶[/b],在3秒后以$radius的半径爆炸,造成$atk点伤害。" +descriptionTemplate = "发射[b]红水晶[/b],在3秒后以$radius的半径爆炸,造成$atk点伤害并向随机方向发射$count个[b]水晶碎片[/b],造成$percent基础伤害。" cooldown = 1000.0 +debugRebuild = true [node name="attack" parent="sounds" index="0"] stream = ExtResource("4_qt0vq") @@ -32,4 +37,4 @@ displayName = "红水晶簇" typeTopic = 1 [node name="description" parent="container" index="2"] -text = "[center]发射[b]红水晶[/b],在3秒后以[color=cyan]150[/color]的半径爆炸,造成[color=cyan]60[/color]点伤害。[/center]" +text = "[center]发射[b]红水晶[/b],在3秒后以[color=cyan]150[/color]的半径爆炸,造成[color=cyan]45[/color]点伤害并向随机方向发射[color=cyan]1[/color]个[b]水晶碎片[/b],造成[color=cyan]50%[/color]基础伤害。[/center]" diff --git a/scripts/Contents/Bullets/CrystalBlock.gd b/scripts/Contents/Bullets/CrystalBlock.gd new file mode 100644 index 0000000..dcaf46c --- /dev/null +++ b/scripts/Contents/Bullets/CrystalBlock.gd @@ -0,0 +1,5 @@ +extends BulletBase +class_name CrystalBlockBullet + +func ai(): + PresetBulletAI.forward(self, rotation) diff --git a/scripts/Contents/Bullets/CrystalBlock.gd.uid b/scripts/Contents/Bullets/CrystalBlock.gd.uid new file mode 100644 index 0000000..d5b818d --- /dev/null +++ b/scripts/Contents/Bullets/CrystalBlock.gd.uid @@ -0,0 +1 @@ +uid://2fv75mmhvjuc diff --git a/scripts/Contents/Bullets/RedCrystal.gd b/scripts/Contents/Bullets/RedCrystal.gd index 8c693bc..1dd06c8 100644 --- a/scripts/Contents/Bullets/RedCrystal.gd +++ b/scripts/Contents/Bullets/RedCrystal.gd @@ -2,6 +2,7 @@ extends BulletBase class_name RedCrystalBullet var radius: float = 0 +var percent: float = 0 func register(): hitbox.shape = hitbox.shape.duplicate() @@ -11,4 +12,7 @@ func ai(): func destroy(_beacuseMap: bool): hitbox.shape.radius = radius EffectController.create(ComponentManager.getEffect("RedCrystalExplosion"), global_position).shot() + for bullet in BulletBase.generate(ComponentManager.getBullet("CrystalBlock"), launcher, position, deg_to_rad(randf_range(0, 360))): + if bullet is CrystalBlockBullet: + bullet.baseDamage = baseDamage * percent await TickTool.millseconds(100) diff --git a/scripts/Contents/Weapons/RedCrystal.gd b/scripts/Contents/Weapons/RedCrystal.gd index cf5249f..5212fb9 100644 --- a/scripts/Contents/Weapons/RedCrystal.gd +++ b/scripts/Contents/Weapons/RedCrystal.gd @@ -5,6 +5,8 @@ class_name RedCrystalWeapon func update(to: int, origin: Dictionary, _entity: EntityBase): origin["atk"] += 5 * to * soulLevel origin["radius"] += 1 * to * soulLevel + origin["count"] = 1 * soulLevel + origin["percent"] += 0.02 * to * soulLevel return origin func attack(entity: EntityBase): var weaponPos = entity.findWeaponAnchor("normal")