From 3e10779dbc5258d1e1b08eab287189f9c1ccec64 Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 26 Feb 2020 21:20:54 +0100 Subject: [PATCH] Updated old style getters/setters to use the new style. E.g. sget_ -> gets_. --- data/auras/aura.cpp | 44 +++--- data/auras/aura.h | 8 +- data/spells/spell.cpp | 6 +- doc_classes/Aura.xml | 8 +- doc_classes/Entity.xml | 64 ++++----- docs/general/enums/entity_enums.rst | 8 +- entities/entity.cpp | 216 ++++++++++++++-------------- entities/entity.h | 68 ++++----- 8 files changed, 211 insertions(+), 211 deletions(-) diff --git a/data/auras/aura.cpp b/data/auras/aura.cpp index 6e5dfdc..28b9132 100644 --- a/data/auras/aura.cpp +++ b/data/auras/aura.cpp @@ -542,18 +542,18 @@ void Aura::sremove(Ref aura) { call("_sremove", aura); } -void Aura::sremove_expired(Ref aura) { +void Aura::removes_expired(Ref aura) { ERR_FAIL_COND(!aura.is_valid()); //always exists - call("_sremove_expired", aura); + call("_removes_expired", aura); } -void Aura::sremove_dispell(Ref aura) { +void Aura::removes_dispell(Ref aura) { ERR_FAIL_COND(!aura.is_valid()); //always exists - call("_sremove_dispell", aura); + call("_removes_dispell", aura); } void Aura::supdate(Ref aura, float delta) { @@ -1105,7 +1105,7 @@ void Aura::_sapply(Ref info) { Ref aura = info->get_aura(); - Ref ad = info->get_target()->sget_aura_by(info->get_caster(), _id); + Ref ad = info->get_target()->gets_aura_by(info->get_caster(), _id); if (!ad.is_valid()) { ad.instance(); @@ -1124,12 +1124,12 @@ void Aura::_sapply(Ref info) { int t = 1 << i; if ((_add_states & t) != 0) { - info->get_target()->sadd_state_ref(i); + info->get_target()->adds_state_ref(i); } } } - info->get_target()->sadd_aura(ad); + info->get_target()->adds_aura(ad); } else { ad->set_remaining_time(_time); } @@ -1150,7 +1150,7 @@ void Aura::_sdeapply(Ref data) { int t = 1 << i; if ((_add_states & t) != 0) { - data->get_owner()->sremove_state_ref(i); + data->get_owner()->removes_state_ref(i); } } } @@ -1161,8 +1161,8 @@ void Aura::_sadd(Ref aura) { //sapply(aura); - aura->get_owner()->sremove_aura(aura); - aura->get_owner()->sadd_aura(aura); + aura->get_owner()->removes_aura(aura); + aura->get_owner()->adds_aura(aura); } void Aura::_sremove(Ref aura) { @@ -1170,23 +1170,23 @@ void Aura::_sremove(Ref aura) { sdeapply(aura); - aura->get_owner()->sremove_aura(aura); + aura->get_owner()->removes_aura(aura); } -void Aura::_sremove_expired(Ref aura) { +void Aura::_removes_expired(Ref aura) { ERR_FAIL_COND(aura->get_owner() == NULL); sdeapply(aura); - aura->get_owner()->sremove_aura_expired(aura); + aura->get_owner()->removes_aura_expired(aura); } -void Aura::_sremove_dispell(Ref aura) { +void Aura::_removes_dispell(Ref aura) { ERR_FAIL_COND(aura->get_owner() == NULL); sdeapply(aura); - aura->get_owner()->sremove_aura_dispelled(aura); + aura->get_owner()->removes_aura_dispelled(aura); } void Aura::_supdate(Ref aura, float delta) { @@ -1222,7 +1222,7 @@ void Aura::_supdate(Ref aura, float delta) { } if (remove) { - sremove_expired(aura); + removes_expired(aura); } } @@ -1322,24 +1322,24 @@ void Aura::_bind_methods() { ClassDB::bind_method(D_METHOD("sdeapply", "aura"), &Aura::sdeapply); ClassDB::bind_method(D_METHOD("sadd", "aura"), &Aura::sadd); ClassDB::bind_method(D_METHOD("sremove", "aura"), &Aura::sremove); - ClassDB::bind_method(D_METHOD("sremove_expired", "aura"), &Aura::sremove_expired); - ClassDB::bind_method(D_METHOD("sremove_dispell", "aura"), &Aura::sremove_dispell); + ClassDB::bind_method(D_METHOD("removes_expired", "aura"), &Aura::removes_expired); + ClassDB::bind_method(D_METHOD("removes_dispell", "aura"), &Aura::removes_dispell); ClassDB::bind_method(D_METHOD("supdate", "aura", "delta"), &Aura::supdate); BIND_VMETHOD(MethodInfo("_sapply", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraApplyInfo"))); BIND_VMETHOD(MethodInfo("_sdeapply", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); BIND_VMETHOD(MethodInfo("_sadd", PropertyInfo(Variant::OBJECT, "aura", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); BIND_VMETHOD(MethodInfo("_sremove", PropertyInfo(Variant::OBJECT, "aura", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_sremove_expired", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_sremove_dispell", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + BIND_VMETHOD(MethodInfo("_removes_expired", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + BIND_VMETHOD(MethodInfo("_removes_dispell", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); BIND_VMETHOD(MethodInfo("_supdate", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::REAL, "delta"))); ClassDB::bind_method(D_METHOD("_sapply", "info"), &Aura::_sapply); ClassDB::bind_method(D_METHOD("_sdeapply", "aura"), &Aura::_sdeapply); ClassDB::bind_method(D_METHOD("_sadd", "aura"), &Aura::_sadd); ClassDB::bind_method(D_METHOD("_sremove", "aura"), &Aura::_sremove); - ClassDB::bind_method(D_METHOD("_sremove_expired", "aura"), &Aura::_sremove_expired); - ClassDB::bind_method(D_METHOD("_sremove_dispell", "aura"), &Aura::_sremove_dispell); + ClassDB::bind_method(D_METHOD("_removes_expired", "aura"), &Aura::_removes_expired); + ClassDB::bind_method(D_METHOD("_removes_dispell", "aura"), &Aura::_removes_dispell); ClassDB::bind_method(D_METHOD("_supdate", "aura", "delta"), &Aura::_supdate); //EventHandlers diff --git a/data/auras/aura.h b/data/auras/aura.h index b0cfbfe..9a23ae6 100644 --- a/data/auras/aura.h +++ b/data/auras/aura.h @@ -249,8 +249,8 @@ public: void sdeapply(Ref info); void sadd(Ref aura); void sremove(Ref aura); - void sremove_expired(Ref aura); - void sremove_dispell(Ref aura); + void removes_expired(Ref aura); + void removes_dispell(Ref aura); void supdate(Ref aura, float delta); //EventHandlers @@ -365,8 +365,8 @@ protected: virtual void _sdeapply(Ref info); virtual void _sadd(Ref aura); virtual void _sremove(Ref aura); - virtual void _sremove_expired(Ref aura); - virtual void _sremove_dispell(Ref aura); + virtual void _removes_expired(Ref aura); + virtual void _removes_dispell(Ref aura); virtual void _supdate(Ref aura, float delta); virtual void _setup_aura_data(Ref data, Ref info); diff --git a/data/spells/spell.cpp b/data/spells/spell.cpp index 03fbdf2..3296d02 100644 --- a/data/spells/spell.cpp +++ b/data/spells/spell.cpp @@ -1005,13 +1005,13 @@ void Spell::_handle_effect(Ref info) { Ref ad; if (aura->get_aura_group().is_valid()) { - ad = info->get_target()->sget_aura_with_group_by_bind(info->get_caster(), aura->get_aura_group()); + ad = info->get_target()->gets_aura_with_group_by_bind(info->get_caster(), aura->get_aura_group()); } else { - ad = info->get_target()->sget_aura_by(info->get_caster(), aura->get_id()); + ad = info->get_target()->gets_aura_by(info->get_caster(), aura->get_id()); } if (ad.is_valid()) { - info->get_target()->sremove_aura_exact(ad); + info->get_target()->removes_aura_exact(ad); } Ref aai; diff --git a/doc_classes/Aura.xml b/doc_classes/Aura.xml index f9c322a..d196029 100644 --- a/doc_classes/Aura.xml +++ b/doc_classes/Aura.xml @@ -768,7 +768,7 @@ - + @@ -776,7 +776,7 @@ - + @@ -1662,7 +1662,7 @@ - + @@ -1670,7 +1670,7 @@ - + diff --git a/doc_classes/Entity.xml b/doc_classes/Entity.xml index b52a38f..c1783d3 100644 --- a/doc_classes/Entity.xml +++ b/doc_classes/Entity.xml @@ -817,7 +817,7 @@ - + @@ -825,7 +825,7 @@ - + @@ -833,7 +833,7 @@ - + @@ -843,7 +843,7 @@ - + @@ -853,7 +853,7 @@ - + @@ -863,7 +863,7 @@ - + @@ -1033,7 +1033,7 @@ - + @@ -1041,7 +1041,7 @@ - + @@ -1389,7 +1389,7 @@ - + @@ -1397,7 +1397,7 @@ - + @@ -1405,7 +1405,7 @@ - + @@ -1413,7 +1413,7 @@ - + @@ -1421,7 +1421,7 @@ - + @@ -1429,7 +1429,7 @@ - + @@ -1437,7 +1437,7 @@ - + @@ -1445,7 +1445,7 @@ - + @@ -1453,7 +1453,7 @@ - + @@ -1461,7 +1461,7 @@ - + @@ -2689,7 +2689,7 @@ - + @@ -2697,7 +2697,7 @@ - + @@ -2905,7 +2905,7 @@ - + @@ -2913,7 +2913,7 @@ - + @@ -2923,13 +2923,13 @@ - + - + @@ -3231,7 +3231,7 @@ - + @@ -3239,7 +3239,7 @@ - + @@ -3247,7 +3247,7 @@ - + @@ -3255,7 +3255,7 @@ - + @@ -3263,7 +3263,7 @@ - + @@ -3271,7 +3271,7 @@ - + @@ -3279,7 +3279,7 @@ - + @@ -3287,7 +3287,7 @@ - + diff --git a/docs/general/enums/entity_enums.rst b/docs/general/enums/entity_enums.rst index 74ce781..f334cf5 100644 --- a/docs/general/enums/entity_enums.rst +++ b/docs/general/enums/entity_enums.rst @@ -64,8 +64,8 @@ and :ref:`Entity.centity_flags `. ----------------------------------------------------------------------- For ease of use, Entity refcounts states, this is the enum, used to do it. When you want to add a state to an -entity, you need to use See :ref:`Entity.sadd_state_ref() `, -when you want to remove states use :ref:`Entity.sremove_state_ref() `. +entity, you need to use See :ref:`Entity.adds_state_ref() `, +when you want to remove states use :ref:`Entity.removes_state_ref() `. .. note:: This in only available serverside. @@ -73,13 +73,13 @@ For exmaple let's add a stun to an Entity: .. code-block:: gdscript - entity.sadd_state_ref(EntityEnums.ENTITY_STATE_TYPE_INDEX_STUN) + entity.adds_state_ref(EntityEnums.ENTITY_STATE_TYPE_INDEX_STUN) Let's remove it: .. code-block:: gdscript - entity.sremove_state_ref(EntityEnums.ENTITY_STATE_TYPE_INDEX_STUN) + entity.removes_state_ref(EntityEnums.ENTITY_STATE_TYPE_INDEX_STUN) Since these states are refcounted, everything will work, even if you have multiple sources stunning an entity. diff --git a/entities/entity.cpp b/entities/entity.cpp index 2f79e43..4e092ea 100644 --- a/entities/entity.cpp +++ b/entities/entity.cpp @@ -457,7 +457,7 @@ void Entity::_setup(Ref info) { Ref ad = _s_auras.get(i); if (!ad->get_aura()->get_hide()) - VRPCOBJ(cadd_aura_rpc, JSON::print(ad->to_dict()), cadd_aura, ad); + VRPCOBJ(addc_aura_rpc, JSON::print(ad->to_dict()), addc_aura, ad); } for (int i = 0; i < _s_resources.size(); ++i) { @@ -1333,7 +1333,7 @@ void Entity::setc_state(int state) { emit_signal("cstate_changed", state); } -void Entity::sadd_state_ref(int state_index) { +void Entity::adds_state_ref(int state_index) { ERR_FAIL_INDEX(state_index, EntityEnums::ENTITY_STATE_TYPE_INDEX_MAX); if (_s_states[state_index]++ == 0) { @@ -1341,7 +1341,7 @@ void Entity::sadd_state_ref(int state_index) { } } -void Entity::sremove_state_ref(int state_index) { +void Entity::removes_state_ref(int state_index) { ERR_FAIL_INDEX(state_index, EntityEnums::ENTITY_STATE_TYPE_INDEX_MAX); if (--_s_states[state_index] == 0) { @@ -2994,7 +2994,7 @@ void Entity::son_character_level_up(int value) { emit_signal("son_character_level_up", this, value); } -void Entity::sadd_aura(Ref aura) { +void Entity::adds_aura(Ref aura) { ERR_FAIL_COND(!aura.is_valid()); son_before_aura_applied(aura); @@ -3008,10 +3008,10 @@ void Entity::sadd_aura(Ref aura) { emit_signal("saura_added", aura); if (!aura->get_aura()->get_hide()) - VRPCOBJ(cadd_aura_rpc, JSON::print(aura->to_dict()), cadd_aura, aura); + VRPCOBJ(addc_aura_rpc, JSON::print(aura->to_dict()), addc_aura, aura); } -void Entity::sremove_aura(Ref aura) { +void Entity::removes_aura(Ref aura) { ERR_FAIL_COND(!aura.is_valid()); int aid = aura->get_aura_id(); @@ -3033,11 +3033,11 @@ void Entity::sremove_aura(Ref aura) { emit_signal("saura_removed", a); if (!aura->get_aura()->get_hide()) - VRPCOBJ(cremove_aura_rpc, JSON::print(aura->to_dict()), cremove_aura, aura); + VRPCOBJ(removec_aura_rpc, JSON::print(aura->to_dict()), removec_aura, aura); } } -void Entity::sremove_aura_exact(Ref aura) { +void Entity::removes_aura_exact(Ref aura) { ERR_FAIL_COND(!aura.is_valid()); for (int i = 0; i < _s_auras.size(); i++) { @@ -3055,10 +3055,10 @@ void Entity::sremove_aura_exact(Ref aura) { emit_signal("saura_removed", aura); if (!aura->get_aura()->get_hide()) - VRPCOBJ(cremove_aura_rpc, JSON::print(aura->to_dict()), cremove_aura, aura); + VRPCOBJ(removec_aura_rpc, JSON::print(aura->to_dict()), removec_aura, aura); } -void Entity::sremove_aura_expired(Ref aura) { +void Entity::removes_aura_expired(Ref aura) { ERR_FAIL_COND(!aura.is_valid()); for (int i = 0; i < _s_auras.size(); i++) { @@ -3076,10 +3076,10 @@ void Entity::sremove_aura_expired(Ref aura) { emit_signal("saura_removed_expired", aura); if (!aura->get_aura()->get_hide()) - VRPCOBJ(cremove_aura_rpc, JSON::print(aura->to_dict()), cremove_aura, aura); + VRPCOBJ(removec_aura_rpc, JSON::print(aura->to_dict()), removec_aura, aura); } -void Entity::sremove_aura_dispelled(Ref aura) { +void Entity::removes_aura_dispelled(Ref aura) { ERR_FAIL_COND(!aura.is_valid()); for (int i = 0; i < _s_auras.size(); i++) { @@ -3097,7 +3097,7 @@ void Entity::sremove_aura_dispelled(Ref aura) { emit_signal("saura_removed_dispelled", aura); if (!aura->get_aura()->get_hide()) - VRPCOBJ(cremove_aura_rpc, JSON::print(aura->to_dict()), cremove_aura, aura); + VRPCOBJ(removec_aura_rpc, JSON::print(aura->to_dict()), removec_aura, aura); } void Entity::saura_refreshed(Ref aura) { @@ -3112,54 +3112,54 @@ void Entity::saura_refreshed(Ref aura) { VRPCOBJ(caura_refreshed_rpc, JSON::print(aura->to_dict()), caura_refreshed, aura); } -void Entity::cadd_aura_rpc(String data) { +void Entity::addc_aura_rpc(String data) { Ref aura; aura.instance(); aura->from_dict(data_as_dict(data)); aura->set_owner(this); aura->resolve_references(this); - cadd_aura(aura); + addc_aura(aura); } -void Entity::cremove_aura_rpc(String data) { +void Entity::removec_aura_rpc(String data) { Ref aura; aura.instance(); aura->from_dict(data_as_dict(data)); aura->set_owner(this); aura->resolve_references(this); - cremove_aura(aura); + removec_aura(aura); } -void Entity::cremove_aura_exact_rpc(String data) { +void Entity::removec_aura_exact_rpc(String data) { Ref aura; aura.instance(); aura->from_dict(data_as_dict(data)); aura->set_owner(this); aura->resolve_references(this); - cremove_aura_exact(aura); + removec_aura_exact(aura); } -void Entity::cremove_aura_expired_rpc(String data) { +void Entity::removec_aura_expired_rpc(String data) { Ref aura; aura.instance(); aura->from_dict(data_as_dict(data)); aura->set_owner(this); aura->resolve_references(this); - cremove_aura_expired(aura); + removec_aura_expired(aura); } -void Entity::cremove_aura_dispelled_rpc(String data) { +void Entity::removec_aura_dispelled_rpc(String data) { Ref aura; aura.instance(); aura->from_dict(data_as_dict(data)); aura->set_owner(this); aura->resolve_references(this); - cremove_aura_dispelled(aura); + removec_aura_dispelled(aura); } void Entity::caura_refreshed_rpc(String data) { @@ -3172,7 +3172,7 @@ void Entity::caura_refreshed_rpc(String data) { caura_refreshed(aura); } -void Entity::cadd_aura(Ref aura) { +void Entity::addc_aura(Ref aura) { ERR_FAIL_COND(!aura.is_valid()); _c_auras.push_back(aura); @@ -3182,7 +3182,7 @@ void Entity::cadd_aura(Ref aura) { emit_signal("caura_added", aura); } -void Entity::cremove_aura(Ref aura) { +void Entity::removec_aura(Ref aura) { ERR_FAIL_COND(!aura.is_valid()); int aid = aura->get_aura_id(); @@ -3207,7 +3207,7 @@ void Entity::cremove_aura(Ref aura) { } } -void Entity::cremove_aura_exact(Ref aura) { +void Entity::removec_aura_exact(Ref aura) { ERR_FAIL_COND(!aura.is_valid()); for (int i = 0; i < _c_auras.size(); i++) { @@ -3222,7 +3222,7 @@ void Entity::cremove_aura_exact(Ref aura) { emit_signal("caura_removed", aura); } -void Entity::cremove_aura_dispelled(Ref aura) { +void Entity::removec_aura_dispelled(Ref aura) { ERR_FAIL_COND(!aura.is_valid()); for (int i = 0; i < _c_auras.size(); i++) { @@ -3246,7 +3246,7 @@ void Entity::caura_refreshed(Ref aura) { emit_signal("caura_refreshed", aura); } -void Entity::cremove_aura_expired(Ref aura) { +void Entity::removec_aura_expired(Ref aura) { ERR_FAIL_COND(!aura.is_valid()); for (int i = 0; i < _c_auras.size(); i++) { @@ -3261,17 +3261,17 @@ void Entity::cremove_aura_expired(Ref aura) { emit_signal("caura_removed_expired", aura); } -int Entity::sget_aura_count() { +int Entity::gets_aura_count() { return _s_auras.size(); } -Ref Entity::sget_aura(int index) { +Ref Entity::gets_aura(int index) { ERR_FAIL_INDEX_V(index, _s_auras.size(), Ref(NULL)); return Ref(_s_auras.get(index)); } -Ref Entity::sget_aura_by(Entity *caster, int aura_id) { +Ref Entity::gets_aura_by(Entity *caster, int aura_id) { for (int i = 0; i < _s_auras.size(); ++i) { Ref ad = _s_auras.get(i); @@ -3282,7 +3282,7 @@ Ref Entity::sget_aura_by(Entity *caster, int aura_id) { return Ref(NULL); } -Ref Entity::sget_aura_by_bind(Node *caster, int aura_id) { +Ref Entity::gets_aura_by_bind(Node *caster, int aura_id) { if (!caster) { return Ref(); } @@ -3293,10 +3293,10 @@ Ref Entity::sget_aura_by_bind(Node *caster, int aura_id) { return Ref(); } - return sget_aura_by(e, aura_id); + return gets_aura_by(e, aura_id); } -Ref Entity::sget_aura_with_group_by(Entity *caster, Ref aura_group) { +Ref Entity::gets_aura_with_group_by(Entity *caster, Ref aura_group) { for (int i = 0; i < _s_auras.size(); ++i) { Ref ad = _s_auras.get(i); @@ -3307,7 +3307,7 @@ Ref Entity::sget_aura_with_group_by(Entity *caster, Ref aur return Ref(); } -Ref Entity::sget_aura_with_group_by_bind(Node *caster, Ref aura_group) { +Ref Entity::gets_aura_with_group_by_bind(Node *caster, Ref aura_group) { if (!ObjectDB::instance_validate(caster)) { return Ref(); } @@ -3318,14 +3318,14 @@ Ref Entity::sget_aura_with_group_by_bind(Node *caster, Ref return Ref(); } - return sget_aura_with_group_by(e, aura_group); + return gets_aura_with_group_by(e, aura_group); } -int Entity::cget_aura_count() { +int Entity::getc_aura_count() { return _s_auras.size(); } -Ref Entity::cget_aura(int index) { +Ref Entity::getc_aura(int index) { ERR_FAIL_INDEX_V(index, _c_auras.size(), Ref(NULL)); return Ref(_c_auras.get(index)); @@ -4516,19 +4516,19 @@ void Entity::setc_spell_cast_info(Ref info) { _c_spell_cast_info = Ref(info); } -void Entity::sremove_auras_with_group(Ref aura_group) { +void Entity::removes_auras_with_group(Ref aura_group) { for (int i = 0; i < _s_auras.size(); ++i) { Ref ad = _s_auras.get(i); if (ad->get_aura()->get_aura_group() == aura_group) { - cremove_aura(ad); + removec_aura(ad); _s_auras.remove(i); emit_signal("saura_removed", ad); - cremove_aura(ad); + removec_aura(ad); i--; } @@ -4730,11 +4730,11 @@ void Entity::_sreceive_talent_learn_request(int spec_index, int talent_row, int if (i > 0) { Ref pt = tr->get_talent(talent_culomn, i - 1); - for (int j = 0; j < sget_aura_count(); ++j) { - Ref ad = sget_aura(j); + for (int j = 0; j < gets_aura_count(); ++j) { + Ref ad = gets_aura(j); if (ad->get_aura_id() == pt->get_id()) { - sremove_aura(ad); + removes_aura(ad); break; } @@ -4805,11 +4805,11 @@ void Entity::removes_talent(int talent) { if (_s_talents[i] == talent) { _s_talents.remove(i); - for (int j = 0; j < sget_aura_count(); ++j) { - Ref ad = sget_aura(j); + for (int j = 0; j < gets_aura_count(); ++j) { + Ref ad = gets_aura(j); if (ad->get_aura_id() == talent) { - sremove_aura(ad); + removes_aura(ad); break; } @@ -5001,30 +5001,30 @@ void Entity::cloot(int index) { } void Entity::ons_item_added(Ref bag, Ref item, int slot_id) { - ORPCOBJP(cadd_item_rpc, slot_id, JSON::print(item->to_dict()), cadd_item, slot_id, item); + ORPCOBJP(addc_item_rpc, slot_id, JSON::print(item->to_dict()), addc_item, slot_id, item); } -void Entity::cadd_item_rpc(int slot_id, String item_data) { +void Entity::addc_item_rpc(int slot_id, String item_data) { Ref ii; ii.instance(); ii->from_dict(data_as_dict(item_data)); - cadd_item(slot_id, ii); + addc_item(slot_id, ii); } -void Entity::cadd_item(int slot_id, Ref item) { +void Entity::addc_item(int slot_id, Ref item) { ERR_FAIL_COND(!_c_bag.is_valid()); _c_bag->add_item_at(slot_id, item); } void Entity::ons_item_removed(Ref bag, Ref item, int slot_id) { - ORPC(cremove_item, slot_id); + ORPC(removec_item, slot_id); } -void Entity::sremove_item(const int slot_id) { +void Entity::removes_item(const int slot_id) { ERR_FAIL_COND(!_s_bag.is_valid()); _s_bag->remove_item(slot_id); } -void Entity::cremove_item(const int slot_id) { +void Entity::removec_item(const int slot_id) { ERR_FAIL_COND(!_c_bag.is_valid()); _c_bag->remove_item(slot_id); @@ -5032,7 +5032,7 @@ void Entity::cremove_item(const int slot_id) { void Entity::cdenyremove_item(const int slot_id) { } void Entity::crequest_remove_item(const int slot_id) { - RPCS(sremove_item, slot_id); + RPCS(removes_item, slot_id); } void Entity::ons_items_swapped(Ref bag, int slot_id_1, int slot_id_2) { @@ -5073,30 +5073,30 @@ void Entity::ons_overburden_removed(Ref bag) { //Target Bag void Entity::ons_target_item_added(Ref bag, Ref item, int slot_id) { - ORPCOBJP(cadd_target_item_rpc, slot_id, JSON::print(item->to_dict()), cadd_target_item, slot_id, item); + ORPCOBJP(addc_target_item_rpc, slot_id, JSON::print(item->to_dict()), addc_target_item, slot_id, item); } -void Entity::cadd_target_item_rpc(int slot_id, String item_data) { +void Entity::addc_target_item_rpc(int slot_id, String item_data) { Ref ii; ii.instance(); ii->from_dict(data_as_dict(item_data)); - cadd_target_item(slot_id, ii); + addc_target_item(slot_id, ii); } -void Entity::cadd_target_item(int slot_id, Ref item) { +void Entity::addc_target_item(int slot_id, Ref item) { ERR_FAIL_COND(!_c_target_bag.is_valid()); _c_target_bag->add_item_at(slot_id, item); } void Entity::ons_target_item_removed(Ref bag, Ref item, int slot_id) { - ORPC(cremove_target_item, slot_id); + ORPC(removec_target_item, slot_id); } -void Entity::sremove_target_item(const int slot_id) { +void Entity::removes_target_item(const int slot_id) { ERR_FAIL_COND(!_s_target_bag.is_valid()); _s_target_bag->remove_item(slot_id); } -void Entity::cremove_target_item(const int slot_id) { +void Entity::removec_target_item(const int slot_id) { ERR_FAIL_COND(!_c_target_bag.is_valid()); _c_target_bag->remove_item(slot_id); @@ -5104,7 +5104,7 @@ void Entity::cremove_target_item(const int slot_id) { void Entity::cdenyremove_target_item(const int slot_id) { } void Entity::crequest_target_remove_item(const int slot_id) { - RPCS(sremove_target_item, slot_id); + RPCS(removes_target_item, slot_id); } void Entity::ons_target_items_swapped(Ref bag, int slot_id_1, int slot_id_2) { @@ -5699,11 +5699,11 @@ Entity::Entity() { //Aura Manipulation - SET_RPC_REMOTE("cadd_aura_rpc"); - SET_RPC_REMOTE("cremove_aura_rpc"); - SET_RPC_REMOTE("cremove_aura_exact_rpc"); - SET_RPC_REMOTE("cremove_aura_expired_rpc"); - SET_RPC_REMOTE("cremove_aura_dispelled_rpc"); + SET_RPC_REMOTE("addc_aura_rpc"); + SET_RPC_REMOTE("removec_aura_rpc"); + SET_RPC_REMOTE("removec_aura_exact_rpc"); + SET_RPC_REMOTE("removec_aura_expired_rpc"); + SET_RPC_REMOTE("removec_aura_dispelled_rpc"); SET_RPC_REMOTE("caura_refreshed_rpc"); //// Casting System //// @@ -5767,18 +5767,18 @@ Entity::Entity() { SET_RPC_REMOTE("sloot"); SET_RPC_REMOTE("cloot"); - SET_RPC_REMOTE("cadd_item_rpc"); - SET_RPC_REMOTE("sremove_item"); - SET_RPC_REMOTE("cremove_item"); + SET_RPC_REMOTE("addc_item_rpc"); + SET_RPC_REMOTE("removes_item"); + SET_RPC_REMOTE("removec_item"); SET_RPC_REMOTE("cdenyremove_item"); SET_RPC_REMOTE("sswap_items"); SET_RPC_REMOTE("cswap_items"); SET_RPC_REMOTE("cdeny_item_swap"); SET_RPC_REMOTE("cchange_item_count"); - SET_RPC_REMOTE("cadd_target_item_rpc"); - SET_RPC_REMOTE("sremove_target_item"); - SET_RPC_REMOTE("cremove_target_item"); + SET_RPC_REMOTE("addc_target_item_rpc"); + SET_RPC_REMOTE("removes_target_item"); + SET_RPC_REMOTE("removec_target_item"); SET_RPC_REMOTE("cdenyremove_target_item"); SET_RPC_REMOTE("sswap_target_items"); SET_RPC_REMOTE("cswap_target_items"); @@ -5982,8 +5982,8 @@ void Entity::_son_death() { return #warning-ignore:unused_variable - for i in range(sget_aura_count()): - sremove_aura(sget_aura(0)) + for i in range(gets_aura_count()): + removes_aura(gets_aura(0)) dead = true @@ -6439,35 +6439,35 @@ void Entity::_bind_methods() { ClassDB::bind_method(D_METHOD("son_character_level_up", "value"), &Entity::son_character_level_up); //Aura Manipulation - ClassDB::bind_method(D_METHOD("sadd_aura", "aura"), &Entity::sadd_aura); - ClassDB::bind_method(D_METHOD("sremove_aura", "aura"), &Entity::sremove_aura); - ClassDB::bind_method(D_METHOD("sremove_aura_exact", "aura"), &Entity::sremove_aura_exact); - ClassDB::bind_method(D_METHOD("sremove_aura_expired", "aura"), &Entity::sremove_aura_expired); - ClassDB::bind_method(D_METHOD("sremove_aura_dispelled", "aura"), &Entity::sremove_aura_dispelled); + ClassDB::bind_method(D_METHOD("adds_aura", "aura"), &Entity::adds_aura); + ClassDB::bind_method(D_METHOD("removes_aura", "aura"), &Entity::removes_aura); + ClassDB::bind_method(D_METHOD("removes_aura_exact", "aura"), &Entity::removes_aura_exact); + ClassDB::bind_method(D_METHOD("removes_aura_expired", "aura"), &Entity::removes_aura_expired); + ClassDB::bind_method(D_METHOD("removes_aura_dispelled", "aura"), &Entity::removes_aura_dispelled); //ClassDB::bind_method(D_METHOD("saura_refreshed", "aura"), &Entity::saura_refreshed); - ClassDB::bind_method(D_METHOD("cadd_aura_rpc", "data"), &Entity::cadd_aura_rpc); - ClassDB::bind_method(D_METHOD("cremove_aura_rpc", "data"), &Entity::cremove_aura_rpc); - ClassDB::bind_method(D_METHOD("cremove_aura_exact_rpc", "data"), &Entity::cremove_aura_exact_rpc); - ClassDB::bind_method(D_METHOD("cremove_aura_expired_rpc", "data"), &Entity::cremove_aura_expired_rpc); - ClassDB::bind_method(D_METHOD("cremove_aura_dispelled_rpc", "data"), &Entity::cremove_aura_dispelled_rpc); + ClassDB::bind_method(D_METHOD("addc_aura_rpc", "data"), &Entity::addc_aura_rpc); + ClassDB::bind_method(D_METHOD("removec_aura_rpc", "data"), &Entity::removec_aura_rpc); + ClassDB::bind_method(D_METHOD("removec_aura_exact_rpc", "data"), &Entity::removec_aura_exact_rpc); + ClassDB::bind_method(D_METHOD("removec_aura_expired_rpc", "data"), &Entity::removec_aura_expired_rpc); + ClassDB::bind_method(D_METHOD("removec_aura_dispelled_rpc", "data"), &Entity::removec_aura_dispelled_rpc); - ClassDB::bind_method(D_METHOD("cadd_aura", "aura"), &Entity::cadd_aura); - ClassDB::bind_method(D_METHOD("cremove_aura", "aura"), &Entity::cremove_aura); - ClassDB::bind_method(D_METHOD("cremove_aura_exact", "aura"), &Entity::cremove_aura_exact); - ClassDB::bind_method(D_METHOD("cremove_aura_expired", "aura"), &Entity::cremove_aura_expired); - ClassDB::bind_method(D_METHOD("cremove_aura_dispelled", "aura"), &Entity::cremove_aura_dispelled); + ClassDB::bind_method(D_METHOD("addc_aura", "aura"), &Entity::addc_aura); + ClassDB::bind_method(D_METHOD("removec_aura", "aura"), &Entity::removec_aura); + ClassDB::bind_method(D_METHOD("removec_aura_exact", "aura"), &Entity::removec_aura_exact); + ClassDB::bind_method(D_METHOD("removec_aura_expired", "aura"), &Entity::removec_aura_expired); + ClassDB::bind_method(D_METHOD("removec_aura_dispelled", "aura"), &Entity::removec_aura_dispelled); //ClassDB::bind_method(D_METHOD("caura_refreshed", "aura"), &Entity::caura_refreshed); - ClassDB::bind_method(D_METHOD("sremove_auras_with_group", "aura_group"), &Entity::sremove_auras_with_group); + ClassDB::bind_method(D_METHOD("removes_auras_with_group", "aura_group"), &Entity::removes_auras_with_group); - ClassDB::bind_method(D_METHOD("sget_aura_count"), &Entity::sget_aura_count); - ClassDB::bind_method(D_METHOD("sget_aura", "index"), &Entity::sget_aura); - ClassDB::bind_method(D_METHOD("sget_aura_by", "caster", "aura_id"), &Entity::sget_aura_by_bind); - ClassDB::bind_method(D_METHOD("sget_aura_with_group_by", "caster", "aura_group"), &Entity::sget_aura_with_group_by_bind); + ClassDB::bind_method(D_METHOD("gets_aura_count"), &Entity::gets_aura_count); + ClassDB::bind_method(D_METHOD("gets_aura", "index"), &Entity::gets_aura); + ClassDB::bind_method(D_METHOD("gets_aura_by", "caster", "aura_id"), &Entity::gets_aura_by_bind); + ClassDB::bind_method(D_METHOD("gets_aura_with_group_by", "caster", "aura_group"), &Entity::gets_aura_with_group_by_bind); - ClassDB::bind_method(D_METHOD("cget_aura_count"), &Entity::cget_aura_count); - ClassDB::bind_method(D_METHOD("cget_aura", "index"), &Entity::cget_aura); + ClassDB::bind_method(D_METHOD("getc_aura_count"), &Entity::getc_aura_count); + ClassDB::bind_method(D_METHOD("getc_aura", "index"), &Entity::getc_aura); //Hooks BIND_VMETHOD(MethodInfo("_moved")); @@ -6774,8 +6774,8 @@ void Entity::_bind_methods() { ClassDB::bind_method(D_METHOD("setc_state", "state"), &Entity::setc_state); ClassDB::bind_method(D_METHOD("gets_state"), &Entity::gets_state); ClassDB::bind_method(D_METHOD("sets_state", "state"), &Entity::sets_state); - ClassDB::bind_method(D_METHOD("sadd_state_ref", "state_index"), &Entity::sadd_state_ref); - ClassDB::bind_method(D_METHOD("sremove_state_ref", "state_index"), &Entity::sremove_state_ref); + ClassDB::bind_method(D_METHOD("adds_state_ref", "state_index"), &Entity::adds_state_ref); + ClassDB::bind_method(D_METHOD("removes_state_ref", "state_index"), &Entity::removes_state_ref); //Casting System @@ -6983,12 +6983,12 @@ void Entity::_bind_methods() { //Bag ClassDB::bind_method(D_METHOD("ons_item_added", "bag", "item", "slot_id"), &Entity::ons_item_added); - ClassDB::bind_method(D_METHOD("cadd_item_rpc", "slot_id", "item_data"), &Entity::cadd_item_rpc); - ClassDB::bind_method(D_METHOD("cadd_item", "slot_id", "item"), &Entity::cadd_item); + ClassDB::bind_method(D_METHOD("addc_item_rpc", "slot_id", "item_data"), &Entity::addc_item_rpc); + ClassDB::bind_method(D_METHOD("addc_item", "slot_id", "item"), &Entity::addc_item); ClassDB::bind_method(D_METHOD("ons_item_removed", "bag", "item", "slot_id"), &Entity::ons_item_removed); - ClassDB::bind_method(D_METHOD("sremove_item", "slot_id"), &Entity::sremove_item); - ClassDB::bind_method(D_METHOD("cremove_item", "slot_id"), &Entity::cremove_item); + ClassDB::bind_method(D_METHOD("removes_item", "slot_id"), &Entity::removes_item); + ClassDB::bind_method(D_METHOD("removec_item", "slot_id"), &Entity::removec_item); ClassDB::bind_method(D_METHOD("cdenyremove_item", "slot_id"), &Entity::cdenyremove_item); ClassDB::bind_method(D_METHOD("crequest_remove_item", "slot_id"), &Entity::crequest_remove_item); @@ -7006,12 +7006,12 @@ void Entity::_bind_methods() { //target Bag ClassDB::bind_method(D_METHOD("ons_target_item_added", "bag", "item", "slot_id"), &Entity::ons_target_item_added); - ClassDB::bind_method(D_METHOD("cadd_target_item_rpc", "slot_id", "item_data"), &Entity::cadd_target_item_rpc); - ClassDB::bind_method(D_METHOD("cadd_target_item", "slot_id", "item"), &Entity::cadd_target_item); + ClassDB::bind_method(D_METHOD("addc_target_item_rpc", "slot_id", "item_data"), &Entity::addc_target_item_rpc); + ClassDB::bind_method(D_METHOD("addc_target_item", "slot_id", "item"), &Entity::addc_target_item); ClassDB::bind_method(D_METHOD("ons_target_item_removed", "bag", "item", "slot_id"), &Entity::ons_target_item_removed); - ClassDB::bind_method(D_METHOD("sremove_target_item", "slot_id"), &Entity::sremove_target_item); - ClassDB::bind_method(D_METHOD("cremove_target_item", "slot_id"), &Entity::cremove_target_item); + ClassDB::bind_method(D_METHOD("removes_target_item", "slot_id"), &Entity::removes_target_item); + ClassDB::bind_method(D_METHOD("removec_target_item", "slot_id"), &Entity::removec_target_item); ClassDB::bind_method(D_METHOD("cdenyremove_target_item", "slot_id"), &Entity::cdenyremove_target_item); ClassDB::bind_method(D_METHOD("crequest_target_remove_item", "slot_id"), &Entity::crequest_target_remove_item); diff --git a/entities/entity.h b/entities/entity.h index 1cc60f5..bbb5d84 100644 --- a/entities/entity.h +++ b/entities/entity.h @@ -426,8 +426,8 @@ public: int gets_state(); void sets_state(int state); - void sadd_state_ref(int state_index); - void sremove_state_ref(int state_index); + void adds_state_ref(int state_index); + void removes_state_ref(int state_index); //// Crafting System //// @@ -574,40 +574,40 @@ public: void ccharacter_levelup(int value); //Aura Manipulation - void sadd_aura(Ref aura); - void sremove_aura(Ref aura); - void sremove_aura_exact(Ref aura); - void sremove_aura_expired(Ref aura); - void sremove_aura_dispelled(Ref aura); + void adds_aura(Ref aura); + void removes_aura(Ref aura); + void removes_aura_exact(Ref aura); + void removes_aura_expired(Ref aura); + void removes_aura_dispelled(Ref aura); void saura_refreshed(Ref aura); - void cadd_aura_rpc(String data); - void cremove_aura_rpc(String data); - void cremove_aura_exact_rpc(String data); - void cremove_aura_expired_rpc(String data); - void cremove_aura_dispelled_rpc(String data); + void addc_aura_rpc(String data); + void removec_aura_rpc(String data); + void removec_aura_exact_rpc(String data); + void removec_aura_expired_rpc(String data); + void removec_aura_dispelled_rpc(String data); void caura_refreshed_rpc(String data); - void cadd_aura(Ref aura); - void cremove_aura(Ref aura); - void cremove_aura_exact(Ref aura); - void cremove_aura_expired(Ref aura); - void cremove_aura_dispelled(Ref aura); + void addc_aura(Ref aura); + void removec_aura(Ref aura); + void removec_aura_exact(Ref aura); + void removec_aura_expired(Ref aura); + void removec_aura_dispelled(Ref aura); void caura_refreshed(Ref aura); - void sremove_auras_with_group(Ref aura_group); + void removes_auras_with_group(Ref aura_group); //NOTE: No reason for shas_aura_by, just query it, and check for null. - int sget_aura_count(); - Ref sget_aura(int index); - Ref sget_aura_by(Entity *caster, int aura_id); - Ref sget_aura_by_bind(Node *caster, int aura_id); + int gets_aura_count(); + Ref gets_aura(int index); + Ref gets_aura_by(Entity *caster, int aura_id); + Ref gets_aura_by_bind(Node *caster, int aura_id); - Ref sget_aura_with_group_by(Entity *caster, Ref aura_group); - Ref sget_aura_with_group_by_bind(Node *caster, Ref aura_group); + Ref gets_aura_with_group_by(Entity *caster, Ref aura_group); + Ref gets_aura_with_group_by_bind(Node *caster, Ref aura_group); - int cget_aura_count(); - Ref cget_aura(int index); + int getc_aura_count(); + Ref getc_aura(int index); //Hooks void moved(); @@ -813,13 +813,13 @@ public: void cloot(int index); void ons_item_added(Ref bag, Ref item, int slot_id); - void cadd_item_rpc(int slot_id, String item_data); - void cadd_item(int slot_id, Ref item); + void addc_item_rpc(int slot_id, String item_data); + void addc_item(int slot_id, Ref item); //Bag void ons_item_removed(Ref bag, Ref item, int slot_id); - void sremove_item(const int slot_id); - void cremove_item(const int slot_id); + void removes_item(const int slot_id); + void removec_item(const int slot_id); void cdenyremove_item(const int slot_id); void crequest_remove_item(const int slot_id); @@ -837,12 +837,12 @@ public: //Target Bag void ons_target_item_added(Ref bag, Ref item, int slot_id); - void cadd_target_item_rpc(int slot_id, String item_data); - void cadd_target_item(int slot_id, Ref item); + void addc_target_item_rpc(int slot_id, String item_data); + void addc_target_item(int slot_id, Ref item); void ons_target_item_removed(Ref bag, Ref item, int slot_id); - void sremove_target_item(const int slot_id); - void cremove_target_item(const int slot_id); + void removes_target_item(const int slot_id); + void removec_target_item(const int slot_id); void cdenyremove_target_item(const int slot_id); void crequest_target_remove_item(const int slot_id);