Consistent SYSTEMS

This commit is contained in:
2025-05-25 14:37:30 -05:00
parent 48f3e57a44
commit 470fd62e2f
34 changed files with 65 additions and 106 deletions

View File

@@ -105,6 +105,12 @@ msgstr[1] "Baked Sweet Potatoes"
msgid "item.baked_sweet_potato.description"
msgstr "A sweet potato that has been baked to perfection. It is warm and comforting, perfect for a chilly day."
#
# RECIPES
#
msgid "recipe.baked_sweet_potato.title"
msgstr "Baked Sweet Potato"
#
# SCENES
#

View File

@@ -17,19 +17,19 @@ config/icon="res://icon.svg"
[autoload]
BATTLE="*res://scripts/Singleton/Battle.gd"
COOKING="*res://scripts/Singleton/Cooking.gd"
OVERWORLD="*res://scripts/Singleton/Overworld.gd"
BATTLE="*res://scripts/Singleton/BattleSystem.gd"
COOKING="*res://scripts/Singleton/CookingSystem.gd"
OVERWORLD="*res://scripts/Singleton/OverworldSystem.gd"
ITEM="*res://scenes/Singletons/Item.tscn"
PAUSE="*res://scripts/Singleton/Pause.gd"
PAUSE="*res://scripts/Singleton/PauseSystem.gd"
QUEST="*res://scenes/Singletons/Quest.tscn"
SCENE_MANAGER="*res://scripts/Singleton/SceneManager.gd"
SCENE_MANAGER="*res://scripts/Singleton/SceneSystem.gd"
UI="*res://scenes/Singletons/UI.tscn"
VN="*res://scripts/Singleton/VN.gd"
VN="*res://scripts/Singleton/VNSystem.gd"
LOAD="*res://scenes/Singletons/Load.tscn"
EVENT="*res://scripts/Singleton/Event.gd"
EVENT="*res://scripts/Singleton/EventSystem.gd"
RECIPE="*res://scenes/Singletons/Recipe.tscn"
LOCALE="*res://scripts/Singleton/Locale.gd"
LOCALE="*res://scripts/Singleton/LocaleSystem.gd"
ControllerIcons="*res://addons/controller_icons/ControllerIcons.gd"
[display]

View File

@@ -1,13 +1,12 @@
[gd_scene load_steps=5 format=3 uid="uid://mfxht4d8pvjj"]
[ext_resource type="Script" uid="uid://1vd57s0j3b2o" path="res://scripts/Singleton/Item.gd" id="1_sv510"]
[ext_resource type="Script" uid="uid://bc4c4eqfrnegb" path="res://scripts/Singleton/ItemSystem.gd" id="1_sv510"]
[ext_resource type="Script" uid="uid://dipe47ljyvycv" path="res://scripts/Item/ingredients/ItemOnion.gd" id="2_w2ka5"]
[ext_resource type="Script" uid="uid://b6v2o563casay" path="res://scripts/Item/medicine/ItemPotion.gd" id="3_q4yin"]
[ext_resource type="Script" uid="uid://c6t5tprnd23t0" path="res://scripts/Item/Item.gd" id="3_v1lpn"]
[node name="Item" type="Node"]
script = ExtResource("1_sv510")
metadata/_custom_type_script = "uid://1vd57s0j3b2o"
[node name="Ingredients" type="Node" parent="."]

View File

@@ -1,12 +1,11 @@
[gd_scene load_steps=4 format=3 uid="uid://cs3kmmd0rfm8w"]
[ext_resource type="Script" uid="uid://d0060jeyftia7" path="res://scripts/Singleton/Quest.gd" id="1_v2h4q"]
[ext_resource type="Script" uid="uid://dnlg1e8une55l" path="res://scripts/Singleton/QuestSystem.gd" id="1_v2h4q"]
[ext_resource type="Script" uid="uid://dn0kxbe85n40f" path="res://scripts/Quest/Quest.gd" id="2_n4ii1"]
[ext_resource type="Script" uid="uid://de1ao4huhy0hm" path="res://scripts/Quest/QuestObjective.gd" id="3_l8p7p"]
[node name="QuestSystem" type="Node"]
script = ExtResource("1_v2h4q")
metadata/_custom_type_script = "uid://d0060jeyftia7"
[node name="Quests" type="Node" parent="."]

View File

@@ -1,27 +1,27 @@
[gd_scene load_steps=6 format=3 uid="uid://1l0tymk8cfxu"]
[ext_resource type="Script" uid="uid://j87s6jrx8unn" path="res://scripts/Singleton/Recipe.gd" id="1_o4nv4"]
[ext_resource type="Script" uid="uid://b83k8ksk1dpu2" path="res://scripts/Singleton/RecipeSystem.gd" id="1_o4nv4"]
[ext_resource type="Script" uid="uid://dipvg4uwjv6p2" path="res://scripts/Cooking/Recipe.gd" id="2_f5akq"]
[ext_resource type="Script" uid="uid://c26aptwsjs044" path="res://scripts/Item/ItemResource.gd" id="3_b8y03"]
[sub_resource type="Resource" id="Resource_3dxl6"]
script = ExtResource("3_b8y03")
itemType = 2
itemType = 3
count = 1
metadata/_custom_type_script = "uid://c26aptwsjs044"
[sub_resource type="Resource" id="Resource_b8y03"]
script = ExtResource("3_b8y03")
itemType = 1
itemType = 4
count = 1
metadata/_custom_type_script = "uid://c26aptwsjs044"
[node name="RecipeSystem" type="Node"]
script = ExtResource("1_o4nv4")
metadata/_custom_type_script = "uid://j87s6jrx8unn"
[node name="Ash-Baked Sweet Potato" type="Node" parent="."]
[node name="Baked Sweet Potato" type="Node" parent="."]
script = ExtResource("2_f5akq")
title = "recipe.baked_sweet_potato.title"
ingredients = Array[ExtResource("3_b8y03")]([SubResource("Resource_3dxl6")])
outputs = Array[ExtResource("3_b8y03")]([SubResource("Resource_b8y03")])
metadata/_custom_type_script = "uid://dipvg4uwjv6p2"

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=7 format=3 uid="uid://b5bwpsh0gcicf"]
[ext_resource type="Script" uid="uid://dahhuhiu8u88b" path="res://scripts/Singleton/UI.gd" id="1_g3au4"]
[ext_resource type="Script" uid="uid://kvdgrmutu6hl" path="res://scripts/Singleton/UISystem.gd" id="1_g3au4"]
[ext_resource type="PackedScene" uid="uid://verg13jtqwvh" path="res://scenes/UI/DebugMenu.tscn" id="2_is0g4"]
[ext_resource type="PackedScene" uid="uid://bfioi52hjn2kf" path="res://scenes/UI/QuestMenu.tscn" id="2_mpokx"]
[ext_resource type="PackedScene" uid="uid://bkx3l0kckf4a8" path="res://scenes/UI/VNTextbox.tscn" id="3_btpxp"]
@@ -16,7 +16,6 @@ grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_g3au4")
metadata/_custom_type_script = "uid://dahhuhiu8u88b"
[node name="QuestMenu" parent="." instance=ExtResource("2_mpokx")]
visible = false

View File

@@ -1,48 +0,0 @@
class_name Battle
const BattleFighter = preload("res://scripts/Battle/BattleFighter.gd");
enum FighterPosition {
LEFT_TOP = 0,
LEFT_CENTER = 1,
LEFT_BOTTOM = 2,
CENTER_TOP = 3,
CENTER_CENTER = 4,
CENTER_BOTTOM = 5,
RIGHT_TOP = 6,
RIGHT_CENTER = 7,
RIGHT_BOTTOM = 8,
ENEMY_DEFAULT = LEFT_CENTER,
PLAYER_DEFAULT = RIGHT_CENTER,
};
var fighters:Array = [];
func addFighter(fighter:BattleFighter, position:FighterPosition):
if fighters.has(position):
push_error("Fighter already exists at position");
return
fighters[position] = fighter;
func moveFighter(fighter:BattleFighter, position:FighterPosition):
if fighters.has(position):
push_error("Fighter already exists at position");
return
if not fighters.has(fighter):
push_error("Fighter does not exist");
return
removeFighter(fighter);
addFighter(fighter, position);
func getFightersOfTeam(team:BattleFighter.BattleFighterTeam):
var result = [];
for fighter in fighters:
if fighter.team != team:
continue
result.append(fighter);
return result;
func removeFighter(fighter:BattleFighter):
fighters.erase(fighter);

View File

@@ -1 +0,0 @@
uid://kwijyojokkpm

View File

@@ -1,10 +0,0 @@
class_name BattleFighter
enum BattleFighterTeam {
PLAYER,
ENEMY
};
var team:BattleFighterTeam;
var health:int = 100;
var maxHealth:int = 100;

View File

@@ -1 +0,0 @@
uid://daksbecm02l3t

View File

@@ -1,6 +1,11 @@
class_name Recipe extends Node
@export var title:String = ""
enum Type {
BAKED_SWEET_POTATO,
}
@export_multiline var title:String = ""
@export var type:Type = Type.BAKED_SWEET_POTATO
@export var ingredients:Array[ItemResource] = []
@export var outputs:Array[ItemResource] = []

View File

@@ -1,7 +1,5 @@
class_name EventPause extends "res://scripts/Event/Event.gd"
const PauseSystem = preload("res://scripts/Singleton/Pause.gd")
@export var pauseType:PauseSystem.PauseType = PauseSystem.PauseType.ENTITY_PAUSED
@export var entities:Array[Entity] = []
@export var includeInteractee:bool = true

View File

@@ -1,9 +0,0 @@
extends Node
const Battle = preload("res://scripts/Battle/Battle.gd");
var battle:Battle = null;
func startBattle(battle:Battle) -> void:
print("start battle");
self.battle = battle;

View File

@@ -0,0 +1 @@
class_name BattleSystem extends Node

View File

@@ -1 +0,0 @@
extends Node

View File

@@ -0,0 +1 @@
class_name CookingSystem extends Node

View File

@@ -0,0 +1 @@
uid://dy8gbmwddma3b

View File

@@ -1 +0,0 @@
class_name LoadManager extends Node

View File

@@ -0,0 +1 @@
class_name LoadSystem extends Node

View File

@@ -0,0 +1 @@
uid://07tsn64m0l1y

View File

@@ -0,0 +1 @@
uid://ggg3o3aawvh5

View File

@@ -1,4 +1,4 @@
extends Node
class_name OverworldSystem extends Node
const MAPS:Dictionary[String, String] = {
"TestMap": "res://scenes/Maps/TestMap/TestMap.tscn"

View File

@@ -1,11 +0,0 @@
class_name RecipeSystem extends Node
enum Type {
ASH_BAKED_SWEET_POTATO,
}
func _init() -> void:
pass

View File

@@ -0,0 +1,27 @@
class_name RecipeSystem extends Node
var RECIPE_MAP:Dictionary[Recipe.Type, Recipe] = {}
func _recurseChildren(node:Node) -> void:
if node is Recipe:
var recipe:Recipe = node as Recipe
if recipe.type in RECIPE_MAP:
assert(false, "Duplicate recipe type found: " + str(recipe.type))
RECIPE_MAP[recipe.type] = recipe
else:
for child in node.get_children():
_recurseChildren(child)
func _updateRecipes() -> void:
RECIPE_MAP = {}
_recurseChildren(self)
func _enter_tree() -> void:
_updateRecipes()
for recipeType in Recipe.Type.values():
if !RECIPE_MAP.has(recipeType):
assert(false, "Missing recipe type: " + Recipe.Type.find_key(recipeType))
func _init() -> void:
_updateRecipes()

View File

@@ -0,0 +1 @@
uid://b83k8ksk1dpu2

View File

@@ -1,4 +1,4 @@
class_name SceneManager extends Node
class_name SceneSystem extends Node
const MainMenu = preload("res://scenes/MainMenu.tscn");
const OverworldScene = preload("res://scenes/Overworld.tscn");

View File

@@ -0,0 +1 @@
uid://kvdgrmutu6hl