diff --git a/global.gd b/global.gd index 0f29c6e..5b7aea5 100644 --- a/global.gd +++ b/global.gd @@ -10,15 +10,18 @@ var bossready = false const pcnames = ["Midori Asgardius", null, null, null, null, null, null, null, null, "Natasha Dostoyevsky"] const npcnames = ["Lily", null, null, null, null, null, null, null, null, "Natasha Dostoyevsky"] const pcfaces = ["res://sprites/common/midori/face.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/face.png"] +const hudfaces = ["res://sprites/common/midori/facehud.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/facehud.png"] const npcfaces = ["res://sprites/common/midori/face.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/face.png"] var cdialog = [] const places = [[[[null, null, false], [null, null, false]], [["res://levels/Testrooms/bullethell.tscn", 11, true], ["res://levels/Testrooms/lilytest.tscn", 20, true]], [["res://levels/Testrooms/dialogtest.tscn", 19, false], ["res://levels/Testrooms/testspawn.tscn", 2 ,false]]]] var cplace = [0,2,1] var dplace = [null, null, null] -const pbbullets = ["res://sprites/common/bullet/fireball.tscn", null, null, null, null, null, null, null, null, "res://sprites/common/bullet/fireball.tscn"] +const pbbullets = ["res://sprites/common/bullet/fireball.tscn", null, null, null, null, null, null, null, null, "res://sprites/common/bullet/snowflake.tscn"] +const pcspecialities = [1, null, null, null, null, null, null, null, null, 0] const pchars = ["res://sprites/common/midori/sprite.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/sprite.png"] const npchars = ["res://sprites/common/midori/sprite.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/sprite.png"] -var party = [null, null, null, null] +var party = [9, 0, null, null] +const specialities = [2, 0, 3, 1, 5, 4] var dparty = [0, 9, null, null] var cpchar = 0 var dcpchar = 0 diff --git a/levels/Testrooms/lilytest.gd b/levels/Testrooms/lilytest.gd new file mode 100644 index 0000000..b8abcab --- /dev/null +++ b/levels/Testrooms/lilytest.gd @@ -0,0 +1,12 @@ +extends Node2D +var boss + +# Called when the node enters the scene tree for the first time. +func _ready(): + boss = $Lily + boss.add_to_group("boss") + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass diff --git a/levels/Testrooms/lilytest.tscn b/levels/Testrooms/lilytest.tscn index eb31164..dd01e16 100644 --- a/levels/Testrooms/lilytest.tscn +++ b/levels/Testrooms/lilytest.tscn @@ -1,5 +1,6 @@ -[gd_scene load_steps=6 format=3 uid="uid://cma7ddp0r4rm"] +[gd_scene load_steps=7 format=3 uid="uid://cma7ddp0r4rm"] +[ext_resource type="Script" path="res://levels/Testrooms/lilytest.gd" id="1_b1yf3"] [ext_resource type="Texture2D" uid="uid://dursxelwwxe8u" path="res://sprites/common/placeholder/player.png" id="1_bch3a"] [ext_resource type="PackedScene" uid="uid://b216q83uw4c45" path="res://sprites/common/midori/lily.tscn" id="2_v1fc7"] [ext_resource type="PackedScene" uid="uid://cehe6sm8ly06u" path="res://sprites/common/player/player.tscn" id="3_h02gt"] @@ -11,6 +12,7 @@ size = Vector2(20, 761) size = Vector2(1283, 20) [node name="Lilytest" type="Node2D"] +script = ExtResource("1_b1yf3") [node name="TextureRect" type="TextureRect" parent="."] offset_left = 583.0 diff --git a/levels/ui/gameplay.gd b/levels/ui/gameplay.gd index 838e671..0ac4b90 100644 --- a/levels/ui/gameplay.gd +++ b/levels/ui/gameplay.gd @@ -7,6 +7,8 @@ var sfx1 := AudioStreamPlayer.new() var musictrack var isboss var bhud = load("res://levels/bottomhud.tscn").instantiate() +var thud = load("res://levels/ui/tophud.tscn").instantiate() +var ishud = true # Called when the node enters the scene tree for the first time. func _ready(): @@ -34,6 +36,7 @@ func _ready(): music = load(musictrack) get_tree().root.add_child.call_deferred(level) get_tree().root.add_child.call_deferred(bhud) + get_tree().root.add_child.call_deferred(thud) #get_tree().root.add_child.call_deferred(player) bgsound.stream = music if !isboss: @@ -65,6 +68,7 @@ func _input(event): if Input.is_key_pressed(KEY_ESCAPE) || Input.is_joy_button_pressed(0,JOY_BUTTON_BACK): Global.live = 0 Global.bossready = false + get_tree().root.remove_child(thud) get_tree().root.remove_child(bhud) get_tree().root.remove_child(player) get_tree().root.remove_child(level) @@ -72,28 +76,28 @@ 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_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.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] != null: Global.dcpchar = 0 else: if Global.party[0] != null: Global.cpchar = 0 - elif (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_RIGHT)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_RIGHT)): + elif (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_RIGHT)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_RIGHT))): if Global.debug: if Global.dparty[1] != null: Global.dcpchar = 1 else: if Global.party[1] != null: Global.cpchar = 1 - elif (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_DOWN)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_DOWN)): + elif (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_DOWN)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_DOWN))): if Global.debug: if Global.dparty[2] != null: Global.dcpchar = 2 else: if Global.party[2] != null: Global.cpchar = 2 - elif (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_LEFT)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_LEFT)): + elif (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_LEFT)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_LEFT))): if Global.debug: if Global.dparty[3] != null: Global.dcpchar = 3 @@ -105,3 +109,9 @@ func _input(event): sfx1.stream = load(Global.sfxtracks[1]) sfx1.play(0) bgsound.play(0) + if Global.cdialog.size() != 0 && ishud: + get_tree().root.remove_child(thud) + ishud = false + elif Global.cdialog.size() == 0&& !ishud: + get_tree().root.add_child.call_deferred(thud) + ishud = true diff --git a/levels/ui/talk.gd b/levels/ui/talk.gd index b463e36..3d0b5f1 100644 --- a/levels/ui/talk.gd +++ b/levels/ui/talk.gd @@ -12,10 +12,10 @@ func _ready(): pface = $Playerface if Global.cdialog[dindex][1]: cname.set_text(Global.pcnames[Global.cdialog[dindex][2]]) - pface.texture = load((Global.pcfaces[Global.cdialog[dindex][2]])) + pface.texture = load(Global.pcfaces[Global.cdialog[dindex][2]]) else: cname.set_text(Global.npcnames[Global.cdialog[dindex][2]]) - pface.texture = load((Global.npcfaces[Global.cdialog[dindex][2]])) + pface.texture = load(Global.npcfaces[Global.cdialog[dindex][2]]) dialog.set_text(Global.cdialog[dindex][0]) diff --git a/levels/ui/tophud.gd b/levels/ui/tophud.gd new file mode 100644 index 0000000..87ff65e --- /dev/null +++ b/levels/ui/tophud.gd @@ -0,0 +1,134 @@ +extends Control +var topleft +var topleftbg +var cn1 +var cn2 +var cn3 +var cn4 +var cf1 +var cf2 +var cf3 +var cf4 +var focus1 +var focus2 +var focus3 +var focus4 + +# Called when the node enters the scene tree for the first time. +func _ready(): + topleft = $Topleft + topleftbg = $Topleftbg + cn1 = $Topleft/Character1/VBoxContainer/HBoxContainer/Label + cn2 = $Topleft/Character2/VBoxContainer/HBoxContainer/Label + cn3 = $Topleft/Character3/VBoxContainer/HBoxContainer/Label + cn4 = $Topleft/Character4/VBoxContainer/HBoxContainer/Label + cf1 = $Topleft/Character1/TextureRect + cf2 = $Topleft/Character2/TextureRect + cf3 = $Topleft/Character3/TextureRect + cf4 = $Topleft/Character4/TextureRect + focus1 = $Topleft/Character1/ColorRect2 + focus2 = $Topleft/Character2/ColorRect2 + focus3 = $Topleft/Character3/ColorRect2 + focus4 = $Topleft/Character4/ColorRect2 + if Global.mangohud: + topleft.position.y = 244 + topleftbg.position.y = 244 + _charrefresh() + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + +func _input(event): + _charrefresh() +func _charrefresh(): + if Global.debug: + if Global.dparty[0] != null: + cn1.set_text(Global.pcnames[Global.dparty[0]]) + cf1.texture = load(Global.hudfaces[Global.dparty[0]]) + if Global.dcpchar == 0: + focus1.set_color(Color(0, 0, 1, 1)) + else: + focus1.set_color(Color(1, 1, 1, 1)) + else: + cn1.set_text("") + cf1.texture = null + focus1.set_color(Color(1, 1, 1, 1)) + if Global.dparty[1] != null: + cn2.set_text(Global.pcnames[Global.dparty[1]]) + cf2.texture = load(Global.hudfaces[Global.dparty[1]]) + if Global.dcpchar == 1: + focus2.set_color(Color(0, 0, 1, 1)) + else: + focus2.set_color(Color(1, 1, 1, 1)) + else: + cn2.set_text("") + cf2.texture = null + focus2.set_color(Color(1, 1, 1, 1)) + if Global.dparty[2] != null: + cn3.set_text(Global.pcnames[Global.dparty[2]]) + cf3.texture = load(Global.hudfaces[Global.dparty[2]]) + if Global.dcpchar == 2: + focus3.set_color(Color(0, 0, 1, 1)) + else: + focus3.set_color(Color(1, 1, 1, 1)) + else: + cn3.set_text("") + cf3.texture = null + focus3.set_color(Color(1, 1, 1, 1)) + if Global.dparty[3] != null: + cn4.set_text(Global.pcnames[Global.dparty[3]]) + cf4.texture = load(Global.hudfaces[Global.dparty[3]]) + if Global.dcpchar == 3: + focus4.set_color(Color(0, 0, 1, 1)) + else: + focus4.set_color(Color(1, 1, 1, 1)) + else: + cn4.set_text("") + cf4.texture = null + focus4.set_color(Color(1, 1, 1, 1)) + else: + if Global.party[0] != null: + cn1.set_text(Global.pcnames[Global.party[0]]) + cf1.texture = load(Global.hudfaces[Global.party[0]]) + if Global.dcpchar == 0: + focus1.set_color(Color(0, 0, 1, 1)) + else: + focus1.set_color(Color(1, 1, 1, 1)) + else: + cn1.set_text("") + cf1.texture = null + focus1.set_color(Color(1, 1, 1, 1)) + if Global.party[1] != null: + cn2.set_text(Global.pcnames[Global.party[1]]) + cf2.texture = load(Global.hudfaces[Global.party[1]]) + if Global.dcpchar == 1: + focus2.set_color(Color(0, 0, 1, 1)) + else: + focus2.set_color(Color(1, 1, 1, 1)) + else: + cn2.set_text("") + cf2.texture = null + focus2.set_color(Color(1, 1, 1, 1)) + if Global.party[2] != null: + cn3.set_text(Global.pcnames[Global.party[0]]) + cf3.texture = load(Global.hudfaces[Global.party[0]]) + if Global.dcpchar == 2: + focus3.set_color(Color(0, 0, 1, 1)) + else: + focus3.set_color(Color(1, 1, 1, 1)) + else: + cn3.set_text("") + cf3.texture = null + focus3.set_color(Color(1, 1, 1, 1)) + if Global.party[3] != null: + cn4.set_text(Global.pcnames[Global.party[3]]) + cf4.texture = load(Global.hudfaces[Global.party[3]]) + if Global.dcpchar == 3: + focus4.set_color(Color(0, 0, 1, 1)) + else: + focus4.set_color(Color(1, 1, 1, 1)) + else: + cn4.set_text("") + cf4.texture = null + focus4.set_color(Color(1, 1, 1, 1)) diff --git a/levels/ui/tophud.tscn b/levels/ui/tophud.tscn new file mode 100644 index 0000000..9888c8a --- /dev/null +++ b/levels/ui/tophud.tscn @@ -0,0 +1,379 @@ +[gd_scene load_steps=7 format=3 uid="uid://coaup7cuj7qev"] + +[ext_resource type="Script" path="res://levels/ui/tophud.gd" id="1_pntuv"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ualpu"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_patnr"] +bg_color = Color(1, 0, 0, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_05pau"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_u3vj7"] +bg_color = Color(1, 0.498039, 0, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ftyws"] + +[node name="Tophud" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_pntuv") + +[node name="Topleftbg" type="ColorRect" parent="."] +layout_mode = 0 +offset_right = 377.0 +offset_bottom = 476.0 +color = Color(0.254902, 0.254902, 0.254902, 0.788235) + +[node name="Topleft" type="VBoxContainer" parent="."] +layout_mode = 0 +offset_right = 377.0 +offset_bottom = 476.0 + +[node name="Character1" type="HBoxContainer" parent="Topleft"] +layout_mode = 2 + +[node name="TextureRect" type="TextureRect" parent="Topleft/Character1"] +custom_minimum_size = Vector2(116, 116) +layout_mode = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="Topleft/Character1"] +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="Topleft/Character1/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Topleft/Character1/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(174, 0) +layout_mode = 2 +text = "Name" + +[node name="Label3" type="Label" parent="Topleft/Character1/VBoxContainer/HBoxContainer"] +layout_mode = 2 +text = "R1 + ↑" +horizontal_alignment = 2 + +[node name="HBoxContainer2" type="HBoxContainer" parent="Topleft/Character1/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Topleft/Character1/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(70, 0) +layout_mode = 2 +text = "Health" + +[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character1/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +theme_override_styles/background = SubResource("StyleBoxFlat_ualpu") +theme_override_styles/fill = SubResource("StyleBoxFlat_patnr") + +[node name="Label2" type="Label" parent="Topleft/Character1/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(63, 0) +layout_mode = 2 +text = "100/100" +horizontal_alignment = 2 + +[node name="HBoxContainer3" type="HBoxContainer" parent="Topleft/Character1/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Topleft/Character1/VBoxContainer/HBoxContainer3"] +custom_minimum_size = Vector2(70, 0) +layout_mode = 2 +text = "Stamina" + +[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character1/VBoxContainer/HBoxContainer3"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +theme_override_styles/background = SubResource("StyleBoxFlat_05pau") +theme_override_styles/fill = SubResource("StyleBoxFlat_u3vj7") + +[node name="Label2" type="Label" parent="Topleft/Character1/VBoxContainer/HBoxContainer3"] +custom_minimum_size = Vector2(63, 0) +layout_mode = 2 +text = "100/100" +horizontal_alignment = 2 + +[node name="HBoxContainer4" type="HBoxContainer" parent="Topleft/Character1/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Topleft/Character1/VBoxContainer/HBoxContainer4"] +custom_minimum_size = Vector2(70, 0) +layout_mode = 2 +text = "Skill" + +[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character1/VBoxContainer/HBoxContainer4"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +theme_override_styles/background = SubResource("StyleBoxFlat_ftyws") + +[node name="Label2" type="Label" parent="Topleft/Character1/VBoxContainer/HBoxContainer4"] +custom_minimum_size = Vector2(63, 0) +layout_mode = 2 +text = "100/100" +horizontal_alignment = 2 + +[node name="ColorRect2" type="ColorRect" parent="Topleft/Character1"] +custom_minimum_size = Vector2(12, 64) +layout_mode = 2 + +[node name="Character2" type="HBoxContainer" parent="Topleft"] +layout_mode = 2 + +[node name="TextureRect" type="TextureRect" parent="Topleft/Character2"] +custom_minimum_size = Vector2(116, 116) +layout_mode = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="Topleft/Character2"] +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="Topleft/Character2/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Topleft/Character2/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(174, 0) +layout_mode = 2 +text = "Name" + +[node name="Label3" type="Label" parent="Topleft/Character2/VBoxContainer/HBoxContainer"] +layout_mode = 2 +text = "R1 + →" +horizontal_alignment = 2 + +[node name="HBoxContainer2" type="HBoxContainer" parent="Topleft/Character2/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Topleft/Character2/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(70, 0) +layout_mode = 2 +text = "Health" + +[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character2/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +theme_override_styles/background = SubResource("StyleBoxFlat_ualpu") +theme_override_styles/fill = SubResource("StyleBoxFlat_patnr") + +[node name="Label2" type="Label" parent="Topleft/Character2/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(63, 0) +layout_mode = 2 +text = "100/100" +horizontal_alignment = 2 + +[node name="HBoxContainer3" type="HBoxContainer" parent="Topleft/Character2/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Topleft/Character2/VBoxContainer/HBoxContainer3"] +custom_minimum_size = Vector2(70, 0) +layout_mode = 2 +text = "Stamina" + +[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character2/VBoxContainer/HBoxContainer3"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +theme_override_styles/background = SubResource("StyleBoxFlat_05pau") +theme_override_styles/fill = SubResource("StyleBoxFlat_u3vj7") + +[node name="Label2" type="Label" parent="Topleft/Character2/VBoxContainer/HBoxContainer3"] +custom_minimum_size = Vector2(63, 0) +layout_mode = 2 +text = "100/100" +horizontal_alignment = 2 + +[node name="HBoxContainer4" type="HBoxContainer" parent="Topleft/Character2/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Topleft/Character2/VBoxContainer/HBoxContainer4"] +custom_minimum_size = Vector2(70, 0) +layout_mode = 2 +text = "Skill" + +[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character2/VBoxContainer/HBoxContainer4"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +theme_override_styles/background = SubResource("StyleBoxFlat_ftyws") + +[node name="Label2" type="Label" parent="Topleft/Character2/VBoxContainer/HBoxContainer4"] +custom_minimum_size = Vector2(63, 0) +layout_mode = 2 +text = "100/100" +horizontal_alignment = 2 + +[node name="ColorRect2" type="ColorRect" parent="Topleft/Character2"] +custom_minimum_size = Vector2(12, 64) +layout_mode = 2 + +[node name="Character3" type="HBoxContainer" parent="Topleft"] +layout_mode = 2 + +[node name="TextureRect" type="TextureRect" parent="Topleft/Character3"] +custom_minimum_size = Vector2(116, 116) +layout_mode = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="Topleft/Character3"] +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="Topleft/Character3/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Topleft/Character3/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(174, 0) +layout_mode = 2 +text = "Name" + +[node name="Label3" type="Label" parent="Topleft/Character3/VBoxContainer/HBoxContainer"] +layout_mode = 2 +text = "R1 + ↓" +horizontal_alignment = 2 + +[node name="HBoxContainer2" type="HBoxContainer" parent="Topleft/Character3/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Topleft/Character3/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(70, 0) +layout_mode = 2 +text = "Health" + +[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character3/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +theme_override_styles/background = SubResource("StyleBoxFlat_ualpu") +theme_override_styles/fill = SubResource("StyleBoxFlat_patnr") + +[node name="Label2" type="Label" parent="Topleft/Character3/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(63, 0) +layout_mode = 2 +text = "100/100" +horizontal_alignment = 2 + +[node name="HBoxContainer3" type="HBoxContainer" parent="Topleft/Character3/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Topleft/Character3/VBoxContainer/HBoxContainer3"] +custom_minimum_size = Vector2(70, 0) +layout_mode = 2 +text = "Stamina" + +[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character3/VBoxContainer/HBoxContainer3"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +theme_override_styles/background = SubResource("StyleBoxFlat_05pau") +theme_override_styles/fill = SubResource("StyleBoxFlat_u3vj7") + +[node name="Label2" type="Label" parent="Topleft/Character3/VBoxContainer/HBoxContainer3"] +custom_minimum_size = Vector2(63, 0) +layout_mode = 2 +text = "100/100" +horizontal_alignment = 2 + +[node name="HBoxContainer4" type="HBoxContainer" parent="Topleft/Character3/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Topleft/Character3/VBoxContainer/HBoxContainer4"] +custom_minimum_size = Vector2(70, 0) +layout_mode = 2 +text = "Skill" + +[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character3/VBoxContainer/HBoxContainer4"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +theme_override_styles/background = SubResource("StyleBoxFlat_ftyws") + +[node name="Label2" type="Label" parent="Topleft/Character3/VBoxContainer/HBoxContainer4"] +custom_minimum_size = Vector2(63, 0) +layout_mode = 2 +text = "100/100" +horizontal_alignment = 2 + +[node name="ColorRect2" type="ColorRect" parent="Topleft/Character3"] +custom_minimum_size = Vector2(12, 64) +layout_mode = 2 + +[node name="Character4" type="HBoxContainer" parent="Topleft"] +layout_mode = 2 + +[node name="TextureRect" type="TextureRect" parent="Topleft/Character4"] +custom_minimum_size = Vector2(116, 116) +layout_mode = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="Topleft/Character4"] +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="Topleft/Character4/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Topleft/Character4/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(174, 0) +layout_mode = 2 +text = "Name" + +[node name="Label3" type="Label" parent="Topleft/Character4/VBoxContainer/HBoxContainer"] +layout_mode = 2 +text = "R1 + ←" +horizontal_alignment = 2 + +[node name="HBoxContainer2" type="HBoxContainer" parent="Topleft/Character4/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Topleft/Character4/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(70, 0) +layout_mode = 2 +text = "Health" + +[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character4/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +theme_override_styles/background = SubResource("StyleBoxFlat_ualpu") +theme_override_styles/fill = SubResource("StyleBoxFlat_patnr") + +[node name="Label2" type="Label" parent="Topleft/Character4/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(63, 0) +layout_mode = 2 +text = "100/100" +horizontal_alignment = 2 + +[node name="HBoxContainer3" type="HBoxContainer" parent="Topleft/Character4/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Topleft/Character4/VBoxContainer/HBoxContainer3"] +custom_minimum_size = Vector2(70, 0) +layout_mode = 2 +text = "Stamina" + +[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character4/VBoxContainer/HBoxContainer3"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +theme_override_styles/background = SubResource("StyleBoxFlat_05pau") +theme_override_styles/fill = SubResource("StyleBoxFlat_u3vj7") + +[node name="Label2" type="Label" parent="Topleft/Character4/VBoxContainer/HBoxContainer3"] +custom_minimum_size = Vector2(63, 0) +layout_mode = 2 +text = "100/100" +horizontal_alignment = 2 + +[node name="HBoxContainer4" type="HBoxContainer" parent="Topleft/Character4/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Topleft/Character4/VBoxContainer/HBoxContainer4"] +custom_minimum_size = Vector2(70, 0) +layout_mode = 2 +text = "Skill" + +[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character4/VBoxContainer/HBoxContainer4"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +theme_override_styles/background = SubResource("StyleBoxFlat_ftyws") + +[node name="Label2" type="Label" parent="Topleft/Character4/VBoxContainer/HBoxContainer4"] +custom_minimum_size = Vector2(63, 0) +layout_mode = 2 +text = "100/100" +horizontal_alignment = 2 + +[node name="ColorRect2" type="ColorRect" parent="Topleft/Character4"] +custom_minimum_size = Vector2(12, 64) +layout_mode = 2 diff --git a/sprites/common/bullet/fireball.gd b/sprites/common/bullet/fireball.gd index 0549c41..9ee5cbc 100644 --- a/sprites/common/bullet/fireball.gd +++ b/sprites/common/bullet/fireball.gd @@ -22,6 +22,9 @@ func _physics_process(delta): 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"): + if body.weakness == 3: + print("weak to fire") #if body.is_in_group("players"): # Global.live = 2 #elif body.is_in_group("enemies"): diff --git a/sprites/common/bullet/snowflake.gd b/sprites/common/bullet/snowflake.gd new file mode 100644 index 0000000..063455b --- /dev/null +++ b/sprites/common/bullet/snowflake.gd @@ -0,0 +1,44 @@ +extends Area2D +var velocity: Vector2 = Vector2() +var direction +var speed = 100 +var btype +# Called when the node enters the scene tree for the first time. +func _ready(): + add_to_group(btype) + #pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + +func _physics_process(delta): + if direction == null: + position += velocity * delta + else: + position += speed * delta * direction + + +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"): + if body.weakness == 0: + print("weak to ice") + #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() + + +func _on_screen_exited(): + queue_free() + + +func _on_area_entered(area): + if !area.is_in_group(btype): + queue_free() + #pass # Replace with function body. diff --git a/sprites/common/bullet/snowflake.png b/sprites/common/bullet/snowflake.png new file mode 100644 index 0000000..30b5d8d Binary files /dev/null and b/sprites/common/bullet/snowflake.png differ diff --git a/sprites/common/bullet/snowflake.png.import b/sprites/common/bullet/snowflake.png.import new file mode 100644 index 0000000..c6a8569 --- /dev/null +++ b/sprites/common/bullet/snowflake.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://nvayru3j13ts" +path="res://.godot/imported/snowflake.png-955eeb363f6816e7809a87df0c75bf64.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/common/bullet/snowflake.png" +dest_files=["res://.godot/imported/snowflake.png-955eeb363f6816e7809a87df0c75bf64.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/sprites/common/bullet/snowflake.tscn b/sprites/common/bullet/snowflake.tscn new file mode 100644 index 0000000..224075b --- /dev/null +++ b/sprites/common/bullet/snowflake.tscn @@ -0,0 +1,21 @@ +[gd_scene load_steps=4 format=3 uid="uid://cexo7mwqpmw4b"] + +[ext_resource type="Script" path="res://sprites/common/bullet/snowflake.gd" id="1_w4m7a"] +[ext_resource type="Texture2D" uid="uid://nvayru3j13ts" path="res://sprites/common/bullet/snowflake.png" id="2_0alhu"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_g125y"] +size = Vector2(60, 60) + +[node name="Snowflake" type="Area2D"] +script = ExtResource("1_w4m7a") + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = ExtResource("2_0alhu") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("RectangleShape2D_g125y") + +[node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."] + +[connection signal="area_entered" from="." to="." method="_on_area_entered"] +[connection signal="body_entered" from="." to="." method="_on_body_entered"] diff --git a/sprites/common/midori/facehud.png b/sprites/common/midori/facehud.png new file mode 100644 index 0000000..6a08511 Binary files /dev/null and b/sprites/common/midori/facehud.png differ diff --git a/sprites/common/midori/facehud.png.import b/sprites/common/midori/facehud.png.import new file mode 100644 index 0000000..122ed2a --- /dev/null +++ b/sprites/common/midori/facehud.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ckjccj40wqboe" +path="res://.godot/imported/facehud.png-853dc11b9d2eda9b4f3dbda0602e31cd.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/common/midori/facehud.png" +dest_files=["res://.godot/imported/facehud.png-853dc11b9d2eda9b4f3dbda0602e31cd.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/sprites/common/midori/lily.gd b/sprites/common/midori/lily.gd index 57d7a05..cac7fef 100644 --- a/sprites/common/midori/lily.gd +++ b/sprites/common/midori/lily.gd @@ -4,6 +4,7 @@ extends CharacterBody2D const SPEED = 300.0 const JUMP_VELOCITY = -400.0 var angle = 2 +var weakness = 0 # Get the gravity from the project settings to be synced with RigidBody nodes. var gravity = ProjectSettings.get_setting("physics/2d/default_gravity") diff --git a/sprites/common/natasha/facehud.png b/sprites/common/natasha/facehud.png new file mode 100644 index 0000000..6d69d0e Binary files /dev/null and b/sprites/common/natasha/facehud.png differ diff --git a/sprites/common/natasha/facehud.png.import b/sprites/common/natasha/facehud.png.import new file mode 100644 index 0000000..d9878af --- /dev/null +++ b/sprites/common/natasha/facehud.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cw2pkjwxw0mj0" +path="res://.godot/imported/facehud.png-cabef45f07551c953d7df3ee19ee1aca.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/common/natasha/facehud.png" +dest_files=["res://.godot/imported/facehud.png-cabef45f07551c953d7df3ee19ee1aca.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/sprites/common/natasha/natasha.gd b/sprites/common/natasha/natasha.gd index fc9c236..a2d5f39 100644 --- a/sprites/common/natasha/natasha.gd +++ b/sprites/common/natasha/natasha.gd @@ -2,11 +2,12 @@ extends CharacterBody2D var theta: float = 0.0 @export_range(0,2*PI) var alpha: float = 1.5 -var bullet = load("res://sprites/common/bullet/fireball.tscn") +var bullet = load("res://sprites/common/bullet/snowflake.tscn") const SPEED = 300.0 const JUMP_VELOCITY = -400.0 var vangle = 2 +var weakness = 2 func get_vector(angle): theta = angle + alpha diff --git a/sprites/common/player/player.gd b/sprites/common/player/player.gd index 6712e84..db7bc8c 100644 --- a/sprites/common/player/player.gd +++ b/sprites/common/player/player.gd @@ -10,31 +10,20 @@ var csprite 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 func _ready(): add_to_group("players") anim = $AnimationPlayer sprite = $Sprite2D - if Global.debug: - csprite = Global.dcpchar - sprite.texture = load(Global.pchars[Global.dparty[Global.dcpchar]]) - else: - csprite = Global.cpchar - sprite.texture = load(Global.pchars[Global.party[Global.cpchar]]) + _charswitch() func _physics_process(delta): # Add the gravity. #var velocity = Vector2.ZERO if Global.live == 1: velocity = (Vector2.RIGHT.rotated(rotation) * 500 * Global.xm * delta)-Vector2.UP.rotated(rotation) * 500 * Global.ym * delta - if Global.debug: - if Global.dcpchar != csprite: - csprite = Global.dcpchar - sprite.texture = load(Global.pchars[Global.dparty[Global.dcpchar]]) - else: - if Global.cpchar != csprite: - csprite = Global.cpchar - sprite.texture = load(Global.pchars[Global.party[Global.cpchar]]) + _charswitch() #origmpos = get_viewport().get_mouse_position() #if Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) != 0: # velocity = Vector2.UP.rotated(rotation) * -400 * Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) @@ -88,3 +77,15 @@ func _input(event): get_parent().add_child(new_pbullet) elif Input.is_action_just_released("shoot") && bpress: bpress = false + +func _charswitch(): + if Global.debug: + if Global.dcpchar != csprite: + csprite = Global.dcpchar + sprite.texture = load(Global.pchars[Global.dparty[Global.dcpchar]]) + weakness = Global.specialities[Global.pcspecialities[Global.dparty[Global.dcpchar]]] + else: + if Global.cpchar != csprite: + csprite = Global.cpchar + sprite.texture = load(Global.pchars[Global.party[Global.cpchar]]) + weakness = Global.specialities[Global.pcspecialities[Global.party[Global.cpchar]]]