mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-04-19 21:33:15 +02:00
Removed spell's next rank member, and a bit more work on the talent management functions.
This commit is contained in:
parent
0d294e89cd
commit
f819668ab0
@ -66,13 +66,6 @@ void Spell::set_rank(int value) {
|
||||
_rank = value;
|
||||
}
|
||||
|
||||
Ref<Spell> Spell::get_next_rank() {
|
||||
return _next_rank;
|
||||
}
|
||||
void Spell::set_next_rank(Ref<Spell> value) {
|
||||
_next_rank = value;
|
||||
}
|
||||
|
||||
int Spell::get_item_cost() {
|
||||
return _item_cost;
|
||||
}
|
||||
@ -907,10 +900,6 @@ 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_next_rank"), &Spell::get_next_rank);
|
||||
ClassDB::bind_method(D_METHOD("set_next_rank", "value"), &Spell::set_next_rank);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "next_rank", PROPERTY_HINT_RESOURCE_TYPE, "Spell"), "set_next_rank", "get_next_rank");
|
||||
|
||||
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");
|
||||
|
@ -110,9 +110,6 @@ public:
|
||||
int get_rank();
|
||||
void set_rank(int value);
|
||||
|
||||
Ref<Spell> get_next_rank();
|
||||
void set_next_rank(Ref<Spell> value);
|
||||
|
||||
int get_item_cost();
|
||||
void set_item_cost(int value);
|
||||
|
||||
@ -360,7 +357,6 @@ private:
|
||||
|
||||
int _level;
|
||||
int _rank;
|
||||
Ref<Spell> _next_rank;
|
||||
int _item_cost;
|
||||
int _craft_material_cost;
|
||||
int _required_item;
|
||||
|
@ -3395,6 +3395,20 @@ void Entity::_sreceive_talent_learn_request(int spec_index, int talent_row, int
|
||||
}
|
||||
}
|
||||
|
||||
if (i > 0) {
|
||||
Ref<Talent> pt = tr->get_talent(talent_culomn, i - 1);
|
||||
|
||||
for (int j = 0; j < sget_aura_count(); ++j) {
|
||||
Ref<AuraData> ad = sget_aura(j);
|
||||
|
||||
if (ad->get_aura_id() == pt->get_id()) {
|
||||
sremove_aura(ad);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ref<AuraApplyInfo> info;
|
||||
info.instance();
|
||||
|
||||
@ -3458,6 +3472,17 @@ void Entity::removes_talent(int talent) {
|
||||
for (int i = 0; i < _s_talents.size(); ++i) {
|
||||
if (_s_talents[i] == talent) {
|
||||
_s_talents.remove(i);
|
||||
|
||||
for (int j = 0; j < sget_aura_count(); ++j) {
|
||||
Ref<AuraData> ad = sget_aura(j);
|
||||
|
||||
if (ad->get_aura_id() == talent) {
|
||||
sremove_aura(ad);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user