/* Copyright (c) 2019-2020 Péter Magyar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef ENTITY_CLASS_DATA_H #define ENTITY_CLASS_DATA_H #include "core/math/math_funcs.h" #include "core/resource.h" #include "core/ustring.h" #include "core/vector.h" #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" #include "../../item_enums.h" #include "../../utility/category_cooldown.h" #include "../../utility/cooldown.h" #include "../resources/entity_resource_data.h" class Aura; class Spell; class Entity; class ItemInstance; class CharacterSpec; class Entity; class SpellCastInfo; class EntityAI; class EntityClassData : public Resource { GDCLASS(EntityClassData, Resource); public: int get_id(); void set_id(int value); String get_text_description(); void set_text_description(String value); Ref get_inherits(); void set_inherits(Ref value); Ref get_icon(); void set_icon(Ref value); Ref get_stat_data(); void set_stat_data(Ref value); int get_player_resource_type(); void set_player_resource_type(int value); int get_spell_points_per_level(); void set_spell_points_per_level(int value); EntityEnums::EntityClassPlaystyleType get_playstyle_type(); void set_playstyle_type(EntityEnums::EntityClassPlaystyleType playstyle_type); //Entity Resources int get_num_entity_resources(); void set_num_entity_resources(int value); Ref get_entity_resource(int index) const; void set_entity_resource(int index, Ref entity_resources); Vector get_entity_resources(); void set_entity_resources(const Vector &entity_resourcess); //Specs int get_num_specs(); void set_num_specs(int value); Ref get_spec(int index) const; void set_spec(int index, Ref spec); Vector get_specs(); void set_specs(const Vector &specs); //Spells int get_num_spells(); void set_num_spells(int value); Ref get_spell(int index); void set_spell(int index, Ref spell); Vector get_spells(); void set_spells(const Vector &spells); //Start Spells int get_num_start_spells(); void set_num_start_spells(int value); Ref get_start_spell(int index); void set_start_spell(int index, Ref spell); Vector get_start_spells(); void set_start_spells(const Vector &spells); //Auras int get_num_auras(); void set_num_auras(int value); Ref get_aura(int index); void set_aura(int index, Ref aura); Vector get_auras(); void set_auras(const Vector &auras); //AI int get_num_ais(); void set_num_ais(int value); Ref get_ai(int index); void set_ai(int index, Ref aura); Vector get_ais(); void set_ais(const Vector &ais); Ref get_ai_instance(); Ref _get_ai_instance(); //Setup void setup_resources(Entity *entity); void _setup_resources(Node *entity); //// Spell System //// void start_casting(int spell_id, Entity *caster, float spellScale); void son_before_cast(Ref info); void son_before_cast_target(Ref info); void son_cast_finished_target(Ref info); void son_cast_finished(Ref info); void son_cast_started(Ref info); void son_cast_failed(Ref info); void son_spell_cast_success(Ref info); void son_before_damage_hit(Ref data); void son_hit(Ref data); void son_before_damage(Ref data); void son_damage_receive(Ref data); void son_dealt_damage(Ref data); void son_damage_dealt(Ref data); void son_before_heal_hit(Ref data); void son_before_heal(Ref data); void son_heal_receive(Ref data); void son_dealt_heal(Ref data); void son_heal_dealt(Ref data); void son_before_aura_applied(Ref data); void son_after_aura_applied(Ref data); void son_death(Entity *entity); void son_death_bind(Node *entity); void son_cooldown_added(Ref cooldown); void son_cooldown_removed(Ref cooldown); void son_category_cooldown_added(Ref category_cooldown); void son_category_cooldown_removed(Ref category_cooldown); 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_class_level_up(Entity *entity, int value); void son_class_level_up_bind(Node *entity, int value); void son_character_level_up(Entity *entity, int value); void son_character_level_up_bind(Node *entity, int value); void son_entity_resource_added(Ref resource); void son_entity_resource_removed(Ref resource); //Clientside Event Handlers void con_cast_failed(Ref info); void con_cast_started(Ref info); void con_cast_state_changed(Ref info); void con_cast_finished(Ref info); void con_spell_cast_success(Ref info); void con_death(Entity *entity); void con_death_bind(Node *entity); void con_cooldown_added(Ref cooldown); void con_cooldown_removed(Ref cooldown); void con_category_cooldown_added(Ref category_cooldown); void con_category_cooldown_removed(Ref category_cooldown); void con_aura_added(Ref data); void con_aura_removed(Ref data); void con_aura_refresh(Ref data); void con_damage_dealt(Ref info); void con_dealt_damage(Ref info); void con_heal_dealt(Ref info); void con_dealt_heal(Ref info); 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_class_level_up(Entity *entity, int value); void con_class_level_up_bind(Node *entity, int value); void con_character_level_up(Entity *entity, int value); void con_character_level_up_bind(Node *entity, int value); void con_entity_resource_added(Ref resource); void con_entity_resource_removed(Ref resource); //Equipment bool should_deny_equip(Entity *entity, ItemEnums::EquipSlots equip_slot, Ref item); bool should_deny_equip_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref item); void son_equip_success(Entity *entity, ItemEnums::EquipSlots equip_slot, Ref item, Ref old_item, int bag_slot); void son_equip_success_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref item, Ref old_item, int bag_slot); void son_equip_fail(Entity *entity, ItemEnums::EquipSlots equip_slot, Ref item, Ref old_item, int bag_slot); void son_equip_fail_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref item, Ref old_item, int bag_slot); void con_equip_success(Entity *entity, ItemEnums::EquipSlots equip_slot, Ref item, Ref old_item, int bag_slot); void con_equip_success_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref item, Ref old_item, int bag_slot); void con_equip_fail(Entity *entity, ItemEnums::EquipSlots equip_slot, Ref item, Ref old_item, int bag_slot); void con_equip_fail_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref item, Ref old_item, int bag_slot); EntityClassData(); ~EntityClassData(); protected: static void _bind_methods(); private: int _id; String _text_description; Ref _inherits; Ref _icon; int _player_resource_type; int _spell_points_per_level; EntityEnums::EntityClassPlaystyleType _playstyle_type; Ref _stat_data; Vector > _entity_resources; Vector > _specs; Vector > _spells; Vector > _start_spells; Vector > _auras; Vector > _ais; }; #endif