mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-07-02 00:02:13 +08:00
feat: 更新多个组件,调整动画、显示名称和参数,优化游戏体验
This commit is contained in:
@@ -4,9 +4,6 @@
|
|||||||
|
|
||||||
[sub_resource type="SpriteFrames" id="SpriteFrames_vypy3"]
|
[sub_resource type="SpriteFrames" id="SpriteFrames_vypy3"]
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_kmogx"]
|
|
||||||
resource_name = "spawn"
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_ynxlt"]
|
[sub_resource type="Animation" id="Animation_ynxlt"]
|
||||||
resource_name = "loop"
|
resource_name = "loop"
|
||||||
loop_mode = 1
|
loop_mode = 1
|
||||||
@@ -24,6 +21,9 @@ tracks/0/keys = {
|
|||||||
"values": [0.0, 6.28319]
|
"values": [0.0, 6.28319]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_kmogx"]
|
||||||
|
resource_name = "spawn"
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_dxweq"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_dxweq"]
|
||||||
_data = {
|
_data = {
|
||||||
"loop": SubResource("Animation_ynxlt"),
|
"loop": SubResource("Animation_ynxlt"),
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://c8odsyb7xsu3i"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_cqnkd"]
|
||||||
|
|
||||||
|
[node name="BulletBase" instance=ExtResource("1_cqnkd")]
|
||||||
@@ -35,7 +35,7 @@ radius = 40.0
|
|||||||
script = ExtResource("2_8u5a0")
|
script = ExtResource("2_8u5a0")
|
||||||
cooldownUnit = 1000.0
|
cooldownUnit = 1000.0
|
||||||
drops = Array[int]([0, 1])
|
drops = Array[int]([0, 1])
|
||||||
dropCounts = Array[Vector2]([Vector2(4, 8), Vector2(2, 6)])
|
dropCounts = Array[Vector2]([Vector2(6, 12), Vector2(3, 8)])
|
||||||
energy = 1000.0
|
energy = 1000.0
|
||||||
|
|
||||||
[node name="hurt" parent="sounds" index="3"]
|
[node name="hurt" parent="sounds" index="3"]
|
||||||
|
|||||||
@@ -5,11 +5,11 @@
|
|||||||
|
|
||||||
[node name="WaterBottle" instance=ExtResource("1_vfxjq")]
|
[node name="WaterBottle" instance=ExtResource("1_vfxjq")]
|
||||||
avatarTexture = ExtResource("2_gsfud")
|
avatarTexture = ExtResource("2_gsfud")
|
||||||
displayName = "一杯水"
|
displayName = "水杯"
|
||||||
fields = Array[int]([3])
|
fields = Array[int]([3])
|
||||||
fieldValues = Array[float]([0.25])
|
fieldValues = Array[float]([0.25])
|
||||||
costs = Array[int]([1])
|
costs = Array[int]([1])
|
||||||
costCounts = Array[int]([500])
|
costCounts = Array[int]([300])
|
||||||
|
|
||||||
[node name="avatar" parent="container/info" index="0"]
|
[node name="avatar" parent="container/info" index="0"]
|
||||||
texture = ExtResource("2_gsfud")
|
texture = ExtResource("2_gsfud")
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
[gd_scene load_steps=4 format=3 uid="uid://1n28ji5sl6bx"]
|
[gd_scene load_steps=5 format=3 uid="uid://1n28ji5sl6bx"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://d3qojeqa3difn" path="res://components/Abstracts/FullscreenPanelBase.tscn" id="1_1wmro"]
|
[ext_resource type="PackedScene" uid="uid://d3qojeqa3difn" path="res://components/Abstracts/FullscreenPanelBase.tscn" id="1_1wmro"]
|
||||||
[ext_resource type="Script" path="res://scripts/Contents/Panels/MakeFeed.gd" id="2_pr610"]
|
[ext_resource type="Script" path="res://scripts/Contents/Panels/MakeFeed.gd" id="2_pr610"]
|
||||||
[ext_resource type="Theme" uid="uid://dhvs6urgf6jr5" path="res://themes/main.tres" id="3_q1rym"]
|
[ext_resource type="Theme" uid="uid://dhvs6urgf6jr5" path="res://themes/main.tres" id="3_q1rym"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bbm8l3hr4ihar" path="res://components/UI/ItemShow.tscn" id="4_kei5t"]
|
||||||
|
|
||||||
[node name="MakeFeed" instance=ExtResource("1_1wmro")]
|
[node name="MakeFeed" instance=ExtResource("1_1wmro")]
|
||||||
script = ExtResource("2_pr610")
|
script = ExtResource("2_pr610")
|
||||||
@@ -82,6 +83,19 @@ size_flags_vertical = 4
|
|||||||
theme = ExtResource("3_q1rym")
|
theme = ExtResource("3_q1rym")
|
||||||
text = "跳过"
|
text = "跳过"
|
||||||
|
|
||||||
|
[node name="refreshBtn" type="Button" parent="content/wrapper/tips/tip" index="6"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 4
|
||||||
|
size_flags_vertical = 4
|
||||||
|
theme = ExtResource("3_q1rym")
|
||||||
|
text = "刷新"
|
||||||
|
|
||||||
|
[node name="needBB" parent="content/wrapper/tips/tip" index="7" instance=ExtResource("4_kei5t")]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 4
|
||||||
|
|
||||||
[node name="feedcards" type="HBoxContainer" parent="content/wrapper" index="1"]
|
[node name="feedcards" type="HBoxContainer" parent="content/wrapper" index="1"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ texture = ExtResource("6_p0nkj")
|
|||||||
position = Vector2(394, 274)
|
position = Vector2(394, 274)
|
||||||
|
|
||||||
[node name="camera" type="Camera2D" parent="rooster"]
|
[node name="camera" type="Camera2D" parent="rooster"]
|
||||||
|
process_mode = 3
|
||||||
position = Vector2(0, -100)
|
position = Vector2(0, -100)
|
||||||
process_callback = 0
|
process_callback = 0
|
||||||
position_smoothing_enabled = true
|
position_smoothing_enabled = true
|
||||||
|
|||||||
@@ -13,12 +13,13 @@ unique_name_in_owner = true
|
|||||||
custom_minimum_size = Vector2(20, 20)
|
custom_minimum_size = Vector2(20, 20)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 0
|
size_flags_horizontal = 0
|
||||||
size_flags_vertical = 4
|
size_flags_vertical = 8
|
||||||
texture = ExtResource("1_hyowb")
|
texture = ExtResource("1_hyowb")
|
||||||
expand_mode = 1
|
expand_mode = 1
|
||||||
|
|
||||||
[node name="count" type="Label" parent="."]
|
[node name="count" type="Label" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 10
|
size_flags_horizontal = 0
|
||||||
|
size_flags_vertical = 8
|
||||||
text = "0"
|
text = "0"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
extends BulletBase
|
extends BulletBase
|
||||||
class_name Diamond
|
class_name Diamond
|
||||||
|
|
||||||
const traceTime = 1000
|
const traceTime = 2000
|
||||||
|
|
||||||
func ai():
|
func ai():
|
||||||
rotation = lerp_angle(rotation, position.angle_to_point(launcher.currentFocusedBoss.position), 0.2 * ((traceTime - timeLived()) / traceTime))
|
rotation = lerp_angle(rotation, position.angle_to_point(launcher.currentFocusedBoss.position), 0.1 * clamp((traceTime - timeLived()) / traceTime, 0, INF))
|
||||||
canDamageSelf = !(timeLived() >= traceTime)
|
canDamageSelf = !(timeLived() >= traceTime)
|
||||||
forward(Vector2.from_angle(rotation))
|
forward(Vector2.from_angle(rotation))
|
||||||
|
|||||||
@@ -2,18 +2,28 @@
|
|||||||
extends FullscreenPanelBase
|
extends FullscreenPanelBase
|
||||||
|
|
||||||
var selectedCount: int = 0
|
var selectedCount: int = 0
|
||||||
|
var refreshNeedBaseballCount = 100
|
||||||
|
|
||||||
@onready var avaliableFeeds: Node2D = $"%avaliableFeeds"
|
@onready var avaliableFeeds: Node2D = $"%avaliableFeeds"
|
||||||
@onready var feedCards: HBoxContainer = $"%feedcards"
|
@onready var feedCards: HBoxContainer = $"%feedcards"
|
||||||
@onready var waveLabel: RichTextLabel = $"%wave"
|
@onready var waveLabel: RichTextLabel = $"%wave"
|
||||||
@onready var countLabel: RichTextLabel = $"%count"
|
@onready var countLabel: RichTextLabel = $"%count"
|
||||||
@onready var skipBtn: Button = $"%skipBtn"
|
@onready var skipBtn: Button = $"%skipBtn"
|
||||||
|
@onready var refreshBtn: Button = $"%refreshBtn"
|
||||||
|
@onready var needBB: ItemShow = $"%needBB"
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
skipBtn.pressed.connect(
|
skipBtn.pressed.connect(
|
||||||
func():
|
func():
|
||||||
finish()
|
finish()
|
||||||
)
|
)
|
||||||
|
refreshBtn.pressed.connect(
|
||||||
|
func():
|
||||||
|
if UIState.player.inventory[ItemStore.ItemType.BASEBALL] >= refreshNeedBaseballCount:
|
||||||
|
UIState.player.inventory[ItemStore.ItemType.BASEBALL] -= refreshNeedBaseballCount
|
||||||
|
refreshNeedBaseballCount *= 1 + randf_range(GameRule.refreshCountIncreasePercent.x, GameRule.refreshCountIncreasePercent.y)
|
||||||
|
regenerateCards()
|
||||||
|
)
|
||||||
for file in DirTool.listdir("res://components/Feeds/"):
|
for file in DirTool.listdir("res://components/Feeds/"):
|
||||||
var i = load(file).instantiate() as Feed
|
var i = load(file).instantiate() as Feed
|
||||||
i.selected.connect(
|
i.selected.connect(
|
||||||
@@ -28,8 +38,22 @@ func _ready():
|
|||||||
|
|
||||||
func beforeOpen():
|
func beforeOpen():
|
||||||
selectedCount = 0
|
selectedCount = 0
|
||||||
afterClose()
|
regenerateCards()
|
||||||
|
|
||||||
|
func clearCards():
|
||||||
|
for i in feedCards.get_children():
|
||||||
|
feedCards.remove_child(i)
|
||||||
|
avaliableFeeds.add_child(i)
|
||||||
|
func updateValue():
|
||||||
|
waveLabel.text = str(Wave.current + 1)
|
||||||
|
countLabel.text = str(UIState.player.fields[FieldStore.Entity.FEED_COUNT_CAN_MADE] - selectedCount)
|
||||||
|
needBB.count = refreshNeedBaseballCount
|
||||||
|
func finish():
|
||||||
|
Wave.next()
|
||||||
|
UIState.closeCurrentPanel()
|
||||||
|
func regenerateCards():
|
||||||
updateValue()
|
updateValue()
|
||||||
|
clearCards()
|
||||||
var feeds: Array[Feed] = []
|
var feeds: Array[Feed] = []
|
||||||
for i in avaliableFeeds.get_children():
|
for i in avaliableFeeds.get_children():
|
||||||
feeds.append(i)
|
feeds.append(i)
|
||||||
@@ -38,14 +62,3 @@ func beforeOpen():
|
|||||||
var feed = feeds[i] as Feed
|
var feed = feeds[i] as Feed
|
||||||
avaliableFeeds.remove_child(feed)
|
avaliableFeeds.remove_child(feed)
|
||||||
feedCards.add_child(feed)
|
feedCards.add_child(feed)
|
||||||
func afterClose():
|
|
||||||
for i in feedCards.get_children():
|
|
||||||
feedCards.remove_child(i)
|
|
||||||
avaliableFeeds.add_child(i)
|
|
||||||
|
|
||||||
func updateValue():
|
|
||||||
waveLabel.text = str(Wave.current + 1)
|
|
||||||
countLabel.text = str(UIState.player.fields[FieldStore.Entity.FEED_COUNT_CAN_MADE] - selectedCount)
|
|
||||||
func finish():
|
|
||||||
Wave.next()
|
|
||||||
UIState.closeCurrentPanel()
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ var targetPlayer: EntityBase = null
|
|||||||
@onready var texture: Sprite2D = $"%texture"
|
@onready var texture: Sprite2D = $"%texture"
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
apply_force(MathTool.randv2_range(20000), MathTool.randv2_range(10))
|
apply_force(MathTool.randv2_range(30000), MathTool.randv2_range(10))
|
||||||
func _process(_delta):
|
func _process(_delta):
|
||||||
texture.texture = ItemStore.getTexture(item)
|
texture.texture = ItemStore.getTexture(item)
|
||||||
func _physics_process(_delta):
|
func _physics_process(_delta):
|
||||||
|
|||||||
@@ -6,3 +6,4 @@ static var damageOffset: float = 0.2 # 伤害随机浮动比例,默认20%,
|
|||||||
static var damageLabelSpawnOffset: float = 10 # 伤害标签生成位置的随机偏移
|
static var damageLabelSpawnOffset: float = 10 # 伤害标签生成位置的随机偏移
|
||||||
static var itemDroppedSpawnOffset: float = 30 # 掉落物生成位置的随机偏移
|
static var itemDroppedSpawnOffset: float = 30 # 掉落物生成位置的随机偏移
|
||||||
static var appleDropRate: float = 0.1 # 苹果掉落概率
|
static var appleDropRate: float = 0.1 # 苹果掉落概率
|
||||||
|
static var refreshCountIncreasePercent: Vector2 = Vector2(0.4, 1.1) # 刷新所需的棒球数量的增加的百分比,随机,默认为40%~110%
|
||||||
Reference in New Issue
Block a user