Spell points are off now, as I think trainers will work better for this game. Made the spell book window handle it properly.

This commit is contained in:
Relintai 2020-09-10 10:46:49 +02:00
parent 6fb1f1ca9b
commit 6a70b36e04
3 changed files with 44 additions and 24 deletions

View File

@ -195,7 +195,6 @@ window/size/ui_scale_touch=1.0
[ess]
spells/use_spell_points=true
level/auto_learn_spells=false
data/ess_resource_db_path="res://data/resource_db.tres"
data/ess_entity_spawner_path="res://player/bs_entity_spawner.tres"

View File

@ -64,6 +64,9 @@ func _ready() -> void:
_prev_button.connect("pressed", self, "dec_page")
_next_button.connect("pressed", self, "inc_page")
if ESS.use_spell_points:
_spell_points_label.text = ""
connect("visibility_changed", self, "_visibility_changed")
@ -135,7 +138,8 @@ func refresh_all() -> void:
if _page > _max_pages:
_page = _max_pages
_spell_points_label.text = "Free spell points: " + str(_player.getc_free_spell_points())
if ESS.use_spell_points:
_spell_points_label.text = "Free spell points: " + str(_player.getc_free_spell_points())
refresh_entries()

View File

@ -106,28 +106,45 @@ func spell_button_pressed() -> void:
_popup.popup(Rect2(pos, _popup.rect_size))
func update_spell_indicators():
if _spell_known && ESS.use_spell_points:
get_node(known_label_path).show()
get_node(learn_button_path).hide()
modulate = known_color
if ESS.use_spell_points:
if _spell_known:
get_node(known_label_path).show()
get_node(learn_button_path).hide()
modulate = known_color
else:
if _spell != null:
if _spell.training_required_spell:
if not _player.spell_hasc(_spell.training_required_spell):
if ESS.use_spell_points:
get_node(known_label_path).hide()
get_node(learn_button_path).show()
modulate = unlearnable_color
return
if ESS.use_spell_points:
get_node(known_label_path).hide()
get_node(learn_button_path).show()
modulate = not_known_color
else:
if _spell != null:
if _spell.training_required_spell:
if not _player.spell_hasc(_spell.training_required_spell):
if ESS.use_spell_points:
get_node(known_label_path).hide()
get_node(learn_button_path).show()
modulate = unlearnable_color
return
if ESS.use_spell_points:
get_node(known_label_path).hide()
get_node(learn_button_path).show()
modulate = not_known_color
get_node(known_label_path).hide()
get_node(learn_button_path).hide()
if _spell_known:
modulate = known_color
else:
if _spell != null:
if _spell.training_required_spell:
if not _player.spell_hasc(_spell.training_required_spell):
modulate = unlearnable_color
return
modulate = not_known_color