diff --git a/components/Abstracts/EntityBase.tscn b/components/Abstracts/EntityBase.tscn index 05cd677..acbc7f5 100644 --- a/components/Abstracts/EntityBase.tscn +++ b/components/Abstracts/EntityBase.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=42 format=3 uid="uid://cvogxi7mktumf"] +[gd_scene format=3 uid="uid://cvogxi7mktumf"] [ext_resource type="Script" uid="uid://ds3j3f82li68h" path="res://scripts/Statemachine/EntityBase.gd" id="1_mvol6"] [ext_resource type="Texture2D" uid="uid://dwwpkn4q07ja2" path="res://icon.svg" id="2_7lpu0"] @@ -346,86 +346,80 @@ alpha_curve = SubResource("CurveTexture_vvfxd") [sub_resource type="CircleShape2D" id="CircleShape2D_34h7q"] -[node name="EntityBase" type="CharacterBody2D"] +[node name="EntityBase" type="CharacterBody2D" unique_id=335589593] script = ExtResource("1_mvol6") -[node name="syncer" type="MultiplayerSynchronizer" parent="."] +[node name="syncer" type="MultiplayerSynchronizer" parent="." unique_id=410089973] unique_name_in_owner = true replication_config = SubResource("SceneReplicationConfig_tiuhe") -[node name="weaponStore" type="Node2D" parent="."] +[node name="weaponStore" type="Node2D" parent="." unique_id=1319091445] unique_name_in_owner = true -[node name="sounds" type="Node2D" parent="."] +[node name="sounds" type="Node2D" parent="." unique_id=1554185633] unique_name_in_owner = true -[node name="sprint" type="AudioStreamPlayer2D" parent="sounds"] +[node name="sprint" type="AudioStreamPlayer2D" parent="sounds" unique_id=771326921] -[node name="heal" type="AudioStreamPlayer2D" parent="sounds"] +[node name="heal" type="AudioStreamPlayer2D" parent="sounds" unique_id=522032588] -[node name="miss" type="AudioStreamPlayer2D" parent="sounds"] +[node name="miss" type="AudioStreamPlayer2D" parent="sounds" unique_id=254579113] -[node name="hurt" type="AudioStreamPlayer2D" parent="sounds"] +[node name="hurt" type="AudioStreamPlayer2D" parent="sounds" unique_id=540822672] -[node name="collect" type="AudioStreamPlayer2D" parent="sounds"] +[node name="collect" type="AudioStreamPlayer2D" parent="sounds" unique_id=1921709906] stream = ExtResource("2_qt0aq") -[node name="die" type="AudioStreamPlayer2D" parent="sounds"] +[node name="die" type="AudioStreamPlayer2D" parent="sounds" unique_id=1599661867] -[node name="attack0" type="AudioStreamPlayer2D" parent="sounds"] +[node name="attack0" type="AudioStreamPlayer2D" parent="sounds" unique_id=244425603] -[node name="texture" type="AnimatedSprite2D" parent="."] +[node name="texture" type="AnimatedSprite2D" parent="." unique_id=1960766921] unique_name_in_owner = true position = Vector2(0, -50) sprite_frames = SubResource("SpriteFrames_wcqpm") animation = &"idle" -[node name="staticBackground" type="Sprite2D" parent="texture"] +[node name="staticBackground" type="Sprite2D" parent="texture" unique_id=226001108] -[node name="staticAnimation" type="AnimatedSprite2D" parent="texture"] +[node name="staticAnimation" type="AnimatedSprite2D" parent="texture" unique_id=2086220178] sprite_frames = SubResource("SpriteFrames_tiuhe") -[node name="hurtbox" type="Area2D" parent="texture"] +[node name="hurtbox" type="Area2D" parent="texture" unique_id=1090146637] unique_name_in_owner = true -[node name="hitbox" type="CollisionShape2D" parent="texture/hurtbox"] +[node name="hitbox" type="CollisionShape2D" parent="texture/hurtbox" unique_id=1089476696] shape = SubResource("CircleShape2D_buhm1") -[node name="animator" type="AnimationPlayer" parent="texture"] +[node name="animator" type="AnimationPlayer" parent="texture" unique_id=998341823] unique_name_in_owner = true -libraries = { -&"": SubResource("AnimationLibrary_daot2") -} +libraries/ = SubResource("AnimationLibrary_daot2") -[node name="animatree" type="AnimationTree" parent="texture/animator"] +[node name="animatree" type="AnimationTree" parent="texture/animator" unique_id=1984427152] unique_name_in_owner = true root_node = NodePath("%animator/..") tree_root = SubResource("AnimationNodeBlendSpace1D_51ube") anim_player = NodePath("..") parameters/blend_position = 1.36 -[node name="hurtAnimator" type="AnimationPlayer" parent="texture"] +[node name="hurtAnimator" type="AnimationPlayer" parent="texture" unique_id=975738660] unique_name_in_owner = true -libraries = { -&"": SubResource("AnimationLibrary_kbmff") -} +libraries/ = SubResource("AnimationLibrary_kbmff") -[node name="stageAnimator" type="AnimationPlayer" parent="texture"] +[node name="stageAnimator" type="AnimationPlayer" parent="texture" unique_id=461345469] unique_name_in_owner = true -libraries = { -&"": SubResource("AnimationLibrary_vvkcp") -} +libraries/ = SubResource("AnimationLibrary_vvkcp") -[node name="weapons" type="Node2D" parent="texture"] +[node name="weapons" type="Node2D" parent="texture" unique_id=1686065375] unique_name_in_owner = true -[node name="trailParticle" type="GPUParticles2D" parent="texture"] +[node name="trailParticle" type="GPUParticles2D" parent="texture" unique_id=1437586204] unique_name_in_owner = true z_index = -1 amount = 300 process_material = SubResource("ParticleProcessMaterial_kndb2") -[node name="deadParticle" type="GPUParticles2D" parent="texture"] +[node name="deadParticle" type="GPUParticles2D" parent="texture" unique_id=1910187205] unique_name_in_owner = true emitting = false amount = 100 @@ -433,13 +427,13 @@ one_shot = true explosiveness = 1.0 process_material = SubResource("ParticleProcessMaterial_f3xas") -[node name="statebar" parent="." instance=ExtResource("2_uje1g")] +[node name="statebar" parent="." unique_id=1990457668 instance=ExtResource("2_uje1g")] unique_name_in_owner = true position = Vector2(0, -100) -[node name="damageAnchor" type="Node2D" parent="statebar"] +[node name="damageAnchor" type="Node2D" parent="statebar" unique_id=621457960] unique_name_in_owner = true position = Vector2(0, -20) -[node name="movebox" type="CollisionShape2D" parent="."] +[node name="movebox" type="CollisionShape2D" parent="." unique_id=1340839290] shape = SubResource("CircleShape2D_34h7q") diff --git a/components/Abstracts/WeaponCardBase.tscn b/components/Abstracts/WeaponCardBase.tscn index f4bbc59..b742be8 100644 --- a/components/Abstracts/WeaponCardBase.tscn +++ b/components/Abstracts/WeaponCardBase.tscn @@ -11,6 +11,8 @@ [ext_resource type="PackedScene" uid="uid://bbm8l3hr4ihar" path="res://components/UI/ItemShow.tscn" id="4_k01vb"] [ext_resource type="Texture2D" uid="uid://clobdvvfmj618" path="res://resources/ui/downdate-soul.svg" id="5_j7v7d"] [ext_resource type="Texture2D" uid="uid://lrvlfvt55j0" path="res://resources/ui/once-update.svg" id="5_jv1l6"] +[ext_resource type="Script" uid="uid://5r8mvbag4m0q" path="res://scripts/Statemachine/TextSwitchButton.gd" id="5_us21t"] +[ext_resource type="Texture2D" uid="uid://bbny26fysoh57" path="res://resources/ui/sublimate.png" id="8_75t4v"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_n2ewr"] content_margin_left = 30.0 @@ -30,6 +32,20 @@ corner_radius_bottom_right = 15 corner_radius_bottom_left = 15 corner_detail = 1 +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mjvvk"] +content_margin_left = 30.0 +content_margin_top = 20.0 +content_margin_right = 30.0 +content_margin_bottom = 20.0 +bg_color = Color(0, 0, 0, 0.5) +border_width_top = 10 +border_width_bottom = 10 +border_color = Color(1, 1, 1, 1) +border_blend = true +corner_radius_top_right = 15 +corner_radius_bottom_left = 15 +corner_detail = 1 + [sub_resource type="LabelSettings" id="LabelSettings_b3nsw"] font_size = 12 font_color = Color(0.55, 0.55, 0.55, 1) @@ -69,6 +85,31 @@ layout_mode = 2 theme_override_constants/separation = 10 alignment = 1 +[node name="anchor" type="Control" parent="container" unique_id=870492027] +layout_mode = 2 + +[node name="climatePanel" type="PanelContainer" parent="container/anchor" unique_id=653448699] +layout_mode = 1 +anchors_preset = -1 +anchor_left = 1.15 +anchor_right = 1.15 +offset_right = 40.0 +offset_bottom = 40.0 +theme_override_styles/panel = SubResource("StyleBoxFlat_mjvvk") + +[node name="wrapper" type="VBoxContainer" parent="container/anchor/climatePanel" unique_id=1097849201] +layout_mode = 2 +theme_override_constants/separation = 15 + +[node name="title" type="Label" parent="container/anchor/climatePanel/wrapper" unique_id=2006348917] +layout_mode = 2 +text = "升华" + +[node name="sublimateOptions" type="VBoxContainer" parent="container/anchor/climatePanel/wrapper" unique_id=738429306] +unique_name_in_owner = true +layout_mode = 2 +theme_override_constants/separation = 10 + [node name="wrapper" type="VBoxContainer" parent="container" unique_id=673686123] layout_mode = 2 @@ -81,8 +122,11 @@ layout_mode = 2 size_flags_horizontal = 3 theme = ExtResource("2_fwkd3") toggle_mode = true -text = "自动强化" +text = "手动强化" icon = ExtResource("4_h3enm") +script = ExtResource("5_us21t") +pressedText = "自动强化" +unpressedText = "手动强化" [node name="onceUpdateBtn" type="Button" parent="container/wrapper/updates" unique_id=1523224875] unique_name_in_owner = true @@ -98,6 +142,22 @@ layout_mode = 2 theme = ExtResource("2_fwkd3") text = "强化武器" icon = ExtResource("4_do015") +alignment = 2 + +[node name="separator" type="HSeparator" parent="container/wrapper" unique_id=2079058077] +layout_mode = 2 +theme = ExtResource("2_fwkd3") + +[node name="climateBtn" type="Button" parent="container/wrapper" unique_id=390423731] +unique_name_in_owner = true +layout_mode = 2 +theme = ExtResource("2_fwkd3") +text = "升华" +icon = ExtResource("8_75t4v") +alignment = 2 +script = ExtResource("5_us21t") +pressedText = "凝华" +unpressedText = "升华" [node name="souls" type="HBoxContainer" parent="container/wrapper" unique_id=1439164733] layout_mode = 2 @@ -213,7 +273,7 @@ unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 bbcode_enabled = true -text = "[center]造成[color=cyan]10[/color]点伤害。[/center]" +text = "造成[color=cyan]10[/color]点伤害。" fit_content = true [node name="tease" type="Label" parent="container" unique_id=689277044] diff --git a/components/Characters/Bear.tscn b/components/Characters/Bear.tscn index b434904..f80fc05 100644 --- a/components/Characters/Bear.tscn +++ b/components/Characters/Bear.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=38 format=3 uid="uid://m60bwhdpbem8"] +[gd_scene format=3 uid="uid://m60bwhdpbem8"] [ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_3ves7"] [ext_resource type="Script" uid="uid://cgmnlpa2w6n72" path="res://scripts/Contents/Characters/Bear.gd" id="2_kh2af"] @@ -20,6 +20,7 @@ [ext_resource type="Texture2D" uid="uid://vaglbapaj4e0" path="res://resources/characters/bear/bear-walk-g.svg" id="16_paalv"] [ext_resource type="Texture2D" uid="uid://b57o6dx0gm5t6" path="res://resources/characters/bear/bear-mask.svg" id="18_vby4r"] + [sub_resource type="SpriteFrames" id="SpriteFrames_6tgxs"] animations = [{ "frames": [{ diff --git a/components/Characters/Cat.tscn b/components/Characters/Cat.tscn index 476901a..13b2be8 100644 --- a/components/Characters/Cat.tscn +++ b/components/Characters/Cat.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=12 format=3 uid="uid://bfkg40awgniv"] +[gd_scene format=3 uid="uid://bfkg40awgniv"] [ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_hw4g4"] [ext_resource type="Script" uid="uid://chmxghslo4kc4" path="res://scripts/Contents/Characters/Cat.gd" id="2_uo67a"] @@ -9,6 +9,7 @@ [ext_resource type="Texture2D" uid="uid://dfid7kvdv8yas" path="res://resources/characters/cat/penguin-a.svg" id="7_kg8tn"] [ext_resource type="Texture2D" uid="uid://dhof4hf8t0lnw" path="res://resources/characters/cat/penguin-c.svg" id="8_anefu"] + [sub_resource type="SpriteFrames" id="SpriteFrames_2o6vq"] animations = [{ "frames": [{ diff --git a/components/Characters/Chick.tscn b/components/Characters/Chick.tscn index 36ec7a5..af570a0 100644 --- a/components/Characters/Chick.tscn +++ b/components/Characters/Chick.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=14 format=3 uid="uid://b0ncrvm8u4pox"] +[gd_scene format=3 uid="uid://b0ncrvm8u4pox"] [ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_goqmy"] [ext_resource type="Script" uid="uid://b2gg1fh0bflu7" path="res://scripts/Contents/Characters/Chick.gd" id="2_r6bub"] @@ -11,6 +11,7 @@ [ext_resource type="Texture2D" uid="uid://7pkplcqqxvnp" path="res://resources/characters/chick/chick-a.svg" id="8_x766l"] [ext_resource type="Texture2D" uid="uid://dj5dvqb8gsedr" path="res://resources/characters/chick/chick-b.svg" id="9_w0sit"] + [sub_resource type="SpriteFrames" id="SpriteFrames_k8ox8"] animations = [{ "frames": [], diff --git a/components/Characters/HCN.tscn b/components/Characters/HCN.tscn index 8b9413d..daae589 100644 --- a/components/Characters/HCN.tscn +++ b/components/Characters/HCN.tscn @@ -4,6 +4,7 @@ [ext_resource type="Script" uid="uid://bevc4f6apql4t" path="res://scripts/Contents/Characters/HCN.gd" id="2_f7uj3"] [ext_resource type="PackedScene" uid="uid://wl8u5m52708w" path="res://components/Weapons/LGBT.tscn" id="3_2fpmn"] + [node name="HCN" unique_id=1711205167 instance=ExtResource("1_eeneu")] script = ExtResource("2_f7uj3") displayName = "氰化氢" diff --git a/components/Characters/Kernyr.tscn b/components/Characters/Kernyr.tscn index 7b4880a..4a1b47f 100644 --- a/components/Characters/Kernyr.tscn +++ b/components/Characters/Kernyr.tscn @@ -4,6 +4,7 @@ [ext_resource type="Script" uid="uid://m28dwfwmmhmh" path="res://scripts/Contents/Characters/Kernyr.gd" id="2_vkls3"] [ext_resource type="Texture2D" uid="uid://bsffob0n8pgy6" path="res://resources/characters/kernyr/koshino.png" id="3_vkls3"] + [sub_resource type="SpriteFrames" id="SpriteFrames_vkls3"] animations = [{ "frames": [], diff --git a/components/Characters/KukeChild.tscn b/components/Characters/KukeChild.tscn index 3219344..0f1a17f 100644 --- a/components/Characters/KukeChild.tscn +++ b/components/Characters/KukeChild.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=6 format=3 uid="uid://c5q7djx12phem"] +[gd_scene format=3 uid="uid://c5q7djx12phem"] [ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_3ohuq"] [ext_resource type="Script" uid="uid://cnkiruxkx0qgu" path="res://scripts/Contents/Characters/KukeChild.gd" id="2_ywxbd"] [ext_resource type="Texture2D" uid="uid://ds3k7aigfrghw" path="res://resources/characters/kukechild/huan.png" id="3_eg8un"] + [sub_resource type="SpriteFrames" id="SpriteFrames_lfsw4"] animations = [{ "frames": [], diff --git a/components/Characters/KukeMC.tscn b/components/Characters/KukeMC.tscn index 500ab6c..304c913 100644 --- a/components/Characters/KukeMC.tscn +++ b/components/Characters/KukeMC.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=11 format=3 uid="uid://d4lfjwy0hkidu"] +[gd_scene format=3 uid="uid://d4lfjwy0hkidu"] [ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_r4q7y"] [ext_resource type="Script" uid="uid://cekuqnfohprpb" path="res://scripts/Contents/Characters/KukeMC.gd" id="2_s2dg5"] @@ -8,6 +8,7 @@ [ext_resource type="Texture2D" uid="uid://dem14qyqmrp52" path="res://resources/characters/kukemc/pico-c.svg" id="5_rfpp4"] [ext_resource type="Texture2D" uid="uid://cvig26vtcyqmd" path="res://resources/characters/kukemc/pico-d.svg" id="6_kcxk2"] + [sub_resource type="SpriteFrames" id="SpriteFrames_x576j"] animations = [{ "frames": [], diff --git a/components/Characters/MuyangDog.tscn b/components/Characters/MuyangDog.tscn index 29217b2..632bdc7 100644 --- a/components/Characters/MuyangDog.tscn +++ b/components/Characters/MuyangDog.tscn @@ -3,9 +3,12 @@ [ext_resource type="PackedScene" uid="uid://bs863g2s8r770" path="res://components/Abstracts/PlayerBase.tscn" id="1_y3l4w"] [ext_resource type="Script" uid="uid://bbmb572iba42l" path="res://scripts/Contents/Characters/MuyangDog.gd" id="2_mr6nm"] [ext_resource type="PackedScene" uid="uid://u0djqwuuysp8" path="res://components/Weapons/Volcano.tscn" id="3_e236u"] +[ext_resource type="PackedScene" uid="uid://cx7nogfnv7s8t" path="res://components/Weapons/Tree.tscn" id="4_im5m5"] [node name="MuyangDog" unique_id=1711205167 instance=ExtResource("1_y3l4w")] script = ExtResource("2_mr6nm") displayName = "牧羊犬" -[node name="Volcano" parent="weaponStore" index="0" unique_id=204992396 instance=ExtResource("3_e236u")] +[node name="Volcano" parent="weaponStore" parent_id_path=PackedInt32Array(1319091445) index="0" unique_id=204992396 instance=ExtResource("3_e236u")] + +[node name="Tree" parent="weaponStore" parent_id_path=PackedInt32Array(1319091445) index="1" unique_id=185228402 instance=ExtResource("4_im5m5")] diff --git a/components/Characters/Yee.tscn b/components/Characters/Yee.tscn index 130fbc1..e832d88 100644 --- a/components/Characters/Yee.tscn +++ b/components/Characters/Yee.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=46 format=3 uid="uid://deuuv6qc280ih"] +[gd_scene format=3 uid="uid://deuuv6qc280ih"] [ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_wh51a"] [ext_resource type="Texture2D" uid="uid://ckqcfw4i35py" path="res://resources/characters/yee/sprint/HoHoYee_Run00.png" id="2_gv83w"] diff --git a/components/Summons/Gobo.tscn b/components/Summons/Gobo.tscn index c313bae..60283f4 100644 --- a/components/Summons/Gobo.tscn +++ b/components/Summons/Gobo.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=3 uid="uid://b2ilo4ag801m2"] +[gd_scene format=3 uid="uid://b2ilo4ag801m2"] [ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_hgynr"] [ext_resource type="Texture2D" uid="uid://xen2edbhf052" path="res://resources/characters/gobo/gobo-a.svg" id="2_e0tdx"] @@ -6,6 +6,7 @@ [ext_resource type="Texture2D" uid="uid://s12imwmfics6" path="res://resources/characters/gobo/gobo-b.svg" id="3_ftr65"] [ext_resource type="Texture2D" uid="uid://d38bjxoowbg7t" path="res://resources/characters/gobo/gobo-c.svg" id="4_w2qsx"] + [sub_resource type="SpriteFrames" id="SpriteFrames_0xeeo"] animations = [{ "frames": [{ diff --git a/components/UI/FeedName.tscn b/components/UI/FeedName.tscn index a334ccc..89b911b 100644 --- a/components/UI/FeedName.tscn +++ b/components/UI/FeedName.tscn @@ -1,22 +1,20 @@ -[gd_scene load_steps=5 format=3 uid="uid://bt370a1djjg5p"] +[gd_scene format=3 uid="uid://bt370a1djjg5p"] [ext_resource type="Script" uid="uid://qllscdsldcpq" path="res://scripts/Statemachine/FeedName.gd" id="1_wfxme"] [ext_resource type="Theme" uid="uid://bje5cd08dyok7" path="res://themes/bigTextAndBold.tres" id="2_k71he"] [sub_resource type="LabelSettings" id="LabelSettings_j8acg"] font_size = 12 -font_color = Color(1, 0.442751, 0, 1) [sub_resource type="LabelSettings" id="LabelSettings_268ry"] font_size = 12 font_color = Color(1, 0, 0.585938, 1) -[node name="FeedName" type="HBoxContainer"] +[node name="FeedName" type="HBoxContainer" unique_id=803617181] offset_right = 205.0 offset_bottom = 25.0 alignment = 1 script = ExtResource("1_wfxme") -quality = 4 qualityColorMap = { 0: Color(0.5, 0.5, 0.5, 1), 1: Color(1, 1, 1, 1), @@ -26,26 +24,26 @@ qualityColorMap = { } topicColorMap = { 0: Color(1, 0, 0.585938, 1), -1: Color(0, 0.414063, 1, 1), +1: Color(0, 0.6829064, 1, 1), 2: Color(0.60183, 0.349817, 0, 1), 3: Color(0.40625, 1, 0, 1), -4: Color(1, 0, 0, 1), +4: Color(0.7543956, 0.4408114, 1, 1), 5: Color(1, 0.421875, 0, 1), 6: Color(1, 1, 1, 1), 7: Color(0.449219, 0.449219, 0.449219, 1), 8: Color(1, 0.816993, 0, 1), -9: Color(0, 1, 0.7435255, 1) +9: Color(0, 1, 0.60952187, 1) } metadata/_edit_horizontal_guides_ = [25.0] -[node name="quality" type="Label" parent="."] +[node name="quality" type="Label" parent="." unique_id=959908885] unique_name_in_owner = true layout_mode = 2 size_flags_vertical = 0 -text = "[传说]" +text = "[普通]" label_settings = SubResource("LabelSettings_j8acg") -[node name="label" type="RichTextLabel" parent="."] +[node name="label" type="RichTextLabel" parent="." unique_id=425020540] unique_name_in_owner = true layout_mode = 2 theme = ExtResource("2_k71he") @@ -54,7 +52,7 @@ text = "[b]未命名饲料[/b]" fit_content = true autowrap_mode = 0 -[node name="topic" type="Label" parent="."] +[node name="topic" type="Label" parent="." unique_id=588425068] unique_name_in_owner = true layout_mode = 2 size_flags_vertical = 8 diff --git a/components/UI/FieldShow.tscn b/components/UI/FieldShow.tscn index 16d0357..6b42a96 100644 --- a/components/UI/FieldShow.tscn +++ b/components/UI/FieldShow.tscn @@ -9,8 +9,8 @@ font_size = 13 [node name="FieldShow" type="HBoxContainer" unique_id=1958616813] -offset_right = 144.0 -offset_bottom = 18.0 +offset_right = 106.0 +offset_bottom = 20.0 alignment = 1 script = ExtResource("1_gwocj") metadata/_edit_horizontal_guides_ = [20.0] @@ -28,23 +28,21 @@ stretch_mode = 5 [node name="name" type="Label" parent="." unique_id=452024197] unique_name_in_owner = true layout_mode = 2 -size_flags_horizontal = 11 +size_flags_horizontal = 0 theme = ExtResource("2_x62bb") text = "生命上限" horizontal_alignment = 1 -[node name="sep" type="ColorRect" parent="." unique_id=947351883] -custom_minimum_size = Vector2(20, 1) +[node name="sep" type="HSeparator" parent="." unique_id=2087003931] +custom_minimum_size = Vector2(20, 0) layout_mode = 2 size_flags_horizontal = 3 -size_flags_vertical = 4 -size_flags_stretch_ratio = 16.0 [node name="value" type="Label" parent="." unique_id=1521326049] unique_name_in_owner = true layout_mode = 2 -size_flags_horizontal = 10 -text = "+10.0" +size_flags_horizontal = 8 +text = "0.0" label_settings = SubResource("LabelSettings_imrgm") horizontal_alignment = 1 diff --git a/components/UI/SublimateOption.tscn b/components/UI/SublimateOption.tscn new file mode 100644 index 0000000..c912e4d --- /dev/null +++ b/components/UI/SublimateOption.tscn @@ -0,0 +1,60 @@ +[gd_scene format=3 uid="uid://dsqq55w2twlp6"] + +[ext_resource type="Script" uid="uid://qpx600iiwgae" path="res://scripts/Statemachine/SublimateOptionHandler.gd" id="1_kwr7c"] +[ext_resource type="Texture2D" uid="uid://bqdfnupy16x1k" path="res://resources/ui/sublimate-icon.png" id="1_xsbjn"] +[ext_resource type="PackedScene" uid="uid://bbm8l3hr4ihar" path="res://components/UI/ItemShow.tscn" id="2_68c0g"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_kwr7c"] +content_margin_left = 15.0 +content_margin_top = 6.0 +content_margin_right = 15.0 +content_margin_bottom = 6.0 +bg_color = Color(0, 0, 0, 0.3) +border_width_left = 4 +border_width_top = 1 +border_width_right = 4 +border_width_bottom = 1 +border_color = Color(1, 1, 1, 1) +corner_radius_top_left = 10 +corner_radius_bottom_right = 10 + +[sub_resource type="LabelSettings" id="LabelSettings_kwr7c"] +font_size = 18 +outline_size = 1 + +[node name="SublimateOption" type="PanelContainer" unique_id=1944124947] +offset_right = 285.0 +offset_bottom = 32.0 +theme_override_styles/panel = SubResource("StyleBoxFlat_kwr7c") +script = ExtResource("1_kwr7c") + +[node name="container" type="HBoxContainer" parent="." unique_id=1689302184] +layout_mode = 2 +theme_override_constants/separation = 10 + +[node name="HBoxContainer" type="HBoxContainer" parent="container" unique_id=703603476] +layout_mode = 2 +theme_override_constants/separation = 5 + +[node name="name" type="Label" parent="container/HBoxContainer" unique_id=1606683475] +unique_name_in_owner = true +layout_mode = 2 +text = "name" +label_settings = SubResource("LabelSettings_kwr7c") + +[node name="costItem" parent="container/HBoxContainer" unique_id=583849471 instance=ExtResource("2_68c0g")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 4 +type = 6 + +[node name="separator" type="HSeparator" parent="container" unique_id=1982068530] +custom_minimum_size = Vector2(40, 0) +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="applyBtn" type="Button" parent="container" unique_id=262085363] +unique_name_in_owner = true +layout_mode = 2 +text = "description" +icon = ExtResource("1_xsbjn") diff --git a/components/Weapons/Meowmere.tscn b/components/Weapons/Meowmere.tscn index b7a1a3a..37f0231 100644 --- a/components/Weapons/Meowmere.tscn +++ b/components/Weapons/Meowmere.tscn @@ -51,4 +51,4 @@ typeTopic = 3 text = "Terraria" [node name="description" parent="container/back/scroller" parent_id_path=PackedInt32Array(543588938) index="0" unique_id=566230682] -text = "[center]发射[color=cyan]1[/color]只伤害以[color=cyan]25.0%[/color]衰减的造成[color=cyan]6[/color]点伤害的[b]彩虹猫[/b]的同时挥舞造成[color=cyan]5[/color]点伤害。[/center]" +text = "发射[color=cyan]1[/color]只伤害以[color=cyan]25.0%[/color]衰减的造成[color=cyan]6[/color]点伤害的[b]彩虹猫[/b]的同时挥舞造成[color=cyan]5[/color]点伤害。" diff --git a/components/Weapons/Tree.tscn b/components/Weapons/Tree.tscn index ecbfe7a..253229d 100644 --- a/components/Weapons/Tree.tscn +++ b/components/Weapons/Tree.tscn @@ -70,7 +70,6 @@ descriptionTemplate = "进行[b]格挡[/b],化解敌人的攻击。 sources = Array[String](["Nine Sols", "Terraria"]) tease = "卸劲反伤" cooldown = 250.0 -debugRebuild = true [node name="avatar" parent="container/info" parent_id_path=PackedInt32Array(1625294072) index="0" unique_id=1021985889] texture = ExtResource("3_nwamk") diff --git a/resources/ui/sublimate-icon.png b/resources/ui/sublimate-icon.png new file mode 100644 index 0000000..824a999 Binary files /dev/null and b/resources/ui/sublimate-icon.png differ diff --git a/resources/ui/sublimate-icon.png.import b/resources/ui/sublimate-icon.png.import new file mode 100644 index 0000000..77406ab --- /dev/null +++ b/resources/ui/sublimate-icon.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bqdfnupy16x1k" +path="res://.godot/imported/sublimate-icon.png-95acea9adde2da5fcf63cc8a6ea78165.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resources/ui/sublimate-icon.png" +dest_files=["res://.godot/imported/sublimate-icon.png-95acea9adde2da5fcf63cc8a6ea78165.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/resources/ui/sublimate.png b/resources/ui/sublimate.png new file mode 100644 index 0000000..aae2f50 Binary files /dev/null and b/resources/ui/sublimate.png differ diff --git a/resources/ui/sublimate.png.import b/resources/ui/sublimate.png.import new file mode 100644 index 0000000..9810cad --- /dev/null +++ b/resources/ui/sublimate.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bbny26fysoh57" +path="res://.godot/imported/sublimate.png-2485435c943d1b5c167712083fb1eef3.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resources/ui/sublimate.png" +dest_files=["res://.godot/imported/sublimate.png-2485435c943d1b5c167712083fb1eef3.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/resources/ui/sublimate.svg b/resources/ui/sublimate.svg new file mode 100644 index 0000000..f41682d --- /dev/null +++ b/resources/ui/sublimate.svg @@ -0,0 +1 @@ +C \ No newline at end of file diff --git a/resources/ui/sublimate.svg.import b/resources/ui/sublimate.svg.import new file mode 100644 index 0000000..dd2c55a --- /dev/null +++ b/resources/ui/sublimate.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dytaty0qs4rnd" +path="res://.godot/imported/sublimate.svg-8b1ced0f3c8d31a2ebc6bebdebf7251f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resources/ui/sublimate.svg" +dest_files=["res://.godot/imported/sublimate.svg-8b1ced0f3c8d31a2ebc6bebdebf7251f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/scripts/Contents/Panels/SelectIntialFeed.gd b/scripts/Contents/Panels/SelectIntialFeed.gd index e32d543..51d2825 100644 --- a/scripts/Contents/Panels/SelectIntialFeed.gd +++ b/scripts/Contents/Panels/SelectIntialFeed.gd @@ -25,7 +25,7 @@ func beforeOpen(_args: Array = []): for feed in ComponentManager.feeds: var card = feed.instantiate() as Feed card.freeToBuy = true - if card.topic == FeedName.Topic.WEAPON: + if card.topic == CategoryStore.Topic.WEAPON: if weaponCounted < OutGameStorage.maxInitialWeaponCount: initialWeaponSelection.add_child(card) card.selected.connect( diff --git a/scripts/Contents/Weapons/Tree.gd b/scripts/Contents/Weapons/Tree.gd index 3f31d60..b130bac 100644 --- a/scripts/Contents/Weapons/Tree.gd +++ b/scripts/Contents/Weapons/Tree.gd @@ -3,17 +3,33 @@ extends Weapon func sublimateOptions() -> Array[SublimateOption]: return [ - SublimateOption.new("健体·阳", "格挡次数+1", func(w: Weapon, _e): w.addStoreExtra("count", 1)), - SublimateOption.new("健体·阴", "气力上限+1", func(w: Weapon, _e): w.addStoreExtra("max", 1)), - SublimateOption.new("引气入体", "乾坤剑伤害+6", func(w: Weapon, _e): w.addStoreExtra("atk", 6)), + SublimateOption.new("引气入体", "乾坤剑伤害+6", + func(w: Weapon, _e): w.addStoreExtra("atk", 6), + 1, + CategoryStore.Quality.COMMON + ), + SublimateOption.new("健体·阳", "格挡次数+1", + func(w: Weapon, _e): w.addStoreExtra("count", 1), + 1, + CategoryStore.Quality.LEGENDARY + ), + SublimateOption.new("健体·阴", "气力上限+1", + func(w: Weapon, _e): w.addStoreExtra("max", 1), + 1, + CategoryStore.Quality.EPIC + ), SublimateOption.new("献祭", "乾坤剑伤害-8,但弹反概率+4%", func(w: Weapon, _e): w.addStoreExtra("atk", -10) w.addStoreExtra("rate", 0.05), + 1, + CategoryStore.Quality.RARE ), SublimateOption.new("亏心", "扣除你的所有幸运,每点幸运增加1%弹反概率", func(w: Weapon, e: EntityBase): w.addStoreExtra("rate", e.fields[FieldStore.Entity.LUCK_VALUE]), + 1, + CategoryStore.Quality.WASTE ), ] func update(to: int, origin: Dictionary, _entity: EntityBase): diff --git a/scripts/Debug/FeedFilter.gd b/scripts/Debug/FeedFilter.gd index 9feeca1..ef88b77 100644 --- a/scripts/Debug/FeedFilter.gd +++ b/scripts/Debug/FeedFilter.gd @@ -7,7 +7,7 @@ enum ComposeMode { } @export var targetFields: Array[FieldStore.Entity] = [] -@export var targetTopics: Array[FeedName.Topic] = [] +@export var targetTopics: Array[CategoryStore.Topic] = [] @export var composeMode: ComposeMode = ComposeMode.ALL @export var clickToRefresh: bool = false diff --git a/scripts/Debug/FeedIsTopic.gd b/scripts/Debug/FeedIsTopic.gd index 9bae975..b415143 100644 --- a/scripts/Debug/FeedIsTopic.gd +++ b/scripts/Debug/FeedIsTopic.gd @@ -1,7 +1,7 @@ @tool extends HBoxContainer -@export var targetTopics: Array[FeedName.Topic] = [] +@export var targetTopics: Array[CategoryStore.Topic] = [] @export var clickToRefresh: bool = false var lastState: bool = false diff --git a/scripts/Statemachine/EntityBase.gd b/scripts/Statemachine/EntityBase.gd index b7091ba..8da23f9 100644 --- a/scripts/Statemachine/EntityBase.gd +++ b/scripts/Statemachine/EntityBase.gd @@ -68,7 +68,7 @@ var inventory = { ItemStore.ItemType.BEACHBALL: 0, ItemStore.ItemType.SOUL: 0, ItemStore.ItemType.CRYSTAL: 0, - ItemStore.ItemType.DIAMOND: 0 + ItemStore.ItemType.DIAMOND: 10 } var inventoryMax = { ItemStore.ItemType.BASEBALL: INF, # 无限 diff --git a/scripts/Statemachine/FeedName.gd b/scripts/Statemachine/FeedName.gd index c09f02f..2285307 100644 --- a/scripts/Statemachine/FeedName.gd +++ b/scripts/Statemachine/FeedName.gd @@ -2,80 +2,60 @@ extends HBoxContainer class_name FeedName -enum Quality { - WASTE, - COMMON, - RARE, - EPIC, - LEGENDARY, -} -enum Topic { - SURVIVAL, - ENERGY, - BULLET, - SPEED, - DAMAGE, - PROBABILITY, - FEED, - DROP, - WEAPON, - SUMMON, -} - @export var displayName: String = "未命名饲料" -@export var quality: Quality = Quality.COMMON -@export var topic: Topic = Topic.SURVIVAL +@export var quality: CategoryStore.Quality = CategoryStore.Quality.COMMON +@export var topic: CategoryStore.Topic = CategoryStore.Topic.SURVIVAL @export var qualityColorMap = { - Quality.WASTE: Color(), - Quality.COMMON: Color(), - Quality.RARE: Color(), - Quality.EPIC: Color(), - Quality.LEGENDARY: Color() + CategoryStore.Quality.WASTE: Color(), + CategoryStore.Quality.COMMON: Color(), + CategoryStore.Quality.RARE: Color(), + CategoryStore.Quality.EPIC: Color(), + CategoryStore.Quality.LEGENDARY: Color() } @export var qualityNameMap = { - Quality.WASTE: "常见", - Quality.COMMON: "普通", - Quality.RARE: "稀有", - Quality.EPIC: "史诗", - Quality.LEGENDARY: "传说" + CategoryStore.Quality.WASTE: "常见", + CategoryStore.Quality.COMMON: "普通", + CategoryStore.Quality.RARE: "稀有", + CategoryStore.Quality.EPIC: "史诗", + CategoryStore.Quality.LEGENDARY: "传说" } @export var qualityRandomWeight = { - Quality.WASTE: 20, - Quality.COMMON: 100, - Quality.RARE: 30, - Quality.EPIC: 10, - Quality.LEGENDARY: 5 + CategoryStore.Quality.WASTE: 20, + CategoryStore.Quality.COMMON: 100, + CategoryStore.Quality.RARE: 30, + CategoryStore.Quality.EPIC: 10, + CategoryStore.Quality.LEGENDARY: 5 } @export var luckInfluence = { - Quality.WASTE: - 0.5, - Quality.COMMON: - 1, - Quality.RARE: 0, - Quality.EPIC: 1, - Quality.LEGENDARY: 2, + CategoryStore.Quality.WASTE: - 0.5, + CategoryStore.Quality.COMMON: - 1, + CategoryStore.Quality.RARE: 0, + CategoryStore.Quality.EPIC: 1, + CategoryStore.Quality.LEGENDARY: 2, } @export var topicNameMap = { - Topic.SURVIVAL: "生存", - Topic.ENERGY: "能量", - Topic.BULLET: "子弹", - Topic.SPEED: "速度", - Topic.DAMAGE: "伤害", - Topic.PROBABILITY: "幸运", - Topic.FEED: "饲料", - Topic.DROP: "掉落物", - Topic.WEAPON: "武器", - Topic.SUMMON: "召唤", + CategoryStore.Topic.SURVIVAL: "生存", + CategoryStore.Topic.ENERGY: "能量", + CategoryStore.Topic.BULLET: "子弹", + CategoryStore.Topic.SPEED: "速度", + CategoryStore.Topic.DAMAGE: "伤害", + CategoryStore.Topic.PROBABILITY: "幸运", + CategoryStore.Topic.FEED: "饲料", + CategoryStore.Topic.DROP: "掉落物", + CategoryStore.Topic.WEAPON: "武器", + CategoryStore.Topic.SUMMON: "召唤", } @export var topicColorMap = { - Topic.SURVIVAL: Color(), - Topic.ENERGY: Color(), - Topic.BULLET: Color(), - Topic.SPEED: Color(), - Topic.DAMAGE: Color(), - Topic.PROBABILITY: Color(), - Topic.FEED: Color(), - Topic.DROP: Color(), - Topic.WEAPON: Color(), - Topic.SUMMON: Color(), + CategoryStore.Topic.SURVIVAL: Color(), + CategoryStore.Topic.ENERGY: Color(), + CategoryStore.Topic.BULLET: Color(), + CategoryStore.Topic.SPEED: Color(), + CategoryStore.Topic.DAMAGE: Color(), + CategoryStore.Topic.PROBABILITY: Color(), + CategoryStore.Topic.FEED: Color(), + CategoryStore.Topic.DROP: Color(), + CategoryStore.Topic.WEAPON: Color(), + CategoryStore.Topic.SUMMON: Color(), } @onready var qualityLabel: Label = $"%quality" diff --git a/scripts/Statemachine/SublimateOptionHandler.gd b/scripts/Statemachine/SublimateOptionHandler.gd new file mode 100644 index 0000000..e427954 --- /dev/null +++ b/scripts/Statemachine/SublimateOptionHandler.gd @@ -0,0 +1,30 @@ +@tool +extends Control +class_name SublimateOptionHandler + +signal apply() + +@onready var nameLabel: Label = $%name +@onready var applyBtn: Button = $%applyBtn +@onready var costItemShow: ItemShow = $%costItem + +var use: SublimateOption; + +func _ready(): + nameLabel.label_settings = nameLabel.label_settings.duplicate() + applyBtn.pressed.connect( + func(): + if UIState.player.useItem({ItemStore.ItemType.DIAMOND: use.cost}): + apply.emit() + else: + UIState.showTip("钻石数量不足!", TipBox.MessageType.ERROR) + ) + rebuildInfo() + +func rebuildInfo(): + if is_instance_valid(use): + nameLabel.label_settings.font_color = CategoryStore.qualityColorMap[use.quality] + nameLabel.label_settings.outline_color = CategoryStore.qualityColorMap[use.quality] + nameLabel.text = use.displayName + applyBtn.text = use.description + costItemShow.count = use.cost diff --git a/scripts/Statemachine/SublimateOptionHandler.gd.uid b/scripts/Statemachine/SublimateOptionHandler.gd.uid new file mode 100644 index 0000000..58de7fd --- /dev/null +++ b/scripts/Statemachine/SublimateOptionHandler.gd.uid @@ -0,0 +1 @@ +uid://qpx600iiwgae diff --git a/scripts/Statemachine/TextSwitchButton.gd b/scripts/Statemachine/TextSwitchButton.gd new file mode 100644 index 0000000..33a83bd --- /dev/null +++ b/scripts/Statemachine/TextSwitchButton.gd @@ -0,0 +1,13 @@ +@tool +extends Button +class_name TextSwitchButton + +@export var pressedText: String = "已按下" +@export var unpressedText: String = "未按下" + +func _ready(): + updateText() + toggled.connect(updateText) + +func updateText(): + text = [unpressedText, pressedText][int(button_pressed)] diff --git a/scripts/Statemachine/TextSwitchButton.gd.uid b/scripts/Statemachine/TextSwitchButton.gd.uid new file mode 100644 index 0000000..63f4787 --- /dev/null +++ b/scripts/Statemachine/TextSwitchButton.gd.uid @@ -0,0 +1 @@ +uid://5r8mvbag4m0q diff --git a/scripts/Structs/Feed.gd b/scripts/Structs/Feed.gd index 2bc8b66..401b2cb 100644 --- a/scripts/Structs/Feed.gd +++ b/scripts/Structs/Feed.gd @@ -6,8 +6,8 @@ signal selected(applied: bool) @export var avatarTexture: Texture2D = null @export var displayName: String = "未命名饲料" -@export var quality: FeedName.Quality = FeedName.Quality.COMMON -@export var topic: FeedName.Topic = FeedName.Topic.SURVIVAL +@export var quality: CategoryStore.Quality = CategoryStore.Quality.COMMON +@export var topic: CategoryStore.Topic = CategoryStore.Topic.SURVIVAL @export var fields: Array[FieldStore.Entity] = [] @export var fieldValues: Array[float] = [] @export var weapons: Array[PackedScene] = [] diff --git a/scripts/Structs/SublimateOption.gd b/scripts/Structs/SublimateOption.gd index 6b75de2..39ba2e3 100644 --- a/scripts/Structs/SublimateOption.gd +++ b/scripts/Structs/SublimateOption.gd @@ -1,15 +1,21 @@ class_name SublimateOption +signal applied() + var displayName: String = "升华" var description: String = "描述" var executor: Callable = func(_weapon: Weapon, _entity: EntityBase): return +var cost: int = 1 +var quality: CategoryStore.Quality = CategoryStore.Quality.COMMON -func _init(displayNames: String, descriptions: String, executors: Callable): +func _init(displayNames: String, descriptions: String, executors: Callable, costs: int, qualities: CategoryStore.Quality): displayName = displayNames description = descriptions executor = executors + cost = costs + quality = qualities -func apply(entity: EntityBase, index: int): - var weapon = entity.weapons[index] - if weapon is Weapon: - executor.call(weapon, entity) +func apply(entity: EntityBase, weapon: Weapon): + cost += 1 + executor.call(weapon, entity) + applied.emit() diff --git a/scripts/Structs/Weapon.gd b/scripts/Structs/Weapon.gd index 9ce8ee7..76a6f92 100644 --- a/scripts/Structs/Weapon.gd +++ b/scripts/Structs/Weapon.gd @@ -48,6 +48,8 @@ enum EmitType { @onready var extractBtn: Button = $%extractBtn @onready var inlayBtn: Button = $%inlayBtn +@onready var sublimateOptionsBox: Control = $%sublimateOptions + var cooldownTimer: CooldownTimer = null var originalStore: Dictionary = {} var chargedTime: float = 0 @@ -55,6 +57,7 @@ var attackSpeed: float = 1 var looping: bool = false var autoUpdate: bool = false var storeExtra: Dictionary = {} +var sublimateOptionsStored: Array[SublimateOption] = [] func _ready(): cooldownTimer = CooldownTimer.new() @@ -126,6 +129,7 @@ func _ready(): for i in sounds.get_children(): i.process_mode = ProcessMode.PROCESS_MODE_ALWAYS debugRebuild = false # 只能在编辑器里打开 + rebuildInfo() func _physics_process(_delta): if debugRebuild: rebuildInfo() @@ -153,6 +157,10 @@ func multipiler() -> float: else: return 1 func rebuildInfo(showNext: bool = false): + rebuildBaseInfo() + rebuildDescription(showNext) + rebuildSublimateOptions(showNext) +func rebuildBaseInfo(): avatarRect.texture = avatarTexture nameLabel.displayName = displayName nameLabel.quality = quality @@ -171,7 +179,6 @@ func rebuildInfo(showNext: bool = false): if is_instance_valid(UIState.player): beachball.enough = canUpdate(UIState.player) soul.enough = canInlay() - descriptionLabel.text = buildDescription(showNext && (canUpdate(UIState.player) || canInlay())) func formatValue(value: Variant, type: FieldStore.DataType) -> String: if type == FieldStore.DataType.VALUE: return "%.2f" % value @@ -186,11 +193,10 @@ func formatValue(value: Variant, type: FieldStore.DataType) -> String: else: return str(value) func buildDescription(showNext: bool = false) -> String: - var current = store var next = update(level + 1, originalStore.duplicate(), UIState.player) var result = descriptionTemplate for key in store.keys(): - var data = current[key] + var data = readStore(key) var nextData = next[key] var type = storeType.get(key, FieldStore.DataType.VALUE) data = formatValue(data, type) @@ -202,6 +208,24 @@ func buildDescription(showNext: bool = false) -> String: text = "[color=cyan]%s[/color]" % data result = result.replace("$" + key, text) return result +func rebuildDescription(showNext: bool): + descriptionLabel.text = buildDescription(showNext && (canUpdate(UIState.player) || canInlay())) +func rebuildSublimateOptions(showNext: bool): + for i in sublimateOptionsBox.get_children(): + sublimateOptionsBox.remove_child(i) + for sublimate in getSublimateOptions(): + var instance = ComponentManager.getUIComponent("SublimateOption").instantiate() as SublimateOptionHandler + instance.use = sublimate + instance.apply.connect( + func(): + sublimate.apply(UIState.player, self ) + rebuildBaseInfo() + rebuildDescription(showNext) + instance.rebuildInfo() + disruptSublimateOptions() + ) + sublimateOptionsBox.add_child(instance) + disruptSublimateOptions() func readStore(key: String): return store.get(key, 0) + readStoreExtra(key) func playSound(sound: String): @@ -246,8 +270,23 @@ func addStoreExtra(key: String, value: float): if !storeExtra.has(key): storeExtra[key] = 0 storeExtra[key] += value + storeExtra[key] = clamp(storeExtra[key], 0, INF) func readStoreExtra(key: String): return storeExtra.get(key, 0) +func getSublimateOptions() -> Array[SublimateOption]: + if len(sublimateOptionsStored) == 0: + sublimateOptionsStored = sublimateOptions() + return sublimateOptionsStored +func disruptSublimateOptions(): + var children = sublimateOptionsBox.get_children() + children.shuffle() + for index in len(children): + sublimateOptionsBox.remove_child(children[index]) + for index in len(children): + var child = children[index] + if child is SublimateOptionHandler: + child.visible = index < 3 + sublimateOptionsBox.add_child(child) # 抽象 func sublimateOptions() -> Array[SublimateOption]: diff --git a/scripts/Tools/CategoryStore.gd b/scripts/Tools/CategoryStore.gd new file mode 100644 index 0000000..6f3c755 --- /dev/null +++ b/scripts/Tools/CategoryStore.gd @@ -0,0 +1,74 @@ +class_name CategoryStore + +enum Quality { + WASTE, + COMMON, + RARE, + EPIC, + LEGENDARY, +} +enum Topic { + SURVIVAL, + ENERGY, + BULLET, + SPEED, + DAMAGE, + PROBABILITY, + FEED, + DROP, + WEAPON, + SUMMON, +} + +static var qualityColorMap = { + Quality.WASTE: Color("808080"), + Quality.COMMON: Color("ffffff"), + Quality.RARE: Color("007eff"), + Quality.EPIC: Color("8100ff"), + Quality.LEGENDARY: Color("ff7100"), +} +static var qualityNameMap = { + Quality.WASTE: "常见", + Quality.COMMON: "普通", + Quality.RARE: "稀有", + Quality.EPIC: "史诗", + Quality.LEGENDARY: "传说" +} +static var qualityRandomWeight = { + Quality.WASTE: 20, + Quality.COMMON: 100, + Quality.RARE: 30, + Quality.EPIC: 10, + Quality.LEGENDARY: 5 +} +static var luckInfluence = { + Quality.WASTE: - 0.5, + Quality.COMMON: - 1, + Quality.RARE: 0, + Quality.EPIC: 1, + Quality.LEGENDARY: 2, +} +static var topicNameMap = { + Topic.SURVIVAL: "生存", + Topic.ENERGY: "能量", + Topic.BULLET: "子弹", + Topic.SPEED: "速度", + Topic.DAMAGE: "伤害", + Topic.PROBABILITY: "幸运", + Topic.FEED: "饲料", + Topic.DROP: "掉落物", + Topic.WEAPON: "武器", + Topic.SUMMON: "召唤", +} +static var topicColorMap = { + Topic.SURVIVAL: Color("ff0095"), + Topic.ENERGY: Color("00aeff"), + Topic.BULLET: Color("995900"), + Topic.SPEED: Color("995900"), + Topic.DAMAGE: Color("c070ff"), + Topic.PROBABILITY: Color("ff6c00"), + Topic.FEED: Color("ffffff"), + Topic.DROP: Color("737373"), + Topic.WEAPON: Color("ffd000"), + Topic.SUMMON: Color("00ff9b"), +} diff --git a/scripts/Tools/CategoryStore.gd.uid b/scripts/Tools/CategoryStore.gd.uid new file mode 100644 index 0000000..ed3d2ce --- /dev/null +++ b/scripts/Tools/CategoryStore.gd.uid @@ -0,0 +1 @@ +uid://cekdcml1yb4g8 diff --git a/themes/main.tres b/themes/main.tres index ea36c54..5b53434 100644 --- a/themes/main.tres +++ b/themes/main.tres @@ -70,6 +70,10 @@ corner_radius_bottom_right = 1000 corner_radius_bottom_left = 1000 corner_detail = 1 +[sub_resource type="StyleBoxLine" id="StyleBoxLine_wc0q8"] +color = Color(1, 1, 1, 1) +thickness = 2 + [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_wc0q8"] bg_color = Color(1, 1, 1, 0.5) @@ -135,6 +139,8 @@ Button/styles/hover = SubResource("StyleBoxFlat_1id7b") Button/styles/hover_pressed = SubResource("StyleBoxFlat_wykhr") Button/styles/normal = SubResource("StyleBoxFlat_0avsd") Button/styles/pressed = SubResource("StyleBoxFlat_wykhr") +HSeparator/constants/separation = 10 +HSeparator/styles/separator = SubResource("StyleBoxLine_wc0q8") HSlider/icons/grabber = ExtResource("1_0avsd") HSlider/icons/grabber_disabled = ExtResource("2_wykhr") HSlider/icons/grabber_highlight = ExtResource("3_78ekx")