mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-11-13 20:47:19 +01:00
Update every module to the latest.
This commit is contained in:
parent
08971de608
commit
8fd696c71a
2
HEADS
2
HEADS
@ -1 +1 @@
|
|||||||
{"world_generator": "290d973ea9580f748881a54502850ae5fecfb586", "entity_spell_system": "9e16f68ff75bb2b8773a9ef4cd4aa84299e7579c", "ui_extensions": "271dcf89e9afe5cb6350de2f2433c8ebf8aba785", "voxelman": "2b369f5be8efc5fe0ef13da57afa46317c413f47", "texture_packer": "604c330188e220c15d10ea5bd545a6fc5aab0132", "fastnoise": "41b7ea05a1f7aa2b8ecddaa1fd739e64d6970f7e"}
|
{"engine": "8fb7481fd53313c5b7a7cece27af0de84c404853", "world_generator": "290d973ea9580f748881a54502850ae5fecfb586", "entity_spell_system": "6bd6ad462333017a01c247fad251059f95904be5", "ui_extensions": "271dcf89e9afe5cb6350de2f2433c8ebf8aba785", "voxelman": "2b369f5be8efc5fe0ef13da57afa46317c413f47", "texture_packer": "604c330188e220c15d10ea5bd545a6fc5aab0132", "fastnoise": "41b7ea05a1f7aa2b8ecddaa1fd739e64d6970f7e", "entity-spell-system-addons": "dd1953e7bbc4a36745fe4d7f6f7c94651fb07b95"}
|
@ -219,7 +219,7 @@ func spawn_mob(class_id : int, level : int, position : Vector3) -> Entity:
|
|||||||
createinfo.player_name = "Mob"
|
createinfo.player_name = "Mob"
|
||||||
createinfo.level = level
|
createinfo.level = level
|
||||||
# createinfo.level = level
|
# createinfo.level = level
|
||||||
createinfo.entity_controller = EntityEnums.ENITIY_CONTROLLER_MOB
|
createinfo.entity_controller = EntityEnums.ENITIY_CONTROLLER_AI
|
||||||
|
|
||||||
var entity : Entity = spawn(createinfo, false, position)
|
var entity : Entity = spawn(createinfo, false, position)
|
||||||
entity.slevelup(level - 1)
|
entity.slevelup(level - 1)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[gd_resource type="EntityClassData" load_steps=74 format=2]
|
[gd_resource type="EntityClassData" load_steps=76 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://data/spells/26_rest.tres" type="Spell" id=1]
|
[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]
|
[ext_resource path="res://data/spells/21_strength_of_nature_rank_1.tres" type="Spell" id=2]
|
||||||
@ -19,6 +19,7 @@
|
|||||||
[ext_resource path="res://data/spells/25_inner_will.tres" type="Spell" id=17]
|
[ext_resource path="res://data/spells/25_inner_will.tres" type="Spell" id=17]
|
||||||
[ext_resource path="res://data/auras/1_test1.tres" type="Aura" id=18]
|
[ext_resource path="res://data/auras/1_test1.tres" type="Aura" id=18]
|
||||||
[ext_resource path="res://scripts/entities/NaturalistGD.gd" type="Script" id=19]
|
[ext_resource path="res://scripts/entities/NaturalistGD.gd" type="Script" id=19]
|
||||||
|
[ext_resource path="res://scripts/ai/EntityAIGD.gd" type="Script" id=20]
|
||||||
[ext_resource path="res://data/auras/13_aspect_of_bees_rank_1.tres" type="Aura" id=21]
|
[ext_resource path="res://data/auras/13_aspect_of_bees_rank_1.tres" type="Aura" id=21]
|
||||||
[ext_resource path="res://data/auras/15_close_wounds_rank_1.tres" type="Aura" id=22]
|
[ext_resource path="res://data/auras/15_close_wounds_rank_1.tres" type="Aura" id=22]
|
||||||
[ext_resource path="res://data/spells/29_aspect_of_wolves.tres" type="Spell" id=23]
|
[ext_resource path="res://data/spells/29_aspect_of_wolves.tres" type="Spell" id=23]
|
||||||
@ -26,6 +27,9 @@
|
|||||||
[ext_resource path="res://data/spells/28_aspectofwasps.tres" type="Spell" id=25]
|
[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/spells/30_aspect_of_bees.tres" type="Spell" id=26]
|
||||||
|
|
||||||
|
[sub_resource type="EntityAI" id=49]
|
||||||
|
script = ExtResource( 20 )
|
||||||
|
|
||||||
[sub_resource type="TalentRowData" id=1]
|
[sub_resource type="TalentRowData" id=1]
|
||||||
Talent_0_0 = ExtResource( 21 )
|
Talent_0_0 = ExtResource( 21 )
|
||||||
|
|
||||||
@ -251,5 +255,5 @@ specs = [ SubResource( 3 ) ]
|
|||||||
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 ) ]
|
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 ) ]
|
start_spells = [ ExtResource( 24 ) ]
|
||||||
auras = [ ExtResource( 18 ) ]
|
auras = [ ExtResource( 18 ) ]
|
||||||
ai_actions = [ null, null ]
|
ais = [ SubResource( 49 ) ]
|
||||||
script = ExtResource( 19 )
|
script = ExtResource( 19 )
|
||||||
|
@ -97,18 +97,18 @@ func _physics_process(delta : float) -> void:
|
|||||||
if dead:
|
if dead:
|
||||||
return
|
return
|
||||||
|
|
||||||
if ai_state == EntityEnums.AI_STATE_OFF:
|
# if ai_state == EntityEnums.AI_STATE_OFF:
|
||||||
return
|
# return
|
||||||
elif ai_state == EntityEnums.AI_STATE_PATROL:
|
# elif ai_state == EntityEnums.AI_STATE_PATROL:
|
||||||
sentity_data.sai_rest(self)
|
# sentity_data.sai_rest(self)
|
||||||
elif ai_state == EntityEnums.AI_STATE_REST:
|
# elif ai_state == EntityEnums.AI_STATE_REST:
|
||||||
sentity_data.sai_rest(self)
|
# sentity_data.sai_rest(self)
|
||||||
elif ai_state == EntityEnums.AI_STATE_REGENERATE:
|
# elif ai_state == EntityEnums.AI_STATE_REGENERATE:
|
||||||
sentity_data.sai_regenerate(self)
|
# sentity_data.sai_regenerate(self)
|
||||||
elif ai_state == EntityEnums.AI_STATE_ATTACK:
|
# elif ai_state == EntityEnums.AI_STATE_ATTACK:
|
||||||
sentity_data.sai_attack(self)
|
# sentity_data.sai_attack(self)
|
||||||
elif ai_state == EntityEnums.AI_STATE_FOLLOW_PATH:
|
# elif ai_state == EntityEnums.AI_STATE_FOLLOW_PATH:
|
||||||
sentity_data.sai_follow(self)
|
# sentity_data.sai_follow(self)
|
||||||
|
|
||||||
process_movement(delta)
|
process_movement(delta)
|
||||||
|
|
||||||
|
@ -9,11 +9,6 @@
|
|||||||
config_version=4
|
config_version=4
|
||||||
|
|
||||||
_global_script_classes=[ {
|
_global_script_classes=[ {
|
||||||
"base": "AIActionContainer",
|
|
||||||
"class": "AITestActionContainer",
|
|
||||||
"language": "GDScript",
|
|
||||||
"path": "res://scripts/ai/TestContainer.gd"
|
|
||||||
}, {
|
|
||||||
"base": "Aura",
|
"base": "Aura",
|
||||||
"class": "AuraGD",
|
"class": "AuraGD",
|
||||||
"language": "GDScript",
|
"language": "GDScript",
|
||||||
@ -34,6 +29,11 @@ _global_script_classes=[ {
|
|||||||
"language": "GDScript",
|
"language": "GDScript",
|
||||||
"path": "res://player/DisplayPlayer.gd"
|
"path": "res://player/DisplayPlayer.gd"
|
||||||
}, {
|
}, {
|
||||||
|
"base": "EntityAI",
|
||||||
|
"class": "EntityAIGD",
|
||||||
|
"language": "GDScript",
|
||||||
|
"path": "res://scripts/ai/EntityAIGD.gd"
|
||||||
|
}, {
|
||||||
"base": "EntityData",
|
"base": "EntityData",
|
||||||
"class": "EntityDataGD",
|
"class": "EntityDataGD",
|
||||||
"language": "GDScript",
|
"language": "GDScript",
|
||||||
@ -180,11 +180,11 @@ _global_script_classes=[ {
|
|||||||
"path": "res://voxelman/transvoxel_mesher/TestVoxelMesher.gd"
|
"path": "res://voxelman/transvoxel_mesher/TestVoxelMesher.gd"
|
||||||
} ]
|
} ]
|
||||||
_global_script_class_icons={
|
_global_script_class_icons={
|
||||||
"AITestActionContainer": "",
|
|
||||||
"AuraGD": "",
|
"AuraGD": "",
|
||||||
"CharacterSkeketonAttachPoint": "",
|
"CharacterSkeketonAttachPoint": "",
|
||||||
"CubicVoxelChunk": "",
|
"CubicVoxelChunk": "",
|
||||||
"DisplayPlayerGD": "",
|
"DisplayPlayerGD": "",
|
||||||
|
"EntityAIGD": "",
|
||||||
"EntityDataGD": "",
|
"EntityDataGD": "",
|
||||||
"GDCubicVoxelMesher": "",
|
"GDCubicVoxelMesher": "",
|
||||||
"ItemTemplateGD": "",
|
"ItemTemplateGD": "",
|
||||||
|
108
game/scripts/ai/EntityAIGD.gd
Normal file
108
game/scripts/ai/EntityAIGD.gd
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
extends EntityAI
|
||||||
|
class_name EntityAIGD
|
||||||
|
|
||||||
|
# Copyright Péter Magyar relintai@gmail.com
|
||||||
|
# MIT License, functionality from this class needs to be protable to the entity spell system
|
||||||
|
|
||||||
|
var _data : Dictionary = {
|
||||||
|
"target_aura_spells": {},
|
||||||
|
"spells": []
|
||||||
|
}
|
||||||
|
|
||||||
|
func _on_set_owner():
|
||||||
|
if not is_instance_valid(owner):
|
||||||
|
return
|
||||||
|
|
||||||
|
if not owner.sentity_data:
|
||||||
|
return
|
||||||
|
|
||||||
|
var ent_data : EntityData = owner.sentity_data
|
||||||
|
|
||||||
|
if not ent_data.entity_class_data:
|
||||||
|
return
|
||||||
|
|
||||||
|
var class_data : EntityClassData = ent_data.entity_class_data
|
||||||
|
|
||||||
|
for i in range(class_data.get_num_spells()):
|
||||||
|
var spell : Spell = class_data.get_spell(i)
|
||||||
|
|
||||||
|
if spell.get_num_target_aura_applys() > 0:
|
||||||
|
var aura : Aura = spell.get_target_aura_apply(0)
|
||||||
|
|
||||||
|
if not _data["target_aura_spells"].has(aura.aura_group):
|
||||||
|
_data["target_aura_spells"][aura.aura_group] = []
|
||||||
|
|
||||||
|
_data["target_aura_spells"][aura.aura_group].append({ "aura_id": aura.id, "spell_id": spell.id, "rank": spell.rank })
|
||||||
|
|
||||||
|
continue
|
||||||
|
|
||||||
|
_data["spells"].append(spell.id)
|
||||||
|
|
||||||
|
for key in _data["target_aura_spells"]:
|
||||||
|
var arr : Array = _data["target_aura_spells"][key]
|
||||||
|
|
||||||
|
arr.sort_custom(self, "sort_spells_by_rank")
|
||||||
|
|
||||||
|
|
||||||
|
func _update(delta):
|
||||||
|
if owner.ai_state == EntityEnums.AI_STATE_ATTACK:
|
||||||
|
attack(delta)
|
||||||
|
|
||||||
|
func attack(delta):
|
||||||
|
var target : Entity = owner.starget
|
||||||
|
|
||||||
|
if target == null:
|
||||||
|
owner.ai_state = EntityEnums.AI_STATE_REGENERATE
|
||||||
|
owner.target_movement_direction = Vector2()
|
||||||
|
return
|
||||||
|
|
||||||
|
var cast : bool = false
|
||||||
|
if not owner.gets_has_global_cooldown():
|
||||||
|
var taspellsdict : Dictionary = _data["target_aura_spells"]
|
||||||
|
|
||||||
|
for taskey in taspellsdict.keys():
|
||||||
|
for tas in taspellsdict[taskey]:
|
||||||
|
var spell_id : int = tas["spell_id"]
|
||||||
|
|
||||||
|
if not owner.hass_spell_id(spell_id):
|
||||||
|
continue
|
||||||
|
|
||||||
|
if taskey == null:
|
||||||
|
if target.sget_aura_by(owner, tas["aura_id"]) == null and not owner.hass_cooldown(spell_id):
|
||||||
|
owner.crequest_spell_cast(spell_id)
|
||||||
|
cast = true
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
if target.sget_aura_with_group_by(owner, taskey) == null and not owner.hass_cooldown(spell_id):
|
||||||
|
owner.crequest_spell_cast(spell_id)
|
||||||
|
cast = true
|
||||||
|
break
|
||||||
|
if cast:
|
||||||
|
break
|
||||||
|
|
||||||
|
if not cast:
|
||||||
|
var sps : Array = _data["spells"]
|
||||||
|
|
||||||
|
for spell_id in sps:
|
||||||
|
if not owner.hass_spell_id(spell_id):
|
||||||
|
continue
|
||||||
|
|
||||||
|
if not owner.hass_cooldown(spell_id):
|
||||||
|
owner.crequest_spell_cast(spell_id)
|
||||||
|
cast = true
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
|
if owner.sis_casting():
|
||||||
|
owner.target_movement_direction = Vector2()
|
||||||
|
return
|
||||||
|
|
||||||
|
var dir : Vector3 = target.translation - owner.translation
|
||||||
|
|
||||||
|
owner.target_movement_direction = Vector2(dir.x, dir.z)
|
||||||
|
|
||||||
|
func sort_spells_by_rank(a, b):
|
||||||
|
if a == null or b == null:
|
||||||
|
return true
|
||||||
|
|
||||||
|
return a["rank"] > b["rank"]
|
@ -1,9 +0,0 @@
|
|||||||
extends AIActionContainer
|
|
||||||
class_name AITestActionContainer
|
|
||||||
|
|
||||||
# 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_title() -> String:
|
|
||||||
return "AITestActionContainer"
|
|
@ -1,9 +1,8 @@
|
|||||||
extends EntityData
|
extends EntityData
|
||||||
class_name EntityDataGD
|
class_name EntityDataGD
|
||||||
|
|
||||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
# Copyright Péter Magyar relintai@gmail.com
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# MIT License, functionality from this class needs to be protable to the entity spell system
|
||||||
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
||||||
|
|
||||||
func _sinteract(entity: Entity) -> void:
|
func _sinteract(entity: Entity) -> void:
|
||||||
var target : Entity = entity.gets_target()
|
var target : Entity = entity.gets_target()
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
extends EntityClassData
|
extends EntityClassData
|
||||||
|
|
||||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
# Copyright Péter Magyar relintai@gmail.com
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# MIT License, functionality from this class needs to be protable to the entity spell system
|
||||||
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
||||||
|
|
||||||
var _data : Dictionary = {
|
var _data : Dictionary = {
|
||||||
"target_aura_spells": {},
|
"target_aura_spells": {},
|
||||||
|
Loading…
Reference in New Issue
Block a user