From 67e327f471c800457e393d1ab722e7d2a544bdb6 Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 10 Jul 2020 15:25:32 +0200 Subject: [PATCH] Update ESS to get the Entity level simplifications. --- game/modules/core/xp/xp_data.tres | 52 +++++++++++++++++++++++++++- game/player/Mob.gd | 14 ++++---- game/player/bs_entity_spawner.gd | 27 +++++++-------- game/scenes/CharacterSelectorMenu.gd | 2 +- game/scenes/World.tscn | 4 +++ game/ui/unitframes/UnitframeBase.gd | 12 +++---- 6 files changed, 82 insertions(+), 29 deletions(-) diff --git a/game/modules/core/xp/xp_data.tres b/game/modules/core/xp/xp_data.tres index 69c47ad1..45fd25ed 100644 --- a/game/modules/core/xp/xp_data.tres +++ b/game/modules/core/xp/xp_data.tres @@ -10,7 +10,57 @@ character_level/6 = 7 character_level/7 = 8 character_level/8 = 9 character_level/9 = 1 -character_level/10 = null +character_level/10 = 1 +character_level/11 = 1 +character_level/12 = 1 +character_level/13 = 1 +character_level/14 = 1 +character_level/15 = 1 +character_level/16 = 1 +character_level/17 = 1 +character_level/18 = 1 +character_level/19 = 1 +character_level/20 = 1 +character_level/21 = 1 +character_level/22 = 1 +character_level/23 = 1 +character_level/24 = 1 +character_level/25 = 1 +character_level/26 = 1 +character_level/27 = 1 +character_level/28 = 1 +character_level/29 = 1 +character_level/30 = 1 +character_level/31 = 1 +character_level/32 = 1 +character_level/33 = 1 +character_level/34 = 1 +character_level/35 = 1 +character_level/36 = 1 +character_level/37 = 1 +character_level/38 = 1 +character_level/39 = 1 +character_level/40 = 1 +character_level/41 = 1 +character_level/42 = 1 +character_level/43 = 1 +character_level/44 = 1 +character_level/45 = 1 +character_level/46 = 1 +character_level/47 = 1 +character_level/48 = 1 +character_level/49 = 1 +character_level/50 = 1 +character_level/51 = 1 +character_level/52 = 1 +character_level/53 = 1 +character_level/54 = 1 +character_level/55 = 1 +character_level/56 = 1 +character_level/57 = 1 +character_level/58 = 1 +character_level/59 = 1 +character_level/60 = null class_level/1 = 1 class_level/2 = 1 class_level/3 = 1 diff --git a/game/player/Mob.gd b/game/player/Mob.gd index 855cedb4..466bc1fa 100644 --- a/game/player/Mob.gd +++ b/game/player/Mob.gd @@ -72,7 +72,7 @@ func _notification_sdeath(): dead = true - var ldiff : float = scharacter_level - starget.scharacter_level + 10.0 + var ldiff : float = slevel - starget.slevel + 10.0 if ldiff < 0: ldiff = 0 @@ -82,7 +82,7 @@ func _notification_sdeath(): ldiff /= 10.0 - starget.xp_adds(int(5.0 * scharacter_level * ldiff)) + starget.xp_adds(int(5.0 * slevel * ldiff)) starget = null @@ -111,14 +111,14 @@ func _notification_cheal(what, info): WorldNumbers.heal(get_body().translation, 1.6, info.heal, info.crit) func _notification_sxp_gained(value : int) -> void: - if not ESS.get_resource_db().get_xp_data().can_character_level_up(gets_character_level()): + if not ESS.get_resource_db().get_xp_data().can_character_level_up(slevel): return - var xpr : int = ESS.get_resource_db().get_xp_data().get_character_xp(gets_character_level()); + var xpr : int = ESS.get_resource_db().get_xp_data().get_character_xp(slevel); - if xpr <= scharacter_xp: - levelup_scharacter(1) - scharacter_xp = 0 + if xpr <= sxp: + levelups(1) + sxp = 0 func _notification_sclass_level_up(value: int): ._notification_sclass_level_up(value) diff --git a/game/player/bs_entity_spawner.gd b/game/player/bs_entity_spawner.gd index fcd13edc..25696685 100644 --- a/game/player/bs_entity_spawner.gd +++ b/game/player/bs_entity_spawner.gd @@ -125,10 +125,9 @@ func spawn_player_for_menu(class_id : int, name : String, parent : Node) -> Enti createinfo.class_id = class_id createinfo.entity_data = cls createinfo.player_name = name - createinfo.character_level = level - createinfo.class_level = class_profile.level - createinfo.character_xp = 0 - createinfo.class_xp = class_profile.xp + createinfo.level = level + createinfo.xp = 0 +# createinfo.class_xp = class_profile.xp createinfo.entity_controller = EntityEnums.ENITIY_CONTROLLER_PLAYER createinfo.entity_player_type = EntityEnums.ENTITY_PLAYER_TYPE_DISPLAY createinfo.networked = false @@ -170,10 +169,10 @@ func spawn_networked_player(class_id : int, position : Vector3, name : String, createinfo.class_id = class_id createinfo.entity_data = cls createinfo.player_name = name - createinfo.character_level = 1 - createinfo.class_level = level - createinfo.character_xp = 0 - createinfo.class_xp = class_profile.xp + createinfo.level = 1 +# createinfo.class_level = level + createinfo.xp = 0 +# createinfo.class_xp = class_profile.xp createinfo.entity_controller = EntityEnums.ENITIY_CONTROLLER_PLAYER createinfo.entity_player_type = EntityEnums.ENTITY_PLAYER_TYPE_NETWORKED createinfo.network_owner = sid @@ -200,10 +199,10 @@ func spawn_player(class_id : int, position : Vector3, name : String, node_name createinfo.class_id = class_id createinfo.entity_data = cls createinfo.player_name = name - createinfo.character_level = 1 - createinfo.class_level = level - createinfo.character_xp = 0 - createinfo.class_xp = class_profile.xp + createinfo.level = 1 +# createinfo.class_level = level + createinfo.xp = 0 +# createinfo.class_xp = class_profile.xp createinfo.entity_controller = EntityEnums.ENITIY_CONTROLLER_PLAYER createinfo.entity_player_type = EntityEnums.ENTITY_PLAYER_TYPE_PLAYER createinfo.network_owner = network_owner @@ -225,8 +224,8 @@ func spawn_mob(class_id : int, level : int, position : Vector3) -> void: createinfo.class_id = class_id createinfo.entity_data = cls createinfo.player_name = "Mob" - createinfo.character_level = level - createinfo.class_level = level + createinfo.level = level +# createinfo.class_level = level createinfo.entity_controller = EntityEnums.ENITIY_CONTROLLER_AI createinfo.entity_player_type = EntityEnums.ENTITY_PLAYER_TYPE_AI createinfo.transform.origin = position diff --git a/game/scenes/CharacterSelectorMenu.gd b/game/scenes/CharacterSelectorMenu.gd index 50061edf..bd850cd1 100644 --- a/game/scenes/CharacterSelectorMenu.gd +++ b/game/scenes/CharacterSelectorMenu.gd @@ -106,7 +106,7 @@ func refresh(): centry.pressed = true centry.connect("pressed", self, "character_selection_changed") - centry.setup(file_name, display.sentity_name, ESS.get_resource_db().get_entity_data(display.characterclass_id).text_name, display.scharacter_level, display.sclass_level, display) + centry.setup(file_name, display.sentity_name, ESS.get_resource_db().get_entity_data(display.characterclass_id).text_name, display.slevel, display.slevel, display) if first_entry == null: first_entry = centry diff --git a/game/scenes/World.tscn b/game/scenes/World.tscn index 1e0b7364..0277f7c5 100644 --- a/game/scenes/World.tscn +++ b/game/scenes/World.tscn @@ -69,6 +69,10 @@ chunk_spawn_range = 6 build_flags = 511 lod_update_interval = 2.0 script = ExtResource( 8 ) +meshes = [ ] +editor_generate = false +show_loading_screen = true +generate_on_ready = false test_prop = ExtResource( 4 ) [node name="WorldEnvironment" type="WorldEnvironment" parent="."] diff --git a/game/ui/unitframes/UnitframeBase.gd b/game/ui/unitframes/UnitframeBase.gd index c13bac1e..fbffa170 100644 --- a/game/ui/unitframes/UnitframeBase.gd +++ b/game/ui/unitframes/UnitframeBase.gd @@ -71,8 +71,8 @@ func set_player(p_player: Entity) -> void: _player = p_player _player.connect("cname_changed", self, "cname_changed") - _player.connect("notification_ccharacter_level_up", self, "clevel_changed") - _player.connect("con_character_level_changed", self, "clevel_changed") + _player.connect("notification_clevel_up", self, "clevel_changed") + _player.connect("con_level_changed", self, "clevel_changed") _player.connect("notification_cxp_gained", self, "notification_cxp_gained") _player.connect("centity_resource_added", self, "centity_resource_added") @@ -84,7 +84,7 @@ func set_player(p_player: Entity) -> void: _health.connect("changed", self, "_on_player_health_changed") _name_text.text = _player.centity_name - _level_text.text = str(_player.ccharacter_level) + _level_text.text = str(_player.clevel) clevel_changed(_player, 0) notification_cxp_gained(_player, 0) @@ -132,9 +132,9 @@ func cname_changed(entity: Entity) -> void: _name_text.text = _player.centity_name func clevel_changed(entity: Entity, value : int) -> void: - _level_text.text = str(_player.ccharacter_level) + _level_text.text = str(_player.clevel) - var xpreq : int = ESS.get_resource_db().get_xp_data().get_character_xp(_player.ccharacter_level) + var xpreq : int = ESS.get_resource_db().get_xp_data().get_character_xp(_player.clevel) if xpreq == 0: _xp_range.value = 0 @@ -146,5 +146,5 @@ func clevel_changed(entity: Entity, value : int) -> void: _xp_range.max_value = xpreq func notification_cxp_gained(entity: Entity, val: int) -> void: - _xp_range.value = _player.ccharacter_xp + _xp_range.value = _player.cxp