fix spider bat boss alittle

This commit is contained in:
2026-02-06 02:49:58 +01:00
parent 9b8d84357f
commit fa7e969363
86 changed files with 4319 additions and 763 deletions

View File

@@ -40,8 +40,8 @@ var equipment_selection_index: int = 0 # Current equipment slot index (0-5: main
# Bar layout constants (align X/Y + bar across rows)
const _BAR_WIDTH: int = 100
const _BAR_VALUE_MIN_WIDTH: int = 44 # "999/999"
const _BAR_LABEL_MIN_WIDTH: int = 52 # "Weight:", "Exp:", "HP:", "MP:", "Coin:"
const _BAR_VALUE_MIN_WIDTH: int = 44 # "999/999"
const _BAR_LABEL_MIN_WIDTH: int = 52 # "Weight:", "Exp:", "HP:", "MP:", "Coin:"
# Weight UI elements (created programmatically)
var weight_container: HBoxContainer = null
@@ -257,18 +257,19 @@ func _update_stats():
str(char_stats.baseStats.lck) + "\n" + \
str(char_stats.baseStats.get("per", 10))
# Derived stats: DMG, DEF, MovSpd, AtkSpd, Sight, SpellAmp, Crit% (XP/Coin moved to exp meter & coin UI)
# Derived stats: DMG, DEF, MovSpd, AtkSpd, Sight, SpellAmp, Crit%, Dodge% (XP/Coin moved to exp meter & coin UI)
if label_derived_stats:
label_derived_stats.text = "DMG\nDEF\nMovSpd\nAtkSpd\nSight\nSpellAmp\nCrit%"
label_derived_stats.text = "DMG\nDEF\nMovSpd\nAtkSpd\nSight\nSpellAmp\nCrit%\nDodge%"
if label_derived_stats_value:
label_derived_stats_value.text = "%.1f\n%.1f\n%.2f\n%.2f\n%.1f\n%.1f\n%.1f%%" % [
label_derived_stats_value.text = "%.1f\n%.1f\n%.2f\n%.2f\n%.1f\n%.1f\n%.1f%%\n%.1f%%" % [
char_stats.damage,
char_stats.defense,
char_stats.move_speed,
char_stats.attack_speed,
char_stats.sight,
char_stats.spell_amp,
char_stats.crit_chance
char_stats.crit_chance,
char_stats.dodge_chance * 100.0
]
# HP bar
@@ -1042,7 +1043,7 @@ func _update_selection_from_navigation():
var row = inventory_rows_list[inventory_selection_row]
print("InventoryUI: Checking item selection - row: ", inventory_selection_row, " col: ", inventory_selection_col, " row exists: ", row != null, " row child count: ", row.get_child_count() if row else 0)
if row and inventory_selection_col >= 0 and inventory_selection_col < row.get_child_count():
var items_per_row = 8 # Must match the items_per_row used when building rows
var items_per_row = 8 # Must match the items_per_row used when building rows
var item_index = inventory_selection_row * items_per_row + inventory_selection_col
print("InventoryUI: Calculated item_index: ", item_index, " inventory_items_list.size(): ", inventory_items_list.size())
if item_index >= 0 and item_index < inventory_items_list.size():
@@ -1368,7 +1369,7 @@ func _on_inventory_item_pressed(item: Item):
_update_selection_highlight()
_update_selection_rectangle()
_update_info_panel() # Show item description on single-click
_update_info_panel() # Show item description on single-click
func _on_inventory_item_gui_input(event: InputEvent, item: Item):
# Handle double-click to equip/consume and right-click to drop
@@ -1679,6 +1680,9 @@ func _use_consumable_item(item: Item):
if item.modifiers.has("mp"):
var mana_amount = item.modifiers["mp"]
char_stats.restore_mana(mana_amount)
# Dodge potion (and any consumable with dodge_chance + duration): apply temporary dodge buff
if item.modifiers.has("dodge_chance") and item.duration > 0:
char_stats.add_buff_dodge_chance(item.modifiers["dodge_chance"], item.duration)
var index = char_stats.inventory.find(item)
if index >= 0:
@@ -1845,3 +1849,6 @@ func _lock_player_controls(lock: bool):
var local_players = player_manager.get_local_players()
for player in local_players:
player.controls_disabled = lock
if lock:
# Stop movement immediately when opening inventory (physics may have already run this frame)
player.velocity = Vector2.ZERO