From 19b158c877119819aa3bcc55edc3c5aee9c5f825 Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 10 Jul 2020 17:18:03 +0200 Subject: [PATCH] Update ESS to get the XPData rework. --- HEADS | 2 +- game/modules/core/resource_db.tres | 4 +- game/modules/core/xp/xp_data.tres | 123 --------------------------- game/project.godot | 5 +- game/scenes/CharacterSelectorMenu.gd | 10 +-- game/ui/unitframes/UnitframeBase.gd | 2 +- 6 files changed, 10 insertions(+), 136 deletions(-) delete mode 100644 game/modules/core/xp/xp_data.tres diff --git a/HEADS b/HEADS index 692f91b9..b36108b0 100644 --- a/HEADS +++ b/HEADS @@ -1 +1 @@ -{"engine": {"3.2": "07b24de868457c0a190c88771e99ff09e5451c3b", "master": "8c73e813134001e575b6f59e3b0100471c007410"}, "world_generator": {"master": "9a4f9f9809cb4da6d0196a9b37ea480e3cd0c400"}, "entity_spell_system": {"master": "dbc7bde24bb048a665a068da3dc9e78b04c4c726"}, "ui_extensions": {"master": "6fe4f69fea8d71043b08d959b8085404c9c4fe47"}, "voxelman": {"master": "dee38b1588ef3224cf8022eaf227e1dcaead6277"}, "texture_packer": {"master": "2993ed34f34cfa6a5e61b7913380231e9c55eda6"}, "fastnoise": {"master": "d0e3f1c759332cf0d9a5d7e0e71d0b0278310651"}, "mesh_data_resource": {"master": "85417ebee9198be3cd7cc643e0e0e934db64a620"}, "procedural_animations": {"master": "9226d21781ea05828570e592874aa319df0dc53d"}, "ess_data": {"master": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}, "props": {"master": "544654f49b13af2d25ac14152c8a5014474e6333"}, "mesh_utils": {"master": "4f69ec67b861ce4475cfd17946dfaa586c888d94"}, "broken_seals_module": {"master": "0e5c54a70f8e90f95cbf11419b959a5f67562d48"}, "thread_pool": {"master": "93320fe864128d706bcc47fc7ed0731e6e9bcf69"}} \ No newline at end of file +{"engine": {"3.2": "07b24de868457c0a190c88771e99ff09e5451c3b", "master": "8c73e813134001e575b6f59e3b0100471c007410"}, "world_generator": {"master": "9a4f9f9809cb4da6d0196a9b37ea480e3cd0c400"}, "entity_spell_system": {"master": "4ab7e83956d7d5ef36e3efd5c6bc2780a4e37a64"}, "ui_extensions": {"master": "6fe4f69fea8d71043b08d959b8085404c9c4fe47"}, "voxelman": {"master": "dee38b1588ef3224cf8022eaf227e1dcaead6277"}, "texture_packer": {"master": "2993ed34f34cfa6a5e61b7913380231e9c55eda6"}, "fastnoise": {"master": "d0e3f1c759332cf0d9a5d7e0e71d0b0278310651"}, "mesh_data_resource": {"master": "85417ebee9198be3cd7cc643e0e0e934db64a620"}, "procedural_animations": {"master": "9226d21781ea05828570e592874aa319df0dc53d"}, "ess_data": {"master": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}, "props": {"master": "544654f49b13af2d25ac14152c8a5014474e6333"}, "mesh_utils": {"master": "4f69ec67b861ce4475cfd17946dfaa586c888d94"}, "broken_seals_module": {"master": "0e5c54a70f8e90f95cbf11419b959a5f67562d48"}, "thread_pool": {"master": "93320fe864128d706bcc47fc7ed0731e6e9bcf69"}} \ No newline at end of file diff --git a/game/modules/core/resource_db.tres b/game/modules/core/resource_db.tres index 092e4114..d17c5ed8 100644 --- a/game/modules/core/resource_db.tres +++ b/game/modules/core/resource_db.tres @@ -1,4 +1,4 @@ -[gd_resource type="ESSResourceDBStatic" load_steps=9 format=2] +[gd_resource type="ESSResourceDBStatic" load_steps=8 format=2] [ext_resource path="res://modules/core/item_templates/2_test.tres" type="ItemTemplate" id=1] [ext_resource path="res://modules/core/item_templates/3_chest_of_the_infinite_wisdom.tres" type="ItemTemplate" id=2] @@ -7,10 +7,8 @@ [ext_resource path="res://modules/core/item_templates/1_gold.tres" type="ItemTemplate" id=5] [ext_resource path="res://modules/core/crafting/1_test_craft.tres" type="CraftRecipe" id=6] [ext_resource path="res://modules/core/entity_resources/1_mana_resource.tres" type="EntityResource" id=7] -[ext_resource path="res://modules/core/xp/xp_data.tres" type="XPData" id=8] [resource] -xp_data = ExtResource( 8 ) entity_resources = [ ExtResource( 7 ) ] entity_skills = [ ExtResource( 4 ) ] craft_recipes = [ ExtResource( 6 ), ExtResource( 3 ) ] diff --git a/game/modules/core/xp/xp_data.tres b/game/modules/core/xp/xp_data.tres deleted file mode 100644 index 45fd25ed..00000000 --- a/game/modules/core/xp/xp_data.tres +++ /dev/null @@ -1,123 +0,0 @@ -[gd_resource type="XPData" format=2] - -[resource] -character_level/1 = 2 -character_level/2 = 3 -character_level/3 = 4 -character_level/4 = 5 -character_level/5 = 6 -character_level/6 = 7 -character_level/7 = 8 -character_level/8 = 9 -character_level/9 = 1 -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 -class_level/4 = 1 -class_level/5 = 500 -class_level/6 = 600 -class_level/7 = 700 -class_level/8 = 800 -class_level/9 = 1000 -class_level/10 = 1000 -class_level/11 = 1000 -class_level/12 = 1000 -class_level/13 = 1000 -class_level/14 = 1000 -class_level/15 = 1000 -class_level/16 = 1000 -class_level/17 = 1000 -class_level/18 = 1000 -class_level/19 = 1000 -class_level/20 = 1000 -class_level/21 = 1000 -class_level/22 = 1000 -class_level/23 = 1000 -class_level/24 = 1000 -class_level/25 = 1000 -class_level/26 = 1000 -class_level/27 = 1000 -class_level/28 = 1000 -class_level/29 = 1000 -class_level/30 = 1000 -class_level/31 = 1000 -class_level/32 = 1000 -class_level/33 = 1000 -class_level/34 = 1000 -class_level/35 = 1000 -class_level/36 = 1000 -class_level/37 = 1000 -class_level/38 = 1000 -class_level/39 = 1000 -class_level/40 = 1000 -class_level/41 = 1000 -class_level/42 = 1000 -class_level/43 = 1000 -class_level/44 = 1000 -class_level/45 = 1000 -class_level/46 = 1000 -class_level/47 = 1000 -class_level/48 = 1000 -class_level/49 = 1000 -class_level/50 = 1000 -class_level/51 = 1000 -class_level/52 = 1000 -class_level/53 = 1000 -class_level/54 = 1000 -class_level/55 = 1000 -class_level/56 = 1000 -class_level/57 = 1000 -class_level/58 = 1000 -class_level/59 = 1000 -class_level/60 = null diff --git a/game/project.godot b/game/project.godot index 1ef80c49..8daa4432 100644 --- a/game/project.godot +++ b/game/project.godot @@ -367,14 +367,15 @@ window/size/viewport_scale=100 [ess] -level/max_character_level=60 -level/max_class_level=60 data/ess_resource_db_path="res://data/resource_db.tres" data/ess_entity_spawner_path="res://player/bs_entity_spawner.tres" enums/stats="Agility,Strength,Stamina,Intellect,Spirit,Health,Mana,Speed,Global Cooldown,Haste,Haste Rating,Resilience,Armor,Attack Power,Spell Power,Melee Crit,Melee Crit bonus,Spell Crit,Spell Crit Bonus,Block,Parry,Damage Reduction,Melee Damage Reduction,Spell Damage Reduction,Damage Taken,Heal Taken,Melee Damage,Spell Damage,Holy Resist,Shadow Resist,Nature Resist,Fire Resist,Frost Resist,Lightning Resist,Chaos Resist,Silence Resist,Fear Resist,Stun Resist,Energy,Rage,XP Rate" enums/skeletons_bones=PoolStringArray( "", "root,pelvis,spine,spine_1,spine_2,neck,head,left_clavicle,left_upper_arm,left_forearm,left_hand,left_thumb_base,left_thumb_end,left_fingers_base,left_fingers_end,right_clavicle,right_upper_arm,right_forearm,right_hand,right_thumb_base,right_thumb_end,right_fingers_base,right_fingers_end,left_thigh,left_calf,left_foot,right_thigh,right_calf,right_foot" ) enums/skeletons_bone_attachment_points=PoolStringArray( "", "left_hand,right_hand,torso,root,right_hip,left_hip,spine_2,weapon_left,weapon_right,weapon_left_back,weapon_right_back,weapon_shield_left" ) +xp/character_xps=PoolIntArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) profiles/automatic_save=true +level/max_character_level=60 +level/max_class_level=60 [importer_defaults] diff --git a/game/scenes/CharacterSelectorMenu.gd b/game/scenes/CharacterSelectorMenu.gd index bd850cd1..8e932235 100644 --- a/game/scenes/CharacterSelectorMenu.gd +++ b/game/scenes/CharacterSelectorMenu.gd @@ -159,18 +159,16 @@ func renounce_character() -> void: if ESS.use_class_xp: var class_profile : ClassProfile = ProfileManager.getc_player_profile().get_class_profile(b.entity.sentity_data.resource_path) - var xp_data : XPData = ESS.get_resource_db().get_xp_data() - - if xp_data.can_class_level_up(class_profile.level): + if ESS.can_class_level_up(class_profile.level): class_profile.xp += b.entity.sclass_xp - var xpr : int = xp_data.get_class_xp(class_profile.level) + var xpr : int = ESS.get_class_xp(class_profile.level) - while xp_data.can_class_level_up(class_profile.level) and class_profile.xp >= xpr: + while ESS.can_class_level_up(class_profile.level) and class_profile.xp >= xpr: class_profile.level += 1 class_profile.xp -= xpr - xpr = xp_data.get_class_xp(class_profile.level) + xpr = ESS.get_class_xp(class_profile.level) ProfileManager.save() diff --git a/game/ui/unitframes/UnitframeBase.gd b/game/ui/unitframes/UnitframeBase.gd index fbffa170..3776057c 100644 --- a/game/ui/unitframes/UnitframeBase.gd +++ b/game/ui/unitframes/UnitframeBase.gd @@ -134,7 +134,7 @@ func cname_changed(entity: Entity) -> void: func clevel_changed(entity: Entity, value : int) -> void: _level_text.text = str(_player.clevel) - var xpreq : int = ESS.get_resource_db().get_xp_data().get_character_xp(_player.clevel) + var xpreq : int = ESS.get_character_xp(_player.clevel) if xpreq == 0: _xp_range.value = 0