game over

This commit is contained in:
Page Asgardius 2024-09-05 17:16:49 -07:00
parent 176634ab28
commit 9ceb77e2f9
11 changed files with 388 additions and 23 deletions

View file

@ -54,7 +54,7 @@ func _ready():
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
var velocity = Vector2.ZERO
if Global.live > 4 && Global.live < 9:
if (Global.live > 4 && Global.live < 9) || Global.live == 2:
_exit()
#velocity = (Vector2.RIGHT.rotated(rotation) * -100 * Global.xm * delta)-Vector2.UP.rotated(rotation) * -100 * Global.ym * delta
@ -65,31 +65,31 @@ func _input(event):
#Global.exitgame = true
if Global.live == 1 && Input.is_action_pressed("schar") && Input.is_action_just_pressed("ui_up"):
if Global.debug:
if Global.dparty[0][0] != null:
if Global.dparty[0][0] != null && Global.dstats[Global.dparty[0][0]][0] > 0:
Global.dcpchar = 0
else:
if Global.party[0][0] != null:
if Global.party[0][0] != null && Global.cstats[Global.party[0][0]][0] > 0:
Global.cpchar = 0
elif Global.live == 1 && Input.is_action_pressed("schar") && Input.is_action_just_pressed("ui_right"):
if Global.debug:
if Global.dparty[1][0] != null:
if Global.dparty[1][0] != null && Global.dstats[Global.dparty[1][0]][0] > 0:
Global.dcpchar = 1
else:
if Global.party[1][0] != null:
if Global.party[1][0] != null && Global.cstats[Global.party[1][0]][0] > 0:
Global.cpchar = 1
elif Global.live == 1 && Input.is_action_pressed("schar") && Input.is_action_just_pressed("ui_down"):
if Global.debug:
if Global.dparty[2][0] != null:
if Global.dparty[2][0] != null && Global.dstats[Global.dparty[2][0]][0] > 0:
Global.dcpchar = 2
else:
if Global.party[2][0] != null:
if Global.party[2][0] != null && Global.cstats[Global.party[2][0]][0] > 0:
Global.cpchar = 2
elif Global.live == 1 && Input.is_action_pressed("schar") && Input.is_action_just_pressed("ui_left"):
if Global.debug:
if Global.dparty[3][0] != null:
if Global.dparty[3][0] != null && Global.dstats[Global.dparty[3][0]][0] > 0:
Global.dcpchar = 3
else:
if Global.party[3][0] != null:
if Global.party[3][0] != null && Global.cstats[Global.party[3][0]][0] > 0:
Global.cpchar = 3
if Global.bossready:
Global.bossready = false
@ -108,11 +108,13 @@ func _statrebase():
if Global.dparty[i][0] != null:
for j in 7:
Global.mstats[Global.dparty[i][0]][j] = Global.basestats[Global.dparty[i][0]][j] * Global.dlevel[Global.dparty[i][0]]
Global.cstats[Global.dparty[i][0]][j] = Global.basestats[Global.dparty[i][0]][j] * Global.dlevel[Global.dparty[i][0]]
else:
for i in 4:
if Global.party[i][0] != null:
for j in 7:
Global.mstats[Global.party[i][0]][j] = Global.basestats[Global.party[i][0]][j] * Global.level[Global.dparty[i][0]]
Global.mstats[Global.party[i][0]][j] = Global.basestats[Global.party[i][0]][j] * Global.level[Global.party[i][0]]
Global.cstats[Global.party[i][0]][j] = Global.basestats[Global.party[i][0]][j] * Global.level[Global.party[i][0]]
func _pausemenu():
if Global.live == 1 && !ispaused:
get_tree().root.remove_child(bhud)
@ -139,9 +141,18 @@ func _exit():
#get_tree().root.remove_child(player)
get_tree().root.remove_child(level)
if Global.live == 7:
if !Global.debug:
Global.cplace = [0, 0, 0]
get_tree().change_scene_to_file("res://backgounds/result.tscn")
elif Global.live == 8:
get_tree().change_scene_to_file("res://levels/ui/Cutscenes.tscn")
elif Global.live == 5:
_statrebase()
get_tree().change_scene_to_file("res://backgounds/warp.tscn")
elif Global.live == 2:
_statrebase()
get_tree().root.remove_child(thud)
get_tree().change_scene_to_file("res://backgounds/gameover.tscn")
elif Global.live == 6:
if Global.debug:
Global.live = 0

View file

@ -3,9 +3,11 @@ var cff
var cnf
var chealthf
var clevel
var warpmenu
# Called when the node enters the scene tree for the first time.
func _ready():
warpmenu = $CanvasLayer/HBoxContainer2/VBoxContainer/Warp
cff = $CanvasLayer/HBoxContainer/TextureRect
cnf = $CanvasLayer/HBoxContainer/VBoxContainer/Cname
chealthf = $CanvasLayer/HBoxContainer/VBoxContainer/HBoxContainer/Label2
@ -23,6 +25,16 @@ func _input(event):
_fetchdata()
func _fetchdata():
if Global.debug:
if Global.dplace != [1, 11, 19] && (Global.dplace[0] == 1 || Global.dplace[0] == 2):
warpmenu.visible = true
else:
warpmenu.visible = false
else:
if Global.cplace != [1, 11, 19] && (Global.cplace[0] == 1 || Global.dplace[0] == 2):
warpmenu.visible = true
else:
warpmenu.visible = false
if Global.debug:
cnf.set_text(Global.pcnames[Global.dparty[Global.dcpchar][0]])
cff.texture = load(Global.hudfaces[Global.dparty[Global.dcpchar][0]][Global.dparty[Global.dcpchar][1]])
@ -38,3 +50,11 @@ func _fetchdata():
func _on_exit_pressed():
Global.live = 6
#pass # Replace with function body.
func _on_warp_pressed() -> void:
if Global.debug:
Global.dplace = [0, 0, 0]
else:
Global.cplace = [0, 0, 0]
Global.live = 5

View file

@ -141,4 +141,5 @@ theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_yb7nc")
text = "MENU_EXIT"
[connection signal="pressed" from="CanvasLayer/HBoxContainer2/VBoxContainer/Warp" to="." method="_on_warp_pressed"]
[connection signal="pressed" from="CanvasLayer/HBoxContainer2/VBoxContainer2/Exit" to="." method="_on_exit_pressed"]

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=7 format=3 uid="uid://coaup7cuj7qev"]
[gd_scene load_steps=12 format=3 uid="uid://coaup7cuj7qev"]
[ext_resource type="Script" path="res://levels/ui/tophud.gd" id="1_pntuv"]
@ -14,6 +14,21 @@ bg_color = Color(1, 0.498039, 0, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ftyws"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pwjrs"]
bg_color = Color(0, 0, 1, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_124wc"]
bg_color = Color(0, 0, 1, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_o8qre"]
bg_color = Color(0, 0, 1, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2pkui"]
bg_color = Color(0, 0, 1, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ig4lq"]
bg_color = Color(0, 0, 1, 1)
[node name="Tophud" type="Control"]
layout_mode = 3
anchors_preset = 15
@ -147,6 +162,7 @@ text = "OC Skill"
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_ftyws")
theme_override_styles/fill = SubResource("StyleBoxFlat_pwjrs")
[node name="Label2" type="Label" parent="CanvasLayer/Topmini/VBoxContainer/HBoxContainer4"]
custom_minimum_size = Vector2(123, 0)
@ -247,6 +263,7 @@ text = "OC Skill"
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_ftyws")
theme_override_styles/fill = SubResource("StyleBoxFlat_124wc")
[node name="Label2" type="Label" parent="CanvasLayer/Topleft/Character1/VBoxContainer/HBoxContainer4"]
custom_minimum_size = Vector2(123, 0)
@ -333,6 +350,7 @@ text = "OC Skill"
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_ftyws")
theme_override_styles/fill = SubResource("StyleBoxFlat_o8qre")
[node name="Label2" type="Label" parent="CanvasLayer/Topleft/Character2/VBoxContainer/HBoxContainer4"]
custom_minimum_size = Vector2(123, 0)
@ -419,6 +437,7 @@ text = "OC Skill"
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_ftyws")
theme_override_styles/fill = SubResource("StyleBoxFlat_2pkui")
[node name="Label2" type="Label" parent="CanvasLayer/Topleft/Character3/VBoxContainer/HBoxContainer4"]
custom_minimum_size = Vector2(123, 0)
@ -505,6 +524,7 @@ text = "OC Skill"
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_ftyws")
theme_override_styles/fill = SubResource("StyleBoxFlat_ig4lq")
[node name="Label2" type="Label" parent="CanvasLayer/Topleft/Character4/VBoxContainer/HBoxContainer4"]
custom_minimum_size = Vector2(123, 0)