- Consumable-System: Tränke (HP/Mana) mit Stacking, Rechtsklick-Benutzung, Aktionsleisten-Zuweisung - Klassen-Ressourcen: ResourceType (NONE/MANA/RAGE/ENERGY) pro Klasse statt universelles Mana - Hauptmenü: Einstellungen für Auflösung, Fenstermodus, VSync, MSAA - Item-Icons: SVG-Icons für alle Equipment-Items und Tränke - Character Panel: Icon-Grid mit Hover-Tooltips statt Textanzeige - HUD: Ressourcen-Leiste mit klassenabhängiger Farbe - Loot: Consumable-Support in LootTable/LootWindow - Dokumentation vollständig aktualisiert Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
30 lines
725 B
GDScript
30 lines
725 B
GDScript
# LootTable.gd
|
|
# Definiert mögliche Drops eines Gegners
|
|
extends Resource
|
|
class_name LootTable
|
|
|
|
# Gold-Drop
|
|
@export var min_gold: int = 1
|
|
@export var max_gold: int = 5
|
|
|
|
# Item-Drops mit Wahrscheinlichkeiten
|
|
@export var possible_drops: Array[LootEntry] = []
|
|
|
|
# Generiert Loot basierend auf Tabelle
|
|
func generate_loot() -> Dictionary:
|
|
var result = {
|
|
"gold": randi_range(min_gold, max_gold),
|
|
"items": []
|
|
}
|
|
|
|
for entry in possible_drops:
|
|
if randf() <= entry.drop_chance:
|
|
# Consumables kopieren damit Stacks unabhängig bleiben
|
|
if entry.item is Consumable:
|
|
var copy = entry.item.duplicate()
|
|
copy.stack_size = 1
|
|
result["items"].append(copy)
|
|
else:
|
|
result["items"].append(entry.item)
|
|
|
|
return result
|