diff --git a/data/aura.cpp b/data/aura.cpp index 94ea0ee..e330597 100644 --- a/data/aura.cpp +++ b/data/aura.cpp @@ -136,7 +136,7 @@ void Aura::OnAuraAbilityScalingDataLoaded(AbilityScalingDataLoaderHelper *h) { */ //Damage -bool Aura::is_damage_enabled() { +bool Aura::get_damage_enabled() { return _damage_enabled; } void Aura::set_damage_enabled(bool value) { @@ -180,7 +180,7 @@ void Aura::set_damage(int min, int max, bool can_crit) { } //Absorb -bool Aura::is_absorb_enabled() { +bool Aura::get_absorb_enabled() { return _absorb_enabled; } void Aura::set_absorb_enabled(bool value) { @@ -210,7 +210,7 @@ void Aura::set_absorb_max(int value) { } //Heal -bool Aura::is_heal_enabled() { +bool Aura::get_heal_enabled() { return _heal_enabled; } void Aura::set_heal_enabled(bool value) { @@ -245,6 +245,35 @@ void Aura::set_heal(int min, int max, bool can_crit) { set_heal_can_crit(can_crit); } +//Dispell +bool Aura::get_dispell_enabled() { + return _dispell_enabled; +} +void Aura::set_dispell_enabled(bool value) { + _dispell_enabled = value; +} + +int Aura::get_dispell_count_min() { + return _dispell_count_min; +} +void Aura::set_dispell_count_min(int value) { + _dispell_count_min = value; +} + +int Aura::get_dispell_count_max() { + return _dispell_count_max; +} +void Aura::set_dispell_count_max(int value) { + _dispell_count_max = value; +} + +int Aura::get_dispell_aura_types() { + return _dispell_aura_types; +} +void Aura::set_dispell_aura_types(int value) { + _dispell_aura_types = value; +} + Ref Aura::get_resource_cost() { return _resource_cost; } @@ -286,6 +315,11 @@ Aura::Aura() { _heal_can_crit = false; + _dispell_enabled = false; + _dispell_count_min = 0; + _dispell_count_max = 0; + _dispell_aura_types = 0; + _add_states = 0; _remove_effects_with_states = 0; _supress_states = 0; @@ -923,11 +957,11 @@ void Aura::_setup_aura_data(Ref data, Ref info) { data->set_is_timed(false); } - if (is_damage_enabled()) { + if (get_damage_enabled()) { calculate_initial_damage(data, info); } - if (is_heal_enabled()) { + if (get_heal_enabled()) { calculate_initial_heal(data, info); } } @@ -1412,9 +1446,9 @@ void Aura::_bind_methods() { ADD_GROUP("Damage", "damage"); //Damage - ClassDB::bind_method(D_METHOD("is_damage_enabled"), &Aura::is_damage_enabled); + ClassDB::bind_method(D_METHOD("get_damage_enabled"), &Aura::get_damage_enabled); ClassDB::bind_method(D_METHOD("set_damage_enabled", "value"), &Aura::set_damage_enabled); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "damage_enabled"), "set_damage_enabled", "is_damage_enabled"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "damage_enabled"), "set_damage_enabled", "get_damage_enabled"); ClassDB::bind_method(D_METHOD("get_damage_type"), &Aura::get_damage_type); ClassDB::bind_method(D_METHOD("set_damage_type", "value"), &Aura::set_damage_type); @@ -1440,9 +1474,9 @@ void Aura::_bind_methods() { ADD_GROUP("Absorb", "absorb"); //Absorb - ClassDB::bind_method(D_METHOD("is_absorb_enabled"), &Aura::is_absorb_enabled); + ClassDB::bind_method(D_METHOD("get_absorb_enabled"), &Aura::get_absorb_enabled); ClassDB::bind_method(D_METHOD("set_absorb_enabled", "value"), &Aura::set_absorb_enabled); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "absorb_enabled"), "set_absorb_enabled", "is_absorb_enabled"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "absorb_enabled"), "set_absorb_enabled", "get_absorb_enabled"); ClassDB::bind_method(D_METHOD("get_absorb_damage_type"), &Aura::get_absorb_damage_type); ClassDB::bind_method(D_METHOD("set_absorb_damage_type", "value"), &Aura::set_absorb_damage_type); @@ -1462,9 +1496,9 @@ void Aura::_bind_methods() { ADD_GROUP("Heal", "heal"); //Heal - ClassDB::bind_method(D_METHOD("is_heal_enabled"), &Aura::is_heal_enabled); + ClassDB::bind_method(D_METHOD("get_heal_enabled"), &Aura::get_heal_enabled); ClassDB::bind_method(D_METHOD("set_heal_enabled", "value"), &Aura::set_heal_enabled); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "heal_enabled"), "set_heal_enabled", "is_heal_enabled"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "heal_enabled"), "set_heal_enabled", "get_heal_enabled"); ClassDB::bind_method(D_METHOD("get_heal_min"), &Aura::get_heal_min); ClassDB::bind_method(D_METHOD("set_heal_min", "value"), &Aura::set_heal_min); @@ -1484,6 +1518,23 @@ void Aura::_bind_methods() { ClassDB::bind_method(D_METHOD("set_heal_scaling_curve", "curve"), &Aura::set_heal_scaling_curve); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "heal_scaling_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_heal_scaling_curve", "get_heal_scaling_curve"); + ADD_GROUP("Dispell", "dispell"); + ClassDB::bind_method(D_METHOD("get_dispell_enabled"), &Aura::get_dispell_enabled); + ClassDB::bind_method(D_METHOD("set_dispell_enabled", "value"), &Aura::set_dispell_enabled); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "dispell_enabled"), "set_dispell_enabled", "get_dispell_enabled"); + + ClassDB::bind_method(D_METHOD("get_dispell_count_min"), &Aura::get_dispell_count_min); + ClassDB::bind_method(D_METHOD("set_dispell_count_min", "value"), &Aura::set_dispell_count_min); + ADD_PROPERTY(PropertyInfo(Variant::INT, "dispell_count_min"), "set_dispell_count_min", "get_dispell_count_min"); + + ClassDB::bind_method(D_METHOD("get_dispell_count_max"), &Aura::get_dispell_count_max); + ClassDB::bind_method(D_METHOD("set_dispell_count_max", "value"), &Aura::set_dispell_count_max); + ADD_PROPERTY(PropertyInfo(Variant::INT, "dispell_count_max"), "set_dispell_count_max", "get_dispell_count_max"); + + ClassDB::bind_method(D_METHOD("get_dispell_aura_types"), &Aura::get_dispell_aura_types); + ClassDB::bind_method(D_METHOD("set_dispell_aura_types", "value"), &Aura::set_dispell_aura_types); + ADD_PROPERTY(PropertyInfo(Variant::INT, "dispell_aura_types", PROPERTY_HINT_FLAGS, SpellEnums::BINDING_STRING_AURA_FLAG_TYPES), "set_dispell_aura_types", "get_dispell_aura_types"); + //Resources ADD_GROUP("Resources", "resource"); ClassDB::bind_method(D_METHOD("get_resource_cost"), &Aura::get_resource_cost); diff --git a/data/aura.h b/data/aura.h index 26093bf..35782c6 100644 --- a/data/aura.h +++ b/data/aura.h @@ -85,12 +85,8 @@ public: Ref get_teaches_spell() const; void set_teaches_spell(const Ref spell); - // AnimationCurve* getDamageLevelScaling(); - // AnimationCurve* getAbsorbLevelScaling(); - // AnimationCurve* getHealLevelScaling(); - //Damage - bool is_damage_enabled(); + bool get_damage_enabled(); void set_damage_enabled(bool value); int get_damage_type(); @@ -109,7 +105,7 @@ public: void set_damage(int min, int max, bool can_crit); //Absorb - bool is_absorb_enabled(); + bool get_absorb_enabled(); void set_absorb_enabled(bool value); int get_absorb_damage_type(); @@ -123,7 +119,7 @@ public: void set_absorb_max(int value); //Heal - bool is_heal_enabled(); + bool get_heal_enabled(); void set_heal_enabled(bool value); int get_heal_min(); @@ -137,6 +133,19 @@ public: void set_heal(int min, int max, bool can_crit); + //Dispells + bool get_dispell_enabled(); + void set_dispell_enabled(bool value); + + int get_dispell_count_min(); + void set_dispell_count_min(int value); + + int get_dispell_count_max(); + void set_dispell_count_max(int value); + + int get_dispell_aura_types(); + void set_dispell_aura_types(int value); + //Resources Ref get_resource_cost(); void set_resource_cost(Ref value); @@ -387,6 +396,11 @@ private: bool _heal_can_crit; Ref _heal_scaling_curve; + bool _dispell_enabled; + int _dispell_count_min; + int _dispell_count_max; + int _dispell_aura_types; + Ref _resource_cost; Ref _resource_give; diff --git a/data/spell.cpp b/data/spell.cpp index 70299b9..1f39347 100644 --- a/data/spell.cpp +++ b/data/spell.cpp @@ -68,6 +68,13 @@ void Spell::set_rank(int value) { _rank = value; } +bool Spell::get_scale_with_level() { + return _scale_with_level; +} +void Spell::set_scale_with_level(bool value) { + _scale_with_level = value; +} + int Spell::get_item_cost() { return _item_cost; } @@ -103,11 +110,11 @@ void Spell::set_resource_give(Ref value) { _resource_give = value; } -bool Spell::has_global_cooldown() { - return _has_global_cooldown; +bool Spell::get_global_cooldown_enabled() { + return _global_cooldown_enabled; } -void Spell::set_has_global_cooldown(bool value) { - _has_global_cooldown = value; +void Spell::set_global_cooldown_enabled(bool value) { + _global_cooldown_enabled = value; } bool Spell::get_is_local_spell() { @@ -138,13 +145,14 @@ void Spell::set_visual_spell_effects(Ref value) { _visual_spell_effects = value; } -Ref Spell::get_world_spell_data() { - return _world_spell_data; +Ref Spell::get_projectile() { + return _projectile; } -void Spell::set_world_spell_data(Ref value) { - _world_spell_data = value; +void Spell::set_projectile(Ref value) { + _projectile = value; } + Ref Spell::get_teaches_craft_recipe() { return _teaches_craft_recipe; } @@ -152,21 +160,6 @@ void Spell::set_teaches_craft_recipe(Ref value) { _teaches_craft_recipe = value; } -float Spell::get_damage_scale_for_level(int level) { - //return getDamageLevelScaling()->Evaluate((float)(level)); - return 1; -} - -float Spell::get_heal_scale_for_level(int level) { - //return getHealLevelScaling()->Evaluate((float)(level)); - return 1; -} - -float Spell::get_absorb_scale_for_level(int level) { - //return getAbsorbLevelScaling()->Evaluate((float)(level)); - return 1; -} - //// Caster Aura Apply //// int Spell::get_num_caster_aura_applys() { @@ -275,22 +268,13 @@ void Spell::set_on_learn_auras(const Vector &on_learn_aura_applys) { } } -//// Projectile //// - -Ref Spell::get_projectile() { - return _projectile; -} -void Spell::set_projectile(Ref value) { - _projectile = value; -} - //// Range //// -bool Spell::get_has_range() { - return _has_range; +bool Spell::get_range_enabled() { + return _range_enabled; } -void Spell::set_has_range(bool value) { - _has_range = value; +void Spell::set_range_enabled(bool value) { + _range_enabled = value; } float Spell::get_range() { @@ -300,11 +284,11 @@ void Spell::set_range(float value) { _range = value; } -bool Spell::get_has_cast_time() { - return _has_cast_time; +bool Spell::get_cast_time_enabled() { + return _cast_time_enabled; } -void Spell::set_has_cast_time(bool value) { - _has_cast_time = value; +void Spell::set_cast_time_enabled(bool value) { + _cast_time_enabled = value; } float Spell::get_cast_time() { @@ -314,11 +298,11 @@ void Spell::set_cast_time(float value) { _cast_time = value; } -bool Spell::get_has_damage() { - return _has_damage; +bool Spell::get_damage_enabled() { + return _damage_enabled; } -void Spell::set_has_damage(bool value) { - _has_damage = value; +void Spell::set_damage_enabled(bool value) { + _damage_enabled = value; } int Spell::get_damage_type() { @@ -342,18 +326,25 @@ void Spell::set_damage_max(int value) { _damage_max = value; } -Ref Spell::get_damage_scaling_curve() { - return _damage_scaling_curve; +Stat::StatId Spell::get_damage_scale_stat() { + return _damage_scale_stat; } -void Spell::set_damage_scaling_curve(Ref curve) { - _damage_scaling_curve = curve; +void Spell::set_damage_scale_stat(Stat::StatId value) { + _damage_scale_stat = value; } -bool Spell::get_has_heal() { - return _has_heal; +float Spell::get_damage_scale_coeff() { + return _damage_scale_coeff; } -void Spell::set_has_heal(bool value) { - _has_heal = value; +void Spell::set_damage_scale_coeff(float value) { + _damage_scale_coeff = value; +} + +bool Spell::get_heal_enabled() { + return _heal_enabled; +} +void Spell::set_heal_enabled(bool value) { + _heal_enabled = value; } int Spell::get_heal_min() { @@ -370,11 +361,46 @@ void Spell::set_heal_max(int value) { _heal_max = value; } -Ref Spell::get_heal_scaling_curve() { - return _heal_scaling_curve; +Stat::StatId Spell::get_heal_scale_stat() { + return _heal_scale_stat; } -void Spell::set_heal_scaling_curve(Ref curve) { - _heal_scaling_curve = curve; +void Spell::set_heal_scale_stat(Stat::StatId value) { + _heal_scale_stat = value; +} + +float Spell::get_heal_scale_coeff() { + return _heal_scale_coeff; +} +void Spell::set_heal_scale_coeff(float value) { + _heal_scale_coeff = value; +} + +bool Spell::get_dispell_enabled() { + return _dispell_enabled; +} +void Spell::set_dispell_enabled(bool value) { + _dispell_enabled = value; +} + +int Spell::get_dispell_count_min() { + return _dispell_count_min; +} +void Spell::set_dispell_count_min(int value) { + _dispell_count_min = value; +} + +int Spell::get_dispell_count_max() { + return _dispell_count_max; +} +void Spell::set_dispell_count_max(int value) { + _dispell_count_max = value; +} + +int Spell::get_dispell_aura_types() { + return _dispell_aura_types; +} +void Spell::set_dispell_aura_types(int value) { + _dispell_aura_types = value; } bool Spell::get_needs_target() { @@ -391,11 +417,11 @@ void Spell::set_can_move_while_casting(bool value) { _can_move_while_casting = value; } -bool Spell::get_is_interrupt() { - return _is_interrupt; +bool Spell::get_interrupt_enabled() { + return _interrupt_enabled; } -void Spell::set_is_interrupt(bool value) { - _is_interrupt = value; +void Spell::set_interrupt_enabled(bool value) { + _interrupt_enabled = value; } float Spell::get_interrupt_time() { @@ -485,7 +511,7 @@ void Spell::sstart_casting_simple(Entity *caster, float spell_scale) { info->set_caster(caster); info->set_target(caster->gets_target()); - info->set_has_cast_time(get_has_cast_time()); + info->set_has_cast_time(get_cast_time_enabled()); info->set_cast_time(get_cast_time()); info->set_spell_scale(spell_scale); info->set_spell(Ref(this)); @@ -638,7 +664,7 @@ void Spell::_sstart_casting(Ref info) { //Ref spell = info->get_spell(); - if (get_needs_target() || get_has_damage()) { + if (get_needs_target() || get_damage_enabled()) { if (!info->get_target()) { //print_error("no target, return"); @@ -646,7 +672,7 @@ void Spell::_sstart_casting(Ref info) { } } - if (get_has_cast_time()) { + if (get_cast_time_enabled()) { //can cast info->get_caster()->son_before_cast(info); @@ -656,7 +682,7 @@ void Spell::_sstart_casting(Ref info) { info->get_caster()->sstart_casting(info); } else { - if (get_has_damage()) { + if (get_damage_enabled()) { Ref dpd = Ref(memnew(SpellDamageInfo())); dpd->set_spell_damage_source(Ref(this)); @@ -699,33 +725,43 @@ Spell::Spell() { _level = 1; _rank = 0; + _scale_with_level = true; _item_cost = 0; _craft_material_cost = 0; _required_item = 0; - _has_global_cooldown = true; + _global_cooldown_enabled = true; _is_local_spell = false; - _has_range = false; + _range_enabled = false; _range = 0; - _has_damage = false; + _damage_enabled = false; _damage_type = 0; _damage_min = 0; _damage_max = 0; + _damage_scale_stat = Stat::STAT_ID_NONE; + _damage_scale_coeff = 0; - _has_heal = false; + _heal_enabled = false; _heal_min = 0; _heal_max = 0; + _heal_scale_stat = Stat::STAT_ID_NONE; + _heal_scale_coeff = 0; - _has_cast_time = false; + _dispell_enabled = false; + _dispell_count_min = 0; + _dispell_count_max = 0; + _dispell_aura_types = 0; + + _cast_time_enabled = false; _cast_time = 0; _needs_target = false; _can_move_while_casting = false; - _is_interrupt = false; + _interrupt_enabled = false; _interrupt_time = 0; _is_aoe = false; @@ -754,8 +790,6 @@ Spell::~Spell() { _world_spell_data.unref(); _teaches_craft_recipe.unref(); - _damage_scaling_curve.unref(); - _heal_scaling_curve.unref(); _projectile.unref(); _training_required_spell.unref(); _training_required_skill.unref(); @@ -842,6 +876,10 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("set_rank", "value"), &Spell::set_rank); ADD_PROPERTY(PropertyInfo(Variant::INT, "rank"), "set_rank", "get_rank"); + ClassDB::bind_method(D_METHOD("get_scale_with_level"), &Spell::get_scale_with_level); + ClassDB::bind_method(D_METHOD("set_scale_with_level", "value"), &Spell::set_scale_with_level); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "scale_with_level"), "set_scale_with_level", "get_scale_with_level"); + ClassDB::bind_method(D_METHOD("get_is_local_spell"), &Spell::get_is_local_spell); ClassDB::bind_method(D_METHOD("set_is_local_spell", "value"), &Spell::set_is_local_spell); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "is_local_spell"), "set_is_local_spell", "get_is_local_spell"); @@ -858,18 +896,14 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("set_visual_spell_effects", "value"), &Spell::set_visual_spell_effects); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "visual_spell_effects", PROPERTY_HINT_RESOURCE_TYPE, "SpellEffectVisual"), "set_visual_spell_effects", "get_visual_spell_effects"); - ClassDB::bind_method(D_METHOD("get_world_spell_data"), &Spell::get_world_spell_data); - ClassDB::bind_method(D_METHOD("set_world_spell_data", "value"), &Spell::set_world_spell_data); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "world_spell_data", PROPERTY_HINT_RESOURCE_TYPE, "WorldSpellData"), "set_world_spell_data", "get_world_spell_data"); + ClassDB::bind_method(D_METHOD("get_projectile"), &Spell::get_projectile); + ClassDB::bind_method(D_METHOD("set_projectile", "value"), &Spell::set_projectile); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "projectile", PROPERTY_HINT_RESOURCE_TYPE, "WorldSpellData"), "set_projectile", "get_projectile"); ClassDB::bind_method(D_METHOD("get_teaches_craft_recipe"), &Spell::get_teaches_craft_recipe); ClassDB::bind_method(D_METHOD("set_teaches_craft_recipe", "value"), &Spell::set_teaches_craft_recipe); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "teaches_craft_recipe", PROPERTY_HINT_RESOURCE_TYPE, "CraftRecipe"), "set_teaches_craft_recipe", "get_teaches_craft_recipe"); - ClassDB::bind_method(D_METHOD("get_damage_scale_for_level"), &Spell::get_damage_scale_for_level); - ClassDB::bind_method(D_METHOD("get_heal_scale_for_level"), &Spell::get_heal_scale_for_level); - ClassDB::bind_method(D_METHOD("get_absorb_scale_for_level"), &Spell::get_absorb_scale_for_level); - //ADD_GROUP("Caster Aura Applys", "caster_aura_applys"); ClassDB::bind_method(D_METHOD("get_num_caster_aura_applys"), &Spell::get_num_caster_aura_applys); ClassDB::bind_method(D_METHOD("set_num_caster_aura_applys", "value"), &Spell::set_num_caster_aura_applys); @@ -903,10 +937,6 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("set_on_learn_auras", "spells"), &Spell::set_on_learn_auras); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "on_learn_auras", PROPERTY_HINT_NONE, "17/17:Aura", PROPERTY_USAGE_DEFAULT, "Aura"), "set_on_learn_auras", "get_on_learn_auras"); - ClassDB::bind_method(D_METHOD("get_projectile"), &Spell::get_projectile); - ClassDB::bind_method(D_METHOD("set_projectile", "value"), &Spell::set_projectile); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "projectile", PROPERTY_HINT_RESOURCE_TYPE, "WorldSpellData"), "set_projectile", "get_projectile"); - ADD_GROUP("Texts", "text"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "text_name"), "set_name", "get_name"); @@ -919,23 +949,23 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("set_cooldown", "value"), &Spell::set_cooldown); ADD_PROPERTY(PropertyInfo(Variant::REAL, "cooldown_cooldown"), "set_cooldown", "get_cooldown"); - ClassDB::bind_method(D_METHOD("has_global_cooldown"), &Spell::has_global_cooldown); - ClassDB::bind_method(D_METHOD("set_has_global_cooldown", "value"), &Spell::set_has_global_cooldown); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cooldown_global_cooldown"), "set_has_global_cooldown", "has_global_cooldown"); + ClassDB::bind_method(D_METHOD("set_global_cooldown_enabled"), &Spell::set_global_cooldown_enabled); + ClassDB::bind_method(D_METHOD("set_global_cooldown_enabled", "value"), &Spell::set_global_cooldown_enabled); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cooldown_global_cooldown_enabled"), "set_global_cooldown_enabled", "set_global_cooldown_enabled"); ADD_GROUP("Range", "range"); - ClassDB::bind_method(D_METHOD("get_has_range"), &Spell::get_has_range); - ClassDB::bind_method(D_METHOD("set_has_range", "value"), &Spell::set_has_range); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "range"), "set_has_range", "get_has_range"); + ClassDB::bind_method(D_METHOD("get_range_enabled"), &Spell::get_range_enabled); + ClassDB::bind_method(D_METHOD("set_range_enabled", "value"), &Spell::set_range_enabled); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "range_enabled"), "set_range_enabled", "get_range_enabled"); ClassDB::bind_method(D_METHOD("get_range"), &Spell::get_range); ClassDB::bind_method(D_METHOD("set_range", "value"), &Spell::set_range); ADD_PROPERTY(PropertyInfo(Variant::REAL, "range_range"), "set_range", "get_range"); ADD_GROUP("Cast", "cast"); - ClassDB::bind_method(D_METHOD("get_has_cast_time"), &Spell::get_has_cast_time); - ClassDB::bind_method(D_METHOD("set_has_cast_time", "value"), &Spell::set_has_cast_time); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cast"), "set_has_cast_time", "get_has_cast_time"); + ClassDB::bind_method(D_METHOD("get_cast_time_enabled"), &Spell::get_cast_time_enabled); + ClassDB::bind_method(D_METHOD("set_cast_time_enabled", "value"), &Spell::set_cast_time_enabled); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cast_enabled"), "set_cast_time_enabled", "get_cast_time_enabled"); ClassDB::bind_method(D_METHOD("get_cast_time"), &Spell::get_cast_time); ClassDB::bind_method(D_METHOD("set_cast_time", "value"), &Spell::set_cast_time); @@ -946,9 +976,9 @@ void Spell::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cast_can_move_while_casting"), "set_can_move_while_casting", "get_can_move_while_casting"); ADD_GROUP("Damage", "damage"); - ClassDB::bind_method(D_METHOD("get_has_damage"), &Spell::get_has_damage); - ClassDB::bind_method(D_METHOD("set_has_damage", "value"), &Spell::set_has_damage); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "damage"), "set_has_damage", "get_has_damage"); + ClassDB::bind_method(D_METHOD("get_damage_enabled"), &Spell::get_damage_enabled); + ClassDB::bind_method(D_METHOD("set_damage", "value"), &Spell::set_damage_enabled); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "damage_enabled"), "set_damage_enabled", "get_damage_enabled"); ClassDB::bind_method(D_METHOD("get_damage_type"), &Spell::get_damage_type); ClassDB::bind_method(D_METHOD("set_damage_type", "value"), &Spell::set_damage_type); @@ -962,14 +992,18 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("set_damage_max", "value"), &Spell::set_damage_max); ADD_PROPERTY(PropertyInfo(Variant::INT, "damage_max"), "set_damage_max", "get_damage_max"); - ClassDB::bind_method(D_METHOD("get_damage_scaling_curve"), &Spell::get_damage_scaling_curve); - ClassDB::bind_method(D_METHOD("set_damage_scaling_curve", "curve"), &Spell::set_damage_scaling_curve); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "damage_scaling_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_damage_scaling_curve", "get_damage_scaling_curve"); + ClassDB::bind_method(D_METHOD("get_damage_scale_stat"), &Spell::get_damage_scale_stat); + ClassDB::bind_method(D_METHOD("set_damage_scale_stat", "value"), &Spell::set_damage_scale_stat); + ADD_PROPERTY(PropertyInfo(Variant::INT, "damage_scale_stat", PROPERTY_HINT_ENUM, Stat::STAT_BINDING_STRING), "set_damage_scale_stat", "get_damage_scale_stat"); + + ClassDB::bind_method(D_METHOD("get_damage_scale_coeff"), &Spell::get_damage_scale_coeff); + ClassDB::bind_method(D_METHOD("set_damage_scale_coeff", "value"), &Spell::set_damage_scale_coeff); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "damage_scale_coeff"), "set_damage_scale_coeff", "get_damage_scale_coeff"); ADD_GROUP("Heal", "heal"); - ClassDB::bind_method(D_METHOD("get_has_heal"), &Spell::get_has_heal); - ClassDB::bind_method(D_METHOD("set_has_heal", "value"), &Spell::set_has_heal); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "heal"), "set_has_heal", "get_has_heal"); + ClassDB::bind_method(D_METHOD("get_heal_enabled"), &Spell::get_heal_enabled); + ClassDB::bind_method(D_METHOD("set_heal_enabled", "value"), &Spell::set_heal_enabled); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "heal_enabled"), "set_heal_enabled", "get_heal_enabled"); ClassDB::bind_method(D_METHOD("get_heal_min"), &Spell::get_heal_min); ClassDB::bind_method(D_METHOD("set_heal_min", "value"), &Spell::set_heal_min); @@ -979,14 +1013,35 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("set_heal_max", "value"), &Spell::set_heal_max); ADD_PROPERTY(PropertyInfo(Variant::INT, "heal_max"), "set_heal_max", "get_heal_max"); - ClassDB::bind_method(D_METHOD("get_heal_scaling_curve"), &Spell::get_heal_scaling_curve); - ClassDB::bind_method(D_METHOD("set_heal_scaling_curve", "curve"), &Spell::set_heal_scaling_curve); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "heal_scaling_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_heal_scaling_curve", "get_heal_scaling_curve"); + ClassDB::bind_method(D_METHOD("get_heal_scale_stat"), &Spell::get_heal_scale_stat); + ClassDB::bind_method(D_METHOD("set_heal_scale_stat", "value"), &Spell::set_heal_scale_stat); + ADD_PROPERTY(PropertyInfo(Variant::INT, "heal_scale_stat", PROPERTY_HINT_ENUM, Stat::STAT_BINDING_STRING), "set_heal_scale_stat", "get_heal_scale_stat"); + + ClassDB::bind_method(D_METHOD("get_heal_scale_coeff"), &Spell::get_heal_scale_coeff); + ClassDB::bind_method(D_METHOD("set_heal_scale_coeff", "value"), &Spell::set_heal_scale_coeff); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "heal_scale_coeff"), "set_heal_scale_coeff", "get_heal_scale_coeff"); + + ADD_GROUP("Dispell", "dispell"); + ClassDB::bind_method(D_METHOD("get_dispell_enabled"), &Spell::get_dispell_enabled); + ClassDB::bind_method(D_METHOD("set_dispell_enabled", "value"), &Spell::set_dispell_enabled); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "dispell_enabled"), "set_dispell_enabled", "get_dispell_enabled"); + + ClassDB::bind_method(D_METHOD("get_dispell_count_min"), &Spell::get_dispell_count_min); + ClassDB::bind_method(D_METHOD("set_dispell_count_min", "value"), &Spell::set_dispell_count_min); + ADD_PROPERTY(PropertyInfo(Variant::INT, "dispell_count_min"), "set_dispell_count_min", "get_dispell_count_min"); + + ClassDB::bind_method(D_METHOD("get_dispell_count_max"), &Spell::get_dispell_count_max); + ClassDB::bind_method(D_METHOD("set_dispell_count_max", "value"), &Spell::set_dispell_count_max); + ADD_PROPERTY(PropertyInfo(Variant::INT, "dispell_count_max"), "set_dispell_count_max", "get_dispell_count_max"); + + ClassDB::bind_method(D_METHOD("get_dispell_aura_types"), &Spell::get_dispell_aura_types); + ClassDB::bind_method(D_METHOD("set_dispell_aura_types", "value"), &Spell::set_dispell_aura_types); + ADD_PROPERTY(PropertyInfo(Variant::INT, "dispell_aura_types", PROPERTY_HINT_FLAGS, SpellEnums::BINDING_STRING_AURA_FLAG_TYPES), "set_dispell_aura_types", "get_dispell_aura_types"); ADD_GROUP("Interrupt", "interrupt"); - ClassDB::bind_method(D_METHOD("get_is_interrupt"), &Spell::get_is_interrupt); - ClassDB::bind_method(D_METHOD("set_is_interrupt", "value"), &Spell::set_is_interrupt); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "interrupt"), "set_is_interrupt", "get_is_interrupt"); + ClassDB::bind_method(D_METHOD("get_interrupt_enabled"), &Spell::get_interrupt_enabled); + ClassDB::bind_method(D_METHOD("set_interrupt_enabled", "value"), &Spell::set_interrupt_enabled); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "interrupt_enabled"), "set_interrupt_enabled", "get_interrupt_enabled"); ClassDB::bind_method(D_METHOD("get_interrupt_time"), &Spell::get_interrupt_time); ClassDB::bind_method(D_METHOD("set_interrupt_time", "value"), &Spell::set_interrupt_time); diff --git a/data/spell.h b/data/spell.h index 3b90873..9ffa0ca 100644 --- a/data/spell.h +++ b/data/spell.h @@ -2,7 +2,6 @@ #define SPELL_H #include "core/resource.h" -#include "scene/resources/curve.h" #include "scene/resources/texture.h" #include "../entity_enums.h" @@ -11,6 +10,7 @@ #include "../infos/spell_cast_info.h" #include "../entities/entity.h" +#include "../entities/stats/stat.h" #include "../pipelines/spell_damage_info.h" #include "../infos/aura_infos.h" @@ -85,6 +85,9 @@ public: int get_rank(); void set_rank(int value); + bool get_scale_with_level(); + void set_scale_with_level(bool value); + int get_item_cost(); void set_item_cost(int value); @@ -100,8 +103,8 @@ public: Ref get_resource_give(); void set_resource_give(Ref value); - bool has_global_cooldown(); - void set_has_global_cooldown(bool value); + bool get_global_cooldown_enabled(); + void set_global_cooldown_enabled(bool value); bool get_is_local_spell(); void set_is_local_spell(bool value); @@ -115,16 +118,12 @@ public: Ref get_visual_spell_effects(); void set_visual_spell_effects(Ref value); - Ref get_world_spell_data(); - void set_world_spell_data(Ref value); + Ref get_projectile(); + void set_projectile(Ref value); Ref get_teaches_craft_recipe(); void set_teaches_craft_recipe(Ref value); - float get_damage_scale_for_level(int level); - float get_heal_scale_for_level(int level); - float get_absorb_scale_for_level(int level); - //Caster Aura Apply int get_num_caster_aura_applys(); void set_num_caster_aura_applys(int value); @@ -155,25 +154,21 @@ public: Vector get_on_learn_auras(); void set_on_learn_auras(const Vector &on_learn_auras); - //Projectile - Ref get_projectile(); - void set_projectile(Ref value); - //Range - bool get_has_range(); - void set_has_range(bool value); + bool get_range_enabled(); + void set_range_enabled(bool value); float get_range(); void set_range(float value); - bool get_has_cast_time(); - void set_has_cast_time(bool value); + bool get_cast_time_enabled(); + void set_cast_time_enabled(bool value); float get_cast_time(); void set_cast_time(float value); - bool get_has_damage(); - void set_has_damage(bool value); + bool get_damage_enabled(); + void set_damage_enabled(bool value); int get_damage_type(); void set_damage_type(int value); @@ -184,11 +179,14 @@ public: int get_damage_max(); void set_damage_max(int value); - Ref get_damage_scaling_curve(); - void set_damage_scaling_curve(Ref curve); + Stat::StatId get_damage_scale_stat(); + void set_damage_scale_stat(Stat::StatId value); - bool get_has_heal(); - void set_has_heal(bool value); + float get_damage_scale_coeff(); + void set_damage_scale_coeff(float value); + + bool get_heal_enabled(); + void set_heal_enabled(bool value); int get_heal_min(); void set_heal_min(int value); @@ -196,17 +194,34 @@ public: int get_heal_max(); void set_heal_max(int value); - Ref get_heal_scaling_curve(); - void set_heal_scaling_curve(Ref curve); + Stat::StatId get_heal_scale_stat(); + void set_heal_scale_stat(Stat::StatId value); + float get_heal_scale_coeff(); + void set_heal_scale_coeff(float value); + + //Dispells + bool get_dispell_enabled(); + void set_dispell_enabled(bool value); + + int get_dispell_count_min(); + void set_dispell_count_min(int value); + + int get_dispell_count_max(); + void set_dispell_count_max(int value); + + int get_dispell_aura_types(); + void set_dispell_aura_types(int value); + + //Target bool get_needs_target(); void set_needs_target(bool value); bool get_can_move_while_casting(); void set_can_move_while_casting(bool value); - bool get_is_interrupt(); - void set_is_interrupt(bool value); + bool get_interrupt_enabled(); + void set_interrupt_enabled(bool value); float get_interrupt_time(); void set_interrupt_time(float value); @@ -303,6 +318,7 @@ private: int _level; int _rank; + bool _scale_with_level; int _item_cost; int _craft_material_cost; int _required_item; @@ -310,7 +326,7 @@ private: Ref _resource_cost; Ref _resource_give; - bool _has_global_cooldown; + bool _global_cooldown_enabled; bool _is_local_spell; Ref _icon; @@ -321,27 +337,34 @@ private: Ref _world_spell_data; Ref _teaches_craft_recipe; - bool _has_range; + bool _range_enabled; float _range; - bool _has_damage; + bool _damage_enabled; int _damage_type; int _damage_min; int _damage_max; - Ref _damage_scaling_curve; + Stat::StatId _damage_scale_stat; + float _damage_scale_coeff; - bool _has_heal; + bool _heal_enabled; int _heal_min; int _heal_max; - Ref _heal_scaling_curve; + Stat::StatId _heal_scale_stat; + float _heal_scale_coeff; - bool _has_cast_time; + bool _dispell_enabled; + int _dispell_count_min; + int _dispell_count_max; + int _dispell_aura_types; + + bool _cast_time_enabled; float _cast_time; bool _needs_target; bool _can_move_while_casting; - bool _is_interrupt; + bool _interrupt_enabled; float _interrupt_time; bool _is_aoe; diff --git a/docs/general/enums/spell_enums.rst b/docs/general/enums/spell_enums.rst index 72bef12..848e0cb 100644 --- a/docs/general/enums/spell_enums.rst +++ b/docs/general/enums/spell_enums.rst @@ -43,6 +43,8 @@ Type of an aura. Like None, Magic, Poison etc. You can make these show up in the ui, also some spell can operate on different types. +They can also be used as flags. + :ref:`ColliderType ` -------------------------------------------------- diff --git a/entities/stats/stat.h b/entities/stats/stat.h index bfd8b34..5d67651 100644 --- a/entities/stats/stat.h +++ b/entities/stats/stat.h @@ -21,55 +21,57 @@ public: enum StatId { STAT_ID_HEALTH = 0, - STAT_ID_SPEED = 1, - STAT_ID_MANA = 2, - STAT_ID_GLOBAL_COOLDOWN = 3, - STAT_ID_HASTE = 4, + STAT_ID_SPEED, + STAT_ID_MANA, + STAT_ID_GLOBAL_COOLDOWN, + STAT_ID_HASTE, - STAT_ID_AGILITY = 5, - STAT_ID_STRENGTH = 6, - STAT_ID_STAMINA = 7, - STAT_ID_INTELLECT = 8, - STAT_ID_SPIRIT = 9, + STAT_ID_AGILITY, + STAT_ID_STRENGTH, + STAT_ID_STAMINA, + STAT_ID_INTELLECT, + STAT_ID_SPIRIT, - STAT_ID_HASTE_RATING = 10, - STAT_ID_RESLILIENCE = 11, - STAT_ID_ARMOR = 12, + STAT_ID_HASTE_RATING, + STAT_ID_RESLILIENCE, + STAT_ID_ARMOR, - STAT_ID_ATTACK_POWER = 13, - STAT_ID_SPELL_POWER = 14, + STAT_ID_ATTACK_POWER, + STAT_ID_SPELL_POWER, - STAT_ID_MELEE_CRIT = 15, - STAT_ID_MELEE_CRIT_BONUS = 16, - STAT_ID_SPELL_CRIT = 17, - STAT_ID_SPELL_CRIT_BONUS = 18, - STAT_ID_BLOCK = 19, - STAT_ID_PARRY = 20, - STAT_ID_DAMAGE_REDUCTION = 21, - STAT_ID_MELEE_DAMAGE_REDUCTION = 22, - STAT_ID_SPELL_DAMAGE_REDUCTION = 23, - STAT_ID_DAMAGE_TAKEN = 24, - STAT_ID_HEAL_TAKEN = 25, - STAT_ID_MELEE_DAMAGE = 26, - STAT_ID_SPELL_DAMAGE = 27, + STAT_ID_MELEE_CRIT, + STAT_ID_MELEE_CRIT_BONUS, + STAT_ID_SPELL_CRIT, + STAT_ID_SPELL_CRIT_BONUS, + STAT_ID_BLOCK, + STAT_ID_PARRY, + STAT_ID_DAMAGE_REDUCTION, + STAT_ID_MELEE_DAMAGE_REDUCTION, + STAT_ID_SPELL_DAMAGE_REDUCTION, + STAT_ID_DAMAGE_TAKEN, + STAT_ID_HEAL_TAKEN, + STAT_ID_MELEE_DAMAGE, + STAT_ID_SPELL_DAMAGE, - STAT_ID_HOLY_RESIST = 28, - STAT_ID_SHADOW_RESIST = 29, - STAT_ID_NATURE_RESIST = 30, - STAT_ID_FIRE_RESIST = 31, - STAT_ID_FROST_RESIST = 32, - STAT_ID_LIGHTNING_RESIST = 33, - STAT_ID_CHAOS_RESIST = 34, - STAT_ID_SILENCE_RESIST = 35, - STAT_ID_FEAR_RESIST = 36, - STAT_ID_STUN_RESIST = 37, + STAT_ID_HOLY_RESIST, + STAT_ID_SHADOW_RESIST, + STAT_ID_NATURE_RESIST, + STAT_ID_FIRE_RESIST, + STAT_ID_FROST_RESIST, + STAT_ID_LIGHTNING_RESIST, + STAT_ID_CHAOS_RESIST, + STAT_ID_SILENCE_RESIST, + STAT_ID_FEAR_RESIST, + STAT_ID_STUN_RESIST, - STAT_ID_ENERGY = 38, - STAT_ID_RAGE = 39, + STAT_ID_ENERGY, + STAT_ID_RAGE, - STAT_ID_XP_RATE = 40, + STAT_ID_XP_RATE, - STAT_ID_TOTAL_STATS = 41, + STAT_DISPELL_RESIST, + + STAT_ID_TOTAL_STATS, STAT_ID_NONE = STAT_ID_TOTAL_STATS, }; diff --git a/entity_enums.h b/entity_enums.h index 65e812b..995c825 100644 --- a/entity_enums.h +++ b/entity_enums.h @@ -146,6 +146,7 @@ public: ENTITY_IMMUNITY_FLAG_PROJECTILE = 1 << 27, ENTITY_IMMUNITY_FLAG_DEBUFF = 1 << 28, ENTITY_IMMUNITY_FLAG_ATTACKS = 1 << 29, + ENTITY_IMMUNITY_FLAG_DISPELL = 1 << 30, }; enum CharacterSkeletonPoints { diff --git a/spell_enums.cpp b/spell_enums.cpp index 387a27d..0a14a0a 100644 --- a/spell_enums.cpp +++ b/spell_enums.cpp @@ -6,5 +6,6 @@ const String SpellEnums::BINDING_STRING_DIMINISHING_RETURN_CATEGORIES = "None,Ro const String SpellEnums::BINDING_STRING_TRIGGER_EVENTS = "None,S On Before Damage,S On Damage Receive,S On Hit,S On Damage Dealt,S Aura Remove,S Aura Dispell,S On Before Aura Applied,S On After Aura Applied,C On Aura Added,C On Aura Removed,C On Aura Refreshed"; const String SpellEnums::BINDING_STRING_DAMAGE_TYPES = "Melee,Holy,Shadow,Nature,Fire,Frost,Lightning,Chaos"; const String SpellEnums::BINDING_STRING_AURA_TYPES = "None,Magic,Poison,Physical,Curse,Bleed,Talent,Skill"; +const String SpellEnums::BINDING_STRING_AURA_FLAG_TYPES = "Magic,Poison,Physical,Curse,Bleed,Talent,Skill"; const String SpellEnums::BINDING_STRING_COLLIDER_TYPE = "None,Sphere,Box"; const String SpellEnums::BINDING_STRING_TARGET_TYPE = "None,Node,Bone ID,Coords"; diff --git a/spell_enums.h b/spell_enums.h index b68da05..c6d87c3 100644 --- a/spell_enums.h +++ b/spell_enums.h @@ -13,6 +13,7 @@ public: static const String BINDING_STRING_TRIGGER_EVENTS; static const String BINDING_STRING_DAMAGE_TYPES; static const String BINDING_STRING_AURA_TYPES; + static const String BINDING_STRING_AURA_FLAG_TYPES; static const String BINDING_STRING_COLLIDER_TYPE; static const String BINDING_STRING_TARGET_TYPE; @@ -73,13 +74,13 @@ public: enum AuraType { AURA_TYPE_NONE = 0, - AURA_TYPE_MAGIC = 1, - AURA_TYPE_POISON = 2, - AURA_TYPE_PHYSICAL = 3, - AURA_TYPE_CURSE = 4, - AURA_TYPE_BLEED = 5, - AURA_TYPE_TALENT = 6, - AURA_TYPE_SKILL = 7, + AURA_TYPE_MAGIC = 1 << 0, + AURA_TYPE_POISON = 1 << 1, + AURA_TYPE_PHYSICAL = 1 << 2, + AURA_TYPE_CURSE = 1 << 3, + AURA_TYPE_BLEED = 1 << 4, + AURA_TYPE_TALENT = 1 << 5, + AURA_TYPE_SKILL = 1 << 6, }; enum ColliderType { @@ -173,5 +174,4 @@ VARIANT_ENUM_CAST(SpellEnums::AuraType); VARIANT_ENUM_CAST(SpellEnums::ColliderType); VARIANT_ENUM_CAST(SpellEnums::TargetType); - #endif