From f13468bc0a0b616364d417c74eb3b0e62d5c9246 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, 13 Dec 2025 11:26:12 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=8F=AC=E5=94=A4):=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=8F=AC=E5=94=A4=E7=89=A9=E5=B1=9E=E6=80=A7=E5=92=8C=E6=AD=A6?= =?UTF-8?q?=E5=99=A8=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改HJM和LGBTFlag的吸引力数值 - 为武器类型枚举添加SUMMON选项 - 优化召唤逻辑,当达到上限时移除最早召唤物 - 调整Shield武器的属性和描述 - 更新Rooster角色的武器配置 - 修复LGBTFlag攻击角度计算问题 --- components/Abstracts/WeaponCardBase.tscn | 11 ++++++++++- components/Characters/Rooster.tscn | 12 +++--------- components/Summons/HJM.tscn | 4 ++-- components/Summons/LGBTFlag.tscn | 4 ++-- components/Weapons/Shield.tscn | 25 +++++++++++++++--------- scripts/Contents/Summons/LGBTFlag.gd | 6 +++++- scripts/Statemachine/EntityBase.gd | 7 ++++--- scripts/Statemachine/WeaponName.gd | 3 +++ scripts/Tools/MathTool.gd | 2 +- 9 files changed, 46 insertions(+), 28 deletions(-) diff --git a/components/Abstracts/WeaponCardBase.tscn b/components/Abstracts/WeaponCardBase.tscn index 0033b18..045f792 100644 --- a/components/Abstracts/WeaponCardBase.tscn +++ b/components/Abstracts/WeaponCardBase.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=7 format=3 uid="uid://ckq2cq6m23hq3"] -[ext_resource type="Script" path="res://scripts/Structs/Weapon.gd" id="1_g802t"] +[ext_resource type="Script" uid="uid://c7odfwtug8ds4" path="res://scripts/Structs/Weapon.gd" id="1_g802t"] [ext_resource type="Theme" uid="uid://dhvs6urgf6jr5" path="res://themes/main.tres" id="2_fwkd3"] [ext_resource type="PackedScene" uid="uid://ch81vd3awkmhk" path="res://components/UI/WeaponName.tscn" id="3_qv0b1"] [ext_resource type="Texture2D" uid="uid://k13cte17httt" path="res://resources/items/energy.svg" id="4_6gohw"] @@ -107,16 +107,25 @@ unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 4 type = 3 +count = 500 [node name="soul" parent="container/info/infos" instance=ExtResource("4_k01vb")] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 4 type = 4 +count = 1 [node name="name" parent="container/info" instance=ExtResource("3_qv0b1")] unique_name_in_owner = true layout_mode = 2 +typeTopicColorMap = { +0: Color(1, 1, 1, 1), +1: Color(0, 0.708754, 1, 1), +2: Color(1, 0.232016, 0, 1), +3: Color(0.707984, 0, 1, 1), +4: Color(0, 1, 0.7641754, 1) +} soulLevelColorMap = { 1: Color(1, 1, 1, 1), 2: Color(0.489296, 1, 0.548293, 1), diff --git a/components/Characters/Rooster.tscn b/components/Characters/Rooster.tscn index a20acdc..92933da 100644 --- a/components/Characters/Rooster.tscn +++ b/components/Characters/Rooster.tscn @@ -1,10 +1,9 @@ -[gd_scene load_steps=14 format=3 uid="uid://bm7ymrri6pykb"] +[gd_scene load_steps=13 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" uid="uid://cthtupc6dtbav" path="res://scripts/Contents/Characters/Rooster.gd" id="2_oqdqd"] -[ext_resource type="PackedScene" uid="uid://sp8f50c5mxyc" path="res://components/Weapons/Shield.tscn" id="3_0omr3"] [ext_resource type="PackedScene" uid="uid://c0n3igy4hucrg" path="res://components/Weapons/PurpleCrystal.tscn" id="3_jluqw"] -[ext_resource type="PackedScene" uid="uid://c3crr8r7y3oho" path="res://components/Weapons/BlueCrystal.tscn" id="3_joj4g"] +[ext_resource type="PackedScene" uid="uid://wl8u5m52708w" path="res://components/Weapons/LGBT.tscn" id="3_s7kxe"] [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="AudioStream" uid="uid://dmxh3bpk8vyy5" path="res://resources/sounds/effect/Coin.mp3" id="5_xnbhq"] @@ -58,13 +57,8 @@ process_mode = 4 [node name="PurpleCrystal" parent="weaponStore" index="0" instance=ExtResource("3_jluqw")] offset_bottom = 350.0 -debugRebuild = false -[node name="BlueCrystal" parent="weaponStore" index="1" instance=ExtResource("3_joj4g")] -offset_bottom = 398.0 - -[node name="Shield" parent="weaponStore" index="2" instance=ExtResource("3_0omr3")] -debugRebuild = false +[node name="LGBT" parent="weaponStore" index="1" instance=ExtResource("3_s7kxe")] [node name="sprint" parent="sounds" index="0"] stream = ExtResource("4_66s6c") diff --git a/components/Summons/HJM.tscn b/components/Summons/HJM.tscn index 72644fa..89940a3 100644 --- a/components/Summons/HJM.tscn +++ b/components/Summons/HJM.tscn @@ -47,10 +47,10 @@ animations = [{ [node name="HJM" instance=ExtResource("1_06nhw")] script = ExtResource("2_7ry3q") -attraction = 0.0 +attraction = 0.1 useStatic = true -[node name="texture" parent="." index="2"] +[node name="texture" parent="." index="3"] sprite_frames = SubResource("SpriteFrames_p863a") animation = &"default" diff --git a/components/Summons/LGBTFlag.tscn b/components/Summons/LGBTFlag.tscn index 5d6f903..9d58171 100644 --- a/components/Summons/LGBTFlag.tscn +++ b/components/Summons/LGBTFlag.tscn @@ -22,9 +22,9 @@ size = Vector2(112, 70) [node name="LGBTFlag" instance=ExtResource("1_fktqv")] script = ExtResource("2_6d456") -attraction = 0.5 +attraction = 0.75 -[node name="texture" parent="." index="2"] +[node name="texture" parent="." index="3"] sprite_frames = SubResource("SpriteFrames_r6sud") [node name="staticBackground" parent="texture" index="0"] diff --git a/components/Weapons/Shield.tscn b/components/Weapons/Shield.tscn index 407f01b..758e936 100644 --- a/components/Weapons/Shield.tscn +++ b/components/Weapons/Shield.tscn @@ -7,24 +7,31 @@ [node name="Shield" instance=ExtResource("1_rax6s")] script = ExtResource("2_s74sn") avatarTexture = ExtResource("2_gcjwh") -displayName = "音元水晶" +displayName = "回响水晶" +quality = 3 +typeTopic = 4 +costBeachball = 1000 store = { -"atk": 200 +"atk": 100 } -descriptionTemplate = "召唤一个可抵挡$atk点伤害的[b]音元护盾[/b]。" +descriptionTemplate = "召唤一个可抵挡$atk点伤害的[b]音元盾[/b]。" +needEnergy = 50.0 +cooldown = 30000.0 debugRebuild = true [node name="avatar" parent="container/info" index="0"] texture = ExtResource("2_gcjwh") -[node name="beachball" parent="container/info/infos" index="1"] -count = 500 +[node name="energy" parent="container/info/infos/energyInfo" index="1"] +text = "50.0" -[node name="soul" parent="container/info/infos" index="2"] -count = 1 +[node name="beachball" parent="container/info/infos" index="1"] +count = 1000 [node name="name" parent="container/info" index="2"] -displayName = "音元水晶" +displayName = "回响水晶" +quality = 3 +typeTopic = 4 [node name="description" parent="container" index="2"] -text = "[center]召唤一个可抵挡[color=cyan]200[/color]点伤害的[b]音元护盾[/b]。[/center]" +text = "[center]召唤一个可抵挡[color=cyan]100[/color]点伤害的[b]音元盾[/b]。[/center]" diff --git a/scripts/Contents/Summons/LGBTFlag.gd b/scripts/Contents/Summons/LGBTFlag.gd index d5864cc..65f0490 100644 --- a/scripts/Contents/Summons/LGBTFlag.gd +++ b/scripts/Contents/Summons/LGBTFlag.gd @@ -12,7 +12,11 @@ func ai(): func attack(type): if type == 0: var tracer = EntityTool.findClosetEntity(position, get_tree(), false, true) - var startAngle = position.angle_to_point(tracer.getTrackingAnchor()) + deg_to_rad(randf_range(-1, 1) * 45) + var startAngle: float + if is_instance_valid(tracer): + startAngle = position.angle_to_point(tracer.getTrackingAnchor()) + deg_to_rad(randf_range(-1, 1) * 45) + else: + startAngle = deg_to_rad(randf_range(0, 360)) for i in count: if !is_instance_valid(tracer): break diff --git a/scripts/Statemachine/EntityBase.gd b/scripts/Statemachine/EntityBase.gd index 8547976..0c5fdd6 100644 --- a/scripts/Statemachine/EntityBase.gd +++ b/scripts/Statemachine/EntityBase.gd @@ -407,10 +407,11 @@ func getMySummons() -> Array[SummonBase]: result.append(entity) return result func summon(who: PackedScene, syncFields: bool = true, lockValue: bool = true) -> SummonBase: - if len(getMySummons()) >= fields.get(FieldStore.Entity.SUMMON_MAX): - return null + var existSummons: Array[SummonBase] = getMySummons() + while len(existSummons) >= fields.get(FieldStore.Entity.SUMMON_MAX): + existSummons.pop_at(0).tryKill() var instance: SummonBase = who.instantiate() - instance.position = position + instance.position = get_global_mouse_position() instance.myMaster = self if isPlayer(): instance.add_to_group("players") if syncFields: diff --git a/scripts/Statemachine/WeaponName.gd b/scripts/Statemachine/WeaponName.gd index 9a3ce9a..ba9f5ba 100644 --- a/scripts/Statemachine/WeaponName.gd +++ b/scripts/Statemachine/WeaponName.gd @@ -14,6 +14,7 @@ enum TypeTopic { ENERGY, TEMPERATURE, MAGIC, + SUMMON } enum SoulLevel { NORMALIZE = 1, @@ -61,12 +62,14 @@ enum SoulLevel { TypeTopic.ENERGY: "能量", TypeTopic.TEMPERATURE: "熔融", TypeTopic.MAGIC: "魔法", + TypeTopic.SUMMON: "召唤", } @export var typeTopicColorMap = { TypeTopic.IMPACT: Color(), TypeTopic.ENERGY: Color(), TypeTopic.TEMPERATURE: Color(), TypeTopic.MAGIC: Color(), + TypeTopic.SUMMON: Color(), } @export var soulLevelNameMap = { SoulLevel.NORMALIZE: "归一", diff --git a/scripts/Tools/MathTool.gd b/scripts/Tools/MathTool.gd index dbc5219..9d8ac9a 100644 --- a/scripts/Tools/MathTool.gd +++ b/scripts/Tools/MathTool.gd @@ -22,7 +22,7 @@ static func signBeforeStr(value: float): static func percent(value: float): return value / 100 static func shrimpRate(value: float): - return floor(value) + int(rate(value - floor(value))) + return randi_range(0, floor(value)) + int(rate(value - floor(value))) static func getClosestIntersection(a: Vector2, b: Vector2, r: float) -> Vector2: var ab = b - a var distance = ab.length()