From c5d58a14f77325fef65c0c758373f1af7a828217 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: Mon, 29 Sep 2025 22:33:56 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=AD=A6=E5=99=A8):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=99=BD=E8=89=B2=E7=81=B5=E9=AD=82=E6=AD=A6=E5=99=A8=E5=8F=8A?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加新的白色灵魂武器,包括脚本、场景和资源文件 修改公鸡角色配置以使用新武器 优化子弹工具类和白色灵魂子弹的行为 添加获取窗口大小的工具方法 --- components/Bullets/WhiteSoul.tscn | 6 ++- components/Characters/Rooster.tscn | 10 +++-- components/Weapons/WhiteSoul.tscn | 36 ++++++++++++++++++ resources/weapons/Daedalus_Stormbow.png | Bin 0 -> 1240 bytes .../weapons/Daedalus_Stormbow.png.import | 34 +++++++++++++++++ resources/weapons/Daedalus_Stormbow.webp | Bin 0 -> 314 bytes .../weapons/Daedalus_Stormbow.webp.import | 34 +++++++++++++++++ scripts/Contents/Bullets/WhiteSoul.gd | 4 -- scripts/Contents/Weapons/WhiteSoul.gd | 17 +++++++++ scripts/Tools/BulletTool.gd | 2 +- scripts/Tools/QuickUI.gd | 3 ++ 11 files changed, 136 insertions(+), 10 deletions(-) create mode 100644 components/Weapons/WhiteSoul.tscn create mode 100644 resources/weapons/Daedalus_Stormbow.png create mode 100644 resources/weapons/Daedalus_Stormbow.png.import create mode 100644 resources/weapons/Daedalus_Stormbow.webp create mode 100644 resources/weapons/Daedalus_Stormbow.webp.import create mode 100644 scripts/Contents/Weapons/WhiteSoul.gd diff --git a/components/Bullets/WhiteSoul.tscn b/components/Bullets/WhiteSoul.tscn index 48633f0..ad17941 100644 --- a/components/Bullets/WhiteSoul.tscn +++ b/components/Bullets/WhiteSoul.tscn @@ -44,8 +44,9 @@ alpha_curve = SubResource("CurveTexture_bd63g") [node name="WhiteSoul" instance=ExtResource("1_k41ea")] texture_filter = 1 script = ExtResource("2_ld7n7") -speed = 1.0 -lifeTime = 1000.0 +displayName = "怪物灵魂" +speed = 20.0 +lifeTime = 2000.0 [node name="texture" parent="." index="0"] rotation = -1.5708 @@ -55,4 +56,5 @@ sprite_frames = SubResource("SpriteFrames_3yyb4") amount = 10 process_material = SubResource("ParticleProcessMaterial_u4kq5") texture = ExtResource("2_mqva0") +speed_scale = 2.0 local_coords = true diff --git a/components/Characters/Rooster.tscn b/components/Characters/Rooster.tscn index c3fb311..8aca251 100644 --- a/components/Characters/Rooster.tscn +++ b/components/Characters/Rooster.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=15 format=3 uid="uid://bm7ymrri6pykb"] +[gd_scene load_steps=16 format=3 uid="uid://bm7ymrri6pykb"] [ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_e5pl8"] [ext_resource type="Script" path="res://scripts/Contents/Characters/Rooster.gd" id="2_oqdqd"] @@ -6,6 +6,7 @@ [ext_resource type="AudioStream" uid="uid://dclinyhu256xi" path="res://resources/sounds/effect/Low Whoosh.mp3" id="3_4syso"] [ext_resource type="Texture2D" uid="uid://ci2ik43ce82uy" path="res://resources/characters/cock/rooster-b.svg" id="3_b0fgx"] [ext_resource type="PackedScene" uid="uid://c0n3igy4hucrg" path="res://components/Weapons/PurpleCrystal.tscn" id="3_cyreu"] +[ext_resource type="PackedScene" uid="uid://bt4b7ks26fcgi" path="res://components/Weapons/WhiteSoul.tscn" id="3_irwgh"] [ext_resource type="AudioStream" uid="uid://cdrevrq7n6yqa" path="res://resources/sounds/effect/Boing.mp3" id="4_66s6c"] [ext_resource type="AudioStream" uid="uid://benyec5bqni0b" path="res://resources/sounds/effect/Chomp.wav" id="4_k0yme"] [ext_resource type="PackedScene" uid="uid://bb1uh8k7gkhr7" path="res://components/Weapons/VectorStar.tscn" id="4_re2px"] @@ -45,10 +46,13 @@ displayName = "公鸡" [node name="weaponStore" parent="." index="0"] process_mode = 4 -[node name="PurpleCrystal" parent="weaponStore" index="0" instance=ExtResource("3_cyreu")] +[node name="WhiteSoul" parent="weaponStore" index="0" instance=ExtResource("3_irwgh")] +offset_bottom = 374.0 + +[node name="PurpleCrystal" parent="weaponStore" index="1" instance=ExtResource("3_cyreu")] debugRebuild = false -[node name="VectorStar" parent="weaponStore" index="1" instance=ExtResource("4_re2px")] +[node name="VectorStar" parent="weaponStore" index="2" instance=ExtResource("4_re2px")] debugRebuild = false [node name="sprint" parent="sounds" index="0"] diff --git a/components/Weapons/WhiteSoul.tscn b/components/Weapons/WhiteSoul.tscn new file mode 100644 index 0000000..543c446 --- /dev/null +++ b/components/Weapons/WhiteSoul.tscn @@ -0,0 +1,36 @@ +[gd_scene load_steps=4 format=3 uid="uid://bt4b7ks26fcgi"] + +[ext_resource type="PackedScene" uid="uid://ckq2cq6m23hq3" path="res://components/Abstracts/WeaponCardBase.tscn" id="1_4hjdm"] +[ext_resource type="Texture2D" uid="uid://bgj2i5q2rst27" path="res://resources/weapons/Daedalus_Stormbow.png" id="2_kcegs"] +[ext_resource type="Script" path="res://scripts/Contents/Weapons/WhiteSoul.gd" id="2_ti114"] + +[node name="WhiteSoul" instance=ExtResource("1_4hjdm")] +script = ExtResource("2_ti114") +avatarTexture = ExtResource("2_kcegs") +displayName = "代达罗斯风暴魂" +quality = 3 +costBeachball = 300 +store = { +"atk": 5, +"count": 2.0, +"radius": 50.0 +} +storeType = { +"atk": 1, +"count": 1, +"radius": 0.0 +} +descriptionTemplate = "从天而降$count支目标位于鼠标位置半径$radius内的怪物灵魂,造成$atk点伤害。" + +[node name="avatar" parent="container/info" index="0"] +texture = ExtResource("2_kcegs") + +[node name="beachball" parent="container/info/infos/beachballInfo" index="1"] +text = "300" + +[node name="name" parent="container/info" index="2"] +displayName = "代达罗斯风暴魂" +quality = 3 + +[node name="description" parent="container" index="2"] +text = "[center]从天而降[color=cyan]2[/color]→[color=yellow]2[/color]支目标位于鼠标位置半径[color=cyan]50.00[/color]→[color=yellow]47.62[/color]内的怪物灵魂,造成[color=cyan]2[/color]→[color=yellow]4[/color]点伤害。[/center]" diff --git a/resources/weapons/Daedalus_Stormbow.png b/resources/weapons/Daedalus_Stormbow.png new file mode 100644 index 0000000000000000000000000000000000000000..74e363f5f2171f1256b2908d99a21e1359324d62 GIT binary patch literal 1240 zcmV;}1Sk86P)EX>4Tx04R}tkv&MmKpe$iTcs)$2aAYw$WWcy#V;I76^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|E;uQ=NQwVT3N2zhIPS;0dyl(!fVWv?iqR7T6xGzz ziMWu_wexbF3Pjq&;2+4MYdkXR^nvDC$^tSiLR#9>)cDc_rO zSmwONS*g}p`=0!Tfr7e{;X2I_5?DeKDF~2IM+H@wh|;Q(VjxZXaTouX?N5<|i>Cw0M1x08?u!RUz+m3Sz-<{vN#lQPsg1z88NA`~}T@UVfGQd3yhQyC~C z?ZKP3C~wAecssH)&f8tv?LDIRyZvV7&7a@r_x;W6f=^bBEvm7FU+W*^KeZA+NCUKn zx}Amu0^l=ID0l?JUQvi~WJ^-+= zJ`cd^`T|DHSL9fCv#`tvh#%F$4b1{zdDrp#$6o2vJk1GE8)=tF_*^Xuh?0Nv+oNGyI z{Urcn9sL0GO^*W5*>VGbt6%2;7>TYpl8;U(^L~jzWLGh)vcXTNkkovY|*4%FC0r{VaA*Js`Xy|}+_|%^9 z`|>kq6~Z&qlS;q7Kj}XiA2gEpl(^WKHMYw@Se0$w6W2AZM^q=PYg$G)_U^SpJ~Prn zh^((X%d!sbN0M&6e9f3~QuA(^Aos0n-V@@v4y=#M41j0E8ycIk64u+L>DoRD>3qoR zTGy+(B<+>~ON;Z~5kKmIy(Dkx+SUoXX;)T#x2jpl!A<1dZXLP4TP@HtKx#esb*7t) zlq4=m??-x+NJ~Ey=@9^pH6Z{N*AfM9E_Cms(C6Dv_v!1W79MAP;RSDXo%r_lma$47 z((qDTok8;z&i4z`cw+dXl{0Vj{ebZn(9h=^aVu@U6VLYI`j^bGZ;^REPl&q_&1}zS z%wM%|L$h%Ex1|^lnSAc_e8&~zd?jA#xtQaMVZQ-M$zJU6TE-s$0000TB^3Kf*sEX)61GkM7`DmGr{xDPR zwz+7Fs`&Zz22?;)X;Ag+jf$Ak;3kAVt+<}*lI5lpF_EOF89r9r`1v(M#lFbTI~CXZ zxG%h50IqdZYT(7SUTp4!u;5`-NdzijKzpJ}A^-~>Hfn}}9(@Bf*LipxY8~yYx!T9Z zC1h*oWKC3A1a^K&~??%q|>JPq? BulletBase: static func canDamage(bullet: BulletBase, target: EntityBase) -> bool: if target.currentInvinsible: return false if !bullet.canDamageSelf && target == bullet.launcher: return false - if !bullet.is_node_ready() && !GameRule.allowFriendlyFire: + if !GameRule.allowFriendlyFire: if target.isPlayer() == bullet.launcher.isPlayer() and bullet.launcher.currentFocusedBoss != target: return false return true diff --git a/scripts/Tools/QuickUI.gd b/scripts/Tools/QuickUI.gd index d617cc0..e666b43 100644 --- a/scripts/Tools/QuickUI.gd +++ b/scripts/Tools/QuickUI.gd @@ -16,3 +16,6 @@ static func graySmallText(text: String, center: bool = true): if center: label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER return label +static func getWindowSize() -> Vector2: + var result = DisplayServer.window_get_size() + return result