diff --git a/components/Feeds/DangoCat.tscn b/components/Feeds/DangoCat.tscn new file mode 100644 index 0000000..dbb873c --- /dev/null +++ b/components/Feeds/DangoCat.tscn @@ -0,0 +1,20 @@ +[gd_scene load_steps=3 format=3 uid="uid://b4fgrf0av1wxw"] + +[ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_niyn3"] +[ext_resource type="Texture2D" uid="uid://dye4dai4tem2" path="res://resources/feeds/dango cat.svg" id="2_lxrba"] + +[node name="DangoCat" instance=ExtResource("1_niyn3")] +avatarTexture = ExtResource("2_lxrba") +displayName = "团子猫" +quality = 3 +fields = Array[int]([17, 19, 10, 20]) +fieldValues = Array[float]([20.0, 0.05, 0.12, 0.1]) +costs = Array[int]([0, 1]) +costCounts = Array[int]([600, 400]) + +[node name="avatar" parent="container/info" index="0"] +texture = ExtResource("2_lxrba") + +[node name="name" parent="container/info" index="1"] +displayName = "团子猫" +quality = 3 diff --git a/resources/feeds/dango cat.svg b/resources/feeds/dango cat.svg new file mode 100644 index 0000000..8fab141 --- /dev/null +++ b/resources/feeds/dango cat.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/feeds/dango cat.svg.import b/resources/feeds/dango cat.svg.import new file mode 100644 index 0000000..bcb15a6 --- /dev/null +++ b/resources/feeds/dango cat.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dye4dai4tem2" +path="res://.godot/imported/dango cat.svg-5ead84624f78d05211c9ff1694e3b14e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resources/feeds/dango cat.svg" +dest_files=["res://.godot/imported/dango cat.svg-5ead84624f78d05211c9ff1694e3b14e.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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/Statemachine/EntityBase.gd b/scripts/Statemachine/EntityBase.gd index e1ee8f6..d42fef7 100644 --- a/scripts/Statemachine/EntityBase.gd +++ b/scripts/Statemachine/EntityBase.gd @@ -26,13 +26,17 @@ var fields = { FieldStore.Entity.DROP_APPLE_RATE: 0, FieldStore.Entity.PENARATION_RESISTANCE: 0, FieldStore.Entity.LUCK_VALUE: 1, - # 倍率 + # 治疗 FieldStore.Entity.HEAL_ABILITY: 1, - FieldStore.Entity.ENERGY_MULTIPILER: 1, + # 价格减免 FieldStore.Entity.PRICE_REDUCTION: 0, # 饲料 FieldStore.Entity.FEED_COUNT_SHOW: 3, FieldStore.Entity.FEED_COUNT_CAN_MADE: 1, + # 储能 + FieldStore.Entity.ENERGY_MULTIPILER: 1, + FieldStore.Entity.SAVE_ENERGY: 1, + FieldStore.Entity.ENERGY_REGENERATION: 1, } var inventory = { ItemStore.ItemType.BASEBALL: 100, @@ -42,7 +46,7 @@ var inventory = { var inventoryMax = { ItemStore.ItemType.BASEBALL: INF, # 无限 ItemStore.ItemType.BASKETBALL: INF, - ItemStore.ItemType.APPLE: 10, # 最多10个苹果 + ItemStore.ItemType.APPLE: 5, # 最多5个苹果 } @export var cooldownUnit: float = 100 # 100毫秒每次攻击 @@ -121,7 +125,7 @@ func _physics_process(_delta: float) -> void: if isPlayer() or is_instance_valid(currentFocusedBoss): ai() move_and_slide() - storeEnergy(0.01) + storeEnergy(0.01 * fields.get(FieldStore.Entity.ENERGY_REGENERATION)) # 通用方法 func applyLevel(): @@ -165,6 +169,7 @@ func storeEnergy(value: float): energy += value * fields.get(FieldStore.Entity.ENERGY_MULTIPILER) energyChanged.emit(energy) func useEnergy(value: float): + value /= fields.get(FieldStore.Entity.SAVE_ENERGY) var state = energy >= value if state: energy -= value diff --git a/scripts/Tools/FieldStore.gd b/scripts/Tools/FieldStore.gd index cd62c97..7fbe2b6 100644 --- a/scripts/Tools/FieldStore.gd +++ b/scripts/Tools/FieldStore.gd @@ -26,6 +26,8 @@ enum Entity { FEED_COUNT_CAN_MADE, MAX_ENERGY, LUCK_VALUE, + SAVE_ENERGY, + ENERGY_REGENERATION, } static var entityMap = { Entity.MAX_HEALTH: "生命上限", @@ -38,7 +40,7 @@ static var entityMap = { Entity.OFFSET_SHOOT: "散射角", Entity.HEAL_ABILITY: "治疗量", Entity.EXTRA_APPLE_MAX: "苹果上限", - Entity.ENERGY_MULTIPILER: "能量倍率", + Entity.ENERGY_MULTIPILER: "储能倍率", Entity.PENARATION_RESISTANCE: "穿透抗性", Entity.PRICE_REDUCTION: "饲料降价", Entity.EXTRA_BULLET_COUNT: "额外子弹", @@ -47,6 +49,8 @@ static var entityMap = { Entity.FEED_COUNT_CAN_MADE: "可制作饲料", Entity.MAX_ENERGY: "能量上限", Entity.LUCK_VALUE: "幸运值", + Entity.SAVE_ENERGY: "节能", + Entity.ENERGY_REGENERATION: "能量再生效率", } static var entityMapType = { Entity.MAX_HEALTH: DataType.VALUE, @@ -68,6 +72,8 @@ static var entityMapType = { Entity.FEED_COUNT_CAN_MADE: DataType.VALUE, Entity.MAX_ENERGY: DataType.VALUE, Entity.LUCK_VALUE: DataType.VALUE, + Entity.SAVE_ENERGY: DataType.PERCENT, + Entity.ENERGY_REGENERATION: DataType.PERCENT, } static var entityMaxValueMap = { Entity.CRIT_RATE: 1, diff --git a/scripts/Tools/WorldManager.gd b/scripts/Tools/WorldManager.gd index f149474..c66d57f 100644 --- a/scripts/Tools/WorldManager.gd +++ b/scripts/Tools/WorldManager.gd @@ -3,10 +3,15 @@ class_name WorldManager static var rootNode: Node2D static var tree: SceneTree +static var runningTime: float = 0 func _ready(): tree = get_tree() rootNode = self -func _physics_process(_delta): +func _physics_process(delta): + runningTime += delta if EntityBase.mobCount() == 0: UIState.setPanel("MakeFeed") + +static func getTime(): + return runningTime