feat: ItemType enum in Equipment + sauberer Schild-Check
- Equipment: ItemType enum (ARMOR, WEAPON, SHIELD, OFFHAND) - player.gd: _has_shield() prüft item_type == SHIELD statt nur Slot-Inhalt - Durchbeißen nutzt _has_shield() für Schildwall/Trotz Entscheidung Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c8ef56d311
commit
799ff23f75
2 changed files with 14 additions and 2 deletions
|
|
@ -20,8 +20,16 @@ enum Rarity {
|
|||
EPIC # Lila
|
||||
}
|
||||
|
||||
enum ItemType {
|
||||
ARMOR, # Rüstung (Helm, Brust, etc.)
|
||||
WEAPON, # Waffe
|
||||
SHIELD, # Schild (Offhand)
|
||||
OFFHAND, # Andere Nebenhand (Buch, Quiver, etc.)
|
||||
}
|
||||
|
||||
@export var item_name: String = "Unbekannt"
|
||||
@export var slot: Slot = Slot.WEAPON
|
||||
@export var item_type: ItemType = ItemType.WEAPON
|
||||
@export var rarity: Rarity = Rarity.COMMON
|
||||
|
||||
# Stats die das Item gibt
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ func _init_class_skills():
|
|||
"cast_time": 0.0,
|
||||
})
|
||||
if level >= 10:
|
||||
var has_offhand = equipment[Equipment.Slot.OFFHAND] != null
|
||||
var has_offhand = _has_shield()
|
||||
available_skills.append({
|
||||
"id": "durchbeissen",
|
||||
"name": "Schildwall" if has_offhand else "Trotz",
|
||||
|
|
@ -746,8 +746,12 @@ func _do_tektonischer_schlag():
|
|||
|
||||
# ─── Durchbeißen / Schildwall / Trotz ────────────────────────
|
||||
|
||||
func _has_shield() -> bool:
|
||||
var offhand = equipment[Equipment.Slot.OFFHAND]
|
||||
return offhand != null and offhand.item_type == Equipment.ItemType.SHIELD
|
||||
|
||||
func _do_durchbeissen():
|
||||
var has_offhand = equipment[Equipment.Slot.OFFHAND] != null
|
||||
var has_offhand = _has_shield()
|
||||
_defend_mode = "schildwall" if has_offhand else "trotz"
|
||||
is_defending = true
|
||||
_defend_timer = DURCHBEISSEN_DURATION
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue