some exp balancing

This commit is contained in:
Victor Turgeon
2023-10-11 05:23:48 -04:00
parent fce86322c7
commit 5e85af9d00
6 changed files with 156 additions and 6 deletions

View File

@@ -1,8 +1,14 @@
class_name PlayerUI
extends Control
@export var buttonGroup : ButtonGroup
@onready var bludGen : Label = $UIRoot/ControlPanel/StatPanel/Blud/HBoxContainer/VBoxContainer/BludGenContainer/BludGen
@onready var bludTotal : Label = $UIRoot/ControlPanel/StatPanel/Blud/HBoxContainer/VBoxContainer/BludTotalContainer/BludTotal
@onready var enemyXPBar : ProgressBar = $UIRoot/ControlPanel/StatPanel/Other/MarginContainer/GridContainer/EnemyXPBar
@onready var enemyXPLabel : Label = $UIRoot/ControlPanel/StatPanel/Other/MarginContainer/GridContainer/EnemyXPBar/EnemyXPLabel
@onready var enemyHPBar : ProgressBar = $UIRoot/ControlPanel/StatPanel/Other/MarginContainer/GridContainer/EnemyHPBar
@onready var enemyHPLabel : Label = $UIRoot/ControlPanel/StatPanel/Other/MarginContainer/GridContainer/EnemyHPBar/EnemyHPLabel
signal button_changed(currentButton : Button)
@@ -22,3 +28,14 @@ func set_blud_gen(gen):
func set_blud_total(total):
bludTotal.text = str(floor(total))
func set_hp(current, total):
enemyHPBar.max_value = total
enemyHPBar.value = current
enemyHPLabel.text = str(current) + "/" + str(total) + " HP"
func set_xp(current, min, max, level):
enemyXPBar.max_value = max
enemyXPBar.min_value = min
enemyXPBar.value = current
enemyXPLabel.text = "Lvl " + str(level) + " (" + str(current) + "/" + str(max) + "xp)"

View File

@@ -1,10 +1,27 @@
[gd_scene load_steps=6 format=3 uid="uid://dmvukn3rl6gbx"]
[gd_scene load_steps=12 format=3 uid="uid://dmvukn3rl6gbx"]
[ext_resource type="Script" path="res://Scenes/Player/UI/player_ui.gd" id="1_4nwdk"]
[ext_resource type="PackedScene" uid="uid://dl0d1m1gfcd4o" path="res://Scenes/Player/UI/bat_button.tscn" id="1_tnnk6"]
[ext_resource type="Theme" uid="uid://dr1h7to56a2pv" path="res://Themes/base_theme.tres" id="3_4fgkw"]
[ext_resource type="ButtonGroup" uid="uid://gjbbywsr8n8b" path="res://Scenes/Player/UI/spawnables_button_group.tres" id="3_7a133"]
[ext_resource type="Texture2D" uid="uid://kbd5cnmgbqso" path="res://Assets/Sprite-0001.png" id="4_s5lk5"]
[ext_resource type="Texture2D" uid="uid://bof6qeuo2rnso" path="res://Assets/Knight/noBKG_KnightRun_strip.png" id="5_7a8uf"]
[ext_resource type="Texture2D" uid="uid://djjqhipuo3byw" path="res://Assets/Knight/noBKG_KnightShield_strip.png" id="5_t0ay2"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_v6oad"]
bg_color = Color(0.243137, 0.713726, 0.0627451, 0.301961)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_b74dp"]
bg_color = Color(0.333333, 0.721569, 0.270588, 0.886275)
[sub_resource type="AtlasTexture" id="AtlasTexture_5ptrg"]
atlas = ExtResource("5_7a8uf")
region = Rect2(132.276, 0.393494, 39.1181, 55.8829)
[sub_resource type="AtlasTexture" id="AtlasTexture_57m6r"]
resource_local_to_scene = true
atlas = ExtResource("5_t0ay2")
region = Rect2(32, 0, 64, 64)
[node name="PlayerUI" type="Control"]
layout_mode = 3
@@ -118,6 +135,106 @@ theme = ExtResource("3_4fgkw")
text = "100"
vertical_alignment = 2
[node name="Other" type="Control" parent="UIRoot/ControlPanel/StatPanel"]
layout_mode = 2
size_flags_horizontal = 3
[node name="MarginContainer" type="MarginContainer" parent="UIRoot/ControlPanel/StatPanel/Other"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 0
theme_override_constants/margin_top = 5
theme_override_constants/margin_bottom = 5
[node name="GridContainer" type="GridContainer" parent="UIRoot/ControlPanel/StatPanel/Other/MarginContainer"]
layout_mode = 2
[node name="EnemyXPBar" type="ProgressBar" parent="UIRoot/ControlPanel/StatPanel/Other/MarginContainer/GridContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme = ExtResource("3_4fgkw")
theme_override_styles/background = SubResource("StyleBoxFlat_v6oad")
theme_override_styles/fill = SubResource("StyleBoxFlat_b74dp")
max_value = 300.0
step = 1.0
value = 100.0
show_percentage = false
[node name="EnemyTexture" type="TextureRect" parent="UIRoot/ControlPanel/StatPanel/Other/MarginContainer/GridContainer/EnemyXPBar"]
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_top = -16.5
offset_right = 24.0
offset_bottom = 16.5
grow_vertical = 2
texture = SubResource("AtlasTexture_5ptrg")
expand_mode = 3
stretch_mode = 5
[node name="EnemyXPLabel" type="Label" parent="UIRoot/ControlPanel/StatPanel/Other/MarginContainer/GridContainer/EnemyXPBar"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -0.5
offset_top = -11.5
offset_right = 0.5
offset_bottom = 11.5
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 6
text = "Lvl 1 (100/300xp)"
vertical_alignment = 1
[node name="EnemyHPBar" type="ProgressBar" parent="UIRoot/ControlPanel/StatPanel/Other/MarginContainer/GridContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme = ExtResource("3_4fgkw")
step = 1.0
value = 99.0
show_percentage = false
[node name="EnemyTexture" type="TextureRect" parent="UIRoot/ControlPanel/StatPanel/Other/MarginContainer/GridContainer/EnemyHPBar"]
layout_mode = 1
anchors_preset = 9
anchor_bottom = 1.0
offset_top = -8.0
offset_right = 33.0
offset_bottom = 8.0
grow_vertical = 2
texture = SubResource("AtlasTexture_57m6r")
expand_mode = 4
stretch_mode = 5
[node name="EnemyHPLabel" type="Label" parent="UIRoot/ControlPanel/StatPanel/Other/MarginContainer/GridContainer/EnemyHPBar"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -0.5
offset_top = -11.5
offset_right = 0.5
offset_bottom = 11.5
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 6
text = "99/100 HP"
vertical_alignment = 1
[node name="ButtonPanel" type="HBoxContainer" parent="UIRoot/ControlPanel"]
layout_mode = 2
size_flags_horizontal = 3