mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-02-20 17:14:44 +01:00
Added SpeciesInstance to EntityData.
This commit is contained in:
parent
20811bb740
commit
52cd322c88
@ -124,6 +124,7 @@ void SpeciesInstance::_from_dict(const Dictionary &dict) {
|
||||
}
|
||||
|
||||
SpeciesInstance::SpeciesInstance() {
|
||||
_id = 0;
|
||||
_species_id = 0;
|
||||
_skin_color_index = 0;
|
||||
_hair_style_index = 0;
|
||||
|
@ -28,6 +28,9 @@ SOFTWARE.
|
||||
#include "../entity.h"
|
||||
#include "character_spec.h"
|
||||
|
||||
#include "../../data/species/entity_species_data.h"
|
||||
#include "../../data/species/species_instance.h"
|
||||
|
||||
#include "../../singletons/ess.h"
|
||||
|
||||
#include "../../defines.h"
|
||||
@ -110,6 +113,13 @@ void EntityData::set_equipment_data(const Ref<EquipmentData> &data) {
|
||||
_equipment_data = data;
|
||||
}
|
||||
|
||||
Ref<SpeciesInstance> EntityData::get_species_instance() const {
|
||||
return _species_instance;
|
||||
}
|
||||
void EntityData::set_species_instance(const Ref<SpeciesInstance> &value) {
|
||||
_species_instance = value;
|
||||
}
|
||||
|
||||
Ref<EntityAI> EntityData::get_ai() const {
|
||||
return _ai;
|
||||
}
|
||||
@ -241,6 +251,7 @@ EntityData::~EntityData() {
|
||||
_entity_class_data.unref();
|
||||
_entity_species_data.unref();
|
||||
_equipment_data.unref();
|
||||
_species_instance.unref();
|
||||
|
||||
_ai.unref();
|
||||
|
||||
@ -299,6 +310,10 @@ void EntityData::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_equipment_data", "value"), &EntityData::set_equipment_data);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "equipment_data", PROPERTY_HINT_RESOURCE_TYPE, "EquipmentData"), "set_equipment_data", "get_equipment_data");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_species_instance"), &EntityData::get_species_instance);
|
||||
ClassDB::bind_method(D_METHOD("set_species_instance", "value"), &EntityData::set_species_instance);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "species_instance", PROPERTY_HINT_RESOURCE_TYPE, "SpeciesInstance"), "set_species_instance", "get_species_instance");
|
||||
|
||||
//AI
|
||||
BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::OBJECT, "ret", PROPERTY_HINT_RESOURCE_TYPE, "EntityAI"), "_get_ai_instance"));
|
||||
|
||||
|
@ -40,8 +40,6 @@ SOFTWARE.
|
||||
|
||||
#include "../../data/items/equipment_data.h"
|
||||
|
||||
#include "../../data/species/entity_species_data.h"
|
||||
|
||||
#include "../ai/entity_ai.h"
|
||||
|
||||
class Aura;
|
||||
@ -52,6 +50,8 @@ class Entity;
|
||||
class SpellCastInfo;
|
||||
class AIAction;
|
||||
class CraftRecipe;
|
||||
class EntitySpeciesData;
|
||||
class SpeciesInstance;
|
||||
|
||||
class EntityData : public Resource {
|
||||
GDCLASS(EntityData, Resource);
|
||||
@ -90,6 +90,9 @@ public:
|
||||
Ref<EquipmentData> get_equipment_data() const;
|
||||
void set_equipment_data(const Ref<EquipmentData> &data);
|
||||
|
||||
Ref<SpeciesInstance> get_species_instance() const;
|
||||
void set_species_instance(const Ref<SpeciesInstance> &value);
|
||||
|
||||
Ref<EntityAI> get_ai() const;
|
||||
void set_ai(const Ref<EntityAI> &ai);
|
||||
Ref<EntityAI> get_ai_instance();
|
||||
@ -135,6 +138,7 @@ private:
|
||||
Ref<EntityClassData> _entity_class_data;
|
||||
Ref<EntitySpeciesData> _entity_species_data;
|
||||
Ref<EquipmentData> _equipment_data;
|
||||
Ref<SpeciesInstance> _species_instance;
|
||||
|
||||
Ref<EntityAI> _ai;
|
||||
|
||||
|
@ -27,6 +27,7 @@ SOFTWARE.
|
||||
#include "../singletons/profile_manager.h"
|
||||
|
||||
#include "../data/auras/aura.h"
|
||||
#include "../data/species/entity_species_data.h"
|
||||
#include "../data/spells/spell.h"
|
||||
#include "../entities/auras/aura_data.h"
|
||||
#include "../infos/spell_cast_info.h"
|
||||
@ -35,6 +36,7 @@ SOFTWARE.
|
||||
#include "../pipelines/spell_heal_info.h"
|
||||
#include "../profiles/class_profile.h"
|
||||
#include "./data/character_spec.h"
|
||||
#include "./data/entity_data.h"
|
||||
#include "./data/vendor_item_data.h"
|
||||
#include "./data/vendor_item_data_entry.h"
|
||||
#include "./resources/entity_resource_health.h"
|
||||
|
@ -30,7 +30,6 @@ SOFTWARE.
|
||||
#include "../data/items/craft_recipe.h"
|
||||
#include "../data/items/item_instance.h"
|
||||
#include "../data/spells/spell.h"
|
||||
#include "./data/entity_data.h"
|
||||
#include "core/hash_map.h"
|
||||
#include "core/io/json.h"
|
||||
#include "core/math/transform.h"
|
||||
@ -73,6 +72,7 @@ class EntitySkill;
|
||||
class ClassProfile;
|
||||
class Spatial;
|
||||
class Node2D;
|
||||
class EntityData;
|
||||
|
||||
enum SpellCastDataSignals {
|
||||
CastFailed,
|
||||
|
Loading…
Reference in New Issue
Block a user