2019-09-17 00:04:37 +02:00
|
|
|
#ifndef ENTITY_CLASS_DATA_H
|
|
|
|
#define ENTITY_CLASS_DATA_H
|
|
|
|
|
2020-01-09 04:27:19 +01:00
|
|
|
#include "core/math/math_funcs.h"
|
2019-09-17 00:04:37 +02:00
|
|
|
#include "core/resource.h"
|
|
|
|
#include "core/ustring.h"
|
2020-01-09 04:27:19 +01:00
|
|
|
#include "core/vector.h"
|
2019-09-17 00:04:37 +02:00
|
|
|
#include "scene/resources/texture.h"
|
|
|
|
|
|
|
|
#include "../../entities/stats/stat_data.h"
|
|
|
|
#include "../../entity_enums.h"
|
|
|
|
|
|
|
|
#include "../../entities/auras/aura_data.h"
|
|
|
|
#include "../../pipelines/spell_damage_info.h"
|
|
|
|
#include "../../pipelines/spell_heal_info.h"
|
|
|
|
|
2019-10-13 13:12:27 +02:00
|
|
|
#include "../../item_enums.h"
|
2020-01-09 04:27:19 +01:00
|
|
|
#include "../../utility/category_cooldown.h"
|
|
|
|
#include "../../utility/cooldown.h"
|
2019-09-17 00:04:37 +02:00
|
|
|
|
2019-11-30 19:26:12 +01:00
|
|
|
#include "../resources/entity_resource_data.h"
|
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
class Aura;
|
|
|
|
class Spell;
|
|
|
|
class Entity;
|
2019-10-13 13:12:27 +02:00
|
|
|
class ItemInstance;
|
2019-09-17 00:04:37 +02:00
|
|
|
class CharacterSpec;
|
|
|
|
class Entity;
|
|
|
|
class SpellCastInfo;
|
2019-11-27 10:54:56 +01:00
|
|
|
class EntityAI;
|
2019-09-17 00:04:37 +02:00
|
|
|
|
|
|
|
class EntityClassData : public Resource {
|
|
|
|
GDCLASS(EntityClassData, Resource);
|
|
|
|
|
|
|
|
public:
|
|
|
|
int get_id();
|
|
|
|
void set_id(int value);
|
|
|
|
|
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<EntityClassData> get_inherits();
|
|
|
|
void set_inherits(Ref<EntityClassData> value);
|
|
|
|
|
|
|
|
Ref<Texture> get_icon();
|
|
|
|
void set_icon(Ref<Texture> value);
|
|
|
|
|
|
|
|
Ref<StatData> get_stat_data();
|
|
|
|
void set_stat_data(Ref<StatData> value);
|
|
|
|
|
|
|
|
int get_player_resource_type();
|
|
|
|
void set_player_resource_type(int value);
|
|
|
|
|
2019-10-06 18:51:16 +02:00
|
|
|
int get_spell_points_per_level();
|
|
|
|
void set_spell_points_per_level(int value);
|
2019-09-17 00:04:37 +02:00
|
|
|
|
2019-09-25 12:00:11 +02:00
|
|
|
EntityEnums::EntityClassPlaystyleType get_playstyle_type();
|
|
|
|
void set_playstyle_type(EntityEnums::EntityClassPlaystyleType playstyle_type);
|
|
|
|
|
2019-11-30 19:26:12 +01:00
|
|
|
//Entity Resources
|
|
|
|
int get_num_entity_resources();
|
|
|
|
void set_num_entity_resources(int value);
|
|
|
|
|
|
|
|
Ref<EntityResourceData> get_entity_resource(int index) const;
|
|
|
|
void set_entity_resource(int index, Ref<EntityResourceData> entity_resources);
|
|
|
|
|
|
|
|
Vector<Variant> get_entity_resources();
|
|
|
|
void set_entity_resources(const Vector<Variant> &entity_resourcess);
|
|
|
|
|
2020-01-09 04:27:19 +01:00
|
|
|
//Specs
|
2019-09-17 00:04:37 +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);
|
|
|
|
|
|
|
|
Vector<Variant> get_specs();
|
|
|
|
void set_specs(const Vector<Variant> &specs);
|
|
|
|
|
2020-01-09 04:27:19 +01:00
|
|
|
//Spells
|
2019-09-17 00:04:37 +02:00
|
|
|
int get_num_spells();
|
|
|
|
void set_num_spells(int value);
|
|
|
|
|
|
|
|
Ref<Spell> get_spell(int index);
|
|
|
|
void set_spell(int index, Ref<Spell> spell);
|
|
|
|
|
|
|
|
Vector<Variant> get_spells();
|
|
|
|
void set_spells(const Vector<Variant> &spells);
|
2019-10-10 00:46:12 +02:00
|
|
|
|
|
|
|
//Start Spells
|
|
|
|
int get_num_start_spells();
|
|
|
|
void set_num_start_spells(int value);
|
|
|
|
|
|
|
|
Ref<Spell> get_start_spell(int index);
|
|
|
|
void set_start_spell(int index, Ref<Spell> spell);
|
|
|
|
|
|
|
|
Vector<Variant> get_start_spells();
|
|
|
|
void set_start_spells(const Vector<Variant> &spells);
|
2020-01-09 04:27:19 +01:00
|
|
|
|
|
|
|
//Auras
|
2019-09-17 00:04:37 +02:00
|
|
|
int get_num_auras();
|
|
|
|
void set_num_auras(int value);
|
|
|
|
|
|
|
|
Ref<Aura> get_aura(int index);
|
|
|
|
void set_aura(int index, Ref<Aura> aura);
|
|
|
|
|
|
|
|
Vector<Variant> get_auras();
|
|
|
|
void set_auras(const Vector<Variant> &auras);
|
|
|
|
|
2019-11-27 10:54:56 +01:00
|
|
|
//AI
|
|
|
|
int get_num_ais();
|
|
|
|
void set_num_ais(int value);
|
2019-09-17 00:04:37 +02:00
|
|
|
|
2019-11-27 10:54:56 +01:00
|
|
|
Ref<EntityAI> get_ai(int index);
|
|
|
|
void set_ai(int index, Ref<EntityAI> aura);
|
2019-09-17 00:04:37 +02:00
|
|
|
|
2019-11-27 10:54:56 +01:00
|
|
|
Vector<Variant> get_ais();
|
|
|
|
void set_ais(const Vector<Variant> &ais);
|
|
|
|
|
|
|
|
Ref<EntityAI> get_ai_instance();
|
|
|
|
Ref<EntityAI> _get_ai_instance();
|
2020-01-09 04:27:19 +01:00
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
//Setup
|
|
|
|
void setup_resources(Entity *entity);
|
2019-11-30 19:26:12 +01:00
|
|
|
void _setup_resources(Node *entity);
|
2019-09-17 00:04:37 +02:00
|
|
|
|
|
|
|
//// Spell System ////
|
|
|
|
|
|
|
|
void start_casting(int spell_id, Entity *caster, float spellScale);
|
|
|
|
|
2020-01-09 04:27:19 +01:00
|
|
|
void son_before_cast(Ref<SpellCastInfo> info);
|
2019-09-17 00:04:37 +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);
|
2020-01-09 04:27:19 +01:00
|
|
|
|
|
|
|
void son_before_damage_hit(Ref<SpellDamageInfo> data);
|
2019-09-17 00:04:37 +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);
|
|
|
|
|
2020-01-09 04:27:19 +01:00
|
|
|
void son_before_heal_hit(Ref<SpellHealInfo> data);
|
2019-09-17 00:04:37 +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);
|
|
|
|
|
2020-01-09 04:27:19 +01:00
|
|
|
void son_before_aura_applied(Ref<AuraData> data);
|
2019-09-17 00:04:37 +02:00
|
|
|
void son_after_aura_applied(Ref<AuraData> data);
|
2020-01-09 04:27:19 +01:00
|
|
|
|
|
|
|
void son_death(Entity *entity);
|
|
|
|
void son_death_bind(Node *entity);
|
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
void son_cooldown_added(Ref<Cooldown> cooldown);
|
|
|
|
void son_cooldown_removed(Ref<Cooldown> cooldown);
|
2020-01-09 04:27:19 +01:00
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
void son_category_cooldown_added(Ref<CategoryCooldown> category_cooldown);
|
|
|
|
void son_category_cooldown_removed(Ref<CategoryCooldown> category_cooldown);
|
2020-01-09 04:27:19 +01:00
|
|
|
|
2019-09-17 00:04: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);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
2020-01-09 04:27:19 +01:00
|
|
|
//Clientside Event Handlers
|
2019-09-17 00:04:37 +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);
|
2020-01-09 04:27:19 +01:00
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
void con_death(Entity *entity);
|
2020-01-09 04:27:19 +01:00
|
|
|
void con_death_bind(Node *entity);
|
|
|
|
|
2019-09-17 00:04:37 +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);
|
2020-01-09 04:27:19 +01:00
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
void con_aura_added(Ref<AuraData> data);
|
|
|
|
void con_aura_removed(Ref<AuraData> data);
|
|
|
|
void con_aura_refresh(Ref<AuraData> data);
|
2020-01-09 04:27:19 +01:00
|
|
|
|
2019-09-17 00:04:37 +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);
|
2020-01-09 04:27:19 +01:00
|
|
|
|
2019-09-17 00:04: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);
|
|
|
|
|
|
|
|
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-17 00:04:37 +02:00
|
|
|
EntityClassData();
|
|
|
|
~EntityClassData();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
private:
|
|
|
|
int _id;
|
|
|
|
|
2019-10-25 10:28:55 +02:00
|
|
|
String _text_description;
|
2019-09-17 00:04:37 +02:00
|
|
|
|
|
|
|
Ref<EntityClassData> _inherits;
|
|
|
|
|
|
|
|
Ref<Texture> _icon;
|
|
|
|
|
|
|
|
int _player_resource_type;
|
|
|
|
|
2019-10-06 18:51:16 +02:00
|
|
|
int _spell_points_per_level;
|
2019-09-17 00:04:37 +02:00
|
|
|
|
2019-09-25 12:00:11 +02:00
|
|
|
EntityEnums::EntityClassPlaystyleType _playstyle_type;
|
|
|
|
|
2019-09-17 00:04:37 +02:00
|
|
|
Ref<StatData> _stat_data;
|
|
|
|
|
2019-12-01 01:16:28 +01:00
|
|
|
Vector<Ref<EntityResourceData> > _entity_resources;
|
2019-11-30 19:26:12 +01:00
|
|
|
Vector<Ref<CharacterSpec> > _specs;
|
2019-09-17 00:04:37 +02:00
|
|
|
Vector<Ref<Spell> > _spells;
|
2019-10-10 00:46:12 +02:00
|
|
|
Vector<Ref<Spell> > _start_spells;
|
2019-09-17 00:04:37 +02:00
|
|
|
Vector<Ref<Aura> > _auras;
|
2019-11-27 10:54:56 +01:00
|
|
|
Vector<Ref<EntityAI> > _ais;
|
2019-09-17 00:04:37 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|