diff --git a/HEADS b/HEADS index f6c72fba..9736d1a8 100644 --- a/HEADS +++ b/HEADS @@ -1 +1 @@ -{"engine": "e64a663c59141f972345852f0bce613e3f13dd3a", "world_generator": "290d973ea9580f748881a54502850ae5fecfb586", "entity_spell_system": "68df038731b7bca1905ce09433c90d64650a3030", "ui_extensions": "271dcf89e9afe5cb6350de2f2433c8ebf8aba785", "voxelman": "2b369f5be8efc5fe0ef13da57afa46317c413f47", "texture_packer": "604c330188e220c15d10ea5bd545a6fc5aab0132", "fastnoise": "41b7ea05a1f7aa2b8ecddaa1fd739e64d6970f7e", "entity-spell-system-addons": "367b2318da45726710c27fd3ac1d23e8a5a8f1f7"} \ No newline at end of file +{"engine": "9607fc48a0134b289fe62f327db1f160d70fac24", "world_generator": "290d973ea9580f748881a54502850ae5fecfb586", "entity_spell_system": "fcf23281e8aec25ac9f5ef61fa8a7e300064b939", "ui_extensions": "271dcf89e9afe5cb6350de2f2433c8ebf8aba785", "voxelman": "2b369f5be8efc5fe0ef13da57afa46317c413f47", "texture_packer": "604c330188e220c15d10ea5bd545a6fc5aab0132", "fastnoise": "41b7ea05a1f7aa2b8ecddaa1fd739e64d6970f7e", "entity-spell-system-addons": "367b2318da45726710c27fd3ac1d23e8a5a8f1f7"} \ No newline at end of file diff --git a/game/autoload/EntityDataManager.gd b/game/autoload/EntityDataManager.gd index 992439ed..10044723 100644 --- a/game/autoload/EntityDataManager.gd +++ b/game/autoload/EntityDataManager.gd @@ -23,11 +23,12 @@ extends Node # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -export (PackedScene) var player_scene : PackedScene -export (PackedScene) var networked_player_scene : PackedScene -export (PackedScene) var mob_scene : PackedScene -export (PackedScene) var player_display_scene : PackedScene -export (String) var spawn_parent_path : String = "/root/Main" +export(PackedScene) var player_scene : PackedScene +export(PackedScene) var networked_player_scene : PackedScene +export(PackedScene) var mob_scene : PackedScene +export(PackedScene) var player_display_scene : PackedScene +export(String) var spawn_parent_path : String = "/root/Main" +export(int) var default_level_override : int = 0 var _spawn_parent : Node = null @@ -167,17 +168,23 @@ func spawn_player_for_menu(class_id : int, name : String, parent : Node) -> Enti createinfo.entity_data = cls createinfo.player_name = name - createinfo.level = class_profile.level + createinfo.level = 1 createinfo.xp = class_profile.xp createinfo.entity_controller = EntityEnums.ENITIY_CONTROLLER_PLAYER var entity : Entity = player_display_scene.instance() as Entity + entity.initialize(createinfo) + + var level : int = class_profile.level + + if default_level_override > 0: + level = default_level_override + + entity.slevelup(level - 1) parent.add_child(entity) entity.owner = parent - entity.initialize(createinfo) - return entity func spawn_networked_player(class_id : int, position : Vector3, name : String, node_name : String, sid : int) -> Entity: @@ -189,12 +196,19 @@ func spawn_networked_player(class_id : int, position : Vector3, name : String, createinfo.entity_data = cls createinfo.player_name = name - createinfo.level = class_profile.level + createinfo.level = 1 createinfo.xp = class_profile.xp createinfo.entity_controller = EntityEnums.ENITIY_CONTROLLER_PLAYER var entity : Entity = spawn(createinfo, true, position, node_name) + var level : int = class_profile.level + + if default_level_override > 0: + level = default_level_override + + entity.slevelup(level - 1) + if get_tree().is_network_server(): entity.set_network_master(sid) @@ -213,12 +227,19 @@ func spawn_player(class_id : int, position : Vector3, name : String, node_name createinfo.entity_data = cls createinfo.player_name = name - createinfo.level = class_profile.level + createinfo.level = 1 createinfo.xp = class_profile.xp createinfo.entity_controller = EntityEnums.ENITIY_CONTROLLER_PLAYER var entity : Entity = spawn(createinfo, false, position, node_name) + var level : int = class_profile.level + + if default_level_override > 0: + level = default_level_override + + entity.slevelup(level - 1) + entity.set_network_master(network_owner) Logger.info("Player spawned " + str(createinfo)) @@ -237,11 +258,15 @@ func spawn_mob(class_id : int, level : int, position : Vector3) -> Entity: createinfo.entity_data = cls createinfo.player_name = "Mob" - createinfo.level = level -# createinfo.level = level - createinfo.entity_controller = EntityEnums.ENITIY_CONTROLLER_AI + createinfo.level = 1 + createinfo.entity_controller = EntityEnums.ENITIY_CONTROLLER_AI + var entity : Entity = spawn(createinfo, false, position) + + if default_level_override > 0: + level = default_level_override + entity.slevelup(level - 1) Logger.info("Mob spawned " + str(createinfo)) diff --git a/game/autoload/EntityDataManager.tscn b/game/autoload/EntityDataManager.tscn index 71da0bcb..0e13b402 100644 --- a/game/autoload/EntityDataManager.tscn +++ b/game/autoload/EntityDataManager.tscn @@ -22,3 +22,4 @@ player_scene = ExtResource( 3 ) networked_player_scene = ExtResource( 2 ) mob_scene = ExtResource( 4 ) player_display_scene = ExtResource( 5 ) +default_level_override = 50 diff --git a/game/autoload/ProfileManager.tscn b/game/autoload/ProfileManager.tscn index c95eede7..1d2cc579 100644 --- a/game/autoload/ProfileManager.tscn +++ b/game/autoload/ProfileManager.tscn @@ -4,4 +4,3 @@ [node name="ProfileManager" type="ProfileManager"] script = ExtResource( 1 ) -save_interval = 1.0 diff --git a/game/data/item_templates/3_chest_of_the_infinite_wisdom.tres b/game/data/item_templates/3_chest_of_the_infinite_wisdom.tres index f430d6d4..4f17dc3c 100644 --- a/game/data/item_templates/3_chest_of_the_infinite_wisdom.tres +++ b/game/data/item_templates/3_chest_of_the_infinite_wisdom.tres @@ -5,6 +5,7 @@ [ext_resource path="res://data/icons/4_chest_of_the_infinite_wisdom.tres" type="Texture" id=3] [resource] +resource_name = "Chest of the Infinite Wisdom" id = 3 text_name = "Chest of the Infinite Wisdom" item_type = 1 diff --git a/game/data/spells/10_aspect_of_scorpions_rank_1.tres b/game/data/spells/10_aspect_of_scorpions_rank_1.tres index 2fc79a5f..0f84b999 100644 --- a/game/data/spells/10_aspect_of_scorpions_rank_1.tres +++ b/game/data/spells/10_aspect_of_scorpions_rank_1.tres @@ -4,7 +4,7 @@ [ext_resource path="res://data/icons/naturalist/aspect_of_scorpions.tres" type="Texture" id=2] [ext_resource path="res://data/auras/10_aspect_of_scorpions_rank_1.tres" type="Aura" id=3] [ext_resource path="res://data/effect_data/aspect_of_scorpions.tres" type="SpellEffectVisual" id=4] -[ext_resource path="res://data/spells/2_test_cast_spell.tres" type="Spell" id=5] +[ext_resource path="res://data/spells/27_aspect_of_scorpions.tres" type="Spell" id=5] [resource] resource_name = "Aspect of Scorpions" diff --git a/game/data/spells/11_aspect_of_wasps_rank_1.tres b/game/data/spells/11_aspect_of_wasps_rank_1.tres index 70b304b1..85916166 100644 --- a/game/data/spells/11_aspect_of_wasps_rank_1.tres +++ b/game/data/spells/11_aspect_of_wasps_rank_1.tres @@ -3,7 +3,7 @@ [ext_resource path="res://scripts/spells/gd_spell_script.gd" type="Script" id=1] [ext_resource path="res://data/icons/naturalist/aspect_of_wasps.tres" type="Texture" id=2] [ext_resource path="res://data/auras/11_aspect_of_wasps_rank1.tres" type="Aura" id=3] -[ext_resource path="res://data/spells/2_test_cast_spell.tres" type="Spell" id=4] +[ext_resource path="res://data/spells/28_aspectofwasps.tres" type="Spell" id=4] [resource] resource_name = "Aspect of Wasps" diff --git a/game/data/spells/12_aspect_of_wolves_rank_1.tres b/game/data/spells/12_aspect_of_wolves_rank_1.tres index 25ae60c0..c6902f18 100644 --- a/game/data/spells/12_aspect_of_wolves_rank_1.tres +++ b/game/data/spells/12_aspect_of_wolves_rank_1.tres @@ -3,7 +3,7 @@ [ext_resource path="res://scripts/spells/gd_spell_script.gd" type="Script" id=1] [ext_resource path="res://data/icons/naturalist/aspect_of_wolves.tres" type="Texture" id=2] [ext_resource path="res://data/auras/12_aspect_of_wolves_rank_1.tres" type="Aura" id=3] -[ext_resource path="res://data/spells/2_test_cast_spell.tres" type="Spell" id=4] +[ext_resource path="res://data/spells/29_aspect_of_wolves.tres" type="Spell" id=4] [resource] resource_name = "Aspect of Wolves" diff --git a/game/data/spells/13_aspect_of_bees_rank_1.tres b/game/data/spells/13_aspect_of_bees_rank_1.tres index aebd4682..2976a7a4 100644 --- a/game/data/spells/13_aspect_of_bees_rank_1.tres +++ b/game/data/spells/13_aspect_of_bees_rank_1.tres @@ -3,7 +3,7 @@ [ext_resource path="res://scripts/spells/gd_spell_script.gd" type="Script" id=1] [ext_resource path="res://data/icons/naturalist/aspect_of_bees.tres" type="Texture" id=2] [ext_resource path="res://data/auras/13_aspect_of_bees_rank_1.tres" type="Aura" id=3] -[ext_resource path="res://data/spells/2_test_cast_spell.tres" type="Spell" id=4] +[ext_resource path="res://data/spells/30_aspect_of_bees.tres" type="Spell" id=4] [resource] resource_name = "Aspect of Bees" diff --git a/game/data/xp/xp_data.tres b/game/data/xp/xp_data.tres index f8ce0eb5..57e1f70d 100644 --- a/game/data/xp/xp_data.tres +++ b/game/data/xp/xp_data.tres @@ -1,10 +1,52 @@ [gd_resource type="XPData" format=2] [resource] -level_1 = 300 level_2 = 600 level_3 = 1000 -level_4 = 10000 -level_5 = 200000 -level_6 = 400000 -level_7 = 600000 +level_4 = 1000 +level_5 = 1000 +level_6 = 1000 +level_7 = 1000 +level_8 = 1000 +level_9 = 1000 +level_10 = 1000 +level_11 = 1000 +level_12 = 1000 +level_13 = 1000 +level_14 = 1000 +level_15 = 1000 +level_16 = 1000 +level_17 = 1000 +level_18 = 1000 +level_19 = 1000 +level_20 = 1000 +level_21 = 1000 +level_22 = 1000 +level_23 = 1000 +level_24 = 1000 +level_25 = 1000 +level_26 = 1000 +level_27 = 1000 +level_28 = 1000 +level_29 = 1000 +level_30 = 1000 +level_31 = 1000 +level_32 = 1000 +level_33 = 1000 +level_34 = 1000 +level_35 = 1000 +level_36 = 1000 +level_37 = 1000 +level_38 = 1000 +level_39 = 1000 +level_40 = 1000 +level_41 = 1000 +level_42 = 1000 +level_43 = 1000 +level_44 = 1000 +level_45 = 1000 +level_46 = 1000 +level_47 = 1000 +level_48 = 1000 +level_49 = 1000 +level_50 = 1000 diff --git a/game/player/DisplayEntity.gd b/game/player/DisplayEntity.gd index 1d989ce0..389f8bc8 100644 --- a/game/player/DisplayEntity.gd +++ b/game/player/DisplayEntity.gd @@ -376,4 +376,26 @@ func _con_spell_cast_success(info): if animation_run: anim_node_state_machine.travel("run-loop") +func _son_level_up(level: int) -> void: + if sentity_data == null: + return + + var ecd : EntityClassData = sentity_data.entity_class_data + + if ecd == null: + return + + sfree_spell_points += ecd.spell_points_per_level * level + sfree_talent_points += level + + for i in range(Stat.MAIN_STAT_ID_COUNT): + var st : int = sentity_data.entity_class_data.get_stat_data().get_level_stat_data().get_stat_diff(i, slevel - level, slevel) + + var statid : int = i + Stat.MAIN_STAT_ID_START + + var stat : Stat = get_stat_int(statid) + + var sm : StatModifier = stat.get_modifier(0) + sm.base_mod += st + diff --git a/game/player/DisplayPlayer.gd b/game/player/DisplayPlayer.gd index f65c1aa6..fae3b42b 100644 --- a/game/player/DisplayPlayer.gd +++ b/game/player/DisplayPlayer.gd @@ -25,6 +25,29 @@ class_name DisplayPlayerGD # SOFTWARE. func _setup(): - ._setup() - setup_actionbars() + + +func _son_level_up(level: int) -> void: + if sentity_data == null: + return + + var ecd : EntityClassData = sentity_data.entity_class_data + + if ecd == null: + return + + sfree_spell_points += ecd.spell_points_per_level * level + sfree_talent_points += level + + for i in range(Stat.MAIN_STAT_ID_COUNT): + var st : int = sentity_data.entity_class_data.get_stat_data().get_level_stat_data().get_stat_diff(i, slevel - level, slevel) + + var statid : int = i + Stat.MAIN_STAT_ID_START + + var stat : Stat = get_stat_int(statid) + + var sm : StatModifier = stat.get_modifier(0) + sm.base_mod += st + + diff --git a/game/player/Mob.gd b/game/player/Mob.gd index 94e299a7..c1818e62 100644 --- a/game/player/Mob.gd +++ b/game/player/Mob.gd @@ -116,19 +116,6 @@ func _physics_process(delta : float) -> void: if dead: return - -# if ai_state == EntityEnums.AI_STATE_OFF: -# return -# elif ai_state == EntityEnums.AI_STATE_PATROL: -# sentity_data.sai_rest(self) -# elif ai_state == EntityEnums.AI_STATE_REST: -# sentity_data.sai_rest(self) -# elif ai_state == EntityEnums.AI_STATE_REGENERATE: -# sentity_data.sai_regenerate(self) -# elif ai_state == EntityEnums.AI_STATE_ATTACK: -# sentity_data.sai_attack(self) -# elif ai_state == EntityEnums.AI_STATE_FOLLOW_PATH: -# sentity_data.sai_follow(self) process_movement(delta) @@ -147,7 +134,6 @@ func process_movement(delta : float) -> void: anim_node_state_machine.travel("run-loop") animation_run = true - target_movement_direction = target_movement_direction.normalized() moving = true else: @@ -203,26 +189,11 @@ func process_movement(delta : float) -> void: facing.y = 0 vel = move_and_slide(vel, Vector3(0,1,0), false, 4, deg2rad(MAX_SLOPE_ANGLE)) - -# if facing.length_squared() > 0.1: -# look_at(translation + facing, Vector3(0, 1, 0)) -# else: -# if starget != null: -# look_at(starget.translation, Vector3(0, 1, 0)) - sset_position(translation, rotation) if vel.length_squared() < 0.12: sleep = true -# if get_tree().network_peer: -# if get_tree().is_network_server(): -# set_position(translation, rotation) -# else: -# rpc("set_position", translation, rotation) - -# print(vel.length_squared()) - if translation.y < -50.0: print("killed mob with fall damage") var sdi : SpellDamageInfo = SpellDamageInfo.new() @@ -340,7 +311,6 @@ func _son_level_up(value: int) -> void: sfree_talent_points += value for i in range(Stat.MAIN_STAT_ID_COUNT): -# print(i) var st : int = sentity_data.entity_class_data.get_stat_data().get_level_stat_data().get_stat_diff(i, slevel - value, slevel) var statid : int = i + Stat.MAIN_STAT_ID_START diff --git a/game/player/Player.gd b/game/player/Player.gd index 96189dd1..dfa41f2d 100644 --- a/game/player/Player.gd +++ b/game/player/Player.gd @@ -447,11 +447,10 @@ func _son_level_up(level: int) -> void: if ecd == null: return - sfree_spell_points += ecd.spell_points_per_level - sfree_talent_points += 1 + sfree_spell_points += ecd.spell_points_per_level * level + sfree_talent_points += level for i in range(Stat.MAIN_STAT_ID_COUNT): -# print(i) var st : int = sentity_data.entity_class_data.get_stat_data().get_level_stat_data().get_stat_diff(i, slevel - level, slevel) var statid : int = i + Stat.MAIN_STAT_ID_START