Updated ESS methods.

This commit is contained in:
Relintai 2023-10-08 20:26:44 +02:00
parent b11f49172b
commit 740e7520f9
9 changed files with 34 additions and 34 deletions

View File

@ -84,7 +84,7 @@ func _enter_tree() -> void:
character_skeleton = get_node(character_skeleton_path) character_skeleton = get_node(character_skeleton_path)
entity = get_node("..") entity = get_node("..")
entity.set_character_skeleton(character_skeleton) entity.character_skeleton_set(character_skeleton)
# entity.connect("notification_ccast", self, "on_notification_ccast") # entity.connect("notification_ccast", self, "on_notification_ccast")
entity.connect("diesd", self, "on_diesd") entity.connect("diesd", self, "on_diesd")
entity.connect("onc_entity_controller_changed", self, "on_c_controlled_changed") entity.connect("onc_entity_controller_changed", self, "on_c_controlled_changed")
@ -288,7 +288,7 @@ func _unhandled_input(event: InputEvent) -> void:
func try_move(dx, dy): func try_move(dx, dy):
var state : int = entity.getc_state() var state : int = entity.state_getc()
if state & EntityEnums.ENTITY_STATE_TYPE_FLAG_ROOT != 0 or state & EntityEnums.ENTITY_STATE_TYPE_FLAG_STUN != 0: if state & EntityEnums.ENTITY_STATE_TYPE_FLAG_ROOT != 0 or state & EntityEnums.ENTITY_STATE_TYPE_FLAG_STUN != 0:
return return
@ -309,12 +309,12 @@ func try_move(dx, dy):
world.player_moved() world.player_moved()
func move_towards_target(): func move_towards_target():
var state : int = entity.getc_state() var state : int = entity.state_getc()
if state & EntityEnums.ENTITY_STATE_TYPE_FLAG_ROOT != 0 or state & EntityEnums.ENTITY_STATE_TYPE_FLAG_STUN != 0: if state & EntityEnums.ENTITY_STATE_TYPE_FLAG_ROOT != 0 or state & EntityEnums.ENTITY_STATE_TYPE_FLAG_STUN != 0:
return return
var t : Entity = entity.getc_target() var t : Entity = entity.target_getc()
if !t: if !t:
return return
@ -355,7 +355,7 @@ func target(position : Vector2, keep_target : bool = false) -> bool:
if !enemy.get_body().visible: if !enemy.get_body().visible:
return false return false
if entity.getc_target() != enemy: if entity.target_getc() != enemy:
entity.target_crequest_change(enemy.get_path()) entity.target_crequest_change(enemy.get_path())
return true return true
else: else:

View File

@ -136,7 +136,7 @@ func _notification_scharacter_level_up(value: int) -> void:
refresh_spells(value) refresh_spells(value)
func refresh_spells(value: int): func refresh_spells(value: int):
if gets_free_spell_points() == 0 and gets_free_class_talent_points() == 0: if free_spell_points_gets() == 0 and class_talent_points_gets_free() == 0:
return return
var ecd : EntityClassData = sentity_data.entity_class_data var ecd : EntityClassData = sentity_data.entity_class_data

View File

@ -165,7 +165,7 @@ func update_visibility():
if visibility_test(tp.x, tp.y, tpos.x, tpos.y): if visibility_test(tp.x, tp.y, tpos.x, tpos.y):
b.set_visibility(true) b.set_visibility(true)
e.sets_target(_player) e.target_sets(_player)
discovered_enemies.append(e) discovered_enemies.append(e)
@ -494,14 +494,14 @@ func on_visibility_changed():
if b.visible: if b.visible:
b.set_visibility(true) b.set_visibility(true)
e.sets_target(_player) e.target_sets(_player)
else: else:
for e in discovered_enemies: for e in discovered_enemies:
var b = e.get_body() var b = e.get_body()
if b.visible: if b.visible:
b.set_visibility(false) b.set_visibility(false)
e.sets_target(null) e.target_sets(null)
func make_cell_visible(x : int, y : int): func make_cell_visible(x : int, y : int):
visibility_map.set_cell(x, y, -1) visibility_map.set_cell(x, y, -1)

View File

@ -25,14 +25,14 @@ class_name EntityDataGD
# SOFTWARE. # SOFTWARE.
func _sinteract(entity: Entity) -> void: func _sinteract(entity: Entity) -> void:
var target : Entity = entity.gets_target() var target : Entity = entity.target_gets()
if target == null or not is_instance_valid(target): if target == null or not is_instance_valid(target):
return return
if target.sentity_interaction_type == EntityEnums.ENITIY_INTERACTION_TYPE_LOOT: if target.sentity_interaction_type == EntityEnums.ENITIY_INTERACTION_TYPE_LOOT:
if target.gets_entity_data().loot_db != null and target.sbag == null: if target.entity_data_gets().loot_db != null and target.sbag == null:
var ldb : LootDataBase = target.gets_entity_data().loot_db var ldb : LootDataBase = target.entity_data_gets().loot_db
var loot : Array = Array() var loot : Array = Array()
@ -57,7 +57,7 @@ func _sinteract(entity: Entity) -> void:
entity.ssend_open_window(EntityEnums.ENTITY_WINDOW_VENDOR) entity.ssend_open_window(EntityEnums.ENTITY_WINDOW_VENDOR)
func _cans_interact(entity): func _cans_interact(entity):
var target : Entity = entity.gets_target() var target : Entity = entity.target_gets()
if target == null or not is_instance_valid(target): if target == null or not is_instance_valid(target):
return false return false

View File

@ -235,20 +235,20 @@ func add_spell_cast_effect(info : SpellCastInfo) -> void:
if basic_spell_effect != null: if basic_spell_effect != null:
if basic_spell_effect.spell_cast_effect_left_hand != null: if basic_spell_effect.spell_cast_effect_left_hand != null:
info.caster.get_character_skeleton().common_attach_point_add(EntityEnums.COMMON_SKELETON_POINT_LEFT_HAND, basic_spell_effect.spell_cast_effect_left_hand) info.caster.character_skeleton_get().common_attach_point_add(EntityEnums.COMMON_SKELETON_POINT_LEFT_HAND, basic_spell_effect.spell_cast_effect_left_hand)
if basic_spell_effect.spell_cast_effect_right_hand != null: if basic_spell_effect.spell_cast_effect_right_hand != null:
info.caster.get_character_skeleton().common_attach_point_add(EntityEnums.COMMON_SKELETON_POINT_RIGHT_HAND, basic_spell_effect.spell_cast_effect_right_hand) info.caster.character_skeleton_get().common_attach_point_add(EntityEnums.COMMON_SKELETON_POINT_RIGHT_HAND, basic_spell_effect.spell_cast_effect_right_hand)
func remove_spell_cast_effect(info : SpellCastInfo) -> void: func remove_spell_cast_effect(info : SpellCastInfo) -> void:
var basic_spell_effect : SpellEffectVisualBasic = visual_spell_effects as SpellEffectVisualBasic var basic_spell_effect : SpellEffectVisualBasic = visual_spell_effects as SpellEffectVisualBasic
if basic_spell_effect != null: if basic_spell_effect != null:
if basic_spell_effect.spell_cast_effect_left_hand != null: if basic_spell_effect.spell_cast_effect_left_hand != null:
info.caster.get_character_skeleton().common_attach_point_remove(EntityEnums.COMMON_SKELETON_POINT_LEFT_HAND, basic_spell_effect.spell_cast_effect_left_hand) info.caster.character_skeleton_get().common_attach_point_remove(EntityEnums.COMMON_SKELETON_POINT_LEFT_HAND, basic_spell_effect.spell_cast_effect_left_hand)
if basic_spell_effect.spell_cast_effect_right_hand != null: if basic_spell_effect.spell_cast_effect_right_hand != null:
info.caster.get_character_skeleton().common_attach_point_remove(EntityEnums.COMMON_SKELETON_POINT_RIGHT_HAND, basic_spell_effect.spell_cast_effect_right_hand) info.caster.character_skeleton_get().common_attach_point_remove(EntityEnums.COMMON_SKELETON_POINT_RIGHT_HAND, basic_spell_effect.spell_cast_effect_right_hand)
func _notification_ccast(what, info): func _notification_ccast(what, info):
if what == SpellEnums.NOTIFICATION_CAST_STARTED: if what == SpellEnums.NOTIFICATION_CAST_STARTED:
@ -269,10 +269,10 @@ func _notification_ccast(what, info):
if bse != null: if bse != null:
if bse.torso_spell_cast_finish_effect != null: if bse.torso_spell_cast_finish_effect != null:
info.target.get_character_skeleton().common_attach_point_add_timed(EntityEnums.COMMON_SKELETON_POINT_TORSO, bse.torso_spell_cast_finish_effect_time) info.target.character_skeleton_get().common_attach_point_add_timed(EntityEnums.COMMON_SKELETON_POINT_TORSO, bse.torso_spell_cast_finish_effect_time)
if bse.root_spell_cast_finish_effect != null: if bse.root_spell_cast_finish_effect != null:
info.target.get_character_skeleton().common_attach_point_add_timed(EntityEnums.COMMON_SKELETON_POINT_ROOT, bse.root_spell_cast_finish_effect_time) info.target.character_skeleton_get().common_attach_point_add_timed(EntityEnums.COMMON_SKELETON_POINT_ROOT, bse.root_spell_cast_finish_effect_time)
func _son_spell_hit(info): func _son_spell_hit(info):
@ -297,7 +297,7 @@ func _aura_sapply(info : AuraApplyInfo) -> void:
var t : int = 1 << i var t : int = 1 << i
if aura_states_add & t != 0: if aura_states_add & t != 0:
info.target.adds_state_ref(i) info.target.state_ref_adds(i)
info.target.aura_adds(ad); info.target.aura_adds(ad);
@ -315,7 +315,7 @@ func _aura_sdeapply(data : AuraData) -> void:
var t : int = 1 << i var t : int = 1 << i
if aura_states_add & t != 0: if aura_states_add & t != 0:
data.owner.removes_state_ref(i) data.owner.state_ref_removes(i)
deapply_mods(data) deapply_mods(data)
@ -327,7 +327,7 @@ func deapply_mods(ad : AuraData):
func _con_aura_added(data : AuraData) -> void: func _con_aura_added(data : AuraData) -> void:
if data.owner.get_character_skeleton() == null or data.owner.get_character_skeleton().root_attach_point == null: if data.owner.character_skeleton_get() == null or data.owner.character_skeleton_get().root_attach_point == null:
return return
var bse : SpellEffectVisualBasic = visual_spell_effects as SpellEffectVisualBasic var bse : SpellEffectVisualBasic = visual_spell_effects as SpellEffectVisualBasic
@ -335,23 +335,23 @@ func _con_aura_added(data : AuraData) -> void:
if bse != null: if bse != null:
if bse.root_aura_effect != null: if bse.root_aura_effect != null:
if bse.root_aura_effect_time < 0.00001: if bse.root_aura_effect_time < 0.00001:
data.owner.get_character_skeleton().root_attach_point.add_effect(bse.root_aura_effect) data.owner.character_skeleton_get().root_attach_point.add_effect(bse.root_aura_effect)
else: else:
data.owner.get_character_skeleton().root_attach_point.add_effect_timed(bse.root_aura_effect, bse.root_aura_effect_time) data.owner.character_skeleton_get().root_attach_point.add_effect_timed(bse.root_aura_effect, bse.root_aura_effect_time)
if bse.torso_aura_effect != null: if bse.torso_aura_effect != null:
if bse.torso_aura_effect_time < 0.00001: if bse.torso_aura_effect_time < 0.00001:
data.owner.get_character_skeleton().torso_attach_point.add_effect(bse.torso_aura_effect) data.owner.character_skeleton_get().torso_attach_point.add_effect(bse.torso_aura_effect)
else: else:
data.owner.get_character_skeleton().torso_attach_point.add_effect_timed(bse.torso_aura_effect, bse.torso_aura_effect_time) data.owner.character_skeleton_get().torso_attach_point.add_effect_timed(bse.torso_aura_effect, bse.torso_aura_effect_time)
func _con_aura_removed(data : AuraData) -> void: func _con_aura_removed(data : AuraData) -> void:
var bse : SpellEffectVisualBasic = visual_spell_effects as SpellEffectVisualBasic var bse : SpellEffectVisualBasic = visual_spell_effects as SpellEffectVisualBasic
if bse != null: if bse != null:
if bse.root_aura_effect != null and bse.root_aura_effect_time < 0.00001: if bse.root_aura_effect != null and bse.root_aura_effect_time < 0.00001:
data.owner.get_character_skeleton().root_attach_point.remove_effect(bse.root_aura_effect) data.owner.character_skeleton_get().root_attach_point.remove_effect(bse.root_aura_effect)
if bse.torso_aura_effect != null and bse.torso_aura_effect_time < 0.00001: if bse.torso_aura_effect != null and bse.torso_aura_effect_time < 0.00001:
data.owner.get_character_skeleton().torso_attach_point.remove_effect(bse.torso_aura_effect) data.owner.character_skeleton_get().torso_attach_point.remove_effect(bse.torso_aura_effect)

View File

@ -9,7 +9,7 @@ func _pressed():
if _player && is_instance_valid(_player): if _player && is_instance_valid(_player):
var abp : ActionBarProfile = _player.get_action_bar_profile() var abp : ActionBarProfile = _player.get_action_bar_profile()
var cp : ClassProfile = ProfileManager.getc_player_profile().get_class_profile(_player.gets_entity_data().get_path()) var cp : ClassProfile = ProfileManager.getc_player_profile().get_class_profile(_player.entity_data_gets().get_path())
cp.get_default_action_bar_profile().from_actionbar_profile(abp) cp.get_default_action_bar_profile().from_actionbar_profile(abp)

View File

@ -32,7 +32,7 @@ func set_player(player : Entity):
_player = player _player = player
on_data_changed(_player.getc_entity_data()) on_data_changed(_player.entity_data_getc())
_player.connect("centity_data_changed", self, "on_data_changed") _player.connect("centity_data_changed", self, "on_data_changed")
@ -150,7 +150,7 @@ func close():
InputMap.load_from_globals() InputMap.load_from_globals()
if _player: if _player:
ProfileManager.on_keybinds_changed(_player.getc_entity_data().get_path()) ProfileManager.on_keybinds_changed(_player.entity_data_getc().get_path())
hide() hide()

View File

@ -137,7 +137,7 @@ func refresh_all() -> void:
_page = _max_pages _page = _max_pages
if ESS.use_spell_points: if ESS.use_spell_points:
_spell_points_label.text = "Free spell points: " + str(_player.getc_free_spell_points()) _spell_points_label.text = "Free spell points: " + str(_player.free_spell_points_getc())
refresh_entries() refresh_entries()
@ -162,7 +162,7 @@ func set_player(p_player: Entity) -> void:
centity_data_changed(null) centity_data_changed(null)
func cfree_spell_points_changed(entity: Entity, value: int) -> void: func cfree_spell_points_changed(entity: Entity, value: int) -> void:
_spell_points_label.text = "Free spell points: " + str(_player.getc_free_spell_points()) _spell_points_label.text = "Free spell points: " + str(_player.free_spell_points_getc())
func centity_data_changed(data: EntityData): func centity_data_changed(data: EntityData):
_spells.clear() _spells.clear()

View File

@ -134,7 +134,7 @@ func _visibility_changed() -> void:
if !t: if !t:
return return
_vendor_item_data = t.getc_entity_data().entity_class_data.get_vendor_item_data() _vendor_item_data = t.entity_data_getc().entity_class_data.get_vendor_item_data()
_page = 0 _page = 0
refresh_all() refresh_all()