From f5d435734cf253c4a19d53fa414caac13e64f9fa Mon Sep 17 00:00:00 2001 From: Page Asgardius Date: Thu, 26 Sep 2024 13:06:33 -0700 Subject: [PATCH] result --- backgounds/result.gd | 17 +++++++++++++++-- global.gd | 1 + levels/Ceres/troublemakers.gd | 1 + levels/ui/gameplay.gd | 6 ++++-- levels/ui/soundtest.gd | 2 +- sprites/common/bullet/aero.gd | 2 ++ sprites/common/bullet/arrow.gd | 3 ++- sprites/common/bullet/fireball.gd | 2 ++ sprites/common/bullet/snowflake.gd | 2 ++ sprites/common/bullet/tnt.gd | 2 ++ 10 files changed, 32 insertions(+), 6 deletions(-) diff --git a/backgounds/result.gd b/backgounds/result.gd index 7ace728..1e89598 100644 --- a/backgounds/result.gd +++ b/backgounds/result.gd @@ -1,11 +1,19 @@ extends Node2D var presscontinue - +var result var rmusic := AudioStreamPlayer.new() var wait # Called when the node enters the scene tree for the first time. func _ready(): + Global.result[1] = Time.get_ticks_msec() - Global.wait + result = $Label presscontinue = $Label2 + var previoustime + var min = float(Global.result[1] / 60000) + var sec = (Global.result[1] / 1000) - (min*60) + var msec = Global.result[1] - (sec*1000) - (min*60000) + result.set_text("Defeated enemies: "+str(Global.result[0])+"\nClear time: "+str(min)+":"+str(sec)+":"+str(msec)+"\nCharged skill uses: 0\nDamage received: "+str(Global.result[3])+"\nEarned experience: 0") + Global.result = [0, 0, 0, 0, 0] updatehud() Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN) add_child(rmusic) @@ -34,7 +42,12 @@ func _title(): if Global.debug: get_tree().change_scene_to_file("res://levels/ui/scene.tscn") else: - get_tree().change_scene_to_file("res://backgounds/wip.tscn") + if Global.cplace == [1, 1, 17]: + Global.cplace = [0, 0, 0] + get_tree().change_scene_to_file("res://backgounds/wip.tscn") + else: + Global.cplace = [0, 0, 0] + get_tree().change_scene_to_file("res://levels/ui/gameplay.tscn") #get_tree().root.add_child(title) #get_tree().root.remove_child(boot) #boot.queue_free() diff --git a/global.gd b/global.gd index 58ec51a..0839976 100644 --- a/global.gd +++ b/global.gd @@ -38,6 +38,7 @@ var dparty = [[0,0], [1,0], [3,0], [9,0]] var level = [1,1,1,1,1,1,1,1,1,1] var dlevel = [1,1,1,1,1,1,1,1,1,1] var cpchar = 0 +var result = [0, 0, 0, 0, 0] var dificulty = 0 var dcpchar = 0 var mangohud = false diff --git a/levels/Ceres/troublemakers.gd b/levels/Ceres/troublemakers.gd index d0128a2..69013ce 100644 --- a/levels/Ceres/troublemakers.gd +++ b/levels/Ceres/troublemakers.gd @@ -27,6 +27,7 @@ func _input(event): Global.cdialog = [] func _winner(): + Global.result[0] = 1 Global.quest[2] = 3 Global.cdialog = [[tr("DIALOG_TROUBLEMAKER_3"), true, 0, 0], [tr("DIALOG_TROUBLEMAKER_4"), true, 7, 0], [tr("DIALOG_TROUBLEMAKER_5"), true, 0, 0]] Global.live = 3 diff --git a/levels/ui/gameplay.gd b/levels/ui/gameplay.gd index 4734d10..6cc2122 100644 --- a/levels/ui/gameplay.gd +++ b/levels/ui/gameplay.gd @@ -46,6 +46,7 @@ func _ready(): bgsound.mix_target = 1 sfx1.mix_target = 1 sfx1.bus = &"SFX1" + Global.wait = Time.get_ticks_msec() if !Global.isboss: bgsound.play(0) @@ -141,19 +142,20 @@ 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: + Global.result = [0, 0, 0, 0, 0] _statrebase() get_tree().change_scene_to_file("res://backgounds/warp.tscn") elif Global.live == 2: + Global.result = [0, 0, 0, 0, 0] _statrebase() get_tree().root.remove_child(thud) get_tree().change_scene_to_file("res://backgounds/gameover.tscn") elif Global.live == 6: + Global.result = [0, 0, 0, 0, 0] if Global.debug: Global.live = 0 get_tree().change_scene_to_file("res://levels/ui/scene.tscn") diff --git a/levels/ui/soundtest.gd b/levels/ui/soundtest.gd index 50d7c31..07e9a74 100644 --- a/levels/ui/soundtest.gd +++ b/levels/ui/soundtest.gd @@ -34,7 +34,7 @@ func _input(event): func _on_back_pressed(): - get_tree().change_scene_to_file("res://levels/ui/tmenu.tscn") + get_tree().change_scene_to_file("res://levels/ui/debug.tscn") diff --git a/sprites/common/bullet/aero.gd b/sprites/common/bullet/aero.gd index ab10528..b53892b 100644 --- a/sprites/common/bullet/aero.gd +++ b/sprites/common/bullet/aero.gd @@ -36,6 +36,7 @@ func _on_body_entered(body): if body.weakness == speciality: print("weakness") #Input.start_joy_vibration(0,0,1,3) + Global.result[3] += attack * crit if Global.debug: if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > (attack * crit): Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack * crit @@ -47,6 +48,7 @@ func _on_body_entered(body): else: Global.cstats[Global.party[Global.cpchar][0]][0] = 0 else: + Global.result[3] += attack #Input.start_joy_vibration(0,1,0,2) if Global.debug: if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > attack: diff --git a/sprites/common/bullet/arrow.gd b/sprites/common/bullet/arrow.gd index 9746e65..027ba9b 100644 --- a/sprites/common/bullet/arrow.gd +++ b/sprites/common/bullet/arrow.gd @@ -36,7 +36,7 @@ func _on_body_entered(body): if !body.is_in_group(btype): if body.is_in_group("players") && Global.dificulty != 1: if body.weakness == speciality: - print("weakness") + Global.result[3] += attack * crit #Input.start_joy_vibration(0,0,1,3) if Global.debug: if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > (attack * crit): @@ -49,6 +49,7 @@ func _on_body_entered(body): else: Global.cstats[Global.party[Global.cpchar][0]][0] = 0 else: + Global.result[3] += attack #Input.start_joy_vibration(0,1,0,2) if Global.debug: if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > attack: diff --git a/sprites/common/bullet/fireball.gd b/sprites/common/bullet/fireball.gd index 3348da6..2363cb4 100644 --- a/sprites/common/bullet/fireball.gd +++ b/sprites/common/bullet/fireball.gd @@ -31,6 +31,7 @@ func _on_body_entered(body): if body.is_in_group("players") && Global.dificulty != 1: if body.weakness == 3: print("weakness") + Global.result[3] += attack * crit #Input.start_joy_vibration(0,0,1,3) if Global.debug: if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > (attack * crit): @@ -43,6 +44,7 @@ func _on_body_entered(body): else: Global.cstats[Global.party[Global.cpchar][0]][0] = 0 else: + Global.result[3] += attack #Input.start_joy_vibration(0,1,0,2) if Global.debug: if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > attack: diff --git a/sprites/common/bullet/snowflake.gd b/sprites/common/bullet/snowflake.gd index 53c6485..bfcfdc4 100644 --- a/sprites/common/bullet/snowflake.gd +++ b/sprites/common/bullet/snowflake.gd @@ -30,6 +30,7 @@ func _on_body_entered(body): if !body.is_in_group(btype) && Global.live == 1: if body.is_in_group("players") && Global.dificulty != 1: if body.weakness == 0: + Global.result[3] += attack * crit print("weakness") #Input.start_joy_vibration(0,0,1,3) if Global.debug: @@ -43,6 +44,7 @@ func _on_body_entered(body): else: Global.cstats[Global.party[Global.cpchar][0]][0] = 0 else: + Global.result[3] += attack #Input.start_joy_vibration(0,1,0,2) if Global.debug: if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > attack: diff --git a/sprites/common/bullet/tnt.gd b/sprites/common/bullet/tnt.gd index de21122..084a705 100644 --- a/sprites/common/bullet/tnt.gd +++ b/sprites/common/bullet/tnt.gd @@ -31,6 +31,7 @@ func _on_body_entered(body): if body.is_in_group("players") && Global.dificulty != 1: if body.weakness == 1: print("weakness") + Global.result[3] += attack * crit #Input.start_joy_vibration(0,0,1,3) if Global.debug: if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > (attack * crit): @@ -43,6 +44,7 @@ func _on_body_entered(body): else: Global.cstats[Global.party[Global.cpchar][0]][0] = 0 else: + Global.result[3] += attack #Input.start_joy_vibration(0,1,0,2) if Global.debug: if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > attack: