From c88e61ad652720a719fde7af8eb01cfc0ba045b8 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 1 Dec 2019 01:18:19 +0100 Subject: [PATCH] ManaResource setup. --- HEADS | 2 +- game/autoload/EntityDataManager.tscn | 1 + game/data/entities/1_naturalist.tres | 1 + game/data/entity_classes/1_naturalist.tres | 4 +++- game/data/entity_resources/1_mana_resource.tres | 7 +++++++ game/data/spells/16_close_wounds_rank_1.tres | 3 +-- game/project.godot | 2 +- .../resources/{mana_resource.gd => ManResource.gd} | 7 ++++--- game/scripts/resources/ManaResourceData.gd | 8 ++++++++ 9 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 game/data/entity_resources/1_mana_resource.tres rename game/scripts/resources/{mana_resource.gd => ManResource.gd} (79%) create mode 100644 game/scripts/resources/ManaResourceData.gd diff --git a/HEADS b/HEADS index 3e158ebb..7ca32709 100644 --- a/HEADS +++ b/HEADS @@ -1 +1 @@ -{"engine": "dac2a7b2378973177a166f1f4c0f6ac3c7b3e529", "world_generator": "290d973ea9580f748881a54502850ae5fecfb586", "entity_spell_system": "abb564acdcb27778123ba3cb7348210c87de0918", "ui_extensions": "271dcf89e9afe5cb6350de2f2433c8ebf8aba785", "voxelman": "2b369f5be8efc5fe0ef13da57afa46317c413f47", "texture_packer": "604c330188e220c15d10ea5bd545a6fc5aab0132", "fastnoise": "41b7ea05a1f7aa2b8ecddaa1fd739e64d6970f7e", "entity-spell-system-addons": "8568888b3c11dec56dbf1088a84bc898d68bd6ce"} \ No newline at end of file +{"engine": "dac2a7b2378973177a166f1f4c0f6ac3c7b3e529", "world_generator": "290d973ea9580f748881a54502850ae5fecfb586", "entity_spell_system": "6a954f3381bb34b81e7e26f5f9058d850761d135", "ui_extensions": "271dcf89e9afe5cb6350de2f2433c8ebf8aba785", "voxelman": "2b369f5be8efc5fe0ef13da57afa46317c413f47", "texture_packer": "604c330188e220c15d10ea5bd545a6fc5aab0132", "fastnoise": "41b7ea05a1f7aa2b8ecddaa1fd739e64d6970f7e", "entity-spell-system-addons": "8568888b3c11dec56dbf1088a84bc898d68bd6ce"} \ No newline at end of file diff --git a/game/autoload/EntityDataManager.tscn b/game/autoload/EntityDataManager.tscn index 7fde4cfe..3ac11a72 100644 --- a/game/autoload/EntityDataManager.tscn +++ b/game/autoload/EntityDataManager.tscn @@ -8,6 +8,7 @@ [node name="EntityDataManager" type="EntityDataManager"] xp_data_path = "res://data/xp/xp_data.tres" +entity_resources_folder = "res://data/entity_resources" entity_datas_folder = "res://data/entities" spells_folder = "res://data/spells" auras_folder = "res://data/auras" diff --git a/game/data/entities/1_naturalist.tres b/game/data/entities/1_naturalist.tres index a9a6a2d2..dec82064 100644 --- a/game/data/entities/1_naturalist.tres +++ b/game/data/entities/1_naturalist.tres @@ -8,6 +8,7 @@ item = ExtResource( 3 ) [resource] +resource_name = "Naturalist" id = 1 entity_type = 4 entity_controller = 1 diff --git a/game/data/entity_classes/1_naturalist.tres b/game/data/entity_classes/1_naturalist.tres index fd6515f8..6e45db97 100644 --- a/game/data/entity_classes/1_naturalist.tres +++ b/game/data/entity_classes/1_naturalist.tres @@ -1,4 +1,4 @@ -[gd_resource type="EntityClassData" load_steps=76 format=2] +[gd_resource type="EntityClassData" load_steps=77 format=2] [ext_resource path="res://data/spells/26_rest.tres" type="Spell" id=1] [ext_resource path="res://data/spells/21_strength_of_nature_rank_1.tres" type="Spell" id=2] @@ -26,6 +26,7 @@ [ext_resource path="res://data/spells/27_aspect_of_scorpions.tres" type="Spell" id=24] [ext_resource path="res://data/spells/28_aspectofwasps.tres" type="Spell" id=25] [ext_resource path="res://data/spells/30_aspect_of_bees.tres" type="Spell" id=26] +[ext_resource path="res://data/entity_resources/1_mana_resource.tres" type="EntityResourceData" id=27] [sub_resource type="EntityAI" id=1] script = ExtResource( 20 ) @@ -249,6 +250,7 @@ id = 1 text_name = "Naturalist" stat_data = SubResource( 49 ) player_resource_type = 2 +entity_resources = [ ExtResource( 27 ) ] specs = [ SubResource( 4 ) ] spells = [ ExtResource( 4 ), ExtResource( 6 ), ExtResource( 16 ), ExtResource( 5 ), ExtResource( 3 ), ExtResource( 10 ), ExtResource( 8 ), ExtResource( 11 ), ExtResource( 9 ), ExtResource( 7 ), ExtResource( 13 ), ExtResource( 2 ), ExtResource( 12 ), ExtResource( 14 ), ExtResource( 15 ), ExtResource( 17 ), ExtResource( 1 ), ExtResource( 24 ), ExtResource( 25 ), ExtResource( 23 ), ExtResource( 26 ) ] start_spells = [ ExtResource( 24 ) ] diff --git a/game/data/entity_resources/1_mana_resource.tres b/game/data/entity_resources/1_mana_resource.tres new file mode 100644 index 00000000..b3cff4e2 --- /dev/null +++ b/game/data/entity_resources/1_mana_resource.tres @@ -0,0 +1,7 @@ +[gd_resource type="EntityResourceData" load_steps=2 format=2] + +[ext_resource path="res://scripts/resources/ManaResourceData.gd" type="Script" id=1] + +[resource] +id = 1 +script = ExtResource( 1 ) diff --git a/game/data/spells/16_close_wounds_rank_1.tres b/game/data/spells/16_close_wounds_rank_1.tres index a90b4b2c..2a4d4de2 100644 --- a/game/data/spells/16_close_wounds_rank_1.tres +++ b/game/data/spells/16_close_wounds_rank_1.tres @@ -12,14 +12,13 @@ target_type = 2 target_relation_type = -870457328 rank = 1 icon = ExtResource( 2 ) +caster_aura_applys = [ ExtResource( 3 ) ] text_name = "Close Wounds" text_description = "Casttime: 2 sec. Cooldown: {2} Heals you for 720 to 780 every 3 sec for 21 sec." -caster_aura_applys = [ ExtResource( 3 ) ] cast = true cast_cast_time = 1.3 -give_resource_type = 2 aoe_movement_type = -2000446188 aoe_colliderType = -2147479552 script = ExtResource( 1 ) diff --git a/game/project.godot b/game/project.godot index d353f0f2..1871a75d 100644 --- a/game/project.godot +++ b/game/project.godot @@ -67,7 +67,7 @@ _global_script_classes=[ { "base": "EntityResource", "class": "ManaResource", "language": "GDScript", -"path": "res://scripts/resources/mana_resource.gd" +"path": "res://scripts/resources/ManResource.gd" }, { "base": "VoxelChunk", "class": "MarchingCubesVoxelChunk", diff --git a/game/scripts/resources/mana_resource.gd b/game/scripts/resources/ManResource.gd similarity index 79% rename from game/scripts/resources/mana_resource.gd rename to game/scripts/resources/ManResource.gd index 0b963f76..17210007 100644 --- a/game/scripts/resources/mana_resource.gd +++ b/game/scripts/resources/ManResource.gd @@ -6,9 +6,10 @@ class_name ManaResource # file, You can obtain one at https://mozilla.org/MPL/2.0/. func _init(): - resource_type = EntityEnums.PLAYER_RESOURCE_TYPES_MANA - -# should_process = true + should_process = false #func _ons_stat_changed(stat : Stat): # print(stat.get_id()) + +func _process_server(delta): + pass diff --git a/game/scripts/resources/ManaResourceData.gd b/game/scripts/resources/ManaResourceData.gd new file mode 100644 index 00000000..747feb31 --- /dev/null +++ b/game/scripts/resources/ManaResourceData.gd @@ -0,0 +1,8 @@ +extends EntityResourceData + +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + +func _get_entity_resource_instance() -> EntityResource: + return ManaResource.new()