test level

This commit is contained in:
Page Asgardius 2024-05-19 12:12:02 -07:00
parent dc061b2dea
commit c207a8be65
10 changed files with 152 additions and 41 deletions

View file

@ -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:

View file

@ -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]]

View file

@ -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]]

View file

@ -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.

View file

@ -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:
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.party[Global.cpchar][0]][0] -= attack * crit
Global.dstats[Global.dparty[Global.dcpchar][0]][0] = 0
else:
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:
if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > attack:
Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack
else:
Global.dstats[Global.party[Global.cpchar][0]][0] -= attack
Global.dstats[Global.dparty[Global.dcpchar][0]][0] = 0
else:
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()

View file

@ -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:
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.party[Global.cpchar][0]][0] -= attack * crit
Global.dstats[Global.dparty[Global.dcpchar][0]][0] = 0
else:
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:
if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > attack:
Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack
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:
Global.dstats[Global.dparty[Global.dcpchar][0]][0] = 0
else:
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

View file

@ -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:
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.party[Global.cpchar][0]][0] -= attack * crit
Global.dstats[Global.dparty[Global.dcpchar][0]][0] = 0
else:
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:
if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > attack:
Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack
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:
Global.dstats[Global.dparty[Global.dcpchar][0]][0] = 0
else:
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

View file

@ -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:
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.party[Global.cpchar][0]][0] -= attack * crit
Global.dstats[Global.dparty[Global.dcpchar][0]][0] = 0
else:
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:
if Global.dstats[Global.dparty[Global.dcpchar][0]][0] > attack:
Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack
else:
Global.dstats[Global.party[Global.cpchar][0]][0] -= attack
elif body.is_in_group("boss") || body.is_in_group("enemies"):
Global.dstats[Global.dparty[Global.dcpchar][0]][0] = 0
else:
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"):

View file

@ -15,6 +15,7 @@ var attack = 59
var crit = 5
func _ready():
if Global.isboss:
Global.cboss = ["Kimberly Arch",0,0]

View file

@ -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]])