diff --git a/data/data_manager.cpp b/data/data_manager.cpp index 7d671a9..96190fd 100644 --- a/data/data_manager.cpp +++ b/data/data_manager.cpp @@ -113,7 +113,7 @@ void DataManager::add_spell(Ref spell) { ERR_FAIL_COND(!spell.is_valid()); _spells.push_back(spell); - _spell_map.set(spell->get_spell_id(), spell); + _spell_map.set(spell->get_id(), spell); } void DataManager::add_aura(Ref aura) { diff --git a/data/spell.cpp b/data/spell.cpp index 4923d8b..a3c9936 100644 --- a/data/spell.cpp +++ b/data/spell.cpp @@ -3,11 +3,11 @@ #include "aura.h" #include "craft_recipe.h" -int Spell::get_spell_id() { - return _spell_id; +int Spell::get_id() { + return _id; } -void Spell::set_spell_id(int value) { - _spell_id = value; +void Spell::set_id(int value) { + _id = value; } int Spell::get_spell_type() { @@ -750,7 +750,7 @@ String Spell::get_description(int level) { Spell::Spell() { PLAYER_HIT_RADIUS = (float)0.5; - _spell_id = 1; + _id = 1; _spell_type = SpellEnums::SPELL_TYPE_NONE; _spell_category = SpellEnums::SPELL_CATEGORY_NORMAL; @@ -868,9 +868,10 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("_handle_spell_damage", "info"), &Spell::_handle_spell_damage); //Properties - ClassDB::bind_method(D_METHOD("get_spell_id"), &Spell::get_spell_id); - ClassDB::bind_method(D_METHOD("set_spell_id", "value"), &Spell::set_spell_id); - ADD_PROPERTY(PropertyInfo(Variant::INT, "spell_id"), "set_spell_id", "get_spell_id"); + ClassDB::bind_method(D_METHOD("get_id"), &Spell::get_id); + ClassDB::bind_method(D_METHOD("set_id", "value"), &Spell::set_id); + ADD_PROPERTY(PropertyInfo(Variant::INT, "id"), "set_id", "get_id"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "spell_id"), "set_id", "get_id");//REMOVE ClassDB::bind_method(D_METHOD("get_spell_type"), &Spell::get_spell_type); ClassDB::bind_method(D_METHOD("set_spell_type", "value"), &Spell::set_spell_type); diff --git a/data/spell.h b/data/spell.h index 5e6d511..103a66d 100644 --- a/data/spell.h +++ b/data/spell.h @@ -83,8 +83,8 @@ class Spell : public Resource { GDCLASS(Spell, Resource); public: - int get_spell_id(); - void set_spell_id(int value); + int get_id(); + void set_id(int value); int get_spell_type(); void set_spell_type(int value); @@ -342,7 +342,7 @@ protected: static void _bind_methods(); private: - int _spell_id; + int _id; int _spell_type; SpellEnums::SpellCategory _spell_category; diff --git a/entities/data/character_spec.cpp b/entities/data/character_spec.cpp index c812611..b1f2459 100644 --- a/entities/data/character_spec.cpp +++ b/entities/data/character_spec.cpp @@ -2,11 +2,11 @@ #include "../../data/aura.h" -int CharacterSpec::get_spec_id() { - return _spec_id; +int CharacterSpec::get_id() { + return _id; } -void CharacterSpec::set_spec_id(int value) { - _spec_id = value; +void CharacterSpec::set_id(int value) { + _id = value; } String CharacterSpec::get_text_name() { @@ -62,7 +62,7 @@ Ref CharacterSpec::get_talent(const int row_index, const int culomn, const CharacterSpec::CharacterSpec() { - _spec_id = 0; + _id = 0; } CharacterSpec::~CharacterSpec() { @@ -70,9 +70,10 @@ CharacterSpec::~CharacterSpec() { } void CharacterSpec::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_spec_id"), &CharacterSpec::get_spec_id); - ClassDB::bind_method(D_METHOD("set_spec_id", "value"), &CharacterSpec::set_spec_id); - ADD_PROPERTY(PropertyInfo(Variant::INT, "spec_id"), "set_spec_id", "get_spec_id"); + ClassDB::bind_method(D_METHOD("get_id"), &CharacterSpec::get_id); + ClassDB::bind_method(D_METHOD("set_id", "value"), &CharacterSpec::set_id); + ADD_PROPERTY(PropertyInfo(Variant::INT, "id"), "set_id", "get_id"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "spec_id"), "set_id", "get_id");//REMOVE ClassDB::bind_method(D_METHOD("get_text_name"), &CharacterSpec::get_text_name); ClassDB::bind_method(D_METHOD("set_text_name", "value"), &CharacterSpec::set_text_name); diff --git a/entities/data/character_spec.h b/entities/data/character_spec.h index 41e5020..ae3eb63 100644 --- a/entities/data/character_spec.h +++ b/entities/data/character_spec.h @@ -14,8 +14,8 @@ class CharacterSpec : public Resource { GDCLASS(CharacterSpec, Resource); public: - int get_spec_id(); - void set_spec_id(int value); + int get_id(); + void set_id(int value); String get_text_name(); void set_text_name(String value); @@ -38,7 +38,7 @@ protected: static void _bind_methods(); private: - int _spec_id; + int _id; String _text_name; Vector > _rows; }; diff --git a/entities/data/entity_class_data.cpp b/entities/data/entity_class_data.cpp index 0e83cc3..453c17c 100644 --- a/entities/data/entity_class_data.cpp +++ b/entities/data/entity_class_data.cpp @@ -316,7 +316,7 @@ void EntityClassData::start_casting(int spell_id, Entity *caster, float spellSca return; } - if (s->get_spell_id() == spell_id) { + if (s->get_id() == spell_id) { s->sstart_casting_simple(caster, spellScale); return; } diff --git a/entities/entity.cpp b/entities/entity.cpp index b1656ea..5440e47 100644 --- a/entities/entity.cpp +++ b/entities/entity.cpp @@ -510,7 +510,7 @@ Dictionary Entity::_to_dict() { Dictionary known_spells; for (int i = 0; i < _s_spells.size(); ++i) { - known_spells[i] = _s_spells.get(i)->get_spell_id(); + known_spells[i] = _s_spells.get(i)->get_id(); } dict["known_spells"] = known_spells; @@ -3457,7 +3457,7 @@ void Entity::slearn_spell(int id) { for (int i = 0; i < cd->get_num_spells(); ++i) { Ref sp = cd->get_spell(i); - if (sp->get_spell_id() == id) { + if (sp->get_id() == id) { adds_spell(sp); sets_free_spell_points(_s_free_spell_points - 1); return;