Consistent SYSTEMS
This commit is contained in:
@@ -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);
|
@@ -1 +0,0 @@
|
||||
uid://kwijyojokkpm
|
@@ -1,10 +0,0 @@
|
||||
class_name BattleFighter
|
||||
|
||||
enum BattleFighterTeam {
|
||||
PLAYER,
|
||||
ENEMY
|
||||
};
|
||||
|
||||
var team:BattleFighterTeam;
|
||||
var health:int = 100;
|
||||
var maxHealth:int = 100;
|
@@ -1 +0,0 @@
|
||||
uid://daksbecm02l3t
|
@@ -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] = []
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
1
scripts/Singleton/BattleSystem.gd
Normal file
1
scripts/Singleton/BattleSystem.gd
Normal file
@@ -0,0 +1 @@
|
||||
class_name BattleSystem extends Node
|
@@ -1 +0,0 @@
|
||||
extends Node
|
1
scripts/Singleton/CookingSystem.gd
Normal file
1
scripts/Singleton/CookingSystem.gd
Normal file
@@ -0,0 +1 @@
|
||||
class_name CookingSystem extends Node
|
1
scripts/Singleton/EventSystem.gd.uid
Normal file
1
scripts/Singleton/EventSystem.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dy8gbmwddma3b
|
@@ -1 +0,0 @@
|
||||
class_name LoadManager extends Node
|
1
scripts/Singleton/LoadSystem.gd
Normal file
1
scripts/Singleton/LoadSystem.gd
Normal file
@@ -0,0 +1 @@
|
||||
class_name LoadSystem extends Node
|
1
scripts/Singleton/LoadSystem.gd.uid
Normal file
1
scripts/Singleton/LoadSystem.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://07tsn64m0l1y
|
1
scripts/Singleton/LocaleSystem.gd.uid
Normal file
1
scripts/Singleton/LocaleSystem.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://ggg3o3aawvh5
|
@@ -1,4 +1,4 @@
|
||||
extends Node
|
||||
class_name OverworldSystem extends Node
|
||||
|
||||
const MAPS:Dictionary[String, String] = {
|
||||
"TestMap": "res://scenes/Maps/TestMap/TestMap.tscn"
|
@@ -1,11 +0,0 @@
|
||||
class_name RecipeSystem extends Node
|
||||
|
||||
enum Type {
|
||||
ASH_BAKED_SWEET_POTATO,
|
||||
}
|
||||
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
|
||||
pass
|
27
scripts/Singleton/RecipeSystem.gd
Normal file
27
scripts/Singleton/RecipeSystem.gd
Normal 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()
|
1
scripts/Singleton/RecipeSystem.gd.uid
Normal file
1
scripts/Singleton/RecipeSystem.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b83k8ksk1dpu2
|
@@ -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");
|
1
scripts/Singleton/UISystem.gd.uid
Normal file
1
scripts/Singleton/UISystem.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://kvdgrmutu6hl
|
Reference in New Issue
Block a user