Skip to content

Commit

Permalink
Merge pull request #479 from snipercup/mob-groups
Browse files Browse the repository at this point in the history
Add Mob groups to quest
  • Loading branch information
snipercup authored Nov 26, 2024
2 parents ccae7dc + da09a4b commit f5329d5
Show file tree
Hide file tree
Showing 16 changed files with 761 additions and 58 deletions.
2 changes: 1 addition & 1 deletion ItemProtosets.tres
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_resource type="Resource" script_class="ItemProtoset" load_steps=2 format=3]
[gd_resource type="Resource" script_class="ItemProtoset" load_steps=2 format=3 uid="uid://bxubu34gjes1y"]

[ext_resource type="Script" path="res://addons/gloot/core/item_protoset.gd" id="1_o35lu"]

Expand Down
25 changes: 25 additions & 0 deletions Mods/Core/Mobgroups/Mobgroups.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[
{
"description": "A group of basic zombies, representing a minor threat to the player",
"id": "basic_zombies",
"mobs": {
"basic_zombie_1": 100,
"basic_zombie_2": 100,
"bloated_zombie": 50,
"charred_zombie": 10,
"heavy_zombie": 50,
"limping_zombie": 25,
"rushing_zombie": 25,
"skeleton_zombie": 10
},
"name": "Basic zombies",
"references": {
"core": {
"quests": [
"starter_tutorial_00"
]
}
},
"spriteid": "zombie_64_64.png"
}
]
27 changes: 24 additions & 3 deletions Mods/Core/Mobs/Mobs.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,10 @@
"generichouse_corner",
"store_electronic_clothing"
],
"mobgroups": [
"basic_zombies"
],
"quests": [
"starter_tutorial_00",
"store_electronic_clothing",
"store_groceries",
"quest_holy_crusade_01"
]
}
Expand Down Expand Up @@ -463,6 +463,9 @@
"generichouse_corner",
"store_electronic_clothing",
"store_groceries"
],
"mobgroups": [
"basic_zombies"
]
}
},
Expand Down Expand Up @@ -534,6 +537,9 @@
"generichouse_corner",
"store_electronic_clothing"
],
"mobgroups": [
"basic_zombies"
],
"quests": [
"quest_holy_crusade_01"
]
Expand Down Expand Up @@ -607,6 +613,9 @@
"generichouse_corner",
"store_electronic_clothing"
],
"mobgroups": [
"basic_zombies"
],
"quests": [
"quest_holy_crusade_01"
]
Expand Down Expand Up @@ -686,6 +695,9 @@
"generichouse_t",
"generichouse_corner",
"store_electronic_clothing"
],
"mobgroups": [
"basic_zombies"
]
}
},
Expand Down Expand Up @@ -757,6 +769,9 @@
"generichouse_corner",
"store_electronic_clothing"
],
"mobgroups": [
"basic_zombies"
],
"quests": [
"quest_holy_crusade_01"
]
Expand Down Expand Up @@ -830,6 +845,9 @@
"generichouse_corner",
"store_electronic_clothing"
],
"mobgroups": [
"basic_zombies"
],
"quests": [
"quest_holy_crusade_01"
]
Expand Down Expand Up @@ -902,6 +920,9 @@
"generichouse_t",
"generichouse_corner",
"store_electronic_clothing"
],
"mobgroups": [
"basic_zombies"
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion Mods/Core/Quests/Quests.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{
"amount": 2,
"map_guide": "revealed",
"mob": "basic_zombie_1",
"mobgroup": "basic_zombies",
"tip": "The map will show you where to find them and update the target if there's no zombie there.",
"type": "kill"
},
Expand Down
142 changes: 142 additions & 0 deletions Scenes/ContentManager/Custom_Editors/MobgroupsEditor.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
[gd_scene load_steps=5 format=3 uid="uid://bw14nfwdnu41d"]

[ext_resource type="Script" path="res://Scenes/ContentManager/Custom_Editors/Scripts/MobgroupsEditor.gd" id="1_vrae5"]
[ext_resource type="Texture2D" uid="uid://c8ragmxitca47" path="res://Scenes/ContentManager/Mapeditor/Images/emptyTile.png" id="2_sxhq2"]
[ext_resource type="PackedScene" uid="uid://d1h1rpwt8f807" path="res://Scenes/ContentManager/Custom_Widgets/Sprite_Selector_Popup.tscn" id="3_hpi3t"]

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_3w4h5"]
content_margin_left = 8.0
content_margin_top = 8.0
content_margin_right = 8.0
content_margin_bottom = 8.0

[node name="MobgroupsEditor" type="Control" node_paths=PackedStringArray("mobgroupImageDisplay", "IDTextLabel", "PathTextLabel", "NameTextEdit", "DescriptionTextEdit", "mobgroupSelector", "mob_list")]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_vrae5")
mobgroupImageDisplay = NodePath("VBoxContainer/FormGrid/MobGroupImageDisplay")
IDTextLabel = NodePath("VBoxContainer/FormGrid/IDTextLabel")
PathTextLabel = NodePath("VBoxContainer/FormGrid/PathTextLabel")
NameTextEdit = NodePath("VBoxContainer/FormGrid/NameTextEdit")
DescriptionTextEdit = NodePath("VBoxContainer/FormGrid/DescriptionTextEdit")
mobgroupSelector = NodePath("Sprite_selector")
mob_list = NodePath("VBoxContainer/FormGrid/PanelContainer/ScrollContainer/MobList")

[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2

[node name="CloseButton" type="Button" parent="VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "Close"

[node name="SaveButton" type="Button" parent="VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "Save"

[node name="FormGrid" type="GridContainer" parent="VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
columns = 2

[node name="ImageLabel" type="Label" parent="VBoxContainer/FormGrid"]
layout_mode = 2
text = "Sprite:"

[node name="MobGroupImageDisplay" type="TextureRect" parent="VBoxContainer/FormGrid"]
custom_minimum_size = Vector2(128, 128)
layout_mode = 2
size_flags_horizontal = 0
size_flags_stretch_ratio = 0.4
texture = ExtResource("2_sxhq2")
expand_mode = 3

[node name="PathLabel" type="Label" parent="VBoxContainer/FormGrid"]
layout_mode = 2
text = "Sprite name"

[node name="PathTextLabel" type="Label" parent="VBoxContainer/FormGrid"]
custom_minimum_size = Vector2(0, 30)
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 0.1

[node name="IDLabel" type="Label" parent="VBoxContainer/FormGrid"]
layout_mode = 2
text = "ID:"

[node name="IDTextLabel" type="Label" parent="VBoxContainer/FormGrid"]
custom_minimum_size = Vector2(0, 30)
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 0.1

[node name="NameLabel" type="Label" parent="VBoxContainer/FormGrid"]
layout_mode = 2
text = "Name"

[node name="NameTextEdit" type="TextEdit" parent="VBoxContainer/FormGrid"]
custom_minimum_size = Vector2(0, 30)
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 0.1
focus_next = NodePath("../DescriptionTextEdit")
focus_previous = NodePath("../MobGroupImageDisplay")
placeholder_text = "Basic zombies"

[node name="DescriptionLabel" type="Label" parent="VBoxContainer/FormGrid"]
layout_mode = 2
text = "Description"

[node name="DescriptionTextEdit" type="TextEdit" parent="VBoxContainer/FormGrid"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 0.9
focus_previous = NodePath("../NameTextEdit")
placeholder_text = "A group of basic zombies, representing a minor threat to the player"
wrap_mode = 1

[node name="ItemsLabel" type="Label" parent="VBoxContainer/FormGrid"]
layout_mode = 2
text = "Mobs"

[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/FormGrid"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
mouse_filter = 1
theme_override_styles/panel = SubResource("StyleBoxFlat_3w4h5")

[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/FormGrid/PanelContainer"]
custom_minimum_size = Vector2(600, 200)
layout_mode = 2
horizontal_scroll_mode = 0

[node name="MobList" type="GridContainer" parent="VBoxContainer/FormGrid/PanelContainer/ScrollContainer"]
custom_minimum_size = Vector2(600, 200)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
tooltip_text = "Drag mobs to this list from the left menu of the content editor. Once the list
has been made, you can assign this group to a quest, in the quest editor."
columns = 4

[node name="Sprite_selector" parent="." instance=ExtResource("3_hpi3t")]
visible = false

[connection signal="button_up" from="VBoxContainer/HBoxContainer/CloseButton" to="." method="_on_close_button_button_up"]
[connection signal="button_up" from="VBoxContainer/HBoxContainer/SaveButton" to="." method="_on_save_button_button_up"]
[connection signal="gui_input" from="VBoxContainer/FormGrid/MobGroupImageDisplay" to="." method="_on_mob_group_image_display_gui_input"]
[connection signal="sprite_selected_ok" from="Sprite_selector" to="." method="_on_sprite_selector_sprite_selected_ok"]
Loading

0 comments on commit f5329d5

Please sign in to comment.