-Talent is now inherited from Aura.

-Cleaned up the talent system specific classes.
-The ResourceManager now loads talents aswell.
-Cleaned up, and made the EntityResource system scriptable.
-Fixed the stat signals, the stat parameter was null every time. ("this" should've been wrapped in a Ref.)
This commit is contained in:
Relintai 2019-08-13 23:58:42 +02:00
parent 1ae265a171
commit 3cce6b0ae8
28 changed files with 1019 additions and 1091 deletions

View File

@ -1363,6 +1363,8 @@ void Aura::_bind_methods() {
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "StatModAttribute_" + itos(i) + "/percent_mod", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_aura_stat_attribute_percent_mod", "get_aura_stat_attribute_percent_mod", i);
}
ClassDB::bind_method(D_METHOD("is_talent"), &Aura::is_talent);
BIND_CONSTANT(MAX_AURA_STATS);
BIND_CONSTANT(MAX_TRIGGER_DATA);
}

View File

@ -301,6 +301,7 @@ public:
virtual void _calculate_initial_heal(Ref<AuraData> aura_data, Ref<AuraApplyInfo> info);
virtual void _handle_aura_heal(Ref<AuraData> aura_data, Ref<SpellHealInfo> data);
_FORCE_INLINE_ bool is_talent() const { return _aura_type == SpellEnums::AURA_TYPE_TALENT; }
Aura();
~Aura();

View File

@ -3,6 +3,8 @@
#include "../data/spell.h"
#include "../data/aura.h"
#include "../entities/entity.h"
#include "character_spec.h"
#include "../infos/spell_cast_info.h"
int CharacterClass::get_id() {
return _id;
@ -28,11 +30,11 @@ void CharacterClass::set_icon(Ref<Texture> value) {
_icon = Ref<Texture>(value);
}
EntityEnums::PlayerResourceTypes CharacterClass::get_player_resource_type() {
int CharacterClass::get_player_resource_type() {
return _player_resource_type;
}
void CharacterClass::set_player_resource_type(EntityEnums::PlayerResourceTypes value) {
void CharacterClass::set_player_resource_type(int value) {
_player_resource_type = value;
}
@ -107,6 +109,13 @@ void CharacterClass::set_aura(int index, Ref<Aura> aura) {
_auras[index] = aura;
}
void CharacterClass::setup_resources(Entity *entity) {
if (has_method("_setup_resources"))
call("_setup_resources", entity);
}
//void CharacterClass::_setup_resources(Entity *entity) {
//}
/*
Vector<int> CharacterClass::get_mob_party_ids() {
return _mob_party_ids;
@ -638,6 +647,8 @@ void CharacterClass::_bind_methods() {
BIND_VMETHOD(MethodInfo("_son_gcd_started", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::REAL, "gcd")));
BIND_VMETHOD(MethodInfo("_son_gcd_finished", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity")));
BIND_VMETHOD(MethodInfo("_setup_resources", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity")));
//Clientside Event Handlers
ClassDB::bind_method(D_METHOD("con_cast_failed", "info"), &CharacterClass::con_cast_failed);

View File

@ -7,12 +7,10 @@
#include "../entities/stats/stat_data.h"
#include "../entity_enums.h"
#include "character_spec.h"
#include "../entities/auras/aura_data.h"
#include "../pipelines/spell_damage_info.h"
#include "../pipelines/spell_heal_info.h"
#include "../infos/spell_cast_info.h"
#include "../utility/cooldown.h"
#include "../utility/category_cooldown.h"
@ -22,6 +20,7 @@ class Spell;
class Entity;
class CharacterSpec;
class Entity;
class SpellCastInfo;
enum CharacterWeaponDataTypes {
CHARACTER_WEAPON_DATA_TYPES_NONE,
@ -47,8 +46,8 @@ public:
Ref<StatData> get_stat_data();
void set_stat_data(Ref<StatData> value);
EntityEnums::PlayerResourceTypes get_player_resource_type();
void set_player_resource_type(EntityEnums::PlayerResourceTypes value);
int get_player_resource_type();
void set_player_resource_type(int value);
int get_num_spells();
void set_num_spells(int value);
@ -68,13 +67,10 @@ public:
Ref<Aura> get_aura(int index);
void set_aura(int index, Ref<Aura> aura);
void setup_resources(Entity *entity);
//void _setup_resources(Entity *entity);
/*
Vector<int> get_talent_ids();
void set_talent_ids(Vector<int> ids);
Vector<int> get_spec_ids();
void set_spec_ids(Vector<int> ids);
Vector<int> get_mob_party_ids();
void set_mob_party_ids(Vector<int> ids);
@ -186,7 +182,7 @@ private:
String _character_class_name;
Ref<Texture> _icon;
EntityEnums::PlayerResourceTypes _player_resource_type;
int _player_resource_type;
Ref<StatData> _stat_data;

View File

@ -1,5 +1,7 @@
#include "character_spec.h"
#include "talent.h"
int CharacterSpec::get_spec_id() {
return _spec_id;
}
@ -17,57 +19,36 @@ void CharacterSpec::set_spec_name(String value) {
}
Ref<TalentRowData> CharacterSpec::get_talent_row(int index) const {
ERR_FAIL_INDEX_V(index, MAX_TALENT_ROWS, Ref<TalentRowData>(NULL));
return _rows[index];
}
Ref<Talent> CharacterSpec::get_talent0_in_row(int index) const {
return _rows[index]->get_talent0();
void CharacterSpec::set_talent_row(const int index, const Ref<TalentRowData> row) {
ERR_FAIL_INDEX(index, MAX_TALENT_ROWS);
_rows[index] = row;
}
void CharacterSpec::set_talent0_in_row(int index, Ref<Talent> talent) {
_rows[index]->set_talent0(talent);
}
Ref<Talent> CharacterSpec::get_talent(const int row_index, const int index) const {
ERR_FAIL_INDEX_V(row_index, MAX_TALENT_ROWS, Ref<Talent>(NULL));
Ref<Talent> CharacterSpec::get_talent1_in_row(int index) const {
return _rows[index]->get_talent1();
}
void CharacterSpec::set_talent1_in_row(int index, Ref<Talent> talent) {
_rows[index]->set_talent1(talent);
}
Ref<Talent> CharacterSpec::get_talent2_in_row(int index) const {
return _rows[index]->get_talent2();
}
void CharacterSpec::set_talent2_in_row(int index, Ref<Talent> talent) {
_rows[index]->set_talent2(talent);
}
Ref<Talent> CharacterSpec::get_talent3_in_row(int index) const {
return _rows[index]->get_talent3();
}
void CharacterSpec::set_talent3_in_row(int index, Ref<Talent> talent) {
_rows[index]->set_talent3(talent);
}
Ref<Talent> CharacterSpec::get_talent4_in_row(int index) const {
return _rows[index]->get_talent4();
}
void CharacterSpec::set_talent4_in_row(int index, Ref<Talent> talent) {
_rows[index]->set_talent4(talent);
}
CharacterSpec::CharacterSpec() {
for (int i = 0; i < MAX_TALENT_ROWS; ++i) {
_rows[i] = Ref<TalentRowData>(memnew(TalentRowData()));
if (_rows[row_index].is_valid()) {
return _rows[row_index]->get_talent(index);
}
return Ref<Talent>(NULL);
}
CharacterSpec::CharacterSpec() {
_spec_id = 0;
}
CharacterSpec::~CharacterSpec() {
for (int i = 0; i < MAX_TALENT_ROWS; ++i) {
_rows[i].unref();
}
}
void CharacterSpec::_bind_methods() {
@ -79,24 +60,14 @@ void CharacterSpec::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_spec_name", "value"), &CharacterSpec::set_spec_name);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "spec_name"), "set_spec_name", "get_spec_name");
ClassDB::bind_method(D_METHOD("get_talent0_in_row", "index"), &CharacterSpec::get_talent0_in_row);
ClassDB::bind_method(D_METHOD("set_talent0_in_row", "index", "value"), &CharacterSpec::set_talent0_in_row);
ClassDB::bind_method(D_METHOD("get_talent1_in_row", "index"), &CharacterSpec::get_talent0_in_row);
ClassDB::bind_method(D_METHOD("set_talent1_in_row", "index", "value"), &CharacterSpec::set_talent0_in_row);
ClassDB::bind_method(D_METHOD("get_talent2_in_row", "index"), &CharacterSpec::get_talent0_in_row);
ClassDB::bind_method(D_METHOD("set_talent2_in_row", "index", "value"), &CharacterSpec::set_talent0_in_row);
ClassDB::bind_method(D_METHOD("get_talent3_in_row", "index"), &CharacterSpec::get_talent0_in_row);
ClassDB::bind_method(D_METHOD("set_talent3_in_row", "index", "value"), &CharacterSpec::set_talent0_in_row);
ClassDB::bind_method(D_METHOD("get_talent4_in_row", "index"), &CharacterSpec::get_talent0_in_row);
ClassDB::bind_method(D_METHOD("set_talent4_in_row", "index", "value"), &CharacterSpec::set_talent0_in_row);
ClassDB::bind_method(D_METHOD("get_talent_row", "index"), &CharacterSpec::get_talent_row);
ClassDB::bind_method(D_METHOD("set_talent_row", "index", "row"), &CharacterSpec::set_talent_row);
for (int i = 0; i < MAX_TALENT_ROWS; i++) {
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "Row_" + itos(i) + "/talent0", PROPERTY_HINT_RESOURCE_TYPE, "Talent", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_talent0_in_row", "get_talent0_in_row", i);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "Row_" + itos(i) + "/talent1", PROPERTY_HINT_RESOURCE_TYPE, "Talent", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_talent1_in_row", "get_talent1_in_row", i);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "Row_" + itos(i) + "/talent2", PROPERTY_HINT_RESOURCE_TYPE, "Talent", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_talent2_in_row", "get_talent2_in_row", i);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "Row_" + itos(i) + "/talent3", PROPERTY_HINT_RESOURCE_TYPE, "Talent", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_talent3_in_row", "get_talent3_in_row", i);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "Row_" + itos(i) + "/talent4", PROPERTY_HINT_RESOURCE_TYPE, "Talent", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_talent4_in_row", "get_talent4_in_row", i);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "Row_" + itos(i), PROPERTY_HINT_RESOURCE_TYPE, "TalentRowData", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_talent_row", "get_talent_row", i);
}
ClassDB::bind_method(D_METHOD("get_talent_row"), &CharacterSpec::get_talent_row);
ClassDB::bind_method(D_METHOD("get_talent", "row_index", "index"), &CharacterSpec::get_talent);
BIND_CONSTANT(MAX_TALENT_ROWS);
}

View File

@ -19,33 +19,22 @@ public:
void set_spec_name(String value);
Ref<TalentRowData> get_talent_row(int index) const;
void set_talent_row(const int index, const Ref<TalentRowData> row);
Ref<Talent> get_talent0_in_row(int index) const;
void set_talent0_in_row(int index, Ref<Talent> talent);
Ref<Talent> get_talent1_in_row(int index) const;
void set_talent1_in_row(int index, Ref<Talent> talent);
Ref<Talent> get_talent2_in_row(int index) const;
void set_talent2_in_row(int index, Ref<Talent> talent);
Ref<Talent> get_talent3_in_row(int index) const;
void set_talent3_in_row(int index, Ref<Talent> talent);
Ref<Talent> get_talent4_in_row(int index) const;
void set_talent4_in_row(int index, Ref<Talent> talent);
Ref<Talent> get_talent(const int row_index, const int index) const;
CharacterSpec();
~CharacterSpec();
public:
enum {
MAX_TALENT_ROWS = 10,
};
protected:
static void _bind_methods();
private:
enum {
MAX_TALENT_ROWS = 10,
};
int _spec_id;
String _spec_name;
Ref<TalentRowData> _rows[MAX_TALENT_ROWS];

View File

@ -4,6 +4,7 @@
#include "character_class.h"
#include "craft_data_attribute.h"
#include "spell.h"
#include "talent.h"
#include "mob_data.h"
#include "player_character_data.h"
@ -129,6 +130,41 @@ int DataManager::get_aura_count() {
return _auras.size();
}
//Talents
void DataManager::add_talent(Ref<Talent> talent) {
ERR_FAIL_COND(!talent.is_valid());
_talents.push_back(talent);
_talent_map.set(talent->get_id(), talent);
}
String DataManager::get_talents_folder() {
return _talents_folder;
}
void DataManager::set_talents_folder(String folder) {
_talents_folder = folder;
}
Vector<Ref<Talent> > *DataManager::get_talents() {
return &_talents;
}
Ref<Talent> DataManager::get_talent(int talent_id) {
ERR_FAIL_COND_V(!_talent_map.has(talent_id), Ref<Talent>(NULL));
return _talent_map.get(talent_id);
}
Ref<Talent> DataManager::get_talent_index(int index) {
ERR_FAIL_INDEX_V(index, _talents.size(), Ref<Talent>(NULL));
return _talents.get(index);
}
int DataManager::get_talent_count() {
return _talents.size();
}
//Craft Data
void DataManager::add_craft_data(Ref<CraftDataAttribute> cda) {
ERR_FAIL_COND(!cda.is_valid());
@ -267,6 +303,7 @@ int DataManager::get_player_character_data_count() {
void DataManager::load_all() {
load_spells();
load_auras();
load_talents();
load_characters();
load_craft_datas();
load_item_templates();
@ -352,6 +389,45 @@ void DataManager::load_auras() {
}
}
void DataManager::load_talents() {
_Directory dir;
ERR_FAIL_COND(_talents_folder.ends_with("/"));
if (dir.open(_talents_folder) == OK) {
dir.list_dir_begin();
String filename = dir.get_next();
while (filename != "") {
if (!dir.current_is_dir()) {
String path = _talents_folder + "/" + filename;
_ResourceLoader *rl = _ResourceLoader::get_singleton();
Ref<ResourceInteractiveLoader> resl = rl->load_interactive(path, "Aura");
resl->wait();
Ref<Resource> s = resl->get_resource();
ERR_CONTINUE(!s.is_valid());
Ref<Talent> talent = s;
ERR_CONTINUE(!talent.is_valid());
add_talent(talent);
}
filename = dir.get_next();
}
} else {
print_error("An error occurred when trying to access the path.");
}
}
void DataManager::load_characters() {
_Directory dir;
@ -565,6 +641,12 @@ void DataManager::list_auras() {
}
}
void DataManager::list_talents() {
for (int i = 0; i < _talents.size(); ++i) {
print_error(itos(i) + ": " + _talents.get(i)->get_aura_name());
}
}
void DataManager::list_craft_data() {
for (int i = 0; i < _craft_datas.size(); ++i) {
print_error(itos(i) + ": " + _craft_datas.get(i)->get_name());
@ -624,6 +706,16 @@ void DataManager::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_aura_index", "index"), &DataManager::get_aura_index);
ClassDB::bind_method(D_METHOD("get_aura_count"), &DataManager::get_aura_count);
//Talent
ClassDB::bind_method(D_METHOD("get_talents_folder"), &DataManager::get_talents_folder);
ClassDB::bind_method(D_METHOD("set_talents_folder", "folder"), &DataManager::set_talents_folder);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "talents_folder"), "set_talents_folder", "get_talents_folder");
ClassDB::bind_method(D_METHOD("add_talent", "spell"), &DataManager::add_talent);
ClassDB::bind_method(D_METHOD("get_talent", "id"), &DataManager::get_talent);
ClassDB::bind_method(D_METHOD("get_talent_index", "index"), &DataManager::get_talent_index);
ClassDB::bind_method(D_METHOD("get_talent_count"), &DataManager::get_talent_count);
//Craft Data
ClassDB::bind_method(D_METHOD("get_craft_data_folder"), &DataManager::get_craft_data_folder);
ClassDB::bind_method(D_METHOD("set_craft_data_folder", "folder"), &DataManager::set_craft_data_folder);
@ -668,6 +760,7 @@ void DataManager::_bind_methods() {
ClassDB::bind_method(D_METHOD("load_all"), &DataManager::load_all);
ClassDB::bind_method(D_METHOD("load_spells"), &DataManager::load_spells);
ClassDB::bind_method(D_METHOD("load_auras"), &DataManager::load_auras);
ClassDB::bind_method(D_METHOD("load_talents"), &DataManager::load_talents);
ClassDB::bind_method(D_METHOD("load_characters"), &DataManager::load_characters);
ClassDB::bind_method(D_METHOD("load_craft_datas"), &DataManager::load_craft_datas);
ClassDB::bind_method(D_METHOD("load_item_templates"), &DataManager::load_item_templates);
@ -678,6 +771,7 @@ void DataManager::_bind_methods() {
ClassDB::bind_method(D_METHOD("list_characters"), &DataManager::list_characters);
ClassDB::bind_method(D_METHOD("list_spells"), &DataManager::list_spells);
ClassDB::bind_method(D_METHOD("list_auras"), &DataManager::list_auras);
ClassDB::bind_method(D_METHOD("list_talents"), &DataManager::list_talents);
ClassDB::bind_method(D_METHOD("list_craft_data"), &DataManager::list_craft_data);
ClassDB::bind_method(D_METHOD("list_item_templates"), &DataManager::list_item_templates);
ClassDB::bind_method(D_METHOD("list_mob_datas"), &DataManager::list_mob_datas);
@ -701,6 +795,9 @@ DataManager::~DataManager() {
_auras.clear();
_aura_map.clear();
_talents.clear();
_talent_map.clear();
_craft_datas.clear();
_craft_data_map.clear();

View File

@ -15,6 +15,7 @@
class Aura;
class Spell;
class Talent;
class CharacterClass;
class CraftDataAttribute;
class ItemTemplate;
@ -51,6 +52,14 @@ public:
int get_aura_count();
void add_aura(Ref<Aura> aura);
String get_talents_folder();
void set_talents_folder(String folder);
Vector<Ref<Talent> > *get_talents();
Ref<Talent> get_talent(int talent_id);
Ref<Talent> get_talent_index(int index);
int get_talent_count();
void add_talent(Ref<Talent> talent);
String get_craft_data_folder();
void set_craft_data_folder(String folder);
Vector<Ref<CraftDataAttribute> > *get_craft_datas();
@ -86,6 +95,7 @@ public:
void load_all();
void load_spells();
void load_auras();
void load_talents();
void load_characters();
void load_craft_datas();
void load_item_templates();
@ -95,6 +105,7 @@ public:
void list_characters();
void list_spells();
void list_auras();
void list_talents();
void list_craft_data();
void list_item_templates();
void list_mob_datas();
@ -123,6 +134,10 @@ private:
Vector<Ref<Aura> > _auras;
HashMap<int, Ref<Aura> > _aura_map;
String _talents_folder;
Vector<Ref<Talent> > _talents;
HashMap<int, Ref<Talent> > _talent_map;
String _craft_data_folder;
Vector<Ref<CraftDataAttribute> > _craft_datas;
HashMap<int, Ref<CraftDataAttribute> > _craft_data_map;

View File

@ -138,10 +138,10 @@ void Spell::set_required_item(int value) {
_required_item = value;
}
EntityEnums::PlayerResourceTypes Spell::get_cost_type() {
int Spell::get_cost_type() {
return _cost_type;
}
void Spell::set_cost_type(EntityEnums::PlayerResourceTypes value) {
void Spell::set_cost_type(int value) {
_cost_type = value;
}
@ -152,10 +152,10 @@ void Spell::set_cost_resource(int value) {
_cost_resource = value;
}
EntityEnums::PlayerResourceTypes Spell::get_give_resource_type() {
int Spell::get_give_resource_type() {
return _give_resource_type;
}
void Spell::set_give_resource_type(EntityEnums::PlayerResourceTypes value) {
void Spell::set_give_resource_type(int value) {
_give_resource_type = value;
}
@ -1041,7 +1041,7 @@ void Spell::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_cost_type"), &Spell::get_cost_type);
ClassDB::bind_method(D_METHOD("set_cost_type", "value"), &Spell::set_cost_type);
ADD_PROPERTY(PropertyInfo(Variant::INT, "cost_type", PROPERTY_HINT_ENUM, "None, Rage"), "set_cost_type", "get_cost_type");
ADD_PROPERTY(PropertyInfo(Variant::INT, "cost_type"), "set_cost_type", "get_cost_type");
ClassDB::bind_method(D_METHOD("get_cost_resource"), &Spell::get_cost_resource);
ClassDB::bind_method(D_METHOD("set_cost_resource", "value"), &Spell::set_cost_resource);
@ -1050,7 +1050,7 @@ void Spell::_bind_methods() {
ADD_GROUP("Gives", "give");
ClassDB::bind_method(D_METHOD("get_give_resource_type"), &Spell::get_give_resource_type);
ClassDB::bind_method(D_METHOD("set_give_resource_type", "value"), &Spell::set_give_resource_type);
ADD_PROPERTY(PropertyInfo(Variant::INT, "give_resource_type", PROPERTY_HINT_ENUM, "None, Rage"), "set_give_resource_type", "get_give_resource_type");
ADD_PROPERTY(PropertyInfo(Variant::INT, "give_resource_type"), "set_give_resource_type", "get_give_resource_type");
ClassDB::bind_method(D_METHOD("get_give_resource"), &Spell::get_give_resource);
ClassDB::bind_method(D_METHOD("set_give_resource", "value"), &Spell::set_give_resource);

View File

@ -127,14 +127,14 @@ public:
int get_required_item();
void set_required_item(int value);
EntityEnums::PlayerResourceTypes get_cost_type();
void set_cost_type(EntityEnums::PlayerResourceTypes value);
int get_cost_type();
void set_cost_type(int value);
int get_cost_resource();
void set_cost_resource(int value);
EntityEnums::PlayerResourceTypes get_give_resource_type();
void set_give_resource_type(EntityEnums::PlayerResourceTypes value);
int get_give_resource_type();
void set_give_resource_type(int value);
int get_give_resource();
void set_give_resource(int value);
@ -392,9 +392,9 @@ private:
int _item_cost;
int _craft_material_cost;
int _required_item;
EntityEnums::PlayerResourceTypes _cost_type;
int _cost_type;
int _cost_resource;
EntityEnums::PlayerResourceTypes _give_resource_type;
int _give_resource_type;
int _give_resource;
bool _has_global_cooldown;
bool _is_local_spell;

View File

@ -1,187 +1,28 @@
#include "talent.h"
int Talent::get_id(){
return _id;
Ref<Talent> Talent::get_next_rank() const {
return _next_rank;
}
void Talent::set_next_rank(const Ref<Talent> rank) {
_next_rank = rank;
}
void Talent::set_id(int value)
{
_id = value;
Talent::Talent() {
set_aura_type(SpellEnums::AURA_TYPE_TALENT);
set_hide(true);
}
Ref<TalentRankData> Talent::get_rank_data(int index)
{
return _ranks[index];
Talent::~Talent() {
_next_rank.unref();
_aura.unref();
}
String Talent::get_talent_name()
{
return _talent_name;
}
void Talent::set_talent_name(String value)
{
_talent_name = value;
}
String Talent::get_description()
{
return _description;
}
void Talent::set_description(String value)
{
_description = value;
}
int Talent::get_max_rank()
{
return _max_rank;
}
void Talent::set_max_rank(int value)
{
_max_rank = value;
}
Stat::StatId Talent::get_talent_stat_attribute_stat(int index) const {
ERR_FAIL_INDEX_V(index, MAX_RANKS, Stat::STAT_ID_NONE);
return _ranks[index]->get_stat();
}
void Talent::set_talent_stat_attribute_stat(int index, const Stat::StatId value) {
ERR_FAIL_INDEX(index, MAX_RANKS);
_ranks[index]->set_stat(value);
}
float Talent::get_talent_stat_attribute_base_mod(int index) const {
ERR_FAIL_INDEX_V(index, MAX_RANKS, 0);
return _ranks[index]->get_base_mod();
}
void Talent::set_talent_stat_attribute_base_mod(int index, float value) {
ERR_FAIL_INDEX(index, MAX_RANKS);
_ranks[index]->set_base_mod(value);
}
float Talent::get_talent_stat_attribute_bonus_mod(int index) const {
ERR_FAIL_INDEX_V(index, MAX_RANKS, 0);
return _ranks[index]->get_bonus_mod();
}
void Talent::set_talent_stat_attribute_bonus_mod(int index, float value) {
ERR_FAIL_INDEX(index, MAX_RANKS);
_ranks[index]->set_bonus_mod(value);
}
float Talent::get_talent_stat_attribute_percent_mod(int index) const {
ERR_FAIL_INDEX_V(index, MAX_RANKS, 0);
return _ranks[index]->get_percent_mod();
}
void Talent::set_talent_stat_attribute_percent_mod(int index, float value) {
ERR_FAIL_INDEX(index, MAX_RANKS);
_ranks[index]->set_percent_mod(value);
}
Ref<Aura> Talent::get_talent_aura(int index) const {
ERR_FAIL_INDEX_V(index, MAX_RANKS, 0);
return _ranks[index]->get_aura();
}
void Talent::set_talent_aura(int index, Ref<Aura> value) {
ERR_FAIL_INDEX(index, MAX_RANKS);
_ranks[index]->set_aura(value);
}
Talent::Talent()
{
for (int i = 0; i < MAX_RANKS; ++i)
{
_ranks[i] = Ref<TalentRankData>(memnew(TalentRankData()));
}
_id = 0;
_talent_name = "";
_description = "";
_max_rank = 0;
}
Talent::~Talent()
{
}
void Talent::_validate_property(PropertyInfo &property) const {
String prop = property.name;
if (prop.begins_with("TalentRank_")) {
int frame = prop.get_slicec('/', 0).get_slicec('_', 1).to_int();
if (frame >= _max_rank) {
property.usage = 0;
}
}
}
void Talent::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_id"), &Talent::get_id);
ClassDB::bind_method(D_METHOD("set_id", "value"), &Talent::set_id);
ADD_PROPERTY(PropertyInfo(Variant::INT, "id"), "set_id", "get_id");
ClassDB::bind_method(D_METHOD("get_next_rank"), &Talent::get_next_rank);
ClassDB::bind_method(D_METHOD("set_next_rank", "next_rank"), &Talent::set_next_rank);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "next_rank", PROPERTY_HINT_RESOURCE_TYPE, "Talent"), "set_next_rank", "get_next_rank");
ClassDB::bind_method(D_METHOD("get_talent_name"), &Talent::get_talent_name);
ClassDB::bind_method(D_METHOD("set_talent_name", "value"), &Talent::set_talent_name);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "talent_name"), "set_talent_name", "get_talent_name");
ClassDB::bind_method(D_METHOD("get_description"), &Talent::get_description);
ClassDB::bind_method(D_METHOD("set_description", "value"), &Talent::set_description);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "description"), "set_description", "get_description");
//// Ranks ////
ADD_GROUP("Rank", "rank");
ClassDB::bind_method(D_METHOD("get_max_rank"), &Talent::get_max_rank);
ClassDB::bind_method(D_METHOD("set_max_rank", "value"), &Talent::set_max_rank);
ClassDB::bind_method(D_METHOD("get_talent_stat_attribute_stat", "index"), &Talent::get_talent_stat_attribute_stat);
ClassDB::bind_method(D_METHOD("set_talent_stat_attribute_stat", "index", "value"), &Talent::set_talent_stat_attribute_stat);
ClassDB::bind_method(D_METHOD("get_talent_stat_attribute_base_mod", "index"), &Talent::get_talent_stat_attribute_base_mod);
ClassDB::bind_method(D_METHOD("set_talent_stat_attribute_base_mod", "index", "value"), &Talent::set_talent_stat_attribute_base_mod);
ClassDB::bind_method(D_METHOD("get_talent_stat_attribute_bonus_mod", "index"), &Talent::get_talent_stat_attribute_bonus_mod);
ClassDB::bind_method(D_METHOD("set_talent_stat_attribute_bonus_mod", "index", "value"), &Talent::set_talent_stat_attribute_bonus_mod);
ClassDB::bind_method(D_METHOD("get_talent_stat_attribute_percent_mod", "index"), &Talent::get_talent_stat_attribute_percent_mod);
ClassDB::bind_method(D_METHOD("set_talent_stat_attribute_percent_mod", "index", "value"), &Talent::set_talent_stat_attribute_percent_mod);
ClassDB::bind_method(D_METHOD("get_talent_aura", "index"), &Talent::get_talent_aura);
ClassDB::bind_method(D_METHOD("set_talent_aura", "index", "value"), &Talent::set_talent_aura);
ADD_PROPERTY(PropertyInfo(Variant::INT, "max_rank", PROPERTY_HINT_RANGE, "0," + itos(MAX_RANKS), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), "set_max_rank", "get_max_rank");
for (int i = 0; i < MAX_RANKS; ++i) {
ADD_PROPERTYI(PropertyInfo(Variant::INT, "TalentRank_" + itos(i) + "/stat", PROPERTY_HINT_ENUM, Stat::STAT_BINDING_STRING, PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_talent_stat_attribute_stat", "get_talent_stat_attribute_stat", i);
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "TalentRank_" + itos(i) + "/base_mod", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_talent_stat_attribute_base_mod", "get_talent_stat_attribute_base_mod", i);
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "TalentRank_" + itos(i) + "/bonus_mod", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_talent_stat_attribute_bonus_mod", "get_talent_stat_attribute_bonus_mod", i);
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "TalentRank_" + itos(i) + "/percent_mod", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_talent_stat_attribute_percent_mod", "get_talent_stat_attribute_percent_mod", i);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "TalentRank_" + itos(i) + "/aura", PROPERTY_HINT_RESOURCE_TYPE, "Aura", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_talent_aura", "get_talent_aura", i);
}
ClassDB::bind_method(D_METHOD("get_rank_data", "index"), &Talent::get_rank_data);
BIND_CONSTANT(MAX_RANKS);
ClassDB::bind_method(D_METHOD("get_apply_aura"), &Talent::get_apply_aura);
ClassDB::bind_method(D_METHOD("set_apply_aura", "value"), &Talent::set_apply_aura);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "apply_aura", PROPERTY_HINT_RESOURCE_TYPE, "Aura"), "set_apply_aura", "get_apply_aura");
}

View File

@ -4,64 +4,28 @@
#include "core/resource.h"
#include "core/ustring.h"
#include "../entities/stats/stat.h"
#include "aura.h"
#include "talent_rank_data.h"
class TalentRankData;
class Aura;
class Talent : public Resource {
GDCLASS(Talent, Resource);
class Talent : public Aura {
GDCLASS(Talent, Aura);
public:
int get_id();
void set_id(int value);
Ref<Talent> get_next_rank() const;
void set_next_rank(const Ref<Talent> rank);
String get_talent_name();
void set_talent_name(String value);
String get_description();
void set_description(String value);
Ref<TalentRankData> get_rank_data(int index);
int get_max_rank();
void set_max_rank(int value);
Stat::StatId get_talent_stat_attribute_stat(int index) const;
void set_talent_stat_attribute_stat(int index, const Stat::StatId value);
float get_talent_stat_attribute_base_mod(int index) const;
void set_talent_stat_attribute_base_mod(int index, float value);
float get_talent_stat_attribute_bonus_mod(int index) const;
void set_talent_stat_attribute_bonus_mod(int index, float value);
float get_talent_stat_attribute_percent_mod(int index) const;
void set_talent_stat_attribute_percent_mod(int index, float value);
Ref<Aura> get_talent_aura(int index) const;
void set_talent_aura(int index, Ref<Aura> value);
Ref<Aura> get_apply_aura() const { return _aura; }
void set_apply_aura(Ref<Aura> aura) { _aura = Ref<Aura>(aura); }
Talent();
~Talent();
protected:
static void _bind_methods();
void _validate_property(PropertyInfo &property) const;
private:
enum {
MAX_RANKS = 5,
};
Ref<Talent> _next_rank;
int _id;
String _talent_name;
String _description;
int _max_rank;
Ref<TalentRankData> _ranks[MAX_RANKS];
Ref<Aura> _aura;
};
#endif

View File

@ -1 +0,0 @@
#include "talent_rank_data.h"

View File

@ -1,74 +0,0 @@
#ifndef TALENT_RANK_DATA_H
#define TALENT_RANK_DATA_H
#include "core/ustring.h"
#include "core/reference.h"
#include "../entities/stats/stat.h"
#include "aura.h"
class Aura;
class TalentRankData : public Reference
{
GDCLASS(TalentRankData, Reference);
public:
Stat::StatId get_stat() const { return _stat; }
void set_stat(Stat::StatId value) { _stat = value; }
float get_base_mod() const { return _base_mod; }
void set_base_mod(float value) { _base_mod = value; }
float get_bonus_mod() const { return _bonus_mod; }
void set_bonus_mod(float value) { _bonus_mod = value; }
float get_percent_mod() const { return _percent_mod; }
void set_percent_mod(float value) { _percent_mod = value; }
Ref<Aura> get_aura() const { return _aura; }
void set_aura (Ref<Aura> aura) { _aura = Ref<Aura>(aura); }
TalentRankData() {
_stat = Stat::STAT_ID_NONE;
_base_mod = 0;
_bonus_mod = 0;
_percent_mod = 0;
}
~TalentRankData() {
}
protected:
static void _bind_methods() {
ClassDB::bind_method(D_METHOD("get_stat"), &TalentRankData::get_stat);
ClassDB::bind_method(D_METHOD("set_stat", "value"), &TalentRankData::set_stat);
ADD_PROPERTY(PropertyInfo(Variant::INT, "stat", PROPERTY_HINT_ENUM, Stat::STAT_BINDING_STRING), "set_stat", "get_stat");
ClassDB::bind_method(D_METHOD("get_base_mod"), &TalentRankData::get_base_mod);
ClassDB::bind_method(D_METHOD("set_base_mod", "value"), &TalentRankData::set_base_mod);
ADD_PROPERTY(PropertyInfo(Variant::REAL, "base_mod"), "set_base_mod", "get_base_mod");
ClassDB::bind_method(D_METHOD("get_bonus_mod"), &TalentRankData::get_bonus_mod);
ClassDB::bind_method(D_METHOD("set_bonus_mod", "value"), &TalentRankData::set_bonus_mod);
ADD_PROPERTY(PropertyInfo(Variant::REAL, "bonus_mod"), "set_bonus_mod", "get_bonus_mod");
ClassDB::bind_method(D_METHOD("get_percent_mod"), &TalentRankData::get_percent_mod);
ClassDB::bind_method(D_METHOD("set_percent_mod", "value"), &TalentRankData::set_percent_mod);
ADD_PROPERTY(PropertyInfo(Variant::REAL, "percent_mod"), "set_percent_mod", "get_percent_mod");
ClassDB::bind_method(D_METHOD("get_aura"), &TalentRankData::get_aura);
ClassDB::bind_method(D_METHOD("set_aura", "value"), &TalentRankData::set_aura);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura", PROPERTY_HINT_RESOURCE_TYPE, "Aura"), "set_aura", "get_aura");
}
private:
Stat::StatId _stat;
float _base_mod;
float _bonus_mod;
float _percent_mod;
Ref<Aura>_aura;
};
#endif

View File

@ -1,74 +1,32 @@
#include "talent_row_data.h"
Ref<Talent> TalentRowData::get_talent(int index) const {
ERR_FAIL_INDEX_V(index, MAX_TALENTS_IN_ROW, Ref<Talent>(NULL));
return _talents[index];
}
void TalentRowData::set_talent(int index, Ref<Talent> talent) {
ERR_FAIL_INDEX(index, MAX_TALENTS_IN_ROW);
_talents[index] = Ref<Talent>(talent);
}
Ref<Talent> TalentRowData::get_talent0() const {
return _talents[0];
TalentRowData::TalentRowData() {
}
void TalentRowData::set_talent0(Ref<Talent> talent) {
_talents[0] = Ref<Talent>(talent);
}
Ref<Talent> TalentRowData::get_talent1() const {
return _talents[1];
}
void TalentRowData::set_talent1(Ref<Talent> talent) {
_talents[1] = Ref<Talent>(talent);
}
Ref<Talent> TalentRowData::get_talent2() const {
return _talents[2];
}
void TalentRowData::set_talent2(Ref<Talent> talent) {
_talents[2] = Ref<Talent>(talent);
}
Ref<Talent> TalentRowData::get_talent3() const {
return _talents[3];
}
void TalentRowData::set_talent3(Ref<Talent> talent) {
_talents[3] = Ref<Talent>(talent);
}
Ref<Talent> TalentRowData::get_talent4() const {
return _talents[4];
}
void TalentRowData::set_talent4(Ref<Talent> talent) {
_talents[4] = Ref<Talent>(talent);
TalentRowData::~TalentRowData() {
for (int i = 0; i < MAX_TALENTS_IN_ROW; ++i) {
_talents[i].unref();
}
}
void TalentRowData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_talent", "index"), &TalentRowData::get_talent);
ClassDB::bind_method(D_METHOD("set_talent", "index", "value"), &TalentRowData::set_talent);
ClassDB::bind_method(D_METHOD("get_talent0"), &TalentRowData::get_talent0);
ClassDB::bind_method(D_METHOD("set_talent0", "value"), &TalentRowData::set_talent0);
for (int i = 0; i < MAX_TALENTS_IN_ROW; ++i) {
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "Talent_" + itos(i), PROPERTY_HINT_RESOURCE_TYPE, "Talent", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_talent", "get_talent", i);
}
ClassDB::bind_method(D_METHOD("get_talent1"), &TalentRowData::get_talent1);
ClassDB::bind_method(D_METHOD("set_talent1", "value"), &TalentRowData::set_talent1);
ClassDB::bind_method(D_METHOD("get_talent2"), &TalentRowData::get_talent2);
ClassDB::bind_method(D_METHOD("set_talent2", "value"), &TalentRowData::set_talent2);
ClassDB::bind_method(D_METHOD("get_talent3"), &TalentRowData::get_talent3);
ClassDB::bind_method(D_METHOD("set_talent3", "value"), &TalentRowData::set_talent3);
ClassDB::bind_method(D_METHOD("get_talent4"), &TalentRowData::get_talent4);
ClassDB::bind_method(D_METHOD("set_talent4", "value"), &TalentRowData::set_talent4);
//for (int i = 0; i < MAX_TALENTS_IN_ROW; i++) {
// ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "Row_" + itos(i) + "/talent" + itos(i), PROPERTY_HINT_RESOURCE_TYPE, "Talent", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_talent", "get_talent", i);
//}
BIND_CONSTANT(MAX_TALENTS_IN_ROW);
}

View File

@ -8,42 +8,25 @@
class Talent;
class TalentRowData : public Reference {
GDCLASS(TalentRowData, Reference);
class TalentRowData : public Resource {
GDCLASS(TalentRowData, Resource);
public:
Ref<Talent> get_talent(int index) const;
void set_talent(int index, Ref<Talent> talent);
Ref<Talent> get_talent0() const;
void set_talent0(Ref<Talent> talent);
TalentRowData();
~TalentRowData();
Ref<Talent> get_talent1() const;
void set_talent1(Ref<Talent> talent);
Ref<Talent> get_talent2() const;
void set_talent2(Ref<Talent> talent);
Ref<Talent> get_talent3() const;
void set_talent3(Ref<Talent> talent);
Ref<Talent> get_talent4() const;
void set_talent4(Ref<Talent> talent);
TalentRowData() {
for (int i = 0; i < MAX_TALENTS_IN_ROW; ++i) {
_talents[i] = Ref<Talent>(NULL);
}
}
public:
enum {
MAX_TALENTS_IN_ROW = 5,
};
protected:
static void _bind_methods();
private:
enum {
MAX_TALENTS_IN_ROW = 5,
};
Ref<Talent> _talents[MAX_TALENTS_IN_ROW];
};

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,6 @@
#include "core/ustring.h"
#include "core/vector.h"
#include "../data/item_instance.h"
#include "player_talent.h"
#include "entity_resource.h"
@ -30,8 +29,6 @@
#include "../entity_enums.h"
#include "../infos/spell_cast_info.h"
#include "../skeleton/character_skeleton.h"
#include "../utility/entity_create_info.h"
@ -225,17 +222,24 @@ public:
void sdie();
void cdie();
void ons_stat_changed(Ref<Stat> stat);
void onc_stat_changed(Ref<Stat> stat);
//// Resources ////
Ref<EntityResource> gets_resource(int index);
Ref<EntityResource> gets_resource_type(int type);
void adds_resource(Ref<EntityResource> resource);
int gets_resource_count();
void removes_resource(int index);
void clears_resource();
Ref<EntityResource> getc_resource(int index);
Ref<EntityResource> getc_resource_type(int type);
void addc_resource(Ref<EntityResource> resource);
int getc_resource_count();
void removec_resource(int index);
void clearc_resource();
//GCD
bool getc_has_global_cooldown();
@ -455,8 +459,8 @@ public:
void sreceive_rank_increase(int talentID);
void sreceive_rank_decrease(int talentID);
void creceive_rank(int talentID, int rank);
PlayerTalent *sget_talent(int id, bool create = false);
PlayerTalent *cget_talent(int id, bool create = false);
//PlayerTalent *sget_talent(int id, bool create = false);
//PlayerTalent *cget_talent(int id, bool create = false);
//// Inventory ////
@ -629,8 +633,8 @@ private:
//// TalentComponent ////
Vector<Ref<PlayerTalent> > _s_talents;
Vector<Ref<PlayerTalent> > _c_talents;
//Vector<Ref<PlayerTalent> > _s_talents;
//Vector<Ref<PlayerTalent> > _c_talents;
//// Inventory ////

View File

@ -1,5 +1,8 @@
#include "entity_resource.h"
#include "entity.h"
#include "stats/stat.h"
bool EntityResource::get_dirty() {
return _dirty;
}
@ -14,26 +17,113 @@ void EntityResource::set_should_process(bool value) {
_should_process = value;
}
void EntityResource::process(float delta) {
ERR_FAIL_COND(!has_method("_process"));
int EntityResource::get_resource_type() {
return _type;
}
void EntityResource::set_resource_type(int value) {
_type = value;
call("_process");
emit_signal("changed", Ref<EntityResource>(this));
}
int EntityResource::get_current() {
return _current;
}
void EntityResource::set_current(int value) {
_current = value;
emit_signal("changed", Ref<EntityResource>(this));
}
int EntityResource::get_max() {
return _max;
}
void EntityResource::set_max(int value) {
_max = value;
emit_signal("changed", Ref<EntityResource>(this));
}
Entity *EntityResource::get_owner() {
return _owner;
}
void EntityResource::set_owner(Entity *value) {
_owner = value;
}
void EntityResource::set_owner_bind(Node *owner) {
if (!owner) {
return;
}
Entity *e = cast_to<Entity>(owner);
if (!e) {
return;
}
_owner = e;
}
void EntityResource::ons_added(Entity *owner) {
_owner = owner;
if (has_method("_ons_added"))
call("_ons_added", owner);
}
void EntityResource::onc_added(Entity *owner) {
_owner = owner;
if (has_method("_onc_added"))
call("_onc_added", owner);
}
void EntityResource::ons_stat_changed(Ref<Stat> stat) {
if (has_method("_ons_stat_changed"))
call("_ons_stat_changed", stat);
}
void EntityResource::onc_stat_changed(Ref<Stat> stat) {
if (has_method("_onc_stat_changed"))
call("_onc_stat_changed", stat);
}
void EntityResource::ons_target_changed(Entity *entity) {
if (has_method("_ons_target_changed"))
call("_ons_target_changed", entity);
}
void EntityResource::onc_target_changed(Entity *entity) {
if (has_method("_ons_target_changed"))
call("_ons_target_changed", entity);
}
void EntityResource::process(float delta) {
call("_process", delta);
}
void EntityResource::_process(float delta) {
}
String EntityResource::gets_update_string() {
if (has_method("_gets_update_string"))
return call("_gets_update_string");
return "";
}
void EntityResource::receivec_update_string(String str) {
if (has_method("_receivec_update_string"))
call("_receivec_update_string", str);
}
EntityResource::EntityResource() {
_dirty = false;
_should_process = has_method("_process");
_type = 0;
_current = 0;
_max = 0;
}
void EntityResource::_bind_methods() {
ADD_SIGNAL(MethodInfo("starget_changed", PropertyInfo(Variant::OBJECT, "Entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity")));
ADD_SIGNAL(MethodInfo("ctarget_changed", PropertyInfo(Variant::OBJECT, "Entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity")));
BIND_VMETHOD(MethodInfo("_process", PropertyInfo(Variant::REAL, "delta")));
ClassDB::bind_method(D_METHOD("process", "delta"), &EntityResource::process);
ClassDB::bind_method(D_METHOD("get_dirty"), &EntityResource::get_dirty);
ClassDB::bind_method(D_METHOD("set_dirty", "value"), &EntityResource::set_dirty);
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "dirty"), "set_dirty", "get_dirty");
@ -41,4 +131,36 @@ void EntityResource::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_should_process"), &EntityResource::get_should_process);
ClassDB::bind_method(D_METHOD("set_should_process", "value"), &EntityResource::set_should_process);
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "should_process"), "set_should_process", "get_should_process");
ClassDB::bind_method(D_METHOD("get_resource_type"), &EntityResource::get_resource_type);
ClassDB::bind_method(D_METHOD("set_resource_type", "value"), &EntityResource::set_resource_type);
ADD_PROPERTY(PropertyInfo(Variant::INT, "resource_type"), "set_resource_type", "get_resource_type");
ClassDB::bind_method(D_METHOD("get_current"), &EntityResource::get_current);
ClassDB::bind_method(D_METHOD("set_current", "value"), &EntityResource::set_current);
ADD_PROPERTY(PropertyInfo(Variant::INT, "current"), "set_current", "get_current");
ClassDB::bind_method(D_METHOD("get_max"), &EntityResource::get_max);
ClassDB::bind_method(D_METHOD("set_max", "value"), &EntityResource::set_max);
ADD_PROPERTY(PropertyInfo(Variant::INT, "max"), "set_max", "get_max");
ClassDB::bind_method(D_METHOD("get_owner"), &EntityResource::get_owner);
ClassDB::bind_method(D_METHOD("set_owner", "value"), &EntityResource::set_owner_bind);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "owner", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), "set_owner", "get_owner");
BIND_VMETHOD(MethodInfo("_ons_stat_changed", PropertyInfo(Variant::OBJECT, "stat", PROPERTY_HINT_RESOURCE_TYPE, "Stat")));
BIND_VMETHOD(MethodInfo("_onc_stat_changed", PropertyInfo(Variant::OBJECT, "stat", PROPERTY_HINT_RESOURCE_TYPE, "Stat")));
BIND_VMETHOD(MethodInfo("_ons_target_changed", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity")));
BIND_VMETHOD(MethodInfo("_onc_target_changed", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity")));
BIND_VMETHOD(MethodInfo("_ons_added", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity")));
BIND_VMETHOD(MethodInfo("_onc_added", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity")));
BIND_VMETHOD(MethodInfo("_process", PropertyInfo(Variant::REAL, "delta")));
BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::STRING, "str"), "_gets_update_string"));
BIND_VMETHOD(MethodInfo("_receivec_update_string", PropertyInfo(Variant::STRING, "str")));
ADD_SIGNAL(MethodInfo("changed", PropertyInfo(Variant::OBJECT, "resource", PROPERTY_HINT_RESOURCE_TYPE, "EntityResource")));
}

View File

@ -3,6 +3,9 @@
#include "core/reference.h"
class Stat;
class Entity;
class EntityResource : public Reference {
GDCLASS(EntityResource, Reference);
@ -13,7 +16,33 @@ public:
bool get_should_process();
void set_should_process(bool value);
int get_resource_type();
void set_resource_type(int value);
int get_current();
void set_current(int value);
int get_max();
void set_max(int value);
Entity *get_owner();
void set_owner(Entity *entity);
void set_owner_bind(Node *owner);
void ons_added(Entity *owner);
void onc_added(Entity *owner);
void ons_stat_changed(Ref<Stat> stat);
void onc_stat_changed(Ref<Stat> stat);
void ons_target_changed(Entity *target);
void onc_target_changed(Entity *target);
void process(float delta);
void _process(float delta);
String gets_update_string();
void receivec_update_string(String str);
EntityResource();
@ -21,8 +50,12 @@ protected:
static void _bind_methods();
private:
Entity *_owner;
bool _dirty;
bool _should_process;
int _type;
int _current;
int _max;
};
#endif

View File

@ -1,30 +0,0 @@
#include "player_talent.h"
int PlayerTalent::get_talent_id() {
return _talent_id;
}
void PlayerTalent::set_talent_id(int value) {
_talent_id = value;
}
int PlayerTalent::get_rank() {
return _rank;
}
void PlayerTalent::set_rank(int value) {
_rank = value;
}
PlayerTalent::PlayerTalent() {
_rank = (int)(0);
_talent_id = (int)(0);
}
PlayerTalent::PlayerTalent(int talentID) {
set_talent_id(talentID);
}
void PlayerTalent::_bind_methods() {
}

View File

@ -1,25 +0,0 @@
#ifndef PLAYER_TALENT_H
#define PLAYER_TALENT_H
#include "core/reference.h"
class PlayerTalent : public Reference {
GDCLASS(PlayerTalent, Reference);
public:
int get_talent_id();
void set_talent_id(int value);
int get_rank();
void set_rank(int value);
PlayerTalent();
PlayerTalent(int talentID);
protected:
static void _bind_methods();
private:
int _talent_id;
int _rank;
};
#endif

View File

@ -1,8 +1,8 @@
#include "stat.h"
const String Stat::STAT_BINDING_STRING = "Health, Speed, Mana, GCD, Haste, Agility, Strength, Stamina, Intellect, Luck, Haste Rating, Resilience, Armor, Attack Power, Spell Power, Melee Crit, Melee Crit bonus, Spell Crit, Spell Crit Bonus, Block, Parry, Damage Reduction, Melee Damage Reduction, Spell Damage Reduction, Damage Taken, Heal Taken, Melee Damage, Spell Damage, Holy Resist, Shadow Resist, Nature Resist, Fire Resist, Frost Resist, Lightning Resist, Chaos Resist, Silence Resist, Fear Resist, None";
const String Stat::STAT_BINDING_STRING = "Health,Speed,Mana,GCD,Haste,Agility,Strength,Stamina,Intellect,Luck,Haste Rating,Resilience,Armor,Attack Power,Spell Power,Melee Crit,Melee Crit bonus,Spell Crit,Spell Crit Bonus,Block,Parry,Damage Reduction,Melee Damage Reduction,Spell Damage Reduction,Damage Taken,Heal Taken,Melee Damage,Spell Damage,Holy Resist,Shadow Resist,Nature Resist,Fire Resist,Frost Resist,Lightning Resist,Chaos Resist,Silence Resist,Fear Resist,None";
const String Stat::MODIFIER_APPLY_TYPE_BINDING_STRING = "Standard, Only min modifier, Only Max modifier";
const String Stat::MODIFIER_APPLY_TYPE_BINDING_STRING = "Standard,Only min modifier,Only Max modifier";
Stat::Stat() {
_id = Stat::STAT_ID_NONE;
@ -197,9 +197,9 @@ void Stat::apply_modifier(Ref<StatModifier> modifier) {
}
recalculate();
emit_signal("s_changed", this);
emit_signal("s_changed", Ref<Stat>(this));
send();
// emit_signal("s_changed", this);
// emit_signal("s_changed", Ref<Stat>(this));
}
void Stat::de_apply_modifier(Ref<StatModifier> modifier) {
@ -233,10 +233,10 @@ void Stat::de_apply_modifier(Ref<StatModifier> modifier) {
}
recalculate();
emit_signal("s_changed", this);
emit_signal("s_changed", Ref<Stat>(this));
send();
// emit_signal("s_changed", this);
// emit_signal("s_changed", Ref<Stat>(this));
}
void Stat::re_apply_modifiers() {
@ -255,10 +255,10 @@ void Stat::re_apply_modifiers() {
}
recalculate();
emit_signal("s_changed", this);
emit_signal("s_changed", Ref<Stat>(this));
send();
// emit_signal("s_changed", this);
// emit_signal("s_changed", Ref<Stat>(this));
}
void Stat::re_apply_modifier_not_negative_stacking_percents() {
@ -296,10 +296,10 @@ void Stat::re_apply_modifier_not_negative_stacking_percents() {
}
recalculate();
emit_signal("s_changed", this);
emit_signal("s_changed", Ref<Stat>(this));
send();
// emit_signal("s_changed", this);
// emit_signal("s_changed", Ref<Stat>(this));
}
//Stat
@ -311,7 +311,7 @@ float Stat::gets_current() {
void Stat::sets_current(float value) {
_s_current = value;
emit_signal("s_changed", this);
emit_signal("s_changed", Ref<Stat>(this));
send();
}
@ -322,7 +322,7 @@ float Stat::gets_max() {
void Stat::sets_max(float value) {
_s_max = value;
emit_signal("s_changed", this);
emit_signal("s_changed", Ref<Stat>(this));
send();
}
@ -333,7 +333,7 @@ float Stat::getc_current() {
void Stat::setc_current(float value) {
_c_current = value;
emit_signal("c_changed", this);
emit_signal("c_changed", Ref<Stat>(this));
}
float Stat::getc_max() {
@ -343,7 +343,7 @@ float Stat::getc_max() {
void Stat::setc_max(float value) {
_s_current = value;
emit_signal("c_changed", this);
emit_signal("c_changed", Ref<Stat>(this));
}
float Stat::get_base() {
@ -354,7 +354,7 @@ void Stat::set_base(float value) {
_base = value;
recalculate();
emit_signal("s_changed", this);
emit_signal("s_changed", Ref<Stat>(this));
send();
}
@ -366,7 +366,7 @@ void Stat::set_bonus(float value) {
_bonus = value;
recalculate();
emit_signal("s_changed", this);
emit_signal("s_changed", Ref<Stat>(this));
send();
}
@ -378,7 +378,7 @@ void Stat::set_percent(float value) {
_percent = value;
recalculate();
emit_signal("s_changed", this);
emit_signal("s_changed", Ref<Stat>(this));
send();
}
@ -389,7 +389,7 @@ void Stat::reset_values() {
_dirty = true;
emit_signal("s_changed", this);
emit_signal("s_changed", Ref<Stat>(this));
send();
}
@ -411,7 +411,7 @@ void Stat::send() {
_c_current = _s_current;
_c_max = _s_max;
emit_signal("c_changed", this);
emit_signal("c_changed", Ref<Stat>(this));
}
@ -426,7 +426,7 @@ bool Stat::isc_current_zero() {
void Stat::set_to_max() {
_s_current = _s_max;
emit_signal("s_changed", this);
emit_signal("s_changed", Ref<Stat>(this));
send();
}
@ -437,7 +437,7 @@ void Stat::set_values(float base, float bonus, float percent) {
recalculate();
emit_signal("s_changed", this);
emit_signal("s_changed", Ref<Stat>(this));
send();
}
@ -451,7 +451,7 @@ void Stat::set_from_stat(Ref<Stat> other) {
_percent = other->_percent;
set_dirty(true);
emit_signal("s_changed", this);
emit_signal("s_changed", Ref<Stat>(this));
send();
}
@ -465,7 +465,7 @@ void Stat::set(float current, float max, float base, float bonus, float percent)
_percent = percent;
_dirty = true;
emit_signal("s_changed", this);
emit_signal("s_changed", Ref<Stat>(this));
send();
}
@ -475,6 +475,7 @@ void Stat::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_id"), &Stat::get_id);
ClassDB::bind_method(D_METHOD("set_id", "id"), &Stat::set_id);
//ADD_PROPERTY(PropertyInfo(Variant::INT, "id", PROPERTY_HINT_ENUM, STAT_BINDING_STRING), "set_id", "get_id");
ClassDB::bind_method(D_METHOD("get_stat_modifier_type"), &Stat::get_stat_modifier_type);
ClassDB::bind_method(D_METHOD("set_stat_modifier_type", "value"), &Stat::set_stat_modifier_type);

View File

@ -6,3 +6,87 @@ const String EntityEnums::BINDING_STRING_ENTITY_STATE_TYPES = "None,Stun,Root,Fr
const String EntityEnums::BINDING_STRING_CHARCATER_SKELETON_POINTS = "Root,Pelvis,Spine,Spine 1,Spine 2,Neck,Head,Left Clavicle,Left upper Arm,Left Forearm,Left Hand,Left Thumb Base,Left Thumb End,Left Fingers Base,Left Fingers End,Right Clavicle,Right upper Arm,Right Forearm,Right Hand,Right Thumb Base,Right Thumb End,Right Fingers Base,Right Fingers End,Left Thigh,Left Calf,Left Foot,Right Thigh,Right Calf,Right Foot";
const String EntityEnums::BINDING_STRING_AI_STATES = "Off,Rest,Patrol,Follow Path,Regenerate,Attack";
const int EntityEnums::PLAYER_RESOURCE_TYPES_RAGE = 0;
const int EntityEnums::PLAYER_RESOURCE_TYPES_MANA = 1;
const int EntityEnums::PLAYER_RESOURCE_TYPES_ENERGY = 2;
const int EntityEnums::PLAYER_RESOURCE_TYPES_TIME_ANOMALY = 3;
void EntityEnums::_bind_methods() {
BIND_CONSTANT(PLAYER_RESOURCE_TYPES_RAGE);
BIND_CONSTANT(PLAYER_RESOURCE_TYPES_MANA);
BIND_CONSTANT(PLAYER_RESOURCE_TYPES_ENERGY);
BIND_CONSTANT(PLAYER_RESOURCE_TYPES_TIME_ANOMALY);
BIND_ENUM_CONSTANT(ENITIY_TYPE_NONE);
BIND_ENUM_CONSTANT(ENITIY_TYPE_PLAYER);
BIND_ENUM_CONSTANT(ENITIY_TYPE_AI);
BIND_ENUM_CONSTANT(ENITIY_TYPE_MOB);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_NONE);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_STUN);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_ROOT);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_FROZEN);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_SILENCED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_DISORIENTED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_FEARED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_BURNING);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_COLD);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_CURSED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_PACIFIED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_NONE);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_STUN);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_ROOT);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_FROZEN);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_SILENCED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_DISORIENTED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_FEARED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_BURNING);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_COLD);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_CURSED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_PACIFIED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_MAX);
BIND_ENUM_CONSTANT(SKELETON_POINT_ROOT);
BIND_ENUM_CONSTANT(SKELETON_POINT_PELVIS);
BIND_ENUM_CONSTANT(SKELETON_POINT_SPINE);
BIND_ENUM_CONSTANT(SKELETON_POINT_SPINE_1);
BIND_ENUM_CONSTANT(SKELETON_POINT_SPINE_2);
BIND_ENUM_CONSTANT(SKELETON_POINT_NECK);
BIND_ENUM_CONSTANT(SKELETON_POINT_HEAD);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_CLAVICLE);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_UPPER_ARM);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_FOREARM);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_HAND);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_THUMB_BASE);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_THUMB_END);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_FINGERS_BASE);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_FINGERS_END);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_CLAVICLE);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_UPPER_ARM);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_FOREARM);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_HAND);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_THUMB_BASE);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_THUMB_END);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_FINGERS_BASE);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_FINGERS_END);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_THIGH);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_CALF);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_FOOT);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_THIGH);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_CALF);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_FOOT);
BIND_ENUM_CONSTANT(SKELETON_POINTS_MAX);
BIND_ENUM_CONSTANT(AI_STATE_OFF);
BIND_ENUM_CONSTANT(AI_STATE_REST);
BIND_ENUM_CONSTANT(AI_STATE_PATROL);
BIND_ENUM_CONSTANT(AI_STATE_FOLLOW_PATH);
BIND_ENUM_CONSTANT(AI_STATE_REGENERATE);
BIND_ENUM_CONSTANT(AI_STATE_ATTACK);
}

View File

@ -14,13 +14,10 @@ public:
static const String BINDING_STRING_CHARCATER_SKELETON_POINTS;
static const String BINDING_STRING_AI_STATES;
enum PlayerResourceTypes {
PLAYER_RESOURCE_TYPES_NONE,
PLAYER_RESOURCE_TYPES_RAGE,
PLAYER_RESOURCE_TYPES_MANA,
PLAYER_RESOURCE_TYPES_ENERGY,
PLAYER_RESOURCE_TYPES_TIME_ANOMALY,
};
static const int PLAYER_RESOURCE_TYPES_RAGE;
static const int PLAYER_RESOURCE_TYPES_MANA;
static const int PLAYER_RESOURCE_TYPES_ENERGY;
static const int PLAYER_RESOURCE_TYPES_TIME_ANOMALY;
enum EntityType {
ENITIY_TYPE_NONE,
@ -136,91 +133,10 @@ public:
EntityEnums() {}
protected:
static void _bind_methods() {
BIND_ENUM_CONSTANT(PLAYER_RESOURCE_TYPES_NONE);
BIND_ENUM_CONSTANT(PLAYER_RESOURCE_TYPES_RAGE);
BIND_ENUM_CONSTANT(PLAYER_RESOURCE_TYPES_MANA);
BIND_ENUM_CONSTANT(PLAYER_RESOURCE_TYPES_ENERGY);
BIND_ENUM_CONSTANT(PLAYER_RESOURCE_TYPES_TIME_ANOMALY);
BIND_ENUM_CONSTANT(ENITIY_TYPE_NONE);
BIND_ENUM_CONSTANT(ENITIY_TYPE_PLAYER);
BIND_ENUM_CONSTANT(ENITIY_TYPE_AI);
BIND_ENUM_CONSTANT(ENITIY_TYPE_MOB);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_NONE);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_STUN);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_ROOT);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_FROZEN);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_SILENCED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_DISORIENTED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_FEARED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_BURNING);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_COLD);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_CURSED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_FLAG_PACIFIED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_NONE);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_STUN);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_ROOT);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_FROZEN);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_SILENCED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_DISORIENTED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_FEARED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_BURNING);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_COLD);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_CURSED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_PACIFIED);
BIND_ENUM_CONSTANT(ENTITY_STATE_TYPE_INDEX_MAX);
BIND_ENUM_CONSTANT(SKELETON_POINT_ROOT);
BIND_ENUM_CONSTANT(SKELETON_POINT_PELVIS);
BIND_ENUM_CONSTANT(SKELETON_POINT_SPINE);
BIND_ENUM_CONSTANT(SKELETON_POINT_SPINE_1);
BIND_ENUM_CONSTANT(SKELETON_POINT_SPINE_2);
BIND_ENUM_CONSTANT(SKELETON_POINT_NECK);
BIND_ENUM_CONSTANT(SKELETON_POINT_HEAD);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_CLAVICLE);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_UPPER_ARM);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_FOREARM);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_HAND);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_THUMB_BASE);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_THUMB_END);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_FINGERS_BASE);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_FINGERS_END);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_CLAVICLE);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_UPPER_ARM);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_FOREARM);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_HAND);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_THUMB_BASE);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_THUMB_END);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_FINGERS_BASE);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_FINGERS_END);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_THIGH);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_CALF);
BIND_ENUM_CONSTANT(SKELETON_POINT_LEFT_FOOT);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_THIGH);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_CALF);
BIND_ENUM_CONSTANT(SKELETON_POINT_RIGHT_FOOT);
BIND_ENUM_CONSTANT(SKELETON_POINTS_MAX);
BIND_ENUM_CONSTANT(AI_STATE_OFF);
BIND_ENUM_CONSTANT(AI_STATE_REST);
BIND_ENUM_CONSTANT(AI_STATE_PATROL);
BIND_ENUM_CONSTANT(AI_STATE_FOLLOW_PATH);
BIND_ENUM_CONSTANT(AI_STATE_REGENERATE);
BIND_ENUM_CONSTANT(AI_STATE_ATTACK);
}
static void _bind_methods();
};
VARIANT_ENUM_CAST(EntityEnums::EntityType);
VARIANT_ENUM_CAST(EntityEnums::PlayerResourceTypes);
VARIANT_ENUM_CAST(EntityEnums::EntityStateTypeFlags);
VARIANT_ENUM_CAST(EntityEnums::EntityStateTypeIndexes);
VARIANT_ENUM_CAST(EntityEnums::CharacterSkeletonPoints);

View File

@ -9,7 +9,6 @@
#include "data/character_class.h"
#include "data/talent.h"
#include "data/talent_row_data.h"
#include "data/talent_rank_data.h"
#include "data/character_spec.h"
#include "data/xp_data.h"
#include "data/item_stat_modifier.h"
@ -23,7 +22,6 @@
#include "entities/stats/stat.h"
#include "entities/stats/stat_modifier.h"
#include "entities/stats/stat_data.h"
#include "entities/player_talent.h"
#include "inventory/bag.h"
#include "data/craft_data_attribute_helper.h"
@ -96,7 +94,6 @@ void register_entity_spell_system_types() {
ClassDB::register_class<SpellCooldownManipulationData>();
ClassDB::register_class<Talent>();
ClassDB::register_class<TalentRowData>();
ClassDB::register_class<TalentRankData>();
ClassDB::register_class<CharacterSkeletonVisualEntry>();
@ -110,7 +107,6 @@ void register_entity_spell_system_types() {
ClassDB::register_class<StatDataEntry>();
ClassDB::register_class<StatData>();
ClassDB::register_class<PlayerTalent>();
ClassDB::register_class<CharacterSpec>();
ClassDB::register_class<Bag>();

View File

@ -4,4 +4,4 @@ const String SpellEnums::BINDING_STRING_SPELL_TYPES = "Melee,Holy,Shadow,Nature,
const String SpellEnums::BINDING_STRING_DIMINISHING_RETURN_CATEGORIES = "None,Root,Stun";
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";
const String SpellEnums::BINDING_STRING_AURA_TYPES = "None,Magic,Poison,Physical,Curse,Bleed,Talent";

View File

@ -65,6 +65,7 @@ public:
AURA_TYPE_PHYSICAL = 3,
AURA_TYPE_CURSE = 4,
AURA_TYPE_BLEED = 5,
AURA_TYPE_TALENT = 6,
};
SpellEnums() {}
@ -114,6 +115,7 @@ protected:
BIND_ENUM_CONSTANT(AURA_TYPE_PHYSICAL);
BIND_ENUM_CONSTANT(AURA_TYPE_CURSE);
BIND_ENUM_CONSTANT(AURA_TYPE_BLEED);
BIND_ENUM_CONSTANT(AURA_TYPE_TALENT);
}
};