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

feat(武器): 调整链式机枪属性和位置

- 修改链式机枪的伤害范围和攻击力
- 调整子弹纹理位置和缩放比例
- 为武器添加商店属性
- 修复武器移动时的空指针问题
- 更新公鸡角色的初始武器配置
This commit is contained in:
2025-09-21 22:20:53 +08:00
parent 034c98654a
commit 87a2e9f2df
4 changed files with 26 additions and 17 deletions
+2 -1
View File
@@ -14,7 +14,8 @@ lifeTime = 50.0
sprite_frames = SubResource("SpriteFrames_cl70o")
[node name="node" type="Sprite2D" parent="texture" index="1"]
position = Vector2(74, 0)
position = Vector2(130, 0)
scale = Vector2(2, 2)
texture = ExtResource("2_4hyk3")
[node name="anchor" type="Node2D" parent="texture/node" index="0"]
+7 -3
View File
@@ -1,10 +1,11 @@
[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"]
[ext_resource type="Texture2D" uid="uid://fn8qx72clh38" path="res://resources/characters/cock/rooster-a.svg" id="2_q0j6j"]
[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://dlaks67h2osms" path="res://components/Weapons/ChainGun.tscn" id="3_inwol"]
[ext_resource type="PackedScene" uid="uid://c0n3igy4hucrg" path="res://components/Weapons/PurpleCrystal.tscn" id="3_ms5sq"]
[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"]
@@ -45,10 +46,13 @@ displayName = "公鸡"
[node name="weaponStore" parent="." index="0"]
process_mode = 4
[node name="PurpleCrystal" parent="weaponStore" index="0" instance=ExtResource("3_ms5sq")]
[node name="ChainGun" parent="weaponStore" index="0" instance=ExtResource("3_inwol")]
offset_bottom = 330.0
[node name="PurpleCrystal" parent="weaponStore" index="1" instance=ExtResource("3_ms5sq")]
debugRebuild = false
[node name="VectorStar" parent="weaponStore" index="1" instance=ExtResource("6_fvy5n")]
[node name="VectorStar" parent="weaponStore" index="2" instance=ExtResource("6_fvy5n")]
debugRebuild = false
[node name="sprint" parent="sounds" index="0"]
+4 -2
View File
@@ -9,9 +9,11 @@ script = ExtResource("2_ponmu")
avatarTexture = ExtResource("2_ghn43")
displayName = "链式机枪"
costBeachball = 400
store = {
"atk": 5
}
needEnergy = 1.0
cooldown = 66.0
debugRebuild = true
[node name="avatar" parent="container/info" index="0"]
texture = ExtResource("2_ghn43")
@@ -26,4 +28,4 @@ text = "400"
displayName = "链式机枪"
[node name="description" parent="container" index="2"]
text = "[center]造成[color=cyan]10[/color]→[color=yellow]7[/color]点伤害。[/center]"
text = "[center]造成[color=cyan]5[/color]→[color=yellow]12[/color]点伤害。[/center]"
+13 -11
View File
@@ -48,7 +48,7 @@ func _ready():
func():
if soulLevel > WeaponName.SoulLevel.NORMALIZE:
UIState.player.getItem({
ItemStore.ItemType.SOUL: soulLevel
ItemStore.ItemType.SOUL: soulLevel - 1
})
soulLevel -= 1
updateStore(level, UIState.player)
@@ -66,19 +66,21 @@ func _ready():
)
moveLeftBtn.pressed.connect(
func():
var myIndex = get_index()
var leftIndex = max(myIndex - 1, 0)
get_parent().move_child(self, leftIndex)
ArrayTool.swap(UIState.player.weapons, myIndex, leftIndex)
UIState.player.rebuildWeaponIcons()
if get_parent():
var myIndex = get_index()
var leftIndex = max(myIndex - 1, 0)
get_parent().move_child(self, leftIndex)
ArrayTool.swap(UIState.player.weapons, myIndex, leftIndex)
UIState.player.rebuildWeaponIcons()
)
moveRightBtn.pressed.connect(
func():
var myIndex = get_index()
var rightIndex = min(myIndex + 1, get_parent().get_child_count() - 1)
get_parent().move_child(self, rightIndex)
ArrayTool.swap(UIState.player.weapons, myIndex, rightIndex)
UIState.player.rebuildWeaponIcons()
if get_parent():
var myIndex = get_index()
var rightIndex = min(myIndex + 1, get_parent().get_child_count() - 1)
get_parent().move_child(self, rightIndex)
ArrayTool.swap(UIState.player.weapons, myIndex, rightIndex)
UIState.player.rebuildWeaponIcons()
)
for i in sounds.get_children():
i.process_mode = ProcessMode.PROCESS_MODE_ALWAYS