mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-29 23:41:54 +08:00
改了一些东西,大概是哪些我忘了,嗯对
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
[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"]
|
||||
[ext_resource type="AudioStream" uid="uid://4wuuf1osk0yv" path="res://resources/sounds/effect/Low Boing.wav" id="6_m5px1"]
|
||||
[ext_resource type="AudioStream" uid="uid://q65xjxxq1m4j" path="res://resources/sounds/effect/laserbig.ogg" id="8_pssdt"]
|
||||
[ext_resource type="AudioStream" uid="uid://b10u6iir6uvqn" path="res://resources/sounds/effect/BigLaser.wav" id="8_7dhim"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_4v2ol"]
|
||||
animations = [{
|
||||
@@ -57,7 +57,7 @@ stream = ExtResource("6_m5px1")
|
||||
stream = ExtResource("3_4syso")
|
||||
|
||||
[node name="attack1" type="AudioStreamPlayer2D" parent="sounds" index="5"]
|
||||
stream = ExtResource("8_pssdt")
|
||||
stream = ExtResource("8_7dhim")
|
||||
|
||||
[node name="texture" parent="." index="1"]
|
||||
position = Vector2(0, -70)
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
[node name="Dango" instance=ExtResource("1_mwo1u")]
|
||||
avatarTexture = ExtResource("2_ckr7l")
|
||||
displayName = "团子"
|
||||
fields = Array[int]([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16])
|
||||
fieldValues = Array[float]([10.0, 0.1, 0.15, 0.12, 0.04, 0.1, 0.075, 5.0, 0.15, 3.0, 0.07, 0.15, 0.1, 0.4, 0.2, 2.0, 2.0])
|
||||
fields = Array[int]([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17])
|
||||
fieldValues = Array[float]([10.0, 0.1, 0.15, 0.12, 0.04, 0.1, 0.075, 5.0, 0.15, 3.0, 0.07, 0.15, 0.1, 0.4, 0.2, 2.0, 2.0, 25.0])
|
||||
costs = Array[int]([0, 1])
|
||||
costCounts = Array[int]([2000, 1500])
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@ visible = false
|
||||
layout_mode = 1
|
||||
|
||||
[node name="energy" type="PanelContainer" parent="root"]
|
||||
custom_minimum_size = Vector2(300, 0)
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
offset_left = -3.0
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://ccuucmpdsjgb3"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://ccuucmpdsjgb3"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/Statemachine/DamageLabel.gd" id="1_0q15u"]
|
||||
[ext_resource type="FontFile" uid="uid://db2jl4bq8idec" path="res://resources/fonts/swyc.ttf" id="2_qkvn4"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_valp2"]
|
||||
font_color = Color(1, 0, 0, 1)
|
||||
font = ExtResource("2_qkvn4")
|
||||
font_size = 25
|
||||
outline_size = 6
|
||||
outline_color = Color(0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_32dxy"]
|
||||
length = 0.001
|
||||
@@ -108,9 +112,9 @@ _data = {
|
||||
|
||||
[node name="DamageLabel" type="Node2D"]
|
||||
script = ExtResource("1_0q15u")
|
||||
color1 = Color(1, 1, 1, 1)
|
||||
|
||||
[node name="anchor" type="Node2D" parent="."]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
|
||||
[node name="label" type="Label" parent="anchor"]
|
||||
unique_name_in_owner = true
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="font_data_dynamic"
|
||||
type="FontFile"
|
||||
uid="uid://db2jl4bq8idec"
|
||||
path="res://.godot/imported/swyc.ttf-130174cb159640e512dc161ee7b54b47.fontdata"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/fonts/swyc.ttf"
|
||||
dest_files=["res://.godot/imported/swyc.ttf-130174cb159640e512dc161ee7b54b47.fontdata"]
|
||||
|
||||
[params]
|
||||
|
||||
Rendering=null
|
||||
antialiasing=1
|
||||
generate_mipmaps=false
|
||||
disable_embedded_bitmaps=true
|
||||
multichannel_signed_distance_field=false
|
||||
msdf_pixel_range=8
|
||||
msdf_size=48
|
||||
allow_system_fallback=true
|
||||
force_autohinter=false
|
||||
hinting=1
|
||||
subpixel_positioning=1
|
||||
oversampling=0.0
|
||||
Fallbacks=null
|
||||
fallbacks=[]
|
||||
Compress=null
|
||||
compress=true
|
||||
preload=[]
|
||||
language_support={}
|
||||
script_support={}
|
||||
opentype_features={}
|
||||
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://b10u6iir6uvqn"
|
||||
path="res://.godot/imported/BigLaser.wav-4955f442dcce94f7e5b612e029f9ce72.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/sounds/effect/BigLaser.wav"
|
||||
dest_files=["res://.godot/imported/BigLaser.wav-4955f442dcce94f7e5b612e029f9ce72.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=0
|
||||
Binary file not shown.
@@ -1,19 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="oggvorbisstr"
|
||||
type="AudioStreamOggVorbis"
|
||||
uid="uid://q65xjxxq1m4j"
|
||||
path="res://.godot/imported/laserbig.ogg-c68f8d84676af4ccb64c68f85992ce2d.oggvorbisstr"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/sounds/effect/laserbig.ogg"
|
||||
dest_files=["res://.godot/imported/laserbig.ogg-c68f8d84676af4ccb64c68f85992ce2d.oggvorbisstr"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
||||
@@ -5,6 +5,8 @@ signal hit(damage: float, bullet: BulletBase, crit: bool)
|
||||
signal healed(amount: float)
|
||||
signal healthChanged(health: float)
|
||||
|
||||
signal energyChanged(energy: float)
|
||||
|
||||
var fields = {
|
||||
FieldStore.Entity.MAX_HEALTH: 100,
|
||||
FieldStore.Entity.DAMAGE_MULTIPILER: 1,
|
||||
@@ -39,7 +41,7 @@ var inventoryMax = {
|
||||
@export var cooldownUnit: float = 100 # 100毫秒每次攻击
|
||||
@export var isBoss: bool = false
|
||||
@export var displayName: String = "未知实体"
|
||||
@export var sprintMultiplier: float = 7
|
||||
@export var sprintMultiplier: float = 4
|
||||
@export var drops: Array[ItemStore.ItemType] = []
|
||||
@export var dropCounts: Array[Vector2] = []
|
||||
@export var appleCount: Vector2i = Vector2(0, 1) # 死亡后掉落的苹果数量
|
||||
@@ -71,9 +73,15 @@ func _ready():
|
||||
inventory[body.item] += body.stackCount
|
||||
body.queue_free()
|
||||
)
|
||||
energyChanged.connect(
|
||||
func(newEnergy):
|
||||
UIState.energyPercent.maxValue = fields.get(FieldStore.Entity.MAX_ENERGY)
|
||||
UIState.energyPercent.setCurrent(newEnergy)
|
||||
)
|
||||
else:
|
||||
currentFocusedBoss = get_tree().get_nodes_in_group("players")[0]
|
||||
healthChanged.emit(health)
|
||||
energyChanged.emit(energy)
|
||||
func _process(_delta):
|
||||
health = clamp(health, 0, fields.get(FieldStore.Entity.MAX_HEALTH))
|
||||
energy = clamp(energy, 0, fields.get(FieldStore.Entity.MAX_ENERGY))
|
||||
@@ -125,10 +133,12 @@ func takeDamage(bullet: BulletBase, crit: bool):
|
||||
tryDie(bullet)
|
||||
func storeEnergy(value: float):
|
||||
energy += value * fields.get(FieldStore.Entity.ENERGY_MULTIPILER)
|
||||
energyChanged.emit(energy)
|
||||
func useEnergy(value: float):
|
||||
var state = energy >= value
|
||||
if state:
|
||||
energy -= value
|
||||
energyChanged.emit(energy)
|
||||
return state
|
||||
func isCooldowned():
|
||||
return Time.get_ticks_msec() - lastAttack >= cooldownUnit / fields.get(FieldStore.Entity.ATTACK_SPEED)
|
||||
|
||||
@@ -7,24 +7,23 @@ class_name UIState
|
||||
@onready var items = $"%items"
|
||||
@onready var energyLabel: Label = $"%energy"
|
||||
@onready var energyMaxLabel: Label = $"%energyMax"
|
||||
@onready var energyPercent: ColorBar = $"%percent"
|
||||
|
||||
static var player: EntityBase = null
|
||||
static var bossbar: EntityStateBar
|
||||
static var currentPanel: FullscreenPanelBase = null
|
||||
static var panels: Control
|
||||
static var energyPercent: ColorBar
|
||||
|
||||
func _ready():
|
||||
bossbar = $"%bossbar"
|
||||
panels = $"%panels"
|
||||
energyPercent = $"%percent"
|
||||
func _process(_delta):
|
||||
bossbar.visible = !!bossbar.entity
|
||||
func _physics_process(_delta):
|
||||
if is_instance_valid(player):
|
||||
energyLabel.text = "%.1f" % player.energy
|
||||
energyMaxLabel.text = "%.1f" % player.fields.get(FieldStore.Entity.MAX_ENERGY)
|
||||
energyPercent.maxValue = player.fields.get(FieldStore.Entity.MAX_ENERGY)
|
||||
energyPercent.setCurrent(player.energy)
|
||||
for i in items.get_children():
|
||||
var item = i as ItemShow
|
||||
item.count = player.inventory.get(item.type)
|
||||
|
||||
Reference in New Issue
Block a user