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

@@ -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