Update HEADS to get the customizable stats for ESS.

This commit is contained in:
Relintai 2020-04-25 21:41:42 +02:00
parent 13a7725106
commit 04da48826e
13 changed files with 194 additions and 623 deletions

2
HEADS
View File

@ -1 +1 @@
{"engine": {"3.2": "ed27b7e6b973eb6be6fdac4439e99a1907b9cb58", "master": "8c73e813134001e575b6f59e3b0100471c007410"}, "world_generator": {"master": "97f10512f8832394389e1109154b8af34a2ef2c6"}, "entity_spell_system": {"master": "46153002933f355e1a6044a0e26df823c9c902a8"}, "ui_extensions": {"master": "6fe4f69fea8d71043b08d959b8085404c9c4fe47"}, "voxelman": {"master": "233dde39defd6608913da5434d8ef2cbff3bfd42"}, "texture_packer": {"master": "b29b499adf570aa7f85af69ef080ff0d5e04afae"}, "fastnoise": {"master": "d0e3f1c759332cf0d9a5d7e0e71d0b0278310651"}, "mesh_data_resource": {"master": "4ee946963a16bbfdb4dbb5df52134d22aa168041"}, "procedural_animations": {"master": "9ae56c17230ba9c6160777650b2b89eecdc8df9e"}, "ess_data": {"master": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}, "fast_quadratic_mesh_simplifier": {"master": "f6d3d65cc6ce4dddfc68054164feec1f612ecd1f"}, "props": {"master": "b2bcb5ea6469b19298cd849c1232ddb5ad26f71c"}}
{"engine": {"3.2": "be5a47e75d4b671a48b0a35eb17887ee38d8516c", "master": "8c73e813134001e575b6f59e3b0100471c007410"}, "world_generator": {"master": "97f10512f8832394389e1109154b8af34a2ef2c6"}, "entity_spell_system": {"master": "5901fc66d00c2c2be662f064bebaceaca59c4ed4"}, "ui_extensions": {"master": "6fe4f69fea8d71043b08d959b8085404c9c4fe47"}, "voxelman": {"master": "233dde39defd6608913da5434d8ef2cbff3bfd42"}, "texture_packer": {"master": "b29b499adf570aa7f85af69ef080ff0d5e04afae"}, "fastnoise": {"master": "d0e3f1c759332cf0d9a5d7e0e71d0b0278310651"}, "mesh_data_resource": {"master": "4ee946963a16bbfdb4dbb5df52134d22aa168041"}, "procedural_animations": {"master": "9ae56c17230ba9c6160777650b2b89eecdc8df9e"}, "ess_data": {"master": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}, "fast_quadratic_mesh_simplifier": {"master": "f6d3d65cc6ce4dddfc68054164feec1f612ecd1f"}, "props": {"master": "b2bcb5ea6469b19298cd849c1232ddb5ad26f71c"}}

View File

@ -1,4 +1,4 @@
[gd_resource type="EntityClassData" load_steps=76 format=2]
[gd_resource type="EntityClassData" load_steps=73 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]
@ -39,12 +39,15 @@ Talent_2_0 = ExtResource( 22 )
id = 1
talent_rows = [ SubResource( 2 ), SubResource( 3 ) ]
[sub_resource type="StatDataEntry" id=5]
stat_id = 41
[sub_resource type="SimpleLevelStatData" id=5]
agility = 3
strength = 4
stamina = 5
intellect = 6
spirit = 4
[sub_resource type="StatDataEntry" id=6]
stat_id = 5
base = 12.0
base = 5.0
[sub_resource type="StatDataEntry" id=7]
stat_id = 12
@ -77,11 +80,11 @@ stat_id = 31
stat_id = 32
[sub_resource type="StatDataEntry" id=17]
stat_id = 3
stat_id = 8
base = 1.5
[sub_resource type="StatDataEntry" id=18]
stat_id = 4
stat_id = 9
[sub_resource type="StatDataEntry" id=19]
stat_id = 10
@ -90,167 +93,139 @@ stat_id = 10
stat_id = 25
[sub_resource type="StatDataEntry" id=21]
stat_id = 0
stat_id = 5
base = 100.0
[sub_resource type="StatDataEntry" id=22]
stat_id = 28
[sub_resource type="Curve" id=23]
max_value = 10.0
_data = [ Vector2( 0, 10 ), 0.0, 0.0, 0, 1, Vector2( 1, 10 ), 0.0, 0.0, 1, 0 ]
[sub_resource type="StatDataEntry" id=23]
stat_id = 3
base = 6.0
[sub_resource type="StatDataEntry" id=24]
stat_id = 8
base = 20.0
mod_stat_count = 1
ModStat_0/stat_id = 2
ModStat_0/curve = SubResource( 23 )
ModStat_0/max_value = 1000.0
[sub_resource type="StatDataEntry" id=25]
stat_id = 33
[sub_resource type="StatDataEntry" id=25]
stat_id = 7
base = 100.0
[sub_resource type="StatDataEntry" id=26]
stat_id = 2
stat_id = 15
[sub_resource type="StatDataEntry" id=27]
stat_id = 15
base = 5.0
stat_id = 16
[sub_resource type="StatDataEntry" id=28]
stat_id = 16
base = 50.0
[sub_resource type="StatDataEntry" id=29]
stat_id = 26
[sub_resource type="StatDataEntry" id=30]
[sub_resource type="StatDataEntry" id=29]
stat_id = 22
base = 15.0
[sub_resource type="StatDataEntry" id=31]
[sub_resource type="StatDataEntry" id=30]
stat_id = 30
[sub_resource type="StatDataEntry" id=32]
[sub_resource type="StatDataEntry" id=31]
stat_id = 20
[sub_resource type="StatDataEntry" id=33]
[sub_resource type="StatDataEntry" id=32]
stat_id = 39
[sub_resource type="StatDataEntry" id=34]
[sub_resource type="StatDataEntry" id=33]
stat_id = 11
[sub_resource type="StatDataEntry" id=35]
[sub_resource type="StatDataEntry" id=34]
stat_id = 29
[sub_resource type="StatDataEntry" id=36]
[sub_resource type="StatDataEntry" id=35]
stat_id = 35
[sub_resource type="StatDataEntry" id=37]
stat_id = 1
[sub_resource type="StatDataEntry" id=36]
stat_id = 6
base = 4.2
modifier_apply_type = 1
[sub_resource type="StatDataEntry" id=37]
stat_id = 17
[sub_resource type="StatDataEntry" id=38]
stat_id = 17
base = 5.0
stat_id = 18
[sub_resource type="StatDataEntry" id=39]
stat_id = 18
base = 50.0
[sub_resource type="StatDataEntry" id=40]
stat_id = 27
[sub_resource type="StatDataEntry" id=41]
[sub_resource type="StatDataEntry" id=40]
stat_id = 23
[sub_resource type="StatDataEntry" id=42]
[sub_resource type="StatDataEntry" id=41]
stat_id = 14
[sub_resource type="StatDataEntry" id=43]
stat_id = 9
[sub_resource type="StatDataEntry" id=42]
stat_id = 4
base = 4.0
[sub_resource type="Curve" id=44]
max_value = 10.0
_data = [ Vector2( 0, 10 ), 0.0, 0.0, 0, 1, Vector2( 1, 10 ), 0.0, 0.0, 1, 0 ]
[sub_resource type="StatDataEntry" id=43]
stat_id = 2
base = 5.0
[sub_resource type="StatDataEntry" id=44]
stat_id = 1
base = 4.0
[sub_resource type="StatDataEntry" id=45]
stat_id = 7
base = 10.0
mod_stat_count = 1
ModStat_0/stat_id = 0
ModStat_0/curve = SubResource( 44 )
ModStat_0/max_value = 1000.0
[sub_resource type="StatDataEntry" id=46]
stat_id = 6
base = 8.0
[sub_resource type="StatDataEntry" id=47]
stat_id = 37
[sub_resource type="StatDataEntry" id=48]
[sub_resource type="StatDataEntry" id=46]
stat_id = 40
base = 1.0
[sub_resource type="SimpleLevelStatData" id=49]
agility_per_level = 4
strength_per_level = 2
stamina_per_level = 4
intellect_per_level = 4
spirit_per_level = 6
[sub_resource type="StatData" id=50]
base_stat_health = SubResource( 21 )
base_stat_speed = SubResource( 37 )
base_stat_mana = SubResource( 26 )
base_stat_gcd = SubResource( 17 )
base_stat_haste = SubResource( 18 )
base_stat_agility = SubResource( 6 )
base_stat_strength = SubResource( 46 )
base_stat_stamina = SubResource( 45 )
base_stat_intellect = SubResource( 24 )
base_stat_spirit = SubResource( 43 )
base_stat_haste_rating = SubResource( 19 )
base_stat_resilience = SubResource( 34 )
base_stat_armor = SubResource( 7 )
base_stat_attack_power = SubResource( 8 )
base_stat_spell_power = SubResource( 42 )
base_stat_melee_crit = SubResource( 27 )
base_stat_melee_crit_bonus = SubResource( 28 )
base_stat_spell_crit = SubResource( 38 )
base_stat_spell_crit_bonus = SubResource( 39 )
base_stat_block = SubResource( 9 )
base_stat_parry = SubResource( 32 )
base_stat_damage_reduction = SubResource( 11 )
base_stat_melee_damage_reduction = SubResource( 30 )
base_stat_spell_damage_reduction = SubResource( 41 )
base_stat_damage_taken = SubResource( 12 )
base_stat_heal_taken = SubResource( 20 )
base_stat_melee_damage = SubResource( 29 )
base_stat_spell_damage = SubResource( 40 )
base_stat_holy_resist = SubResource( 22 )
base_stat_shadow_resist = SubResource( 35 )
base_stat_nature_resist = SubResource( 31 )
base_stat_fire_resist = SubResource( 15 )
base_stat_frost_resist = SubResource( 16 )
base_stat_lightning_resist = SubResource( 25 )
base_stat_chaos_resist = SubResource( 10 )
base_stat_silence_resist = SubResource( 36 )
base_stat_fear_resist = SubResource( 14 )
base_stat_stun_resist = SubResource( 47 )
base_stat_energy = SubResource( 13 )
base_stat_rage = SubResource( 33 )
base_stat_xp_rate = SubResource( 48 )
base_stat_ = SubResource( 5 )
level_stat_data = SubResource( 49 )
[sub_resource type="StatData" id=47]
level_stat_data = SubResource( 5 )
stat/agility = SubResource( 6 )
stat/strength = SubResource( 44 )
stat/stamina = SubResource( 43 )
stat/intellect = SubResource( 23 )
stat/spirit = SubResource( 42 )
stat/health = SubResource( 21 )
stat/speed = SubResource( 36 )
stat/mana = SubResource( 25 )
stat/global_cooldown = SubResource( 17 )
stat/haste = SubResource( 18 )
stat/haste_rating = SubResource( 19 )
stat/resilience = SubResource( 33 )
stat/armor = SubResource( 7 )
stat/attack_power = SubResource( 8 )
stat/spell_power = SubResource( 41 )
stat/melee_crit = SubResource( 26 )
stat/melee_crit_bonus = SubResource( 27 )
stat/spell_crit = SubResource( 37 )
stat/spell_crit_bonus = SubResource( 38 )
stat/block = SubResource( 9 )
stat/parry = SubResource( 31 )
stat/damage_reduction = SubResource( 11 )
stat/melee_damage_reduction = SubResource( 29 )
stat/spell_damage_reduction = SubResource( 40 )
stat/damage_taken = SubResource( 12 )
stat/heal_taken = SubResource( 20 )
stat/melee_damage = SubResource( 28 )
stat/spell_damage = SubResource( 39 )
stat/holy_resist = SubResource( 22 )
stat/shadow_resist = SubResource( 34 )
stat/nature_resist = SubResource( 30 )
stat/fire_resist = SubResource( 15 )
stat/frost_resist = SubResource( 16 )
stat/lightning_resist = SubResource( 24 )
stat/chaos_resist = SubResource( 10 )
stat/silence_resist = SubResource( 35 )
stat/fear_resist = SubResource( 14 )
stat/stun_resist = SubResource( 45 )
stat/energy = SubResource( 13 )
stat/rage = SubResource( 32 )
stat/xp_rate = SubResource( 46 )
[resource]
resource_name = "Naturalist"
id = 1
text_name = "Naturalist"
stat_data = SubResource( 50 )
stat_data = SubResource( 47 )
player_resource_type = 2
entity_resources = [ ExtResource( 27 ) ]
specs = [ SubResource( 4 ) ]

View File

@ -1,4 +1,4 @@
[gd_resource type="EntityClassData" load_steps=52 format=2]
[gd_resource type="EntityClassData" load_steps=51 format=2]
[ext_resource path="res://scripts/entities/EntityClassDataGD.gd" type="Script" id=1]
[ext_resource path="res://data/character_specs/2_elementalist_fire.tres" type="CharacterSpec" id=2]
@ -8,11 +8,15 @@
[ext_resource path="res://data/spells/32_heat.tres" type="Spell" id=6]
[ext_resource path="res://data/spells/33_normal.tres" type="Spell" id=7]
[sub_resource type="StatDataEntry" id=1]
stat_id = 41
[sub_resource type="SimpleLevelStatData" id=1]
agility = 4
strength = 5
stamina = 5
intellect = 3
spirit = 5
[sub_resource type="StatDataEntry" id=2]
stat_id = 5
base = 5.0
[sub_resource type="StatDataEntry" id=3]
stat_id = 12
@ -22,7 +26,6 @@ stat_id = 13
[sub_resource type="StatDataEntry" id=5]
stat_id = 19
base = 10.0
[sub_resource type="StatDataEntry" id=6]
stat_id = 34
@ -46,11 +49,11 @@ stat_id = 31
stat_id = 32
[sub_resource type="StatDataEntry" id=13]
stat_id = 3
stat_id = 8
base = 1.5
[sub_resource type="StatDataEntry" id=14]
stat_id = 4
stat_id = 9
[sub_resource type="StatDataEntry" id=15]
stat_id = 10
@ -59,43 +62,38 @@ stat_id = 10
stat_id = 25
[sub_resource type="StatDataEntry" id=17]
stat_id = 0
base = 100.0
stat_id = 5
[sub_resource type="StatDataEntry" id=18]
stat_id = 28
[sub_resource type="StatDataEntry" id=19]
stat_id = 8
stat_id = 3
base = 5.0
[sub_resource type="StatDataEntry" id=20]
stat_id = 33
[sub_resource type="StatDataEntry" id=21]
stat_id = 2
base = 100.0
stat_id = 7
[sub_resource type="StatDataEntry" id=22]
stat_id = 15
base = 5.0
[sub_resource type="StatDataEntry" id=23]
stat_id = 16
base = 50.0
[sub_resource type="StatDataEntry" id=24]
stat_id = 26
[sub_resource type="StatDataEntry" id=25]
stat_id = 22
base = 15.0
[sub_resource type="StatDataEntry" id=26]
stat_id = 30
[sub_resource type="StatDataEntry" id=27]
stat_id = 20
base = 15.0
[sub_resource type="StatDataEntry" id=28]
stat_id = 39
@ -110,16 +108,14 @@ stat_id = 29
stat_id = 35
[sub_resource type="StatDataEntry" id=32]
stat_id = 1
stat_id = 6
base = 4.2
[sub_resource type="StatDataEntry" id=33]
stat_id = 17
base = 5.0
[sub_resource type="StatDataEntry" id=34]
stat_id = 18
base = 50.0
[sub_resource type="StatDataEntry" id=35]
stat_id = 27
@ -131,78 +127,72 @@ stat_id = 23
stat_id = 14
[sub_resource type="StatDataEntry" id=38]
stat_id = 9
stat_id = 4
base = 4.0
[sub_resource type="StatDataEntry" id=39]
stat_id = 7
stat_id = 2
base = 6.0
[sub_resource type="StatDataEntry" id=40]
stat_id = 6
stat_id = 1
base = 5.0
[sub_resource type="StatDataEntry" id=41]
stat_id = 37
[sub_resource type="StatDataEntry" id=42]
stat_id = 40
base = 1.0
[sub_resource type="SimpleLevelStatData" id=43]
agility_per_level = 4
strength_per_level = 4
stamina_per_level = 5
intellect_per_level = 5
spirit_per_level = 1
[sub_resource type="StatData" id=44]
base_stat_health = SubResource( 17 )
base_stat_speed = SubResource( 32 )
base_stat_mana = SubResource( 21 )
base_stat_gcd = SubResource( 13 )
base_stat_haste = SubResource( 14 )
base_stat_agility = SubResource( 2 )
base_stat_strength = SubResource( 40 )
base_stat_stamina = SubResource( 39 )
base_stat_intellect = SubResource( 19 )
base_stat_spirit = SubResource( 38 )
base_stat_haste_rating = SubResource( 15 )
base_stat_resilience = SubResource( 29 )
base_stat_armor = SubResource( 3 )
base_stat_attack_power = SubResource( 4 )
base_stat_spell_power = SubResource( 37 )
base_stat_melee_crit = SubResource( 22 )
base_stat_melee_crit_bonus = SubResource( 23 )
base_stat_spell_crit = SubResource( 33 )
base_stat_spell_crit_bonus = SubResource( 34 )
base_stat_block = SubResource( 5 )
base_stat_parry = SubResource( 27 )
base_stat_damage_reduction = SubResource( 7 )
base_stat_melee_damage_reduction = SubResource( 25 )
base_stat_spell_damage_reduction = SubResource( 36 )
base_stat_damage_taken = SubResource( 8 )
base_stat_heal_taken = SubResource( 16 )
base_stat_melee_damage = SubResource( 24 )
base_stat_spell_damage = SubResource( 35 )
base_stat_holy_resist = SubResource( 18 )
base_stat_shadow_resist = SubResource( 30 )
base_stat_nature_resist = SubResource( 26 )
base_stat_fire_resist = SubResource( 11 )
base_stat_frost_resist = SubResource( 12 )
base_stat_lightning_resist = SubResource( 20 )
base_stat_chaos_resist = SubResource( 6 )
base_stat_silence_resist = SubResource( 31 )
base_stat_fear_resist = SubResource( 10 )
base_stat_stun_resist = SubResource( 41 )
base_stat_energy = SubResource( 9 )
base_stat_rage = SubResource( 28 )
base_stat_xp_rate = SubResource( 42 )
base_stat_ = SubResource( 1 )
level_stat_data = SubResource( 43 )
[sub_resource type="StatData" id=43]
level_stat_data = SubResource( 1 )
stat/agility = SubResource( 2 )
stat/strength = SubResource( 40 )
stat/stamina = SubResource( 39 )
stat/intellect = SubResource( 19 )
stat/spirit = SubResource( 38 )
stat/health = SubResource( 17 )
stat/speed = SubResource( 32 )
stat/mana = SubResource( 21 )
stat/global_cooldown = SubResource( 13 )
stat/haste = SubResource( 14 )
stat/haste_rating = SubResource( 15 )
stat/resilience = SubResource( 29 )
stat/armor = SubResource( 3 )
stat/attack_power = SubResource( 4 )
stat/spell_power = SubResource( 37 )
stat/melee_crit = SubResource( 22 )
stat/melee_crit_bonus = SubResource( 23 )
stat/spell_crit = SubResource( 33 )
stat/spell_crit_bonus = SubResource( 34 )
stat/block = SubResource( 5 )
stat/parry = SubResource( 27 )
stat/damage_reduction = SubResource( 7 )
stat/melee_damage_reduction = SubResource( 25 )
stat/spell_damage_reduction = SubResource( 36 )
stat/damage_taken = SubResource( 8 )
stat/heal_taken = SubResource( 16 )
stat/melee_damage = SubResource( 24 )
stat/spell_damage = SubResource( 35 )
stat/holy_resist = SubResource( 18 )
stat/shadow_resist = SubResource( 30 )
stat/nature_resist = SubResource( 26 )
stat/fire_resist = SubResource( 11 )
stat/frost_resist = SubResource( 12 )
stat/lightning_resist = SubResource( 20 )
stat/chaos_resist = SubResource( 6 )
stat/silence_resist = SubResource( 31 )
stat/fear_resist = SubResource( 10 )
stat/stun_resist = SubResource( 41 )
stat/energy = SubResource( 9 )
stat/rage = SubResource( 28 )
stat/xp_rate = SubResource( 42 )
[resource]
resource_name = "Elementalist"
id = 2
text_name = "Elementalist"
stat_data = SubResource( 44 )
stat_data = SubResource( 43 )
player_resource_type = 2
playstyle_type = 2
specs = [ ExtResource( 2 ), ExtResource( 3 ), ExtResource( 4 ) ]

File diff suppressed because one or more lines are too long

View File

@ -89,7 +89,11 @@ var entity : Entity
var model_rotation_node : Spatial
var character_skeleton : CharacterSkeleton3D
var speed_stat_id : int
func _ready() -> void:
speed_stat_id = ESS.stat_get_id("Speed")
camera = get_node_or_null("CameraPivot/Camera") as Camera
camera_pivot = get_node_or_null("CameraPivot") as Spatial
@ -258,7 +262,7 @@ func process_movement_player(delta : float) -> void:
hvel.y = 0
var target : Vector3 = dir
target *= entity.get_speed().ccurrent
target *= entity.get_stat(speed_stat_id).ccurrent
var accel
if dir.dot(hvel) > 0:
@ -332,7 +336,7 @@ func process_movement_mob(delta : float) -> void:
hvel.y = 0
var target : Vector3 = dir
target *= entity.get_speed().ccurrent
target *= entity.get_stat(speed_stat_id).ccurrent
var accel
if dir.dot(hvel) > 0:

View File

@ -1,416 +0,0 @@
extends Entity
# Copyright (c) 2019-2020 Péter Magyar
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
export (float) var MOUSE_SENSITIVITY : float = 0.05
export (String) var map_path : String
const ray_length = 1000
const ACCEL : float = 100.0
const DEACCEL : float = 100.0
const GRAVITY : float = -24.8
const JUMP_SPEED : float = 3.8
const MAX_SLOPE_ANGLE : float = 40.0
const MOUSE_TARGET_MAX_OFFSET : int = 10
var _on : bool = true
var y_rot : float = 0.0
var vel : Vector3 = Vector3()
var dir : Vector3 = Vector3()
var input_dir : Vector2 = Vector2()
var mouse_dir : Vector2 = Vector2()
var mouse_move_dir : Vector2 = Vector2()
var mouse_left_down : bool = false
var mouse_right_down : bool = false
var touchpad_dir : Vector2 = Vector2()
var mouse_down_delta : Vector2 = Vector2()
var queued_camera_rotaions : Vector2 = Vector2()
var key_left : bool = false
var key_right : bool = false
var key_up : bool = false
var key_down : bool = false
var cursor_grabbed : bool = false
var last_cursor_pos : Vector2 = Vector2()
var mouse_down_pos : Vector2 = Vector2()
var total_down_mouse_delta : Vector2 = Vector2()
var camera : Camera
var camera_pivot : Spatial
var animation_tree : AnimationTree
var anim_node_state_machine : AnimationNodeStateMachinePlayback = null
var animation_run : bool = false
var moving : bool = false
var casting_anim : bool = false
var last_mouse_over : Entity = null
func _ready() -> void:
camera = $CameraPivot/Camera as Camera
camera_pivot = $CameraPivot as Spatial
animation_tree = get_character_skeleton().get_animation_tree()
if animation_tree != null:
anim_node_state_machine = animation_tree["parameters/playback"]
set_process(true)
func _physics_process(delta : float) -> void:
if not _on:
return
process_input(delta)
process_movement(delta)
func process_input(delta: float) -> void:
var key_dir : Vector2 = Vector2()
if key_up:
key_dir.y += 1
if key_down:
key_dir.y -= 1
if key_left:
key_dir.x += 1
if key_right:
key_dir.x -= 1
input_dir = key_dir + mouse_dir + touchpad_dir + mouse_move_dir
var state : int = getc_state()
if state & EntityEnums.ENTITY_STATE_TYPE_FLAG_ROOT != 0 or state & EntityEnums.ENTITY_STATE_TYPE_FLAG_STUN != 0:
input_dir = Vector2()
return
var input_length : float = input_dir.length_squared()
if input_length > 0.1:
if anim_node_state_machine != null and not animation_run:
anim_node_state_machine.travel("run-loop")
animation_run = true
input_dir = input_dir.normalized()
animation_tree["parameters/run-loop/blend_position"] = input_dir
else:
if anim_node_state_machine != null and animation_run:
anim_node_state_machine.travel("idle-loop")
animation_run = false
if queued_camera_rotaions.length_squared() > 1:
camera_pivot.rotate_delta(queued_camera_rotaions.x * 2.0, -queued_camera_rotaions.y)
queued_camera_rotaions = Vector2()
if input_length > 0.1:
rotate_delta(camera_pivot.get_y_rot())
camera_pivot.set_y_rot(0.0)
func process_movement(delta : float) -> void:
var state : int = getc_state()
if state & EntityEnums.ENTITY_STATE_TYPE_FLAG_ROOT != 0 or state & EntityEnums.ENTITY_STATE_TYPE_FLAG_STUN != 0:
moving = false
return
if input_dir.x > 0.1 or input_dir.y > 0.1 or input_dir.x < -0.1 or input_dir.y < -0.1:
var forward : Vector3 = Vector3(0, 0, 1).rotated(Vector3(0, 1, 0), deg2rad(y_rot))
var right : Vector3 = forward.cross(Vector3(0, 1, 0)) * -input_dir.x
forward *= input_dir.y #only potentially make it zero after getting the right vector
dir = forward
dir += right
if dir.length_squared() > 0.1:
dir = dir.normalized()
moving = true
moved()
else:
dir = Vector3()
moving = false
vel.y += delta * GRAVITY
var hvel : Vector3 = vel
hvel.y = 0
var target : Vector3 = dir
target *= get_speed().ccurrent
var accel
if dir.dot(hvel) > 0:
accel = ACCEL
else:
accel = DEACCEL
hvel = hvel.linear_interpolate(target, accel * delta) as Vector3
vel.x = hvel.x
vel.z = hvel.z
vel = get_body().move_and_slide(vel, Vector3(0,1,0), false, 4, deg2rad(MAX_SLOPE_ANGLE))
if get_tree().network_peer:
if get_tree().is_network_server():
set_position(get_body().translation, get_body().rotation)
else:
rpc("set_position", get_body().translation, get_body().rotation)
func _input(event: InputEvent) -> void:
if not cursor_grabbed:
set_process_input(false)
return
if event is InputEventMouseMotion and event.device != -1:
var s : float = ProjectSettings.get("display/mouse_cursor/sensitivity")
var relx : float = event.relative.x * s
var rely : float = event.relative.y * s
mouse_down_delta.x += relx
mouse_down_delta.y += rely
total_down_mouse_delta.x += relx
total_down_mouse_delta.y += rely
get_tree().set_input_as_handled()
if (mouse_right_down or mouse_left_down) and event.device != -1:
if mouse_right_down:
camera_pivot.rotate_delta(0.0, event.relative.y)
rotate_delta(-event.relative.x)
else:
camera_pivot.rotate_delta(-relx, rely)
func _unhandled_input(event: InputEvent) -> void:
if event is InputEventKey:
var ievkey : InputEventKey = event as InputEventKey
if ievkey.scancode == KEY_W:
key_up = ievkey.pressed
if ievkey.scancode == KEY_S:
key_down = ievkey.pressed
if ievkey.scancode == KEY_A:
key_left = ievkey.pressed
if ievkey.scancode == KEY_D:
key_right = ievkey.pressed
if event is InputEventMouseMotion and not (mouse_right_down or mouse_left_down) and event.device != -1:
cmouseover(event)
if event is InputEventMouseButton:
if event.button_index == BUTTON_LEFT and event.device != -1:
mouse_left_down = event.pressed
if mouse_left_down:
mouse_down_delta = Vector2()
mouse_down_pos = event.position
if event.button_index == BUTTON_RIGHT and event.device != -1:
mouse_right_down = event.pressed
if mouse_right_down:
rotate_delta(camera_pivot.get_y_rot())
camera_pivot.set_y_rot(0.0)
if mouse_left_down and mouse_right_down:
mouse_move_dir.y = 1
else:
mouse_move_dir.y = 0
if event.is_pressed() and event.device != -1:
if event.button_index == BUTTON_WHEEL_UP:
camera_pivot.camera_distance_set_delta(-0.2)
if event.button_index == BUTTON_WHEEL_DOWN:
camera_pivot.camera_distance_set_delta(0.2)
if not event.pressed and event.button_index == BUTTON_LEFT and event.device != -1:
if mouse_down_delta.length() < MOUSE_TARGET_MAX_OFFSET:
target(event.position)
if event is InputEventScreenTouch and event.pressed:
target(event.position)
update_cursor_mode()
func update_cursor_mode():
if mouse_left_down or mouse_right_down:
if not cursor_grabbed:
set_process_input(true)
total_down_mouse_delta = Vector2()
cursor_grabbed = true
last_cursor_pos = get_viewport().get_mouse_position()
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
else:
if cursor_grabbed:
set_process_input(false)
cursor_grabbed = false
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
get_viewport().warp_mouse(last_cursor_pos)
if total_down_mouse_delta.length_squared() < 8:
target(last_cursor_pos)
func rotate_delta(x_delta : float) -> void:
y_rot += x_delta
while y_rot > 360:
y_rot -= 360
while y_rot < 0:
y_rot += 360
get_body().rotation_degrees = Vector3(0.0, y_rot, 0.0)
func target(position : Vector2):
var from = camera.project_ray_origin(position)
var to = from + camera.project_ray_normal(position) * ray_length
var space_state = get_body().get_world().direct_space_state
var result = space_state.intersect_ray(from, to, [], 2)
if result:
if result.collider and result.collider is Entity:
var ent : Entity = result.collider as Entity
crequest_target_change(ent.get_path())
return
crequest_target_change(NodePath())
else:
crequest_target_change(NodePath())
func cmouseover(event):
var from = camera.project_ray_origin(event.position)
var to = from + camera.project_ray_normal(event.position) * ray_length
var space_state = get_body().get_world().direct_space_state
var result = space_state.intersect_ray(from, to, [], 2)
if result:
if result.collider and result.collider is Entity:
var mo : Entity = result.collider as Entity
if last_mouse_over != null and last_mouse_over != mo:
if is_instance_valid(last_mouse_over):
last_mouse_over.onc_mouse_exit()
last_mouse_over = null
if last_mouse_over == null:
mo.onc_mouse_enter()
last_mouse_over = mo
return
if last_mouse_over != null:
last_mouse_over.onc_mouse_exit()
last_mouse_over = null
func analog_force_change(vector, touchpad):
if touchpad.padname == "TouchPad":
touchpad_dir = vector
touchpad_dir.x *= -1
elif touchpad.padname == "TargetPad":
#try to target
return
func queue_camera_rotation(rot : Vector2) -> void:
queued_camera_rotaions += rot
remote func set_position(position : Vector3, rotation : Vector3) -> void:
if get_tree().is_network_server():
rpc("set_position", position, rotation)
func _moved() -> void:
if sis_casting():
sfail_cast()
func _con_target_changed(entity: Entity, old_target: Entity) -> void:
if is_instance_valid(old_target):
old_target.onc_untargeted()
if is_instance_valid(ctarget):
ctarget.onc_targeted()
if canc_interact():
crequest_interact()
func _con_cast_started(info):
if anim_node_state_machine != null and not casting_anim:
anim_node_state_machine.travel("casting-loop")
casting_anim = true
animation_run = false
func _con_cast_failed(info):
if anim_node_state_machine != null and casting_anim:
anim_node_state_machine.travel("idle-loop")
casting_anim = false
if animation_run:
anim_node_state_machine.travel("run-loop")
func _con_cast_finished(info):
if anim_node_state_machine != null:
anim_node_state_machine.travel("cast-end")
casting_anim = false
if animation_run:
anim_node_state_machine.travel("run-loop")
func _con_spell_cast_success(info):
if anim_node_state_machine != null:
anim_node_state_machine.travel("cast-end")
casting_anim = false
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

View File

@ -46,13 +46,17 @@ var health_bar_label : Label = null
var entity : Entity = null
var health : Stat = null
var health_stat_id : int
func _ready():
health_stat_id = ESS.stat_get_id("Health")
name_label = get_node(name_label_path) as Label
health_bar = get_node(health_bar_path) as TextureProgress
health_bar_label = get_node(health_bar_label_path) as Label
entity = get_node("../..") as Entity
health = entity.get_health()
health = entity.get_stat(health_stat_id)
health.connect("c_changed", self, "c_health_changed")

View File

@ -370,6 +370,7 @@ spells/allow_class_recipe_learning=true
level/use_class_xp=true
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,Speed,Mana,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"
profiles/automatic_save=true
[importer_defaults]

View File

@ -60,7 +60,7 @@ func _sapply(info : AuraApplyInfo) -> void:
for i in range(get_aura_stat_attribute_count()):
var stat_attribute : AuraStatAttribute = get_aura_stat_attribute(i)
var stat : Stat = info.target.get_stat_enum(stat_attribute.stat)
var stat : Stat = info.target.get_stat(stat_attribute.stat)
stat.add_modifier(id, stat_attribute.base_mod, stat_attribute.bonus_mod, stat_attribute.percent_mod)
if states_add != 0:
@ -80,7 +80,7 @@ func _sdeapply(data : AuraData) -> void:
for i in range(get_aura_stat_attribute_count()):
var stat_attribute : AuraStatAttribute = get_aura_stat_attribute(i)
var stat : Stat = data.owner.get_stat_enum(stat_attribute.stat)
var stat : Stat = data.owner.get_stat(stat_attribute.stat)
stat.remove_modifier(id)

View File

@ -25,19 +25,24 @@ var mana_regen : int = 10
var tickrate : float = 2
var timer : float = 0
var int_id : int = 0
var spirit_id = 0
func _init():
should_process = true
int_id = ESS.stat_get_id("Intellect")
spirit_id = ESS.stat_get_id("Spirit")
func _ons_added(entity):
refresh()
func _ons_stat_changed(stat : Stat):
if stat.id == Stat.STAT_ID_INTELLECT || stat.id == Stat.STAT_ID_SPIRIT:
if stat.id == int_id || stat.id == spirit_id:
refresh()
func refresh():
var intellect : Stat = owner.get_stat_int(Stat.STAT_ID_INTELLECT)
var spirit : Stat = owner.get_stat_int(Stat.STAT_ID_SPIRIT)
var intellect : Stat = owner.get_stat(int_id)
var spirit : Stat = owner.get_stat(spirit_id)
var m : bool = false

View File

@ -39,8 +39,12 @@ var _aura_grid : GridContainer
var _player : Entity
var _mana : ManaResource
var health_stat_id : int
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
health_stat_id = ESS.stat_get_id("Health")
_name_text = get_node(name_text_path) as Label
_health_range = get_node(health_range_path) as Range
_health_text = get_node(health_text_path) as Label
@ -50,7 +54,7 @@ func _ready() -> void:
func set_player(p_player : Entity) -> void:
if not _player == null and is_instance_valid(_player):
_player.get_health().disconnect("c_changed", self, "_on_player_health_changed")
_player.get_stat(health_stat_id).disconnect("c_changed", self, "_on_player_health_changed")
_player.disconnect("caura_added", self, "on_caura_added")
_player.disconnect("caura_removed", self, "on_caura_removed")
_player.disconnect("cdied", self, "cdied")
@ -87,7 +91,7 @@ func set_player(p_player : Entity) -> void:
for i in range(_player.getc_resource_count()):
centity_resource_added(_player.getc_resource_index(i))
var health = _player.get_health()
var health = _player.get_stat(health_stat_id)
_on_player_health_changed(health)
health.connect("c_changed", self, "_on_player_health_changed")

View File

@ -40,7 +40,11 @@ var _player : Entity
var _mana : ManaResource
var health_stat_id : int
func _ready() -> void:
health_stat_id = ESS.stat_get_id("Health")
_name_text = get_node(name_text_path)
_level_text = get_node(level_text_path)
_health_range = get_node(health_range_path)
@ -80,7 +84,7 @@ func set_player(p_player: Entity) -> void:
for i in range(_player.getc_resource_count()):
centity_resource_added(_player.getc_resource_index(i))
var health = _player.get_health()
var health = _player.get_stat(health_stat_id)
_on_player_health_changed(health)
health.connect("c_changed", self, "_on_player_health_changed")
@ -142,5 +146,5 @@ func con_xp_gained(entity: Entity, val: int) -> void:
_xp_range.value = _player.ccharacter_xp
func centity_data_changed(data: EntityData) -> void:
var health = _player.get_health()
var health = _player.get_stat(health_stat_id)
_on_player_health_changed(health)