rename main scene to combatUI and refactor debug

This commit is contained in:
tonydero 2024-10-21 06:44:52 -06:00
parent ccdee2e057
commit c3f02e855d
9 changed files with 43 additions and 39 deletions

View File

@ -11,7 +11,7 @@ config_version=5
[application]
config/name="Semi-Idle ARPG"
run/main_scene="res://scenes/testScrollScene.tscn"
run/main_scene="res://scenes/combatUIScene.tscn"
config/features=PackedStringArray("4.3", "Forward Plus")
config/icon="res://assets/icon.svg"

View File

@ -1,11 +1,11 @@
[gd_scene load_steps=16 format=3 uid="uid://0h3dpe6fuhe8"]
[ext_resource type="Script" path="res://scripts/test_scroll_scene.gd" id="1_gc1kb"]
[ext_resource type="Theme" uid="uid://clhh3c3gxotjg" path="res://assets/healthbar.tres" id="2_2v2l0"]
[ext_resource type="Script" path="res://scripts/WorldArea.gd" id="2_ccxbh"]
[ext_resource type="PackedScene" uid="uid://dvwo26vsk46tl" path="res://scenes/ability_player.tscn" id="2_heria"]
[ext_resource type="Script" path="res://scripts/Player.gd" id="3_cjiwt"]
[ext_resource type="Theme" uid="uid://cp82s71sduhcv" path="res://assets/expbar.tres" id="3_n8q4b"]
[ext_resource type="Script" path="res://scripts/combat_ui_scene.gd" id="1_p88l5"]
[ext_resource type="Script" path="res://scripts/WorldArea.gd" id="2_anfgr"]
[ext_resource type="Script" path="res://scripts/Player.gd" id="3_w71a3"]
[ext_resource type="Theme" uid="uid://clhh3c3gxotjg" path="res://assets/healthbar.tres" id="4_4e8vj"]
[ext_resource type="Theme" uid="uid://cp82s71sduhcv" path="res://assets/expbar.tres" id="5_mpq3w"]
[ext_resource type="PackedScene" uid="uid://dvwo26vsk46tl" path="res://scenes/ability_player.tscn" id="6_8hwtc"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_6qo1s"]
@ -34,7 +34,7 @@ curve_z = SubResource("Curve_wmq0q")
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_6jnvr"]
[node name="TestInstanceScene" type="Control"]
[node name="CombatUIScene" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
@ -43,8 +43,7 @@ grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource("1_gc1kb")
debug = true
script = ExtResource("1_p88l5")
[node name="SpawnTimer" type="Timer" parent="."]
@ -57,7 +56,7 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxEmpty_6qo1s")
script = ExtResource("2_ccxbh")
script = ExtResource("2_anfgr")
[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 1
@ -93,7 +92,7 @@ theme_override_styles/panel = SubResource("StyleBoxEmpty_imvmd")
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
script = ExtResource("3_cjiwt")
script = ExtResource("3_w71a3")
[node name="PlayerLabel" type="HBoxContainer" parent="MarginContainer/UIBottom/PlayerContainer/PlayerInfo"]
layout_mode = 2
@ -111,7 +110,7 @@ visible = false
custom_minimum_size = Vector2(0, 32)
layout_mode = 2
size_flags_vertical = 2
theme = ExtResource("2_2v2l0")
theme = ExtResource("4_4e8vj")
step = 1.0
value = 100.0
@ -119,7 +118,7 @@ value = 100.0
custom_minimum_size = Vector2(0, 32)
layout_mode = 2
size_flags_vertical = 2
theme = ExtResource("2_2v2l0")
theme = ExtResource("4_4e8vj")
value = 72.0
nine_patch_stretch = true
texture_under = SubResource("CurveTexture_mtsg5")
@ -180,7 +179,7 @@ metadata/_edit_use_anchors_ = true
[node name="PlayerExpBar" type="ProgressBar" parent="MarginContainer/UIBottom/PlayerContainer/PlayerInfo"]
layout_mode = 2
size_flags_vertical = 10
theme = ExtResource("3_n8q4b")
theme = ExtResource("5_mpq3w")
step = 1.0
value = 43.0
@ -197,13 +196,13 @@ size_flags_horizontal = 4
size_flags_vertical = 6
alignment = 1
[node name="AbilityA1" parent="MarginContainer/UIBottom/UIBottomCenter/AbilityBar" instance=ExtResource("2_heria")]
[node name="AbilityA1" parent="MarginContainer/UIBottom/UIBottomCenter/AbilityBar" instance=ExtResource("6_8hwtc")]
custom_minimum_size = Vector2(64, 64)
layout_mode = 2
attack_range = 9999
attack_damage = 999999
attack_damage = 10000
[node name="AbilityA2" parent="MarginContainer/UIBottom/UIBottomCenter/AbilityBar" instance=ExtResource("2_heria")]
[node name="AbilityA2" parent="MarginContainer/UIBottom/UIBottomCenter/AbilityBar" instance=ExtResource("6_8hwtc")]
visible = false
custom_minimum_size = Vector2(64, 64)
layout_mode = 2
@ -213,25 +212,25 @@ attack_range = 200
attack_damage = 50
auto_speed = 5.0
[node name="AbilityA3" parent="MarginContainer/UIBottom/UIBottomCenter/AbilityBar" instance=ExtResource("2_heria")]
[node name="AbilityA3" parent="MarginContainer/UIBottom/UIBottomCenter/AbilityBar" instance=ExtResource("6_8hwtc")]
visible = false
custom_minimum_size = Vector2(64, 64)
layout_mode = 2
size_flags_horizontal = 6
[node name="AbilityA4" parent="MarginContainer/UIBottom/UIBottomCenter/AbilityBar" instance=ExtResource("2_heria")]
[node name="AbilityA4" parent="MarginContainer/UIBottom/UIBottomCenter/AbilityBar" instance=ExtResource("6_8hwtc")]
visible = false
custom_minimum_size = Vector2(64, 64)
layout_mode = 2
size_flags_horizontal = 6
[node name="AbilityB1" parent="MarginContainer/UIBottom/UIBottomCenter/AbilityBar" instance=ExtResource("2_heria")]
[node name="AbilityB1" parent="MarginContainer/UIBottom/UIBottomCenter/AbilityBar" instance=ExtResource("6_8hwtc")]
visible = false
custom_minimum_size = Vector2(64, 64)
layout_mode = 2
size_flags_horizontal = 6
[node name="AbilityB2" parent="MarginContainer/UIBottom/UIBottomCenter/AbilityBar" instance=ExtResource("2_heria")]
[node name="AbilityB2" parent="MarginContainer/UIBottom/UIBottomCenter/AbilityBar" instance=ExtResource("6_8hwtc")]
visible = false
custom_minimum_size = Vector2(64, 64)
layout_mode = 2
@ -301,7 +300,7 @@ size_flags_horizontal = 3
[node name="MPlayerFollowerHealthBar" type="ProgressBar" parent="MarginContainer/UIBottom/MPlayerFollowerContainer/MPlayerFollowerInfo"]
layout_mode = 2
theme = ExtResource("2_2v2l0")
theme = ExtResource("4_4e8vj")
[connection signal="timeout" from="SpawnTimer" to="." method="_on_spawn_timer_timeout"]
[connection signal="pressed" from="MarginContainer/UIBottom/UIBottomCenter/MenuButtons/DebugMenu/ButtonTest" to="." method="_on_button_test_pressed"]

View File

@ -6,8 +6,7 @@
[node name="NPCEnemy" type="CharacterBody2D"]
script = ExtResource("1_ec4cy")
npcDifficulty = 2
npcTier = 4
npcDifficulty = 1
[node name="CollisionShape2D" type="CollisionPolygon2D" parent="."]
position = Vector2(-100, -86)

View File

@ -10,6 +10,7 @@ offset_right = 175.0
offset_bottom = 40.0
theme_override_styles/panel = SubResource("StyleBoxEmpty_dv3o6")
script = ExtResource("1_o0k38")
goalTotal = 200
[node name="QuestProgress" type="HBoxContainer" parent="."]
layout_mode = 2

View File

@ -1,6 +1,10 @@
# file containing type information to be referrenced by other classes
extends Node
@export var debug = true
class World:
enum Zone {
TUTORIAL,

View File

@ -3,7 +3,6 @@ class_name NPCEnemy
extends NPC
var target
var speed := 200
var prevCollisions := 0

View File

@ -16,16 +16,17 @@ func _ready() -> void:
func _on_enemy_died(enemyDifficulty, enemyTier, _enemyFaction) -> void:
var kill_exp = pow(pow(enemyTier + 1, 3), enemyDifficulty)
area_exp += kill_exp
print("T: ", enemyTier, " D: ", enemyDifficulty)
print("K: ", kill_exp)
print("A: ",area_exp)
if Globals.debug:
print("T: ", enemyTier, " D: ", enemyDifficulty)
print("K: ", kill_exp)
print("A: ",area_exp)
# TODO: maybe show earned exp on bar, separate from current
# use xp to next level and current level, subtract, figure out percentage per point exp, add to display?
func _calculate_player_level() -> float:
var current_exp = PlayerState.player_exp
return log((current_exp + 5)/5.0) + 1
return log((0.2 * current_exp + 5)/5.0) + 1
func _get_level_progress_percent() -> float:
@ -38,9 +39,10 @@ func _on_quest_completed() -> void:
PlayerState.player_level = _calculate_player_level()
$PlayerExpBar.value = _get_level_progress_percent()
$PlayerLabel/PlayerLevel.text = str(floor(PlayerState.player_level))
print("FA: ", area_exp)
print("L: ", PlayerState.player_level)
print("XP: ", PlayerState.player_exp)
print("CL: ", _calculate_player_level())
print("LP: ", _get_level_progress_percent())
if Globals.debug:
print("FA: ", area_exp)
print("L: ", PlayerState.player_level)
print("XP: ", PlayerState.player_exp)
print("CL: ", _calculate_player_level())
print("LP: ", _get_level_progress_percent())
Engine.time_scale = 0.0001

View File

@ -8,13 +8,13 @@ extends PanelContainer
@export var faction := Globals.World.Faction.CREATURE
@export var goalTotal := 1
@export var goalCurrent := 0
var goalCurrent := 0
var questComplete := false
func _ready() -> void:
SignalBus.enemy_died.connect(_on_enemy_died)
_generate_random_quest()
#_generate_random_quest()
_set_goal_text()
_set_goal_val()
@ -28,6 +28,7 @@ func _process(_delta: float) -> void:
func _set_goal_text() -> void:
var goalStr = WorldArea.GoalType.keys()[self.goalType].capitalize()
var factionStr = Globals.World.Faction.keys()[self.faction].capitalize()
# TODO: use better string formatting methods
$QuestProgress/GoalTypeVal.text = goalStr + " " + factionStr + "s"

View File

@ -2,7 +2,6 @@
extends Control
@export var debug = false
@export var spawnTimerValue = 10.0
var deltaCount := 0
@ -15,7 +14,7 @@ var playerPos
func _ready() -> void:
if debug:
if Globals.debug:
%DebugMenu.show()
Engine.time_scale = 10.0