diff --git a/SCsub b/SCsub index fd6c345..ae92896 100644 --- a/SCsub +++ b/SCsub @@ -23,7 +23,6 @@ sources = [ "spell_enums.cpp", "item_enums.cpp", - "data/auras/aura.cpp", "data/auras/aura_group.cpp", "data/items/item_instance.cpp", diff --git a/config.py b/config.py index 5cd0b4b..7d83031 100644 --- a/config.py +++ b/config.py @@ -16,7 +16,6 @@ def get_doc_classes(): "ESS", "AuraGroup", - "Aura", "CraftRecipeHelper", "CraftRecipe", "EquipmentData", diff --git a/data/auras/aura.cpp b/data/auras/aura.cpp deleted file mode 100644 index c86112a..0000000 --- a/data/auras/aura.cpp +++ /dev/null @@ -1,1770 +0,0 @@ -/* -Copyright (c) 2019-2021 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. -*/ - -#include "aura.h" - -#include "../../entities/resources/entity_resource_cost_data.h" -#include "../../singletons/ess.h" - -#include "../../defines.h" - -int Aura::get_id() const { - return _id; -} -void Aura::set_id(const int value) { - _id = value; -} - -Ref Aura::get_icon() { - return _icon; -} -void Aura::set_icon(const Ref &value) { - _icon = value; -} - -int Aura::get_rank() const { - return _rank; -} -void Aura::set_rank(const int value) { - _rank = value; -} - -float Aura::aura_get_time() const { - return _aura_time; -} -void Aura::aura_set_time(const float value) { - _aura_time = value; -} - -float Aura::aura_get_tick() const { - return _aura_tick; -} -void Aura::aura_set_tick(const float value) { - _aura_tick = value; -} - -Ref Aura::aura_get_aura_group() { - return _aura_group; -} -void Aura::aura_set_aura_group(const Ref &value) { - _aura_group = value; -} - -bool Aura::aura_get_is_debuff() const { - return _aura_is_debuff; -} -void Aura::aura_set_is_debuff(const bool value) { - _aura_is_debuff = value; -} - -SpellEnums::AuraType Aura::aura_get_aura_type() const { - return _aura_type; -} -void Aura::aura_set_aura_type(SpellEnums::AuraType value) { - _aura_type = value; -} - -bool Aura::aura_get_scale_with_level() const { - return _aura_scale_with_level; -} -void Aura::aura_set_scale_with_level(const bool value) { - _aura_scale_with_level = value; -} - -String Aura::aura_get_text_translation_key() const { - return _aura_text_translation_key; -} -void Aura::aura_set_text_translation_key(const String &value) { - _aura_text_translation_key = value; -} - -String Aura::aura_get_text_description() const { - return _aura_text_description; -} -void Aura::aura_set_text_description(const String description) { - _aura_text_description = description; -} - -bool Aura::aura_get_hide() const { - return _aura_hide; -} -void Aura::aura_set_hide(const bool value) { - _aura_hide = value; -} - -Ref Aura::aura_get_visual_spell_effects() { - return _aura_visual_spell_effects; -} -void Aura::aura_set_visual_spell_effects(const Ref &value) { - _aura_visual_spell_effects = value; -} - -int Aura::aura_get_ability_scale_data_id() const { - return _aura_ability_scale_data_id; -} -void Aura::aura_set_ability_scale_data_id(const int value) { - _aura_ability_scale_data_id = value; -} - -float Aura::aura_damage_get_scale_for_level(const int level) const { - //return this->getDamageLevelScaling()->Evaluate((float)(level)); - return 1; -} -float Aura::aura_heal_get_scale_for_level(const int level) const { - //return this->getHealLevelScaling()->Evaluate((float)(level)); - return 1; -} - -float Aura::aura_absorb_get_scale_for_level(const int level) const { - //return this->getAbsorbLevelScaling()->Evaluate((float)(level)); - return 1; -} - -bool Aura::aura_diminishing_return_enabled_get() const { - return _aura_diminishing_return_enabled; -} -void Aura::aura_diminishing_return_enabled_set(const bool value) { - _aura_diminishing_return_enabled = value; -} - -int Aura::aura_diminishing_return_category_get() const { - return _aura_diminishing_return_category; -} -void Aura::aura_diminishing_return_category_set(const int value) { - _aura_diminishing_return_category = value; -} - -Ref Aura::aura_get_teaches_spell() { - return _aura_teaches_spell; -} -void Aura::aura_set_teaches_spell(const Ref &spell) { - _aura_teaches_spell = spell; -} - -/* -void Aura::SetScalingData(AbilityScalingData *scalingData) { -scalingData->getDamageCurve(); -scalingData->getAbsorbCurve(); -scalingData->getHealingCurve(); -}*/ -/* -void Aura::OnAuraAbilityScalingDataLoaded(AbilityScalingDataLoaderHelper *h) { -this->SetScalingData(h->getData()); -} -*/ - -//Damage -bool Aura::aura_damage_get_enabled() const { - return _aura_damage_enabled; -} -void Aura::aura_damage_set_enabled(const bool value) { - _aura_damage_enabled = value; -} - -int Aura::aura_damage_get_type() const { - return _aura_damage_type; -} - -void Aura::aura_damage_set_type(const int value) { - _aura_damage_type = value; -} - -int Aura::aura_damage_get_min() const { - return _aura_damage_min; -} -void Aura::aura_damage_set_min(const int value) { - _aura_damage_min = value; -} - -int Aura::aura_damage_get_max() const { - return _aura_damage_max; -} -void Aura::aura_damage_set_max(const int value) { - _aura_damage_max = value; -} - -bool Aura::aura_damage_get_can_crit() const { - return _aura_damage_can_crit; -} -void Aura::aura_damage_set_can_crit(const bool value) { - _aura_damage_can_crit = value; -} - -void Aura::aura_damage_set(const int min, const int max, const bool can_crit) { - aura_damage_set_enabled(true); - aura_damage_set_min(min); - aura_damage_set_max(max); - aura_damage_set_can_crit(can_crit); -} - -//Absorb -bool Aura::aura_absorb_get_enabled() const { - return _aura_absorb_enabled; -} -void Aura::aura_absorb_set_enabled(const bool value) { - _aura_absorb_enabled = value; -} - -int Aura::aura_absorb_damage_get_type() const { - return _aura_absorb_damage_type; -} - -void Aura::aura_absorb_damage_set_type(const int value) { - _aura_absorb_damage_type = value; -} - -int Aura::aura_absorb_get_min() const { - return _aura_absorb_min; -} -void Aura::aura_absorb_set_min(const int value) { - _aura_absorb_min = value; -} - -int Aura::aura_absorb_get_max() const { - return _aura_absorb_max; -} -void Aura::aura_absorb_set_max(const int value) { - _aura_absorb_max = value; -} - -//Heal -bool Aura::aura_heal_get_enabled() const { - return _aura_heal_enabled; -} -void Aura::aura_heal_set_enabled(const bool value) { - _aura_heal_enabled = value; -} - -int Aura::aura_heal_get_min() const { - return _aura_heal_min; -} -void Aura::aura_heal_set_min(const int value) { - _aura_heal_min = value; -} - -int Aura::aura_heal_get_max() const { - return _aura_heal_max; -} -void Aura::aura_heal_set_max(const int value) { - _aura_heal_max = value; -} - -bool Aura::aura_heal_get_can_crit() const { - return _aura_heal_can_crit; -} -void Aura::aura_heal_set_can_crit(const bool value) { - _aura_heal_can_crit = value; -} - -void Aura::aura_heal_set(const int min, const int max, const bool can_crit) { - aura_heal_set_enabled(true); - aura_heal_set_min(min); - aura_heal_set_max(max); - aura_heal_set_can_crit(can_crit); -} - -//Dispell -bool Aura::aura_dispell_get_enabled() const { - return _aura_dispell_enabled; -} -void Aura::aura_dispell_set_enabled(const bool value) { - _aura_dispell_enabled = value; -} - -int Aura::aura_dispell_get_count_min() const { - return _aura_dispell_count_min; -} -void Aura::aura_dispell_set_count_min(const int value) { - _aura_dispell_count_min = value; -} - -int Aura::aura_dispell_get_count_max() const { - return _aura_dispell_count_max; -} -void Aura::aura_dispell_set_count_max(const int value) { - _aura_dispell_count_max = value; -} - -int Aura::aura_dispell_get_aura_types() const { - return _aura_dispell_aura_types; -} -void Aura::aura_dispell_set_aura_types(const int value) { - _aura_dispell_aura_types = value; -} - -Ref Aura::aura_get_resource_cost() { - return _aura_resource_cost; -} -void Aura::aura_set_resource_cost(const Ref &value) { - _aura_resource_cost = value; -} - -Ref Aura::aura_get_resource_give() { - return _aura_resource_give; -} -void Aura::aura_set_resource_give(const Ref &value) { - _aura_resource_give = value; -} - -Aura::Aura() { - _id = 0; - _rank = 0; - - _aura_ability_scale_data_id = 1; - - _aura_time = 0; - _aura_tick = 0; - _aura_type = SpellEnums::AURA_TYPE_NONE; - _aura_is_debuff = false; - _aura_hide = false; - - _aura_scale_with_level = ESS::get_singleton()->get_scale_spells_by_default(); - - _aura_damage_enabled = false; - _aura_damage_type = 0; - _aura_damage_min = 0; - _aura_damage_max = 0; - _aura_damage_can_crit = false; - - _aura_absorb_enabled = false; - _aura_absorb_damage_type = 0; - _aura_absorb_min = 0; - _aura_absorb_max = 0; - - _aura_heal_enabled = false; - _aura_heal_min = 0; - _aura_heal_max = 0; - - _aura_heal_can_crit = false; - - _aura_dispell_enabled = false; - _aura_dispell_count_min = 0; - _aura_dispell_count_max = 0; - _aura_dispell_aura_types = 0; - - _aura_add_states = 0; - _aura_remove_effects_with_states = 0; - _aura_supress_states = 0; - - _aura_stat_attribute_count = 0; - _aura_trigger_count = 0; - - _aura_diminishing_return_enabled = false; - _aura_diminishing_return_category = 0; -} - -Aura::~Aura() { - _icon.unref(); - - _aura_teaches_spell.unref(); - - _aura_visual_spell_effects.unref(); - - _aura_damage_scaling_curve.unref(); - _aura_absorb_scaling_curve.unref(); - _aura_heal_scaling_curve.unref(); - - for (int i = 0; i < MAX_TRIGGER_DATA; ++i) { - _aura_trigger_datas[i].spell.unref(); - } - - _aura_talent_required_talent.unref(); - _aura_talent_required_spell.unref(); -} - -////// Triggers /////// - -int Aura::aura_trigger_get_count() const { - return _aura_trigger_count; -} - -void Aura::aura_trigger_set_count(const int count) { - ERR_FAIL_COND(count < 0 || count > MAX_TRIGGER_DATA); - - _aura_trigger_count = count; -} - -SpellEnums::TriggerNotificationType Aura::aura_trigger_get_notification_type(const int index) const { - ERR_FAIL_INDEX_V(index, _aura_trigger_count, SpellEnums::TRIGGER_NOTIFICATION_TYPE_AURA); - - return _aura_trigger_datas[index].notification_type; -} - -void Aura::aura_trigger_set_notification_type(const int index, const SpellEnums::TriggerNotificationType value) { - ERR_FAIL_COND(index < 0 || index > _aura_trigger_count); - - _aura_trigger_datas[index].notification_type = value; -} - -int Aura::aura_trigger_get_notification_data(const int index) const { - ERR_FAIL_INDEX_V(index, _aura_trigger_count, 0); - - return _aura_trigger_datas[index].notification_data; -} - -void Aura::aura_trigger_set_notification_data(const int index, const int value) { - ERR_FAIL_COND(index < 0 || index > _aura_trigger_count); - - _aura_trigger_datas[index].notification_data = value; -} - -SpellEnums::TriggerType Aura::aura_trigger_get_trigger_type(const int index) const { - ERR_FAIL_INDEX_V(index, _aura_trigger_count, SpellEnums::TRIGGER_TYPE_NONE); - - return _aura_trigger_datas[index].trigger_type; -} - -void Aura::aura_trigger_set_trigger_type(const int index, const SpellEnums::TriggerType value) { - ERR_FAIL_COND(index < 0 || index > _aura_trigger_count); - - _aura_trigger_datas[index].trigger_type = value; -} - -float Aura::aura_trigger_get_trigger_type_data(const int index) const { - ERR_FAIL_INDEX_V(index, _aura_trigger_count, 0); - - return _aura_trigger_datas[index].trigger_type_data; -} - -void Aura::aura_trigger_set_trigger_type_data(const int index, const float value) { - ERR_FAIL_COND(index < 0 || index > _aura_trigger_count); - - _aura_trigger_datas[index].trigger_type_data = value; -} - -Ref Aura::aura_trigger_get_spell(const int index) const { - ERR_FAIL_INDEX_V(index, _aura_trigger_count, Ref()); - - return _aura_trigger_datas[index].spell; -} - -void Aura::aura_trigger_set_spell(const int index, const Ref &value) { - ERR_FAIL_COND(index < 0 || index > _aura_trigger_count); - - _aura_trigger_datas[index].spell = value; -} - -//// Talent //// -Ref Aura::aura_get_talent_required_talent() const { - return _aura_talent_required_talent; -} -void Aura::aura_set_talent_required_talent(const Ref rank) { - _aura_talent_required_talent = rank; -} - -Ref Aura::aura_get_talent_required_spell() const { - return _aura_talent_required_talent; -} -void Aura::aura_set_talent_required_spell(const Ref spell) { - _aura_talent_required_spell = spell; -} - -////// Aura Stat Attributes ////// - -int Aura::aura_stat_attribute_get_count() const { - return _aura_stat_attribute_count; -} -void Aura::aura_stat_attribute_set_count(int count) { - ERR_FAIL_COND(count < 0 || count > MAX_AURA_STATS); - - _aura_stat_attribute_count = count; -} - -int Aura::aura_stat_attribute_get_stat(int index) const { - ERR_FAIL_INDEX_V(index, MAX_AURA_STATS, 0); - - return _aura_stat_attributes[index].stat; -} -void Aura::aura_stat_attribute_set_stat(int index, const int value) { - ERR_FAIL_INDEX(index, MAX_AURA_STATS); - - _aura_stat_attributes[index].stat = value; -} - -float Aura::aura_stat_attribute_get_base_mod(int index) const { - ERR_FAIL_INDEX_V(index, MAX_AURA_STATS, 0); - - return _aura_stat_attributes[index].base_mod; -} -void Aura::aura_stat_attribute_set_base_mod(int index, float value) { - ERR_FAIL_INDEX(index, MAX_AURA_STATS); - - _aura_stat_attributes[index].base_mod = value; -} - -float Aura::aura_stat_attribute_get_bonus_mod(int index) const { - ERR_FAIL_INDEX_V(index, MAX_AURA_STATS, 0); - - return _aura_stat_attributes[index].bonus_mod; -} -void Aura::aura_stat_attribute_set_bonus_mod(int index, float value) { - ERR_FAIL_INDEX(index, MAX_AURA_STATS); - - _aura_stat_attributes[index].bonus_mod = value; -} - -float Aura::aura_stat_attribute_get_percent_mod(int index) const { - ERR_FAIL_INDEX_V(index, MAX_AURA_STATS, 0); - - return _aura_stat_attributes[index].percent_mod; -} -void Aura::aura_stat_attribute_set_percent_mod(int index, float value) { - ERR_FAIL_INDEX(index, MAX_AURA_STATS); - - _aura_stat_attributes[index].percent_mod = value; -} - -void Aura::aura_sapply_simple(Entity *caster, Entity *target, float spell_scale) { - ERR_FAIL_COND(caster == NULL || target == NULL); - - Ref info(memnew(AuraApplyInfo(caster, target, spell_scale, this))); - - aura_sapply(info); -} - -void Aura::aura_sapply(Ref info) { - ERR_FAIL_COND(!info.is_valid()); - - //always exists - call("_aura_sapply", info); -} - -void Aura::aura_sdeapply(Ref info) { - ERR_FAIL_COND(!info.is_valid()); - - //always exists - call("_aura_sdeapply", info); -} - -void Aura::aura_sadd(Ref aura) { - ERR_FAIL_COND(!aura.is_valid()); - - //always exists - call("_aura_sadd", aura); -} - -void Aura::aura_sremove(Ref aura) { - ERR_FAIL_COND(!aura.is_valid()); - - //always exists - call("_aura_sremove", aura); -} - -void Aura::aura_removes_expired(Ref aura) { - ERR_FAIL_COND(!aura.is_valid()); - - //always exists - call("_aura_removes_expired", aura); -} - -void Aura::aura_removes_dispell(Ref aura) { - ERR_FAIL_COND(!aura.is_valid()); - - //always exists - call("_aura_removes_dispell", aura); -} - -void Aura::aura_supdate(Ref aura, float delta) { - ERR_FAIL_COND(!aura.is_valid()); - - //always exists - call("_aura_supdate", aura, delta); -} - -void Aura::notification_saura(int what, Ref data) { - ERR_FAIL_COND(!data.is_valid()); - - if (has_method("_notification_saura")) - call("_notification_saura", what, data); -} -void Aura::notification_sheal(int what, Ref aura, Ref data) { - ERR_FAIL_COND(!aura.is_valid()); - ERR_FAIL_COND(!data.is_valid()); - - if (has_method("_notification_sheal")) - call("_notification_sheal", what, aura, data); -} -void Aura::notification_scast(int what, Ref aura, Ref info) { - ERR_FAIL_COND(!aura.is_valid()); - ERR_FAIL_COND(!info.is_valid()); - - if (has_method("_notification_scast")) - call("_notification_scast", what, aura, info); -} -void Aura::notification_sdamage(int what, Ref aura, Ref data) { - ERR_FAIL_COND(!aura.is_valid()); - ERR_FAIL_COND(!data.is_valid()); - - if (has_method("_notification_sdamage")) - call("_notification_sdamage", what, aura, data); -} - -void Aura::son_remove_expired(Ref aura) { - ERR_FAIL_COND(!aura.is_valid()); - - if (has_method("_son_remove_expired")) - call("_son_remove_expired", aura); -} - -void Aura::son_remove(Ref aura) { - ERR_FAIL_COND(!aura.is_valid()); - - if (has_method("_son_remove")) - call("_son_remove", aura); -} - -void Aura::son_remove_dispell(Ref aura) { - ERR_FAIL_COND(!aura.is_valid()); - - if (has_method("_son_remove_dispell")) - call("_son_remove_dispell", aura); -} - -void Aura::notification_sdeath(Ref data) { - if (has_method("_notification_sdeath")) - call("_notification_sdeath", data); -} - -void Aura::notification_scooldown_added(Ref data, int id, float value) { - if (has_method("_notification_scooldown_added")) - call("_notification_scooldown_added", data, id, value); -} -void Aura::notification_scooldown_removed(Ref data, int id, float value) { - if (has_method("_notification_scooldown_removed")) - call("_notification_scooldown_removed", data, id, value); -} - -void Aura::notification_scategory_cooldown_added(Ref data, int id, float value) { - if (has_method("_notification_scategory_cooldown_added")) - call("_notification_scategory_cooldown_added", data, id, value); -} -void Aura::notification_scategory_cooldown_removed(Ref data, int id, float value) { - if (has_method("_notification_scategory_cooldown_removed")) - call("_notification_scategory_cooldown_removed", data, id, value); -} - -void Aura::notification_sgcd_started(Ref data, float gcd) { - ERR_FAIL_COND(!data.is_valid()); - - if (has_method("_notification_sgcd_started")) - call("_notification_sgcd_started", data, gcd); -} -void Aura::notification_sgcd_finished(Ref data) { - ERR_FAIL_COND(!data.is_valid()); - - if (has_method("_notification_sgcd_finished")) - call("_notification_sgcd_finished", data); -} - -void Aura::son_physics_process(Ref data) { - ERR_FAIL_COND(!data.is_valid()); - - if (has_method("_notification_sgcd_finished")) - call("_notification_sgcd_finished", data); -} - -void Aura::notification_sxp_gained(Ref data, int value) { - ERR_FAIL_COND(!data.is_valid()); - - if (has_method("_notification_sxp_gained")) - call("_notification_sxp_gained", data, value); -} - -void Aura::notification_slevel_up(Ref data, int value) { - ERR_FAIL_COND(!data.is_valid()); - - if (has_method("_notification_slevel_up")) - call("_notification_slevel_up", data, value); -} - -void Aura::notification_sentity_resource_added(Ref data, Ref resource) { - ERR_FAIL_COND(!data.is_valid()); - ERR_FAIL_COND(!resource.is_valid()); - - if (has_method("_notification_sentity_resource_added")) - call("_notification_sentity_resource_added", data, resource); -} -void Aura::notification_sentity_resource_removed(Ref data, Ref resource) { - ERR_FAIL_COND(!data.is_valid()); - ERR_FAIL_COND(!resource.is_valid()); - - if (has_method("_notification_sentity_resource_removed")) - call("_notification_sentity_resource_removed", data, resource); -} - -void Aura::notification_caura(int what, Ref data) { - ERR_FAIL_COND(!data.is_valid()); - - if (has_method("_notification_caura")) - call("_notification_caura", what, data); -} -void Aura::notification_cheal(int what, Ref aura, Ref data) { - ERR_FAIL_COND(!aura.is_valid()); - ERR_FAIL_COND(!data.is_valid()); - - if (has_method("_notification_cheal")) - call("_notification_cheal", what, aura, data); -} -void Aura::notification_ccast(int what, Ref aura, Ref info) { - ERR_FAIL_COND(!aura.is_valid()); - ERR_FAIL_COND(!info.is_valid()); - - if (has_method("_notification_ccast")) - call("_notification_ccast", what, aura, info); -} -void Aura::notification_cdamage(int what, Ref aura, Ref data) { - ERR_FAIL_COND(!aura.is_valid()); - ERR_FAIL_COND(!data.is_valid()); - - if (has_method("_notification_cdamage")) - call("_notification_cdamage", what, aura, data); -} - -void Aura::notification_cdeath(Ref data) { - if (has_method("_notification_cdeath")) - call("_notification_cdeath", data); -} - -void Aura::notification_ccooldown_added(Ref data, int id, float value) { - if (has_method("_notification_ccooldown_added")) - call("_notification_ccooldown_added", data, id, value); -} -void Aura::notification_ccooldown_removed(Ref data, int id, float value) { - if (has_method("_notification_ccooldown_removed")) - call("_notification_ccooldown_removed", data, id, value); -} -void Aura::notification_ccategory_cooldown_added(Ref data, int id, float value) { - if (has_method("_notification_ccategory_cooldown_added")) - call("_notification_ccategory_cooldown_added", data, id, value); -} -void Aura::notification_ccategory_cooldown_removed(Ref data, int id, float value) { - if (has_method("_notification_ccategory_cooldown_removed")) - call("_notification_ccategory_cooldown_removed", data, id, value); -} - -void Aura::notification_cgcd_started(Ref data, float gcd) { - ERR_FAIL_COND(!data.is_valid()); - - if (has_method("_notification_cgcd_started")) - call("_notification_cgcd_started", data, gcd); -} -void Aura::notification_cgcd_finished(Ref data) { - ERR_FAIL_COND(!data.is_valid()); - - if (has_method("_notification_cgcd_finished")) - call("_notification_cgcd_finished", data); -} - -void Aura::notification_cxp_gained(Ref data, int value) { - ERR_FAIL_COND(!data.is_valid()); - - if (has_method("_notification_cxp_gained")) - call("_notification_cxp_gained", data, value); -} - -void Aura::notification_clevel_up(Ref data, int value) { - ERR_FAIL_COND(!data.is_valid()); - - if (has_method("_notification_clevel_up")) - call("_notification_clevel_up", data, value); -} - -void Aura::notification_centity_resource_added(Ref data, Ref resource) { - ERR_FAIL_COND(!data.is_valid()); - ERR_FAIL_COND(!resource.is_valid()); - - if (has_method("_notification_centity_resource_added")) - call("_notification_centity_resource_added", data, resource); -} -void Aura::notification_centity_resource_removed(Ref data, Ref resource) { - ERR_FAIL_COND(!data.is_valid()); - ERR_FAIL_COND(!resource.is_valid()); - - if (has_method("_notification_centity_resource_removed")) - call("_notification_centity_resource_removed", data, resource); -} - -//Equipment - -bool Aura::equip_should_deny(Ref data, int equip_slot, Ref item) { - ERR_FAIL_COND_V(!data.is_valid(), false); - - if (has_method("_equip_should_deny")) - if (call("_equip_should_deny", data, equip_slot, item)) - return true; - - return false; -} - -void Aura::equip_son_success(Ref data, int equip_slot, Ref item, Ref old_item, int bag_slot) { - ERR_FAIL_COND(!data.is_valid()); - - if (has_method("_equip_son_success")) - call("_equip_son_success", data, equip_slot, item, old_item, bag_slot); -} -void Aura::equip_son_fail(Ref data, int equip_slot, Ref item, Ref old_item, int bag_slot) { - ERR_FAIL_COND(!data.is_valid()); - - if (has_method("_equip_son_fail")) - call("_equip_son_fail", data, equip_slot, item, old_item, bag_slot); -} - -void Aura::equip_con_success(Ref data, int equip_slot, Ref item, Ref old_item, int bag_slot) { - ERR_FAIL_COND(!data.is_valid()); - - if (has_method("_equip_con_success")) - call("_equip_con_success", data, equip_slot, item, old_item, bag_slot); -} -void Aura::equip_con_fail(Ref data, int equip_slot, Ref item, Ref old_item, int bag_slot) { - ERR_FAIL_COND(!data.is_valid()); - - if (has_method("_equip_con_fail")) - call("_equip_con_fail", data, equip_slot, item, old_item, bag_slot); -} - -void Aura::setup_aura_data(Ref data, Ref info) { - ERR_FAIL_COND(!data.is_valid() || !info.is_valid()); - - //always exists - call("_setup_aura_data", data, info); -} - -void Aura::aura_sapply_passives_damage_receive(Ref info) { - ERR_FAIL_COND(!info.is_valid()); - - //always exists - call("_aura_sapply_passives_damage_receive", info); -} - -void Aura::aura_sapply_passives_damage_deal(Ref info) { - ERR_FAIL_COND(!info.is_valid()); - - //always exists - call("_aura_sapply_passives_damage_deal", info); -} - -void Aura::aura_calculate_initial_damage(Ref aura_data, Ref info) { - ERR_FAIL_COND(!aura_data.is_valid() || !info.is_valid()); - - //always exists - call("_aura_calculate_initial_damage", aura_data, info); -} - -void Aura::handle_aura_damage(Ref aura_data, Ref info) { - ERR_FAIL_COND(!aura_data.is_valid() || !info.is_valid()); - - //always exists - call("_handle_aura_damage", aura_data, info); -} - -void Aura::aura_sapply_passives_heal_receive(Ref data) { - ERR_FAIL_COND(!data.is_valid()); - - //always exists - call("_aura_sapply_passives_heal_receive", data); -} - -void Aura::aura_sapply_passives_heal_deal(Ref data) { - ERR_FAIL_COND(!data.is_valid()); - - //always exists - call("_aura_sapply_passives_heal_deal", data); -} - -void Aura::aura_calculate_initial_heal(Ref aura_data, Ref info) { - ERR_FAIL_COND(!aura_data.is_valid() || !info.is_valid()); - - //always exists - call("_aura_calculate_initial_heal", aura_data, info); -} - -void Aura::handle_aura_heal(Ref aura_data, Ref data) { - ERR_FAIL_COND(!aura_data.is_valid() || !data.is_valid()); - - //always exists - call("_handle_aura_heal", aura_data, data); -} - -String Aura::aura_get_name_translated() const { - if (_aura_text_translation_key != "") { - return tr(_aura_text_translation_key); - } - - return get_name(); -} - -String Aura::aura_get_description(const int class_level, const int character_level) { - return call("_aura_get_description", class_level, character_level); -} - -String Aura::_aura_get_description(const int class_level, const int character_level) { - String str; - - if (_aura_text_translation_key != "") { - str = tr(_aura_text_translation_key + "_DESC"); - } - - str = _aura_text_description; - - int pos = str.find_char('%'); - - while (pos > 0) { - if (pos == str.size() - 1) - break; - -#if GODOT4 - char32_t o = str[pos + 1]; -#else - CharType o = str[pos + 1]; -#endif - - if (o == '#' || o == '$' || o == '%') { - int nsp = str.find_char(' ', pos + 1); - - if (pos < 0) - break; - - String prop = str.substr(pos + 2, nsp - pos - 2); - StringName psm = prop; - bool valid = false; - Variant value = get(psm, &valid); - - if (valid) { - if (o == '#') { - value = Variant::evaluate(Variant::OP_MULTIPLY, value, class_level / static_cast(ESS::get_singleton()->get_max_class_level())); - - value = static_cast(value); - } - - if (o == '$') { - value = Variant::evaluate(Variant::OP_MULTIPLY, value, character_level / static_cast(ESS::get_singleton()->get_max_character_level())); - - value = static_cast(value); - } - - str = str.replace(str.substr(pos, nsp - pos) + " ", value); - } - } - - pos = str.find_char('%', pos + 1); - } - - return str; -} - -void Aura::_aura_sapply(Ref info) { - ERR_FAIL_COND(info->target_get() == NULL || info->caster_get() == NULL || !info->get_aura().is_valid()); - - Ref ad = info->target_get()->aura_gets_by(info->caster_get(), _id); - - if (!ad.is_valid()) { - ad.instance(); - - setup_aura_data(ad, info); - - Entity *owner = ad->get_owner(); - - for (int i = 0; i < _aura_stat_attribute_count; ++i) { - owner->stat_mod(_aura_stat_attributes[i].stat, _aura_stat_attributes[i].base_mod, _aura_stat_attributes[i].bonus_mod, _aura_stat_attributes[i].percent_mod); - } - - if (_aura_add_states != 0) { - for (int i = 0; i < EntityEnums::ENTITY_STATE_TYPE_INDEX_MAX; ++i) { - int t = 1 << i; - - if ((_aura_add_states & t) != 0) { - info->target_get()->adds_state_ref(i); - } - } - } - - info->target_get()->aura_adds(ad); - } else { - ad->set_remaining_time(_aura_time); - } -} - -void Aura::_aura_sdeapply(Ref data) { - ERR_FAIL_COND(data->get_owner() == NULL || data->caster_get() == NULL || !data->get_aura().is_valid()); - - Entity *owner = data->get_owner(); - - for (int i = 0; i < _aura_stat_attribute_count; ++i) { - owner->stat_mod(_aura_stat_attributes[i].stat, -_aura_stat_attributes[i].base_mod, -_aura_stat_attributes[i].bonus_mod, -_aura_stat_attributes[i].percent_mod); - } - - if (_aura_add_states != 0) { - for (int i = 0; i < EntityEnums::ENTITY_STATE_TYPE_INDEX_MAX; ++i) { - int t = 1 << i; - - if ((_aura_add_states & t) != 0) { - data->get_owner()->removes_state_ref(i); - } - } - } -} - -void Aura::_aura_sadd(Ref aura) { - ERR_FAIL_COND(aura->get_owner() == NULL); - - //sapply(aura); - - aura->get_owner()->aura_removes(aura); - aura->get_owner()->aura_adds(aura); -} - -void Aura::_aura_sremove(Ref aura) { - ERR_FAIL_COND(aura->get_owner() == NULL); - - aura_sdeapply(aura); - - aura->get_owner()->aura_removes(aura); -} - -void Aura::_aura_removes_expired(Ref aura) { - ERR_FAIL_COND(aura->get_owner() == NULL); - - aura_sdeapply(aura); - - aura->get_owner()->aura_removes_expired(aura); -} - -void Aura::_aura_removes_dispell(Ref aura) { - ERR_FAIL_COND(aura->get_owner() == NULL); - - aura_sdeapply(aura); - - aura->get_owner()->aura_removes_dispelled(aura); -} - -void Aura::_aura_supdate(Ref aura, float delta) { - bool remove = false; - - remove = aura->update(delta); - - //ontick - while (aura->get_unhandled_ticks() > 0) { - if (aura->damage_get() != 0) { - Ref dpd = Ref(memnew(SpellDamageInfo())); - - dpd->aura_source_set(Ref(this)); - dpd->dealer_set(aura->caster_get()); - dpd->receiver_set(aura->get_owner()); - - handle_aura_damage(aura, dpd); - } - - if (aura->heal_get() != 0) { - Ref shi = Ref(memnew(SpellHealInfo())); - - shi->aura_source_set(Ref(this)); - shi->dealer_set(aura->caster_get()); - shi->receiver_set(aura->get_owner()); - - handle_aura_heal(aura, shi); - } - - aura->set_unhandled_ticks(aura->get_unhandled_ticks() - 1); - } - - if (remove) { - aura_removes_expired(aura); - } -} - -void Aura::_setup_aura_data(Ref data, Ref info) { - ERR_FAIL_COND(!INSTANCE_VALIDATE(info->caster_get())); - - data->set_aura(Ref(this)); - data->set_aura_id(get_id()); - data->set_owner(info->target_get()); - data->caster_set(info->caster_get()); - data->set_tick(info->get_aura()->aura_get_tick()); - - if (aura_get_time() > 0.2) { - data->set_is_timed(true); - data->set_remaining_time(aura_get_time()); - - } else { - data->set_is_timed(false); - } - - if (aura_damage_get_enabled()) { - aura_calculate_initial_damage(data, info); - } - - if (aura_heal_get_enabled()) { - aura_calculate_initial_heal(data, info); - } -} - -void Aura::_aura_sapply_passives_damage_receive(Ref info) { -} - -void Aura::_aura_sapply_passives_damage_deal(Ref info) { -} - -void Aura::_aura_calculate_initial_damage(Ref aura_data, Ref info) { - int min_damage = aura_damage_get_min(); - int max_damage = aura_damage_get_max(); - - Math::randomize(); - int damage = min_damage + Math::rand() % (max_damage - min_damage); - - if (aura_get_scale_with_level()) { - damage = static_cast(damage * static_cast(info->caster_get()->gets_level()) / static_cast(ESS::get_singleton()->get_max_character_level())); - } - - aura_data->damage_set(damage); -} - -void Aura::_handle_aura_damage(Ref aura_data, Ref info) { - if (info->dealer_get() && !INSTANCE_VALIDATE(info->dealer_get())) { - info->dealer_set(NULL); - } - - info->damage_set(aura_data->damage_get()); - info->aura_source_set(Ref(this)); - - if (info->dealer_get()) { - info->dealer_get()->sdeal_damage_to(info); - } else { - info->receiver_get()->stake_damage(info); - } -} - -void Aura::_aura_sapply_passives_heal_receive(Ref data) { - ERR_FAIL_COND(!data.is_valid()); -} - -void Aura::_aura_sapply_passives_heal_deal(Ref data) { - ERR_FAIL_COND(!data.is_valid()); -} - -void Aura::_aura_calculate_initial_heal(Ref aura_data, Ref info) { - int min_heal = aura_heal_get_min(); - int max_heal = aura_heal_get_max(); - - Math::randomize(); - int heal = min_heal + Math::rand() % (max_heal - min_heal); - - if (aura_get_scale_with_level()) { - heal = static_cast(heal * static_cast(info->caster_get()->gets_level()) / static_cast(ESS::get_singleton()->get_max_character_level())); - } - - aura_data->heal_set(heal); -} - -void Aura::_handle_aura_heal(Ref aura_data, Ref info) { - if (info->dealer_get() && !INSTANCE_VALIDATE(info->dealer_get())) { - info->dealer_set(NULL); - } - - info->heal_set(aura_data->heal_get()); - - if (info->dealer_get()) { - info->dealer_get()->sdeal_heal_to(info); - } else { - info->receiver_get()->stake_heal(info); - } -} - -void Aura::_validate_property(PropertyInfo &property) const { - String prop = property.name; - if (prop.begins_with("aura_stat_attribute_")) { - if (prop.ends_with("count")) - return; - - int frame = prop.get_slicec('/', 0).get_slicec('_', 2).to_int(); - if (frame >= _aura_stat_attribute_count) { - property.usage = 0; - } - - if (property.name.ends_with("stat")) - property.hint_string = ESS::get_singleton()->stat_get_string(); - } else if (prop == "diminishing_return_category") { - property.hint_string = ESS::get_singleton()->dminishing_return_categories_get(); - } else if (prop.begins_with("aura_trigger_")) { - if (prop.ends_with("count")) - return; - - int frame = prop.get_slicec('/', 0).get_slicec('_', 1).to_int(); - if (frame >= _aura_trigger_count) { - property.usage = 0; - } else { - if (prop.ends_with("notification_data")) { - switch (_aura_trigger_datas[frame].notification_type) { - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_AURA: - property.hint = PROPERTY_HINT_ENUM; - property.hint_string = SpellEnums::BINDING_STRING_NOTIFICATION_AURAS; - break; - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_DAMAGE: - property.hint = PROPERTY_HINT_ENUM; - property.hint_string = SpellEnums::BINDING_STRING_NOTIFICATION_DAMAGES; - break; - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_HEAL: - property.hint = PROPERTY_HINT_ENUM; - property.hint_string = SpellEnums::BINDING_STRING_NOTIFICATION_HEALS; - break; - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_CAST: - property.hint = PROPERTY_HINT_ENUM; - property.hint_string = SpellEnums::BINDING_STRING_NOTIFICATION_CASTS; - break; - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_DEATH: - property.hint = PROPERTY_HINT_NONE; - property.hint_string = ""; - break; - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_COOLDOWN_ADDED: - property.hint = PROPERTY_HINT_NONE; - property.hint_string = ""; - break; - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_COOLDOWN_REMOVED: - property.hint = PROPERTY_HINT_NONE; - property.hint_string = ""; - break; - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_CATEGORY_COOLDOWN_ADDED: - property.hint = PROPERTY_HINT_NONE; - property.hint_string = ""; - break; - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_CATEGORY_COOLDOWN_REMOVED: - property.hint = PROPERTY_HINT_NONE; - property.hint_string = ""; - break; - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_GCD_STARTED: - property.hint = PROPERTY_HINT_NONE; - property.hint_string = ""; - break; - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_GCD_FINISHED: - property.hint = PROPERTY_HINT_NONE; - property.hint_string = ""; - break; - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_XP_GAINED: - property.hint = PROPERTY_HINT_NONE; - property.hint_string = ""; - break; - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_CLASS_LEVELUP: - property.hint = PROPERTY_HINT_NONE; - property.hint_string = ""; - break; - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_CHARACTER_LEVELUP: - property.hint = PROPERTY_HINT_NONE; - property.hint_string = ""; - break; - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_ENTITY_RESOURCE_ADDED: - property.hint = PROPERTY_HINT_NONE; - property.hint_string = ""; - break; - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_ENTITY_RESOURCE_REMOVED: - property.hint = PROPERTY_HINT_NONE; - property.hint_string = ""; - break; - - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_AURA_CUSTOM: - property.hint = PROPERTY_HINT_NONE; - property.hint_string = ""; - break; - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_DAMAGE_CUSTOM: - property.hint = PROPERTY_HINT_NONE; - property.hint_string = ""; - break; - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_HEAL_CUSTOM: - property.hint = PROPERTY_HINT_NONE; - property.hint_string = ""; - break; - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_CAST_CUSTOM: - property.hint = PROPERTY_HINT_NONE; - property.hint_string = ""; - break; - case SpellEnums::TRIGGER_NOTIFICATION_TYPE_CUSTOM: - property.hint = PROPERTY_HINT_NONE; - property.hint_string = ""; - break; - default: - break; - } - } - } - } -} - -void Aura::_bind_methods() { - //Commands - ClassDB::bind_method(D_METHOD("aura_sapply", "info"), &Aura::aura_sapply); - ClassDB::bind_method(D_METHOD("aura_sdeapply", "aura"), &Aura::aura_sdeapply); - ClassDB::bind_method(D_METHOD("aura_sadd", "aura"), &Aura::aura_sadd); - ClassDB::bind_method(D_METHOD("aura_sremove", "aura"), &Aura::aura_sremove); - ClassDB::bind_method(D_METHOD("aura_removes_expired", "aura"), &Aura::aura_removes_expired); - ClassDB::bind_method(D_METHOD("aura_removes_dispell", "aura"), &Aura::aura_removes_dispell); - ClassDB::bind_method(D_METHOD("aura_supdate", "aura", "delta"), &Aura::aura_supdate); - - BIND_VMETHOD(MethodInfo("_aura_sapply", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraApplyInfo"))); - BIND_VMETHOD(MethodInfo("_aura_sdeapply", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_aura_sadd", PropertyInfo(Variant::OBJECT, "aura", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_aura_sremove", PropertyInfo(Variant::OBJECT, "aura", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_aura_removes_expired", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_aura_removes_dispell", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_aura_supdate", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::REAL, "delta"))); - - ClassDB::bind_method(D_METHOD("_aura_sapply", "info"), &Aura::_aura_sapply); - ClassDB::bind_method(D_METHOD("_aura_sdeapply", "aura"), &Aura::_aura_sdeapply); - ClassDB::bind_method(D_METHOD("_aura_sadd", "aura"), &Aura::_aura_sadd); - ClassDB::bind_method(D_METHOD("_aura_sremove", "aura"), &Aura::_aura_sremove); - ClassDB::bind_method(D_METHOD("_aura_removes_expired", "aura"), &Aura::_aura_removes_expired); - ClassDB::bind_method(D_METHOD("_aura_removes_dispell", "aura"), &Aura::_aura_removes_dispell); - ClassDB::bind_method(D_METHOD("_aura_supdate", "aura", "delta"), &Aura::_aura_supdate); - - //EventHandlers - BIND_VMETHOD(MethodInfo("_notification_saura", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_notification_sheal", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); - BIND_VMETHOD(MethodInfo("_notification_scast", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_notification_sdamage", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); - - ClassDB::bind_method(D_METHOD("notification_saura", "what", "data"), &Aura::notification_saura); - ClassDB::bind_method(D_METHOD("notification_sheal", "what", "aura", "info"), &Aura::notification_sheal); - ClassDB::bind_method(D_METHOD("notification_scast", "what", "aura", "info"), &Aura::notification_scast); - ClassDB::bind_method(D_METHOD("notification_sdamage", "what", "aura", "info"), &Aura::notification_sdamage); - - ClassDB::bind_method(D_METHOD("son_remove", "aura"), &Aura::son_remove); - ClassDB::bind_method(D_METHOD("son_remove_expired", "aura"), &Aura::son_remove_expired); - ClassDB::bind_method(D_METHOD("son_remove_dispell", "aura"), &Aura::son_remove_dispell); - - ClassDB::bind_method(D_METHOD("notification_sdeath", "data"), &Aura::notification_sdeath); - - ClassDB::bind_method(D_METHOD("notification_scooldown_added", "data", "cooldown"), &Aura::notification_scooldown_added); - ClassDB::bind_method(D_METHOD("notification_scooldown_removed", "data", "cooldown"), &Aura::notification_scooldown_removed); - - ClassDB::bind_method(D_METHOD("notification_scategory_cooldown_added", "data", "category_cooldown"), &Aura::notification_scategory_cooldown_added); - ClassDB::bind_method(D_METHOD("notification_scategory_cooldown_removed", "data", "category_cooldown"), &Aura::notification_scategory_cooldown_removed); - - ClassDB::bind_method(D_METHOD("notification_sgcd_started", "data", "gcd"), &Aura::notification_sgcd_started); - ClassDB::bind_method(D_METHOD("notification_sgcd_finished", "data"), &Aura::notification_sgcd_finished); - - ClassDB::bind_method(D_METHOD("son_physics_process", "data"), &Aura::son_physics_process); - - ClassDB::bind_method(D_METHOD("notification_sxp_gained", "data", "value"), &Aura::notification_sxp_gained); - ClassDB::bind_method(D_METHOD("notification_slevel_up", "data", "value"), &Aura::notification_slevel_up); - - ClassDB::bind_method(D_METHOD("notification_sentity_resource_added", "data", "value"), &Aura::notification_sentity_resource_added); - ClassDB::bind_method(D_METHOD("notification_sentity_resource_removed", "data", "value"), &Aura::notification_sentity_resource_removed); - - BIND_VMETHOD(MethodInfo("_son_remove", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_son_remove_expired", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_son_remove_dispell", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - - BIND_VMETHOD(MethodInfo("_notification_sdeath", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - - BIND_VMETHOD(MethodInfo("_notification_scooldown_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("_notification_scooldown_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("_notification_scategory_cooldown_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("_notification_scategory_cooldown_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - - BIND_VMETHOD(MethodInfo("_notification_sgcd_started", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::REAL, "gcd"))); - BIND_VMETHOD(MethodInfo("_notification_sgcd_finished", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - - BIND_VMETHOD(MethodInfo("_son_physics_process", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - - BIND_VMETHOD(MethodInfo("_notification_sxp_gained", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); - BIND_VMETHOD(MethodInfo("_notification_slevel_up", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); - - BIND_VMETHOD(MethodInfo("_notification_sentity_resource_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); - BIND_VMETHOD(MethodInfo("_notification_sentity_resource_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); - - //Clientside Event Handlers - BIND_VMETHOD(MethodInfo("_notification_caura", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_notification_cheal", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); - BIND_VMETHOD(MethodInfo("_notification_ccast", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_notification_cdamage", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); - - ClassDB::bind_method(D_METHOD("notification_caura", "what", "data"), &Aura::notification_caura); - ClassDB::bind_method(D_METHOD("notification_cheal", "what", "aura", "info"), &Aura::notification_cheal); - ClassDB::bind_method(D_METHOD("notification_ccast", "what", "aura", "info"), &Aura::notification_ccast); - ClassDB::bind_method(D_METHOD("notification_cdamage", "what", "aura", "info"), &Aura::notification_cdamage); - - ClassDB::bind_method(D_METHOD("notification_cdeath", "data"), &Aura::notification_cdeath); - - ClassDB::bind_method(D_METHOD("notification_ccooldown_added", "data", "info"), &Aura::notification_ccooldown_added); - ClassDB::bind_method(D_METHOD("notification_ccooldown_removed", "data", "info"), &Aura::notification_ccooldown_removed); - ClassDB::bind_method(D_METHOD("notification_ccategory_cooldown_added", "data", "info"), &Aura::notification_ccategory_cooldown_added); - ClassDB::bind_method(D_METHOD("notification_ccategory_cooldown_removed", "data", "info"), &Aura::notification_ccategory_cooldown_removed); - - ClassDB::bind_method(D_METHOD("notification_cgcd_started", "data", "info"), &Aura::notification_cgcd_started); - ClassDB::bind_method(D_METHOD("notification_cgcd_finished", "data"), &Aura::notification_cgcd_finished); - - ClassDB::bind_method(D_METHOD("notification_cxp_gained", "data", "value"), &Aura::notification_cxp_gained); - ClassDB::bind_method(D_METHOD("notification_clevel_up", "data", "value"), &Aura::notification_clevel_up); - - ClassDB::bind_method(D_METHOD("notification_centity_resource_added", "data", "value"), &Aura::notification_centity_resource_added); - ClassDB::bind_method(D_METHOD("notification_centity_resource_removed", "data", "value"), &Aura::notification_centity_resource_removed); - - BIND_VMETHOD(MethodInfo("_con_cast_failed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_con_cast_started", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_con_cast_state_changed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_con_cast_finished", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_con_spell_cast_success", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - - BIND_VMETHOD(MethodInfo("_notification_cdeath", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - - BIND_VMETHOD(MethodInfo("_notification_ccooldown_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("_notification_ccooldown_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("_notification_ccategory_cooldown_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("_notification_ccategory_cooldown_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - - BIND_VMETHOD(MethodInfo("_con_aura_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_con_aura_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_con_aura_refresh", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - - BIND_VMETHOD(MethodInfo("_con_damage_dealt", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); - BIND_VMETHOD(MethodInfo("_con_dealt_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); - BIND_VMETHOD(MethodInfo("_con_heal_dealt", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); - BIND_VMETHOD(MethodInfo("_con_dealt_heal", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); - - BIND_VMETHOD(MethodInfo("_notification_cgcd_started", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::REAL, "gcd"))); - BIND_VMETHOD(MethodInfo("_notification_cgcd_finished", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - - BIND_VMETHOD(MethodInfo("_notification_cxp_gained", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); - BIND_VMETHOD(MethodInfo("_notification_clevel_up", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); - - BIND_VMETHOD(MethodInfo("_notification_centity_resource_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); - BIND_VMETHOD(MethodInfo("_notification_centity_resource_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); - - //Equipment - - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "ret"), "_equip_should_deny", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"))); - - BIND_VMETHOD(MethodInfo("_equip_son_success", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); - BIND_VMETHOD(MethodInfo("_equip_son_fail", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); - BIND_VMETHOD(MethodInfo("_equip_con_success", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); - BIND_VMETHOD(MethodInfo("_equip_con_fail", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); - - ClassDB::bind_method(D_METHOD("equip_should_deny", "data", "equip_slot", "item"), &Aura::equip_should_deny); - - ClassDB::bind_method(D_METHOD("equip_son_success", "data", "equip_slot", "item", "old_item", "bag_slot"), &Aura::equip_son_success); - ClassDB::bind_method(D_METHOD("equip_son_fail", "data", "equip_slot", "item", "old_item", "bag_slot"), &Aura::equip_son_fail); - ClassDB::bind_method(D_METHOD("equip_con_success", "data", "equip_slot", "item", "old_item", "bag_slot"), &Aura::equip_con_success); - ClassDB::bind_method(D_METHOD("equip_con_fail", "data", "equip_slot", "item", "old_item", "bag_slot"), &Aura::equip_con_fail); - - //Calculations / Queries - ClassDB::bind_method(D_METHOD("setup_aura_data", "data", "info"), &Aura::setup_aura_data); - - BIND_VMETHOD(MethodInfo("_setup_aura_data", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraApplyInfo"))); - - ClassDB::bind_method(D_METHOD("_setup_aura_data", "data", "info"), &Aura::_setup_aura_data); - - //damage - ClassDB::bind_method(D_METHOD("aura_sapply_passives_damage_receive", "data"), &Aura::aura_sapply_passives_damage_receive); - ClassDB::bind_method(D_METHOD("aura_sapply_passives_damage_deal", "data"), &Aura::aura_sapply_passives_damage_deal); - ClassDB::bind_method(D_METHOD("aura_calculate_initial_damage", "aura_data", "info"), &Aura::aura_calculate_initial_damage); - ClassDB::bind_method(D_METHOD("handle_aura_damage", "aura_data", "data"), &Aura::handle_aura_damage); - - BIND_VMETHOD(MethodInfo("_aura_sapply_passives_damage_receive", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); - BIND_VMETHOD(MethodInfo("_aura_sapply_passives_damage_deal", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); - BIND_VMETHOD(MethodInfo("_aura_calculate_initial_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraApplyInfo"))); - BIND_VMETHOD(MethodInfo("_handle_aura_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); - - ClassDB::bind_method(D_METHOD("_aura_sapply_passives_damage_receive", "info"), &Aura::_aura_sapply_passives_damage_receive); - ClassDB::bind_method(D_METHOD("_aura_sapply_passives_damage_deal", "info"), &Aura::_aura_sapply_passives_damage_deal); - ClassDB::bind_method(D_METHOD("_aura_calculate_initial_damage", "aura_data", "info"), &Aura::_aura_calculate_initial_damage); - ClassDB::bind_method(D_METHOD("_handle_aura_damage", "aura_data", "info"), &Aura::_handle_aura_damage); - - //heal - ClassDB::bind_method(D_METHOD("aura_sapply_passives_heal_receive", "data"), &Aura::aura_sapply_passives_heal_receive); - ClassDB::bind_method(D_METHOD("aura_sapply_passives_heal_deal", "data"), &Aura::aura_sapply_passives_heal_deal); - ClassDB::bind_method(D_METHOD("aura_calculate_initial_heal", "aura_data", "info"), &Aura::aura_calculate_initial_heal); - ClassDB::bind_method(D_METHOD("handle_aura_heal", "aura_data", "data"), &Aura::handle_aura_heal); - - BIND_VMETHOD(MethodInfo("_aura_sapply_passives_heal_receive", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); - BIND_VMETHOD(MethodInfo("_aura_sapply_passives_heal_deal", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); - BIND_VMETHOD(MethodInfo("_aura_calculate_initial_heal", PropertyInfo(Variant::OBJECT, "aura_data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraApplyInfo"))); - BIND_VMETHOD(MethodInfo("_handle_aura_heal", PropertyInfo(Variant::OBJECT, "aura_data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "spell_heal_info", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); - - ClassDB::bind_method(D_METHOD("_aura_sapply_passives_heal_receive", "info"), &Aura::_aura_sapply_passives_heal_receive); - ClassDB::bind_method(D_METHOD("_aura_sapply_passives_heal_deal", "info"), &Aura::_aura_sapply_passives_heal_deal); - ClassDB::bind_method(D_METHOD("_aura_calculate_initial_heal", "aura_data", "info"), &Aura::_aura_calculate_initial_heal); - ClassDB::bind_method(D_METHOD("_handle_aura_heal", "aura_data", "info"), &Aura::_handle_aura_heal); - - //Properties - ClassDB::bind_method(D_METHOD("get_id"), &Aura::get_id); - ClassDB::bind_method(D_METHOD("set_id", "value"), &Aura::set_id); - ADD_PROPERTY(PropertyInfo(Variant::INT, "id"), "set_id", "get_id"); - - ClassDB::bind_method(D_METHOD("get_icon"), &Aura::get_icon); - ClassDB::bind_method(D_METHOD("set_icon", "value"), &Aura::set_icon); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "icon", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_icon", "get_icon"); - - ClassDB::bind_method(D_METHOD("get_rank"), &Aura::get_rank); - ClassDB::bind_method(D_METHOD("set_rank", "value"), &Aura::set_rank); - ADD_PROPERTY(PropertyInfo(Variant::INT, "rank"), "set_rank", "get_rank"); - - ADD_GROUP("Aura", "aura"); - ClassDB::bind_method(D_METHOD("aura_get_time"), &Aura::aura_get_time); - ClassDB::bind_method(D_METHOD("aura_set_time", "value"), &Aura::aura_set_time); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "aura_time"), "aura_set_time", "aura_get_time"); - - ClassDB::bind_method(D_METHOD("aura_get_tick"), &Aura::aura_get_tick); - ClassDB::bind_method(D_METHOD("aura_set_tick", "value"), &Aura::aura_set_tick); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "aura_tick"), "aura_set_tick", "aura_get_tick"); - - ClassDB::bind_method(D_METHOD("aura_get_is_debuff"), &Aura::aura_get_is_debuff); - ClassDB::bind_method(D_METHOD("aura_set_is_debuff", "value"), &Aura::aura_set_is_debuff); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_debuff"), "aura_set_is_debuff", "aura_get_is_debuff"); - - ClassDB::bind_method(D_METHOD("aura_get_scale_with_level"), &Aura::aura_get_scale_with_level); - ClassDB::bind_method(D_METHOD("aura_set_scale_with_level", "value"), &Aura::aura_set_scale_with_level); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_scale_with_level"), "aura_set_scale_with_level", "aura_get_scale_with_level"); - - ClassDB::bind_method(D_METHOD("aura_get_aura_type"), &Aura::aura_get_aura_type); - ClassDB::bind_method(D_METHOD("aura_set_aura_type", "value"), &Aura::aura_set_aura_type); - ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_type", PROPERTY_HINT_ENUM, SpellEnums::BINDING_STRING_AURA_TYPES), "aura_set_aura_type", "aura_get_aura_type"); - - ClassDB::bind_method(D_METHOD("aura_get_aura_group"), &Aura::aura_get_aura_group); - ClassDB::bind_method(D_METHOD("aura_set_aura_group", "value"), &Aura::aura_set_aura_group); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_group", PROPERTY_HINT_RESOURCE_TYPE, "AuraGroup"), "aura_set_aura_group", "aura_get_aura_group"); - - ClassDB::bind_method(D_METHOD("aura_get_hide"), &Aura::aura_get_hide); - ClassDB::bind_method(D_METHOD("aura_set_hide", "value"), &Aura::aura_set_hide); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_hide"), "aura_set_hide", "aura_get_hide"); - - ClassDB::bind_method(D_METHOD("aura_get_ability_scale_data_id"), &Aura::aura_get_ability_scale_data_id); - ClassDB::bind_method(D_METHOD("aura_set_ability_scale_data_id", "value"), &Aura::aura_set_ability_scale_data_id); - ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_ability_scale_data_id"), "aura_set_ability_scale_data_id", "aura_get_ability_scale_data_id"); - - ClassDB::bind_method(D_METHOD("aura_get_visual_spell_effects"), &Aura::aura_get_visual_spell_effects); - ClassDB::bind_method(D_METHOD("aura_set_visual_spell_effects", "value"), &Aura::aura_set_visual_spell_effects); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_visual_spell_effects", PROPERTY_HINT_RESOURCE_TYPE, "SpellEffectVisual"), "aura_set_visual_spell_effects", "aura_get_visual_spell_effects"); - - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::STRING, "desc"), "_aura_get_description", PropertyInfo(Variant::INT, "class_level"), PropertyInfo(Variant::INT, "character_level"))); - - ADD_PROPERTY(PropertyInfo(Variant::STRING, "text_name"), "set_name", "get_name"); - - ADD_GROUP("Aura Texts", "aura_text"); - ClassDB::bind_method(D_METHOD("aura_get_text_translation_key"), &Aura::aura_get_text_translation_key); - ClassDB::bind_method(D_METHOD("aura_set_text_translation_key", "value"), &Aura::aura_set_text_translation_key); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "aura_text_translation_key"), "aura_set_text_translation_key", "aura_get_text_translation_key"); - - ClassDB::bind_method(D_METHOD("aura_get_text_description"), &Aura::aura_get_text_description); - ClassDB::bind_method(D_METHOD("aura_set_text_description", "value"), &Aura::aura_set_text_description); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "aura_text_description", PROPERTY_HINT_MULTILINE_TEXT), "aura_set_text_description", "aura_get_text_description"); - - ClassDB::bind_method(D_METHOD("aura_get_name_translated"), &Aura::aura_get_name_translated); - ClassDB::bind_method(D_METHOD("aura_get_description", "class_level", "character_level"), &Aura::aura_get_description); - ClassDB::bind_method(D_METHOD("_aura_get_description", "class_level", "character_level"), &Aura::_aura_get_description); - - ADD_GROUP("Aura Damage", "aura_damage"); - //Damage - ClassDB::bind_method(D_METHOD("aura_damage_get_enabled"), &Aura::aura_damage_get_enabled); - ClassDB::bind_method(D_METHOD("aura_damage_set_enabled", "value"), &Aura::aura_damage_set_enabled); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_damage_enabled"), "aura_damage_set_enabled", "aura_damage_get_enabled"); - - ClassDB::bind_method(D_METHOD("aura_damage_get_type"), &Aura::aura_damage_get_type); - ClassDB::bind_method(D_METHOD("aura_damage_set_type", "value"), &Aura::aura_damage_set_type); - ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_damage_type", PROPERTY_HINT_FLAGS, SpellEnums::BINDING_STRING_DAMAGE_TYPES), "aura_damage_set_type", "aura_damage_get_type"); - - ClassDB::bind_method(D_METHOD("aura_damage_get_min"), &Aura::aura_damage_get_min); - ClassDB::bind_method(D_METHOD("aura_damage_set_min", "value"), &Aura::aura_damage_set_min); - ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_damage_min"), "aura_damage_set_min", "aura_damage_get_min"); - - ClassDB::bind_method(D_METHOD("aura_damage_get_max"), &Aura::aura_damage_get_max); - ClassDB::bind_method(D_METHOD("aura_damage_set_max", "value"), &Aura::aura_damage_set_max); - ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_damage_max"), "aura_damage_set_max", "aura_damage_get_max"); - - ClassDB::bind_method(D_METHOD("aura_damage_get_can_crit"), &Aura::aura_damage_get_can_crit); - ClassDB::bind_method(D_METHOD("aura_damage_set_can_crit", "value"), &Aura::aura_damage_set_can_crit); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_damage_can_crit"), "aura_damage_set_can_crit", "aura_damage_get_can_crit"); - - ClassDB::bind_method(D_METHOD("aura_damage_set", "min", "max", "can_crit"), &Aura::aura_damage_set); - - ClassDB::bind_method(D_METHOD("aura_damage_get_scaling_curve"), &Aura::aura_damage_get_scaling_curve); - ClassDB::bind_method(D_METHOD("aura_damage_set_scaling_curve", "curve"), &Aura::aura_damage_set_scaling_curve); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_damage_scaling_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "aura_damage_set_scaling_curve", "aura_damage_get_scaling_curve"); - - ADD_GROUP("Aura Absorb", "aura_absorb"); - //Absorb - ClassDB::bind_method(D_METHOD("aura_absorb_get_enabled"), &Aura::aura_absorb_get_enabled); - ClassDB::bind_method(D_METHOD("aura_absorb_set_enabled", "value"), &Aura::aura_absorb_set_enabled); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_absorb_enabled"), "aura_absorb_set_enabled", "aura_absorb_get_enabled"); - - ClassDB::bind_method(D_METHOD("aura_absorb_damage_get_type"), &Aura::aura_absorb_damage_get_type); - ClassDB::bind_method(D_METHOD("aura_absorb_damage_set_type", "value"), &Aura::aura_absorb_damage_set_type); - ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_absorb_damage_type", PROPERTY_HINT_FLAGS, SpellEnums::BINDING_STRING_DAMAGE_TYPES), "aura_absorb_damage_set_type", "aura_absorb_damage_get_type"); - - ClassDB::bind_method(D_METHOD("aura_absorb_get_min"), &Aura::aura_absorb_get_min); - ClassDB::bind_method(D_METHOD("aura_absorb_set_min", "value"), &Aura::aura_absorb_set_min); - ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_absorb_min"), "aura_absorb_set_min", "aura_absorb_get_min"); - - ClassDB::bind_method(D_METHOD("aura_absorb_get_max"), &Aura::aura_absorb_get_max); - ClassDB::bind_method(D_METHOD("aura_absorb_set_max", "value"), &Aura::aura_absorb_set_max); - ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_absorb_max"), "aura_absorb_set_max", "aura_absorb_get_max"); - - ClassDB::bind_method(D_METHOD("aura_absorb_get_scaling_curve"), &Aura::aura_absorb_get_scaling_curve); - ClassDB::bind_method(D_METHOD("aura_absorb_set_scaling_curve", "curve"), &Aura::aura_absorb_set_scaling_curve); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_absorb_scaling_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "aura_absorb_set_scaling_curve", "aura_absorb_get_scaling_curve"); - - ADD_GROUP("Aura Heal", "aura_heal"); - //Heal - ClassDB::bind_method(D_METHOD("aura_heal_get_enabled"), &Aura::aura_heal_get_enabled); - ClassDB::bind_method(D_METHOD("aura_heal_set_enabled", "value"), &Aura::aura_heal_set_enabled); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_heal_enabled"), "aura_heal_set_enabled", "aura_heal_get_enabled"); - - ClassDB::bind_method(D_METHOD("aura_heal_get_min"), &Aura::aura_heal_get_min); - ClassDB::bind_method(D_METHOD("aura_heal_set_min", "value"), &Aura::aura_heal_set_min); - ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_heal_min"), "aura_heal_set_min", "aura_heal_get_min"); - - ClassDB::bind_method(D_METHOD("aura_heal_get_max"), &Aura::aura_heal_get_max); - ClassDB::bind_method(D_METHOD("aura_heal_set_max", "value"), &Aura::aura_heal_set_max); - ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_heal_max"), "aura_heal_set_max", "aura_heal_get_max"); - - ClassDB::bind_method(D_METHOD("aura_heal_get_can_crit"), &Aura::aura_heal_get_can_crit); - ClassDB::bind_method(D_METHOD("aura_heal_set_can_crit", "value"), &Aura::aura_heal_set_can_crit); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_heal_can_crit"), "aura_heal_set_can_crit", "aura_heal_get_can_crit"); - - ClassDB::bind_method(D_METHOD("aura_heal_set", "min", "max", "can_crit"), &Aura::aura_heal_set); - - ClassDB::bind_method(D_METHOD("aura_heal_get_scaling_curve"), &Aura::aura_heal_get_scaling_curve); - ClassDB::bind_method(D_METHOD("aura_heal_set_scaling_curve", "curve"), &Aura::aura_heal_set_scaling_curve); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_heal_scaling_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "aura_heal_set_scaling_curve", "aura_heal_get_scaling_curve"); - - ADD_GROUP("Aura Dispell", "aura_dispell"); - ClassDB::bind_method(D_METHOD("aura_dispell_get_enabled"), &Aura::aura_dispell_get_enabled); - ClassDB::bind_method(D_METHOD("aura_dispell_set_enabled", "value"), &Aura::aura_dispell_set_enabled); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_dispell_enabled"), "aura_dispell_set_enabled", "aura_dispell_get_enabled"); - - ClassDB::bind_method(D_METHOD("aura_dispell_get_count_min"), &Aura::aura_dispell_get_count_min); - ClassDB::bind_method(D_METHOD("aura_dispell_set_count_min", "value"), &Aura::aura_dispell_set_count_min); - ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_dispell_count_min"), "aura_dispell_set_count_min", "aura_dispell_get_count_min"); - - ClassDB::bind_method(D_METHOD("aura_dispell_get_count_max"), &Aura::aura_dispell_get_count_max); - ClassDB::bind_method(D_METHOD("aura_dispell_set_count_max", "value"), &Aura::aura_dispell_set_count_max); - ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_dispell_count_max"), "aura_dispell_set_count_max", "aura_dispell_get_count_max"); - - ClassDB::bind_method(D_METHOD("aura_dispell_get_aura_types"), &Aura::aura_dispell_get_aura_types); - ClassDB::bind_method(D_METHOD("aura_dispell_set_aura_types", "value"), &Aura::aura_dispell_set_aura_types); - ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_dispell_aura_types", PROPERTY_HINT_FLAGS, SpellEnums::BINDING_STRING_AURA_FLAG_TYPES), "aura_dispell_set_aura_types", "aura_dispell_get_aura_types"); - - //Resources - ADD_GROUP("Aura Resources", "aura_resource"); - ClassDB::bind_method(D_METHOD("aura_get_resource_cost"), &Aura::aura_get_resource_cost); - ClassDB::bind_method(D_METHOD("aura_set_resource_cost", "value"), &Aura::aura_set_resource_cost); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_resource_cost", PROPERTY_HINT_RESOURCE_TYPE, "EntityResourceCostData"), "aura_set_resource_cost", "aura_get_resource_cost"); - - ClassDB::bind_method(D_METHOD("aura_get_resource_give"), &Aura::aura_get_resource_give); - ClassDB::bind_method(D_METHOD("aura_set_resource_give", "value"), &Aura::aura_set_resource_give); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_resource_give", PROPERTY_HINT_RESOURCE_TYPE, "EntityResourceCostData"), "aura_set_resource_give", "aura_get_resource_give"); - - ADD_GROUP("Aura States", "aura_states"); - ClassDB::bind_method(D_METHOD("aura_get_add_states"), &Aura::aura_get_add_states); - ClassDB::bind_method(D_METHOD("aura_set_add_states", "value"), &Aura::aura_set_add_states); - ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_states_add", PROPERTY_HINT_FLAGS, EntityEnums::BINDING_STRING_ENTITY_STATE_TYPES), "aura_set_add_states", "aura_get_add_states"); - - ClassDB::bind_method(D_METHOD("aura_get_remove_effects_with_states"), &Aura::aura_get_remove_effects_with_states); - ClassDB::bind_method(D_METHOD("aura_set_remove_effects_with_states", "value"), &Aura::aura_set_remove_effects_with_states); - ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_states_remove_effects", PROPERTY_HINT_FLAGS, EntityEnums::BINDING_STRING_ENTITY_STATE_TYPES), "aura_set_remove_effects_with_states", "aura_get_remove_effects_with_states"); - - ClassDB::bind_method(D_METHOD("aura_get_supress_states"), &Aura::aura_get_supress_states); - ClassDB::bind_method(D_METHOD("aura_set_supress_states", "value"), &Aura::aura_set_supress_states); - ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_states_supress", PROPERTY_HINT_FLAGS, EntityEnums::BINDING_STRING_ENTITY_STATE_TYPES), "aura_set_supress_states", "aura_get_supress_states"); - - //Diminishing Returns - ADD_GROUP("Aura Diminishing Returns", "aura_diminishing_return"); - ClassDB::bind_method(D_METHOD("aura_diminishing_return_enabled_get"), &Aura::aura_diminishing_return_enabled_get); - ClassDB::bind_method(D_METHOD("aura_diminishing_return_enabled_set", "value"), &Aura::aura_diminishing_return_enabled_set); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_diminishing_return_enabled"), "aura_diminishing_return_enabled_set", "aura_diminishing_return_enabled_get"); - - ClassDB::bind_method(D_METHOD("aura_diminishing_return_category_get"), &Aura::aura_diminishing_return_category_get); - ClassDB::bind_method(D_METHOD("aura_diminishing_return_category_set", "value"), &Aura::aura_diminishing_return_category_set); - ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_diminishing_return_category", PROPERTY_HINT_ENUM, ""), "aura_diminishing_return_category_set", "aura_diminishing_return_category_get"); - - //// Talents //// - ADD_GROUP("Aura Talent", "aura_talent"); - ClassDB::bind_method(D_METHOD("aura_get_talent_required_talent"), &Aura::aura_get_talent_required_talent); - ClassDB::bind_method(D_METHOD("aura_set_talent_required_talent", "next_rank"), &Aura::aura_set_talent_required_talent); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_talent_required_talent", PROPERTY_HINT_RESOURCE_TYPE, "Aura"), "aura_set_talent_required_talent", "aura_get_talent_required_talent"); - - ClassDB::bind_method(D_METHOD("aura_get_talent_required_spell"), &Aura::aura_get_talent_required_spell); - ClassDB::bind_method(D_METHOD("aura_set_talent_required_spell", "next_rank"), &Aura::aura_set_talent_required_spell); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_talent_required_spell", PROPERTY_HINT_RESOURCE_TYPE, "Spell"), "aura_set_talent_required_spell", "aura_get_talent_required_spell"); - - ADD_GROUP("Aura Teaches", "aura_teaches"); - ClassDB::bind_method(D_METHOD("aura_get_teaches_spell"), &Aura::aura_get_teaches_spell); - ClassDB::bind_method(D_METHOD("aura_set_teaches_spell", "next_rank"), &Aura::aura_set_teaches_spell); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_teaches_spell", PROPERTY_HINT_RESOURCE_TYPE, "Spell"), "aura_set_teaches_spell", "aura_get_teaches_spell"); - - //// Triggers //// - ADD_GROUP("Aura Triggers", "aura_trigger"); - ClassDB::bind_method(D_METHOD("aura_trigger_get_count"), &Aura::aura_trigger_get_count); - ClassDB::bind_method(D_METHOD("aura_trigger_set_count", "count"), &Aura::aura_trigger_set_count); - - ClassDB::bind_method(D_METHOD("aura_trigger_get_notification_type", "index"), &Aura::aura_trigger_get_notification_type); - ClassDB::bind_method(D_METHOD("aura_trigger_set_notification_type", "index", "value"), &Aura::aura_trigger_set_notification_type); - - ClassDB::bind_method(D_METHOD("aura_trigger_get_notification_data", "index"), &Aura::aura_trigger_get_notification_data); - ClassDB::bind_method(D_METHOD("aura_trigger_set_notification_data", "index", "value"), &Aura::aura_trigger_set_notification_data); - - ClassDB::bind_method(D_METHOD("aura_trigger_get_trigger_type", "index"), &Aura::aura_trigger_get_trigger_type); - ClassDB::bind_method(D_METHOD("aura_trigger_set_trigger_type", "index", "value"), &Aura::aura_trigger_set_trigger_type); - - ClassDB::bind_method(D_METHOD("aura_trigger_get_trigger_type_data", "index"), &Aura::aura_trigger_get_trigger_type_data); - ClassDB::bind_method(D_METHOD("aura_trigger_set_trigger_type_data", "index", "value"), &Aura::aura_trigger_set_trigger_type_data); - - ClassDB::bind_method(D_METHOD("aura_trigger_get_spell", "index"), &Aura::aura_trigger_get_spell); - ClassDB::bind_method(D_METHOD("aura_trigger_set_spell", "index", "value"), &Aura::aura_trigger_set_spell); - - ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_trigger_count", PROPERTY_HINT_RANGE, "0," + itos(MAX_TRIGGER_DATA), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), "aura_trigger_set_count", "aura_trigger_get_count"); - - for (int i = 0; i < MAX_TRIGGER_DATA; i++) { - ADD_PROPERTYI(PropertyInfo(Variant::INT, "aura_trigger_" + itos(i) + "/notification_type", PROPERTY_HINT_ENUM, SpellEnums::BINDING_STRING_TRIGGER_NOTIFICATION_TYPE, PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), "aura_trigger_set_notification_type", "aura_trigger_get_notification_type", i); - ADD_PROPERTYI(PropertyInfo(Variant::INT, "aura_trigger_" + itos(i) + "/notification_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "aura_trigger_set_notification_data", "aura_trigger_get_notification_data", i); - ADD_PROPERTYI(PropertyInfo(Variant::INT, "aura_trigger_" + itos(i) + "/trigger_type", PROPERTY_HINT_ENUM, SpellEnums::BINDING_STRING_TRIGGER_TYPE, PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "aura_trigger_set_trigger_type", "aura_trigger_get_trigger_type", i); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "aura_trigger_" + itos(i) + "/trigger_type_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "aura_trigger_set_trigger_type_data", "aura_trigger_get_trigger_type_data", i); - ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "aura_trigger_" + itos(i) + "/spell", PROPERTY_HINT_RESOURCE_TYPE, "Spell", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "aura_trigger_set_spell", "aura_trigger_get_spell", i); - } - - ADD_GROUP("Aura Stat Attributes", "aura_stat_attribute"); - //AuraStatAttributes - ClassDB::bind_method(D_METHOD("aura_stat_attribute_get_count"), &Aura::aura_stat_attribute_get_count); - ClassDB::bind_method(D_METHOD("aura_stat_attribute_set_count", "count"), &Aura::aura_stat_attribute_set_count); - - ClassDB::bind_method(D_METHOD("aura_stat_attribute_get_stat", "index"), &Aura::aura_stat_attribute_get_stat); - ClassDB::bind_method(D_METHOD("aura_stat_attribute_set_stat", "index", "value"), &Aura::aura_stat_attribute_set_stat); - - ClassDB::bind_method(D_METHOD("aura_stat_attribute_get_base_mod", "index"), &Aura::aura_stat_attribute_get_base_mod); - ClassDB::bind_method(D_METHOD("aura_stat_attribute_set_base_mod", "index", "value"), &Aura::aura_stat_attribute_set_base_mod); - - ClassDB::bind_method(D_METHOD("aura_stat_attribute_get_bonus_mod", "index"), &Aura::aura_stat_attribute_get_bonus_mod); - ClassDB::bind_method(D_METHOD("aura_stat_attribute_set_bonus_mod", "index", "value"), &Aura::aura_stat_attribute_set_bonus_mod); - - ClassDB::bind_method(D_METHOD("aura_stat_attribute_get_percent_mod", "index"), &Aura::aura_stat_attribute_get_percent_mod); - ClassDB::bind_method(D_METHOD("aura_stat_attribute_set_percent_mod", "index", "value"), &Aura::aura_stat_attribute_set_percent_mod); - - ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_stat_attribute_count", PROPERTY_HINT_RANGE, "0," + itos(MAX_AURA_STATS), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), "aura_stat_attribute_set_count", "aura_stat_attribute_get_count"); - - for (int i = 0; i < MAX_AURA_STATS; i++) { - ADD_PROPERTYI(PropertyInfo(Variant::INT, "aura_stat_attribute_" + itos(i) + "/stat", PROPERTY_HINT_ENUM, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "aura_stat_attribute_set_stat", "aura_stat_attribute_get_stat", i); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "aura_stat_attribute_" + itos(i) + "/base_mod", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "aura_stat_attribute_set_base_mod", "aura_stat_attribute_get_base_mod", i); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "aura_stat_attribute_" + itos(i) + "/bonus_mod", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "aura_stat_attribute_set_bonus_mod", "aura_stat_attribute_get_bonus_mod", i); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "aura_stat_attribute_" + itos(i) + "/percent_mod", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "aura_stat_attribute_set_percent_mod", "aura_stat_attribute_get_percent_mod", i); - } - - ClassDB::bind_method(D_METHOD("aura_is_talent"), &Aura::aura_is_talent); - - BIND_CONSTANT(MAX_AURA_STATS); - BIND_CONSTANT(MAX_TRIGGER_DATA); -} diff --git a/data/auras/aura.h b/data/auras/aura.h deleted file mode 100644 index 250cfb2..0000000 --- a/data/auras/aura.h +++ /dev/null @@ -1,470 +0,0 @@ -/* -Copyright (c) 2019-2021 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 AURA_H -#define AURA_H - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/io/resource.h" -#else -#include "core/resource.h" -#endif - -#include "scene/resources/curve.h" -#include "scene/resources/texture.h" - -#include "aura_group.h" - -#include "../../entity_enums.h" -#include "../../spell_enums.h" - -#include "../../entities/entity.h" -#include "../../infos/aura_infos.h" - -#include "../../entities/auras/aura_data.h" -#include "../../infos/spell_cast_info.h" -#include "../../pipelines/spell_damage_info.h" -#include "../../pipelines/spell_heal_info.h" - -#include "../spells/spell_effect_visual.h" - -class AuraApplyInfo; -class AuraScript; -class Entity; -class SpellCastInfo; -class EntityResourceCostData; - -class Spell; - -class Aura : public Resource { - GDCLASS(Aura, Resource); - -public: - int get_id() const; - void set_id(const int value); - - int get_rank() const; - void set_rank(const int value); - - Ref get_icon(); - void set_icon(const Ref &value); - - float aura_get_time() const; - void aura_set_time(const float value); - - Ref aura_get_aura_group(); - void aura_set_aura_group(const Ref &value); - - bool aura_get_is_debuff() const; - void aura_set_is_debuff(const bool value); - - float aura_get_tick() const; - void aura_set_tick(const float value); - - SpellEnums::AuraType aura_get_aura_type() const; - void aura_set_aura_type(const SpellEnums::AuraType value); - - bool aura_get_scale_with_level() const; - void aura_set_scale_with_level(const bool value); - - String aura_get_text_translation_key() const; - void aura_set_text_translation_key(const String &value); - - String aura_get_text_description() const; - void aura_set_text_description(const String description); - - bool aura_get_hide() const; - void aura_set_hide(const bool value); - - Ref aura_get_visual_spell_effects(); - void aura_set_visual_spell_effects(const Ref &value); - - int aura_get_ability_scale_data_id() const; - void aura_set_ability_scale_data_id(const int value); - - float aura_damage_get_scale_for_level(int level) const; - float aura_heal_get_scale_for_level(int level) const; - float aura_absorb_get_scale_for_level(int level) const; - - Ref aura_get_teaches_spell(); - void aura_set_teaches_spell(const Ref &spell); - - //Damage - bool aura_damage_get_enabled() const; - void aura_damage_set_enabled(const bool value); - - int aura_damage_get_type() const; - - void aura_damage_set_type(const int value); - - int aura_damage_get_min() const; - void aura_damage_set_min(const int value); - - int aura_damage_get_max() const; - void aura_damage_set_max(const int value); - - bool aura_damage_get_can_crit() const; - void aura_damage_set_can_crit(const bool value); - - void aura_damage_set(const int min, const int max, const bool can_crit); - - //Absorb - bool aura_absorb_get_enabled() const; - void aura_absorb_set_enabled(const bool value); - - int aura_absorb_damage_get_type() const; - void aura_absorb_damage_set_type(const int value); - - int aura_absorb_get_min() const; - void aura_absorb_set_min(const int value); - - int aura_absorb_get_max() const; - void aura_absorb_set_max(const int value); - - //Heal - bool aura_heal_get_enabled() const; - void aura_heal_set_enabled(const bool value); - - int aura_heal_get_min() const; - void aura_heal_set_min(const int value); - - int aura_heal_get_max() const; - void aura_heal_set_max(const int value); - - bool aura_heal_get_can_crit() const; - void aura_heal_set_can_crit(const bool value); - - void aura_heal_set(const int min, const int max, const bool can_crit); - - //Dispells - bool aura_dispell_get_enabled() const; - void aura_dispell_set_enabled(const bool value); - - int aura_dispell_get_count_min() const; - void aura_dispell_set_count_min(const int value); - - int aura_dispell_get_count_max() const; - void aura_dispell_set_count_max(const int value); - - int aura_dispell_get_aura_types() const; - void aura_dispell_set_aura_types(const int value); - - //Resources - Ref aura_get_resource_cost(); - void aura_set_resource_cost(const Ref &value); - - Ref aura_get_resource_give(); - void aura_set_resource_give(const Ref &value); - - Ref aura_damage_get_scaling_curve() { return _aura_damage_scaling_curve; } - void aura_damage_set_scaling_curve(const Ref &curve) { _aura_damage_scaling_curve = curve; } - - Ref aura_heal_get_scaling_curve() { return _aura_heal_scaling_curve; } - void aura_heal_set_scaling_curve(const Ref &curve) { _aura_heal_scaling_curve = curve; } - - Ref aura_absorb_get_scaling_curve() { return _aura_absorb_scaling_curve; } - void aura_absorb_set_scaling_curve(const Ref &curve) { _aura_absorb_scaling_curve = curve; } - - //states - int aura_get_add_states() const { return _aura_add_states; } - void aura_set_add_states(const int value) { _aura_add_states = value; } - - int aura_get_remove_effects_with_states() const { return _aura_remove_effects_with_states; } - void aura_set_remove_effects_with_states(const int value) { _aura_remove_effects_with_states = value; } - - int aura_get_supress_states() const { return _aura_supress_states; } - void aura_set_supress_states(const int value) { _aura_supress_states = value; } - - //DiminishingReturns - bool aura_diminishing_return_enabled_get() const; - void aura_diminishing_return_enabled_set(const bool value); - - int aura_diminishing_return_category_get() const; - void aura_diminishing_return_category_set(const int value); - - //Triggers - int aura_trigger_get_count() const; - void aura_trigger_set_count(const int count); - - SpellEnums::TriggerNotificationType aura_trigger_get_notification_type(const int index) const; - void aura_trigger_set_notification_type(const int index, const SpellEnums::TriggerNotificationType value); - - int aura_trigger_get_notification_data(const int index) const; - void aura_trigger_set_notification_data(const int index, const int value); - - SpellEnums::TriggerType aura_trigger_get_trigger_type(const int index) const; - void aura_trigger_set_trigger_type(const int index, const SpellEnums::TriggerType value); - - float aura_trigger_get_trigger_type_data(const int index) const; - void aura_trigger_set_trigger_type_data(const int index, const float value); - - Ref aura_trigger_get_spell(const int index) const; - void aura_trigger_set_spell(const int index, const Ref &value); - - //Talent - Ref aura_get_talent_required_talent() const; - void aura_set_talent_required_talent(const Ref rank); - - Ref aura_get_talent_required_spell() const; - void aura_set_talent_required_spell(const Ref spell); - - //AuraStatAttributes - int aura_stat_attribute_get_count() const; - void aura_stat_attribute_set_count(int count); - - int aura_stat_attribute_get_stat(int index) const; - void aura_stat_attribute_set_stat(int index, const int value); - - float aura_stat_attribute_get_base_mod(int index) const; - void aura_stat_attribute_set_base_mod(int index, float value); - - float aura_stat_attribute_get_bonus_mod(int index) const; - void aura_stat_attribute_set_bonus_mod(int index, float value); - - float aura_stat_attribute_get_percent_mod(int index) const; - void aura_stat_attribute_set_percent_mod(int index, float value); - - //// SpellSystem //// - - //Commands, c++ only - void aura_sapply_simple(Entity *caster, Entity *target, float spell_scale); - - //Commands - void aura_sapply(Ref info); - void aura_sdeapply(Ref info); - void aura_sadd(Ref aura); - void aura_sremove(Ref aura); - void aura_removes_expired(Ref aura); - void aura_removes_dispell(Ref aura); - void aura_supdate(Ref aura, float delta); - - //EventHandlers - void notification_saura(int what, Ref data); - void notification_sheal(int what, Ref aura, Ref data); - void notification_scast(int what, Ref aura, Ref info); - void notification_sdamage(int what, Ref aura, Ref data); - - void son_remove(Ref aura); - void son_remove_expired(Ref aura); - void son_remove_dispell(Ref aura); - - void notification_sdeath(Ref data); - - void notification_scooldown_added(Ref data, int id, float value); - void notification_scooldown_removed(Ref data, int id, float value); - - void notification_scategory_cooldown_added(Ref data, int id, float value); - void notification_scategory_cooldown_removed(Ref data, int id, float value); - - void notification_sgcd_started(Ref data, float gcd); - void notification_sgcd_finished(Ref data); - - void son_physics_process(Ref data); - - void notification_sxp_gained(Ref data, int value); - void notification_slevel_up(Ref data, int value); - - void notification_sentity_resource_added(Ref data, Ref resource); - void notification_sentity_resource_removed(Ref data, Ref resource); - - //Clientside Event Handlers - void notification_caura(int what, Ref data); - void notification_cheal(int what, Ref aura, Ref data); - void notification_ccast(int what, Ref aura, Ref info); - void notification_cdamage(int what, Ref aura, Ref data); - - void notification_cdeath(Ref data); - - void notification_ccooldown_added(Ref data, int id, float value); - void notification_ccooldown_removed(Ref data, int id, float value); - void notification_ccategory_cooldown_added(Ref data, int id, float value); - void notification_ccategory_cooldown_removed(Ref data, int id, float value); - - void notification_cgcd_started(Ref data, float gcd); - void notification_cgcd_finished(Ref data); - - void notification_cxp_gained(Ref data, int value); - void notification_clevel_up(Ref data, int value); - - void notification_centity_resource_added(Ref data, Ref resource); - void notification_centity_resource_removed(Ref data, Ref resource); - - //Equipment - bool equip_should_deny(Ref data, int equip_slot, Ref item); - - void equip_son_success(Ref data, int equip_slot, Ref item, Ref old_item, int bag_slot); - void equip_son_fail(Ref data, int equip_slot, Ref item, Ref old_item, int bag_slot); - - void equip_con_success(Ref data, int equip_slot, Ref item, Ref old_item, int bag_slot); - void equip_con_fail(Ref data, int equip_slot, Ref item, Ref old_item, int bag_slot); - - //Calculations / Queries - void setup_aura_data(Ref data, Ref info); - - void aura_sapply_passives_damage_receive(Ref info); - void aura_sapply_passives_damage_deal(Ref info); - void aura_calculate_initial_damage(Ref aura_data, Ref info); - void handle_aura_damage(Ref aura_data, Ref info); - - void aura_sapply_passives_heal_receive(Ref info); - void aura_sapply_passives_heal_deal(Ref info); - void aura_calculate_initial_heal(Ref aura_data, Ref info); - void handle_aura_heal(Ref aura_data, Ref info); - - _FORCE_INLINE_ bool aura_is_talent() const { return _aura_type == SpellEnums::AURA_TYPE_TALENT; } - - String aura_get_name_translated() const; - String aura_get_description(const int class_level, const int character_level); - String _aura_get_description(const int class_level, const int character_level); - - Aura(); - ~Aura(); - -protected: - virtual void _aura_sapply(Ref info); - virtual void _aura_sdeapply(Ref info); - virtual void _aura_sadd(Ref aura); - virtual void _aura_sremove(Ref aura); - virtual void _aura_removes_expired(Ref aura); - virtual void _aura_removes_dispell(Ref aura); - virtual void _aura_supdate(Ref aura, float delta); - - virtual void _setup_aura_data(Ref data, Ref info); - - virtual void _aura_sapply_passives_damage_receive(Ref info); - virtual void _aura_sapply_passives_damage_deal(Ref info); - virtual void _aura_calculate_initial_damage(Ref aura_data, Ref info); - virtual void _handle_aura_damage(Ref aura_data, Ref info); - - virtual void _aura_sapply_passives_heal_receive(Ref info); - virtual void _aura_sapply_passives_heal_deal(Ref info); - virtual void _aura_calculate_initial_heal(Ref aura_data, Ref info); - virtual void _handle_aura_heal(Ref aura_data, Ref info); - - static void _bind_methods(); - void _validate_property(PropertyInfo &property) const; - -protected: - struct AuraTriggerData { - SpellEnums::TriggerNotificationType notification_type; - int notification_data; - SpellEnums::TriggerType trigger_type; - float trigger_type_data; - Ref spell; - - AuraTriggerData() { - notification_type = SpellEnums::TRIGGER_NOTIFICATION_TYPE_AURA; - trigger_type = SpellEnums::TRIGGER_TYPE_NONE; - notification_data = 0; - trigger_type_data = 0; - } - }; - - struct AuraStatAttribute { - int stat; - float base_mod; - float bonus_mod; - float percent_mod; - - AuraStatAttribute() { - stat = 0; - base_mod = 0; - bonus_mod = 0; - percent_mod = 0; - } - }; - -private: - enum { - MAX_AURA_STATS = 5, //Increase if necessary, should be enough for now - MAX_TRIGGER_DATA = 5, - }; - - int _id; - int _rank; - Ref _icon; - - float _aura_time; - float _aura_tick; - Ref _aura_group; - - SpellEnums::AuraType _aura_type; - bool _aura_is_debuff; - bool _aura_hide; - Ref _aura_teaches_spell; - - String _aura_text_translation_key; - String _aura_text_description; - int _aura_ability_scale_data_id; - - bool _aura_scale_with_level; - - Ref _aura_visual_spell_effects; - - bool _aura_damage_enabled; - int _aura_damage_type; - int _aura_damage_min; - int _aura_damage_max; - bool _aura_damage_can_crit; - Ref _aura_damage_scaling_curve; - - bool _aura_absorb_enabled; - int _aura_absorb_damage_type; - int _aura_absorb_min; - int _aura_absorb_max; - Ref _aura_absorb_scaling_curve; - - bool _aura_heal_enabled; - int _aura_heal_min; - int _aura_heal_max; - bool _aura_heal_can_crit; - Ref _aura_heal_scaling_curve; - - bool _aura_dispell_enabled; - int _aura_dispell_count_min; - int _aura_dispell_count_max; - int _aura_dispell_aura_types; - - Ref _aura_resource_cost; - Ref _aura_resource_give; - - int _aura_add_states; - int _aura_remove_effects_with_states; - int _aura_supress_states; - - int _aura_trigger_count; - AuraTriggerData _aura_trigger_datas[MAX_TRIGGER_DATA]; - - int _aura_stat_attribute_count; - AuraStatAttribute _aura_stat_attributes[MAX_AURA_STATS]; - - bool _aura_diminishing_return_enabled; - int _aura_diminishing_return_category; - - //Talent - Ref _aura_talent_required_talent; - Ref _aura_talent_required_spell; -}; - -#endif diff --git a/data/items/item_template.cpp b/data/items/item_template.cpp index cfd6d24..1840fb4 100644 --- a/data/items/item_template.cpp +++ b/data/items/item_template.cpp @@ -23,7 +23,6 @@ SOFTWARE. #include "item_template.h" #include "../../entities/data/entity_class_data.h" -#include "../auras/aura.h" #include "../spells/spell.h" #include "item_instance.h" @@ -220,22 +219,22 @@ void ItemTemplate::set_num_auras(int value) { _auras.resize(value); } -Ref ItemTemplate::get_aura(const int index) { - ERR_FAIL_INDEX_V(index, _auras.size(), Ref()); +Ref ItemTemplate::get_aura(const int index) { + ERR_FAIL_INDEX_V(index, _auras.size(), Ref()); return _auras[index]; } -void ItemTemplate::set_aura(const int index, const Ref &aura) { +void ItemTemplate::set_aura(const int index, const Ref &aura) { ERR_FAIL_INDEX(index, _auras.size()); - _auras.set(index, Ref(aura)); + _auras.set(index, Ref(aura)); } Vector ItemTemplate::get_auras() { VARIANT_ARRAY_GET(_auras); } void ItemTemplate::set_auras(const Vector &auras) { - VARIANT_ARRAY_SET(auras, _auras, Aura); + VARIANT_ARRAY_SET(auras, _auras, Spell); } //Required Skills @@ -243,12 +242,12 @@ int ItemTemplate::get_num_required_skills() const { return _required_skills.size(); } -Ref ItemTemplate::get_required_skill(const int index) { - ERR_FAIL_INDEX_V(index, _required_skills.size(), Ref()); +Ref ItemTemplate::get_required_skill(const int index) { + ERR_FAIL_INDEX_V(index, _required_skills.size(), Ref()); return _required_skills.get(index); } -void ItemTemplate::set_required_skill(const int index, const Ref &aura) { +void ItemTemplate::set_required_skill(const int index, const Ref &aura) { ERR_FAIL_INDEX(index, _required_skills.size()); _required_skills.set(index, aura); @@ -258,7 +257,7 @@ Vector ItemTemplate::get_required_skills() { VARIANT_ARRAY_GET(_required_skills); } void ItemTemplate::set_required_skills(const Vector &skills) { - VARIANT_ARRAY_SET(skills, _required_skills, Aura); + VARIANT_ARRAY_SET(skills, _required_skills, Spell); } //use spell @@ -537,7 +536,7 @@ void ItemTemplate::_bind_methods() { ClassDB::bind_method(D_METHOD("get_auras"), &ItemTemplate::get_auras); ClassDB::bind_method(D_METHOD("set_auras", "auras"), &ItemTemplate::set_auras); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "auras", PROPERTY_HINT_NONE, "17/17:Aura", PROPERTY_USAGE_DEFAULT, "Aura"), "set_auras", "get_auras"); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "auras", PROPERTY_HINT_NONE, "17/17:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_auras", "get_auras"); //// Required Skills //// ClassDB::bind_method(D_METHOD("get_num_required_skills"), &ItemTemplate::get_num_required_skills); @@ -547,7 +546,7 @@ void ItemTemplate::_bind_methods() { ClassDB::bind_method(D_METHOD("get_required_skills"), &ItemTemplate::get_required_skills); ClassDB::bind_method(D_METHOD("set_required_skills", "auras"), &ItemTemplate::set_required_skills); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "required_skills", PROPERTY_HINT_NONE, "17/17:Aura", PROPERTY_USAGE_DEFAULT, "Aura"), "set_required_skills", "get_required_skills"); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "required_skills", PROPERTY_HINT_NONE, "17/17:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_required_skills", "get_required_skills"); //Use spell ClassDB::bind_method(D_METHOD("get_use_spell"), &ItemTemplate::get_use_spell); diff --git a/data/items/item_template.h b/data/items/item_template.h index b072eda..cc5c13a 100644 --- a/data/items/item_template.h +++ b/data/items/item_template.h @@ -39,7 +39,6 @@ SOFTWARE. #include "model_visual.h" class ItemInstance; -class Aura; class Spell; class EntityClassData; @@ -122,8 +121,8 @@ public: int get_num_auras() const; void set_num_auras(const int value); - Ref get_aura(const int index); - void set_aura(const int index, const Ref &aura); + Ref get_aura(const int index); + void set_aura(const int index, const Ref &aura); Vector get_auras(); void set_auras(const Vector &auras); @@ -131,8 +130,8 @@ public: //Required Skills int get_num_required_skills() const; - Ref get_required_skill(const int index); - void set_required_skill(const int index, const Ref &skills); + Ref get_required_skill(const int index); + void set_required_skill(const int index, const Ref &skills); Vector get_required_skills(); void set_required_skills(const Vector &grants_spells); @@ -186,7 +185,7 @@ public: public: struct SkillEntry { - Ref aura; + Ref aura; int level; }; @@ -253,8 +252,8 @@ private: Vector > _teaches_spells; Vector > _grants_spells; - Vector > _auras; - Vector > _required_skills; + Vector > _auras; + Vector > _required_skills; Ref _use_spell; int _charges; bool _consumed; diff --git a/data/species/entity_species_data.cpp b/data/species/entity_species_data.cpp index 6203cc1..654341f 100644 --- a/data/species/entity_species_data.cpp +++ b/data/species/entity_species_data.cpp @@ -22,7 +22,6 @@ SOFTWARE. #include "entity_species_data.h" -#include "../auras/aura.h" #include "../spells/spell.h" #include "../../singletons/ess.h" @@ -116,17 +115,17 @@ void EntitySpeciesData::set_spells(const Vector &spells) { //Auras -Ref EntitySpeciesData::get_aura(const int index) const { - ERR_FAIL_INDEX_V(index, _auras.size(), Ref()); +Ref EntitySpeciesData::get_aura(const int index) const { + ERR_FAIL_INDEX_V(index, _auras.size(), Ref()); return _auras.get(index); } -void EntitySpeciesData::set_aura(const int index, const Ref &aura) { +void EntitySpeciesData::set_aura(const int index, const Ref &aura) { ERR_FAIL_INDEX(index, _auras.size()); _auras.set(index, aura); } -void EntitySpeciesData::add_aura(const Ref &aura) { +void EntitySpeciesData::add_aura(const Ref &aura) { _auras.push_back(aura); } void EntitySpeciesData::remove_aura(const int index) { @@ -145,7 +144,7 @@ Vector EntitySpeciesData::get_auras() { void EntitySpeciesData::set_auras(const Vector &auras) { _auras.clear(); for (int i = 0; i < auras.size(); i++) { - Ref aura = Ref(auras[i]); + Ref aura = Ref(auras[i]); _auras.push_back(aura); } @@ -229,5 +228,5 @@ void EntitySpeciesData::_bind_methods() { ClassDB::bind_method(D_METHOD("get_auras"), &EntitySpeciesData::get_auras); ClassDB::bind_method(D_METHOD("set_auras", "auras"), &EntitySpeciesData::set_auras); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "auras", PROPERTY_HINT_NONE, "17/17:Aura", PROPERTY_USAGE_DEFAULT, "Aura"), "set_auras", "get_auras"); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "auras", PROPERTY_HINT_NONE, "17/17:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_auras", "get_auras"); } diff --git a/data/species/entity_species_data.h b/data/species/entity_species_data.h index 0c5d948..7df3909 100644 --- a/data/species/entity_species_data.h +++ b/data/species/entity_species_data.h @@ -40,7 +40,6 @@ SOFTWARE. #include "species_model_data.h" class Spell; -class Aura; class EntitySpeciesData : public Resource { GDCLASS(EntitySpeciesData, Resource); @@ -78,9 +77,9 @@ public: void set_spells(const Vector &spells); //Auras - Ref get_aura(const int index) const; - void set_aura(const int index, const Ref &aura); - void add_aura(const Ref &aura); + Ref get_aura(const int index) const; + void set_aura(const int index, const Ref &aura); + void add_aura(const Ref &aura); void remove_aura(const int index); int get_aura_count() const; @@ -104,7 +103,7 @@ private: Vector > _model_datas; Vector > _spells; - Vector > _auras; + Vector > _auras; }; #endif diff --git a/data/spells/spell.cpp b/data/spells/spell.cpp index 081447e..9dd98be 100644 --- a/data/spells/spell.cpp +++ b/data/spells/spell.cpp @@ -22,12 +22,15 @@ SOFTWARE. #include "spell.h" +#include "../../entities/auras/aura_data.h" #include "../../entities/resources/entity_resource_cost_data.h" #include "../../entities/skills/entity_skill_data.h" -#include "../auras/aura.h" #include "../items/craft_recipe.h" #include "../../entities/auras/aura_data.h" +#include "../auras/aura_group.h" +#include "../../infos/aura_infos.h" +#include "../../entities/data/entity_data.h" #include "../../singletons/ess.h" @@ -192,22 +195,22 @@ void Spell::spells_cast_on_caster_num_set(const int value) { _spells_cast_on_caster.resize(value); } -Ref Spell::spell_cast_on_caster_get(const int index) { - ERR_FAIL_INDEX_V(index, _spells_cast_on_caster.size(), Ref()); +Ref Spell::spell_cast_on_caster_get(const int index) { + ERR_FAIL_INDEX_V(index, _spells_cast_on_caster.size(), Ref()); return _spells_cast_on_caster[index]; } -void Spell::spell_cast_on_caster_set(const int index, const Ref &spell) { +void Spell::spell_cast_on_caster_set(const int index, const Ref &spell) { ERR_FAIL_INDEX(index, _spells_cast_on_caster.size()); - _spells_cast_on_caster.set(index, Ref(spell)); + _spells_cast_on_caster.set(index, Ref(spell)); } Vector Spell::spells_cast_on_caster_get() { VARIANT_ARRAY_GET(_spells_cast_on_caster); } void Spell::spells_cast_on_caster_set(const Vector &spells) { - VARIANT_ARRAY_SET(spells, _spells_cast_on_caster, Aura); + VARIANT_ARRAY_SET(spells, _spells_cast_on_caster, Spell); } //// Target Aura Apply //// @@ -219,22 +222,22 @@ void Spell::spells_cast_on_target_num_set(const int value) { _spells_cast_on_target.resize(value); } -Ref Spell::spell_cast_on_target_get(const int index) { - ERR_FAIL_INDEX_V(index, _spells_cast_on_target.size(), Ref()); +Ref Spell::spell_cast_on_target_get(const int index) { + ERR_FAIL_INDEX_V(index, _spells_cast_on_target.size(), Ref()); return _spells_cast_on_target[index]; } -void Spell::spell_cast_on_target_set(const int index, const Ref &spell) { +void Spell::spell_cast_on_target_set(const int index, const Ref &spell) { ERR_FAIL_INDEX(index, _spells_cast_on_target.size()); - _spells_cast_on_target.set(index, Ref(spell)); + _spells_cast_on_target.set(index, Ref(spell)); } Vector Spell::spells_cast_on_target_get() { VARIANT_ARRAY_GET(_spells_cast_on_target); } void Spell::spells_cast_on_target_set(const Vector &spells) { - VARIANT_ARRAY_SET(spells, _spells_cast_on_target, Aura); + VARIANT_ARRAY_SET(spells, _spells_cast_on_target, Spell); } //// Apply Auras On Learn //// @@ -246,22 +249,22 @@ void Spell::on_learn_cast_spells_num_set(const int value) { _on_learn_cast_spells.resize(value); } -Ref Spell::spell_cast_on_learn_get(int index) { - ERR_FAIL_INDEX_V(index, _on_learn_cast_spells.size(), Ref()); +Ref Spell::spell_cast_on_learn_get(int index) { + ERR_FAIL_INDEX_V(index, _on_learn_cast_spells.size(), Ref()); return _on_learn_cast_spells[index]; } -void Spell::spell_cast_on_learn_set(const int index, const Ref &spell) { +void Spell::spell_cast_on_learn_set(const int index, const Ref &spell) { ERR_FAIL_INDEX(index, _on_learn_cast_spells.size()); - _on_learn_cast_spells.set(index, Ref(spell)); + _on_learn_cast_spells.set(index, Ref(spell)); } Vector Spell::spells_cast_on_learn_get() { VARIANT_ARRAY_GET(_on_learn_cast_spells); } void Spell::spells_cast_on_learn_set(const Vector &spells) { - VARIANT_ARRAY_SET(spells, _on_learn_cast_spells, Aura); + VARIANT_ARRAY_SET(spells, _on_learn_cast_spells, Spell); } //// Range //// @@ -532,6 +535,427 @@ void Spell::set_training_required_skill_level(const int value) { _training_required_skill_level = value; } +// Aura + +float Spell::aura_get_time() const { + return _aura_time; +} +void Spell::aura_set_time(const float value) { + _aura_time = value; +} + +float Spell::aura_get_tick() const { + return _aura_tick; +} +void Spell::aura_set_tick(const float value) { + _aura_tick = value; +} + +Ref Spell::aura_get_aura_group() { + return _aura_group; +} +void Spell::aura_set_aura_group(const Ref &value) { + _aura_group = value; +} + +bool Spell::aura_get_is_debuff() const { + return _aura_is_debuff; +} +void Spell::aura_set_is_debuff(const bool value) { + _aura_is_debuff = value; +} + +SpellEnums::AuraType Spell::aura_get_aura_type() const { + return _aura_type; +} +void Spell::aura_set_aura_type(SpellEnums::AuraType value) { + _aura_type = value; +} + +bool Spell::aura_get_scale_with_level() const { + return _aura_scale_with_level; +} +void Spell::aura_set_scale_with_level(const bool value) { + _aura_scale_with_level = value; +} + +String Spell::aura_get_text_translation_key() const { + return _aura_text_translation_key; +} +void Spell::aura_set_text_translation_key(const String &value) { + _aura_text_translation_key = value; +} + +String Spell::aura_get_text_description() const { + return _aura_text_description; +} +void Spell::aura_set_text_description(const String description) { + _aura_text_description = description; +} + +bool Spell::aura_get_hide() const { + return _aura_hide; +} +void Spell::aura_set_hide(const bool value) { + _aura_hide = value; +} + +Ref Spell::aura_get_visual_spell_effects() { + return _aura_visual_spell_effects; +} +void Spell::aura_set_visual_spell_effects(const Ref &value) { + _aura_visual_spell_effects = value; +} + +int Spell::aura_get_ability_scale_data_id() const { + return _aura_ability_scale_data_id; +} +void Spell::aura_set_ability_scale_data_id(const int value) { + _aura_ability_scale_data_id = value; +} + +float Spell::aura_damage_get_scale_for_level(const int level) const { + //return this->getDamageLevelScaling()->Evaluate((float)(level)); + return 1; +} +float Spell::aura_heal_get_scale_for_level(const int level) const { + //return this->getHealLevelScaling()->Evaluate((float)(level)); + return 1; +} + +float Spell::aura_absorb_get_scale_for_level(const int level) const { + //return this->getAbsorbLevelScaling()->Evaluate((float)(level)); + return 1; +} + +bool Spell::aura_diminishing_return_enabled_get() const { + return _aura_diminishing_return_enabled; +} +void Spell::aura_diminishing_return_enabled_set(const bool value) { + _aura_diminishing_return_enabled = value; +} + +int Spell::aura_diminishing_return_category_get() const { + return _aura_diminishing_return_category; +} +void Spell::aura_diminishing_return_category_set(const int value) { + _aura_diminishing_return_category = value; +} + +Ref Spell::aura_get_teaches_spell() { + return _aura_teaches_spell; +} +void Spell::aura_set_teaches_spell(const Ref &spell) { + _aura_teaches_spell = spell; +} + +/* +void Spell::SetScalingData(AbilityScalingData *scalingData) { +scalingData->getDamageCurve(); +scalingData->getAbsorbCurve(); +scalingData->getHealingCurve(); +}*/ +/* +void Spell::OnAuraAbilityScalingDataLoaded(AbilityScalingDataLoaderHelper *h) { +this->SetScalingData(h->getData()); +} +*/ + +//Damage +bool Spell::aura_damage_get_enabled() const { + return _aura_damage_enabled; +} +void Spell::aura_damage_set_enabled(const bool value) { + _aura_damage_enabled = value; +} + +int Spell::aura_damage_get_type() const { + return _aura_damage_type; +} + +void Spell::aura_damage_set_type(const int value) { + _aura_damage_type = value; +} + +int Spell::aura_damage_get_min() const { + return _aura_damage_min; +} +void Spell::aura_damage_set_min(const int value) { + _aura_damage_min = value; +} + +int Spell::aura_damage_get_max() const { + return _aura_damage_max; +} +void Spell::aura_damage_set_max(const int value) { + _aura_damage_max = value; +} + +bool Spell::aura_damage_get_can_crit() const { + return _aura_damage_can_crit; +} +void Spell::aura_damage_set_can_crit(const bool value) { + _aura_damage_can_crit = value; +} + +void Spell::aura_damage_set(const int min, const int max, const bool can_crit) { + aura_damage_set_enabled(true); + aura_damage_set_min(min); + aura_damage_set_max(max); + aura_damage_set_can_crit(can_crit); +} + +//Absorb +bool Spell::aura_absorb_get_enabled() const { + return _aura_absorb_enabled; +} +void Spell::aura_absorb_set_enabled(const bool value) { + _aura_absorb_enabled = value; +} + +int Spell::aura_absorb_damage_get_type() const { + return _aura_absorb_damage_type; +} + +void Spell::aura_absorb_damage_set_type(const int value) { + _aura_absorb_damage_type = value; +} + +int Spell::aura_absorb_get_min() const { + return _aura_absorb_min; +} +void Spell::aura_absorb_set_min(const int value) { + _aura_absorb_min = value; +} + +int Spell::aura_absorb_get_max() const { + return _aura_absorb_max; +} +void Spell::aura_absorb_set_max(const int value) { + _aura_absorb_max = value; +} + +//Heal +bool Spell::aura_heal_get_enabled() const { + return _aura_heal_enabled; +} +void Spell::aura_heal_set_enabled(const bool value) { + _aura_heal_enabled = value; +} + +int Spell::aura_heal_get_min() const { + return _aura_heal_min; +} +void Spell::aura_heal_set_min(const int value) { + _aura_heal_min = value; +} + +int Spell::aura_heal_get_max() const { + return _aura_heal_max; +} +void Spell::aura_heal_set_max(const int value) { + _aura_heal_max = value; +} + +bool Spell::aura_heal_get_can_crit() const { + return _aura_heal_can_crit; +} +void Spell::aura_heal_set_can_crit(const bool value) { + _aura_heal_can_crit = value; +} + +void Spell::aura_heal_set(const int min, const int max, const bool can_crit) { + aura_heal_set_enabled(true); + aura_heal_set_min(min); + aura_heal_set_max(max); + aura_heal_set_can_crit(can_crit); +} + +//Dispell +bool Spell::aura_dispell_get_enabled() const { + return _aura_dispell_enabled; +} +void Spell::aura_dispell_set_enabled(const bool value) { + _aura_dispell_enabled = value; +} + +int Spell::aura_dispell_get_count_min() const { + return _aura_dispell_count_min; +} +void Spell::aura_dispell_set_count_min(const int value) { + _aura_dispell_count_min = value; +} + +int Spell::aura_dispell_get_count_max() const { + return _aura_dispell_count_max; +} +void Spell::aura_dispell_set_count_max(const int value) { + _aura_dispell_count_max = value; +} + +int Spell::aura_dispell_get_aura_types() const { + return _aura_dispell_aura_types; +} +void Spell::aura_dispell_set_aura_types(const int value) { + _aura_dispell_aura_types = value; +} + +Ref Spell::aura_get_resource_cost() { + return _aura_resource_cost; +} +void Spell::aura_set_resource_cost(const Ref &value) { + _aura_resource_cost = value; +} + +Ref Spell::aura_get_resource_give() { + return _aura_resource_give; +} +void Spell::aura_set_resource_give(const Ref &value) { + _aura_resource_give = value; +} + +////// Triggers /////// + +int Spell::aura_trigger_get_count() const { + return _aura_trigger_count; +} + +void Spell::aura_trigger_set_count(const int count) { + ERR_FAIL_COND(count < 0 || count > MAX_TRIGGER_DATA); + + _aura_trigger_count = count; +} + +SpellEnums::TriggerNotificationType Spell::aura_trigger_get_notification_type(const int index) const { + ERR_FAIL_INDEX_V(index, _aura_trigger_count, SpellEnums::TRIGGER_NOTIFICATION_TYPE_AURA); + + return _aura_trigger_datas[index].notification_type; +} + +void Spell::aura_trigger_set_notification_type(const int index, const SpellEnums::TriggerNotificationType value) { + ERR_FAIL_COND(index < 0 || index > _aura_trigger_count); + + _aura_trigger_datas[index].notification_type = value; +} + +int Spell::aura_trigger_get_notification_data(const int index) const { + ERR_FAIL_INDEX_V(index, _aura_trigger_count, 0); + + return _aura_trigger_datas[index].notification_data; +} + +void Spell::aura_trigger_set_notification_data(const int index, const int value) { + ERR_FAIL_COND(index < 0 || index > _aura_trigger_count); + + _aura_trigger_datas[index].notification_data = value; +} + +SpellEnums::TriggerType Spell::aura_trigger_get_trigger_type(const int index) const { + ERR_FAIL_INDEX_V(index, _aura_trigger_count, SpellEnums::TRIGGER_TYPE_NONE); + + return _aura_trigger_datas[index].trigger_type; +} + +void Spell::aura_trigger_set_trigger_type(const int index, const SpellEnums::TriggerType value) { + ERR_FAIL_COND(index < 0 || index > _aura_trigger_count); + + _aura_trigger_datas[index].trigger_type = value; +} + +float Spell::aura_trigger_get_trigger_type_data(const int index) const { + ERR_FAIL_INDEX_V(index, _aura_trigger_count, 0); + + return _aura_trigger_datas[index].trigger_type_data; +} + +void Spell::aura_trigger_set_trigger_type_data(const int index, const float value) { + ERR_FAIL_COND(index < 0 || index > _aura_trigger_count); + + _aura_trigger_datas[index].trigger_type_data = value; +} + +Ref Spell::aura_trigger_get_spell(const int index) const { + ERR_FAIL_INDEX_V(index, _aura_trigger_count, Ref()); + + return _aura_trigger_datas[index].spell; +} + +void Spell::aura_trigger_set_spell(const int index, const Ref &value) { + ERR_FAIL_COND(index < 0 || index > _aura_trigger_count); + + _aura_trigger_datas[index].spell = value; +} + +//// Talent //// +Ref Spell::aura_get_talent_required_talent() const { + return _aura_talent_required_talent; +} +void Spell::aura_set_talent_required_talent(const Ref rank) { + _aura_talent_required_talent = rank; +} + +Ref Spell::aura_get_talent_required_spell() const { + return _aura_talent_required_talent; +} +void Spell::aura_set_talent_required_spell(const Ref spell) { + _aura_talent_required_spell = spell; +} + +////// Aura Stat Attributes ////// + +int Spell::aura_stat_attribute_get_count() const { + return _aura_stat_attribute_count; +} +void Spell::aura_stat_attribute_set_count(int count) { + ERR_FAIL_COND(count < 0 || count > MAX_AURA_STATS); + + _aura_stat_attribute_count = count; +} + +int Spell::aura_stat_attribute_get_stat(int index) const { + ERR_FAIL_INDEX_V(index, MAX_AURA_STATS, 0); + + return _aura_stat_attributes[index].stat; +} +void Spell::aura_stat_attribute_set_stat(int index, const int value) { + ERR_FAIL_INDEX(index, MAX_AURA_STATS); + + _aura_stat_attributes[index].stat = value; +} + +float Spell::aura_stat_attribute_get_base_mod(int index) const { + ERR_FAIL_INDEX_V(index, MAX_AURA_STATS, 0); + + return _aura_stat_attributes[index].base_mod; +} +void Spell::aura_stat_attribute_set_base_mod(int index, float value) { + ERR_FAIL_INDEX(index, MAX_AURA_STATS); + + _aura_stat_attributes[index].base_mod = value; +} + +float Spell::aura_stat_attribute_get_bonus_mod(int index) const { + ERR_FAIL_INDEX_V(index, MAX_AURA_STATS, 0); + + return _aura_stat_attributes[index].bonus_mod; +} +void Spell::aura_stat_attribute_set_bonus_mod(int index, float value) { + ERR_FAIL_INDEX(index, MAX_AURA_STATS); + + _aura_stat_attributes[index].bonus_mod = value; +} + +float Spell::aura_stat_attribute_get_percent_mod(int index) const { + ERR_FAIL_INDEX_V(index, MAX_AURA_STATS, 0); + + return _aura_stat_attributes[index].percent_mod; +} +void Spell::aura_stat_attribute_set_percent_mod(int index, float value) { + ERR_FAIL_INDEX(index, MAX_AURA_STATS); + + _aura_stat_attributes[index].percent_mod = value; +} + //// Spell System //// void Spell::cast_starts_simple(Entity *caster, float spell_scale) { @@ -571,6 +995,14 @@ void Spell::cast_starts_triggered_simple(Entity *caster) { cast_starts_triggered(info); } +void Spell::aura_sapply_simple(Entity *caster, Entity *target, float spell_scale) { + ERR_FAIL_COND(caster == NULL || target == NULL); + + Ref info(memnew(AuraApplyInfo(caster, target, spell_scale, this))); + + aura_sapply(info); +} + //Script methods void Spell::cast_starts(Ref info) { @@ -610,6 +1042,57 @@ void Spell::cast_finishs(Ref info) { } } +void Spell::aura_sapply(Ref info) { + ERR_FAIL_COND(!info.is_valid()); + + //always exists + call("_aura_sapply", info); +} + +void Spell::aura_sdeapply(Ref info) { + ERR_FAIL_COND(!info.is_valid()); + + //always exists + call("_aura_sdeapply", info); +} + +void Spell::aura_sadd(Ref aura) { + ERR_FAIL_COND(!aura.is_valid()); + + //always exists + call("_aura_sadd", aura); +} + +void Spell::aura_sremove(Ref aura) { + ERR_FAIL_COND(!aura.is_valid()); + + //always exists + call("_aura_sremove", aura); +} + +void Spell::aura_removes_expired(Ref aura) { + ERR_FAIL_COND(!aura.is_valid()); + + //always exists + call("_aura_removes_expired", aura); +} + +void Spell::aura_removes_dispell(Ref aura) { + ERR_FAIL_COND(!aura.is_valid()); + + //always exists + call("_aura_removes_dispell", aura); +} + +void Spell::aura_supdate(Ref aura, float delta) { + ERR_FAIL_COND(!aura.is_valid()); + + //always exists + call("_aura_supdate", aura, delta); +} + +//eventhandlers + void Spell::son_cast_player_moved(Ref info) { ERR_FAIL_COND(!info.is_valid()); @@ -658,6 +1141,259 @@ void Spell::notification_ccast(int what, Ref info) { } } +void Spell::notification_saura(int what, Ref data) { + ERR_FAIL_COND(!data.is_valid()); + + if (has_method("_notification_saura")) + call("_notification_saura", what, data); +} +void Spell::notification_sheal(int what, Ref aura, Ref data) { + ERR_FAIL_COND(!aura.is_valid()); + ERR_FAIL_COND(!data.is_valid()); + + if (has_method("_notification_sheal")) + call("_notification_sheal", what, aura, data); +} +void Spell::notification_aura_scast(int what, Ref aura, Ref info) { + ERR_FAIL_COND(!aura.is_valid()); + ERR_FAIL_COND(!info.is_valid()); + + if (has_method("_notification_aura_scast")) + call("_notification_aura_scast", what, aura, info); +} +void Spell::notification_sdamage(int what, Ref aura, Ref data) { + ERR_FAIL_COND(!aura.is_valid()); + ERR_FAIL_COND(!data.is_valid()); + + if (has_method("_notification_sdamage")) + call("_notification_sdamage", what, aura, data); +} + +void Spell::son_remove_expired(Ref aura) { + ERR_FAIL_COND(!aura.is_valid()); + + if (has_method("_son_remove_expired")) + call("_son_remove_expired", aura); +} + +void Spell::son_remove(Ref aura) { + ERR_FAIL_COND(!aura.is_valid()); + + if (has_method("_son_remove")) + call("_son_remove", aura); +} + +void Spell::son_remove_dispell(Ref aura) { + ERR_FAIL_COND(!aura.is_valid()); + + if (has_method("_son_remove_dispell")) + call("_son_remove_dispell", aura); +} + +void Spell::notification_sdeath(Ref data) { + if (has_method("_notification_sdeath")) + call("_notification_sdeath", data); +} + +void Spell::notification_scooldown_added(Ref data, int id, float value) { + if (has_method("_notification_scooldown_added")) + call("_notification_scooldown_added", data, id, value); +} +void Spell::notification_scooldown_removed(Ref data, int id, float value) { + if (has_method("_notification_scooldown_removed")) + call("_notification_scooldown_removed", data, id, value); +} + +void Spell::notification_scategory_cooldown_added(Ref data, int id, float value) { + if (has_method("_notification_scategory_cooldown_added")) + call("_notification_scategory_cooldown_added", data, id, value); +} +void Spell::notification_scategory_cooldown_removed(Ref data, int id, float value) { + if (has_method("_notification_scategory_cooldown_removed")) + call("_notification_scategory_cooldown_removed", data, id, value); +} + +void Spell::notification_sgcd_started(Ref data, float gcd) { + ERR_FAIL_COND(!data.is_valid()); + + if (has_method("_notification_sgcd_started")) + call("_notification_sgcd_started", data, gcd); +} +void Spell::notification_sgcd_finished(Ref data) { + ERR_FAIL_COND(!data.is_valid()); + + if (has_method("_notification_sgcd_finished")) + call("_notification_sgcd_finished", data); +} + +void Spell::son_physics_process_aura(Ref data) { + ERR_FAIL_COND(!data.is_valid()); + + if (has_method("_son_physics_process_aura")) + call("_son_physics_process_aura", data); +} + +void Spell::notification_sxp_gained(Ref data, int value) { + ERR_FAIL_COND(!data.is_valid()); + + if (has_method("_notification_sxp_gained")) + call("_notification_sxp_gained", data, value); +} + +void Spell::notification_slevel_up(Ref data, int value) { + ERR_FAIL_COND(!data.is_valid()); + + if (has_method("_notification_slevel_up")) + call("_notification_slevel_up", data, value); +} + +void Spell::notification_sentity_resource_added(Ref data, Ref resource) { + ERR_FAIL_COND(!data.is_valid()); + ERR_FAIL_COND(!resource.is_valid()); + + if (has_method("_notification_sentity_resource_added")) + call("_notification_sentity_resource_added", data, resource); +} +void Spell::notification_sentity_resource_removed(Ref data, Ref resource) { + ERR_FAIL_COND(!data.is_valid()); + ERR_FAIL_COND(!resource.is_valid()); + + if (has_method("_notification_sentity_resource_removed")) + call("_notification_sentity_resource_removed", data, resource); +} + +void Spell::notification_caura(int what, Ref data) { + ERR_FAIL_COND(!data.is_valid()); + + if (has_method("_notification_caura")) + call("_notification_caura", what, data); +} +void Spell::notification_cheal(int what, Ref aura, Ref data) { + ERR_FAIL_COND(!aura.is_valid()); + ERR_FAIL_COND(!data.is_valid()); + + if (has_method("_notification_cheal")) + call("_notification_cheal", what, aura, data); +} +void Spell::notification_aura_ccast(int what, Ref aura, Ref info) { + ERR_FAIL_COND(!aura.is_valid()); + ERR_FAIL_COND(!info.is_valid()); + + if (has_method("_notification_aura_ccast")) + call("_notification_aura_ccast", what, aura, info); +} +void Spell::notification_cdamage(int what, Ref aura, Ref data) { + ERR_FAIL_COND(!aura.is_valid()); + ERR_FAIL_COND(!data.is_valid()); + + if (has_method("_notification_cdamage")) + call("_notification_cdamage", what, aura, data); +} + +void Spell::notification_cdeath(Ref data) { + if (has_method("_notification_cdeath")) + call("_notification_cdeath", data); +} + +void Spell::notification_ccooldown_added(Ref data, int id, float value) { + if (has_method("_notification_ccooldown_added")) + call("_notification_ccooldown_added", data, id, value); +} +void Spell::notification_ccooldown_removed(Ref data, int id, float value) { + if (has_method("_notification_ccooldown_removed")) + call("_notification_ccooldown_removed", data, id, value); +} +void Spell::notification_ccategory_cooldown_added(Ref data, int id, float value) { + if (has_method("_notification_ccategory_cooldown_added")) + call("_notification_ccategory_cooldown_added", data, id, value); +} +void Spell::notification_ccategory_cooldown_removed(Ref data, int id, float value) { + if (has_method("_notification_ccategory_cooldown_removed")) + call("_notification_ccategory_cooldown_removed", data, id, value); +} + +void Spell::notification_cgcd_started(Ref data, float gcd) { + ERR_FAIL_COND(!data.is_valid()); + + if (has_method("_notification_cgcd_started")) + call("_notification_cgcd_started", data, gcd); +} +void Spell::notification_cgcd_finished(Ref data) { + ERR_FAIL_COND(!data.is_valid()); + + if (has_method("_notification_cgcd_finished")) + call("_notification_cgcd_finished", data); +} + +void Spell::notification_cxp_gained(Ref data, int value) { + ERR_FAIL_COND(!data.is_valid()); + + if (has_method("_notification_cxp_gained")) + call("_notification_cxp_gained", data, value); +} + +void Spell::notification_clevel_up(Ref data, int value) { + ERR_FAIL_COND(!data.is_valid()); + + if (has_method("_notification_clevel_up")) + call("_notification_clevel_up", data, value); +} + +void Spell::notification_centity_resource_added(Ref data, Ref resource) { + ERR_FAIL_COND(!data.is_valid()); + ERR_FAIL_COND(!resource.is_valid()); + + if (has_method("_notification_centity_resource_added")) + call("_notification_centity_resource_added", data, resource); +} +void Spell::notification_centity_resource_removed(Ref data, Ref resource) { + ERR_FAIL_COND(!data.is_valid()); + ERR_FAIL_COND(!resource.is_valid()); + + if (has_method("_notification_centity_resource_removed")) + call("_notification_centity_resource_removed", data, resource); +} + +//Equipment + +bool Spell::equip_should_deny(Ref data, int equip_slot, Ref item) { + ERR_FAIL_COND_V(!data.is_valid(), false); + + if (has_method("_equip_should_deny")) + if (call("_equip_should_deny", data, equip_slot, item)) + return true; + + return false; +} + +void Spell::equip_son_success(Ref data, int equip_slot, Ref item, Ref old_item, int bag_slot) { + ERR_FAIL_COND(!data.is_valid()); + + if (has_method("_equip_son_success")) + call("_equip_son_success", data, equip_slot, item, old_item, bag_slot); +} +void Spell::equip_son_fail(Ref data, int equip_slot, Ref item, Ref old_item, int bag_slot) { + ERR_FAIL_COND(!data.is_valid()); + + if (has_method("_equip_son_fail")) + call("_equip_son_fail", data, equip_slot, item, old_item, bag_slot); +} + +void Spell::equip_con_success(Ref data, int equip_slot, Ref item, Ref old_item, int bag_slot) { + ERR_FAIL_COND(!data.is_valid()); + + if (has_method("_equip_con_success")) + call("_equip_con_success", data, equip_slot, item, old_item, bag_slot); +} +void Spell::equip_con_fail(Ref data, int equip_slot, Ref item, Ref old_item, int bag_slot) { + ERR_FAIL_COND(!data.is_valid()); + + if (has_method("_equip_con_fail")) + call("_equip_con_fail", data, equip_slot, item, old_item, bag_slot); +} + +//Calculations / Queries + void Spell::calculate_initial_damage(Ref data) { ERR_FAIL_COND(!data.is_valid() || data->receiver_get() == NULL); @@ -711,6 +1447,69 @@ void Spell::handle_cooldown(Ref info) { } } +void Spell::setup_aura_data(Ref data, Ref info) { + ERR_FAIL_COND(!data.is_valid() || !info.is_valid()); + + //always exists + call("_setup_aura_data", data, info); +} + +void Spell::aura_sapply_passives_damage_receive(Ref info) { + ERR_FAIL_COND(!info.is_valid()); + + //always exists + call("_aura_sapply_passives_damage_receive", info); +} + +void Spell::aura_sapply_passives_damage_deal(Ref info) { + ERR_FAIL_COND(!info.is_valid()); + + //always exists + call("_aura_sapply_passives_damage_deal", info); +} + +void Spell::aura_calculate_initial_damage(Ref aura_data, Ref info) { + ERR_FAIL_COND(!aura_data.is_valid() || !info.is_valid()); + + //always exists + call("_aura_calculate_initial_damage", aura_data, info); +} + +void Spell::handle_aura_damage(Ref aura_data, Ref info) { + ERR_FAIL_COND(!aura_data.is_valid() || !info.is_valid()); + + //always exists + call("_handle_aura_damage", aura_data, info); +} + +void Spell::aura_sapply_passives_heal_receive(Ref data) { + ERR_FAIL_COND(!data.is_valid()); + + //always exists + call("_aura_sapply_passives_heal_receive", data); +} + +void Spell::aura_sapply_passives_heal_deal(Ref data) { + ERR_FAIL_COND(!data.is_valid()); + + //always exists + call("_aura_sapply_passives_heal_deal", data); +} + +void Spell::aura_calculate_initial_heal(Ref aura_data, Ref info) { + ERR_FAIL_COND(!aura_data.is_valid() || !info.is_valid()); + + //always exists + call("_aura_calculate_initial_heal", aura_data, info); +} + +void Spell::handle_aura_heal(Ref aura_data, Ref data) { + ERR_FAIL_COND(!aura_data.is_valid() || !data.is_valid()); + + //always exists + call("_handle_aura_heal", aura_data, data); +} + String Spell::get_name_translated() const { if (_text_translation_key != "") { return tr(_text_translation_key); @@ -778,6 +1577,73 @@ String Spell::_get_description(const int class_level, const int character_level) return str; } +String Spell::aura_get_name_translated() const { + if (_aura_text_translation_key != "") { + return tr(_aura_text_translation_key); + } + + return get_name(); +} + +String Spell::aura_get_description(const int class_level, const int character_level) { + return call("_aura_get_description", class_level, character_level); +} + +String Spell::_aura_get_description(const int class_level, const int character_level) { + String str; + + if (_aura_text_translation_key != "") { + str = tr(_aura_text_translation_key + "_DESC"); + } + + str = _aura_text_description; + + int pos = str.find_char('%'); + + while (pos > 0) { + if (pos == str.size() - 1) + break; + +#if GODOT4 + char32_t o = str[pos + 1]; +#else + CharType o = str[pos + 1]; +#endif + + if (o == '#' || o == '$' || o == '%') { + int nsp = str.find_char(' ', pos + 1); + + if (pos < 0) + break; + + String prop = str.substr(pos + 2, nsp - pos - 2); + StringName psm = prop; + bool valid = false; + Variant value = get(psm, &valid); + + if (valid) { + if (o == '#') { + value = Variant::evaluate(Variant::OP_MULTIPLY, value, class_level / static_cast(ESS::get_singleton()->get_max_class_level())); + + value = static_cast(value); + } + + if (o == '$') { + value = Variant::evaluate(Variant::OP_MULTIPLY, value, character_level / static_cast(ESS::get_singleton()->get_max_character_level())); + + value = static_cast(value); + } + + str = str.replace(str.substr(pos, nsp - pos) + " ", value); + } + } + + pos = str.find_char('%', pos + 1); + } + + return str; +} + Spell::Spell() { PLAYER_HIT_RADIUS = (float)0.5; @@ -844,6 +1710,47 @@ Spell::Spell() { _projectile_time = 0; _projectile_use_speed = false; _projectile_speed = 0; + + _aura_ability_scale_data_id = 1; + _aura_time = 0; + _aura_tick = 0; + _aura_type = SpellEnums::AURA_TYPE_NONE; + _aura_is_debuff = false; + _aura_hide = false; + + _aura_scale_with_level = ESS::get_singleton()->get_scale_spells_by_default(); + + _aura_damage_enabled = false; + _aura_damage_type = 0; + _aura_damage_min = 0; + _aura_damage_max = 0; + _aura_damage_can_crit = false; + + _aura_absorb_enabled = false; + _aura_absorb_damage_type = 0; + _aura_absorb_min = 0; + _aura_absorb_max = 0; + + _aura_heal_enabled = false; + _aura_heal_min = 0; + _aura_heal_max = 0; + + _aura_heal_can_crit = false; + + _aura_dispell_enabled = false; + _aura_dispell_count_min = 0; + _aura_dispell_count_max = 0; + _aura_dispell_aura_types = 0; + + _aura_add_states = 0; + _aura_remove_effects_with_states = 0; + _aura_supress_states = 0; + + _aura_stat_attribute_count = 0; + _aura_trigger_count = 0; + + _aura_diminishing_return_enabled = false; + _aura_diminishing_return_category = 0; } Spell::~Spell() { @@ -866,6 +1773,21 @@ Spell::~Spell() { _training_required_skill.unref(); _projectile_scene.unref(); + + _aura_teaches_spell.unref(); + + _aura_visual_spell_effects.unref(); + + _aura_damage_scaling_curve.unref(); + _aura_absorb_scaling_curve.unref(); + _aura_heal_scaling_curve.unref(); + + for (int i = 0; i < MAX_TRIGGER_DATA; ++i) { + _aura_trigger_datas[i].spell.unref(); + } + + _aura_talent_required_talent.unref(); + _aura_talent_required_spell.unref(); } void Spell::_cast_starts(Ref info) { @@ -972,16 +1894,16 @@ void Spell::_handle_projectile(Ref info) { void Spell::_handle_effect(Ref info) { /* # var ok : bool = false - + # if (target_relation_type & TARGET_SELF): # ok = true - + # if not ok and (target_relation_type & TARGET_ENEMY and info.target is Entity): # ok = true # # if not ok and (target_relation_type & TARGET_FRIENDLY and info.target is Player): # ok = true - + # if not ok: # return */ @@ -1020,7 +1942,7 @@ void Spell::_handle_effect(Ref info) { if (has_target) { for (int i = 0; i < _spells_cast_on_target.size(); ++i) { - Ref aura = _spells_cast_on_target.get(i); + Ref aura = _spells_cast_on_target.get(i); Ref ad; @@ -1047,8 +1969,340 @@ void Spell::_handle_effect(Ref info) { } } +void Spell::_aura_sapply(Ref info) { + ERR_FAIL_COND(info->target_get() == NULL || info->caster_get() == NULL || !info->get_aura().is_valid()); + + Ref ad = info->target_get()->aura_gets_by(info->caster_get(), _id); + + if (!ad.is_valid()) { + ad.instance(); + + setup_aura_data(ad, info); + + Entity *owner = ad->get_owner(); + + for (int i = 0; i < _aura_stat_attribute_count; ++i) { + owner->stat_mod(_aura_stat_attributes[i].stat, _aura_stat_attributes[i].base_mod, _aura_stat_attributes[i].bonus_mod, _aura_stat_attributes[i].percent_mod); + } + + if (_aura_add_states != 0) { + for (int i = 0; i < EntityEnums::ENTITY_STATE_TYPE_INDEX_MAX; ++i) { + int t = 1 << i; + + if ((_aura_add_states & t) != 0) { + info->target_get()->adds_state_ref(i); + } + } + } + + info->target_get()->aura_adds(ad); + } else { + ad->set_remaining_time(_aura_time); + } +} + +void Spell::_aura_sdeapply(Ref data) { + ERR_FAIL_COND(data->get_owner() == NULL || data->caster_get() == NULL || !data->get_aura().is_valid()); + + Entity *owner = data->get_owner(); + + for (int i = 0; i < _aura_stat_attribute_count; ++i) { + owner->stat_mod(_aura_stat_attributes[i].stat, -_aura_stat_attributes[i].base_mod, -_aura_stat_attributes[i].bonus_mod, -_aura_stat_attributes[i].percent_mod); + } + + if (_aura_add_states != 0) { + for (int i = 0; i < EntityEnums::ENTITY_STATE_TYPE_INDEX_MAX; ++i) { + int t = 1 << i; + + if ((_aura_add_states & t) != 0) { + data->get_owner()->removes_state_ref(i); + } + } + } +} + +void Spell::_aura_sadd(Ref aura) { + ERR_FAIL_COND(aura->get_owner() == NULL); + + //sapply(aura); + + aura->get_owner()->aura_removes(aura); + aura->get_owner()->aura_adds(aura); +} + +void Spell::_aura_sremove(Ref aura) { + ERR_FAIL_COND(aura->get_owner() == NULL); + + aura_sdeapply(aura); + + aura->get_owner()->aura_removes(aura); +} + +void Spell::_aura_removes_expired(Ref aura) { + ERR_FAIL_COND(aura->get_owner() == NULL); + + aura_sdeapply(aura); + + aura->get_owner()->aura_removes_expired(aura); +} + +void Spell::_aura_removes_dispell(Ref aura) { + ERR_FAIL_COND(aura->get_owner() == NULL); + + aura_sdeapply(aura); + + aura->get_owner()->aura_removes_dispelled(aura); +} + +void Spell::_aura_supdate(Ref aura, float delta) { + bool remove = false; + + remove = aura->update(delta); + + //ontick + while (aura->get_unhandled_ticks() > 0) { + if (aura->damage_get() != 0) { + Ref dpd = Ref(memnew(SpellDamageInfo())); + + dpd->aura_source_set(Ref(this)); + dpd->dealer_set(aura->caster_get()); + dpd->receiver_set(aura->get_owner()); + + handle_aura_damage(aura, dpd); + } + + if (aura->heal_get() != 0) { + Ref shi = Ref(memnew(SpellHealInfo())); + + shi->aura_source_set(Ref(this)); + shi->dealer_set(aura->caster_get()); + shi->receiver_set(aura->get_owner()); + + handle_aura_heal(aura, shi); + } + + aura->set_unhandled_ticks(aura->get_unhandled_ticks() - 1); + } + + if (remove) { + aura_removes_expired(aura); + } +} + +void Spell::_setup_aura_data(Ref data, Ref info) { + ERR_FAIL_COND(!INSTANCE_VALIDATE(info->caster_get())); + + data->set_aura(Ref(this)); + data->set_aura_id(get_id()); + data->set_owner(info->target_get()); + data->caster_set(info->caster_get()); + data->set_tick(info->get_aura()->aura_get_tick()); + + if (aura_get_time() > 0.2) { + data->set_is_timed(true); + data->set_remaining_time(aura_get_time()); + + } else { + data->set_is_timed(false); + } + + if (aura_damage_get_enabled()) { + aura_calculate_initial_damage(data, info); + } + + if (aura_heal_get_enabled()) { + aura_calculate_initial_heal(data, info); + } +} + +void Spell::_aura_sapply_passives_damage_receive(Ref info) { +} + +void Spell::_aura_sapply_passives_damage_deal(Ref info) { +} + +void Spell::_aura_calculate_initial_damage(Ref aura_data, Ref info) { + int min_damage = aura_damage_get_min(); + int max_damage = aura_damage_get_max(); + + Math::randomize(); + int damage = min_damage + Math::rand() % (max_damage - min_damage); + + if (aura_get_scale_with_level()) { + damage = static_cast(damage * static_cast(info->caster_get()->gets_level()) / static_cast(ESS::get_singleton()->get_max_character_level())); + } + + aura_data->damage_set(damage); +} + +void Spell::_handle_aura_damage(Ref aura_data, Ref info) { + if (info->dealer_get() && !INSTANCE_VALIDATE(info->dealer_get())) { + info->dealer_set(NULL); + } + + info->damage_set(aura_data->damage_get()); + info->aura_source_set(Ref(this)); + + if (info->dealer_get()) { + info->dealer_get()->sdeal_damage_to(info); + } else { + info->receiver_get()->stake_damage(info); + } +} + +void Spell::_aura_sapply_passives_heal_receive(Ref data) { + ERR_FAIL_COND(!data.is_valid()); +} + +void Spell::_aura_sapply_passives_heal_deal(Ref data) { + ERR_FAIL_COND(!data.is_valid()); +} + +void Spell::_aura_calculate_initial_heal(Ref aura_data, Ref info) { + int min_heal = aura_heal_get_min(); + int max_heal = aura_heal_get_max(); + + Math::randomize(); + int heal = min_heal + Math::rand() % (max_heal - min_heal); + + if (aura_get_scale_with_level()) { + heal = static_cast(heal * static_cast(info->caster_get()->gets_level()) / static_cast(ESS::get_singleton()->get_max_character_level())); + } + + aura_data->heal_set(heal); +} + +void Spell::_handle_aura_heal(Ref aura_data, Ref info) { + if (info->dealer_get() && !INSTANCE_VALIDATE(info->dealer_get())) { + info->dealer_set(NULL); + } + + info->heal_set(aura_data->heal_get()); + + if (info->dealer_get()) { + info->dealer_get()->sdeal_heal_to(info); + } else { + info->receiver_get()->stake_heal(info); + } +} + void Spell::_validate_property(PropertyInfo &property) const { - if (property.name.ends_with("_stat")) { + String prop = property.name; + + if (prop.begins_with("aura_stat_attribute_")) { + if (prop.ends_with("count")) + return; + + int frame = prop.get_slicec('/', 0).get_slicec('_', 2).to_int(); + if (frame >= _aura_stat_attribute_count) { + property.usage = 0; + } + + if (property.name.ends_with("stat")) + property.hint_string = ESS::get_singleton()->stat_get_string(); + } else if (prop == "diminishing_return_category") { + property.hint_string = ESS::get_singleton()->dminishing_return_categories_get(); + } else if (prop.begins_with("aura_trigger_")) { + if (prop.ends_with("count")) + return; + + int frame = prop.get_slicec('/', 0).get_slicec('_', 1).to_int(); + if (frame >= _aura_trigger_count) { + property.usage = 0; + } else { + if (prop.ends_with("notification_data")) { + switch (_aura_trigger_datas[frame].notification_type) { + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_AURA: + property.hint = PROPERTY_HINT_ENUM; + property.hint_string = SpellEnums::BINDING_STRING_NOTIFICATION_AURAS; + break; + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_DAMAGE: + property.hint = PROPERTY_HINT_ENUM; + property.hint_string = SpellEnums::BINDING_STRING_NOTIFICATION_DAMAGES; + break; + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_HEAL: + property.hint = PROPERTY_HINT_ENUM; + property.hint_string = SpellEnums::BINDING_STRING_NOTIFICATION_HEALS; + break; + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_CAST: + property.hint = PROPERTY_HINT_ENUM; + property.hint_string = SpellEnums::BINDING_STRING_NOTIFICATION_CASTS; + break; + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_DEATH: + property.hint = PROPERTY_HINT_NONE; + property.hint_string = ""; + break; + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_COOLDOWN_ADDED: + property.hint = PROPERTY_HINT_NONE; + property.hint_string = ""; + break; + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_COOLDOWN_REMOVED: + property.hint = PROPERTY_HINT_NONE; + property.hint_string = ""; + break; + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_CATEGORY_COOLDOWN_ADDED: + property.hint = PROPERTY_HINT_NONE; + property.hint_string = ""; + break; + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_CATEGORY_COOLDOWN_REMOVED: + property.hint = PROPERTY_HINT_NONE; + property.hint_string = ""; + break; + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_GCD_STARTED: + property.hint = PROPERTY_HINT_NONE; + property.hint_string = ""; + break; + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_GCD_FINISHED: + property.hint = PROPERTY_HINT_NONE; + property.hint_string = ""; + break; + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_XP_GAINED: + property.hint = PROPERTY_HINT_NONE; + property.hint_string = ""; + break; + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_CLASS_LEVELUP: + property.hint = PROPERTY_HINT_NONE; + property.hint_string = ""; + break; + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_CHARACTER_LEVELUP: + property.hint = PROPERTY_HINT_NONE; + property.hint_string = ""; + break; + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_ENTITY_RESOURCE_ADDED: + property.hint = PROPERTY_HINT_NONE; + property.hint_string = ""; + break; + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_ENTITY_RESOURCE_REMOVED: + property.hint = PROPERTY_HINT_NONE; + property.hint_string = ""; + break; + + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_AURA_CUSTOM: + property.hint = PROPERTY_HINT_NONE; + property.hint_string = ""; + break; + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_DAMAGE_CUSTOM: + property.hint = PROPERTY_HINT_NONE; + property.hint_string = ""; + break; + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_HEAL_CUSTOM: + property.hint = PROPERTY_HINT_NONE; + property.hint_string = ""; + break; + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_CAST_CUSTOM: + property.hint = PROPERTY_HINT_NONE; + property.hint_string = ""; + break; + case SpellEnums::TRIGGER_NOTIFICATION_TYPE_CUSTOM: + property.hint = PROPERTY_HINT_NONE; + property.hint_string = ""; + break; + default: + break; + } + } + } + } else if (property.name.ends_with("_stat")) { property.hint_string = ESS::get_singleton()->stat_get_string(); } } @@ -1065,6 +2319,31 @@ void Spell::_bind_methods() { BIND_VMETHOD(MethodInfo("_cast_interrupts", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); BIND_VMETHOD(MethodInfo("_cast_finishs", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); + //Aura Commands + ClassDB::bind_method(D_METHOD("aura_sapply", "info"), &Spell::aura_sapply); + ClassDB::bind_method(D_METHOD("aura_sdeapply", "aura"), &Spell::aura_sdeapply); + ClassDB::bind_method(D_METHOD("aura_sadd", "aura"), &Spell::aura_sadd); + ClassDB::bind_method(D_METHOD("aura_sremove", "aura"), &Spell::aura_sremove); + ClassDB::bind_method(D_METHOD("aura_removes_expired", "aura"), &Spell::aura_removes_expired); + ClassDB::bind_method(D_METHOD("aura_removes_dispell", "aura"), &Spell::aura_removes_dispell); + ClassDB::bind_method(D_METHOD("aura_supdate", "aura", "delta"), &Spell::aura_supdate); + + BIND_VMETHOD(MethodInfo("_aura_sapply", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraApplyInfo"))); + BIND_VMETHOD(MethodInfo("_aura_sdeapply", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + BIND_VMETHOD(MethodInfo("_aura_sadd", PropertyInfo(Variant::OBJECT, "aura", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + BIND_VMETHOD(MethodInfo("_aura_sremove", PropertyInfo(Variant::OBJECT, "aura", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + BIND_VMETHOD(MethodInfo("_aura_removes_expired", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + BIND_VMETHOD(MethodInfo("_aura_removes_dispell", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + BIND_VMETHOD(MethodInfo("_aura_supdate", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::REAL, "delta"))); + + ClassDB::bind_method(D_METHOD("_aura_sapply", "info"), &Spell::_aura_sapply); + ClassDB::bind_method(D_METHOD("_aura_sdeapply", "aura"), &Spell::_aura_sdeapply); + ClassDB::bind_method(D_METHOD("_aura_sadd", "aura"), &Spell::_aura_sadd); + ClassDB::bind_method(D_METHOD("_aura_sremove", "aura"), &Spell::_aura_sremove); + ClassDB::bind_method(D_METHOD("_aura_removes_expired", "aura"), &Spell::_aura_removes_expired); + ClassDB::bind_method(D_METHOD("_aura_removes_dispell", "aura"), &Spell::_aura_removes_dispell); + ClassDB::bind_method(D_METHOD("_aura_supdate", "aura", "delta"), &Spell::_aura_supdate); + //Eventhandlers ClassDB::bind_method(D_METHOD("son_cast_player_moved", "info"), &Spell::son_cast_player_moved); ClassDB::bind_method(D_METHOD("son_cast_damage_received", "info"), &Spell::son_cast_damage_received); @@ -1081,7 +2360,137 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("notification_scast", "what", "info"), &Spell::notification_scast); BIND_VMETHOD(MethodInfo("_notification_ccast", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - ClassDB::bind_method(D_METHOD("notification_ccast", "what", "info"), &Spell::notification_scast); + ClassDB::bind_method(D_METHOD("notification_ccast", "what", "info"), &Spell::notification_ccast); + + //Aura EventHandlers + BIND_VMETHOD(MethodInfo("_notification_saura", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + BIND_VMETHOD(MethodInfo("_notification_sheal", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); + BIND_VMETHOD(MethodInfo("_notification_aura_scast", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); + BIND_VMETHOD(MethodInfo("_notification_sdamage", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); + + ClassDB::bind_method(D_METHOD("notification_saura", "what", "data"), &Spell::notification_saura); + ClassDB::bind_method(D_METHOD("notification_sheal", "what", "aura", "info"), &Spell::notification_sheal); + ClassDB::bind_method(D_METHOD("notification_aura_scast", "what", "aura", "info"), &Spell::notification_aura_scast); + ClassDB::bind_method(D_METHOD("notification_sdamage", "what", "aura", "info"), &Spell::notification_sdamage); + + ClassDB::bind_method(D_METHOD("son_remove", "aura"), &Spell::son_remove); + ClassDB::bind_method(D_METHOD("son_remove_expired", "aura"), &Spell::son_remove_expired); + ClassDB::bind_method(D_METHOD("son_remove_dispell", "aura"), &Spell::son_remove_dispell); + + ClassDB::bind_method(D_METHOD("notification_sdeath", "data"), &Spell::notification_sdeath); + + ClassDB::bind_method(D_METHOD("notification_scooldown_added", "data", "cooldown"), &Spell::notification_scooldown_added); + ClassDB::bind_method(D_METHOD("notification_scooldown_removed", "data", "cooldown"), &Spell::notification_scooldown_removed); + + ClassDB::bind_method(D_METHOD("notification_scategory_cooldown_added", "data", "category_cooldown"), &Spell::notification_scategory_cooldown_added); + ClassDB::bind_method(D_METHOD("notification_scategory_cooldown_removed", "data", "category_cooldown"), &Spell::notification_scategory_cooldown_removed); + + ClassDB::bind_method(D_METHOD("notification_sgcd_started", "data", "gcd"), &Spell::notification_sgcd_started); + ClassDB::bind_method(D_METHOD("notification_sgcd_finished", "data"), &Spell::notification_sgcd_finished); + + ClassDB::bind_method(D_METHOD("son_physics_process_aura", "data"), &Spell::son_physics_process_aura); + + ClassDB::bind_method(D_METHOD("notification_sxp_gained", "data", "value"), &Spell::notification_sxp_gained); + ClassDB::bind_method(D_METHOD("notification_slevel_up", "data", "value"), &Spell::notification_slevel_up); + + ClassDB::bind_method(D_METHOD("notification_sentity_resource_added", "data", "value"), &Spell::notification_sentity_resource_added); + ClassDB::bind_method(D_METHOD("notification_sentity_resource_removed", "data", "value"), &Spell::notification_sentity_resource_removed); + + BIND_VMETHOD(MethodInfo("_son_remove", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + BIND_VMETHOD(MethodInfo("_son_remove_expired", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + BIND_VMETHOD(MethodInfo("_son_remove_dispell", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + + BIND_VMETHOD(MethodInfo("_notification_sdeath", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + + BIND_VMETHOD(MethodInfo("_notification_scooldown_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); + BIND_VMETHOD(MethodInfo("_notification_scooldown_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); + BIND_VMETHOD(MethodInfo("_notification_scategory_cooldown_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); + BIND_VMETHOD(MethodInfo("_notification_scategory_cooldown_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); + + BIND_VMETHOD(MethodInfo("_notification_sgcd_started", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::REAL, "gcd"))); + BIND_VMETHOD(MethodInfo("_notification_sgcd_finished", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + + BIND_VMETHOD(MethodInfo("_son_physics_process_aura", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + + BIND_VMETHOD(MethodInfo("_notification_sxp_gained", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); + BIND_VMETHOD(MethodInfo("_notification_slevel_up", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); + + BIND_VMETHOD(MethodInfo("_notification_sentity_resource_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); + BIND_VMETHOD(MethodInfo("_notification_sentity_resource_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); + + //Aura Clientside Event Handlers + BIND_VMETHOD(MethodInfo("_notification_caura", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + BIND_VMETHOD(MethodInfo("_notification_cheal", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); + BIND_VMETHOD(MethodInfo("_notification_aura_ccast", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); + BIND_VMETHOD(MethodInfo("_notification_cdamage", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); + + ClassDB::bind_method(D_METHOD("notification_caura", "what", "data"), &Spell::notification_caura); + ClassDB::bind_method(D_METHOD("notification_cheal", "what", "aura", "info"), &Spell::notification_cheal); + ClassDB::bind_method(D_METHOD("notification_aura_ccast", "what", "aura", "info"), &Spell::notification_aura_ccast); + ClassDB::bind_method(D_METHOD("notification_cdamage", "what", "aura", "info"), &Spell::notification_cdamage); + + ClassDB::bind_method(D_METHOD("notification_cdeath", "data"), &Spell::notification_cdeath); + + ClassDB::bind_method(D_METHOD("notification_ccooldown_added", "data", "info"), &Spell::notification_ccooldown_added); + ClassDB::bind_method(D_METHOD("notification_ccooldown_removed", "data", "info"), &Spell::notification_ccooldown_removed); + ClassDB::bind_method(D_METHOD("notification_ccategory_cooldown_added", "data", "info"), &Spell::notification_ccategory_cooldown_added); + ClassDB::bind_method(D_METHOD("notification_ccategory_cooldown_removed", "data", "info"), &Spell::notification_ccategory_cooldown_removed); + + ClassDB::bind_method(D_METHOD("notification_cgcd_started", "data", "info"), &Spell::notification_cgcd_started); + ClassDB::bind_method(D_METHOD("notification_cgcd_finished", "data"), &Spell::notification_cgcd_finished); + + ClassDB::bind_method(D_METHOD("notification_cxp_gained", "data", "value"), &Spell::notification_cxp_gained); + ClassDB::bind_method(D_METHOD("notification_clevel_up", "data", "value"), &Spell::notification_clevel_up); + + ClassDB::bind_method(D_METHOD("notification_centity_resource_added", "data", "value"), &Spell::notification_centity_resource_added); + ClassDB::bind_method(D_METHOD("notification_centity_resource_removed", "data", "value"), &Spell::notification_centity_resource_removed); + + BIND_VMETHOD(MethodInfo("_con_cast_failed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); + BIND_VMETHOD(MethodInfo("_con_cast_started", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); + BIND_VMETHOD(MethodInfo("_con_cast_state_changed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); + BIND_VMETHOD(MethodInfo("_con_cast_finished", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); + BIND_VMETHOD(MethodInfo("_con_spell_cast_success", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); + + BIND_VMETHOD(MethodInfo("_notification_cdeath", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + + BIND_VMETHOD(MethodInfo("_notification_ccooldown_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); + BIND_VMETHOD(MethodInfo("_notification_ccooldown_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); + BIND_VMETHOD(MethodInfo("_notification_ccategory_cooldown_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); + BIND_VMETHOD(MethodInfo("_notification_ccategory_cooldown_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); + + BIND_VMETHOD(MethodInfo("_con_aura_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + BIND_VMETHOD(MethodInfo("_con_aura_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + BIND_VMETHOD(MethodInfo("_con_aura_refresh", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + + BIND_VMETHOD(MethodInfo("_con_damage_dealt", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); + BIND_VMETHOD(MethodInfo("_con_dealt_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); + BIND_VMETHOD(MethodInfo("_con_heal_dealt", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); + BIND_VMETHOD(MethodInfo("_con_dealt_heal", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); + + BIND_VMETHOD(MethodInfo("_notification_cgcd_started", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::REAL, "gcd"))); + BIND_VMETHOD(MethodInfo("_notification_cgcd_finished", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + + BIND_VMETHOD(MethodInfo("_notification_cxp_gained", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); + BIND_VMETHOD(MethodInfo("_notification_clevel_up", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); + + BIND_VMETHOD(MethodInfo("_notification_centity_resource_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); + BIND_VMETHOD(MethodInfo("_notification_centity_resource_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); + + //Equipment + + BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "ret"), "_equip_should_deny", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"))); + + BIND_VMETHOD(MethodInfo("_equip_son_success", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); + BIND_VMETHOD(MethodInfo("_equip_son_fail", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); + BIND_VMETHOD(MethodInfo("_equip_con_success", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); + BIND_VMETHOD(MethodInfo("_equip_con_fail", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); + + ClassDB::bind_method(D_METHOD("equip_should_deny", "data", "equip_slot", "item"), &Spell::equip_should_deny); + + ClassDB::bind_method(D_METHOD("equip_son_success", "data", "equip_slot", "item", "old_item", "bag_slot"), &Spell::equip_son_success); + ClassDB::bind_method(D_METHOD("equip_son_fail", "data", "equip_slot", "item", "old_item", "bag_slot"), &Spell::equip_son_fail); + ClassDB::bind_method(D_METHOD("equip_con_success", "data", "equip_slot", "item", "old_item", "bag_slot"), &Spell::equip_con_success); + ClassDB::bind_method(D_METHOD("equip_con_fail", "data", "equip_slot", "item", "old_item", "bag_slot"), &Spell::equip_con_fail); //Calculations / Queries ClassDB::bind_method(D_METHOD("calculate_initial_damage", "data"), &Spell::calculate_initial_damage); @@ -1121,6 +2530,45 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("_handle_projectile", "info"), &Spell::_handle_projectile); ClassDB::bind_method(D_METHOD("_handle_effect", "info"), &Spell::_handle_effect); + //Aura Calculations / Queries + ClassDB::bind_method(D_METHOD("setup_aura_data", "data", "info"), &Spell::setup_aura_data); + + BIND_VMETHOD(MethodInfo("_setup_aura_data", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraApplyInfo"))); + + ClassDB::bind_method(D_METHOD("_setup_aura_data", "data", "info"), &Spell::_setup_aura_data); + + //damage + ClassDB::bind_method(D_METHOD("aura_sapply_passives_damage_receive", "data"), &Spell::aura_sapply_passives_damage_receive); + ClassDB::bind_method(D_METHOD("aura_sapply_passives_damage_deal", "data"), &Spell::aura_sapply_passives_damage_deal); + ClassDB::bind_method(D_METHOD("aura_calculate_initial_damage", "aura_data", "info"), &Spell::aura_calculate_initial_damage); + ClassDB::bind_method(D_METHOD("handle_aura_damage", "aura_data", "data"), &Spell::handle_aura_damage); + + BIND_VMETHOD(MethodInfo("_aura_sapply_passives_damage_receive", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); + BIND_VMETHOD(MethodInfo("_aura_sapply_passives_damage_deal", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); + BIND_VMETHOD(MethodInfo("_aura_calculate_initial_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraApplyInfo"))); + BIND_VMETHOD(MethodInfo("_handle_aura_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); + + ClassDB::bind_method(D_METHOD("_aura_sapply_passives_damage_receive", "info"), &Spell::_aura_sapply_passives_damage_receive); + ClassDB::bind_method(D_METHOD("_aura_sapply_passives_damage_deal", "info"), &Spell::_aura_sapply_passives_damage_deal); + ClassDB::bind_method(D_METHOD("_aura_calculate_initial_damage", "aura_data", "info"), &Spell::_aura_calculate_initial_damage); + ClassDB::bind_method(D_METHOD("_handle_aura_damage", "aura_data", "info"), &Spell::_handle_aura_damage); + + //heal + ClassDB::bind_method(D_METHOD("aura_sapply_passives_heal_receive", "data"), &Spell::aura_sapply_passives_heal_receive); + ClassDB::bind_method(D_METHOD("aura_sapply_passives_heal_deal", "data"), &Spell::aura_sapply_passives_heal_deal); + ClassDB::bind_method(D_METHOD("aura_calculate_initial_heal", "aura_data", "info"), &Spell::aura_calculate_initial_heal); + ClassDB::bind_method(D_METHOD("handle_aura_heal", "aura_data", "data"), &Spell::handle_aura_heal); + + BIND_VMETHOD(MethodInfo("_aura_sapply_passives_heal_receive", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); + BIND_VMETHOD(MethodInfo("_aura_sapply_passives_heal_deal", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); + BIND_VMETHOD(MethodInfo("_aura_calculate_initial_heal", PropertyInfo(Variant::OBJECT, "aura_data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraApplyInfo"))); + BIND_VMETHOD(MethodInfo("_handle_aura_heal", PropertyInfo(Variant::OBJECT, "aura_data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "spell_heal_info", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); + + ClassDB::bind_method(D_METHOD("_aura_sapply_passives_heal_receive", "info"), &Spell::_aura_sapply_passives_heal_receive); + ClassDB::bind_method(D_METHOD("_aura_sapply_passives_heal_deal", "info"), &Spell::_aura_sapply_passives_heal_deal); + ClassDB::bind_method(D_METHOD("_aura_calculate_initial_heal", "aura_data", "info"), &Spell::_aura_calculate_initial_heal); + ClassDB::bind_method(D_METHOD("_handle_aura_heal", "aura_data", "info"), &Spell::_handle_aura_heal); + //Properties ClassDB::bind_method(D_METHOD("get_id"), &Spell::get_id); ClassDB::bind_method(D_METHOD("set_id", "value"), &Spell::set_id); @@ -1189,7 +2637,7 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("spells_cast_on_caster_get"), &Spell::spells_cast_on_caster_get); ClassDB::bind_method(D_METHOD("spells_cast_on_caster_set", "caster_aura_applys"), &Spell::spells_cast_on_caster_set); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells_cast_on_caster", PROPERTY_HINT_NONE, "17/17:Aura", PROPERTY_USAGE_DEFAULT, "Aura"), "spells_cast_on_caster_set", "spells_cast_on_caster_get"); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells_cast_on_caster", PROPERTY_HINT_NONE, "17/17:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "spells_cast_on_caster_set", "spells_cast_on_caster_get"); //ADD_GROUP("Target Aura Apply", "target_aura_applys"); ClassDB::bind_method(D_METHOD("spells_cast_on_target_num_get"), &Spell::spells_cast_on_target_num_get); @@ -1200,7 +2648,7 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("spells_cast_on_target_get"), &Spell::spells_cast_on_target_get); ClassDB::bind_method(D_METHOD("spells_cast_on_target_set", "target_aura_applys"), &Spell::spells_cast_on_target_set); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells_cast_on_target", PROPERTY_HINT_NONE, "17/17:Aura", PROPERTY_USAGE_DEFAULT, "Aura"), "spells_cast_on_target_set", "spells_cast_on_target_get"); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells_cast_on_target", PROPERTY_HINT_NONE, "17/17:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "spells_cast_on_target_set", "spells_cast_on_target_get"); //ADD_GROUP("Apply Auras On Learn", "on_learn_auras"); ClassDB::bind_method(D_METHOD("on_learn_cast_spells_num_get"), &Spell::on_learn_cast_spells_num_get); @@ -1211,8 +2659,8 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("spells_cast_on_learn_get"), &Spell::spells_cast_on_learn_get); ClassDB::bind_method(D_METHOD("spells_cast_on_learn_set", "spells"), &Spell::spells_cast_on_learn_set); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells_cast_on_learn", PROPERTY_HINT_NONE, "17/17:Aura", PROPERTY_USAGE_DEFAULT, "Aura"), "spells_cast_on_learn_set", "spells_cast_on_learn_get"); - + ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells_cast_on_learn", PROPERTY_HINT_NONE, "17/17:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "spells_cast_on_learn_set", "spells_cast_on_learn_get"); + ADD_GROUP("Texts", "text"); BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::STRING, "desc"), "_get_description", PropertyInfo(Variant::INT, "class_level"), PropertyInfo(Variant::INT, "character_level"))); @@ -1415,6 +2863,255 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("set_training_required_skill_level", "value"), &Spell::set_training_required_skill_level); ADD_PROPERTY(PropertyInfo(Variant::INT, "training_required_skill_level"), "set_training_required_skill_level", "get_training_required_skill_level"); + ADD_GROUP("Aura", "aura"); + ClassDB::bind_method(D_METHOD("aura_get_time"), &Spell::aura_get_time); + ClassDB::bind_method(D_METHOD("aura_set_time", "value"), &Spell::aura_set_time); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "aura_time"), "aura_set_time", "aura_get_time"); + + ClassDB::bind_method(D_METHOD("aura_get_tick"), &Spell::aura_get_tick); + ClassDB::bind_method(D_METHOD("aura_set_tick", "value"), &Spell::aura_set_tick); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "aura_tick"), "aura_set_tick", "aura_get_tick"); + + ClassDB::bind_method(D_METHOD("aura_get_is_debuff"), &Spell::aura_get_is_debuff); + ClassDB::bind_method(D_METHOD("aura_set_is_debuff", "value"), &Spell::aura_set_is_debuff); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_debuff"), "aura_set_is_debuff", "aura_get_is_debuff"); + + ClassDB::bind_method(D_METHOD("aura_get_scale_with_level"), &Spell::aura_get_scale_with_level); + ClassDB::bind_method(D_METHOD("aura_set_scale_with_level", "value"), &Spell::aura_set_scale_with_level); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_scale_with_level"), "aura_set_scale_with_level", "aura_get_scale_with_level"); + + ClassDB::bind_method(D_METHOD("aura_get_aura_type"), &Spell::aura_get_aura_type); + ClassDB::bind_method(D_METHOD("aura_set_aura_type", "value"), &Spell::aura_set_aura_type); + ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_type", PROPERTY_HINT_ENUM, SpellEnums::BINDING_STRING_AURA_TYPES), "aura_set_aura_type", "aura_get_aura_type"); + + ClassDB::bind_method(D_METHOD("aura_get_aura_group"), &Spell::aura_get_aura_group); + ClassDB::bind_method(D_METHOD("aura_set_aura_group", "value"), &Spell::aura_set_aura_group); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_group", PROPERTY_HINT_RESOURCE_TYPE, "AuraGroup"), "aura_set_aura_group", "aura_get_aura_group"); + + ClassDB::bind_method(D_METHOD("aura_get_hide"), &Spell::aura_get_hide); + ClassDB::bind_method(D_METHOD("aura_set_hide", "value"), &Spell::aura_set_hide); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_hide"), "aura_set_hide", "aura_get_hide"); + + ClassDB::bind_method(D_METHOD("aura_get_ability_scale_data_id"), &Spell::aura_get_ability_scale_data_id); + ClassDB::bind_method(D_METHOD("aura_set_ability_scale_data_id", "value"), &Spell::aura_set_ability_scale_data_id); + ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_ability_scale_data_id"), "aura_set_ability_scale_data_id", "aura_get_ability_scale_data_id"); + + ClassDB::bind_method(D_METHOD("aura_get_visual_spell_effects"), &Spell::aura_get_visual_spell_effects); + ClassDB::bind_method(D_METHOD("aura_set_visual_spell_effects", "value"), &Spell::aura_set_visual_spell_effects); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_visual_spell_effects", PROPERTY_HINT_RESOURCE_TYPE, "SpellEffectVisual"), "aura_set_visual_spell_effects", "aura_get_visual_spell_effects"); + + BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::STRING, "desc"), "_aura_get_description", PropertyInfo(Variant::INT, "class_level"), PropertyInfo(Variant::INT, "character_level"))); + + ADD_GROUP("Aura Texts", "aura_text"); + ClassDB::bind_method(D_METHOD("aura_get_text_translation_key"), &Spell::aura_get_text_translation_key); + ClassDB::bind_method(D_METHOD("aura_set_text_translation_key", "value"), &Spell::aura_set_text_translation_key); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "aura_text_translation_key"), "aura_set_text_translation_key", "aura_get_text_translation_key"); + + ClassDB::bind_method(D_METHOD("aura_get_text_description"), &Spell::aura_get_text_description); + ClassDB::bind_method(D_METHOD("aura_set_text_description", "value"), &Spell::aura_set_text_description); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "aura_text_description", PROPERTY_HINT_MULTILINE_TEXT), "aura_set_text_description", "aura_get_text_description"); + + ClassDB::bind_method(D_METHOD("aura_get_name_translated"), &Spell::aura_get_name_translated); + ClassDB::bind_method(D_METHOD("aura_get_description", "class_level", "character_level"), &Spell::aura_get_description); + ClassDB::bind_method(D_METHOD("_aura_get_description", "class_level", "character_level"), &Spell::_aura_get_description); + + ADD_GROUP("Aura Damage", "aura_damage"); + //Damage + ClassDB::bind_method(D_METHOD("aura_damage_get_enabled"), &Spell::aura_damage_get_enabled); + ClassDB::bind_method(D_METHOD("aura_damage_set_enabled", "value"), &Spell::aura_damage_set_enabled); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_damage_enabled"), "aura_damage_set_enabled", "aura_damage_get_enabled"); + + ClassDB::bind_method(D_METHOD("aura_damage_get_type"), &Spell::aura_damage_get_type); + ClassDB::bind_method(D_METHOD("aura_damage_set_type", "value"), &Spell::aura_damage_set_type); + ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_damage_type", PROPERTY_HINT_FLAGS, SpellEnums::BINDING_STRING_DAMAGE_TYPES), "aura_damage_set_type", "aura_damage_get_type"); + + ClassDB::bind_method(D_METHOD("aura_damage_get_min"), &Spell::aura_damage_get_min); + ClassDB::bind_method(D_METHOD("aura_damage_set_min", "value"), &Spell::aura_damage_set_min); + ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_damage_min"), "aura_damage_set_min", "aura_damage_get_min"); + + ClassDB::bind_method(D_METHOD("aura_damage_get_max"), &Spell::aura_damage_get_max); + ClassDB::bind_method(D_METHOD("aura_damage_set_max", "value"), &Spell::aura_damage_set_max); + ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_damage_max"), "aura_damage_set_max", "aura_damage_get_max"); + + ClassDB::bind_method(D_METHOD("aura_damage_get_can_crit"), &Spell::aura_damage_get_can_crit); + ClassDB::bind_method(D_METHOD("aura_damage_set_can_crit", "value"), &Spell::aura_damage_set_can_crit); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_damage_can_crit"), "aura_damage_set_can_crit", "aura_damage_get_can_crit"); + + ClassDB::bind_method(D_METHOD("aura_damage_set", "min", "max", "can_crit"), &Spell::aura_damage_set); + + ClassDB::bind_method(D_METHOD("aura_damage_get_scaling_curve"), &Spell::aura_damage_get_scaling_curve); + ClassDB::bind_method(D_METHOD("aura_damage_set_scaling_curve", "curve"), &Spell::aura_damage_set_scaling_curve); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_damage_scaling_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "aura_damage_set_scaling_curve", "aura_damage_get_scaling_curve"); + + ADD_GROUP("Aura Absorb", "aura_absorb"); + //Absorb + ClassDB::bind_method(D_METHOD("aura_absorb_get_enabled"), &Spell::aura_absorb_get_enabled); + ClassDB::bind_method(D_METHOD("aura_absorb_set_enabled", "value"), &Spell::aura_absorb_set_enabled); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_absorb_enabled"), "aura_absorb_set_enabled", "aura_absorb_get_enabled"); + + ClassDB::bind_method(D_METHOD("aura_absorb_damage_get_type"), &Spell::aura_absorb_damage_get_type); + ClassDB::bind_method(D_METHOD("aura_absorb_damage_set_type", "value"), &Spell::aura_absorb_damage_set_type); + ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_absorb_damage_type", PROPERTY_HINT_FLAGS, SpellEnums::BINDING_STRING_DAMAGE_TYPES), "aura_absorb_damage_set_type", "aura_absorb_damage_get_type"); + + ClassDB::bind_method(D_METHOD("aura_absorb_get_min"), &Spell::aura_absorb_get_min); + ClassDB::bind_method(D_METHOD("aura_absorb_set_min", "value"), &Spell::aura_absorb_set_min); + ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_absorb_min"), "aura_absorb_set_min", "aura_absorb_get_min"); + + ClassDB::bind_method(D_METHOD("aura_absorb_get_max"), &Spell::aura_absorb_get_max); + ClassDB::bind_method(D_METHOD("aura_absorb_set_max", "value"), &Spell::aura_absorb_set_max); + ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_absorb_max"), "aura_absorb_set_max", "aura_absorb_get_max"); + + ClassDB::bind_method(D_METHOD("aura_absorb_get_scaling_curve"), &Spell::aura_absorb_get_scaling_curve); + ClassDB::bind_method(D_METHOD("aura_absorb_set_scaling_curve", "curve"), &Spell::aura_absorb_set_scaling_curve); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_absorb_scaling_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "aura_absorb_set_scaling_curve", "aura_absorb_get_scaling_curve"); + + ADD_GROUP("Aura Heal", "aura_heal"); + //Heal + ClassDB::bind_method(D_METHOD("aura_heal_get_enabled"), &Spell::aura_heal_get_enabled); + ClassDB::bind_method(D_METHOD("aura_heal_set_enabled", "value"), &Spell::aura_heal_set_enabled); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_heal_enabled"), "aura_heal_set_enabled", "aura_heal_get_enabled"); + + ClassDB::bind_method(D_METHOD("aura_heal_get_min"), &Spell::aura_heal_get_min); + ClassDB::bind_method(D_METHOD("aura_heal_set_min", "value"), &Spell::aura_heal_set_min); + ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_heal_min"), "aura_heal_set_min", "aura_heal_get_min"); + + ClassDB::bind_method(D_METHOD("aura_heal_get_max"), &Spell::aura_heal_get_max); + ClassDB::bind_method(D_METHOD("aura_heal_set_max", "value"), &Spell::aura_heal_set_max); + ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_heal_max"), "aura_heal_set_max", "aura_heal_get_max"); + + ClassDB::bind_method(D_METHOD("aura_heal_get_can_crit"), &Spell::aura_heal_get_can_crit); + ClassDB::bind_method(D_METHOD("aura_heal_set_can_crit", "value"), &Spell::aura_heal_set_can_crit); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_heal_can_crit"), "aura_heal_set_can_crit", "aura_heal_get_can_crit"); + + ClassDB::bind_method(D_METHOD("aura_heal_set", "min", "max", "can_crit"), &Spell::aura_heal_set); + + ClassDB::bind_method(D_METHOD("aura_heal_get_scaling_curve"), &Spell::aura_heal_get_scaling_curve); + ClassDB::bind_method(D_METHOD("aura_heal_set_scaling_curve", "curve"), &Spell::aura_heal_set_scaling_curve); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_heal_scaling_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "aura_heal_set_scaling_curve", "aura_heal_get_scaling_curve"); + + ADD_GROUP("Aura Dispell", "aura_dispell"); + ClassDB::bind_method(D_METHOD("aura_dispell_get_enabled"), &Spell::aura_dispell_get_enabled); + ClassDB::bind_method(D_METHOD("aura_dispell_set_enabled", "value"), &Spell::aura_dispell_set_enabled); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_dispell_enabled"), "aura_dispell_set_enabled", "aura_dispell_get_enabled"); + + ClassDB::bind_method(D_METHOD("aura_dispell_get_count_min"), &Spell::aura_dispell_get_count_min); + ClassDB::bind_method(D_METHOD("aura_dispell_set_count_min", "value"), &Spell::aura_dispell_set_count_min); + ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_dispell_count_min"), "aura_dispell_set_count_min", "aura_dispell_get_count_min"); + + ClassDB::bind_method(D_METHOD("aura_dispell_get_count_max"), &Spell::aura_dispell_get_count_max); + ClassDB::bind_method(D_METHOD("aura_dispell_set_count_max", "value"), &Spell::aura_dispell_set_count_max); + ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_dispell_count_max"), "aura_dispell_set_count_max", "aura_dispell_get_count_max"); + + ClassDB::bind_method(D_METHOD("aura_dispell_get_aura_types"), &Spell::aura_dispell_get_aura_types); + ClassDB::bind_method(D_METHOD("aura_dispell_set_aura_types", "value"), &Spell::aura_dispell_set_aura_types); + ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_dispell_aura_types", PROPERTY_HINT_FLAGS, SpellEnums::BINDING_STRING_AURA_FLAG_TYPES), "aura_dispell_set_aura_types", "aura_dispell_get_aura_types"); + + //Resources + ADD_GROUP("Aura Resources", "aura_resource"); + ClassDB::bind_method(D_METHOD("aura_get_resource_cost"), &Spell::aura_get_resource_cost); + ClassDB::bind_method(D_METHOD("aura_set_resource_cost", "value"), &Spell::aura_set_resource_cost); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_resource_cost", PROPERTY_HINT_RESOURCE_TYPE, "EntityResourceCostData"), "aura_set_resource_cost", "aura_get_resource_cost"); + + ClassDB::bind_method(D_METHOD("aura_get_resource_give"), &Spell::aura_get_resource_give); + ClassDB::bind_method(D_METHOD("aura_set_resource_give", "value"), &Spell::aura_set_resource_give); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_resource_give", PROPERTY_HINT_RESOURCE_TYPE, "EntityResourceCostData"), "aura_set_resource_give", "aura_get_resource_give"); + + ADD_GROUP("Aura States", "aura_states"); + ClassDB::bind_method(D_METHOD("aura_get_add_states"), &Spell::aura_get_add_states); + ClassDB::bind_method(D_METHOD("aura_set_add_states", "value"), &Spell::aura_set_add_states); + ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_states_add", PROPERTY_HINT_FLAGS, EntityEnums::BINDING_STRING_ENTITY_STATE_TYPES), "aura_set_add_states", "aura_get_add_states"); + + ClassDB::bind_method(D_METHOD("aura_get_remove_effects_with_states"), &Spell::aura_get_remove_effects_with_states); + ClassDB::bind_method(D_METHOD("aura_set_remove_effects_with_states", "value"), &Spell::aura_set_remove_effects_with_states); + ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_states_remove_effects", PROPERTY_HINT_FLAGS, EntityEnums::BINDING_STRING_ENTITY_STATE_TYPES), "aura_set_remove_effects_with_states", "aura_get_remove_effects_with_states"); + + ClassDB::bind_method(D_METHOD("aura_get_supress_states"), &Spell::aura_get_supress_states); + ClassDB::bind_method(D_METHOD("aura_set_supress_states", "value"), &Spell::aura_set_supress_states); + ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_states_supress", PROPERTY_HINT_FLAGS, EntityEnums::BINDING_STRING_ENTITY_STATE_TYPES), "aura_set_supress_states", "aura_get_supress_states"); + + //Diminishing Returns + ADD_GROUP("Aura Diminishing Returns", "aura_diminishing_return"); + ClassDB::bind_method(D_METHOD("aura_diminishing_return_enabled_get"), &Spell::aura_diminishing_return_enabled_get); + ClassDB::bind_method(D_METHOD("aura_diminishing_return_enabled_set", "value"), &Spell::aura_diminishing_return_enabled_set); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "aura_diminishing_return_enabled"), "aura_diminishing_return_enabled_set", "aura_diminishing_return_enabled_get"); + + ClassDB::bind_method(D_METHOD("aura_diminishing_return_category_get"), &Spell::aura_diminishing_return_category_get); + ClassDB::bind_method(D_METHOD("aura_diminishing_return_category_set", "value"), &Spell::aura_diminishing_return_category_set); + ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_diminishing_return_category", PROPERTY_HINT_ENUM, ""), "aura_diminishing_return_category_set", "aura_diminishing_return_category_get"); + + //// Talents //// + ADD_GROUP("Aura Talent", "aura_talent"); + ClassDB::bind_method(D_METHOD("aura_get_talent_required_talent"), &Spell::aura_get_talent_required_talent); + ClassDB::bind_method(D_METHOD("aura_set_talent_required_talent", "next_rank"), &Spell::aura_set_talent_required_talent); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_talent_required_talent", PROPERTY_HINT_RESOURCE_TYPE, "Spell"), "aura_set_talent_required_talent", "aura_get_talent_required_talent"); + + ClassDB::bind_method(D_METHOD("aura_get_talent_required_spell"), &Spell::aura_get_talent_required_spell); + ClassDB::bind_method(D_METHOD("aura_set_talent_required_spell", "next_rank"), &Spell::aura_set_talent_required_spell); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_talent_required_spell", PROPERTY_HINT_RESOURCE_TYPE, "Spell"), "aura_set_talent_required_spell", "aura_get_talent_required_spell"); + + ADD_GROUP("Aura Teaches", "aura_teaches"); + ClassDB::bind_method(D_METHOD("aura_get_teaches_spell"), &Spell::aura_get_teaches_spell); + ClassDB::bind_method(D_METHOD("aura_set_teaches_spell", "next_rank"), &Spell::aura_set_teaches_spell); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_teaches_spell", PROPERTY_HINT_RESOURCE_TYPE, "Spell"), "aura_set_teaches_spell", "aura_get_teaches_spell"); + + //// Triggers //// + ADD_GROUP("Aura Triggers", "aura_trigger"); + ClassDB::bind_method(D_METHOD("aura_trigger_get_count"), &Spell::aura_trigger_get_count); + ClassDB::bind_method(D_METHOD("aura_trigger_set_count", "count"), &Spell::aura_trigger_set_count); + + ClassDB::bind_method(D_METHOD("aura_trigger_get_notification_type", "index"), &Spell::aura_trigger_get_notification_type); + ClassDB::bind_method(D_METHOD("aura_trigger_set_notification_type", "index", "value"), &Spell::aura_trigger_set_notification_type); + + ClassDB::bind_method(D_METHOD("aura_trigger_get_notification_data", "index"), &Spell::aura_trigger_get_notification_data); + ClassDB::bind_method(D_METHOD("aura_trigger_set_notification_data", "index", "value"), &Spell::aura_trigger_set_notification_data); + + ClassDB::bind_method(D_METHOD("aura_trigger_get_trigger_type", "index"), &Spell::aura_trigger_get_trigger_type); + ClassDB::bind_method(D_METHOD("aura_trigger_set_trigger_type", "index", "value"), &Spell::aura_trigger_set_trigger_type); + + ClassDB::bind_method(D_METHOD("aura_trigger_get_trigger_type_data", "index"), &Spell::aura_trigger_get_trigger_type_data); + ClassDB::bind_method(D_METHOD("aura_trigger_set_trigger_type_data", "index", "value"), &Spell::aura_trigger_set_trigger_type_data); + + ClassDB::bind_method(D_METHOD("aura_trigger_get_spell", "index"), &Spell::aura_trigger_get_spell); + ClassDB::bind_method(D_METHOD("aura_trigger_set_spell", "index", "value"), &Spell::aura_trigger_set_spell); + + ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_trigger_count", PROPERTY_HINT_RANGE, "0," + itos(MAX_TRIGGER_DATA), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), "aura_trigger_set_count", "aura_trigger_get_count"); + + for (int i = 0; i < MAX_TRIGGER_DATA; i++) { + ADD_PROPERTYI(PropertyInfo(Variant::INT, "aura_trigger_" + itos(i) + "/notification_type", PROPERTY_HINT_ENUM, SpellEnums::BINDING_STRING_TRIGGER_NOTIFICATION_TYPE, PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), "aura_trigger_set_notification_type", "aura_trigger_get_notification_type", i); + ADD_PROPERTYI(PropertyInfo(Variant::INT, "aura_trigger_" + itos(i) + "/notification_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "aura_trigger_set_notification_data", "aura_trigger_get_notification_data", i); + ADD_PROPERTYI(PropertyInfo(Variant::INT, "aura_trigger_" + itos(i) + "/trigger_type", PROPERTY_HINT_ENUM, SpellEnums::BINDING_STRING_TRIGGER_TYPE, PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "aura_trigger_set_trigger_type", "aura_trigger_get_trigger_type", i); + ADD_PROPERTYI(PropertyInfo(Variant::REAL, "aura_trigger_" + itos(i) + "/trigger_type_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "aura_trigger_set_trigger_type_data", "aura_trigger_get_trigger_type_data", i); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "aura_trigger_" + itos(i) + "/spell", PROPERTY_HINT_RESOURCE_TYPE, "Spell", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "aura_trigger_set_spell", "aura_trigger_get_spell", i); + } + + ADD_GROUP("Aura Stat Attributes", "aura_stat_attribute"); + //AuraStatAttributes + ClassDB::bind_method(D_METHOD("aura_stat_attribute_get_count"), &Spell::aura_stat_attribute_get_count); + ClassDB::bind_method(D_METHOD("aura_stat_attribute_set_count", "count"), &Spell::aura_stat_attribute_set_count); + + ClassDB::bind_method(D_METHOD("aura_stat_attribute_get_stat", "index"), &Spell::aura_stat_attribute_get_stat); + ClassDB::bind_method(D_METHOD("aura_stat_attribute_set_stat", "index", "value"), &Spell::aura_stat_attribute_set_stat); + + ClassDB::bind_method(D_METHOD("aura_stat_attribute_get_base_mod", "index"), &Spell::aura_stat_attribute_get_base_mod); + ClassDB::bind_method(D_METHOD("aura_stat_attribute_set_base_mod", "index", "value"), &Spell::aura_stat_attribute_set_base_mod); + + ClassDB::bind_method(D_METHOD("aura_stat_attribute_get_bonus_mod", "index"), &Spell::aura_stat_attribute_get_bonus_mod); + ClassDB::bind_method(D_METHOD("aura_stat_attribute_set_bonus_mod", "index", "value"), &Spell::aura_stat_attribute_set_bonus_mod); + + ClassDB::bind_method(D_METHOD("aura_stat_attribute_get_percent_mod", "index"), &Spell::aura_stat_attribute_get_percent_mod); + ClassDB::bind_method(D_METHOD("aura_stat_attribute_set_percent_mod", "index", "value"), &Spell::aura_stat_attribute_set_percent_mod); + + ADD_PROPERTY(PropertyInfo(Variant::INT, "aura_stat_attribute_count", PROPERTY_HINT_RANGE, "0," + itos(MAX_AURA_STATS), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), "aura_stat_attribute_set_count", "aura_stat_attribute_get_count"); + + for (int i = 0; i < MAX_AURA_STATS; i++) { + ADD_PROPERTYI(PropertyInfo(Variant::INT, "aura_stat_attribute_" + itos(i) + "/stat", PROPERTY_HINT_ENUM, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "aura_stat_attribute_set_stat", "aura_stat_attribute_get_stat", i); + ADD_PROPERTYI(PropertyInfo(Variant::REAL, "aura_stat_attribute_" + itos(i) + "/base_mod", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "aura_stat_attribute_set_base_mod", "aura_stat_attribute_get_base_mod", i); + ADD_PROPERTYI(PropertyInfo(Variant::REAL, "aura_stat_attribute_" + itos(i) + "/bonus_mod", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "aura_stat_attribute_set_bonus_mod", "aura_stat_attribute_get_bonus_mod", i); + ADD_PROPERTYI(PropertyInfo(Variant::REAL, "aura_stat_attribute_" + itos(i) + "/percent_mod", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "aura_stat_attribute_set_percent_mod", "aura_stat_attribute_get_percent_mod", i); + } + + ClassDB::bind_method(D_METHOD("aura_is_talent"), &Spell::aura_is_talent); + BIND_ENUM_CONSTANT(TARGET_SELF); BIND_ENUM_CONSTANT(TARGET_ENEMY); BIND_ENUM_CONSTANT(TARGET_FRIENDLY); @@ -1429,4 +3126,7 @@ void Spell::_bind_methods() { BIND_ENUM_CONSTANT(SPELL_AOE_TARGET_TYPE_TARGET); BIND_ENUM_CONSTANT(SPELL_AOE_TARGET_TYPE_GOUND_TARGET_SELECTION); BIND_ENUM_CONSTANT(SPELL_AOE_TARGET_TYPE_RANDOM); + + BIND_CONSTANT(MAX_AURA_STATS); + BIND_CONSTANT(MAX_TRIGGER_DATA); } diff --git a/data/spells/spell.h b/data/spells/spell.h index 2a0bc35..c36f5df 100644 --- a/data/spells/spell.h +++ b/data/spells/spell.h @@ -33,16 +33,15 @@ SOFTWARE. #include "scene/resources/texture.h" -#include "../../entity_enums.h" -#include "../../spell_enums.h" -#include "../../infos/spell_cast_info.h" #include "../../entities/entity.h" +#include "../../entity_enums.h" #include "../../infos/aura_infos.h" +#include "../../infos/spell_cast_info.h" +#include "../../spell_enums.h" #include "spell_effect_visual.h" class Entity; -class Aura; class SpellCastInfo; class Spell; class CraftRecipe; @@ -50,6 +49,10 @@ class EntityResourceCostData; class EntitySkillData; class SpellDamageInfo; class SpellHealInfo; +class AuraData; +class AuraGroup; +class AuraApplyInfo; +class EntityResource; enum TargetRelationType { TARGET_SELF = 1 << 0, @@ -149,8 +152,8 @@ public: int spells_cast_on_caster_num_get() const; void spells_cast_on_caster_num_set(const int value); - Ref spell_cast_on_caster_get(const int index); - void spell_cast_on_caster_set(const int index, const Ref &spell); + Ref spell_cast_on_caster_get(const int index); + void spell_cast_on_caster_set(const int index, const Ref &spell); Vector spells_cast_on_caster_get(); void spells_cast_on_caster_set(const Vector &spells); @@ -159,8 +162,8 @@ public: int spells_cast_on_target_num_get() const; void spells_cast_on_target_num_set(const int value); - Ref spell_cast_on_target_get(const int index); - void spell_cast_on_target_set(const int index, const Ref &spell); + Ref spell_cast_on_target_get(const int index); + void spell_cast_on_target_set(const int index, const Ref &spell); Vector spells_cast_on_target_get(); void spells_cast_on_target_set(const Vector &target_aura_applys); @@ -169,8 +172,8 @@ public: int on_learn_cast_spells_num_get() const; void on_learn_cast_spells_num_set(const int value); - Ref spell_cast_on_learn_get(const int index); - void spell_cast_on_learn_set(const int index, const Ref &spell); + Ref spell_cast_on_learn_get(const int index); + void spell_cast_on_learn_set(const int index, const Ref &spell); Vector spells_cast_on_learn_get(); void spells_cast_on_learn_set(const Vector &spells); @@ -295,6 +298,181 @@ public: int get_training_required_skill_level() const; void set_training_required_skill_level(const int value); + float aura_get_time() const; + void aura_set_time(const float value); + + Ref aura_get_aura_group(); + void aura_set_aura_group(const Ref &value); + + bool aura_get_is_debuff() const; + void aura_set_is_debuff(const bool value); + + float aura_get_tick() const; + void aura_set_tick(const float value); + + SpellEnums::AuraType aura_get_aura_type() const; + void aura_set_aura_type(const SpellEnums::AuraType value); + + bool aura_get_scale_with_level() const; + void aura_set_scale_with_level(const bool value); + + String aura_get_text_translation_key() const; + void aura_set_text_translation_key(const String &value); + + String aura_get_text_description() const; + void aura_set_text_description(const String description); + + bool aura_get_hide() const; + void aura_set_hide(const bool value); + + Ref aura_get_visual_spell_effects(); + void aura_set_visual_spell_effects(const Ref &value); + + int aura_get_ability_scale_data_id() const; + void aura_set_ability_scale_data_id(const int value); + + float aura_damage_get_scale_for_level(int level) const; + float aura_heal_get_scale_for_level(int level) const; + float aura_absorb_get_scale_for_level(int level) const; + + Ref aura_get_teaches_spell(); + void aura_set_teaches_spell(const Ref &spell); + + //Damage + bool aura_damage_get_enabled() const; + void aura_damage_set_enabled(const bool value); + + int aura_damage_get_type() const; + + void aura_damage_set_type(const int value); + + int aura_damage_get_min() const; + void aura_damage_set_min(const int value); + + int aura_damage_get_max() const; + void aura_damage_set_max(const int value); + + bool aura_damage_get_can_crit() const; + void aura_damage_set_can_crit(const bool value); + + void aura_damage_set(const int min, const int max, const bool can_crit); + + //Absorb + bool aura_absorb_get_enabled() const; + void aura_absorb_set_enabled(const bool value); + + int aura_absorb_damage_get_type() const; + void aura_absorb_damage_set_type(const int value); + + int aura_absorb_get_min() const; + void aura_absorb_set_min(const int value); + + int aura_absorb_get_max() const; + void aura_absorb_set_max(const int value); + + //Heal + bool aura_heal_get_enabled() const; + void aura_heal_set_enabled(const bool value); + + int aura_heal_get_min() const; + void aura_heal_set_min(const int value); + + int aura_heal_get_max() const; + void aura_heal_set_max(const int value); + + bool aura_heal_get_can_crit() const; + void aura_heal_set_can_crit(const bool value); + + void aura_heal_set(const int min, const int max, const bool can_crit); + + //Dispells + bool aura_dispell_get_enabled() const; + void aura_dispell_set_enabled(const bool value); + + int aura_dispell_get_count_min() const; + void aura_dispell_set_count_min(const int value); + + int aura_dispell_get_count_max() const; + void aura_dispell_set_count_max(const int value); + + int aura_dispell_get_aura_types() const; + void aura_dispell_set_aura_types(const int value); + + //Resources + Ref aura_get_resource_cost(); + void aura_set_resource_cost(const Ref &value); + + Ref aura_get_resource_give(); + void aura_set_resource_give(const Ref &value); + + Ref aura_damage_get_scaling_curve() { return _aura_damage_scaling_curve; } + void aura_damage_set_scaling_curve(const Ref &curve) { _aura_damage_scaling_curve = curve; } + + Ref aura_heal_get_scaling_curve() { return _aura_heal_scaling_curve; } + void aura_heal_set_scaling_curve(const Ref &curve) { _aura_heal_scaling_curve = curve; } + + Ref aura_absorb_get_scaling_curve() { return _aura_absorb_scaling_curve; } + void aura_absorb_set_scaling_curve(const Ref &curve) { _aura_absorb_scaling_curve = curve; } + + //states + int aura_get_add_states() const { return _aura_add_states; } + void aura_set_add_states(const int value) { _aura_add_states = value; } + + int aura_get_remove_effects_with_states() const { return _aura_remove_effects_with_states; } + void aura_set_remove_effects_with_states(const int value) { _aura_remove_effects_with_states = value; } + + int aura_get_supress_states() const { return _aura_supress_states; } + void aura_set_supress_states(const int value) { _aura_supress_states = value; } + + //DiminishingReturns + bool aura_diminishing_return_enabled_get() const; + void aura_diminishing_return_enabled_set(const bool value); + + int aura_diminishing_return_category_get() const; + void aura_diminishing_return_category_set(const int value); + + //Triggers + int aura_trigger_get_count() const; + void aura_trigger_set_count(const int count); + + SpellEnums::TriggerNotificationType aura_trigger_get_notification_type(const int index) const; + void aura_trigger_set_notification_type(const int index, const SpellEnums::TriggerNotificationType value); + + int aura_trigger_get_notification_data(const int index) const; + void aura_trigger_set_notification_data(const int index, const int value); + + SpellEnums::TriggerType aura_trigger_get_trigger_type(const int index) const; + void aura_trigger_set_trigger_type(const int index, const SpellEnums::TriggerType value); + + float aura_trigger_get_trigger_type_data(const int index) const; + void aura_trigger_set_trigger_type_data(const int index, const float value); + + Ref aura_trigger_get_spell(const int index) const; + void aura_trigger_set_spell(const int index, const Ref &value); + + //Talent + Ref aura_get_talent_required_talent() const; + void aura_set_talent_required_talent(const Ref rank); + + Ref aura_get_talent_required_spell() const; + void aura_set_talent_required_spell(const Ref spell); + + //AuraStatAttributes + int aura_stat_attribute_get_count() const; + void aura_stat_attribute_set_count(int count); + + int aura_stat_attribute_get_stat(int index) const; + void aura_stat_attribute_set_stat(int index, const int value); + + float aura_stat_attribute_get_base_mod(int index) const; + void aura_stat_attribute_set_base_mod(int index, float value); + + float aura_stat_attribute_get_bonus_mod(int index) const; + void aura_stat_attribute_set_bonus_mod(int index, float value); + + float aura_stat_attribute_get_percent_mod(int index) const; + void aura_stat_attribute_set_percent_mod(int index, float value); + //// Spell Script //// float PLAYER_HIT_RADIUS; @@ -303,6 +481,7 @@ public: void cast_starts_simple(Entity *caster, float spell_scale); void cast_interrupts_simple(Entity *caster); void cast_starts_triggered_simple(Entity *caster); + void aura_sapply_simple(Entity *caster, Entity *target, float spell_scale); //Commands void cast_starts(Ref info); @@ -310,16 +489,82 @@ public: void cast_interrupts(Ref info); void cast_finishs(Ref info); + void aura_sapply(Ref info); + void aura_sdeapply(Ref info); + void aura_sadd(Ref aura); + void aura_sremove(Ref aura); + void aura_removes_expired(Ref aura); + void aura_removes_dispell(Ref aura); + void aura_supdate(Ref aura, float delta); + //eventhandlers void son_cast_player_moved(Ref info); void son_cast_damage_received(Ref info); void son_spell_hit(Ref info); void son_physics_process(Ref info, float delta); + void notification_saura(int what, Ref data); + void notification_sheal(int what, Ref aura, Ref data); + void notification_aura_scast(int what, Ref aura, Ref info); + void notification_sdamage(int what, Ref aura, Ref data); + + void son_remove(Ref aura); + void son_remove_expired(Ref aura); + void son_remove_dispell(Ref aura); + + void notification_sdeath(Ref data); + + void notification_scooldown_added(Ref data, int id, float value); + void notification_scooldown_removed(Ref data, int id, float value); + + void notification_scategory_cooldown_added(Ref data, int id, float value); + void notification_scategory_cooldown_removed(Ref data, int id, float value); + + void notification_sgcd_started(Ref data, float gcd); + void notification_sgcd_finished(Ref data); + + void son_physics_process_aura(Ref data); + + void notification_sxp_gained(Ref data, int value); + void notification_slevel_up(Ref data, int value); + + void notification_sentity_resource_added(Ref data, Ref resource); + void notification_sentity_resource_removed(Ref data, Ref resource); + //Clientside Event Handlers void notification_scast(int what, Ref info); void notification_ccast(int what, Ref info); + void notification_caura(int what, Ref data); + void notification_cheal(int what, Ref aura, Ref data); + void notification_aura_ccast(int what, Ref aura, Ref info); + void notification_cdamage(int what, Ref aura, Ref data); + + void notification_cdeath(Ref data); + + void notification_ccooldown_added(Ref data, int id, float value); + void notification_ccooldown_removed(Ref data, int id, float value); + void notification_ccategory_cooldown_added(Ref data, int id, float value); + void notification_ccategory_cooldown_removed(Ref data, int id, float value); + + void notification_cgcd_started(Ref data, float gcd); + void notification_cgcd_finished(Ref data); + + void notification_cxp_gained(Ref data, int value); + void notification_clevel_up(Ref data, int value); + + void notification_centity_resource_added(Ref data, Ref resource); + void notification_centity_resource_removed(Ref data, Ref resource); + + //Equipment + bool equip_should_deny(Ref data, int equip_slot, Ref item); + + void equip_son_success(Ref data, int equip_slot, Ref item, Ref old_item, int bag_slot); + void equip_son_fail(Ref data, int equip_slot, Ref item, Ref old_item, int bag_slot); + + void equip_con_success(Ref data, int equip_slot, Ref item, Ref old_item, int bag_slot); + void equip_con_fail(Ref data, int equip_slot, Ref item, Ref old_item, int bag_slot); + //Calculations / Queries void calculate_initial_damage(Ref data); void handle_spell_damage(Ref data); @@ -333,10 +578,28 @@ public: void handle_gcd(Ref info); void handle_cooldown(Ref info); + void setup_aura_data(Ref data, Ref info); + + void aura_sapply_passives_damage_receive(Ref info); + void aura_sapply_passives_damage_deal(Ref info); + void aura_calculate_initial_damage(Ref aura_data, Ref info); + void handle_aura_damage(Ref aura_data, Ref info); + + void aura_sapply_passives_heal_receive(Ref info); + void aura_sapply_passives_heal_deal(Ref info); + void aura_calculate_initial_heal(Ref aura_data, Ref info); + void handle_aura_heal(Ref aura_data, Ref info); + + _FORCE_INLINE_ bool aura_is_talent() const { return _aura_type == SpellEnums::AURA_TYPE_TALENT; } + String get_name_translated() const; String get_description(const int class_level, const int character_level); String _get_description(const int class_level, const int character_level); + String aura_get_name_translated() const; + String aura_get_description(const int class_level, const int character_level); + String _aura_get_description(const int class_level, const int character_level); + Spell(); ~Spell(); @@ -356,10 +619,65 @@ protected: virtual void _handle_projectile(Ref info); virtual void _handle_effect(Ref info); + virtual void _aura_sapply(Ref info); + virtual void _aura_sdeapply(Ref info); + virtual void _aura_sadd(Ref aura); + virtual void _aura_sremove(Ref aura); + virtual void _aura_removes_expired(Ref aura); + virtual void _aura_removes_dispell(Ref aura); + virtual void _aura_supdate(Ref aura, float delta); + + virtual void _setup_aura_data(Ref data, Ref info); + + virtual void _aura_sapply_passives_damage_receive(Ref info); + virtual void _aura_sapply_passives_damage_deal(Ref info); + virtual void _aura_calculate_initial_damage(Ref aura_data, Ref info); + virtual void _handle_aura_damage(Ref aura_data, Ref info); + + virtual void _aura_sapply_passives_heal_receive(Ref info); + virtual void _aura_sapply_passives_heal_deal(Ref info); + virtual void _aura_calculate_initial_heal(Ref aura_data, Ref info); + virtual void _handle_aura_heal(Ref aura_data, Ref info); + void _validate_property(PropertyInfo &property) const; static void _bind_methods(); +protected: + struct AuraTriggerData { + SpellEnums::TriggerNotificationType notification_type; + int notification_data; + SpellEnums::TriggerType trigger_type; + float trigger_type_data; + Ref spell; + + AuraTriggerData() { + notification_type = SpellEnums::TRIGGER_NOTIFICATION_TYPE_AURA; + trigger_type = SpellEnums::TRIGGER_TYPE_NONE; + notification_data = 0; + trigger_type_data = 0; + } + }; + + struct AuraStatAttribute { + int stat; + float base_mod; + float bonus_mod; + float percent_mod; + + AuraStatAttribute() { + stat = 0; + base_mod = 0; + bonus_mod = 0; + percent_mod = 0; + } + }; + private: + enum { + MAX_AURA_STATS = 5, //Increase if necessary, should be enough for now + MAX_TRIGGER_DATA = 5, + }; + int _id; int _spell_type; SpellEnums::SpellCategory _spell_category; @@ -369,9 +687,9 @@ private: SpellTargetType _target_type; TargetRelationType _target_relation_type; - Vector > _spells_cast_on_caster; - Vector > _spells_cast_on_target; - Vector > _on_learn_cast_spells; + Vector> _spells_cast_on_caster; + Vector> _spells_cast_on_target; + Vector> _on_learn_cast_spells; int _level; int _rank; @@ -444,6 +762,69 @@ private: Ref _training_required_spell; Ref _training_required_skill; int _training_required_skill_level; + + //Aura + + float _aura_time; + float _aura_tick; + Ref _aura_group; + + SpellEnums::AuraType _aura_type; + bool _aura_is_debuff; + bool _aura_hide; + Ref _aura_teaches_spell; + + String _aura_text_translation_key; + String _aura_text_description; + int _aura_ability_scale_data_id; + + bool _aura_scale_with_level; + + Ref _aura_visual_spell_effects; + + bool _aura_damage_enabled; + int _aura_damage_type; + int _aura_damage_min; + int _aura_damage_max; + bool _aura_damage_can_crit; + Ref _aura_damage_scaling_curve; + + bool _aura_absorb_enabled; + int _aura_absorb_damage_type; + int _aura_absorb_min; + int _aura_absorb_max; + Ref _aura_absorb_scaling_curve; + + bool _aura_heal_enabled; + int _aura_heal_min; + int _aura_heal_max; + bool _aura_heal_can_crit; + Ref _aura_heal_scaling_curve; + + bool _aura_dispell_enabled; + int _aura_dispell_count_min; + int _aura_dispell_count_max; + int _aura_dispell_aura_types; + + Ref _aura_resource_cost; + Ref _aura_resource_give; + + int _aura_add_states; + int _aura_remove_effects_with_states; + int _aura_supress_states; + + int _aura_trigger_count; + AuraTriggerData _aura_trigger_datas[MAX_TRIGGER_DATA]; + + int _aura_stat_attribute_count; + AuraStatAttribute _aura_stat_attributes[MAX_AURA_STATS]; + + bool _aura_diminishing_return_enabled; + int _aura_diminishing_return_category; + + //Talent + Ref _aura_talent_required_talent; + Ref _aura_talent_required_spell; }; #endif diff --git a/database/ess_resource_db.cpp b/database/ess_resource_db.cpp index 760cc90..18abcb7 100644 --- a/database/ess_resource_db.cpp +++ b/database/ess_resource_db.cpp @@ -22,7 +22,6 @@ SOFTWARE. #include "ess_resource_db.h" -#include "../data/auras/aura.h" #include "../data/items/craft_recipe.h" #include "../data/species/entity_species_data.h" #include "../data/spells/spell.h" @@ -30,12 +29,12 @@ SOFTWARE. #include "../entities/resources/entity_resource.h" #include "../entities/skills/entity_skill_data.h" -Ref ESSResourceDB::get_skill_for_armor_type(const int index) { - ERR_FAIL_INDEX_V(index, ItemEnums::ARMOR_TYPE_MAX, Ref()); +Ref ESSResourceDB::get_skill_for_armor_type(const int index) { + ERR_FAIL_INDEX_V(index, ItemEnums::ARMOR_TYPE_MAX, Ref()); return _armor_type_skills[index]; } -void ESSResourceDB::set_skill_for_armor_type(const int index, const Ref &aura) { +void ESSResourceDB::set_skill_for_armor_type(const int index, const Ref &aura) { ERR_FAIL_INDEX(index, ItemEnums::ARMOR_TYPE_MAX); _armor_type_skills[index] = aura; @@ -89,18 +88,6 @@ Ref ESSResourceDB::get_spell_path(const StringName &path) { return get_spell(spell_path_to_id(path)); } -void ESSResourceDB::add_aura(Ref aura) { - if (!aura.is_valid()) - return; - - _aura_id_to_path.set(aura->get_id(), aura->get_path()); - _aura_path_to_id.set(aura->get_path(), aura->get_id()); -} - -Ref ESSResourceDB::get_aura_path(const StringName &path) { - return get_aura(aura_path_to_id(path)); -} - void ESSResourceDB::add_craft_recipe(Ref cda) { if (!cda.is_valid()) return; @@ -181,17 +168,6 @@ int ESSResourceDB::spell_path_to_id(const StringName &path) const { return _spell_path_to_id[path]; } -StringName ESSResourceDB::aura_id_to_path(const int id) const { - ERR_FAIL_COND_V(!_aura_id_to_path.has(id), StringName()); - - return _aura_id_to_path[id]; -} -int ESSResourceDB::aura_path_to_id(const StringName &path) const { - ERR_FAIL_COND_V(!_aura_path_to_id.has(path), 0); - - return _aura_path_to_id[path]; -} - StringName ESSResourceDB::craft_recipe_id_to_path(const int id) const { ERR_FAIL_COND_V(!_craft_recipe_id_to_path.has(id), StringName()); @@ -248,10 +224,6 @@ void ESSResourceDB::add_entity_resource_db(Ref other) { add_spell(other->get_spell_index(i)); } - for (int i = 0; i < other->get_aura_count(); ++i) { - add_aura(other->get_aura_index(i)); - } - for (int i = 0; i < other->get_craft_recipe_count(); ++i) { add_craft_recipe(other->get_craft_recipe_index(i)); } @@ -286,9 +258,6 @@ ESSResourceDB::~ESSResourceDB() { _spell_path_to_id.clear(); _spell_id_to_path.clear(); - _aura_path_to_id.clear(); - _aura_id_to_path.clear(); - _craft_recipe_path_to_id.clear(); _craft_recipe_id_to_path.clear(); @@ -304,7 +273,7 @@ void ESSResourceDB::_bind_methods() { ClassDB::bind_method(D_METHOD("set_skill_for_armor_type", "index", "aura"), &ESSResourceDB::set_skill_for_armor_type); for (int i = 0; i < ItemEnums::ARMOR_TYPE_MAX; ++i) { - ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "skill_for_armor_type_" + itos(i), PROPERTY_HINT_RESOURCE_TYPE, "Aura"), "set_skill_for_armor_type", "get_skill_for_armor_type", i); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "skill_for_armor_type_" + itos(i), PROPERTY_HINT_RESOURCE_TYPE, "Spell"), "set_skill_for_armor_type", "get_skill_for_armor_type", i); } //EntityResource @@ -355,18 +324,6 @@ void ESSResourceDB::_bind_methods() { ClassDB::bind_method(D_METHOD("spell_id_to_path", "id"), &ESSResourceDB::spell_id_to_path); ClassDB::bind_method(D_METHOD("spell_path_to_id", "path"), &ESSResourceDB::spell_path_to_id); - //Aura - ClassDB::bind_method(D_METHOD("add_aura", "spell"), &ESSResourceDB::add_aura); - ClassDB::bind_method(D_METHOD("get_aura", "id"), &ESSResourceDB::get_aura); - ClassDB::bind_method(D_METHOD("get_aura_index", "index"), &ESSResourceDB::get_aura_index); - ClassDB::bind_method(D_METHOD("get_aura_count"), &ESSResourceDB::get_aura_count); - ClassDB::bind_method(D_METHOD("get_auras"), &ESSResourceDB::get_auras); - ClassDB::bind_method(D_METHOD("set_auras", "recipe"), &ESSResourceDB::set_auras); - - ClassDB::bind_method(D_METHOD("get_aura_path", "path"), &ESSResourceDB::get_aura_path); - ClassDB::bind_method(D_METHOD("aura_id_to_path", "id"), &ESSResourceDB::aura_id_to_path); - ClassDB::bind_method(D_METHOD("aura_path_to_id", "path"), &ESSResourceDB::aura_path_to_id); - //Craft Data ClassDB::bind_method(D_METHOD("add_craft_recipe", "craft_recipe"), &ESSResourceDB::add_craft_recipe); ClassDB::bind_method(D_METHOD("get_craft_recipe", "craft_recipe_id"), &ESSResourceDB::get_craft_recipe); diff --git a/database/ess_resource_db.h b/database/ess_resource_db.h index 29da79b..9f6c838 100644 --- a/database/ess_resource_db.h +++ b/database/ess_resource_db.h @@ -43,7 +43,6 @@ SOFTWARE. #include "../item_enums.h" -class Aura; class Spell; class EntityData; class CraftRecipe; @@ -58,8 +57,8 @@ class ESSResourceDB : public Resource { GDCLASS(ESSResourceDB, Resource); public: - Ref get_skill_for_armor_type(const int index); - void set_skill_for_armor_type(const int index, const Ref &aura); + Ref get_skill_for_armor_type(const int index); + void set_skill_for_armor_type(const int index, const Ref &aura); virtual Ref get_entity_resource(int class_id) = 0; virtual Ref get_entity_resource_index(int index) = 0; @@ -105,17 +104,6 @@ public: StringName spell_id_to_path(const int id) const; int spell_path_to_id(const StringName &path) const; - virtual Ref get_aura(int aura_id) = 0; - virtual Ref get_aura_index(int index) = 0; - virtual int get_aura_count() = 0; - virtual void add_aura(Ref aura); - virtual Vector get_auras() const = 0; - virtual void set_auras(const Vector &data) = 0; - - Ref get_aura_path(const StringName &path); - StringName aura_id_to_path(const int id) const; - int aura_path_to_id(const StringName &path) const; - virtual Ref get_craft_recipe(int craft_id) = 0; virtual Ref get_craft_recipe_index(int index) = 0; virtual int get_craft_recipe_count() = 0; @@ -161,7 +149,7 @@ public: protected: static void _bind_methods(); - Ref _armor_type_skills[ItemEnums::ARMOR_TYPE_MAX]; + Ref _armor_type_skills[ItemEnums::ARMOR_TYPE_MAX]; HashMap _entity_resources_id_to_path; HashMap _entity_resources_path_to_id; @@ -175,9 +163,6 @@ protected: HashMap _spell_id_to_path; HashMap _spell_path_to_id; - HashMap _aura_id_to_path; - HashMap _aura_path_to_id; - HashMap _craft_recipe_id_to_path; HashMap _craft_recipe_path_to_id; diff --git a/database/ess_resource_db_folders.cpp b/database/ess_resource_db_folders.cpp index a868e60..cf9460c 100644 --- a/database/ess_resource_db_folders.cpp +++ b/database/ess_resource_db_folders.cpp @@ -22,7 +22,6 @@ SOFTWARE. #include "ess_resource_db_folders.h" -#include "../data/auras/aura.h" #include "../data/items/craft_recipe.h" #include "../data/species/entity_species_data.h" #include "../data/spells/spell.h" @@ -113,8 +112,6 @@ void ESSResourceDBFolders::add_resource(const Ref &resource) { add_entity_data(resource); } else if (cls == "Spell") { add_spell(resource); - } else if (cls == "Aura") { - add_aura(resource); } else if (cls == "CraftRecipe") { add_craft_recipe(resource); } else if (cls == "ItemTemplate") { diff --git a/database/ess_resource_db_folders.h b/database/ess_resource_db_folders.h index 5a230ca..d5c7173 100644 --- a/database/ess_resource_db_folders.h +++ b/database/ess_resource_db_folders.h @@ -51,7 +51,6 @@ SOFTWARE. #include "../defines.h" -class Aura; class Spell; class EntityData; class CraftRecipe; diff --git a/database/ess_resource_db_map.cpp b/database/ess_resource_db_map.cpp index edca82d..a5c6012 100644 --- a/database/ess_resource_db_map.cpp +++ b/database/ess_resource_db_map.cpp @@ -22,7 +22,6 @@ SOFTWARE. #include "ess_resource_db_map.h" -#include "../data/auras/aura.h" #include "../data/items/craft_recipe.h" #include "../data/species/entity_species_data.h" #include "../data/spells/spell.h" @@ -179,46 +178,6 @@ void ESSResourceDBMap::set_spells(const Vector &data) { } } -void ESSResourceDBMap::add_aura(Ref aura) { - ERR_FAIL_COND(!aura.is_valid()); - - _auras.push_back(aura); - _aura_map.set(aura->get_id(), aura); - _aura_id_to_path.set(aura->get_id(), aura->get_path()); - _aura_path_to_id.set(aura->get_path(), aura->get_id()); -} - -Ref ESSResourceDBMap::get_aura(int aura_id) { - ERR_FAIL_COND_V_MSG(!_aura_map.has(aura_id), Ref(), "Could not find Aura! Id:" + String::num(aura_id)); - - return _aura_map.get(aura_id); -} - -Ref ESSResourceDBMap::get_aura_index(int index) { - ERR_FAIL_INDEX_V(index, _auras.size(), Ref()); - - return _auras.get(index); -} - -int ESSResourceDBMap::get_aura_count() { - return _auras.size(); -} - -Vector ESSResourceDBMap::get_auras() const { - VARIANT_ARRAY_GET(_auras); -} -void ESSResourceDBMap::set_auras(const Vector &data) { - _auras.clear(); - _aura_map.clear(); - for (int i = 0; i < data.size(); i++) { - Ref d = Ref(data[i]); - - ERR_CONTINUE(!d.is_valid()); - - add_aura(d); - } -} - //Craft Data void ESSResourceDBMap::add_craft_recipe(Ref cda) { ERR_FAIL_COND(!cda.is_valid()); @@ -352,9 +311,6 @@ ESSResourceDBMap::~ESSResourceDBMap() { _spells.clear(); _spell_map.clear(); - _auras.clear(); - _aura_map.clear(); - _craft_recipes.clear(); _craft_recipe_map.clear(); diff --git a/database/ess_resource_db_map.h b/database/ess_resource_db_map.h index 7315ba2..86bacb3 100644 --- a/database/ess_resource_db_map.h +++ b/database/ess_resource_db_map.h @@ -51,7 +51,6 @@ SOFTWARE. #include "../defines.h" -class Aura; class Spell; class EntityData; class CraftRecipe; @@ -94,13 +93,6 @@ public: Vector get_spells() const; void set_spells(const Vector &data); - Ref get_aura(int aura_id); - Ref get_aura_index(int index); - int get_aura_count(); - void add_aura(Ref aura); - Vector get_auras() const; - void set_auras(const Vector &data); - Ref get_craft_recipe(int craft_id); Ref get_craft_recipe_index(int index); int get_craft_recipe_count(); @@ -141,9 +133,6 @@ private: Vector > _spells; HashMap > _spell_map; - Vector > _auras; - HashMap > _aura_map; - Vector > _craft_recipes; HashMap > _craft_recipe_map; diff --git a/database/ess_resource_db_static.cpp b/database/ess_resource_db_static.cpp index 98e4493..7708b2d 100644 --- a/database/ess_resource_db_static.cpp +++ b/database/ess_resource_db_static.cpp @@ -22,7 +22,6 @@ SOFTWARE. #include "ess_resource_db_static.h" -#include "../data/auras/aura.h" #include "../data/items/craft_recipe.h" #include "../data/species/entity_species_data.h" #include "../data/spells/spell.h" @@ -174,44 +173,6 @@ void ESSResourceDBStatic::set_spells(const Vector &data) { } } -void ESSResourceDBStatic::add_aura(Ref aura) { - if (_remap_ids && aura.is_valid()) - aura->set_id(_auras.size()); - - _auras.push_back(aura); - - ESSResourceDB::add_aura(aura); -} - -Ref ESSResourceDBStatic::get_aura(int id) { - if (id < 0 || id >= _auras.size()) - return Ref(); - - return _auras.get(id); -} - -Ref ESSResourceDBStatic::get_aura_index(int index) { - ERR_FAIL_INDEX_V(index, _auras.size(), Ref()); - - return _auras.get(index); -} - -int ESSResourceDBStatic::get_aura_count() { - return _auras.size(); -} - -Vector ESSResourceDBStatic::get_auras() const { - VARIANT_ARRAY_GET(_auras); -} -void ESSResourceDBStatic::set_auras(const Vector &data) { - _auras.clear(); - for (int i = 0; i < data.size(); i++) { - Ref d = Ref(data[i]); - - add_aura(d); - } -} - //Craft Data void ESSResourceDBStatic::add_craft_recipe(Ref cda) { if (_remap_ids && cda.is_valid()) @@ -327,7 +288,6 @@ void ESSResourceDBStatic::clear() { _entity_skills.clear(); _entity_datas.clear(); _spells.clear(); - _auras.clear(); _craft_recipes.clear(); _item_templates.clear(); _entity_species_datas.clear(); @@ -342,7 +302,6 @@ ESSResourceDBStatic::~ESSResourceDBStatic() { _entity_skills.clear(); _entity_datas.clear(); _spells.clear(); - _auras.clear(); _craft_recipes.clear(); _item_templates.clear(); _entity_species_datas.clear(); @@ -357,7 +316,6 @@ void ESSResourceDBStatic::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "entity_skills", PROPERTY_HINT_NONE, "17/17:EntitySkillData", PROPERTY_USAGE_DEFAULT, "EntitySkillData"), "set_entity_skills", "get_entity_skills"); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "entity_datas", PROPERTY_HINT_NONE, "17/17:EntityData", PROPERTY_USAGE_DEFAULT, "EntityData"), "set_entity_datas", "get_entity_datas"); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells", PROPERTY_HINT_NONE, "17/17:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_spells", "get_spells"); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "auras", PROPERTY_HINT_NONE, "17/17:Aura", PROPERTY_USAGE_DEFAULT, "Aura"), "set_auras", "get_auras"); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "craft_recipes", PROPERTY_HINT_NONE, "17/17:CraftRecipe", PROPERTY_USAGE_DEFAULT, "CraftRecipe"), "set_craft_recipes", "get_craft_recipes"); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "item_templates", PROPERTY_HINT_NONE, "17/17:ItemTemplate", PROPERTY_USAGE_DEFAULT, "ItemTemplate"), "set_item_templates", "get_item_templates"); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "entity_species_datas", PROPERTY_HINT_NONE, "17/17:EntitySpeciesData", PROPERTY_USAGE_DEFAULT, "EntitySpeciesData"), "set_entity_species_datas", "get_entity_species_datas"); diff --git a/database/ess_resource_db_static.h b/database/ess_resource_db_static.h index 12d8076..9583e0c 100644 --- a/database/ess_resource_db_static.h +++ b/database/ess_resource_db_static.h @@ -37,7 +37,6 @@ SOFTWARE. #include "../defines.h" -class Aura; class Spell; class EntityData; class CraftRecipe; @@ -89,13 +88,6 @@ public: Vector get_spells() const; void set_spells(const Vector &data); - Ref get_aura(int aura_id); - Ref get_aura_index(int index); - int get_aura_count(); - void add_aura(Ref aura); - Vector get_auras() const; - void set_auras(const Vector &data); - Ref get_craft_recipe(int craft_id); Ref get_craft_recipe_index(int index); int get_craft_recipe_count(); @@ -132,7 +124,6 @@ private: Vector > _entity_skills; Vector > _entity_datas; Vector > _spells; - Vector > _auras; Vector > _craft_recipes; Vector > _item_templates; Vector > _entity_species_datas; diff --git a/doc_classes/Aura.xml b/doc_classes/Aura.xml deleted file mode 100644 index 9ef29f9..0000000 --- a/doc_classes/Aura.xml +++ /dev/null @@ -1,1653 +0,0 @@ - - - - Base Aura class. Contains data, and callbacks for aura scripts. Inherit from this to create auras with different functionality. - - - - - - - - - - - - - - - Override to change the default damage calculation formula. Serverside only. - - - - - - - - - - - Override to change the default heal calculation formula. Serverside Only. - - - - - - - - - Called clientside when this aura is applied to an [Entity]. You can apply visual effects here. - - - - - - - - - Called clientside when this aura's duration is refreshed on an [Entity]. - - - - - - - - - Called clientside when this aura's is removed from an [Entity]. - - - - - - - - - - - Called clientside when an [Entity]'s cast fails. - - - - - - - - - - - Called clientside when an [Entity]'s cast finsihes. - - - - - - - - - - - Called clientside when an [Entity]'s cast starts. - - - - - - - - - - - Called clientside when an [Entity]'s cast state changes. Not yet used. - - - - - - - - - - - Called clientside for an [Entity] receives damage. - - - - - - - - - - - Called clientside for an [Entity] who deals damage. - - - - - - - - - - - Called clientside for an [Entity] who deals heal. - - - - - - - - - - - Called clientside for an [Entity] who receives heal. - - - - - - - - - - - Called clientside for an [Entity] whos spell cast succeeds. - - - - - - - - - - - - - - - - - Called clientside for an [Entity] when equipping an item fails. - - - - - - - - - - - - - - - - - Called clientside for an [Entity] when equipping an item succeeds. - - - - - - - - - - - - - Gets called if an [Entity] wants to equip an [ItemInstance]. Return true, if tou want this [Aura] to prevent the equip. Serverside. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Called when this aura wants to deal damage. Serverside only. - - - - - - - - - - - Called when this aura wants to deal damage. Serverside only. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Called clientside for an [Entity] who dies. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Called clientside for an [Entity] when a global cooldown finishes. - - - - - - - - - - - Called clientside for an [Entity] when a global cooldown starts. - - - - - - - - - - - - - - - - - - - - - - - Called clientside for an [Entity] who gains xp. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Called serverside when this aura gets added to an [Entity]. - - - - - - - - - Called serverside when this aura gets applied to an [Entity]. - - - - - - - - - Called serverside, apply damage passives of the caster [Entity] into the [SpellDamageInfo] in this method. - - - - - - - - - Called serverside, apply damage passives of the target [Entity] into the [SpellDamageInfo] in this method. - - - - - - - - - Called serverside, apply heal passives of the caster [Entity] into the [SpellHealInfo] in this method. - - - - - - - - - Called serverside, apply heal passives of the target [Entity] into the [SpellHealInfo] in this method. - - - - - - - - - Called when this aura is getting removed from an [Entity]. - - - - - - - - - - - This method sets up the given [AuraData] based on the given [AuraApplyInfo]. Override it, if you need to do something special. Serverside. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/entities/ai/entity_ai.cpp b/entities/ai/entity_ai.cpp index 9d01987..597fd02 100644 --- a/entities/ai/entity_ai.cpp +++ b/entities/ai/entity_ai.cpp @@ -26,7 +26,6 @@ SOFTWARE. #include "../../infos/spell_cast_info.h" -#include "../../data/auras/aura.h" #include "../../data/items/item_instance.h" #include "../../entities/auras/aura_data.h" #include "../../entities/resources/entity_resource.h" diff --git a/entities/auras/aura_data.cpp b/entities/auras/aura_data.cpp index 4864f7f..306d133 100644 --- a/entities/auras/aura_data.cpp +++ b/entities/auras/aura_data.cpp @@ -24,7 +24,7 @@ SOFTWARE. #include "core/version.h" -#include "../../data/auras/aura.h" +#include "../../data/spells/spell.h" #include "../../database/ess_resource_db.h" #include "../../singletons/ess.h" #include "../entity.h" @@ -156,7 +156,7 @@ void AuraData::spell_scale_set(float value) { _spell_scale = value; } -Ref AuraData::get_aura() { +Ref AuraData::get_aura() { //if (_aura == NULL) { //TODO fix! //_aura = Auras::getInstance()->GetData(get_aura_id()); @@ -165,7 +165,7 @@ Ref AuraData::get_aura() { return _aura; } -void AuraData::set_aura(Ref aura) { +void AuraData::set_aura(Ref aura) { _aura = aura; if (aura.is_valid()) @@ -325,7 +325,7 @@ void AuraData::_from_dict(const Dictionary &dict) { _aura_group = dict.get("aura_group", 0); //int aura_id = dict.get("aura_id", 0); - _aura = ESS::get_singleton()->get_resource_db()->get_aura_path(_aura_path); + _aura = ESS::get_singleton()->get_resource_db()->get_spell_path(_aura_path); _is_timed = dict.get("is_timed", true); _damage = dict.get("damage", 0); diff --git a/entities/auras/aura_data.h b/entities/auras/aura_data.h index 10ec367..d94d4a1 100644 --- a/entities/auras/aura_data.h +++ b/entities/auras/aura_data.h @@ -37,7 +37,7 @@ SOFTWARE. #include "../../spell_enums.h" -class Aura; +class Spell; class Entity; class AuraData : public Resource { @@ -68,8 +68,8 @@ public: float spell_scale_get(); void spell_scale_set(float value); - Ref get_aura(); - void set_aura(Ref aura); + Ref get_aura(); + void set_aura(Ref aura); void refresh(float remaining); @@ -125,7 +125,7 @@ private: NodePath _caster_path; float _spell_scale; int _aura_group; - Ref _aura; + Ref _aura; bool _is_timed; int _damage; diff --git a/entities/data/character_spec.cpp b/entities/data/character_spec.cpp index d34a1e9..accf86d 100644 --- a/entities/data/character_spec.cpp +++ b/entities/data/character_spec.cpp @@ -22,7 +22,7 @@ SOFTWARE. #include "character_spec.h" -#include "../../data/auras/aura.h" +#include "../../data/spells/spell.h" #include "../../defines.h" @@ -88,14 +88,14 @@ Vector CharacterSpec::get_talents() { return r; } -Ref CharacterSpec::get_talent(const int row, const int column, const int rank) { - ERR_FAIL_INDEX_V(row, _rows.size(), Ref()); - ERR_FAIL_INDEX_V(column, _rows[row].size(), Ref()); - ERR_FAIL_INDEX_V(rank, _rows[row][column].size(), Ref()); +Ref CharacterSpec::get_talent(const int row, const int column, const int rank) { + ERR_FAIL_INDEX_V(row, _rows.size(), Ref()); + ERR_FAIL_INDEX_V(column, _rows[row].size(), Ref()); + ERR_FAIL_INDEX_V(rank, _rows[row][column].size(), Ref()); return _rows[row][column][rank]; } -void CharacterSpec::set_talent(const int row, const int column, const int rank, const Ref &talent) { +void CharacterSpec::set_talent(const int row, const int column, const int rank, const Ref &talent) { ERR_FAIL_INDEX(row, _rows.size()); ERR_FAIL_INDEX(column, _rows[row].size()); ERR_FAIL_INDEX(rank, _rows[row][column].size()); @@ -107,7 +107,7 @@ bool CharacterSpec::has_talent_with_id(const int id) { for (int i = 0; i < _rows.size(); ++i) { for (int j = 0; j < _rows[i].size(); ++j) { for (int k = 0; k < _rows[i][j].size(); ++k) { - const Ref a = _rows[i][j][k]; + const Ref a = _rows[i][j][k]; if (a.is_valid() && a->get_id() == id) return true; @@ -118,11 +118,11 @@ bool CharacterSpec::has_talent_with_id(const int id) { return false; } -Ref CharacterSpec::get_talent_with_id(const int id) { +Ref CharacterSpec::get_talent_with_id(const int id) { for (int i = 0; i < _rows.size(); ++i) { for (int j = 0; j < _rows[i].size(); ++j) { for (int k = 0; k < _rows[i][j].size(); ++k) { - const Ref a = _rows[i][j][k]; + const Ref a = _rows[i][j][k]; if (a.is_valid() && a->get_id() == id) return a; @@ -130,7 +130,7 @@ Ref CharacterSpec::get_talent_with_id(const int id) { } } - return Ref(); + return Ref(); } CharacterSpec::CharacterSpec() { @@ -254,7 +254,7 @@ void CharacterSpec::_get_property_list(List *p_list) const { p_list->push_back(PropertyInfo(Variant::INT, "row_" + itos(i) + "/column_" + itos(j) + "/size", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED)); for (int k = 0; k < _rows[i][j].size(); ++k) { - p_list->push_back(PropertyInfo(Variant::OBJECT, "row_" + itos(i) + "/column_" + itos(j) + "/entry_" + itos(k), PROPERTY_HINT_RESOURCE_TYPE, "Aura", PROPERTY_USAGE_DEFAULT)); + p_list->push_back(PropertyInfo(Variant::OBJECT, "row_" + itos(i) + "/column_" + itos(j) + "/entry_" + itos(k), PROPERTY_HINT_RESOURCE_TYPE, "Spell", PROPERTY_USAGE_DEFAULT)); } } } diff --git a/entities/data/character_spec.h b/entities/data/character_spec.h index 8c02c83..3921376 100644 --- a/entities/data/character_spec.h +++ b/entities/data/character_spec.h @@ -35,7 +35,7 @@ SOFTWARE. #include "core/ustring.h" #endif -class Aura; +class Spell; class CharacterSpec : public Resource { GDCLASS(CharacterSpec, Resource); @@ -55,11 +55,11 @@ public: Vector get_talents(); - Ref get_talent(const int row, const int column, const int rank); - void set_talent(const int row, const int column, const int rank, const Ref &talent); + Ref get_talent(const int row, const int column, const int rank); + void set_talent(const int row, const int column, const int rank, const Ref &talent); bool has_talent_with_id(const int id); - Ref get_talent_with_id(const int id); + Ref get_talent_with_id(const int id); CharacterSpec(); ~CharacterSpec(); @@ -72,7 +72,7 @@ protected: private: int _id; - Vector > > > _rows; + Vector > > > _rows; }; #endif diff --git a/entities/data/entity_class_data.cpp b/entities/data/entity_class_data.cpp index 91e4404..0236582 100644 --- a/entities/data/entity_class_data.cpp +++ b/entities/data/entity_class_data.cpp @@ -22,7 +22,6 @@ SOFTWARE. #include "entity_class_data.h" -#include "../../data/auras/aura.h" #include "../../data/items/craft_recipe.h" #include "../../data/items/item_instance.h" #include "../../data/spells/spell.h" @@ -216,12 +215,12 @@ void EntityClassData::set_num_auras(int value) { _auras.resize(value); } -Ref EntityClassData::get_aura(int index) { - ERR_FAIL_INDEX_V(index, _auras.size(), Ref()); +Ref EntityClassData::get_aura(int index) { + ERR_FAIL_INDEX_V(index, _auras.size(), Ref()); return _auras[index]; } -void EntityClassData::set_aura(int index, Ref aura) { +void EntityClassData::set_aura(int index, Ref aura) { ERR_FAIL_INDEX(index, _auras.size()); _auras.set(index, aura); @@ -233,7 +232,7 @@ Vector EntityClassData::get_auras() { void EntityClassData::set_auras(const Vector &auras) { _auras.clear(); for (int i = 0; i < auras.size(); i++) { - Ref aura = Ref(auras[i]); + Ref aura = Ref(auras[i]); _auras.push_back(aura); } @@ -462,7 +461,7 @@ void EntityClassData::_bind_methods() { ClassDB::bind_method(D_METHOD("get_auras"), &EntityClassData::get_auras); ClassDB::bind_method(D_METHOD("set_auras", "auras"), &EntityClassData::set_auras); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "auras", PROPERTY_HINT_NONE, "17/17:Aura", PROPERTY_USAGE_DEFAULT, "Aura"), "set_auras", "get_auras"); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "auras", PROPERTY_HINT_NONE, "17/17:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_auras", "get_auras"); //Vendor ClassDB::bind_method(D_METHOD("get_vendor_item_data"), &EntityClassData::get_vendor_item_data); diff --git a/entities/data/entity_class_data.h b/entities/data/entity_class_data.h index 440f555..7aaceab 100644 --- a/entities/data/entity_class_data.h +++ b/entities/data/entity_class_data.h @@ -49,7 +49,6 @@ SOFTWARE. #include "../resources/entity_resource.h" -class Aura; class Spell; class Entity; class ItemInstance; @@ -128,8 +127,8 @@ public: int get_num_auras(); void set_num_auras(int value); - Ref get_aura(int index); - void set_aura(int index, Ref aura); + Ref get_aura(int index); + void set_aura(int index, Ref aura); Vector get_auras(); void set_auras(const Vector &auras); @@ -193,7 +192,7 @@ private: Vector > _specs; Vector > _spells; Vector > _start_spells; - Vector > _auras; + Vector > _auras; Ref _vendor_item_data; Ref _spell_train_data; diff --git a/entities/data/entity_data.cpp b/entities/data/entity_data.cpp index 5ec8a8e..29e96fe 100644 --- a/entities/data/entity_data.cpp +++ b/entities/data/entity_data.cpp @@ -22,7 +22,6 @@ SOFTWARE. #include "entity_data.h" -#include "../../data/auras/aura.h" #include "../../data/spells/spell.h" #include "../../infos/spell_cast_info.h" #include "../entity.h" diff --git a/entities/data/entity_data.h b/entities/data/entity_data.h index e98ad5a..8f0d3c0 100644 --- a/entities/data/entity_data.h +++ b/entities/data/entity_data.h @@ -51,7 +51,6 @@ SOFTWARE. #include "../ai/entity_ai.h" -class Aura; class Spell; class Entity; class CharacterSpec; diff --git a/entities/entity.cpp b/entities/entity.cpp index e946e24..a71ebc7 100644 --- a/entities/entity.cpp +++ b/entities/entity.cpp @@ -26,7 +26,6 @@ SOFTWARE. #include "../singletons/ess.h" #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" @@ -151,6 +150,20 @@ SOFTWARE. \ emit_signal(signal, what, __VA_ARGS__); +#define NOTIFICATION_AURA_DIFF_IMPLS(func, aura_func, signal, what, ...) \ + if (_s_entity_controller == EntityEnums::ENITIY_CONTROLLER_AI && _s_ai.is_valid()) \ + _s_ai->func(what, __VA_ARGS__); \ + \ + if (has_method("_" #func)) \ + call("_" #func, what, __VA_ARGS__); \ + \ + for (int i = 0; i < _s_auras.size(); ++i) { \ + Ref ad = _s_auras.get(i); \ + ad->get_aura()->aura_func(what, ad, __VA_ARGS__); \ + } \ + \ + emit_signal(signal, what, __VA_ARGS__); + #define NOTIFICATION_AURA_IMPLC(func, signal, what, ...) \ if (has_method("_" #func)) \ call("_" #func, what, __VA_ARGS__); \ @@ -723,7 +736,7 @@ void Entity::_setup() { } for (int i = 0; i < cc->get_num_auras(); ++i) { - Ref a = cc->get_aura(i); + Ref a = cc->get_aura(i); if (a.is_valid()) { a->aura_sapply_simple(this, this, 1.0); @@ -3176,7 +3189,7 @@ void Entity::notification_sheal(int what, Ref info) { void Entity::notification_scast(int what, Ref info) { ERR_FAIL_COND(!info.is_valid()); - NOTIFICATION_AURA_IMPLS(notification_scast, "notification_scast", what, info); + NOTIFICATION_AURA_DIFF_IMPLS(notification_scast, notification_aura_scast, "notification_scast", what, info); } void Entity::notification_sdamage(int what, Ref info) { ERR_FAIL_COND(!info.is_valid()); @@ -3241,7 +3254,7 @@ void Entity::son_physics_process(float delta) { for (int i = 0; i < _s_auras.size(); ++i) { Ref ad = _s_auras.get(i); - ad->get_aura()->son_physics_process(ad); + ad->get_aura()->son_physics_process_aura(ad); } if (_physics_process_scis.size() > 0) { @@ -3677,7 +3690,7 @@ void Entity::notification_ccast(int what, Ref info) { for (int i = 0; i < _c_auras.size(); ++i) { Ref ad = _c_auras.get(i); - ad->get_aura()->notification_ccast(what, ad, info); + ad->get_aura()->notification_aura_ccast(what, ad, info); } if (has_method("_notification_ccast")) @@ -3742,7 +3755,7 @@ void Entity::cast_starts(Ref info) { for (int i = 0; i < _s_auras.size(); ++i) { Ref ad = _s_auras.get(i); - ad->get_aura()->notification_scast(SpellEnums::NOTIFICATION_CAST_STARTED, ad, info); + ad->get_aura()->notification_aura_scast(SpellEnums::NOTIFICATION_CAST_STARTED, ad, info); } _s_spell_cast_info->is_casting_set(true); @@ -4746,7 +4759,7 @@ void Entity::_class_talent_sreceive_learn_request(int spec_index, int class_tale ERR_FAIL_COND(!spec.is_valid()); for (int i = 0; i < spec->get_num_ranks(class_talent_row, class_talent_culomn); ++i) { - Ref class_talent = spec->get_talent(class_talent_row, class_talent_culomn, i); + Ref class_talent = spec->get_talent(class_talent_row, class_talent_culomn, i); if (!class_talent.is_valid()) return; @@ -4769,7 +4782,7 @@ void Entity::_class_talent_sreceive_learn_request(int spec_index, int class_tale } if (i > 0) { - Ref pt = spec->get_talent(class_talent_row, class_talent_culomn, i - 1); + Ref pt = spec->get_talent(class_talent_row, class_talent_culomn, i - 1); for (int j = 0; j < aura_gets_count(); ++j) { Ref ad = aura_gets(j); @@ -4993,7 +5006,7 @@ void Entity::_character_talent_sreceive_learn_request(int spec_index, int charac ERR_FAIL_COND(!spec.is_valid()); for (int i = 0; i < spec->get_num_ranks(character_talent_row, character_talent_culomn); ++i) { - Ref character_talent = spec->get_talent(character_talent_row, character_talent_culomn, i); + Ref character_talent = spec->get_talent(character_talent_row, character_talent_culomn, i); if (!character_talent.is_valid()) return; @@ -5016,7 +5029,7 @@ void Entity::_character_talent_sreceive_learn_request(int spec_index, int charac } if (i > 0) { - Ref pt = spec->get_talent(character_talent_row, character_talent_culomn, i - 1); + Ref pt = spec->get_talent(character_talent_row, character_talent_culomn, i - 1); for (int j = 0; j < aura_gets_count(); ++j) { Ref ad = aura_gets(j); diff --git a/infos/aura_infos.cpp b/infos/aura_infos.cpp index aa57b4c..8abd6f6 100644 --- a/infos/aura_infos.cpp +++ b/infos/aura_infos.cpp @@ -22,7 +22,7 @@ SOFTWARE. #include "aura_infos.h" -#include "../data/auras/aura.h" +#include "../data/spells/spell.h" Entity *AuraApplyInfo::caster_get() const { return _caster; @@ -76,11 +76,11 @@ void AuraApplyInfo::spell_scale_set(float value) { _spell_scale = value; } -Ref AuraApplyInfo::get_aura() const { - return Ref(_aura); +Ref AuraApplyInfo::get_aura() const { + return Ref(_aura); } -void AuraApplyInfo::set_aura(Ref aura) { +void AuraApplyInfo::set_aura(Ref aura) { _aura = (*aura); } @@ -91,7 +91,7 @@ AuraApplyInfo::AuraApplyInfo() { _aura = NULL; } -AuraApplyInfo::AuraApplyInfo(Entity *caster, Entity *target, float spell_scale, Aura *aura) { +AuraApplyInfo::AuraApplyInfo(Entity *caster, Entity *target, float spell_scale, Spell *aura) { _caster = caster; _target = target; _spell_scale = spell_scale; @@ -120,5 +120,5 @@ void AuraApplyInfo::_bind_methods() { ClassDB::bind_method(D_METHOD("get_aura"), &AuraApplyInfo::get_aura); ClassDB::bind_method(D_METHOD("set_aura", "aura"), &AuraApplyInfo::set_aura); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura", PROPERTY_HINT_RESOURCE_TYPE, "Aura"), "set_aura", "get_aura"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura", PROPERTY_HINT_RESOURCE_TYPE, "Spell"), "set_aura", "get_aura"); } diff --git a/infos/aura_infos.h b/infos/aura_infos.h index 0b5fe0e..fdc4964 100644 --- a/infos/aura_infos.h +++ b/infos/aura_infos.h @@ -34,7 +34,7 @@ SOFTWARE. #include "../entities/entity.h" class Entity; -class Aura; +class Spell; class AuraApplyInfo : public Reference { GDCLASS(AuraApplyInfo, Reference); @@ -51,11 +51,11 @@ public: float spell_scale_get() const; void spell_scale_set(float value); - Ref get_aura() const; - void set_aura(Ref aura); + Ref get_aura() const; + void set_aura(Ref aura); AuraApplyInfo(); - AuraApplyInfo(Entity *_caster, Entity *_target, float _spell_scale, Aura *_aura); + AuraApplyInfo(Entity *_caster, Entity *_target, float _spell_scale, Spell *_aura); AuraApplyInfo(Entity *_caster, Entity *_target, float _spell_scale); protected: @@ -65,7 +65,7 @@ private: Entity *_caster; Entity *_target; float _spell_scale; - Aura *_aura; + Spell *_aura; }; #endif diff --git a/pipelines/spell_damage_info.cpp b/pipelines/spell_damage_info.cpp index fff1467..8ca4aeb 100644 --- a/pipelines/spell_damage_info.cpp +++ b/pipelines/spell_damage_info.cpp @@ -24,7 +24,6 @@ SOFTWARE. #include "core/version.h" -#include "../data/auras/aura.h" #include "../data/spells/spell.h" #include "../database/ess_resource_db.h" #include "../entities/entity.h" @@ -132,11 +131,11 @@ void SpellDamageInfo::spell_source_set(const Ref &value) { _damage_source_id = value->get_id(); } -Ref SpellDamageInfo::aura_source_get() { - return Ref(_damage_source); +Ref SpellDamageInfo::aura_source_get() { + return Ref(_damage_source); } -void SpellDamageInfo::aura_source_set(const Ref &value) { +void SpellDamageInfo::aura_source_set(const Ref &value) { _damage_source_type = DAMAGE_SOURCE_AURA; _damage_source = value; @@ -174,7 +173,7 @@ void SpellDamageInfo::resolve_references(Node *owner) { if (_damage_source_type == DAMAGE_SOURCE_SPELL) { _damage_source = ESS::get_singleton()->get_resource_db()->get_spell(_damage_source_id); } else if (_damage_source_type == DAMAGE_SOURCE_AURA) { - _damage_source = ESS::get_singleton()->get_resource_db()->get_aura(_damage_source_id); + _damage_source = ESS::get_singleton()->get_resource_db()->get_spell(_damage_source_id); } } diff --git a/pipelines/spell_damage_info.h b/pipelines/spell_damage_info.h index c48bc5e..fb85a2f 100644 --- a/pipelines/spell_damage_info.h +++ b/pipelines/spell_damage_info.h @@ -36,7 +36,6 @@ SOFTWARE. class Entity; class Spell; -class Aura; class SpellDamageInfo : public Reference { GDCLASS(SpellDamageInfo, Reference); @@ -81,8 +80,8 @@ public: Ref spell_source_get(); void spell_source_set(const Ref &value); - Ref aura_source_get(); - void aura_source_set(const Ref &value); + Ref aura_source_get(); + void aura_source_set(const Ref &value); int source_get_id() const; void source_set_id(const int value); diff --git a/pipelines/spell_heal_info.cpp b/pipelines/spell_heal_info.cpp index 67fadd8..e09be81 100644 --- a/pipelines/spell_heal_info.cpp +++ b/pipelines/spell_heal_info.cpp @@ -24,7 +24,6 @@ SOFTWARE. #include "core/version.h" -#include "../data/auras/aura.h" #include "../data/spells/spell.h" #include "../database/ess_resource_db.h" #include "../entities/entity.h" @@ -133,11 +132,11 @@ void SpellHealInfo::spell_source_set(const Ref &value) { _heal_source_id = value->get_id(); } -Ref SpellHealInfo::aura_source_get() { - return Ref(_heal_source); +Ref SpellHealInfo::aura_source_get() { + return Ref(_heal_source); } -void SpellHealInfo::aura_source_set(const Ref &value) { +void SpellHealInfo::aura_source_set(const Ref &value) { _heal_source_type = HEAL_SOURCE_AURA; _heal_source = value; @@ -175,7 +174,7 @@ void SpellHealInfo::resolve_references(Node *owner) { if (_heal_source_type == HEAL_SOURCE_SPELL) { _heal_source = ESS::get_singleton()->get_resource_db()->get_spell(_heal_source_id); } else if (_heal_source_type == HEAL_SOURCE_AURA) { - _heal_source = ESS::get_singleton()->get_resource_db()->get_aura(_heal_source_id); + _heal_source = ESS::get_singleton()->get_resource_db()->get_spell(_heal_source_id); } } @@ -277,7 +276,7 @@ void SpellHealInfo::_bind_methods() { ClassDB::bind_method(D_METHOD("aura_source_get"), &SpellHealInfo::aura_source_get); ClassDB::bind_method(D_METHOD("aura_source_set", "value"), &SpellHealInfo::aura_source_set); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_source", PROPERTY_HINT_RESOURCE_TYPE, "Aura"), "aura_source_set", "aura_source_get"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_source", PROPERTY_HINT_RESOURCE_TYPE, "Spell"), "aura_source_set", "aura_source_get"); ClassDB::bind_method(D_METHOD("source_get_id"), &SpellHealInfo::source_get_id); ClassDB::bind_method(D_METHOD("source_set_id", "value"), &SpellHealInfo::source_set_id); diff --git a/pipelines/spell_heal_info.h b/pipelines/spell_heal_info.h index 52515d4..ea58f4f 100644 --- a/pipelines/spell_heal_info.h +++ b/pipelines/spell_heal_info.h @@ -36,7 +36,6 @@ SOFTWARE. class Entity; class Spell; -class Aura; class SpellHealInfo : public Reference { GDCLASS(SpellHealInfo, Reference); @@ -84,8 +83,8 @@ public: Ref spell_source_get(); void spell_source_set(const Ref &value); - Ref aura_source_get(); - void aura_source_set(const Ref &value); + Ref aura_source_get(); + void aura_source_set(const Ref &value); int source_get_id() const; void source_set_id(const int value); diff --git a/register_types.cpp b/register_types.cpp index 968626d..b1a5b87 100644 --- a/register_types.cpp +++ b/register_types.cpp @@ -27,7 +27,6 @@ SOFTWARE. #include "singletons/ess.h" -#include "data/auras/aura.h" #include "data/auras/aura_group.h" #include "data/items/equipment_data.h" @@ -153,7 +152,6 @@ void register_entity_spell_system_types() { ClassDB::register_class(); ClassDB::register_class(); - ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class();