From c207a8be651b9e326fc139599d0c4d0b344a5213 Mon Sep 17 00:00:00 2001 From: Page Asgardius Date: Sun, 19 May 2024 12:12:02 -0700 Subject: [PATCH] test level --- levels/ui/Cutscenes.gd | 20 +++++++++++++++++ levels/ui/debug.gd | 7 ++++++ levels/ui/newgame.gd | 24 ++++++++++++++++++--- levels/ui/tmenu.gd | 7 +++--- sprites/common/bullet/X11.gd | 33 +++++++++++++++++++++++------ sprites/common/bullet/arrow.gd | 29 +++++++++++++++++++------ sprites/common/bullet/fireball.gd | 29 +++++++++++++++++++------ sprites/common/bullet/snowflake.gd | 27 +++++++++++++++++------ sprites/common/kimberly/kimberly.gd | 1 + sprites/common/player/player.gd | 16 +++++++------- 10 files changed, 152 insertions(+), 41 deletions(-) diff --git a/levels/ui/Cutscenes.gd b/levels/ui/Cutscenes.gd index 6752c05..ce1ed6a 100644 --- a/levels/ui/Cutscenes.gd +++ b/levels/ui/Cutscenes.gd @@ -55,6 +55,26 @@ func _input(event): get_tree().change_scene_to_file("res://levels/ui/scene.tscn") else: get_tree().change_scene_to_file("res://title.tscn") + if Input.is_action_just_pressed("ui_accept"): + if Global.cutscenes[Global.ccutscene][3]: + get_tree().root.remove_child(bhud) + get_tree().root.remove_child(level) + bgsound.stop() + if Global.debug: + get_tree().change_scene_to_file("res://levels/ui/scene.tscn") + else: + get_tree().change_scene_to_file(Global.cutscenes[Global.ccutscene][1]) + else: + Global.ccutscene += 1 + get_tree().root.remove_child(level) + level = load(Global.cutscenes[Global.ccutscene][0]).instantiate() + if musictrack != Global.cutscenes[Global.ccutscene][2]: + bgsound.stop() + musictrack = Global.cutscenes[Global.ccutscene][2] + music = load(musictrack) + bgsound.stream = music + bgsound.play(0) + get_tree().root.add_child.call_deferred(level) #if (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_UP)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_UP))): # if Global.debug: # if Global.dparty[0][0] != null: diff --git a/levels/ui/debug.gd b/levels/ui/debug.gd index 45e0dc9..37fd917 100644 --- a/levels/ui/debug.gd +++ b/levels/ui/debug.gd @@ -1,5 +1,6 @@ extends Control func _ready(): + _statrebase() Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN) Global.debug = true $"VBoxContainer/Gamepad Test".grab_focus() @@ -55,3 +56,9 @@ func _on_back_pressed(): func _on_gamepad_test_pressed(): get_tree().change_scene_to_file("res://levels/ui/gamepadtest.tscn") + +func _statrebase(): + for i in 4: + if Global.dparty[i][0] != null: + for j in 7: + Global.dstats[Global.dparty[i][0]][j] = Global.basestats[Global.dparty[i][0]][j] * Global.dlevel[Global.dparty[i][0]] diff --git a/levels/ui/newgame.gd b/levels/ui/newgame.gd index 5585178..bed714e 100644 --- a/levels/ui/newgame.gd +++ b/levels/ui/newgame.gd @@ -46,17 +46,28 @@ func _on_exit_pressed(): func _on_noob_pressed(): + _statrebase() Global.dificulty = 1 Global.cplace = [1, 11, 19] Global.live = 1 Global.cpchar = 0 Global.party = [[0,0], [null,null], [null,null], [null,null]] - get_tree().change_scene_to_file("res://levels/ui/gameplay.tscn") - pass # Replace with function body. + Global.ccutscene = 0 + get_tree().change_scene_to_file("res://levels/ui/Cutscenes.tscn") + #pass # Replace with function body. func _on_thisfirst_pressed(): - pass # Replace with function body. + _statrebase() + Global.dificulty = 2 + Global.cplace = [1, 11, 19] + Global.live = 1 + Global.cpchar = 0 + Global.party = [[0,0], [null,null], [null,null], [null,null]] + Global.ccutscene = 0 + get_tree().change_scene_to_file("res://levels/ui/Cutscenes.tscn") + #pass # Replace with function body. + func _on_challenge_pressed(): @@ -65,3 +76,10 @@ func _on_challenge_pressed(): func _on_maniac_pressed(): pass # Replace with function body. + + +func _statrebase(): + for i in 4: + if Global.party[i][0] != null: + for j in 7: + Global.cstats[Global.party[i][0]][j] = Global.basestats[Global.party[i][0]][j] * Global.level[Global.dparty[i][0]] diff --git a/levels/ui/tmenu.gd b/levels/ui/tmenu.gd index acabf13..bfd1ded 100644 --- a/levels/ui/tmenu.gd +++ b/levels/ui/tmenu.gd @@ -26,9 +26,9 @@ func _level(): func _input(event): if Input.is_action_just_pressed("ui_cancel"): get_tree().change_scene_to_file("res://title.tscn") - # Mouse in viewport coordinates. +# Mouse in viewport coordinates. # if Input.is_key_pressed(KEY_ENTER) || Input.is_joy_button_pressed(0,JOY_BUTTON_B): - #print("Mouse Click/Unclick at: ", event.position) +# print("Mouse Click/Unclick at: ", event.position) # if highlighted == 1: # _on_debug_pressed() # if highlighted == 2: @@ -40,7 +40,8 @@ func _input(event): func _on_start_pressed(): - _level() + get_tree().change_scene_to_file("res://levels/ui/newgame.tscn") + #_level() #pass # Replace with function body. diff --git a/sprites/common/bullet/X11.gd b/sprites/common/bullet/X11.gd index 4f7cf33..8bac55d 100644 --- a/sprites/common/bullet/X11.gd +++ b/sprites/common/bullet/X11.gd @@ -20,28 +20,47 @@ func _process(delta): func _physics_process(delta): pass -func _on_body_entered(body):if !body.is_in_group(btype): - if body.is_in_group("players") || body.is_in_group("boss") || body.is_in_group("enemies"): +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 == speciality: print("weakness") Input.start_joy_vibration(0,0,1,3) if Global.debug: - Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack * crit + if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > (attack * crit): + Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack * crit + else: + Global.dstats[Global.dparty[Global.dcpchar][0]][0] = 0 else: - Global.dstats[Global.party[Global.cpchar][0]][0] -= attack * crit + if Global.cstats[Global.party[Global.cpchar][0]][0] > (attack * crit): + Global.cstats[Global.party[Global.cpchar][0]][0] -= attack * crit + else: + Global.cstats[Global.party[Global.cpchar][0]][0] = 0 else: Input.start_joy_vibration(0,1,0,2) if Global.debug: - Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack + if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > attack: + Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack + else: + Global.dstats[Global.dparty[Global.dcpchar][0]][0] = 0 else: - Global.dstats[Global.party[Global.cpchar][0]][0] -= attack + if Global.cstats[Global.party[Global.cpchar][0]][0] > attack: + Global.cstats[Global.party[Global.cpchar][0]][0] -= attack + else: + Global.cstats[Global.party[Global.cpchar][0]][0] = 0 + elif body.is_in_group("boss") && Global.dificulty != 1: + if body.weakness == 0: + print("weakness") + elif body.is_in_group("enemies") && Global.dificulty != 1: + if body.weakness == 0: + print("weakness") #if body.is_in_group("players"): # Global.live = 2 #elif body.is_in_group("enemies"): # Global.live = 3 #elif body.is_in_group("boss"): # Global.live = 3 - #queue_free() + queue_free() diff --git a/sprites/common/bullet/arrow.gd b/sprites/common/bullet/arrow.gd index 13382ec..dc8d439 100644 --- a/sprites/common/bullet/arrow.gd +++ b/sprites/common/bullet/arrow.gd @@ -34,22 +34,37 @@ func _physics_process(delta): func _on_body_entered(body): if !body.is_in_group(btype): - if body.is_in_group("players"): + if body.is_in_group("players") && Global.dificulty != 1: if body.weakness == speciality: print("weakness") Input.start_joy_vibration(0,0,1,3) if Global.debug: - Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack * crit + if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > (attack * crit): + Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack * crit + else: + Global.dstats[Global.dparty[Global.dcpchar][0]][0] = 0 else: - Global.dstats[Global.party[Global.cpchar][0]][0] -= attack * crit + if Global.cstats[Global.party[Global.cpchar][0]][0] > (attack * crit): + Global.cstats[Global.party[Global.cpchar][0]][0] -= attack * crit + else: + Global.cstats[Global.party[Global.cpchar][0]][0] = 0 else: Input.start_joy_vibration(0,1,0,2) if Global.debug: - Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack + if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > attack: + Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack + else: + Global.dstats[Global.dparty[Global.dcpchar][0]][0] = 0 else: - Global.dstats[Global.party[Global.cpchar][0]][0] -= attack - elif body.is_in_group("boss") || body.is_in_group("enemies"): - if body.weakness == speciality: + if Global.cstats[Global.party[Global.cpchar][0]][0] > attack: + Global.cstats[Global.party[Global.cpchar][0]][0] -= attack + else: + Global.cstats[Global.party[Global.cpchar][0]][0] = 0 + elif body.is_in_group("boss") && Global.dificulty != 1: + if body.weakness == 0: + print("weakness") + elif body.is_in_group("enemies") && Global.dificulty != 1: + if body.weakness == 0: print("weakness") #if body.is_in_group("players"): # Global.live = 2 diff --git a/sprites/common/bullet/fireball.gd b/sprites/common/bullet/fireball.gd index ca20ebe..17f6346 100644 --- a/sprites/common/bullet/fireball.gd +++ b/sprites/common/bullet/fireball.gd @@ -27,22 +27,37 @@ func _physics_process(delta): func _on_body_entered(body): if !body.is_in_group(btype): - if body.is_in_group("players"): + if body.is_in_group("players") && Global.dificulty != 1: if body.weakness == 3: print("weakness") Input.start_joy_vibration(0,0,1,3) if Global.debug: - Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack * crit + if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > (attack * crit): + Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack * crit + else: + Global.dstats[Global.dparty[Global.dcpchar][0]][0] = 0 else: - Global.dstats[Global.party[Global.cpchar][0]][0] -= attack * crit + if Global.cstats[Global.party[Global.cpchar][0]][0] > (attack * crit): + Global.cstats[Global.party[Global.cpchar][0]][0] -= attack * crit + else: + Global.cstats[Global.party[Global.cpchar][0]][0] = 0 else: Input.start_joy_vibration(0,1,0,2) if Global.debug: - Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack + if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > attack: + Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack + else: + Global.dstats[Global.dparty[Global.dcpchar][0]][0] = 0 else: - Global.dstats[Global.party[Global.cpchar][0]][0] -= attack - elif body.is_in_group("boss") || body.is_in_group("enemies"): - if body.weakness == 3: + if Global.cstats[Global.party[Global.cpchar][0]][0] > attack: + Global.cstats[Global.party[Global.cpchar][0]][0] -= attack + else: + Global.cstats[Global.party[Global.cpchar][0]][0] = 0 + elif body.is_in_group("boss") && Global.dificulty != 1: + if body.weakness == 0: + print("weakness") + elif body.is_in_group("enemies") && Global.dificulty != 1: + if body.weakness == 0: print("weakness") #if body.is_in_group("players"): # Global.live = 2 diff --git a/sprites/common/bullet/snowflake.gd b/sprites/common/bullet/snowflake.gd index f88333c..5425e71 100644 --- a/sprites/common/bullet/snowflake.gd +++ b/sprites/common/bullet/snowflake.gd @@ -27,21 +27,36 @@ func _physics_process(delta): func _on_body_entered(body): if !body.is_in_group(btype) && Global.live == 1: - if body.is_in_group("players"): + if body.is_in_group("players") && Global.dificulty != 1: if body.weakness == 0: print("weakness") Input.start_joy_vibration(0,0,1,3) if Global.debug: - Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack * crit + if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > (attack * crit): + Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack * crit + else: + Global.dstats[Global.dparty[Global.dcpchar][0]][0] = 0 else: - Global.dstats[Global.party[Global.cpchar][0]][0] -= attack * crit + if Global.cstats[Global.party[Global.cpchar][0]][0] > (attack * crit): + Global.cstats[Global.party[Global.cpchar][0]][0] -= attack * crit + else: + Global.cstats[Global.party[Global.cpchar][0]][0] = 0 else: Input.start_joy_vibration(0,1,0,2) if Global.debug: - Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack + if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > attack: + Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack + else: + Global.dstats[Global.dparty[Global.dcpchar][0]][0] = 0 else: - Global.dstats[Global.party[Global.cpchar][0]][0] -= attack - elif body.is_in_group("boss") || body.is_in_group("enemies"): + if Global.cstats[Global.party[Global.cpchar][0]][0] > attack: + Global.cstats[Global.party[Global.cpchar][0]][0] -= attack + else: + Global.cstats[Global.party[Global.cpchar][0]][0] = 0 + elif body.is_in_group("boss") && Global.dificulty != 1: + if body.weakness == 0: + print("weakness") + elif body.is_in_group("enemies") && Global.dificulty != 1: if body.weakness == 0: print("weakness") #if body.is_in_group("players"): diff --git a/sprites/common/kimberly/kimberly.gd b/sprites/common/kimberly/kimberly.gd index 687c54f..f21024f 100644 --- a/sprites/common/kimberly/kimberly.gd +++ b/sprites/common/kimberly/kimberly.gd @@ -15,6 +15,7 @@ var attack = 59 var crit = 5 + func _ready(): if Global.isboss: Global.cboss = ["Kimberly Arch",0,0] diff --git a/sprites/common/player/player.gd b/sprites/common/player/player.gd index 77ce5ef..73e6a9f 100644 --- a/sprites/common/player/player.gd +++ b/sprites/common/player/player.gd @@ -85,22 +85,22 @@ func _input(event): func _charinit(): if Global.debug: - speed = Global.basestats[Global.dparty[Global.dcpchar][0]][6] + speed = Global.mstats[Global.dparty[Global.dcpchar][0]][6] #print(Global.dparty[Global.dcpchar][0]) #print(speed) else: - speed = Global.basestats[Global.party[Global.cpchar][0]][6] + speed = Global.mstats[Global.party[Global.cpchar][0]][6] #print(Global.dparty[Global.cpchar][0]) #print(speed) _charswitch() func _charswitch(): if Global.debug: - if csprite != null && speed!=Global.basestats[Global.dparty[csprite][0]][6]: + if csprite != null && speed!=Global.mstats[Global.dparty[csprite][0]][6]: print("Script Kiddie") - speed = Global.dparty/800 + speed = Global.dparty/0 else: - speed = Global.basestats[Global.dparty[Global.dcpchar][0]][6] + speed = Global.mstats[Global.dparty[Global.dcpchar][0]][6] if Global.dcpchar != csprite: csprite = Global.dcpchar sprite.texture = load(Global.pchars[Global.dparty[Global.dcpchar][0]][Global.dparty[Global.dcpchar][1]]) @@ -108,11 +108,11 @@ func _charswitch(): print(Global.dparty[Global.dcpchar][0]) print(speed) else: - if csprite != null && speed!=Global.basestats[Global.party[Global.cpchar][0]][6]: + if csprite != null && speed!=Global.mstats[Global.party[Global.cpchar][0]][6]: print("Script Kiddie") - speed = Global.party/800 + speed = Global.party/0 else: - speed = Global.basestats[Global.party[Global.dcpchar][0]][6] + speed = Global.mstats[Global.party[Global.dcpchar][0]][6] if Global.cpchar != csprite: csprite = Global.cpchar sprite.texture = load(Global.pchars[Global.party[Global.cpchar][0]][Global.party[Global.cpchar][1]])