diff --git a/assets/craftarrow.png b/assets/craftarrow.png new file mode 100644 index 0000000..5752bb8 Binary files /dev/null and b/assets/craftarrow.png differ diff --git a/assets/craftarrow.png.import b/assets/craftarrow.png.import new file mode 100644 index 0000000..04ab71c --- /dev/null +++ b/assets/craftarrow.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cu18nhutsu0ov" +path="res://.godot/imported/craftarrow.png-d573a3e20f434757cbe57c783b76d428.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/craftarrow.png" +dest_files=["res://.godot/imported/craftarrow.png-d573a3e20f434757cbe57c783b76d428.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/assets/ending.png b/assets/ending.png new file mode 100644 index 0000000..ee160bf Binary files /dev/null and b/assets/ending.png differ diff --git a/assets/ending.png.import b/assets/ending.png.import new file mode 100644 index 0000000..abec394 --- /dev/null +++ b/assets/ending.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://jdfmarm0iilr" +path="res://.godot/imported/ending.png-c85172e8c7e8ac54c531ca5c9a4f3ec1.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ending.png" +dest_files=["res://.godot/imported/ending.png-c85172e8c7e8ac54c531ca5c9a4f3ec1.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/assets/menu.png b/assets/menu.png new file mode 100644 index 0000000..54204d6 Binary files /dev/null and b/assets/menu.png differ diff --git a/assets/menu.png.import b/assets/menu.png.import new file mode 100644 index 0000000..a356b28 --- /dev/null +++ b/assets/menu.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b1rs6epjar6mj" +path="res://.godot/imported/menu.png-507092a63be01007fcca0624aab4189b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/menu.png" +dest_files=["res://.godot/imported/menu.png-507092a63be01007fcca0624aab4189b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/crafting/recipe book/recipe_card.tscn b/crafting/recipe book/recipe_card.tscn index f3912dd..27e3d57 100644 --- a/crafting/recipe book/recipe_card.tscn +++ b/crafting/recipe book/recipe_card.tscn @@ -2,9 +2,7 @@ [ext_resource type="Script" uid="uid://mvqohkfd6whc" path="res://crafting/recipe book/recipe_card.gd" id="1_8t2l7"] [ext_resource type="PackedScene" uid="uid://dgqs20xf7l8c" path="res://inv_system/item_slot.tscn" id="1_ebtwo"] - -[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_8t2l7"] -size = Vector2(32, 32) +[ext_resource type="Texture2D" uid="uid://cu18nhutsu0ov" path="res://assets/craftarrow.png" id="3_qstsn"] [node name="Recipe Card" type="PanelContainer" node_paths=PackedStringArray("grid_container", "output_slot", "output_label")] script = ExtResource("1_8t2l7") @@ -58,7 +56,7 @@ layout_mode = 2 [node name="TextureRect" type="TextureRect" parent="HBoxContainer"] layout_mode = 2 -texture = SubResource("PlaceholderTexture2D_8t2l7") +texture = ExtResource("3_qstsn") stretch_mode = 3 [node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"] diff --git a/inv_system/crafting_panel.gd b/inv_system/crafting_panel.gd index 2076da4..afcc697 100644 --- a/inv_system/crafting_panel.gd +++ b/inv_system/crafting_panel.gd @@ -122,8 +122,3 @@ func _on_action_button_pressed() -> void: add_item(matched_recipe.roll()) check_recipes() pass # Replace with function body. - -func empty_grid(): - for slot in slots: - slot.item = null - slot.update_ui() diff --git a/inv_system/inventory.gd b/inv_system/inventory.gd index 53f0f8f..0838438 100644 --- a/inv_system/inventory.gd +++ b/inv_system/inventory.gd @@ -52,3 +52,8 @@ func filled_slots() -> int: if slot.item: count += 1 return count + +func empty_grid(): + for slot in slots: + slot.item = null + slot.update_ui() diff --git a/inv_system/player_inventory.tscn b/inv_system/player_inventory.tscn index 22c4d33..ea32bfd 100644 --- a/inv_system/player_inventory.tscn +++ b/inv_system/player_inventory.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=9 format=3 uid="uid://bkhg56q71vsjv"] +[gd_scene load_steps=10 format=3 uid="uid://bkhg56q71vsjv"] [ext_resource type="Script" uid="uid://jxkjnscuxcyi" path="res://inv_system/player_inventory.gd" id="1_vk2kx"] [ext_resource type="Script" uid="uid://c6oycdae5wvjf" path="res://inv_system/inventory.gd" id="2_hk4hx"] @@ -42,6 +42,10 @@ corner_radius_bottom_right = 3 corner_radius_bottom_left = 3 corner_detail = 5 +[sub_resource type="LabelSettings" id="LabelSettings_bdgfq"] +font_size = 24 +font_color = Color(1, 0.7490196, 0, 1) + [node name="PlayerInventory" type="Control" node_paths=PackedStringArray("inventory_panel", "button", "money_label")] z_index = 2 layout_mode = 3 @@ -261,6 +265,7 @@ offset_bottom = 608.0 [node name="Label" type="Label" parent="PanelContainer"] layout_mode = 2 text = "Money: $0" +label_settings = SubResource("LabelSettings_bdgfq") horizontal_alignment = 1 [connection signal="pressed" from="Button" to="." method="_on_button_pressed"] diff --git a/project.godot b/project.godot index 1ed5bc4..6b7de0d 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="Repurposed Jam" -run/main_scene="uid://dbxymsdyvbe2p" +run/main_scene="uid://dxr1ergmn3ij7" config/features=PackedStringArray("4.5", "GL Compatibility") config/icon="res://icon.svg" diff --git a/scenes/ending.gd b/scenes/ending.gd new file mode 100644 index 0000000..341dd5a --- /dev/null +++ b/scenes/ending.gd @@ -0,0 +1,41 @@ +extends Control + +@export var server_box : HBoxContainer +@export var score_label : Label + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + #sell remaining inventory + var inv_sell_value : int = 0 + for slot in PlayerInventory.inventory_panel.slots: + if slot.item: + inv_sell_value += floori(slot.item.buy_value/float(2)) + + var server_item : ItemData = load("res://items/server.tres") + for x in range(PlayerInventory.botnet_servers): + var new_slot : ItemSlot = load("res://inv_system/item_slot.tscn").instantiate() + new_slot.item = server_item + new_slot.update_ui() + new_slot.block_taking = true + server_box.add_child(new_slot) + + score_label.text = str(PlayerInventory.botnet_servers) + " machines + $" + str(PlayerInventory.money + inv_sell_value) + + + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass + + +func _on_reset_button_pressed() -> void: + PlayerInventory.money = 0 + PlayerInventory.botnet_servers = 0 + PlayerInventory.inventory_panel.empty_grid() + Clock.days_left = 7 + Clock.time_left = 200 + PlayerInventory.show() + Clock.show() + get_tree().change_scene_to_file("res://scenes/workshop.tscn") diff --git a/scenes/ending.gd.uid b/scenes/ending.gd.uid new file mode 100644 index 0000000..e6d3efd --- /dev/null +++ b/scenes/ending.gd.uid @@ -0,0 +1 @@ +uid://ekqrygb4eunr diff --git a/scenes/ending.tscn b/scenes/ending.tscn new file mode 100644 index 0000000..2b05993 --- /dev/null +++ b/scenes/ending.tscn @@ -0,0 +1,89 @@ +[gd_scene load_steps=3 format=3 uid="uid://b17m8fgb3hhcn"] + +[ext_resource type="Script" uid="uid://ekqrygb4eunr" path="res://scenes/ending.gd" id="1_2x1jc"] +[ext_resource type="Texture2D" uid="uid://jdfmarm0iilr" path="res://assets/ending.png" id="1_mqjok"] + +[node name="Ending" type="Control" node_paths=PackedStringArray("server_box", "score_label")] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +script = ExtResource("1_2x1jc") +server_box = NodePath("MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer") +score_label = NodePath("MarginContainer/PanelContainer/MarginContainer/VBoxContainer/ScoreL") + +[node name="TextureRect" type="TextureRect" parent="."] +z_index = -3 +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +texture = ExtResource("1_mqjok") +expand_mode = 3 + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 250 +theme_override_constants/margin_top = 100 +theme_override_constants/margin_right = 250 +theme_override_constants/margin_bottom = 100 + +[node name="PanelContainer" type="PanelContainer" parent="MarginContainer"] +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/PanelContainer"] +layout_mode = 2 +theme_override_constants/margin_left = 5 +theme_override_constants/margin_top = 5 +theme_override_constants/margin_right = 5 +theme_override_constants/margin_bottom = 5 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/PanelContainer/MarginContainer"] +layout_mode = 2 +alignment = 1 + +[node name="RichTextLabel" type="RichTextLabel" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +bbcode_enabled = true +text = "[center][font_size=50][wave]meow!!" +fit_content = true + +[node name="Label" type="Label" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +text = "You launch your botnet filling the internet with catgirls!" +horizontal_alignment = 1 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +alignment = 1 + +[node name="ScoreL" type="Label" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +text = "5 machines + $1234" +horizontal_alignment = 1 + +[node name="HSeparator" type="HSeparator" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="RichTextLabel2" type="RichTextLabel" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +bbcode_enabled = true +text = "[wave][color=orchid][center]Thanks for playing :3" +fit_content = true + +[node name="ResetButton" type="Button" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +text = "Play Again" + +[connection signal="pressed" from="MarginContainer/PanelContainer/MarginContainer/VBoxContainer/ResetButton" to="." method="_on_reset_button_pressed"] diff --git a/scenes/menu.gd b/scenes/menu.gd new file mode 100644 index 0000000..446b7ea --- /dev/null +++ b/scenes/menu.gd @@ -0,0 +1,19 @@ +extends Control + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + PlayerInventory.hide() + Clock.hide() + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass + + +func _on_play_button_pressed() -> void: + PlayerInventory.show() + Clock.show() + get_tree().change_scene_to_file("res://scenes/workshop.tscn") diff --git a/scenes/menu.gd.uid b/scenes/menu.gd.uid new file mode 100644 index 0000000..3390f27 --- /dev/null +++ b/scenes/menu.gd.uid @@ -0,0 +1 @@ +uid://4c4k3o0jnmdk diff --git a/scenes/menu.tscn b/scenes/menu.tscn new file mode 100644 index 0000000..cc85f43 --- /dev/null +++ b/scenes/menu.tscn @@ -0,0 +1,97 @@ +[gd_scene load_steps=3 format=3 uid="uid://dxr1ergmn3ij7"] + +[ext_resource type="Script" uid="uid://4c4k3o0jnmdk" path="res://scenes/menu.gd" id="1_vjb58"] +[ext_resource type="Texture2D" uid="uid://b1rs6epjar6mj" path="res://assets/menu.png" id="2_con2f"] + +[node name="Ending" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +script = ExtResource("1_vjb58") + +[node name="TextureRect" type="TextureRect" parent="."] +z_index = -3 +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +texture = ExtResource("2_con2f") +expand_mode = 3 + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 250 +theme_override_constants/margin_top = 100 +theme_override_constants/margin_right = 250 +theme_override_constants/margin_bottom = 100 + +[node name="PanelContainer" type="PanelContainer" parent="MarginContainer"] +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/PanelContainer"] +layout_mode = 2 +theme_override_constants/margin_left = 5 +theme_override_constants/margin_top = 5 +theme_override_constants/margin_right = 5 +theme_override_constants/margin_bottom = 5 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/PanelContainer/MarginContainer"] +layout_mode = 2 +alignment = 1 + +[node name="RichTextLabel" type="RichTextLabel" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +bbcode_enabled = true +text = "[center][font_size=50][wave](title pending)" +fit_content = true + +[node name="RichTextLabel2" type="RichTextLabel" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +bbcode_enabled = true +text = "[wave][color=orchid][center]Made by Tabby" +fit_content = true + +[node name="Label" type="Label" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +text = "Your goal is to build a botnet of servers so you can take over the internet with catgirls. You have 7 days to loot the ewaste before building management realises what you're up to and you have to escape" +horizontal_alignment = 1 +autowrap_mode = 2 + +[node name="HSeparator" type="HSeparator" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="PlayButton" type="Button" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"] +modulate = Color(0, 1, 0, 1) +layout_mode = 2 +text = "Play!" + +[node name="RichTextLabel3" type="RichTextLabel" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +bbcode_enabled = true +text = "[i]Credits +[ul] Playtesting: Maxie, Kane +Octodemy's Inventory Tutorial +Item Icons: (todo)" +fit_content = true + +[node name="HSeparator2" type="HSeparator" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="Label2" type="Label" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +text = "tip: you can quickly move items between inventories with Shift+Click" +horizontal_alignment = 1 + +[connection signal="pressed" from="MarginContainer/PanelContainer/MarginContainer/VBoxContainer/PlayButton" to="." method="_on_play_button_pressed"] diff --git a/shop/listing.gd b/shop/listing.gd index 017b1ca..cffdf4f 100644 --- a/shop/listing.gd +++ b/shop/listing.gd @@ -13,7 +13,7 @@ func _ready() -> void: # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: if item_slot.item: - button.disabled = PlayerInventory.money <= item_cost + button.disabled = PlayerInventory.money < item_cost func prepare(item : ItemData): item_slot.item = item diff --git a/shop/meowbay.gd b/shop/meowbay.gd index a6098b3..3ffe36f 100644 --- a/shop/meowbay.gd +++ b/shop/meowbay.gd @@ -14,7 +14,7 @@ func _process(delta: float) -> void: pass func make_listings(): - print("building meowbay") + #print("building meowbay") for item in RecipeManager.items: if item.can_buy: var new_listing = load("res://shop/listing.tscn").instantiate() diff --git a/time_system/clock.gd b/time_system/clock.gd index 676ea78..df61bd4 100644 --- a/time_system/clock.gd +++ b/time_system/clock.gd @@ -6,6 +6,7 @@ var starting_time : int = 200 @export var bar : TextureProgressBar @export var timer_text : Label @export var days_text : Label +@export var next_button : Button # Called when the node enters the scene tree for the first time. func _ready() -> void: @@ -17,6 +18,11 @@ func _process(delta: float) -> void: bar.value = (starting_time-time_left)/float(starting_time) timer_text.text = str(time_left) days_text.text = str(days_left) + next_button.disabled = time_left > 10 + if days_left == 0: + next_button.text = "End Game" + else: + next_button.text = "Proceed to next day ->" func has_time(time : float) -> bool: return time_left >= time @@ -26,5 +32,11 @@ func use_time(time : float): func _on_next_day_pressed() -> void: - days_left -= 1 - time_left = 200 + if days_left >= 1: + days_left -= 1 + time_left = 200 + else: + get_tree().change_scene_to_file("res://scenes/ending.tscn") + PlayerInventory.hide() + Clock.hide() + pass diff --git a/time_system/clock.tscn b/time_system/clock.tscn index a06717c..460ce12 100644 --- a/time_system/clock.tscn +++ b/time_system/clock.tscn @@ -8,7 +8,7 @@ [sub_resource type="LabelSettings" id="LabelSettings_r3ygl"] font_size = 32 -[node name="Clock" type="Control" node_paths=PackedStringArray("bar", "timer_text", "days_text")] +[node name="Clock" type="Control" node_paths=PackedStringArray("bar", "timer_text", "days_text", "next_button")] z_index = 2 layout_mode = 3 anchors_preset = 15 @@ -21,6 +21,7 @@ script = ExtResource("1_m6rn1") bar = NodePath("PanelContainer/VBoxContainer/HBoxContainer/TextureProgressBar") timer_text = NodePath("PanelContainer/VBoxContainer/HBoxContainer/TextureProgressBar/PanelContainer/Label") days_text = NodePath("PanelContainer/VBoxContainer/HBoxContainer/VBoxContainer/Label") +next_button = NodePath("PanelContainer/VBoxContainer/NextDay") [node name="PanelContainer" type="PanelContainer" parent="."] layout_mode = 1