mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-24 04:22:29 +08:00
refactor(武器系统): 重构武器冷却和攻击逻辑
- 将CooldownTimer的startCooldown方法重命名为更简洁的start - 为EntityBase添加weaponStore节点管理武器 - 修改武器攻击逻辑,现在由Weapon类自身处理冷却和攻击 - 调整武器卡片的UI布局和描述居中显示 - 为Rooster角色添加预设武器
This commit is contained in:
@@ -258,6 +258,9 @@ alpha_curve = SubResource("CurveTexture_vvfxd")
|
||||
[node name="EntityBase" type="CharacterBody2D"]
|
||||
script = ExtResource("1_mvol6")
|
||||
|
||||
[node name="weaponStore" type="Node2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="sounds" type="Node2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[node name="WeaponCard" type="PanelContainer"]
|
||||
offset_right = 300.0
|
||||
offset_right = 350.0
|
||||
offset_bottom = 304.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_n2ewr")
|
||||
script = ExtResource("1_g802t")
|
||||
@@ -32,6 +32,7 @@ metadata/_edit_lock_ = true
|
||||
[node name="container" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 10
|
||||
alignment = 1
|
||||
|
||||
[node name="selectBtn" type="Button" parent="container"]
|
||||
unique_name_in_owner = true
|
||||
@@ -80,7 +81,6 @@ quality = 1
|
||||
[node name="description" type="RichTextLabel" parent="container"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
bbcode_enabled = true
|
||||
text = "造成[color=cyan]10.0[/color]点伤害。"
|
||||
fit_content = true
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://bm7ymrri6pykb"]
|
||||
[gd_scene load_steps=15 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://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="PackedScene" uid="uid://cxabqjo7skxev" path="res://components/Weapons/BigLaser.tscn" id="4_0862n"]
|
||||
[ext_resource type="AudioStream" uid="uid://benyec5bqni0b" path="res://resources/sounds/effect/Chomp.wav" id="4_k0yme"]
|
||||
[ext_resource type="AudioStream" uid="uid://dmxh3bpk8vyy5" path="res://resources/sounds/effect/Coin.mp3" id="5_xnbhq"]
|
||||
[ext_resource type="AudioStream" uid="uid://4wuuf1osk0yv" path="res://resources/sounds/effect/Low Boing.wav" id="6_m5px1"]
|
||||
@@ -38,8 +40,13 @@ radius = 41.0122
|
||||
|
||||
[node name="Rooster" instance=ExtResource("1_e5pl8")]
|
||||
script = ExtResource("2_oqdqd")
|
||||
cooldownUnit = 200.0
|
||||
energy = 50.0
|
||||
|
||||
[node name="weaponStore" parent="." index="0"]
|
||||
process_mode = 4
|
||||
|
||||
[node name="PurpleCrystal" parent="weaponStore" index="0" instance=ExtResource("3_ms5sq")]
|
||||
|
||||
[node name="BigLaser" parent="weaponStore" index="1" instance=ExtResource("4_0862n")]
|
||||
|
||||
[node name="sprint" parent="sounds" index="0"]
|
||||
stream = ExtResource("4_66s6c")
|
||||
@@ -53,13 +60,13 @@ stream = ExtResource("5_xnbhq")
|
||||
[node name="hurt" parent="sounds" index="3"]
|
||||
stream = ExtResource("6_m5px1")
|
||||
|
||||
[node name="attack0" parent="sounds" index="4"]
|
||||
stream = ExtResource("3_4syso")
|
||||
|
||||
[node name="attack1" type="AudioStreamPlayer2D" parent="sounds" index="5"]
|
||||
stream = ExtResource("8_7dhim")
|
||||
|
||||
[node name="texture" parent="." index="1"]
|
||||
[node name="attack0" parent="sounds" index="6"]
|
||||
stream = ExtResource("3_4syso")
|
||||
|
||||
[node name="texture" parent="." index="2"]
|
||||
position = Vector2(0, -70)
|
||||
sprite_frames = SubResource("SpriteFrames_4v2ol")
|
||||
animation = &"walk"
|
||||
@@ -71,6 +78,6 @@ shape = SubResource("CircleShape2D_h1v0q")
|
||||
[node name="normal" type="Node2D" parent="texture/weapons" index="0"]
|
||||
position = Vector2(54, -45)
|
||||
|
||||
[node name="statebar" parent="." index="2" node_paths=PackedStringArray("entity")]
|
||||
[node name="statebar" parent="." index="3" node_paths=PackedStringArray("entity")]
|
||||
position = Vector2(0, -151)
|
||||
entity = NodePath("..")
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://c0n3igy4hucrg"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://c0n3igy4hucrg"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://ckq2cq6m23hq3" path="res://components/Abstracts/WeaponCardBase.tscn" id="1_hyubh"]
|
||||
[ext_resource type="Script" path="res://scripts/Contents/Weapons/PurpleCrystal.gd" id="2_0xgcv"]
|
||||
[ext_resource type="Texture2D" uid="uid://16yhngg3jpun" path="res://resources/weapons/purple-crystal.svg" id="2_wgtcw"]
|
||||
|
||||
[node name="PurpleCrystal" instance=ExtResource("1_hyubh")]
|
||||
offset_right = 208.0
|
||||
offset_bottom = 280.0
|
||||
offset_bottom = 282.0
|
||||
script = ExtResource("2_0xgcv")
|
||||
avatarTexture = ExtResource("2_wgtcw")
|
||||
displayName = "紫水晶簇"
|
||||
costs = Array[int]([0, 1])
|
||||
costCounts = Array[int]([50, 10])
|
||||
descriptionTemplate = "撞击造成$atk点伤害。"
|
||||
cooldown = 200.0
|
||||
|
||||
[node name="avatar" parent="container/info" index="0"]
|
||||
texture = ExtResource("2_wgtcw")
|
||||
|
||||
Reference in New Issue
Block a user