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"
|
|
|
|
#include "core/vector.h"
|
2019-09-09 22:12:04 +02:00
|
|
|
#include "core/ustring.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/cooldown.h"
|
|
|
|
#include "../../utility/category_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-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-04-20 14:02:55 +02:00
|
|
|
|
|
|
|
enum CharacterWeaponDataTypes {
|
|
|
|
CHARACTER_WEAPON_DATA_TYPES_NONE,
|
|
|
|
CHARACTER_WEAPON_DATA_TYPES_SWORD,
|
|
|
|
CHARACTER_WEAPON_DATA_TYPES_BOW
|
|
|
|
};
|
|
|
|
|
|
|
|
VARIANT_ENUM_CAST(CharacterWeaponDataTypes)
|
|
|
|
|
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-11 12:26:41 +02:00
|
|
|
|
|
|
|
EntityEnums::EntityType get_entity_type();
|
|
|
|
void set_entity_type(EntityEnums::EntityType value);
|
|
|
|
|
|
|
|
int get_immunity_flags();
|
|
|
|
void set_immunity_flags(int value);
|
|
|
|
|
|
|
|
int get_entity_flags();
|
|
|
|
void set_entity_flags(int value);
|
|
|
|
|
|
|
|
EntityEnums::EntityController get_entity_controller();
|
|
|
|
void set_entity_controller(EntityEnums::EntityController value);
|
2019-04-20 14:02:55 +02:00
|
|
|
|
2019-09-09 22:12:04 +02:00
|
|
|
String get_entity_name();
|
|
|
|
void set_entity_name(String value);
|
2019-04-20 14:02:55 +02:00
|
|
|
|
2019-09-09 20:36:15 +02:00
|
|
|
Ref<EntityData> get_inherits();
|
|
|
|
void set_inherits(Ref<EntityData> value);
|
|
|
|
|
2019-04-20 14:02:55 +02:00
|
|
|
Ref<Texture> get_icon();
|
|
|
|
void set_icon(Ref<Texture> value);
|
|
|
|
|
|
|
|
Ref<StatData> get_stat_data();
|
|
|
|
void set_stat_data(Ref<StatData> value);
|
|
|
|
|
2019-08-13 23:58:42 +02:00
|
|
|
int get_player_resource_type();
|
|
|
|
void set_player_resource_type(int value);
|
2019-09-09 22:12:04 +02:00
|
|
|
|
|
|
|
Ref<LootDataBase> get_loot_db() const;
|
|
|
|
void set_loot_db(const Ref<LootDataBase> lootdb);
|
|
|
|
|
2019-09-08 23:10:22 +02:00
|
|
|
//Specs
|
2019-04-20 14:02:55 +02:00
|
|
|
int get_num_specs();
|
|
|
|
void set_num_specs(int value);
|
|
|
|
|
|
|
|
Ref<CharacterSpec> get_spec(int index) const;
|
|
|
|
void set_spec(int index, Ref<CharacterSpec> spec);
|
|
|
|
|
2019-09-08 21:26:05 +02:00
|
|
|
Vector<Variant> get_specs();
|
|
|
|
void set_specs(const Vector<Variant> &specs);
|
|
|
|
|
2019-09-08 23:10:22 +02:00
|
|
|
//Spells
|
|
|
|
int get_num_spells();
|
|
|
|
void set_num_spells(int value);
|
|
|
|
|
|
|
|
Ref<Spell> get_spell(int index);
|
|
|
|
void set_spell(int index, Ref<Spell> spell);
|
2019-09-08 21:26:05 +02:00
|
|
|
|
2019-09-08 23:10:22 +02:00
|
|
|
Vector<Variant> get_spells();
|
|
|
|
void set_spells(const Vector<Variant> &spells);
|
|
|
|
|
|
|
|
//Auras
|
2019-09-08 21:26:05 +02:00
|
|
|
int get_num_auras();
|
|
|
|
void set_num_auras(int value);
|
|
|
|
|
2019-06-22 23:28:36 +02:00
|
|
|
Ref<Aura> get_aura(int index);
|
|
|
|
void set_aura(int index, Ref<Aura> aura);
|
|
|
|
|
2019-09-08 21:26:05 +02:00
|
|
|
Vector<Variant> get_auras();
|
|
|
|
void set_auras(const Vector<Variant> &auras);
|
|
|
|
|
2019-09-09 01:28:29 +02:00
|
|
|
//AI Actions
|
|
|
|
int get_num_ai_actions();
|
|
|
|
void set_num_ai_actions(int value);
|
|
|
|
|
|
|
|
Ref<AIAction> get_ai_action(int index);
|
|
|
|
void set_ai_action(int index, Ref<AIAction> aura);
|
|
|
|
|
|
|
|
Vector<Variant> get_ai_actions();
|
2019-09-09 01:48:14 +02:00
|
|
|
void set_ai_actions(const Vector<Variant> &ai_actions);
|
2019-09-09 01:28:29 +02:00
|
|
|
|
|
|
|
//Setup
|
2019-08-13 23:58:42 +02:00
|
|
|
void setup_resources(Entity *entity);
|
|
|
|
//void _setup_resources(Entity *entity);
|
2019-04-20 14:02:55 +02:00
|
|
|
|
2019-08-13 23:58:42 +02:00
|
|
|
/*
|
2019-04-20 14:02:55 +02:00
|
|
|
Vector<int> get_mob_party_ids();
|
|
|
|
void set_mob_party_ids(Vector<int> ids);
|
|
|
|
|
|
|
|
Vector<int> get_mob_dislike_ids();
|
|
|
|
void set_mob_dislike_ids(Vector<int> ids);
|
|
|
|
*/
|
|
|
|
//MobSpellData *getMobSpellData();
|
|
|
|
//void setMobSpellData(MobSpellData *value);
|
|
|
|
|
|
|
|
//int get_inspector_max_spells();
|
|
|
|
//void set_inspector_max_spells(int value);
|
|
|
|
|
|
|
|
//// Spell System ////
|
|
|
|
|
|
|
|
void start_casting(int spell_id, Entity *caster, float spellScale);
|
2019-07-06 21:24:02 +02:00
|
|
|
|
2019-08-04 19:13:00 +02:00
|
|
|
void son_before_cast(Ref<SpellCastInfo> info);
|
|
|
|
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-11 11:01:30 +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-11 11:01:30 +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);
|
|
|
|
|
|
|
|
void son_before_aura_applied(Ref<AuraData> data);
|
|
|
|
void son_after_aura_applied(Ref<AuraData> data);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
void son_category_cooldown_added(Ref<CategoryCooldown> category_cooldown);
|
|
|
|
void son_category_cooldown_removed(Ref<CategoryCooldown> category_cooldown);
|
|
|
|
|
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-08-04 19:13:00 +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);
|
|
|
|
|
|
|
|
void con_death(Entity *entity);
|
|
|
|
void con_death_bind(Node *entity);
|
|
|
|
|
|
|
|
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-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-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-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-08-04 19:13:00 +02:00
|
|
|
|
|
|
|
// AI //
|
2019-07-06 21:24:02 +02:00
|
|
|
void sai_follow(Entity *entity);
|
|
|
|
void sai_rest(Entity *entity);
|
|
|
|
void sai_regenerate(Entity *entity);
|
|
|
|
void sai_attack(Entity *entity);
|
|
|
|
|
|
|
|
void sai_follow_bind(Node *entity);
|
|
|
|
void sai_rest_bind(Node *entity);
|
|
|
|
void sai_regenerate_bind(Node *entity);
|
|
|
|
void sai_attack_bind(Node *entity);
|
2019-04-20 14:02:55 +02:00
|
|
|
|
2019-09-09 22:12:04 +02:00
|
|
|
String generate_name();
|
|
|
|
|
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-11 12:26:41 +02:00
|
|
|
|
|
|
|
EntityEnums::EntityType _entity_type;
|
|
|
|
int _immunity_flags;
|
|
|
|
int _entity_flags;
|
|
|
|
EntityEnums::EntityController _entity_controller;
|
2019-09-09 20:36:15 +02:00
|
|
|
|
2019-09-09 22:12:04 +02:00
|
|
|
String _entity_name;
|
2019-09-09 20:36:15 +02:00
|
|
|
|
|
|
|
Ref<EntityData> _inherits;
|
|
|
|
|
2019-04-20 14:02:55 +02:00
|
|
|
Ref<Texture> _icon;
|
|
|
|
|
2019-08-13 23:58:42 +02:00
|
|
|
int _player_resource_type;
|
2019-04-20 14:02:55 +02:00
|
|
|
|
|
|
|
Ref<StatData> _stat_data;
|
|
|
|
|
2019-09-08 21:26:05 +02:00
|
|
|
Vector<Ref<Spell> > _spells;
|
|
|
|
Vector<Ref<CharacterSpec> > _specs;
|
|
|
|
Vector<Ref<Aura> > _auras;
|
2019-09-09 01:28:29 +02:00
|
|
|
Vector<Ref<AIAction> > _ai_actions;
|
2019-06-22 23:28:36 +02:00
|
|
|
|
2019-09-09 22:12:04 +02:00
|
|
|
Ref<LootDataBase> _lootdb;
|
|
|
|
|
2019-04-20 14:02:55 +02:00
|
|
|
//Vector<int> _mob_party_ids;
|
|
|
|
//Vector<int> _mob_dislike_ids;
|
|
|
|
|
|
|
|
//MobSpellData *_mob_spell_data;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|