feat(inventory): hotbar + inventory UI + 5 crafting recipes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
65
scripts/inventory/ItemDatabase.gd
Normal file
65
scripts/inventory/ItemDatabase.gd
Normal file
@@ -0,0 +1,65 @@
|
||||
extends Node
|
||||
|
||||
const ITEM_NAMES: Dictionary = {
|
||||
0: "Air",
|
||||
1: "Water",
|
||||
2: "Sand",
|
||||
3: "Rock",
|
||||
4: "Coral Rouge",
|
||||
5: "Coral Bleu",
|
||||
6: "Kelp",
|
||||
7: "Epave",
|
||||
8: "Glace",
|
||||
9: "Bedrock",
|
||||
100: "Lampe Bio",
|
||||
101: "Harpon",
|
||||
102: "Bulle d'air",
|
||||
103: "Algue cuisinee",
|
||||
104: "Armure ecailles",
|
||||
}
|
||||
|
||||
const ITEM_COLORS: Dictionary = {
|
||||
0: Color(0, 0, 0, 0),
|
||||
1: Color(0.1, 0.3, 0.8, 0.5),
|
||||
2: Color(0.76, 0.70, 0.50),
|
||||
3: Color(0.45, 0.45, 0.45),
|
||||
4: Color(0.9, 0.2, 0.2),
|
||||
5: Color(0.2, 0.4, 0.9),
|
||||
6: Color(0.1, 0.6, 0.1),
|
||||
7: Color(0.55, 0.35, 0.15),
|
||||
8: Color(0.7, 0.9, 1.0),
|
||||
9: Color(0.15, 0.15, 0.15),
|
||||
100: Color(1.0, 0.95, 0.2),
|
||||
101: Color(0.6, 0.6, 0.6),
|
||||
102: Color(0.2, 0.9, 0.9),
|
||||
103: Color(0.05, 0.4, 0.05),
|
||||
104: Color(0.1, 0.55, 0.5),
|
||||
}
|
||||
|
||||
const PLACEABLE_IDS: Array = [2, 3, 4, 5, 6, 7, 8]
|
||||
const CONSUMABLE_IDS: Array = [102, 103]
|
||||
const TOOL_IDS: Array = [100, 101, 104]
|
||||
|
||||
|
||||
func get_item_name(id: int) -> String:
|
||||
if ITEM_NAMES.has(id):
|
||||
return ITEM_NAMES[id]
|
||||
return "Inconnu"
|
||||
|
||||
|
||||
func get_item_color(id: int) -> Color:
|
||||
if ITEM_COLORS.has(id):
|
||||
return ITEM_COLORS[id]
|
||||
return Color(0.5, 0.5, 0.5)
|
||||
|
||||
|
||||
func is_placeable(id: int) -> bool:
|
||||
return id in PLACEABLE_IDS
|
||||
|
||||
|
||||
func is_consumable(id: int) -> bool:
|
||||
return id in CONSUMABLE_IDS
|
||||
|
||||
|
||||
func is_tool(id: int) -> bool:
|
||||
return id in TOOL_IDS
|
||||
Reference in New Issue
Block a user