diff --git a/levels/Ceres/L20.gd b/levels/Ceres/L20.gd index 7e40e10..40f6337 100644 --- a/levels/Ceres/L20.gd +++ b/levels/Ceres/L20.gd @@ -26,6 +26,7 @@ func _physics_process(delta): print("move down") func _input(event): - if Global.cdialog.size() == 0: + if Global.cdialog.size() != 0 && Global.live == 1: get_tree().root.remove_child(talk) + Global.cdialog = [] diff --git a/levels/Testrooms/bullethell.gd b/levels/Testrooms/bullethell.gd index dee8ab3..38faeed 100644 --- a/levels/Testrooms/bullethell.gd +++ b/levels/Testrooms/bullethell.gd @@ -26,6 +26,7 @@ func _physics_process(delta): print("move down") func _input(event): - if Global.cdialog.size() == 0: + if Global.cdialog.size() != 0 && Global.live == 1: get_tree().root.remove_child(talk) + Global.cdialog = [] diff --git a/levels/Testrooms/dialogtest.gd b/levels/Testrooms/dialogtest.gd index 743eafd..df1b60e 100644 --- a/levels/Testrooms/dialogtest.gd +++ b/levels/Testrooms/dialogtest.gd @@ -12,5 +12,6 @@ func _process(delta): pass func _input(event): - if Global.cdialog.size() == 0: + if Global.cdialog.size() != 0 && Global.live == 1: get_tree().root.remove_child(talk) + Global.cdialog = [] diff --git a/levels/ui/gameplay.gd b/levels/ui/gameplay.gd index 1cd4203..28e6d88 100644 --- a/levels/ui/gameplay.gd +++ b/levels/ui/gameplay.gd @@ -132,6 +132,7 @@ func _pausemenu(): get_tree().root.remove_child(pmenu) get_tree().root.add_child.call_deferred(bhud) ispaused = false + pmenu = load("res://levels/ui/pause.tscn").instantiate() Global.live = 1 func _exit(): Global.exitgame = false diff --git a/levels/ui/pause.gd b/levels/ui/pause.gd index 3e83a85..4a80d36 100644 --- a/levels/ui/pause.gd +++ b/levels/ui/pause.gd @@ -10,8 +10,8 @@ func _ready(): cnf = $CanvasLayer/HBoxContainer/VBoxContainer/Cname chealthf = $CanvasLayer/HBoxContainer/VBoxContainer/HBoxContainer/Label2 clevel = $CanvasLayer/HBoxContainer/VBoxContainer/HBoxContainer2/Label2 - _fetchdata() $CanvasLayer/HBoxContainer2/VBoxContainer2/Exit.grab_focus() + _fetchdata() #pass # Replace with function body. diff --git a/levels/ui/talk.gd b/levels/ui/talk.gd index 6d59768..472170a 100644 --- a/levels/ui/talk.gd +++ b/levels/ui/talk.gd @@ -45,5 +45,4 @@ func _input(event): if isboss: Global.bossready = true Global.live = 1 - Global.cdialog = [] press = false diff --git a/sprites/common/bullet/X11.gd b/sprites/common/bullet/X11.gd index 8bac55d..bf516ab 100644 --- a/sprites/common/bullet/X11.gd +++ b/sprites/common/bullet/X11.gd @@ -25,7 +25,7 @@ func _on_body_entered(body): if body.is_in_group("players") && Global.dificulty != 1: if body.weakness == speciality: print("weakness") - Input.start_joy_vibration(0,0,1,3) + #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 @@ -37,7 +37,7 @@ func _on_body_entered(body): else: Global.cstats[Global.party[Global.cpchar][0]][0] = 0 else: - Input.start_joy_vibration(0,1,0,2) + #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 @@ -49,10 +49,19 @@ func _on_body_entered(body): else: Global.cstats[Global.party[Global.cpchar][0]][0] = 0 elif body.is_in_group("boss") && Global.dificulty != 1: - if body.weakness == 0: + if body.weakness == speciality: print("weakness") + if Global.cboss[1] > (attack * crit): + Global.cboss[1] -= attack * crit + else: + Global.cboss[1] = 0 + else: + if Global.cboss[1] > (attack): + Global.cboss[1] -= attack + else: + Global.cboss[1] = 0 elif body.is_in_group("enemies") && Global.dificulty != 1: - if body.weakness == 0: + if body.weakness == speciality: print("weakness") #if body.is_in_group("players"): # Global.live = 2 diff --git a/sprites/common/bullet/arrow.gd b/sprites/common/bullet/arrow.gd index 58876a8..9746e65 100644 --- a/sprites/common/bullet/arrow.gd +++ b/sprites/common/bullet/arrow.gd @@ -37,7 +37,7 @@ func _on_body_entered(body): if body.is_in_group("players") && Global.dificulty != 1: if body.weakness == speciality: print("weakness") - Input.start_joy_vibration(0,0,1,3) + #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 @@ -49,7 +49,7 @@ func _on_body_entered(body): else: Global.cstats[Global.party[Global.cpchar][0]][0] = 0 else: - Input.start_joy_vibration(0,1,0,2) + #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 @@ -61,10 +61,19 @@ func _on_body_entered(body): else: Global.cstats[Global.party[Global.cpchar][0]][0] = 0 elif body.is_in_group("boss") && Global.dificulty != 1: - if body.weakness == 0: + if body.weakness == speciality: print("weakness") + if Global.cboss[1] >= (attack * crit): + Global.cboss[1] -= attack * crit + else: + Global.cboss[1] = 0 + else: + if Global.cboss[1] >= (attack): + Global.cboss[1] -= attack + else: + Global.cboss[1] = 0 elif body.is_in_group("enemies") && Global.dificulty != 1: - if body.weakness == 0: + if body.weakness == speciality: 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 9bc471b..3348da6 100644 --- a/sprites/common/bullet/fireball.gd +++ b/sprites/common/bullet/fireball.gd @@ -2,6 +2,7 @@ extends Area2D var velocity: Vector2 = Vector2() var direction var speed = 100 +var speciality var btype var isvisible var attack @@ -30,7 +31,7 @@ func _on_body_entered(body): if body.is_in_group("players") && Global.dificulty != 1: if body.weakness == 3: print("weakness") - Input.start_joy_vibration(0,0,1,3) + #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 @@ -42,7 +43,7 @@ func _on_body_entered(body): else: Global.cstats[Global.party[Global.cpchar][0]][0] = 0 else: - Input.start_joy_vibration(0,1,0,2) + #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 @@ -53,11 +54,20 @@ func _on_body_entered(body): 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: + elif body.is_in_group("boss") && Global.dificulty != 1 && Global.cboss[1] != null: + if body.weakness == 3: print("weakness") + if Global.cboss[1] >= (attack * crit): + Global.cboss[1] -= attack * crit + else: + Global.cboss[1] = 0 + else: + if Global.cboss[1] >= (attack): + Global.cboss[1] -= attack + else: + Global.cboss[1] = 0 elif body.is_in_group("enemies") && Global.dificulty != 1: - if body.weakness == 0: + if body.weakness == 3: 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 661d1ae..53c6485 100644 --- a/sprites/common/bullet/snowflake.gd +++ b/sprites/common/bullet/snowflake.gd @@ -4,6 +4,7 @@ var direction var speed = 100 var btype var isvisible +var speciality var attack var crit # Called when the node enters the scene tree for the first time. @@ -30,7 +31,7 @@ func _on_body_entered(body): if body.is_in_group("players") && Global.dificulty != 1: if body.weakness == 0: print("weakness") - Input.start_joy_vibration(0,0,1,3) + #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 @@ -42,7 +43,7 @@ func _on_body_entered(body): else: Global.cstats[Global.party[Global.cpchar][0]][0] = 0 else: - Input.start_joy_vibration(0,1,0,2) + #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 @@ -56,6 +57,15 @@ func _on_body_entered(body): elif body.is_in_group("boss") && Global.dificulty != 1: if body.weakness == 0: print("weakness") + if Global.cboss[1] >= (attack * crit): + Global.cboss[1] -= attack * crit + else: + Global.cboss[1] = 0 + else: + if Global.cboss[1] >= (attack): + Global.cboss[1] -= attack + else: + Global.cboss[1] = 0 elif body.is_in_group("enemies") && Global.dificulty != 1: if body.weakness == 0: print("weakness") diff --git a/sprites/common/kimberly/kimberly.gd b/sprites/common/kimberly/kimberly.gd index f21024f..72f3f62 100644 --- a/sprites/common/kimberly/kimberly.gd +++ b/sprites/common/kimberly/kimberly.gd @@ -93,6 +93,7 @@ func shoot(angle): new_bullet.btype = "boss" new_bullet.attack = attack new_bullet.crit = crit + new_bullet.speciality = 3 get_parent().call_deferred("add_child",new_bullet) diff --git a/sprites/common/player/player.gd b/sprites/common/player/player.gd index be0c628..661f77e 100644 --- a/sprites/common/player/player.gd +++ b/sprites/common/player/player.gd @@ -8,10 +8,13 @@ var sprite var anim var speed var csprite +var attack +var crit var bpress = false # Get the gravity from the project settings to be synced with RigidBody nodes. var gravity = ProjectSettings.get_setting("physics/2d/default_gravity") var weakness +var speciality func _ready(): add_to_group("players") @@ -72,6 +75,9 @@ func _input(event): bullet = load(Global.pbbullets[Global.party[Global.cpchar][0]]) var new_pbullet = bullet.instantiate() new_pbullet.btype = "players" + new_pbullet.attack = attack + new_pbullet.crit = crit + new_pbullet.speciality = speciality new_pbullet.velocity = Vector2(0, -speed).rotated(deg_to_rad(angle * 90)) var rposition = Vector2(0, -96).rotated(deg_to_rad(angle * 90)) if angle == 2: @@ -86,10 +92,14 @@ func _input(event): func _charinit(): if Global.debug: speed = Global.mstats[Global.dparty[Global.dcpchar][0]][6] + attack = Global.mstats[Global.dparty[Global.dcpchar][0]][2] + crit = Global.mstats[Global.dparty[Global.dcpchar][0]][3] #print(Global.dparty[Global.dcpchar][0]) #print(speed) else: speed = Global.mstats[Global.party[Global.cpchar][0]][6] + attack = Global.mstats[Global.party[Global.cpchar][0]][2] + crit = Global.mstats[Global.party[Global.cpchar][0]][3] #print(Global.dparty[Global.cpchar][0]) #print(speed) _charswitch() @@ -105,6 +115,7 @@ func _charswitch(): csprite = Global.dcpchar sprite.texture = load(Global.pchars[Global.dparty[Global.dcpchar][0]][Global.dparty[Global.dcpchar][1]]) weakness = Global.specialities[Global.pcspecialities[Global.dparty[Global.dcpchar][0]]] + speciality = Global.pcspecialities[Global.dparty[Global.dcpchar][0]] print(Global.dparty[Global.dcpchar][0]) print(speed) else: @@ -117,3 +128,4 @@ func _charswitch(): csprite = Global.cpchar sprite.texture = load(Global.pchars[Global.party[Global.cpchar][0]][Global.party[Global.cpchar][1]]) weakness = Global.specialities[Global.pcspecialities[Global.party[Global.cpchar][0]]] + speciality = Global.pcspecialities[Global.party[Global.cpchar][0]]