From f2287d6ee75af7f11acc7acde44942dc0799d49c 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: Sat, 6 Sep 2025 08:08:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=AD=A6=E5=99=A8):=20=E6=B7=BB=E5=8A=A0L?= =?UTF-8?q?GBT=E6=AD=A6=E5=99=A8=E5=8F=8A=E5=85=B6=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加LGBT武器场景和对应的GD脚本,实现武器攻击逻辑和属性更新功能。武器发射可追踪的彩虹激光并提升攻击属性。 --- components/Weapons/LGBT.tscn | 9 +++++---- scripts/Contents/Weapons/LGBTWeapon.gd | 11 +++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 scripts/Contents/Weapons/LGBTWeapon.gd diff --git a/components/Weapons/LGBT.tscn b/components/Weapons/LGBT.tscn index 82591b2..57d2c6a 100644 --- a/components/Weapons/LGBT.tscn +++ b/components/Weapons/LGBT.tscn @@ -1,11 +1,12 @@ -[gd_scene load_steps=3 format=3 uid="uid://wl8u5m52708w"] +[gd_scene load_steps=4 format=3 uid="uid://wl8u5m52708w"] [ext_resource type="PackedScene" uid="uid://ckq2cq6m23hq3" path="res://components/Abstracts/WeaponCardBase.tscn" id="1_jwtmd"] +[ext_resource type="Script" path="res://scripts/Contents/Weapons/LGBTWeapon.gd" id="2_0tyah"] [ext_resource type="Texture2D" uid="uid://cwfyi61xkt4bt" path="res://resources/weapons/lgbt.jpeg" id="2_ou6jo"] [node name="LGBT" instance=ExtResource("1_jwtmd")] -offset_right = 190.0 -offset_bottom = 324.0 +offset_bottom = 346.0 +script = ExtResource("2_0tyah") avatarTexture = ExtResource("2_ou6jo") displayName = "彩虹旗" quality = 4 @@ -32,5 +33,5 @@ quality = 4 [node name="description" parent="container" index="2"] size_flags_vertical = 3 -text = "发射[color=cyan]7.0[/color]条可追踪[color=cyan]2.0[/color]秒,效率为[color=cyan]0.3[/color]的带状彩虹,每条造成[color=cyan]20.0[/color]点伤害。" +text = "[center]发射[color=cyan]7.0[/color]条可追踪[color=cyan]2.0[/color]秒,效率为[color=cyan]0.3[/color]的带状彩虹,每条造成[color=cyan]20.0[/color]点伤害。[/center]" autowrap_mode = 2 diff --git a/scripts/Contents/Weapons/LGBTWeapon.gd b/scripts/Contents/Weapons/LGBTWeapon.gd new file mode 100644 index 0000000..0665395 --- /dev/null +++ b/scripts/Contents/Weapons/LGBTWeapon.gd @@ -0,0 +1,11 @@ +extends Weapon +class_name LGBTWeapon + +func update(to: int, origin: Dictionary, _entity: EntityBase): + origin["atk"] += 5 * to + origin["time"] /= 1.1 + return origin +func attack(entity: EntityBase): + var weaponPos = entity.findWeaponAnchor("normal") + BulletBase.generate(preload("res://components/Bullets/BigLaser.tscn"), entity, weaponPos, (get_global_mouse_position() - weaponPos).angle()) + return true