2019-09-09 14:26:18 +02:00
|
|
|
#ifndef ENTITY_DATA_H
|
|
|
|
#define ENTITY_DATA_H
|
2019-04-20 14:02:55 +02:00
|
|
|
|
|
|
|
#include "core/resource.h"
|
2019-09-09 22:12:04 +02:00
|
|
|
#include "core/ustring.h"
|
2019-10-25 10:38:32 +02:00
|
|
|
#include "core/vector.h"
|
2019-04-20 14:02:55 +02:00
|
|
|
#include "scene/resources/texture.h"
|
|
|
|
|
2019-09-09 14:26:18 +02:00
|
|
|
#include "../../entities/stats/stat_data.h"
|
|
|
|
#include "../../entity_enums.h"
|
2019-04-20 14:02:55 +02:00
|
|
|
|
2019-09-09 14:26:18 +02:00
|
|
|
#include "../../entities/auras/aura_data.h"
|
|
|
|
#include "../../pipelines/spell_damage_info.h"
|
|
|
|
#include "../../pipelines/spell_heal_info.h"
|
2019-08-04 19:13:00 +02:00
|
|
|
|
2019-09-09 14:26:18 +02:00
|
|
|
#include "../../utility/category_cooldown.h"
|
2019-09-17 00:04:37 +02:00
|
|
|
#include "../../utility/cooldown.h"
|
2019-08-05 01:36:33 +02:00
|
|
|
|
2019-09-09 22:12:04 +02:00
|
|
|
#include "../../loot/loot_data_base.h"
|
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
#include "entity_class_data.h"
|
2019-09-17 01:14:19 +02:00
|
|
|
#include "item_container_data.h"
|
2019-09-17 00:04:37 +02:00
|
|
|
|
2019-10-13 20:05:03 +02:00
|
|
|
#include "../../data/equipment_data.h"
|
|
|
|
|
2019-10-25 10:38:32 +02:00
|
|
|
#include "../../skeleton/entity_species_data.h"
|
|
|
|
|
2019-11-27 10:54:56 +01:00
|
|
|
#include "../ai/entity_ai.h"
|
2019-10-31 01:35:29 +01:00
|
|
|
#include "../../formations/ai_formation.h"
|
|
|
|
|
2019-06-22 23:28:36 +02:00
|
|
|
class Aura;
|
2019-04-20 14:02:55 +02:00
|
|
|
class Spell;
|
|
|
|
class Entity;
|
|
|
|
class CharacterSpec;
|
2019-07-06 21:24:02 +02:00
|
|
|
class Entity;
|
2019-08-13 23:58:42 +02:00
|
|
|
class SpellCastInfo;
|
2019-09-09 01:28:29 +02:00
|
|
|
class AIAction;
|
2019-09-11 15:06:30 +02:00
|
|
|
class VendorItemData;
|
2019-10-07 17:17:21 +02:00
|
|
|
class CraftRecipe;
|
2019-04-20 14:02:55 +02:00
|
|
|
|
2019-09-09 14:26:18 +02:00
|
|
|
class EntityData : public Resource {
|
|
|
|
GDCLASS(EntityData, Resource);
|
2019-04-20 14:02:55 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
int get_id();
|
|
|
|
void set_id(int value);
|
2019-09-17 00:04:37 +02:00
|
|
|
|
2019-10-25 10:28:55 +02:00
|
|
|
String get_text_description();
|
|
|
|
void set_text_description(String value);
|
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
Ref<EntityData> get_inherits();
|
|
|
|
void set_inherits(Ref<EntityData> value);
|
|
|
|
|
2019-09-11 12:26:41 +02:00
|
|
|
EntityEnums::EntityType get_entity_type();
|
|
|
|
void set_entity_type(EntityEnums::EntityType value);
|
2019-09-16 21:57:55 +02:00
|
|
|
|
|
|
|
EntityEnums::EntityInteractionType get_entity_interaction_type();
|
|
|
|
void set_entity_interaction_type(EntityEnums::EntityInteractionType value);
|
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
int get_immunity_flags();
|
2019-09-11 12:26:41 +02:00
|
|
|
void set_immunity_flags(int value);
|
|
|
|
|
|
|
|
int get_entity_flags();
|
|
|
|
void set_entity_flags(int value);
|
2019-09-17 00:04:37 +02:00
|
|
|
|
|
|
|
EntityEnums::EntityController get_entity_controller();
|
2019-09-11 12:26:41 +02:00
|
|
|
void set_entity_controller(EntityEnums::EntityController value);
|
2019-04-20 14:02:55 +02:00
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
int get_money();
|
2019-09-11 13:06:04 +02:00
|
|
|
void set_money(int value);
|
2019-04-20 14:02:55 +02:00
|
|
|
|
2019-09-16 21:57:55 +02:00
|
|
|
int get_bag_size();
|
|
|
|
void set_bag_size(int value);
|
|
|
|
|
2019-10-25 10:38:32 +02:00
|
|
|
Ref<EntitySpeciesData> get_entity_species_data();
|
|
|
|
void set_entity_species_data(Ref<EntitySpeciesData> value);
|
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
Ref<EntityClassData> get_entity_class_data();
|
|
|
|
void set_entity_class_data(Ref<EntityClassData> data);
|
2019-09-12 22:55:07 +02:00
|
|
|
|
2019-10-13 20:05:03 +02:00
|
|
|
Ref<EquipmentData> get_equipment_data();
|
|
|
|
void set_equipment_data(Ref<EquipmentData> data);
|
|
|
|
|
2019-11-27 10:54:56 +01:00
|
|
|
Ref<EntityAI> get_ai() const;
|
|
|
|
void set_ai(const Ref<EntityAI> ai);
|
|
|
|
Ref<EntityAI> get_ai_instance();
|
|
|
|
Ref<EntityAI> _get_ai_instance();
|
2019-10-31 01:35:29 +01:00
|
|
|
|
|
|
|
Ref<AIFormation> get_formation() const;
|
|
|
|
void set_formation(const Ref<AIFormation> data);
|
|
|
|
|
2019-09-09 22:12:04 +02:00
|
|
|
Ref<LootDataBase> get_loot_db() const;
|
2019-09-17 01:14:19 +02:00
|
|
|
void set_loot_db(const Ref<LootDataBase> data);
|
2019-09-09 22:12:04 +02:00
|
|
|
|
2019-09-17 01:14:19 +02:00
|
|
|
Ref<VendorItemData> get_vendor_item_data() const;
|
|
|
|
void set_vendor_item_data(const Ref<VendorItemData> data);
|
2019-09-11 15:06:30 +02:00
|
|
|
|
2019-09-17 01:14:19 +02:00
|
|
|
Ref<ItemContainerData> get_item_container_data() const;
|
|
|
|
void set_item_container_data(const Ref<ItemContainerData> data);
|
2019-09-09 01:28:29 +02:00
|
|
|
|
2019-10-07 17:17:21 +02:00
|
|
|
//Craft Recipes
|
|
|
|
int get_num_craft_recipes();
|
|
|
|
|
|
|
|
Ref<CraftRecipe> get_craft_recipe(int index);
|
|
|
|
void set_craft_recipe(int index, Ref<CraftRecipe> recipe);
|
|
|
|
|
|
|
|
Vector<Variant> get_craft_recipes();
|
|
|
|
void set_craft_recipes(const Vector<Variant> &recipe);
|
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
String generate_name();
|
|
|
|
|
|
|
|
//Setup
|
|
|
|
void setup_resources(Entity *entity);
|
|
|
|
|
2019-09-11 12:54:51 +02:00
|
|
|
//// Interactions ////
|
2019-09-17 00:04:37 +02:00
|
|
|
bool cans_interact(Entity *entity);
|
|
|
|
bool cans_interact_bind(Node *entity);
|
|
|
|
|
|
|
|
void sinteract(Entity *entity);
|
|
|
|
void sinteract_bind(Node *entity);
|
2019-04-20 14:02:55 +02:00
|
|
|
|
|
|
|
//// Spell System ////
|
|
|
|
|
|
|
|
void start_casting(int spell_id, Entity *caster, float spellScale);
|
2019-07-06 21:24:02 +02:00
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
void son_before_cast(Ref<SpellCastInfo> info);
|
2019-08-04 19:13:00 +02:00
|
|
|
void son_before_cast_target(Ref<SpellCastInfo> info);
|
|
|
|
void son_cast_finished_target(Ref<SpellCastInfo> info);
|
|
|
|
void son_cast_finished(Ref<SpellCastInfo> info);
|
|
|
|
void son_cast_started(Ref<SpellCastInfo> info);
|
|
|
|
void son_cast_failed(Ref<SpellCastInfo> info);
|
2019-09-28 17:36:02 +02:00
|
|
|
void son_spell_cast_success(Ref<SpellCastInfo> info);
|
2019-09-17 00:04:37 +02:00
|
|
|
|
|
|
|
void son_before_damage_hit(Ref<SpellDamageInfo> data);
|
2019-08-04 19:13:00 +02:00
|
|
|
void son_hit(Ref<SpellDamageInfo> data);
|
|
|
|
void son_before_damage(Ref<SpellDamageInfo> data);
|
|
|
|
void son_damage_receive(Ref<SpellDamageInfo> data);
|
|
|
|
void son_dealt_damage(Ref<SpellDamageInfo> data);
|
|
|
|
void son_damage_dealt(Ref<SpellDamageInfo> data);
|
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
void son_before_heal_hit(Ref<SpellHealInfo> data);
|
2019-08-04 19:13:00 +02:00
|
|
|
void son_before_heal(Ref<SpellHealInfo> data);
|
|
|
|
void son_heal_receive(Ref<SpellHealInfo> data);
|
|
|
|
void son_dealt_heal(Ref<SpellHealInfo> data);
|
|
|
|
void son_heal_dealt(Ref<SpellHealInfo> data);
|
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
void son_before_aura_applied(Ref<AuraData> data);
|
2019-08-04 19:13:00 +02:00
|
|
|
void son_after_aura_applied(Ref<AuraData> data);
|
2019-09-17 00:04:37 +02:00
|
|
|
|
|
|
|
void son_death(Entity *entity);
|
|
|
|
void son_death_bind(Node *entity);
|
|
|
|
|
2019-08-05 01:36:33 +02:00
|
|
|
void son_cooldown_added(Ref<Cooldown> cooldown);
|
|
|
|
void son_cooldown_removed(Ref<Cooldown> cooldown);
|
2019-09-17 00:04:37 +02:00
|
|
|
|
2019-08-05 01:36:33 +02:00
|
|
|
void son_category_cooldown_added(Ref<CategoryCooldown> category_cooldown);
|
|
|
|
void son_category_cooldown_removed(Ref<CategoryCooldown> category_cooldown);
|
2019-09-17 00:04:37 +02:00
|
|
|
|
2019-08-05 23:59:37 +02:00
|
|
|
void son_gcd_started(Entity *entity, float gcd);
|
|
|
|
void son_gcd_finished(Entity *entity);
|
|
|
|
void son_gcd_started_bind(Node *entity, float gcd);
|
|
|
|
void son_gcd_finished_bind(Node *entity);
|
2019-09-12 13:26:52 +02:00
|
|
|
|
|
|
|
void son_xp_gained(Entity *entity, int value);
|
|
|
|
void son_xp_gained_bind(Node *entity, int value);
|
|
|
|
void son_level_up(Entity *entity, int value);
|
|
|
|
void son_level_up_bind(Node *entity, int value);
|
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
//Clientside Event Handlers
|
2019-08-05 01:36:33 +02:00
|
|
|
void con_cast_failed(Ref<SpellCastInfo> info);
|
|
|
|
void con_cast_started(Ref<SpellCastInfo> info);
|
|
|
|
void con_cast_state_changed(Ref<SpellCastInfo> info);
|
|
|
|
void con_cast_finished(Ref<SpellCastInfo> info);
|
|
|
|
void con_spell_cast_success(Ref<SpellCastInfo> info);
|
2019-09-17 00:04:37 +02:00
|
|
|
|
2019-08-05 01:36:33 +02:00
|
|
|
void con_death(Entity *entity);
|
2019-09-17 00:04:37 +02:00
|
|
|
void con_death_bind(Node *entity);
|
|
|
|
|
2019-08-05 01:36:33 +02:00
|
|
|
void con_cooldown_added(Ref<Cooldown> cooldown);
|
|
|
|
void con_cooldown_removed(Ref<Cooldown> cooldown);
|
|
|
|
void con_category_cooldown_added(Ref<CategoryCooldown> category_cooldown);
|
|
|
|
void con_category_cooldown_removed(Ref<CategoryCooldown> category_cooldown);
|
2019-09-17 00:04:37 +02:00
|
|
|
|
2019-08-04 19:13:00 +02:00
|
|
|
void con_aura_added(Ref<AuraData> data);
|
|
|
|
void con_aura_removed(Ref<AuraData> data);
|
|
|
|
void con_aura_refresh(Ref<AuraData> data);
|
2019-09-17 00:04:37 +02:00
|
|
|
|
2019-08-05 01:36:33 +02:00
|
|
|
void con_damage_dealt(Ref<SpellDamageInfo> info);
|
|
|
|
void con_dealt_damage(Ref<SpellDamageInfo> info);
|
|
|
|
void con_heal_dealt(Ref<SpellHealInfo> info);
|
|
|
|
void con_dealt_heal(Ref<SpellHealInfo> info);
|
2019-09-17 00:04:37 +02:00
|
|
|
|
2019-08-05 23:59:37 +02:00
|
|
|
void con_gcd_started(Entity *entity, float gcd);
|
|
|
|
void con_gcd_finished(Entity *entity);
|
|
|
|
void con_gcd_started_bind(Node *entity, float gcd);
|
|
|
|
void con_gcd_finished_bind(Node *entity);
|
2019-09-12 13:26:52 +02:00
|
|
|
|
|
|
|
void con_xp_gained(Entity *entity, int value);
|
|
|
|
void con_xp_gained_bind(Node *entity, int value);
|
|
|
|
void con_level_up(Entity *entity, int value);
|
|
|
|
void con_level_up_bind(Node *entity, int value);
|
|
|
|
|
2019-10-13 13:12:27 +02:00
|
|
|
//Equipment
|
|
|
|
|
2019-10-13 22:48:25 +02:00
|
|
|
bool should_deny_equip(Entity *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item);
|
|
|
|
bool should_deny_equip_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item);
|
|
|
|
|
2019-10-13 13:12:27 +02:00
|
|
|
void son_equip_success(Entity *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item, Ref<ItemInstance> old_item, int bag_slot);
|
|
|
|
void son_equip_success_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item, Ref<ItemInstance> old_item, int bag_slot);
|
|
|
|
void son_equip_fail(Entity *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item, Ref<ItemInstance> old_item, int bag_slot);
|
|
|
|
void son_equip_fail_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item, Ref<ItemInstance> old_item, int bag_slot);
|
|
|
|
|
|
|
|
void con_equip_success(Entity *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item, Ref<ItemInstance> old_item, int bag_slot);
|
|
|
|
void con_equip_success_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item, Ref<ItemInstance> old_item, int bag_slot);
|
|
|
|
void con_equip_fail(Entity *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item, Ref<ItemInstance> old_item, int bag_slot);
|
|
|
|
void con_equip_fail_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item, Ref<ItemInstance> old_item, int bag_slot);
|
|
|
|
|
2019-09-09 14:26:18 +02:00
|
|
|
EntityData();
|
|
|
|
~EntityData();
|
2019-04-20 14:02:55 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
2019-06-22 23:28:36 +02:00
|
|
|
private:
|
2019-04-20 14:02:55 +02:00
|
|
|
int _id;
|
2019-09-16 21:57:55 +02:00
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
Ref<EntityData> _inherits;
|
2019-09-09 20:36:15 +02:00
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
EntityEnums::EntityType _entity_type;
|
2019-09-09 20:36:15 +02:00
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
EntityEnums::EntityInteractionType _interaction_type;
|
2019-09-09 20:36:15 +02:00
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
int _immunity_flags;
|
|
|
|
int _entity_flags;
|
|
|
|
EntityEnums::EntityController _entity_controller;
|
2019-04-20 14:02:55 +02:00
|
|
|
|
2019-10-25 10:28:55 +02:00
|
|
|
String _text_description;
|
2019-04-20 14:02:55 +02:00
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
int _money;
|
|
|
|
int _bag_size;
|
2019-09-12 22:55:07 +02:00
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
Ref<EntityClassData> _entity_class_data;
|
2019-10-25 10:38:32 +02:00
|
|
|
Ref<EntitySpeciesData> _entity_species_data;
|
2019-10-13 20:05:03 +02:00
|
|
|
Ref<EquipmentData> _equipment_data;
|
2019-04-20 14:02:55 +02:00
|
|
|
|
2019-11-27 10:54:56 +01:00
|
|
|
Ref<EntityAI> _ai;
|
2019-10-31 01:35:29 +01:00
|
|
|
Ref<AIFormation> _formation;
|
|
|
|
|
2019-09-09 22:12:04 +02:00
|
|
|
Ref<LootDataBase> _lootdb;
|
2019-09-17 01:14:19 +02:00
|
|
|
Ref<VendorItemData> _vendor_item_data;
|
|
|
|
Ref<ItemContainerData> _item_container_data;
|
2019-10-07 17:17:21 +02:00
|
|
|
Vector<Ref<CraftRecipe> > _craft_recipes;
|
2019-04-20 14:02:55 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|