DungeonCrawler/equipment.gd
Andre 9ed18e034c Waffen-Modell an Spielerhand via BoneAttachment3D
Schwert (medieval_sword.glb) wird zur Laufzeit an mixamorig_RightHand
gehängt. Modell erscheint/verschwindet beim Ausrüsten/Ablegen.
Equipment-Ressource um model_scene Property erweitert.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 01:25:19 +01:00

66 lines
1.7 KiB
GDScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Equipment.gd
# Resource für Ausrüstungsgegenstände
extends Resource
class_name Equipment
enum Slot {
HEAD, # Helm
CHEST, # Brustpanzer
HANDS, # Handschuhe
LEGS, # Beinschienen
FEET, # Stiefel
WEAPON, # Waffe
OFFHAND # Nebenhand (Schild, etc.)
}
enum Rarity {
COMMON, # Weiß
UNCOMMON, # Grün
RARE, # Blau
EPIC # Lila
}
@export var item_name: String = "Unbekannt"
@export var slot: Slot = Slot.WEAPON
@export var rarity: Rarity = Rarity.COMMON
# Stats die das Item gibt
@export var armor: int = 0
@export var strength: int = 0
@export var agility: int = 0
@export var intelligence: int = 0
@export var stamina: int = 0
@export var haste: float = 0.0 # Angriffsgeschwindigkeit (0.1 = 10% schneller)
# Nur für Waffen
@export var min_damage: int = 0
@export var max_damage: int = 0
@export var attack_speed: float = 1.5 # Sekunden zwischen Angriffen
@export var weapon_range: float = 3.0
# 3D-Modell (GLB/GLTF) wird an der Hand des Spielers angezeigt
@export var model_scene: PackedScene
# Icon für UI
@export var icon: Texture2D
# Slot-Namen für Anzeige
static func get_slot_name(s: Slot) -> String:
match s:
Slot.HEAD: return "Kopf"
Slot.CHEST: return "Brust"
Slot.HANDS: return "Hände"
Slot.LEGS: return "Beine"
Slot.FEET: return "Füße"
Slot.WEAPON: return "Waffe"
Slot.OFFHAND: return "Nebenhand"
return "Unbekannt"
# Seltenheitsfarbe
static func get_rarity_color(r: Rarity) -> Color:
match r:
Rarity.COMMON: return Color(1, 1, 1) # Weiß
Rarity.UNCOMMON: return Color(0.2, 0.8, 0.2) # Grün
Rarity.RARE: return Color(0.3, 0.5, 1.0) # Blau
Rarity.EPIC: return Color(0.7, 0.3, 0.9) # Lila
return Color(1, 1, 1)