Amount check

This commit is contained in:
Rendo 2025-12-12 02:15:02 +05:00
commit 82539c5af8
3 changed files with 15 additions and 2 deletions

View file

@ -79,6 +79,12 @@ func get_empty_ability_slot() -> StringName:
return "ability_third"
return "ability_first"
func can_add_ability(ability: StringName, slot: StringName) -> bool:
for ability_slot in ["ability_first","ability_second","ability_third"]:
if slots[ability_slot] != null and slots[ability_slot].registry_entry == ability:
return false
return can_add(slot)
func switch(to: StringName, exit: bool = true):
if slots.has(to) == false or slots[to] == null or slots[to] == current_state or (multiplayer.get_remote_sender_id() != 1 and is_multiplayer_authority() == false):
return