From 1e0daf2e73059b09ccca8e8e791a15a6dc7e5113 Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 23 Jul 2019 02:21:06 +0200 Subject: [PATCH] Added a bund of skeleton-related new classes. They aren't finished yet. Renamed the spells folder to infos. --- data/character_skeleton_visual_entry.h | 10 ++++- {spells => infos}/Queued/GenericAOESpell.cpp | 0 {spells => infos}/Queued/GenericAOESpell.h | 0 {spells => infos}/aura_infos.cpp | 0 {spells => infos}/aura_infos.h | 0 infos/entity_spawn_info.cpp | 13 ++++++ infos/entity_spawn_info.h | 24 +++++++++++ infos/player_spawn_info.cpp | 13 ++++++ infos/player_spawn_info.h | 27 ++++++++++++ {spells => infos}/spell_cast_info.cpp | 0 {spells => infos}/spell_cast_info.h | 0 skeleton/entity_equipset.cpp | 0 skeleton/entity_equipset.h | 22 ++++++++++ skeleton/entity_race.cpp | 8 ++++ skeleton/entity_race.h | 42 ++++++++++++++++++ skeleton/entity_skeleton_data.cpp | 0 skeleton/entity_skeleton_data.h | 30 +++++++++++++ skeleton/entity_texture_layer.cpp | 0 skeleton/entity_texture_layer.h | 45 ++++++++++++++++++++ 19 files changed, 233 insertions(+), 1 deletion(-) rename {spells => infos}/Queued/GenericAOESpell.cpp (100%) rename {spells => infos}/Queued/GenericAOESpell.h (100%) rename {spells => infos}/aura_infos.cpp (100%) rename {spells => infos}/aura_infos.h (100%) create mode 100644 infos/entity_spawn_info.cpp create mode 100644 infos/entity_spawn_info.h create mode 100644 infos/player_spawn_info.cpp create mode 100644 infos/player_spawn_info.h rename {spells => infos}/spell_cast_info.cpp (100%) rename {spells => infos}/spell_cast_info.h (100%) create mode 100644 skeleton/entity_equipset.cpp create mode 100644 skeleton/entity_equipset.h create mode 100644 skeleton/entity_race.cpp create mode 100644 skeleton/entity_race.h create mode 100644 skeleton/entity_skeleton_data.cpp create mode 100644 skeleton/entity_skeleton_data.h create mode 100644 skeleton/entity_texture_layer.cpp create mode 100644 skeleton/entity_texture_layer.h diff --git a/data/character_skeleton_visual_entry.h b/data/character_skeleton_visual_entry.h index 76442a5..fbf55a7 100644 --- a/data/character_skeleton_visual_entry.h +++ b/data/character_skeleton_visual_entry.h @@ -9,13 +9,19 @@ #include "../entity_enums.h" #include "../meshes/mesh_data_resource.h" +#include "../skeleton/entity_texture_layer.h" class CharacterSkeletonVisualEntry : public Resource { GDCLASS(CharacterSkeletonVisualEntry, Resource); public: static const String BINDING_STRING_BONE_ATTACHMENT_TYPES; - + + enum { + MAX_TEXTURE_LAYERS = 5 + }; + + //not needed, delete enum CharacterSkeletonVisualEntryType { BONE_ATTACHMENT_TYPE_NONE = 0, BONE_ATTACHMENT_TYPE_MESH = 1, @@ -50,6 +56,8 @@ private: EntityEnums::CharacterSkeletonPoints _target_bone; Ref _effect; Ref _mesh; + //apply these from to to bottom, with color index 0, if index not present. store color index in item instance. Use the same index for all of them at once. + Ref _texture_layers[MAX_TEXTURE_LAYERS]; }; VARIANT_ENUM_CAST(CharacterSkeletonVisualEntry::CharacterSkeletonVisualEntryType); diff --git a/spells/Queued/GenericAOESpell.cpp b/infos/Queued/GenericAOESpell.cpp similarity index 100% rename from spells/Queued/GenericAOESpell.cpp rename to infos/Queued/GenericAOESpell.cpp diff --git a/spells/Queued/GenericAOESpell.h b/infos/Queued/GenericAOESpell.h similarity index 100% rename from spells/Queued/GenericAOESpell.h rename to infos/Queued/GenericAOESpell.h diff --git a/spells/aura_infos.cpp b/infos/aura_infos.cpp similarity index 100% rename from spells/aura_infos.cpp rename to infos/aura_infos.cpp diff --git a/spells/aura_infos.h b/infos/aura_infos.h similarity index 100% rename from spells/aura_infos.h rename to infos/aura_infos.h diff --git a/infos/entity_spawn_info.cpp b/infos/entity_spawn_info.cpp new file mode 100644 index 0000000..c3258ac --- /dev/null +++ b/infos/entity_spawn_info.cpp @@ -0,0 +1,13 @@ +#include "character_spawn_info.h" + +CharacterSpawnInfo::CharacterSpawnInfo() { + +} + +CharacterSpawnInfo::~CharacterSpawnInfo() { + +} + +void CharacterSpawnInfo::_bind_methods() { + +} diff --git a/infos/entity_spawn_info.h b/infos/entity_spawn_info.h new file mode 100644 index 0000000..a8be98a --- /dev/null +++ b/infos/entity_spawn_info.h @@ -0,0 +1,24 @@ +#ifndef ENTITY_SPAWN_INFO_H +#define ENTITY_SPAWN_INFO_H + +#include "../entities/entity.h" +#include "core/reference.h" + +class EntitySpawnInfo : public Reference { + GDCLASS(EntitySpawnInfo, Reference); + +public: + + CharacterSpawnInfo(); + ~CharacterSpawnInfo(); + +protected: + static void _bind_methods(); + +private: + int _class_id; + int _race; + int _visual_set_id; +}; + +#endif diff --git a/infos/player_spawn_info.cpp b/infos/player_spawn_info.cpp new file mode 100644 index 0000000..c3258ac --- /dev/null +++ b/infos/player_spawn_info.cpp @@ -0,0 +1,13 @@ +#include "character_spawn_info.h" + +CharacterSpawnInfo::CharacterSpawnInfo() { + +} + +CharacterSpawnInfo::~CharacterSpawnInfo() { + +} + +void CharacterSpawnInfo::_bind_methods() { + +} diff --git a/infos/player_spawn_info.h b/infos/player_spawn_info.h new file mode 100644 index 0000000..d65cab0 --- /dev/null +++ b/infos/player_spawn_info.h @@ -0,0 +1,27 @@ +#ifndef ENTITY_SPAWN_INFO_H +#define ENTITY_SPAWN_INFO_H + +#include "../entities/entity.h" +#include "core/reference.h" + +class EntitySpawnInfo : public Reference { + GDCLASS(EntitySpawnInfo, Reference); + +public: + + CharacterSpawnInfo(); + ~CharacterSpawnInfo(); + + +protected: + static void _bind_methods(); + +private: + int _class_id; + int _race; + int _skin_color_index; + int _item_ids[20]; + int _item_color_indexes[20]; +}; + +#endif diff --git a/spells/spell_cast_info.cpp b/infos/spell_cast_info.cpp similarity index 100% rename from spells/spell_cast_info.cpp rename to infos/spell_cast_info.cpp diff --git a/spells/spell_cast_info.h b/infos/spell_cast_info.h similarity index 100% rename from spells/spell_cast_info.h rename to infos/spell_cast_info.h diff --git a/skeleton/entity_equipset.cpp b/skeleton/entity_equipset.cpp new file mode 100644 index 0000000..e69de29 diff --git a/skeleton/entity_equipset.h b/skeleton/entity_equipset.h new file mode 100644 index 0000000..a0567a1 --- /dev/null +++ b/skeleton/entity_equipset.h @@ -0,0 +1,22 @@ +#ifndef ENTITY_EQUIPSET_H +#define ENTITY_EQUIPSET_H + +#include "core/resource.h" +#include "core/ustring.h" + +class EntityEquipSet : public Resource { + GDCLASS(EntityEquipSet, Resource); + +public: +protected: + static void _bind_methods(); + + enum { + MAX_ENTRIES = 20 + }; + +private: + Ref _entries[MAX_ENTRIES]; +}; + +#endif diff --git a/skeleton/entity_race.cpp b/skeleton/entity_race.cpp new file mode 100644 index 0000000..93d47a6 --- /dev/null +++ b/skeleton/entity_race.cpp @@ -0,0 +1,8 @@ +#include "entity_race.h" + + +void EntityRace::_bind_methods() { + BIND_VMETHOD(MethodInfo(Variant::STRING, "_generate_name", PropertyInfo(Variant::INT, "seed"))); + + BIND_CONSTANT(MAX_SKIN_COLORS); + } diff --git a/skeleton/entity_race.h b/skeleton/entity_race.h new file mode 100644 index 0000000..3aaa0a2 --- /dev/null +++ b/skeleton/entity_race.h @@ -0,0 +1,42 @@ +#ifndef ENTITY_RACE_H +#define ENTITY_RACE_H + +#include "core/resource.h" +#include "core/ustring.h" + +class Spell; +class Aura; + +class EntityRace : public Resource { + GDCLASS(EntityRace, Resource); + +public: + enum { + MAX_SKIN_COLORS = 10, + MAX_SPELLS = 10, + MAX_AURAS = 10 + }; + + enum EntityRaceType { + ENTITY_RACE_TYPE_NONE, + ENTITY_RACE_TYPE_HUMANOID, + ENTITY_RACE_TYPE_BEAST + }; + + String generate_name(int seed); + +protected: + static void _bind_methods(); + +private: + + String _name; + String _description; + //Ref _skeleton_data; + Color _preset_skin_colors[MAX_SKIN_COLORS]; + Ref _spells[MAX_SPELLS]; + Ref _auras[MAX_AURAS]; + EntityRaceType _type; +}; + +#endif diff --git a/skeleton/entity_skeleton_data.cpp b/skeleton/entity_skeleton_data.cpp new file mode 100644 index 0000000..e69de29 diff --git a/skeleton/entity_skeleton_data.h b/skeleton/entity_skeleton_data.h new file mode 100644 index 0000000..cb696ee --- /dev/null +++ b/skeleton/entity_skeleton_data.h @@ -0,0 +1,30 @@ +#ifndef ENTITY_SKELETON_DATA_H +#define ENTITY_SKELETON_DATA_H + +#include "core/resource.h" +#include "core/ustring.h" + +class EntitySkeletonData : public Resource { + GDCLASS(EntitySkeletonData, Resource); + +public: + +protected: + static void _bind_methods(); + + enum { + MAX_ENTRIES = 20 + }; + + struct ESDataEntry { + Ref entry; + Vector3 offset; + Vector3 rotation; + Vector3 scale; + }; + +private: + ESDataEntry _entries[MAX_ENTRIES]; +}; + +#endif diff --git a/skeleton/entity_texture_layer.cpp b/skeleton/entity_texture_layer.cpp new file mode 100644 index 0000000..e69de29 diff --git a/skeleton/entity_texture_layer.h b/skeleton/entity_texture_layer.h new file mode 100644 index 0000000..dc0a168 --- /dev/null +++ b/skeleton/entity_texture_layer.h @@ -0,0 +1,45 @@ +#ifndef ENTITY_TEXTURE_LAYER_H +#define ENTITY_TEXTURE_LAYER_H + +#include "core/resource.h" +#include "core/ustring.h" + +class EntityTextureLayer : public Resource { + GDCLASS(EntityTextureLayer, Resource); + +public: + enum { + MAX_COLORS = 6 + }; + + enum EntityTextureLayerLayers { + ENTITY_TEXTURE_LAYER_NONE = 0, + ENTITY_TEXTURE_LAYER_SKIN = 1, + ENTITY_TEXTURE_LAYER_UNDERWEAR = 2, + ENTITY_TEXTURE_LAYER_SHIRT = 3, + ENTITY_TEXTURE_LAYER_CLOTHES_BASE = 4, + ENTITY_TEXTURE_LAYER_BELT = 5, + ENTITY_TEXTURE_LAYER_TABARD = 6, + ENTITY_TEXTURE_LAYER_OVERLAY = 7 + }; + + enum EntityTextureLayerRectId { + ENTITY_TEXTURE_LAYER_RECT_ID_FULL = 0, + ENTITY_TEXTURE_LAYER_RECT_ID_HEAD = 1, + ENTITY_TEXTURE_LAYER_RECT_ID_FOOT = 2, + //etc + }; + + Ref get_texture(); + void set_texture(Ref texture); + +protected: + static void _bind_methods(); + +private: + Ref _texture; + int _layer; + Color _colors[MAX_COLORS]; +}; + +#endif