diff --git a/components/Feeds/Fish.tscn b/components/Feeds/Fish.tscn new file mode 100644 index 0000000..fbdfa6f --- /dev/null +++ b/components/Feeds/Fish.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=3 format=3 uid="uid://ch8010vm2lpby"] + +[ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_wb8r8"] +[ext_resource type="Texture2D" uid="uid://p5wms8lrj23a" path="res://resources/feeds/fish-a.svg" id="2_mefkw"] + +[node name="Fish" instance=ExtResource("1_wb8r8")] +avatarTexture = ExtResource("2_mefkw") +displayName = "小丑鱼" +quality = 4 +topic = 9 +fields = Array[int]([27, 19, 17]) +fieldValues = Array[float]([1.0, -0.1, -20.0]) +costs = Array[int]([2, 3]) +costCounts = Array[int]([1, 2500]) + +[node name="avatar" parent="container/info" index="0"] +texture = ExtResource("2_mefkw") + +[node name="name" parent="container/info" index="1"] +displayName = "小丑鱼" +quality = 4 +topic = 9 diff --git a/components/UI/FeedName.tscn b/components/UI/FeedName.tscn index ac1182b..a334ccc 100644 --- a/components/UI/FeedName.tscn +++ b/components/UI/FeedName.tscn @@ -1,13 +1,13 @@ [gd_scene load_steps=5 format=3 uid="uid://bt370a1djjg5p"] -[ext_resource type="Script" path="res://scripts/Statemachine/FeedName.gd" id="1_wfxme"] +[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_8o8ly"] +[sub_resource type="LabelSettings" id="LabelSettings_j8acg"] font_size = 12 font_color = Color(1, 0.442751, 0, 1) -[sub_resource type="LabelSettings" id="LabelSettings_6f4ri"] +[sub_resource type="LabelSettings" id="LabelSettings_268ry"] font_size = 12 font_color = Color(1, 0, 0.585938, 1) @@ -33,7 +33,8 @@ topicColorMap = { 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) +8: Color(1, 0.816993, 0, 1), +9: Color(0, 1, 0.7435255, 1) } metadata/_edit_horizontal_guides_ = [25.0] @@ -42,7 +43,7 @@ unique_name_in_owner = true layout_mode = 2 size_flags_vertical = 0 text = "[传说]" -label_settings = SubResource("LabelSettings_8o8ly") +label_settings = SubResource("LabelSettings_j8acg") [node name="label" type="RichTextLabel" parent="."] unique_name_in_owner = true @@ -58,4 +59,4 @@ unique_name_in_owner = true layout_mode = 2 size_flags_vertical = 8 text = "[生存]" -label_settings = SubResource("LabelSettings_6f4ri") +label_settings = SubResource("LabelSettings_268ry") diff --git a/resources/feeds/fish-a.svg b/resources/feeds/fish-a.svg new file mode 100644 index 0000000..177d251 --- /dev/null +++ b/resources/feeds/fish-a.svg @@ -0,0 +1,52 @@ + + + + fish-a + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/resources/feeds/fish-a.svg.import b/resources/feeds/fish-a.svg.import new file mode 100644 index 0000000..c4ae3fe --- /dev/null +++ b/resources/feeds/fish-a.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://p5wms8lrj23a" +path="res://.godot/imported/fish-a.svg-b6202775ad13c6efce0a7e1d6f86575e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resources/feeds/fish-a.svg" +dest_files=["res://.godot/imported/fish-a.svg-b6202775ad13c6efce0a7e1d6f86575e.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/resources/fieldIcons/召唤上限.svg b/resources/fieldIcons/召唤上限.svg new file mode 100644 index 0000000..3e6b881 --- /dev/null +++ b/resources/fieldIcons/召唤上限.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/fieldIcons/召唤上限.svg.import b/resources/fieldIcons/召唤上限.svg.import new file mode 100644 index 0000000..6efb4e1 --- /dev/null +++ b/resources/fieldIcons/召唤上限.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bvmc6kaaqekel" +path="res://.godot/imported/召唤上限.svg-b54eb451a81b025d047621f82213934b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resources/fieldIcons/召唤上限.svg" +dest_files=["res://.godot/imported/召唤上限.svg-b54eb451a81b025d047621f82213934b.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/Weapons/HJM.gd b/scripts/Contents/Weapons/HJM.gd index 65a5b77..760e16e 100644 --- a/scripts/Contents/Weapons/HJM.gd +++ b/scripts/Contents/Weapons/HJM.gd @@ -7,6 +7,7 @@ func update(to: int, origin: Dictionary, _entity: EntityBase): return origin func attack(entity: EntityBase): var summon = entity.summon(ComponentManager.getSummon("HJM")) + if !summon: return true summon.atk = readStore("atk") summon.attackTime = readStore("time") * 1000 return true diff --git a/scripts/Contents/Weapons/LGBTWeapon.gd b/scripts/Contents/Weapons/LGBTWeapon.gd index a5046ca..f65732d 100644 --- a/scripts/Contents/Weapons/LGBTWeapon.gd +++ b/scripts/Contents/Weapons/LGBTWeapon.gd @@ -11,6 +11,7 @@ func update(to: int, origin: Dictionary, _entity: EntityBase): return origin func attack(entity: EntityBase): var summon = entity.summon(ComponentManager.getSummon("LGBTFlag")) + if !summon: return true summon.atk = readStore("atk") summon.maxTraceTime = readStore("trace") * 1000 summon.tracePower = readStore("power") diff --git a/scripts/Statemachine/EntityBase.gd b/scripts/Statemachine/EntityBase.gd index 55f15a3..2c3e148 100644 --- a/scripts/Statemachine/EntityBase.gd +++ b/scripts/Statemachine/EntityBase.gd @@ -16,6 +16,8 @@ var fields = { FieldStore.Entity.EXTRA_APPLE_MAX: 0, FieldStore.Entity.DROP_APPLE_RATE: 0, FieldStore.Entity.PENARATION_RESISTANCE: 0, + "召唤": TITLE_FLAG, + FieldStore.Entity.SUMMON_MAX: 1, "储能": TITLE_FLAG, FieldStore.Entity.MAX_ENERGY: 200, FieldStore.Entity.SAVE_ENERGY: 1, @@ -398,7 +400,15 @@ func useItem(items: Dictionary): func getItem(items: Dictionary): for item in items: inventory[item] = clamp(inventory[item] + items[item], 0, inventoryMax[item]) +func getMySummons() -> Array[SummonBase]: + var result: Array[SummonBase] = [] + for entity in get_tree().get_nodes_in_group("players" if isPlayer() else "mobs"): + if entity is SummonBase && entity.myMaster == self: + 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 instance: SummonBase = who.instantiate() instance.position = position instance.myMaster = self diff --git a/scripts/Statemachine/FeedName.gd b/scripts/Statemachine/FeedName.gd index 3a8432d..bd0736a 100644 --- a/scripts/Statemachine/FeedName.gd +++ b/scripts/Statemachine/FeedName.gd @@ -19,6 +19,7 @@ enum Topic { FEED, DROP, WEAPON, + SUMMON, } @export var displayName: String = "未命名饲料" @@ -62,6 +63,7 @@ enum Topic { Topic.FEED: "饲料", Topic.DROP: "掉落物", Topic.WEAPON: "武器", + Topic.SUMMON: "召唤", } @export var topicColorMap = { Topic.SURVIVAL: Color(), @@ -73,6 +75,7 @@ enum Topic { Topic.FEED: Color(), Topic.DROP: Color(), Topic.WEAPON: Color(), + Topic.SUMMON: Color(), } @onready var qualityLabel: Label = $"%quality" diff --git a/scripts/Tools/FieldStore.gd b/scripts/Tools/FieldStore.gd index 42953d2..920f17c 100644 --- a/scripts/Tools/FieldStore.gd +++ b/scripts/Tools/FieldStore.gd @@ -35,7 +35,8 @@ enum Entity { BULLET_REFRACTION, BULLET_TRACE, GRAVITY, - PERFECT_MISS_WINDOW + PERFECT_MISS_WINDOW, + SUMMON_MAX } static var entityMap = { Entity.MAX_HEALTH: "生命上限", @@ -65,6 +66,7 @@ static var entityMap = { Entity.BULLET_TRACE: "追踪", Entity.GRAVITY: "引力", Entity.PERFECT_MISS_WINDOW: "闪避窗口", + Entity.SUMMON_MAX: "召唤上限" } static var entityMapType = { Entity.MAX_HEALTH: DataType.VALUE, @@ -94,6 +96,7 @@ static var entityMapType = { Entity.BULLET_TRACE: DataType.PERCENT, Entity.GRAVITY: DataType.VALUE, Entity.PERFECT_MISS_WINDOW: DataType.PERCENT, + Entity.SUMMON_MAX: DataType.INTEGER } static var entityMaxValueMap = { Entity.CRIT_RATE: 0.9,