mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-04-19 21:33:15 +02:00
Added the money field.
This commit is contained in:
parent
870a1f406c
commit
41d94978e6
@ -56,6 +56,13 @@ void EntityData::set_entity_name(String value) {
|
||||
_entity_name = value;
|
||||
}
|
||||
|
||||
int EntityData::get_money() {
|
||||
return _money;
|
||||
}
|
||||
void EntityData::set_money(int value) {
|
||||
_money = value;
|
||||
}
|
||||
|
||||
Ref<Texture> EntityData::get_icon() {
|
||||
return _icon;
|
||||
}
|
||||
@ -1016,6 +1023,10 @@ void EntityData::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_entity_name"), &EntityData::get_entity_name);
|
||||
ClassDB::bind_method(D_METHOD("set_entity_name", "value"), &EntityData::set_entity_name);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::STRING, "entity_name"), "set_entity_name", "get_entity_name");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_money"), &EntityData::get_money);
|
||||
ClassDB::bind_method(D_METHOD("set_money", "value"), &EntityData::set_money);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "money"), "set_money", "get_money");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_inherits"), &EntityData::get_inherits);
|
||||
ClassDB::bind_method(D_METHOD("set_inherits", "value"), &EntityData::set_inherits);
|
||||
@ -1103,7 +1114,7 @@ void EntityData::_bind_methods() {
|
||||
EntityData::EntityData() {
|
||||
_id = 0;
|
||||
_player_resource_type = 0;
|
||||
|
||||
_money = 0;
|
||||
|
||||
_entity_type = EntityEnums::ENITIY_TYPE_NONE;
|
||||
_immunity_flags = 0;
|
||||
|
@ -55,6 +55,9 @@ public:
|
||||
|
||||
String get_entity_name();
|
||||
void set_entity_name(String value);
|
||||
|
||||
int get_money();
|
||||
void set_money(int value);
|
||||
|
||||
Ref<EntityData> get_inherits();
|
||||
void set_inherits(Ref<EntityData> value);
|
||||
@ -239,6 +242,7 @@ private:
|
||||
Ref<Texture> _icon;
|
||||
|
||||
int _player_resource_type;
|
||||
int _money;
|
||||
|
||||
Ref<StatData> _stat_data;
|
||||
|
||||
|
@ -173,6 +173,24 @@ void Entity::setc_xp(int value) {
|
||||
_c_xp = value;
|
||||
}
|
||||
|
||||
|
||||
int Entity::gets_money() {
|
||||
return _s_money;
|
||||
}
|
||||
void Entity::sets_money(int value) {
|
||||
_s_money = value;
|
||||
|
||||
SEND_RPC(rpc("setc_money", value), setc_money(value));
|
||||
}
|
||||
|
||||
int Entity::getc_money() {
|
||||
return _c_money;
|
||||
}
|
||||
void Entity::setc_money(int value) {
|
||||
_c_money = value;
|
||||
}
|
||||
|
||||
|
||||
Ref<EntityData> Entity::getc_entity_data() {
|
||||
return _c_entity_data;
|
||||
}
|
||||
@ -215,6 +233,7 @@ void Entity::_setup() {
|
||||
sets_entity_flags(_s_entity_data->get_entity_flags());
|
||||
sets_entity_controller(_s_entity_data->get_entity_controller());
|
||||
sets_player_name(_s_entity_data->get_entity_name());
|
||||
sets_money(_s_entity_data->get_money());
|
||||
}
|
||||
|
||||
if (!Engine::get_singleton()->is_editor_hint())
|
||||
@ -241,6 +260,9 @@ Entity::Entity() {
|
||||
_c_xp = 0;
|
||||
|
||||
_s_send_flag = 0;
|
||||
|
||||
_c_money = 0;
|
||||
_s_money = 0;
|
||||
|
||||
_s_player_name = "";
|
||||
_c_player_name = "";
|
||||
@ -3118,6 +3140,14 @@ void Entity::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("getc_xp"), &Entity::getc_xp);
|
||||
ClassDB::bind_method(D_METHOD("setc_xp", "value"), &Entity::setc_xp);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::STRING, "c_xp"), "setc_xp", "getc_xp");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("gets_money"), &Entity::gets_money);
|
||||
ClassDB::bind_method(D_METHOD("sets_money", "value"), &Entity::sets_money);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "smoney"), "sets_money", "gets_money");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("getc_money"), &Entity::getc_money);
|
||||
ClassDB::bind_method(D_METHOD("setc_money", "value"), &Entity::setc_money);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "cmoney"), "setc_money", "getc_money");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("gets_entity_data"), &Entity::gets_entity_data);
|
||||
ClassDB::bind_method(D_METHOD("sets_entity_data", "value"), &Entity::sets_entity_data);
|
||||
|
@ -179,6 +179,12 @@ public:
|
||||
|
||||
int getc_xp();
|
||||
void setc_xp(int value);
|
||||
|
||||
int gets_money();
|
||||
void sets_money(int value);
|
||||
|
||||
int getc_money();
|
||||
void setc_money(int value);
|
||||
|
||||
Ref<EntityData> getc_entity_data();
|
||||
void setc_entity_data(Ref<EntityData> value);
|
||||
@ -517,6 +523,9 @@ private:
|
||||
|
||||
int _s_xp;
|
||||
int _c_xp;
|
||||
|
||||
int _s_money;
|
||||
int _c_money;
|
||||
|
||||
Ref<EntityData> _s_entity_data;
|
||||
Ref<EntityData> _c_entity_data;
|
||||
|
Loading…
Reference in New Issue
Block a user