diff --git a/README.md b/README.md
index 426b4d1..63602ce 100644
--- a/README.md
+++ b/README.md
@@ -32,8 +32,8 @@ The module provides a huge number of script callbacks, usually as virtual method
Do not call methods with underscores, all of them has a normal counterpart, always call that.
-For example entity has `scraft(int id)` and `_scraft(int id)` (virtual). Always use `scraft(int id)`, it will
-call `_scraft(int id)`.
+For example entity has `crafts(int id)` and `_crafts(int id)` (virtual). Always use `crafts(int id)`, it will
+call `_crafts(int id)`.
For networked classes, every variable is broken up into clientside, and serverside. This makes it easier to
develop games that can also run locally, with less overhead and simpler logic.
diff --git a/doc_classes/Entity.xml b/doc_classes/Entity.xml
index 72bc8f4..d60356c 100644
--- a/doc_classes/Entity.xml
+++ b/doc_classes/Entity.xml
@@ -320,7 +320,7 @@
-
+
@@ -710,7 +710,7 @@
-
+
@@ -718,7 +718,7 @@
-
+
@@ -890,7 +890,7 @@
-
+
@@ -898,7 +898,7 @@
-
+
@@ -1528,7 +1528,7 @@
-
+
@@ -1934,7 +1934,7 @@
-
+
@@ -1942,7 +1942,7 @@
-
+
@@ -2152,7 +2152,7 @@
-
+
@@ -2160,13 +2160,13 @@
-
+
-
+
@@ -2344,7 +2344,7 @@
-
+
@@ -2352,7 +2352,7 @@
-
+
@@ -2416,7 +2416,7 @@
-
+
@@ -2424,7 +2424,7 @@
-
+
@@ -2740,7 +2740,7 @@
-
+
@@ -2748,7 +2748,7 @@
-
+
@@ -2900,7 +2900,7 @@
-
+
@@ -2908,7 +2908,7 @@
-
+
@@ -3082,7 +3082,7 @@
-
+
@@ -4266,7 +4266,7 @@
-
+
@@ -4274,7 +4274,7 @@
-
+
diff --git a/entities/entity.cpp b/entities/entity.cpp
index 25cb2c8..5164b4f 100644
--- a/entities/entity.cpp
+++ b/entities/entity.cpp
@@ -678,7 +678,7 @@ void Entity::_setup() {
}
for (int i = 0; i < _s_entity_data->get_num_craft_recipes(); ++i) {
- adds_craft_recipe(_s_entity_data->get_craft_recipe(i));
+ craft_adds_recipe(_s_entity_data->get_craft_recipe(i));
}
if (_s_entity_data->get_equipment_data().is_valid()) {
@@ -754,7 +754,7 @@ void Entity::_setup() {
Vector recipes = class_profile->get_custom_data("recipes");
for (int i = 0; i < recipes.size(); ++i) {
- adds_craft_recipe_id(ESS::get_instance()->get_resource_db()->craft_recipe_path_to_id(recipes.get(i)));
+ craft_adds_recipe_id(ESS::get_instance()->get_resource_db()->craft_recipe_path_to_id(recipes.get(i)));
}
}
}
@@ -1443,7 +1443,7 @@ void Entity::_from_dict(const Dictionary &dict) {
Ref cr = ESS::get_instance()->get_resource_db()->get_craft_recipe_path(crn);
if (cr.is_valid()) {
- adds_craft_recipe(cr);
+ craft_adds_recipe(cr);
}
}
}
@@ -1597,16 +1597,16 @@ void Entity::removes_state_ref(int state_index) {
//// Crafting System ////
-void Entity::crequest_craft(int id) {
- scraft(id);
+void Entity::craft_crequest(int id) {
+ crafts(id);
}
-void Entity::scraft(int id) {
- if (has_method("_scraft")) {
- call("_scraft", id);
+void Entity::crafts(int id) {
+ if (has_method("_crafts")) {
+ call("_crafts", id);
}
}
-bool Entity::hass_craft_recipe(Ref craft_recipe) {
+bool Entity::craft_hass_recipe(Ref craft_recipe) {
for (int i = 0; i < _s_craft_recipes.size(); ++i) {
if (_s_craft_recipes.get(i) == craft_recipe) {
return true;
@@ -1615,7 +1615,7 @@ bool Entity::hass_craft_recipe(Ref craft_recipe) {
return false;
}
-bool Entity::hass_craft_recipe_id(int id) {
+bool Entity::craft_hass_recipe_id(int id) {
for (int i = 0; i < _s_craft_recipes.size(); ++i) {
Ref cr = _s_craft_recipes.get(i);
@@ -1628,22 +1628,22 @@ bool Entity::hass_craft_recipe_id(int id) {
return false;
}
-void Entity::adds_craft_recipe(Ref craft_recipe) {
+void Entity::craft_adds_recipe(Ref craft_recipe) {
ERR_FAIL_COND(!craft_recipe.is_valid());
- if (hass_craft_recipe(craft_recipe))
+ if (craft_hass_recipe(craft_recipe))
return;
_s_craft_recipes.push_back(craft_recipe);
- emit_signal("scraft_recipe_added", this, craft_recipe);
+ emit_signal("crafts_recipe_added", this, craft_recipe);
- ORPC(addc_craft_recipe_id, craft_recipe->get_id());
+ ORPC(craft_addc_recipe_id, craft_recipe->get_id());
}
-void Entity::adds_craft_recipe_id(int id) {
+void Entity::craft_adds_recipe_id(int id) {
ERR_FAIL_COND(!ESS::get_instance());
- if (hass_craft_recipe_id(id))
+ if (craft_hass_recipe_id(id))
return;
Ref craft_recipe = ESS::get_instance()->get_resource_db()->get_craft_recipe(id);
@@ -1678,11 +1678,11 @@ void Entity::adds_craft_recipe_id(int id) {
}
}
- emit_signal("scraft_recipe_added", this, craft_recipe);
+ emit_signal("crafts_recipe_added", this, craft_recipe);
- ORPC(addc_craft_recipe_id, id);
+ ORPC(craft_addc_recipe_id, id);
}
-void Entity::removes_craft_recipe(Ref craft_recipe) {
+void Entity::craft_removes_recipe(Ref craft_recipe) {
for (int i = 0; i < _s_craft_recipes.size(); ++i) {
if (_s_craft_recipes.get(i) == craft_recipe) {
_s_craft_recipes.remove(i);
@@ -1690,11 +1690,11 @@ void Entity::removes_craft_recipe(Ref craft_recipe) {
}
}
- emit_signal("scraft_recipe_removed", this, craft_recipe);
+ emit_signal("crafts_recipe_removed", this, craft_recipe);
- ORPC(removec_craft_recipe, craft_recipe);
+ ORPC(craft_removec_recipe, craft_recipe);
}
-void Entity::removes_craft_recipe_id(int id) {
+void Entity::craft_removes_recipe_id(int id) {
Ref craft_recipe;
for (int i = 0; i < _s_craft_recipes.size(); ++i) {
@@ -1706,16 +1706,16 @@ void Entity::removes_craft_recipe_id(int id) {
}
}
- emit_signal("scraft_recipe_removed", this, craft_recipe);
+ emit_signal("crafts_recipe_removed", this, craft_recipe);
- ORPC(removec_craft_recipe_id, id);
+ ORPC(craft_removec_recipe_id, id);
}
-Ref Entity::gets_craft_recipe(int index) {
+Ref Entity::craft_gets_recipe(int index) {
ERR_FAIL_INDEX_V(index, _s_craft_recipes.size(), Ref());
return _s_craft_recipes.get(index);
}
-Ref Entity::gets_craft_recipe_id(int id) {
+Ref Entity::craft_gets_recipe_id(int id) {
for (int i = 0; i < _s_craft_recipes.size(); ++i) {
Ref craft_recipe = _s_craft_recipes.get(i);
@@ -1726,11 +1726,11 @@ Ref Entity::gets_craft_recipe_id(int id) {
return Ref();
}
-int Entity::gets_craft_recipe_count() {
+int Entity::craft_gets_recipe_count() {
return _s_craft_recipes.size();
}
-bool Entity::hasc_craft_recipe(Ref craft_recipe) {
+bool Entity::craft_hasc_recipe(Ref craft_recipe) {
for (int i = 0; i < _c_craft_recipes.size(); ++i) {
if (_c_craft_recipes.get(i) == craft_recipe) {
return true;
@@ -1739,7 +1739,7 @@ bool Entity::hasc_craft_recipe(Ref craft_recipe) {
return false;
}
-bool Entity::hasc_craft_recipe_id(int id) {
+bool Entity::craft_hasc_recipe_id(int id) {
for (int i = 0; i < _c_craft_recipes.size(); ++i) {
Ref cr = _c_craft_recipes.get(i);
@@ -1752,18 +1752,18 @@ bool Entity::hasc_craft_recipe_id(int id) {
return false;
}
-void Entity::addc_craft_recipe(Ref craft_recipe) {
- if (hasc_craft_recipe(craft_recipe))
+void Entity::craft_addc_recipe(Ref craft_recipe) {
+ if (craft_hasc_recipe(craft_recipe))
return;
_c_craft_recipes.push_back(craft_recipe);
emit_signal("ccraft_recipe_added", this, craft_recipe);
}
-void Entity::addc_craft_recipe_id(int id) {
+void Entity::craft_addc_recipe_id(int id) {
ERR_FAIL_COND(!ESS::get_instance());
- if (hasc_craft_recipe_id(id))
+ if (craft_hasc_recipe_id(id))
return;
Ref craft_recipe = ESS::get_instance()->get_resource_db()->get_craft_recipe(id);
@@ -1774,7 +1774,7 @@ void Entity::addc_craft_recipe_id(int id) {
emit_signal("ccraft_recipe_added", this, craft_recipe);
}
-void Entity::removec_craft_recipe(Ref craft_recipe) {
+void Entity::craft_removec_recipe(Ref craft_recipe) {
for (int i = 0; i < _c_craft_recipes.size(); ++i) {
if (_c_craft_recipes.get(i) == craft_recipe) {
_c_craft_recipes.remove(i);
@@ -1784,7 +1784,7 @@ void Entity::removec_craft_recipe(Ref craft_recipe) {
emit_signal("ccraft_recipe_removed", this, craft_recipe);
}
-void Entity::removec_craft_recipe_id(int id) {
+void Entity::craft_removec_recipe_id(int id) {
Ref craft_recipe;
for (int i = 0; i < _c_craft_recipes.size(); ++i) {
@@ -1798,12 +1798,12 @@ void Entity::removec_craft_recipe_id(int id) {
emit_signal("ccraft_recipe_removed", this, craft_recipe);
}
-Ref Entity::getc_craft_recipe(int index) {
+Ref Entity::craft_getc_recipe(int index) {
ERR_FAIL_INDEX_V(index, _c_craft_recipes.size(), Ref());
return _c_craft_recipes.get(index);
}
-int Entity::getc_craft_recipe_count() {
+int Entity::craft_getc_recipe_count() {
return _c_craft_recipes.size();
}
@@ -5759,10 +5759,10 @@ Entity::Entity() {
//// Crafting System ////
- SET_RPC_REMOTE("scraft");
+ SET_RPC_REMOTE("crafts");
- SET_RPC_REMOTE("addc_craft_recipe_id");
- SET_RPC_REMOTE("removec_craft_recipe_id");
+ SET_RPC_REMOTE("craft_addc_recipe_id");
+ SET_RPC_REMOTE("craft_removec_recipe_id");
//// SpellSystem ////
@@ -5948,11 +5948,11 @@ Entity::~Entity() {
_physics_process_scis.clear();
}
-void Entity::_scraft(int id) {
- if (!hass_craft_recipe_id(id))
+void Entity::_crafts(int id) {
+ if (!craft_hass_recipe_id(id))
return;
- Ref recipe = gets_craft_recipe_id(id);
+ Ref recipe = craft_gets_recipe_id(id);
if (!recipe.is_valid())
return;
@@ -6501,7 +6501,7 @@ bool Entity::_set(const StringName &p_name, const Variant &p_value) {
Ref cr = ESS::get_instance()->get_resource_db()->get_craft_recipe_path(crn);
if (cr.is_valid()) {
- adds_craft_recipe(cr);
+ craft_adds_recipe(cr);
}
}
}
@@ -7536,35 +7536,35 @@ void Entity::_bind_methods() {
ClassDB::bind_method(D_METHOD("removec_spell_rpc", "id"), &Entity::removec_spell_rpc);
//Crafting
- BIND_VMETHOD(MethodInfo("_scraft", PropertyInfo(Variant::INT, "id")));
+ BIND_VMETHOD(MethodInfo("_crafts", PropertyInfo(Variant::INT, "id")));
- ADD_SIGNAL(MethodInfo("scraft_success", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance")));
+ ADD_SIGNAL(MethodInfo("crafts_success", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance")));
ADD_SIGNAL(MethodInfo("ccraft_success", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance")));
- ADD_SIGNAL(MethodInfo("scraft_recipe_added", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::OBJECT, "craft_recipe", PROPERTY_HINT_RESOURCE_TYPE, "CraftRecipe")));
+ ADD_SIGNAL(MethodInfo("crafts_recipe_added", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::OBJECT, "craft_recipe", PROPERTY_HINT_RESOURCE_TYPE, "CraftRecipe")));
ADD_SIGNAL(MethodInfo("ccraft_recipe_added", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::OBJECT, "craft_recipe", PROPERTY_HINT_RESOURCE_TYPE, "CraftRecipe")));
- ClassDB::bind_method(D_METHOD("crequest_craft", "id"), &Entity::crequest_craft);
- ClassDB::bind_method(D_METHOD("scraft", "id"), &Entity::scraft);
+ ClassDB::bind_method(D_METHOD("craft_crequest", "id"), &Entity::craft_crequest);
+ ClassDB::bind_method(D_METHOD("crafts", "id"), &Entity::crafts);
- ClassDB::bind_method(D_METHOD("hass_craft_recipe", "craft_recipe"), &Entity::hass_craft_recipe);
- ClassDB::bind_method(D_METHOD("hass_craft_recipe_id", "id"), &Entity::hass_craft_recipe_id);
- ClassDB::bind_method(D_METHOD("adds_craft_recipe", "craft_recipe"), &Entity::adds_craft_recipe);
- ClassDB::bind_method(D_METHOD("adds_craft_recipe_id", "id"), &Entity::adds_craft_recipe_id);
- ClassDB::bind_method(D_METHOD("removes_craft_recipe", "craft_recipe"), &Entity::removes_craft_recipe);
- ClassDB::bind_method(D_METHOD("removes_craft_recipe_id", "id"), &Entity::removes_craft_recipe_id);
- ClassDB::bind_method(D_METHOD("gets_craft_recipe", "index"), &Entity::gets_craft_recipe);
- ClassDB::bind_method(D_METHOD("gets_craft_recipe_id", "id"), &Entity::gets_craft_recipe_id);
- ClassDB::bind_method(D_METHOD("gets_craft_recipe_count"), &Entity::gets_craft_recipe_count);
+ ClassDB::bind_method(D_METHOD("craft_hass_recipe", "craft_recipe"), &Entity::craft_hass_recipe);
+ ClassDB::bind_method(D_METHOD("craft_hass_recipe_id", "id"), &Entity::craft_hass_recipe_id);
+ ClassDB::bind_method(D_METHOD("craft_adds_recipe", "craft_recipe"), &Entity::craft_adds_recipe);
+ ClassDB::bind_method(D_METHOD("craft_adds_recipe_id", "id"), &Entity::craft_adds_recipe_id);
+ ClassDB::bind_method(D_METHOD("craft_removes_recipe", "craft_recipe"), &Entity::craft_removes_recipe);
+ ClassDB::bind_method(D_METHOD("craft_removes_recipe_id", "id"), &Entity::craft_removes_recipe_id);
+ ClassDB::bind_method(D_METHOD("craft_gets_recipe", "index"), &Entity::craft_gets_recipe);
+ ClassDB::bind_method(D_METHOD("craft_gets_recipe_id", "id"), &Entity::craft_gets_recipe_id);
+ ClassDB::bind_method(D_METHOD("craft_gets_recipe_count"), &Entity::craft_gets_recipe_count);
- ClassDB::bind_method(D_METHOD("hasc_craft_recipe", "craft_recipe"), &Entity::hasc_craft_recipe);
- ClassDB::bind_method(D_METHOD("hasc_craft_recipe_id", "id"), &Entity::hasc_craft_recipe_id);
- ClassDB::bind_method(D_METHOD("addc_craft_recipe", "craft_recipe"), &Entity::addc_craft_recipe);
- ClassDB::bind_method(D_METHOD("addc_craft_recipe_id", "id"), &Entity::addc_craft_recipe_id);
- ClassDB::bind_method(D_METHOD("removec_craft_recipe", "craft_recipe"), &Entity::removec_craft_recipe);
- ClassDB::bind_method(D_METHOD("removec_craft_recipe_id", "id"), &Entity::removec_craft_recipe_id);
- ClassDB::bind_method(D_METHOD("getc_craft_recipe", "craft_recipe"), &Entity::getc_craft_recipe);
- ClassDB::bind_method(D_METHOD("getc_craft_recipe_count"), &Entity::getc_craft_recipe_count);
+ ClassDB::bind_method(D_METHOD("craft_hasc_recipe", "craft_recipe"), &Entity::craft_hasc_recipe);
+ ClassDB::bind_method(D_METHOD("craft_hasc_recipe_id", "id"), &Entity::craft_hasc_recipe_id);
+ ClassDB::bind_method(D_METHOD("craft_addc_recipe", "craft_recipe"), &Entity::craft_addc_recipe);
+ ClassDB::bind_method(D_METHOD("craft_addc_recipe_id", "id"), &Entity::craft_addc_recipe_id);
+ ClassDB::bind_method(D_METHOD("craft_removec_recipe", "craft_recipe"), &Entity::craft_removec_recipe);
+ ClassDB::bind_method(D_METHOD("craft_removec_recipe_id", "id"), &Entity::craft_removec_recipe_id);
+ ClassDB::bind_method(D_METHOD("craft_getc_recipe", "craft_recipe"), &Entity::craft_getc_recipe);
+ ClassDB::bind_method(D_METHOD("craft_getc_recipe_count"), &Entity::craft_getc_recipe_count);
//Skills
ClassDB::bind_method(D_METHOD("hass_skill_id", "id"), &Entity::hass_skill_id);
@@ -7794,7 +7794,7 @@ void Entity::_bind_methods() {
ClassDB::bind_method(D_METHOD("update", "delta"), &Entity::update);
- ClassDB::bind_method(D_METHOD("_scraft", "id"), &Entity::_scraft);
+ ClassDB::bind_method(D_METHOD("_crafts", "id"), &Entity::_crafts);
ClassDB::bind_method(D_METHOD("_son_xp_gained", "value"), &Entity::_son_xp_gained);
ClassDB::bind_method(D_METHOD("_son_character_level_up", "level"), &Entity::_son_character_level_up);
ClassDB::bind_method(D_METHOD("_son_class_level_up", "level"), &Entity::_son_class_level_up);
diff --git a/entities/entity.h b/entities/entity.h
index 8eda29d..9129599 100644
--- a/entities/entity.h
+++ b/entities/entity.h
@@ -436,27 +436,27 @@ public:
//// Crafting System ////
- void crequest_craft(int id);
- void scraft(int id);
+ void craft_crequest(int id);
+ void crafts(int id);
- bool hass_craft_recipe(Ref craft_recipe);
- bool hass_craft_recipe_id(int id);
- void adds_craft_recipe(Ref craft_recipe);
- void adds_craft_recipe_id(int id);
- void removes_craft_recipe(Ref craft_recipe);
- void removes_craft_recipe_id(int id);
- Ref gets_craft_recipe(int index);
- Ref gets_craft_recipe_id(int id);
- int gets_craft_recipe_count();
+ bool craft_hass_recipe(Ref craft_recipe);
+ bool craft_hass_recipe_id(int id);
+ void craft_adds_recipe(Ref craft_recipe);
+ void craft_adds_recipe_id(int id);
+ void craft_removes_recipe(Ref craft_recipe);
+ void craft_removes_recipe_id(int id);
+ Ref craft_gets_recipe(int index);
+ Ref craft_gets_recipe_id(int id);
+ int craft_gets_recipe_count();
- bool hasc_craft_recipe(Ref craft_recipe);
- bool hasc_craft_recipe_id(int id);
- void addc_craft_recipe(Ref craft_recipe);
- void addc_craft_recipe_id(int id);
- void removec_craft_recipe(Ref craft_recipe);
- void removec_craft_recipe_id(int id);
- Ref getc_craft_recipe(int index);
- int getc_craft_recipe_count();
+ bool craft_hasc_recipe(Ref craft_recipe);
+ bool craft_hasc_recipe_id(int id);
+ void craft_addc_recipe(Ref craft_recipe);
+ void craft_addc_recipe_id(int id);
+ void craft_removec_recipe(Ref craft_recipe);
+ void craft_removec_recipe_id(int id);
+ Ref craft_getc_recipe(int index);
+ int craft_getc_recipe_count();
//// SpellSystem ////
@@ -967,7 +967,7 @@ public:
~Entity();
protected:
- void _scraft(int id);
+ void _crafts(int id);
void _son_xp_gained(int value);
void _son_character_level_up(int level);
void _son_class_level_up(int level);