mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-05-07 22:31:39 +02:00
Ran clang format on every file, I got used to it working by default in Visual Studio and I forgot about it.
This commit is contained in:
parent
6b2c97df9a
commit
6f3744e2cb
@ -1,8 +1,6 @@
|
||||
#include "character_atlas.h"
|
||||
|
||||
|
||||
CharacterAtlas::CharacterAtlas() {
|
||||
|
||||
}
|
||||
|
||||
void CharacterAtlas::_bind_methods() {
|
||||
|
@ -12,8 +12,7 @@ public:
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
//private:
|
||||
//private:
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,8 +1,6 @@
|
||||
#include "character_atlas_entry.h"
|
||||
|
||||
|
||||
CharacterAtlasEntry::CharacterAtlasEntry() {
|
||||
|
||||
}
|
||||
|
||||
void CharacterAtlasEntry::_bind_methods() {
|
||||
|
@ -12,8 +12,7 @@ public:
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
//private:
|
||||
//private:
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,9 +1,9 @@
|
||||
#include "entity_data_manager.h"
|
||||
|
||||
#include "../entities/data/entity_data.h"
|
||||
#include "../data/aura.h"
|
||||
#include "../data/craft_recipe.h"
|
||||
#include "../data/spell.h"
|
||||
#include "../entities/data/entity_data.h"
|
||||
#include "../entities/resources/entity_resource_data.h"
|
||||
#include "../entities/skills/entity_skill_data.h"
|
||||
|
||||
@ -496,7 +496,6 @@ void EntityDataManager::load_entity_skills() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void EntityDataManager::load_spells() {
|
||||
_Directory dir;
|
||||
|
||||
|
@ -2,11 +2,11 @@
|
||||
#define ENTITY_DATA_MANAGER_H
|
||||
|
||||
#include "core/array.h"
|
||||
#include "core/engine.h"
|
||||
#include "core/hash_map.h"
|
||||
#include "core/io/json.h"
|
||||
#include "core/variant.h"
|
||||
#include "core/vector.h"
|
||||
#include "core/engine.h"
|
||||
|
||||
#include "core/resource.h"
|
||||
#include "core/ustring.h"
|
||||
@ -28,7 +28,6 @@ class ItemTemplate;
|
||||
class EntityResourceData;
|
||||
class EntitySkillData;
|
||||
|
||||
|
||||
class EntityDataManager : public Node {
|
||||
GDCLASS(EntityDataManager, Node);
|
||||
|
||||
@ -105,16 +104,16 @@ public:
|
||||
Ref<ItemTemplate> get_item_template(int item_id);
|
||||
Ref<ItemTemplate> get_item_template_index(int index);
|
||||
int get_item_template_count();
|
||||
|
||||
String get_mob_data_folder();
|
||||
|
||||
String get_mob_data_folder();
|
||||
void set_mob_data_folder(String folder);
|
||||
Vector<Ref<EntityData> > *get_mob_datas();
|
||||
void add_mob_data(Ref<EntityData> aura);
|
||||
Ref<EntityData> get_mob_data(int item_id);
|
||||
Ref<EntityData> get_mob_data_index(int index);
|
||||
int get_mob_data_count();
|
||||
|
||||
String get_player_character_data_folder();
|
||||
|
||||
String get_player_character_data_folder();
|
||||
void set_player_character_data_folder(String folder);
|
||||
Vector<Ref<EntityData> > *get_player_character_datas();
|
||||
void add_player_character_data(Ref<EntityData> aura);
|
||||
@ -132,9 +131,9 @@ public:
|
||||
void load_characters();
|
||||
void load_craft_datas();
|
||||
void load_item_templates();
|
||||
void load_mob_datas();
|
||||
void load_player_character_datas();
|
||||
|
||||
void load_mob_datas();
|
||||
void load_player_character_datas();
|
||||
|
||||
bool get_automatic_load() { return _automatic_load; }
|
||||
void set_automatic_load(bool load) { _automatic_load = load; }
|
||||
|
||||
@ -180,12 +179,12 @@ private:
|
||||
String _item_template_folder;
|
||||
Vector<Ref<ItemTemplate> > _item_templates;
|
||||
HashMap<int, Ref<ItemTemplate> > _item_template_map;
|
||||
|
||||
String _mob_data_folder;
|
||||
|
||||
String _mob_data_folder;
|
||||
Vector<Ref<EntityData> > _mob_datas;
|
||||
HashMap<int, Ref<EntityData> > _mob_data_map;
|
||||
|
||||
String _player_character_data_folder;
|
||||
|
||||
String _player_character_data_folder;
|
||||
Vector<Ref<EntityData> > _player_character_datas;
|
||||
HashMap<int, Ref<EntityData> > _player_character_data_map;
|
||||
|
||||
|
@ -72,7 +72,6 @@ void Aura::set_hide(bool value) {
|
||||
_hide = value;
|
||||
}
|
||||
|
||||
|
||||
Ref<SpellEffectVisual> Aura::get_visual_spell_effects() {
|
||||
return _visual_spell_effects;
|
||||
}
|
||||
@ -358,7 +357,6 @@ Aura::~Aura() {
|
||||
|
||||
_talent_required_talent.unref();
|
||||
_talent_required_spell.unref();
|
||||
|
||||
}
|
||||
|
||||
////// Triggers ///////
|
||||
@ -489,14 +487,14 @@ void Aura::sapply_simple(Entity *caster, Entity *target, float spell_scale) {
|
||||
|
||||
void Aura::sapply(Ref<AuraApplyInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
|
||||
//always exists
|
||||
call("_sapply", info);
|
||||
}
|
||||
|
||||
void Aura::sdeapply(Ref<AuraData> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
|
||||
//always exists
|
||||
call("_sdeapply", info);
|
||||
}
|
||||
@ -716,7 +714,7 @@ void Aura::son_after_aura_applied(Ref<AuraData> data) {
|
||||
}
|
||||
|
||||
void Aura::son_death(Ref<AuraData> data) {
|
||||
if (has_method("_son_death"))
|
||||
if (has_method("_son_death"))
|
||||
call("_son_death", data);
|
||||
}
|
||||
|
||||
@ -728,7 +726,7 @@ void Aura::son_cooldown_removed(Ref<AuraData> data, Ref<Cooldown> cooldown) {
|
||||
if (has_method("_son_cooldown_removed"))
|
||||
call("_son_cooldown_removed", data, cooldown);
|
||||
}
|
||||
|
||||
|
||||
void Aura::son_category_cooldown_added(Ref<AuraData> data, Ref<CategoryCooldown> category_cooldown) {
|
||||
if (has_method("_son_category_cooldown_added"))
|
||||
call("_son_category_cooldown_added", data, category_cooldown);
|
||||
@ -792,15 +790,15 @@ void Aura::con_spell_cast_success(Ref<AuraData> data, Ref<SpellCastInfo> info) {
|
||||
if (has_method("_con_spell_cast_success"))
|
||||
call("_con_spell_cast_success", data, info);
|
||||
}
|
||||
|
||||
|
||||
void Aura::con_death(Ref<AuraData> data) {
|
||||
if (has_method("_con_death"))
|
||||
if (has_method("_con_death"))
|
||||
call("_con_death", data);
|
||||
}
|
||||
|
||||
|
||||
void Aura::con_cooldown_added(Ref<AuraData> data, Ref<Cooldown> cooldown) {
|
||||
if (has_method("_con_cooldown_added"))
|
||||
call("_con_cooldown_added", data,cooldown);
|
||||
call("_con_cooldown_added", data, cooldown);
|
||||
}
|
||||
void Aura::con_cooldown_removed(Ref<AuraData> data, Ref<Cooldown> cooldown) {
|
||||
if (has_method("_con_cooldown_removed"))
|
||||
@ -847,7 +845,7 @@ void Aura::con_damage_dealt(Ref<AuraData> data, Ref<SpellDamageInfo> info) {
|
||||
void Aura::con_dealt_damage(Ref<AuraData> data, Ref<SpellDamageInfo> info) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
|
||||
if (has_method("_con_dealt_damage"))
|
||||
call("_con_dealt_damage", data, info);
|
||||
}
|
||||
@ -855,12 +853,12 @@ void Aura::con_dealt_damage(Ref<AuraData> data, Ref<SpellDamageInfo> info) {
|
||||
void Aura::con_heal_dealt(Ref<AuraData> data, Ref<SpellHealInfo> info) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
|
||||
if (has_method("_con_heal_dealt"))
|
||||
call("_con_heal_dealt", data, info);
|
||||
}
|
||||
|
||||
void Aura::con_dealt_heal(Ref<AuraData> data, Ref<SpellHealInfo> info){
|
||||
void Aura::con_dealt_heal(Ref<AuraData> data, Ref<SpellHealInfo> info) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
@ -1069,14 +1067,13 @@ void Aura::_sapply(Ref<AuraApplyInfo> info) {
|
||||
|
||||
void Aura::_sdeapply(Ref<AuraData> info) {
|
||||
ERR_FAIL_COND(info->get_owner() == NULL || info->get_caster() == NULL || !info->get_aura().is_valid());
|
||||
|
||||
}
|
||||
|
||||
void Aura::_sadd(Ref<AuraData> aura) {
|
||||
ERR_FAIL_COND(aura->get_owner() == NULL);
|
||||
|
||||
//sapply(aura);
|
||||
|
||||
|
||||
aura->get_owner()->sremove_aura(aura);
|
||||
aura->get_owner()->sadd_aura(aura);
|
||||
}
|
||||
@ -1085,7 +1082,7 @@ void Aura::_sremove(Ref<AuraData> aura) {
|
||||
ERR_FAIL_COND(aura->get_owner() == NULL);
|
||||
|
||||
sdeapply(aura);
|
||||
|
||||
|
||||
aura->get_owner()->sremove_aura(aura);
|
||||
}
|
||||
|
||||
@ -1093,7 +1090,7 @@ void Aura::_sremove_expired(Ref<AuraData> aura) {
|
||||
ERR_FAIL_COND(aura->get_owner() == NULL);
|
||||
|
||||
sdeapply(aura);
|
||||
|
||||
|
||||
aura->get_owner()->sremove_aura_expired(aura);
|
||||
}
|
||||
|
||||
@ -1101,7 +1098,7 @@ void Aura::_sremove_dispell(Ref<AuraData> aura) {
|
||||
ERR_FAIL_COND(aura->get_owner() == NULL);
|
||||
|
||||
sdeapply(aura);
|
||||
|
||||
|
||||
aura->get_owner()->sremove_aura_dispelled(aura);
|
||||
}
|
||||
|
||||
@ -1193,14 +1190,14 @@ void Aura::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("son_cast_finished_target", "aura", "info"), &Aura::son_cast_finished_target);
|
||||
ClassDB::bind_method(D_METHOD("son_spell_cast_success", "aura", "info"), &Aura::son_spell_cast_success);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("son_before_damage_hit", "aura", "data"), &Aura::son_before_damage_hit);
|
||||
ClassDB::bind_method(D_METHOD("son_before_damage_hit", "aura", "data"), &Aura::son_before_damage_hit);
|
||||
ClassDB::bind_method(D_METHOD("son_hit", "aura", "data"), &Aura::son_hit);
|
||||
ClassDB::bind_method(D_METHOD("son_before_damage", "aura", "data"), &Aura::son_before_damage);
|
||||
ClassDB::bind_method(D_METHOD("son_damage_receive", "aura", "data"), &Aura::son_damage_receive);
|
||||
ClassDB::bind_method(D_METHOD("son_dealt_damage", "aura", "data"), &Aura::son_dealt_damage);
|
||||
ClassDB::bind_method(D_METHOD("son_damage_dealt", "aura", "data"), &Aura::son_damage_dealt);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("son_before_heal_hit", "aura", "data"), &Aura::son_before_heal_hit);
|
||||
ClassDB::bind_method(D_METHOD("son_before_heal_hit", "aura", "data"), &Aura::son_before_heal_hit);
|
||||
ClassDB::bind_method(D_METHOD("son_before_heal", "aura", "data"), &Aura::son_before_heal);
|
||||
ClassDB::bind_method(D_METHOD("son_heal_receive", "aura", "data"), &Aura::son_heal_receive);
|
||||
ClassDB::bind_method(D_METHOD("son_dealt_heal", "aura", "data"), &Aura::son_dealt_heal);
|
||||
@ -1212,15 +1209,15 @@ void Aura::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("son_before_aura_applied", "data"), &Aura::son_before_aura_applied);
|
||||
ClassDB::bind_method(D_METHOD("son_after_aura_applied", "data"), &Aura::son_after_aura_applied);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("son_death", "data"), &Aura::son_death);
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("son_death", "data"), &Aura::son_death);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("son_cooldown_added", "data", "cooldown"), &Aura::son_cooldown_added);
|
||||
ClassDB::bind_method(D_METHOD("son_cooldown_removed", "data", "cooldown"), &Aura::son_cooldown_removed);
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("son_category_cooldown_added", "data", "category_cooldown"), &Aura::son_category_cooldown_added);
|
||||
ClassDB::bind_method(D_METHOD("son_category_cooldown_removed", "data", "category_cooldown"), &Aura::son_category_cooldown_removed);
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("son_gcd_started", "data", "gcd"), &Aura::son_gcd_started);
|
||||
ClassDB::bind_method(D_METHOD("son_gcd_finished", "data"), &Aura::son_gcd_finished);
|
||||
|
||||
@ -1228,7 +1225,7 @@ void Aura::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("son_xp_gained", "data", "value"), &Aura::son_xp_gained);
|
||||
ClassDB::bind_method(D_METHOD("son_level_up", "data", "value"), &Aura::son_level_up);
|
||||
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_son_before_cast", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_before_cast_target", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_cast_started", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
@ -1237,14 +1234,14 @@ void Aura::_bind_methods() {
|
||||
BIND_VMETHOD(MethodInfo("_son_cast_finished_target", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_spell_cast_success", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_son_before_damage_hit", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_before_damage_hit", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_hit", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_before_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_damage_receive", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_dealt_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_damage_dealt", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_son_before_heal_hit", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_before_heal_hit", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_before_heal", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_heal_receive", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_dealt_heal", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
|
||||
@ -1256,9 +1253,9 @@ void Aura::_bind_methods() {
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_son_before_aura_applied", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData")));
|
||||
BIND_VMETHOD(MethodInfo("_son_after_aura_applied", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData")));
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_son_death", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData")));
|
||||
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_son_death", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData")));
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_son_cooldown_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "cooldown", PROPERTY_HINT_RESOURCE_TYPE, "Cooldown")));
|
||||
BIND_VMETHOD(MethodInfo("_son_cooldown_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "cooldown", PROPERTY_HINT_RESOURCE_TYPE, "Cooldown")));
|
||||
BIND_VMETHOD(MethodInfo("_son_category_cooldown_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "category_cooldown", PROPERTY_HINT_RESOURCE_TYPE, "CategoryCooldown")));
|
||||
@ -1278,51 +1275,51 @@ void Aura::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("con_cast_state_changed", "data", "info"), &Aura::con_cast_state_changed);
|
||||
ClassDB::bind_method(D_METHOD("con_cast_finished", "data", "info"), &Aura::con_cast_finished);
|
||||
ClassDB::bind_method(D_METHOD("con_spell_cast_success", "data", "info"), &Aura::con_spell_cast_success);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("con_death", "data"), &Aura::con_death);
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("con_death", "data"), &Aura::con_death);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("con_cooldown_added", "data", "info"), &Aura::con_cooldown_added);
|
||||
ClassDB::bind_method(D_METHOD("con_cooldown_removed", "data", "info"), &Aura::con_cooldown_removed);
|
||||
ClassDB::bind_method(D_METHOD("con_category_cooldown_added", "data", "info"), &Aura::con_category_cooldown_added);
|
||||
ClassDB::bind_method(D_METHOD("con_category_cooldown_removed", "data", "info"), &Aura::con_category_cooldown_removed);
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("con_aura_added", "data"), &Aura::con_aura_added);
|
||||
ClassDB::bind_method(D_METHOD("con_aura_removed", "data"), &Aura::con_aura_removed);
|
||||
ClassDB::bind_method(D_METHOD("con_aura_refresh", "data"), &Aura::con_aura_refresh);
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("con_damage_dealt", "data", "info"), &Aura::con_damage_dealt);
|
||||
ClassDB::bind_method(D_METHOD("con_dealt_damage", "data", "info"), &Aura::con_dealt_damage);
|
||||
ClassDB::bind_method(D_METHOD("con_heal_dealt", "data", "info"), &Aura::con_heal_dealt);
|
||||
ClassDB::bind_method(D_METHOD("con_dealt_heal", "data", "info"), &Aura::con_dealt_heal);
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("con_gcd_started", "data", "info"), &Aura::con_gcd_started);
|
||||
ClassDB::bind_method(D_METHOD("con_gcd_finished", "data"), &Aura::con_gcd_finished);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("con_xp_gained", "data", "value"), &Aura::con_xp_gained);
|
||||
ClassDB::bind_method(D_METHOD("con_level_up", "data", "value"), &Aura::con_level_up);
|
||||
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_con_cast_failed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_con_cast_started", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_con_cast_state_changed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_con_cast_finished", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_con_spell_cast_success", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_con_death", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData")));
|
||||
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_con_cooldown_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "cooldown", PROPERTY_HINT_RESOURCE_TYPE, "Cooldown")));
|
||||
BIND_VMETHOD(MethodInfo("_con_cooldown_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "cooldown", PROPERTY_HINT_RESOURCE_TYPE, "Cooldown")));
|
||||
BIND_VMETHOD(MethodInfo("_con_category_cooldown_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "category_cooldown", PROPERTY_HINT_RESOURCE_TYPE, "CategoryCooldown")));
|
||||
BIND_VMETHOD(MethodInfo("_con_category_cooldown_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "category_cooldown", PROPERTY_HINT_RESOURCE_TYPE, "CategoryCooldown")));
|
||||
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_con_aura_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData")));
|
||||
BIND_VMETHOD(MethodInfo("_con_aura_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData")));
|
||||
BIND_VMETHOD(MethodInfo("_con_aura_refresh", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData")));
|
||||
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_con_damage_dealt", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_con_dealt_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_con_heal_dealt", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_con_dealt_heal", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
|
||||
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_con_gcd_started", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::REAL, "gcd")));
|
||||
BIND_VMETHOD(MethodInfo("_con_gcd_finished", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData")));
|
||||
|
||||
@ -1568,7 +1565,6 @@ void Aura::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_talent_required_spell", "next_rank"), &Aura::set_talent_required_spell);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "talent_required_spell", PROPERTY_HINT_RESOURCE_TYPE, "Spell"), "set_talent_required_spell", "get_talent_required_spell");
|
||||
|
||||
|
||||
//// Triggers ////
|
||||
ADD_GROUP("Triggers", "trigger");
|
||||
ClassDB::bind_method(D_METHOD("get_trigger_count"), &Aura::get_trigger_count);
|
||||
|
36
data/aura.h
36
data/aura.h
@ -18,12 +18,12 @@
|
||||
#include "aura_trigger_data.h"
|
||||
|
||||
#include "../entities/auras/aura_data.h"
|
||||
#include "../infos/spell_cast_info.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"
|
||||
#include "../utility/cooldown.h"
|
||||
|
||||
#include "spell_effect_visual.h"
|
||||
|
||||
@ -245,14 +245,14 @@ public:
|
||||
void son_cast_finished_target(Ref<AuraData> aura, Ref<SpellCastInfo> info);
|
||||
void son_spell_cast_success(Ref<AuraData> aura, Ref<SpellCastInfo> info);
|
||||
|
||||
void son_before_damage_hit(Ref<AuraData> aura, Ref<SpellDamageInfo> data);
|
||||
void son_before_damage_hit(Ref<AuraData> aura, Ref<SpellDamageInfo> data);
|
||||
void son_hit(Ref<AuraData> aura, Ref<SpellDamageInfo> data);
|
||||
void son_before_damage(Ref<AuraData> aura, Ref<SpellDamageInfo> data);
|
||||
void son_damage_receive(Ref<AuraData> aura, Ref<SpellDamageInfo> data);
|
||||
void son_dealt_damage(Ref<AuraData> aura, Ref<SpellDamageInfo> data);
|
||||
void son_damage_dealt(Ref<AuraData> aura, Ref<SpellDamageInfo> data);
|
||||
|
||||
void son_before_heal_hit(Ref<AuraData> aura, Ref<SpellHealInfo> data);
|
||||
void son_before_heal_hit(Ref<AuraData> aura, Ref<SpellHealInfo> data);
|
||||
void son_before_heal(Ref<AuraData> aura, Ref<SpellHealInfo> data);
|
||||
void son_heal_receive(Ref<AuraData> aura, Ref<SpellHealInfo> data);
|
||||
void son_dealt_heal(Ref<AuraData> aura, Ref<SpellHealInfo> data);
|
||||
@ -264,46 +264,46 @@ public:
|
||||
|
||||
void son_before_aura_applied(Ref<AuraData> data);
|
||||
void son_after_aura_applied(Ref<AuraData> data);
|
||||
|
||||
void son_death(Ref<AuraData> data);
|
||||
|
||||
|
||||
void son_death(Ref<AuraData> data);
|
||||
|
||||
void son_cooldown_added(Ref<AuraData> data, Ref<Cooldown> cooldown);
|
||||
void son_cooldown_removed(Ref<AuraData> data, Ref<Cooldown> cooldown);
|
||||
|
||||
|
||||
void son_category_cooldown_added(Ref<AuraData> data, Ref<CategoryCooldown> category_cooldown);
|
||||
void son_category_cooldown_removed(Ref<AuraData> data, Ref<CategoryCooldown> category_cooldown);
|
||||
|
||||
void son_gcd_started(Ref<AuraData> data, float gcd);
|
||||
void son_gcd_finished(Ref<AuraData> data);
|
||||
|
||||
void son_physics_process(Ref<AuraData> data);
|
||||
|
||||
void son_physics_process(Ref<AuraData> data);
|
||||
|
||||
void son_xp_gained(Ref<AuraData> data, int value);
|
||||
void son_level_up(Ref<AuraData> data, int value);
|
||||
|
||||
|
||||
//Clientside Event Handlers
|
||||
void con_cast_failed(Ref<AuraData> data, Ref<SpellCastInfo> info);
|
||||
void con_cast_started(Ref<AuraData> data, Ref<SpellCastInfo> info);
|
||||
void con_cast_state_changed(Ref<AuraData> data, Ref<SpellCastInfo> info);
|
||||
void con_cast_finished(Ref<AuraData> data, Ref<SpellCastInfo> info);
|
||||
void con_spell_cast_success(Ref<AuraData> data, Ref<SpellCastInfo> info);
|
||||
|
||||
void con_death(Ref<AuraData> data);
|
||||
|
||||
|
||||
void con_death(Ref<AuraData> data);
|
||||
|
||||
void con_cooldown_added(Ref<AuraData> data, Ref<Cooldown> cooldown);
|
||||
void con_cooldown_removed(Ref<AuraData> data, Ref<Cooldown> cooldown);
|
||||
void con_category_cooldown_added(Ref<AuraData> data, Ref<CategoryCooldown> category_cooldown);
|
||||
void con_category_cooldown_removed(Ref<AuraData> data, Ref<CategoryCooldown> category_cooldown);
|
||||
|
||||
|
||||
void con_aura_added(Ref<AuraData> data);
|
||||
void con_aura_removed(Ref<AuraData> data);
|
||||
void con_aura_refresh(Ref<AuraData> data);
|
||||
|
||||
|
||||
void con_damage_dealt(Ref<AuraData> data, Ref<SpellDamageInfo> info);
|
||||
void con_dealt_damage(Ref<AuraData> data, Ref<SpellDamageInfo> info);
|
||||
void con_heal_dealt(Ref<AuraData> data, Ref<SpellHealInfo> info);
|
||||
void con_dealt_heal(Ref<AuraData> data, Ref<SpellHealInfo> info);
|
||||
|
||||
|
||||
void con_gcd_started(Ref<AuraData> data, float gcd);
|
||||
void con_gcd_finished(Ref<AuraData> data);
|
||||
|
||||
@ -376,7 +376,7 @@ private:
|
||||
Ref<SpellEffectVisual> _visual_spell_effects;
|
||||
|
||||
Ref<WorldSpellData> _world_spell_data;
|
||||
|
||||
|
||||
bool _damage_enabled;
|
||||
int _damage_type;
|
||||
int _damage_min;
|
||||
|
@ -1,2 +1 @@
|
||||
#include "aura_stat_attribute.h"
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef AURA_STAT_ATTRIBUTE_H
|
||||
#define AURA_STAT_ATTRIBUTE_H
|
||||
|
||||
#include "core/reference.h"
|
||||
#include "../entities/stats/stat.h"
|
||||
#include "core/reference.h"
|
||||
|
||||
class AuraStatAttribute : public Reference {
|
||||
GDCLASS(AuraStatAttribute, Reference);
|
||||
@ -53,4 +53,4 @@ private:
|
||||
float _percent_mod;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -43,5 +43,4 @@ private:
|
||||
Ref<Spell> _spell;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -41,7 +41,6 @@ void CraftRecipe::set_required_tools_count(int value) {
|
||||
_required_tools_count = value;
|
||||
}
|
||||
|
||||
|
||||
void CraftRecipe::set_required_material(int index, const Ref<CraftRecipeHelper> value) {
|
||||
_required_materials[index] = value;
|
||||
}
|
||||
@ -50,7 +49,6 @@ Ref<CraftRecipeHelper> CraftRecipe::get_required_material(int index) {
|
||||
return _required_materials[index];
|
||||
}
|
||||
|
||||
|
||||
int CraftRecipe::get_required_materials_count() {
|
||||
return _required_materials_count;
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef CRAFT_RECIPE_H
|
||||
#define CRAFT_RECIPE_H
|
||||
|
||||
#include "core/vector.h"
|
||||
#include "core/resource.h"
|
||||
#include "core/ustring.h"
|
||||
#include "core/vector.h"
|
||||
|
||||
#include "item_template.h"
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
#include "equipment_data_entry.h"
|
||||
|
||||
|
||||
|
||||
Ref<ItemInstance> EquipmentDataEntry::get_item() {
|
||||
if (has_method("_get_item")) {
|
||||
return call("_get_item");
|
||||
|
@ -19,7 +19,7 @@ public:
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
//private:
|
||||
//private:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
#include "item_template.h"
|
||||
|
||||
|
||||
Ref<ItemTemplate> ItemInstance::get_item_template() const {
|
||||
return _item_template;
|
||||
}
|
||||
@ -13,7 +12,6 @@ void ItemInstance::set_item_template(const Ref<ItemTemplate> value) {
|
||||
|
||||
if (value.is_valid())
|
||||
_item_template_id = value->get_id();
|
||||
|
||||
}
|
||||
|
||||
Ref<ItemStatModifier> ItemInstance::get_item_stat_modifier(int index) {
|
||||
@ -100,7 +98,6 @@ ItemInstance::~ItemInstance() {
|
||||
_modifiers.clear();
|
||||
}
|
||||
|
||||
|
||||
void ItemInstance::_bind_methods() {
|
||||
ADD_SIGNAL(MethodInfo("stack_size_changed", PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance")));
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
#include "core/reference.h"
|
||||
#include "core/vector.h"
|
||||
|
||||
#include "item_stat_modifier.h"
|
||||
#include "../entities/stats/stat.h"
|
||||
#include "../item_enums.h"
|
||||
#include "item_stat_modifier.h"
|
||||
|
||||
#include "../autoloads/entity_data_manager.h"
|
||||
|
||||
@ -25,7 +25,7 @@ public:
|
||||
void clear_item_stat_modifiers();
|
||||
|
||||
int get_item_stat_modifier_count();
|
||||
|
||||
|
||||
int get_stack_size();
|
||||
void set_stack_size(int value);
|
||||
|
||||
@ -34,7 +34,7 @@ public:
|
||||
|
||||
virtual Dictionary _to_dict();
|
||||
virtual void _from_dict(const Dictionary &dict);
|
||||
|
||||
|
||||
ItemInstance();
|
||||
~ItemInstance();
|
||||
|
||||
@ -44,7 +44,7 @@ protected:
|
||||
private:
|
||||
Ref<ItemTemplate> _item_template;
|
||||
int _item_template_id;
|
||||
|
||||
|
||||
int _stack_size;
|
||||
|
||||
Vector<Ref<ItemStatModifier> > _modifiers;
|
||||
|
@ -8,7 +8,6 @@ void ItemStatModifier::set_stat_id(Stat::StatId value) {
|
||||
_stat_id = value;
|
||||
}
|
||||
|
||||
|
||||
float ItemStatModifier::get_base_mod() {
|
||||
return _base_mod;
|
||||
}
|
||||
@ -25,7 +24,6 @@ void ItemStatModifier::set_bonus_mod(float value) {
|
||||
_bonus_mod = value;
|
||||
}
|
||||
|
||||
|
||||
float ItemStatModifier::get_percent_mod() {
|
||||
return _percent_mod;
|
||||
}
|
||||
@ -55,7 +53,6 @@ Dictionary ItemStatModifier::_to_dict() {
|
||||
void ItemStatModifier::_from_dict(const Dictionary &dict) {
|
||||
ERR_FAIL_COND(dict.empty());
|
||||
|
||||
|
||||
_stat_id = static_cast<Stat::StatId>(static_cast<int>(dict.get("stat_id", 0)));
|
||||
_base_mod = dict.get("base_mod", 0);
|
||||
_bonus_mod = dict.get("bonus_mod", 0);
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef ITEM_STAT_MODIFIER_H
|
||||
#define ITEM_STAT_MODIFIER_H
|
||||
|
||||
#include "core/reference.h"
|
||||
#include "../entities/stats/stat.h"
|
||||
#include "core/reference.h"
|
||||
|
||||
class ItemStatModifier : public Reference {
|
||||
GDCLASS(ItemStatModifier, Reference);
|
||||
|
@ -2,13 +2,13 @@
|
||||
#define ITEM_TEMPLATE_H
|
||||
|
||||
#include "core/resource.h"
|
||||
#include "scene/resources/texture.h"
|
||||
#include "core/vector.h"
|
||||
#include "scene/resources/texture.h"
|
||||
|
||||
#include "item_visual.h"
|
||||
#include "item_template_stat_modifier.h"
|
||||
#include "../entities/stats/stat.h"
|
||||
#include "../item_enums.h"
|
||||
#include "item_template_stat_modifier.h"
|
||||
#include "item_visual.h"
|
||||
|
||||
class ItemInstance;
|
||||
class Aura;
|
||||
@ -19,7 +19,6 @@ class ItemTemplate : public Resource {
|
||||
GDCLASS(ItemTemplate, Resource);
|
||||
|
||||
public:
|
||||
|
||||
int get_id() const;
|
||||
void set_id(const int value);
|
||||
|
||||
@ -52,7 +51,7 @@ public:
|
||||
|
||||
int get_stack_size() const;
|
||||
void set_stack_size(const int value);
|
||||
|
||||
|
||||
Ref<Texture> get_icon() const;
|
||||
void set_icon(const Ref<Texture> value);
|
||||
|
||||
@ -67,7 +66,7 @@ public:
|
||||
|
||||
int get_bag_size() const;
|
||||
void set_bag_size(const int size);
|
||||
|
||||
|
||||
//Teaches
|
||||
int get_num_teaches_spells();
|
||||
void set_num_teaches_spells(int value);
|
||||
@ -172,13 +171,13 @@ private:
|
||||
Ref<ItemVisual> _item_visual;
|
||||
|
||||
int _stack_size;
|
||||
|
||||
|
||||
Ref<Texture> _icon;
|
||||
|
||||
float _scale_x;
|
||||
float _scale_y;
|
||||
float _scale_z;
|
||||
|
||||
|
||||
int _bag_size;
|
||||
|
||||
Vector<Ref<Spell> > _teaches_spells;
|
||||
|
@ -106,4 +106,3 @@ void ItemTemplateStatModifier::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_scaling_factor", "value"), &ItemTemplateStatModifier::set_scaling_factor);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "scaling_factor"), "set_scaling_factor", "get_scaling_factor");
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef ITEM_TEMPLATE_STAT_MODIFIER_H
|
||||
#define ITEM_TEMPLATE_STAT_MODIFIER_H
|
||||
|
||||
#include "core/reference.h"
|
||||
#include "../entities/stats/stat.h"
|
||||
#include "core/reference.h"
|
||||
|
||||
class ItemTemplateStatModifier : public Reference {
|
||||
GDCLASS(ItemTemplateStatModifier, Reference);
|
||||
|
@ -70,5 +70,4 @@ void ItemVisual::_bind_methods() {
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_right_thigh", PROPERTY_HINT_RESOURCE_TYPE, "ItemVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_RIGHT_THIGH);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_right_calf", PROPERTY_HINT_RESOURCE_TYPE, "ItemVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_RIGHT_CALF);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_right_foot", PROPERTY_HINT_RESOURCE_TYPE, "ItemVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_RIGHT_FOOT);
|
||||
|
||||
}
|
||||
|
@ -52,10 +52,10 @@ ItemVisualEntry::ItemVisualEntry() {
|
||||
|
||||
ItemVisualEntry::~ItemVisualEntry() {
|
||||
for (int i = 0; i < EntityEnums::GENDER_COUNT; ++i) {
|
||||
#ifdef MESH_DATA_RESOURCE_PRESENT
|
||||
#ifdef MESH_DATA_RESOURCE_PRESENT
|
||||
_mesh[i].unref();
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
_texture[i].unref();
|
||||
}
|
||||
|
||||
@ -67,12 +67,12 @@ void ItemVisualEntry::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_override_layer", "value"), &ItemVisualEntry::set_override_layer);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "override_layer", PROPERTY_HINT_ENUM, ItemEnums::BINDING_STRING_ENTITY_TEXTURE_LAYERS), "set_override_layer", "get_override_layer");
|
||||
|
||||
#ifdef MESH_DATA_RESOURCE_PRESENT
|
||||
#ifdef MESH_DATA_RESOURCE_PRESENT
|
||||
ClassDB::bind_method(D_METHOD("get_mesh", "index"), &ItemVisualEntry::get_mesh);
|
||||
ClassDB::bind_method(D_METHOD("set_mesh", "index", "value"), &ItemVisualEntry::set_mesh);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "mesh_male", PROPERTY_HINT_RESOURCE_TYPE, "MeshDataResource"), "set_mesh", "get_mesh", EntityEnums::GENDER_MALE);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "mesh_female", PROPERTY_HINT_RESOURCE_TYPE, "MeshDataResource"), "set_mesh", "get_mesh", EntityEnums::GENDER_FEMALE);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_texture", "index"), &ItemVisualEntry::get_texture);
|
||||
ClassDB::bind_method(D_METHOD("set_texture", "index", "value"), &ItemVisualEntry::set_texture);
|
||||
@ -92,4 +92,3 @@ void ItemVisualEntry::_bind_methods() {
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::VECTOR3, "effect_offset_male"), "set_effect_offset", "get_effect_offset", EntityEnums::GENDER_MALE);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::VECTOR3, "effect_offset_female"), "set_effect_offset", "get_effect_offset", EntityEnums::GENDER_FEMALE);
|
||||
}
|
||||
|
||||
|
@ -1,16 +1,16 @@
|
||||
#ifndef ITEM_VISUAL_ENTRY_H
|
||||
#define ITEM_VISUAL_ENTRY_H
|
||||
|
||||
#include "core/color.h"
|
||||
#include "core/resource.h"
|
||||
#include "core/ustring.h"
|
||||
#include "core/color.h"
|
||||
#include "scene/resources/texture.h"
|
||||
|
||||
#include "../entity_enums.h"
|
||||
#include "../item_enums.h"
|
||||
|
||||
#include "scene/resources/packed_scene.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
#include "scene/resources/packed_scene.h"
|
||||
|
||||
#ifdef MESH_DATA_RESOURCE_PRESENT
|
||||
#include "../../mesh_data_resource/mesh_data_resource.h"
|
||||
@ -23,10 +23,10 @@ public:
|
||||
ItemEnums::EntityTextureLayers get_override_layer();
|
||||
void set_override_layer(ItemEnums::EntityTextureLayers layer);
|
||||
|
||||
#ifdef MESH_DATA_RESOURCE_PRESENT
|
||||
#ifdef MESH_DATA_RESOURCE_PRESENT
|
||||
Ref<MeshDataResource> get_mesh(int index);
|
||||
void set_mesh(int index, Ref<MeshDataResource> mesh);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Ref<Texture> get_texture(int index);
|
||||
void set_texture(int index, Ref<Texture> texture);
|
||||
@ -49,9 +49,9 @@ protected:
|
||||
private:
|
||||
ItemEnums::EntityTextureLayers _override_layer;
|
||||
|
||||
#ifdef MESH_DATA_RESOURCE_PRESENT
|
||||
#ifdef MESH_DATA_RESOURCE_PRESENT
|
||||
Ref<MeshDataResource> _mesh[EntityEnums::GENDER_COUNT];
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Ref<Texture> _texture[EntityEnums::GENDER_COUNT];
|
||||
Color _color;
|
||||
|
@ -1,9 +1,9 @@
|
||||
#include "spell.h"
|
||||
|
||||
#include "aura.h"
|
||||
#include "craft_recipe.h"
|
||||
#include "../entities/resources/entity_resource_cost_data.h"
|
||||
#include "../entities/skills/entity_skill_data.h"
|
||||
#include "aura.h"
|
||||
#include "craft_recipe.h"
|
||||
|
||||
int Spell::get_id() {
|
||||
return _id;
|
||||
@ -145,7 +145,6 @@ void Spell::set_projectile(Ref<WorldSpellData> value) {
|
||||
_projectile = value;
|
||||
}
|
||||
|
||||
|
||||
Ref<CraftRecipe> Spell::get_teaches_craft_recipe() {
|
||||
return _teaches_craft_recipe;
|
||||
}
|
||||
@ -492,7 +491,6 @@ int Spell::get_training_required_skill_level() {
|
||||
}
|
||||
void Spell::set_training_required_skill_level(int value) {
|
||||
_training_required_skill_level = value;
|
||||
|
||||
}
|
||||
|
||||
//// Spell System ////
|
||||
@ -675,7 +673,7 @@ void Spell::_sstart_casting(Ref<SpellCastInfo> info) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((get_global_cooldown_enabled() && info->get_caster()->gets_has_global_cooldown()) ||
|
||||
if ((get_global_cooldown_enabled() && info->get_caster()->gets_has_global_cooldown()) ||
|
||||
info->get_caster()->hass_category_cooldown(get_spell_type()) ||
|
||||
info->get_caster()->hass_cooldown(get_id())) {
|
||||
return;
|
||||
@ -694,8 +692,6 @@ void Spell::_sstart_casting(Ref<SpellCastInfo> info) {
|
||||
|
||||
info->get_target()->son_cast_finished_target(info);
|
||||
|
||||
|
||||
|
||||
if (get_projectile().is_valid()) {
|
||||
//fire_projectile(info);
|
||||
} else {
|
||||
@ -758,13 +754,11 @@ pass
|
||||
# sp.launch(info, projectile, projectile_speed)
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
void Spell::_handle_effect(Ref<SpellCastInfo> info) {
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
|
||||
if target_type == SPELL_TARGET_TYPE_TARGET:
|
||||
if info.target == null:
|
||||
@ -1187,7 +1181,7 @@ void Spell::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_resource_cost"), &Spell::get_resource_cost);
|
||||
ClassDB::bind_method(D_METHOD("set_resource_cost", "value"), &Spell::set_resource_cost);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "resource_cost", PROPERTY_HINT_RESOURCE_TYPE, "EntityResourceCostData"), "set_resource_cost", "get_resource_cost");
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_resource_give"), &Spell::get_resource_give);
|
||||
ClassDB::bind_method(D_METHOD("set_resource_give", "value"), &Spell::set_resource_give);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "resource_give", PROPERTY_HINT_RESOURCE_TYPE, "EntityResourceCostData"), "set_resource_give", "get_resource_give");
|
||||
@ -1235,7 +1229,6 @@ void Spell::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_training_required_skill_level", "value"), &Spell::set_training_required_skill_level);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "training_required_skill_level"), "set_training_required_skill_level", "get_training_required_skill_level");
|
||||
|
||||
|
||||
BIND_ENUM_CONSTANT(TARGET_SELF);
|
||||
BIND_ENUM_CONSTANT(TARGET_ENEMY);
|
||||
BIND_ENUM_CONSTANT(TARGET_FRIENDLY);
|
||||
|
@ -12,8 +12,8 @@
|
||||
#include "../entities/entity.h"
|
||||
#include "../entities/stats/stat.h"
|
||||
|
||||
#include "../pipelines/spell_damage_info.h"
|
||||
#include "../infos/aura_infos.h"
|
||||
#include "../pipelines/spell_damage_info.h"
|
||||
|
||||
#include "spell_effect_visual.h"
|
||||
|
||||
@ -325,7 +325,7 @@ private:
|
||||
|
||||
int _level;
|
||||
int _rank;
|
||||
|
||||
|
||||
bool _scale_with_level;
|
||||
|
||||
Ref<ItemTemplate> _item_cost;
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include "spell_effect_visual_simple.h"
|
||||
|
||||
|
||||
bool SpellEffectVisualSimple::has_spell_effect_visual() {
|
||||
return _effect_visual.is_valid();
|
||||
}
|
||||
@ -47,7 +46,6 @@ void SpellEffectVisualSimple::set_spell_cast_effect(Ref<PackedScene> value) {
|
||||
_spell_cast_effect = value;
|
||||
}
|
||||
|
||||
|
||||
//Visual Effect
|
||||
|
||||
bool SpellEffectVisualSimple::has_aura_effect_visual() {
|
||||
@ -68,7 +66,6 @@ void SpellEffectVisualSimple::set_aura_effect_visual(Ref<PackedScene> value) {
|
||||
_aura_effect_visual = value;
|
||||
}
|
||||
|
||||
|
||||
SpellEffectVisualSimple::SpellEffectVisualSimple() {
|
||||
}
|
||||
|
||||
@ -103,7 +100,7 @@ void SpellEffectVisualSimple::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_spell_cast_effect", "value"), &SpellEffectVisualSimple::set_spell_cast_effect);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "effect_spell_cast_effect_id", PROPERTY_HINT_RESOURCE_TYPE, "PackedScene"), "set_spell_cast_effect", "get_spell_cast_effect");
|
||||
|
||||
//Visual Effect
|
||||
//Visual Effect
|
||||
ADD_GROUP("Aura Effect", "aura_effect");
|
||||
ClassDB::bind_method(D_METHOD("has_aura_effect_visual"), &SpellEffectVisualSimple::has_aura_effect_visual);
|
||||
|
||||
|
@ -88,7 +88,6 @@ void EntityAI::pet_update(float delta) {
|
||||
call("_pet_update", delta);
|
||||
}
|
||||
|
||||
|
||||
void EntityAI::move(float delta) {
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(_owner));
|
||||
|
||||
|
@ -130,8 +130,8 @@ void AuraData::set_spell_scale(float value) {
|
||||
|
||||
Ref<Aura> AuraData::get_aura() {
|
||||
//if (_aura == NULL) {
|
||||
//TODO fix!
|
||||
//_aura = Auras::getInstance()->GetData(get_aura_id());
|
||||
//TODO fix!
|
||||
//_aura = Auras::getInstance()->GetData(get_aura_id());
|
||||
//}
|
||||
|
||||
return _aura;
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef AURA_DATA_H
|
||||
#define AURA_DATA_H
|
||||
|
||||
#include "core/reference.h"
|
||||
#include "core/array.h"
|
||||
#include "core/dictionary.h"
|
||||
#include "core/reference.h"
|
||||
|
||||
#include "../../spell_enums.h"
|
||||
|
||||
|
@ -53,7 +53,6 @@ Ref<Aura> CharacterSpec::get_talent(const int row_index, const int culomn, const
|
||||
return Ref<Aura>(NULL);
|
||||
}
|
||||
|
||||
|
||||
CharacterSpec::CharacterSpec() {
|
||||
_id = 0;
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include "entity_class_data.h"
|
||||
|
||||
#include "../ai/entity_ai.h"
|
||||
#include "../../data/aura.h"
|
||||
#include "../../data/spell.h"
|
||||
#include "../../data/item_instance.h"
|
||||
#include "../../data/spell.h"
|
||||
#include "../../infos/spell_cast_info.h"
|
||||
#include "../ai/entity_ai.h"
|
||||
#include "../entity.h"
|
||||
#include "character_spec.h"
|
||||
|
||||
@ -116,7 +116,6 @@ void EntityClassData::set_entity_resources(const Vector<Variant> &entity_resourc
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// SPECS ////
|
||||
|
||||
int EntityClassData::get_num_specs() {
|
||||
@ -161,7 +160,6 @@ void EntityClassData::set_specs(const Vector<Variant> &specs) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// SPELLS ////
|
||||
|
||||
int EntityClassData::get_num_spells() {
|
||||
|
@ -1,10 +1,10 @@
|
||||
#ifndef ENTITY_CLASS_DATA_H
|
||||
#define ENTITY_CLASS_DATA_H
|
||||
|
||||
#include "core/resource.h"
|
||||
#include "core/vector.h"
|
||||
#include "core/ustring.h"
|
||||
#include "core/math/math_funcs.h"
|
||||
#include "core/resource.h"
|
||||
#include "core/ustring.h"
|
||||
#include "core/vector.h"
|
||||
#include "scene/resources/texture.h"
|
||||
|
||||
#include "../../entities/stats/stat_data.h"
|
||||
@ -14,9 +14,9 @@
|
||||
#include "../../pipelines/spell_damage_info.h"
|
||||
#include "../../pipelines/spell_heal_info.h"
|
||||
|
||||
#include "../../utility/cooldown.h"
|
||||
#include "../../utility/category_cooldown.h"
|
||||
#include "../../item_enums.h"
|
||||
#include "../../utility/category_cooldown.h"
|
||||
#include "../../utility/cooldown.h"
|
||||
|
||||
#include "../resources/entity_resource_data.h"
|
||||
|
||||
@ -67,7 +67,7 @@ public:
|
||||
Vector<Variant> get_entity_resources();
|
||||
void set_entity_resources(const Vector<Variant> &entity_resourcess);
|
||||
|
||||
//Specs
|
||||
//Specs
|
||||
int get_num_specs();
|
||||
void set_num_specs(int value);
|
||||
|
||||
@ -77,7 +77,7 @@ public:
|
||||
Vector<Variant> get_specs();
|
||||
void set_specs(const Vector<Variant> &specs);
|
||||
|
||||
//Spells
|
||||
//Spells
|
||||
int get_num_spells();
|
||||
void set_num_spells(int value);
|
||||
|
||||
@ -96,8 +96,8 @@ public:
|
||||
|
||||
Vector<Variant> get_start_spells();
|
||||
void set_start_spells(const Vector<Variant> &spells);
|
||||
|
||||
//Auras
|
||||
|
||||
//Auras
|
||||
int get_num_auras();
|
||||
void set_num_auras(int value);
|
||||
|
||||
@ -119,7 +119,7 @@ public:
|
||||
|
||||
Ref<EntityAI> get_ai_instance();
|
||||
Ref<EntityAI> _get_ai_instance();
|
||||
|
||||
|
||||
//Setup
|
||||
void setup_resources(Entity *entity);
|
||||
void _setup_resources(Node *entity);
|
||||
@ -128,39 +128,39 @@ public:
|
||||
|
||||
void start_casting(int spell_id, Entity *caster, float spellScale);
|
||||
|
||||
void son_before_cast(Ref<SpellCastInfo> info);
|
||||
void son_before_cast(Ref<SpellCastInfo> info);
|
||||
void son_before_cast_target(Ref<SpellCastInfo> info);
|
||||
void son_cast_finished_target(Ref<SpellCastInfo> info);
|
||||
void son_cast_finished(Ref<SpellCastInfo> info);
|
||||
void son_cast_started(Ref<SpellCastInfo> info);
|
||||
void son_cast_failed(Ref<SpellCastInfo> info);
|
||||
void son_spell_cast_success(Ref<SpellCastInfo> info);
|
||||
|
||||
void son_before_damage_hit(Ref<SpellDamageInfo> data);
|
||||
|
||||
void son_before_damage_hit(Ref<SpellDamageInfo> data);
|
||||
void son_hit(Ref<SpellDamageInfo> data);
|
||||
void son_before_damage(Ref<SpellDamageInfo> data);
|
||||
void son_damage_receive(Ref<SpellDamageInfo> data);
|
||||
void son_dealt_damage(Ref<SpellDamageInfo> data);
|
||||
void son_damage_dealt(Ref<SpellDamageInfo> data);
|
||||
|
||||
void son_before_heal_hit(Ref<SpellHealInfo> data);
|
||||
void son_before_heal_hit(Ref<SpellHealInfo> data);
|
||||
void son_before_heal(Ref<SpellHealInfo> data);
|
||||
void son_heal_receive(Ref<SpellHealInfo> data);
|
||||
void son_dealt_heal(Ref<SpellHealInfo> data);
|
||||
void son_heal_dealt(Ref<SpellHealInfo> data);
|
||||
|
||||
void son_before_aura_applied(Ref<AuraData> data);
|
||||
void son_before_aura_applied(Ref<AuraData> data);
|
||||
void son_after_aura_applied(Ref<AuraData> data);
|
||||
|
||||
void son_death(Entity *entity);
|
||||
void son_death_bind(Node *entity);
|
||||
|
||||
|
||||
void son_death(Entity *entity);
|
||||
void son_death_bind(Node *entity);
|
||||
|
||||
void son_cooldown_added(Ref<Cooldown> cooldown);
|
||||
void son_cooldown_removed(Ref<Cooldown> cooldown);
|
||||
|
||||
|
||||
void son_category_cooldown_added(Ref<CategoryCooldown> category_cooldown);
|
||||
void son_category_cooldown_removed(Ref<CategoryCooldown> category_cooldown);
|
||||
|
||||
|
||||
void son_gcd_started(Entity *entity, float gcd);
|
||||
void son_gcd_finished(Entity *entity);
|
||||
void son_gcd_started_bind(Node *entity, float gcd);
|
||||
@ -171,30 +171,30 @@ public:
|
||||
void son_level_up(Entity *entity, int value);
|
||||
void son_level_up_bind(Node *entity, int value);
|
||||
|
||||
//Clientside Event Handlers
|
||||
//Clientside Event Handlers
|
||||
void con_cast_failed(Ref<SpellCastInfo> info);
|
||||
void con_cast_started(Ref<SpellCastInfo> info);
|
||||
void con_cast_state_changed(Ref<SpellCastInfo> info);
|
||||
void con_cast_finished(Ref<SpellCastInfo> info);
|
||||
void con_spell_cast_success(Ref<SpellCastInfo> info);
|
||||
|
||||
|
||||
void con_death(Entity *entity);
|
||||
void con_death_bind(Node *entity);
|
||||
|
||||
void con_death_bind(Node *entity);
|
||||
|
||||
void con_cooldown_added(Ref<Cooldown> cooldown);
|
||||
void con_cooldown_removed(Ref<Cooldown> cooldown);
|
||||
void con_category_cooldown_added(Ref<CategoryCooldown> category_cooldown);
|
||||
void con_category_cooldown_removed(Ref<CategoryCooldown> category_cooldown);
|
||||
|
||||
|
||||
void con_aura_added(Ref<AuraData> data);
|
||||
void con_aura_removed(Ref<AuraData> data);
|
||||
void con_aura_refresh(Ref<AuraData> data);
|
||||
|
||||
|
||||
void con_damage_dealt(Ref<SpellDamageInfo> info);
|
||||
void con_dealt_damage(Ref<SpellDamageInfo> info);
|
||||
void con_heal_dealt(Ref<SpellHealInfo> info);
|
||||
void con_dealt_heal(Ref<SpellHealInfo> info);
|
||||
|
||||
|
||||
void con_gcd_started(Entity *entity, float gcd);
|
||||
void con_gcd_finished(Entity *entity);
|
||||
void con_gcd_started_bind(Node *entity, float gcd);
|
||||
|
@ -25,8 +25,8 @@
|
||||
|
||||
#include "../../skeleton/entity_species_data.h"
|
||||
|
||||
#include "../ai/entity_ai.h"
|
||||
#include "../../formations/ai_formation.h"
|
||||
#include "../ai/entity_ai.h"
|
||||
|
||||
class Aura;
|
||||
class Spell;
|
||||
|
@ -16,7 +16,6 @@ Dictionary EntityDataContainer::_to_dict() {
|
||||
}
|
||||
void EntityDataContainer::_from_dict(const Dictionary &dict) {
|
||||
ERR_FAIL_COND(dict.empty());
|
||||
|
||||
}
|
||||
|
||||
EntityDataContainer::EntityDataContainer() {
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef ENTITY_DATA_CONTAINER_H
|
||||
#define ENTITY_DATA_CONTAINER_H
|
||||
|
||||
#include "core/reference.h"
|
||||
#include "core/dictionary.h"
|
||||
#include "core/reference.h"
|
||||
|
||||
class EntityDataContainer : public Reference {
|
||||
GDCLASS(EntityDataContainer, Reference);
|
||||
|
@ -3,32 +3,31 @@
|
||||
#include "../../data/item_template.h"
|
||||
|
||||
Ref<ItemTemplate> ItemContainerDataEntry::get_item() {
|
||||
return _item;
|
||||
return _item;
|
||||
}
|
||||
void ItemContainerDataEntry::set_item(Ref<ItemTemplate> item) {
|
||||
_item = item;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
int ItemContainerDataEntry::get_item_count() const {
|
||||
return _item_count;
|
||||
return _item_count;
|
||||
}
|
||||
void ItemContainerDataEntry::set_item_count(int value) {
|
||||
_item_count = value;
|
||||
_item_count = value;
|
||||
}
|
||||
|
||||
ItemContainerDataEntry::ItemContainerDataEntry() {
|
||||
_item_count = 0;
|
||||
_item_count = 0;
|
||||
}
|
||||
ItemContainerDataEntry::~ItemContainerDataEntry() {
|
||||
|
||||
}
|
||||
|
||||
void ItemContainerDataEntry::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_item"), &ItemContainerDataEntry::get_item);
|
||||
ClassDB::bind_method(D_METHOD("set_item", "item"), &ItemContainerDataEntry::set_item);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemTemplate"), "set_item", "get_item");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_item_count"), &ItemContainerDataEntry::get_item_count);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_item_count"), &ItemContainerDataEntry::get_item_count);
|
||||
ClassDB::bind_method(D_METHOD("set_item_count", "value"), &ItemContainerDataEntry::set_item_count);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "item_count"), "set_item_count", "get_item_count");
|
||||
}
|
||||
|
@ -9,10 +9,10 @@ class ItemContainerDataEntry : public Resource {
|
||||
GDCLASS(ItemContainerDataEntry, Resource);
|
||||
|
||||
public:
|
||||
Ref<ItemTemplate> get_item();
|
||||
Ref<ItemTemplate> get_item();
|
||||
void set_item(Ref<ItemTemplate> item);
|
||||
|
||||
int get_item_count() const;
|
||||
|
||||
int get_item_count() const;
|
||||
void set_item_count(int value);
|
||||
|
||||
ItemContainerDataEntry();
|
||||
@ -23,7 +23,7 @@ protected:
|
||||
|
||||
private:
|
||||
Ref<ItemTemplate> _item;
|
||||
int _item_count;
|
||||
int _item_count;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -34,7 +34,6 @@ void VendorItemData::set_vendor_datas(const Vector<Variant> &vendor_datas) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
VendorItemData::VendorItemData() {
|
||||
}
|
||||
VendorItemData::~VendorItemData() {
|
||||
|
@ -3,37 +3,37 @@
|
||||
#include "../../data/item_template.h"
|
||||
|
||||
Ref<ItemTemplate> VendorItemDataEntry::get_item() {
|
||||
return _item;
|
||||
return _item;
|
||||
}
|
||||
void VendorItemDataEntry::set_item(Ref<ItemTemplate> item) {
|
||||
_item = item;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
|
||||
int VendorItemDataEntry::get_item_price() const {
|
||||
return _item_price;
|
||||
return _item_price;
|
||||
}
|
||||
void VendorItemDataEntry::set_item_price(int value) {
|
||||
_item_price = value;
|
||||
_item_price = value;
|
||||
}
|
||||
|
||||
|
||||
int VendorItemDataEntry::get_item_count() const {
|
||||
return _item_count;
|
||||
return _item_count;
|
||||
}
|
||||
void VendorItemDataEntry::set_item_count(int value) {
|
||||
_item_count = value;
|
||||
_item_count = value;
|
||||
}
|
||||
|
||||
|
||||
int VendorItemDataEntry::get_item_spawn_time() const {
|
||||
return _item_spawn_time;
|
||||
return _item_spawn_time;
|
||||
}
|
||||
void VendorItemDataEntry::set_item_spawn_time(int value) {
|
||||
_item_spawn_time = value;
|
||||
_item_spawn_time = value;
|
||||
}
|
||||
|
||||
|
||||
VendorItemDataEntry::VendorItemDataEntry() {
|
||||
_item_price = 0;
|
||||
_item_count = 0;
|
||||
_item_spawn_time = 0;
|
||||
_item_price = 0;
|
||||
_item_count = 0;
|
||||
_item_spawn_time = 0;
|
||||
}
|
||||
VendorItemDataEntry::~VendorItemDataEntry() {
|
||||
}
|
||||
@ -42,16 +42,16 @@ void VendorItemDataEntry::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_item"), &VendorItemDataEntry::get_item);
|
||||
ClassDB::bind_method(D_METHOD("set_item", "item"), &VendorItemDataEntry::set_item);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemTemplate"), "set_item", "get_item");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_item_price"), &VendorItemDataEntry::get_item_price);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_item_price"), &VendorItemDataEntry::get_item_price);
|
||||
ClassDB::bind_method(D_METHOD("set_item_price", "value"), &VendorItemDataEntry::set_item_price);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "item_price"), "set_item_price", "get_item_price");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_item_count"), &VendorItemDataEntry::get_item_count);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_item_count"), &VendorItemDataEntry::get_item_count);
|
||||
ClassDB::bind_method(D_METHOD("set_item_count", "value"), &VendorItemDataEntry::set_item_count);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "item_count"), "set_item_count", "get_item_count");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_item_spawn_time"), &VendorItemDataEntry::get_item_spawn_time);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_item_spawn_time"), &VendorItemDataEntry::get_item_spawn_time);
|
||||
ClassDB::bind_method(D_METHOD("set_item_spawn_time", "value"), &VendorItemDataEntry::set_item_spawn_time);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "item_spawn_time"), "set_item_spawn_time", "get_item_spawn_time");
|
||||
}
|
||||
|
@ -9,18 +9,18 @@ class VendorItemDataEntry : public Resource {
|
||||
GDCLASS(VendorItemDataEntry, Resource);
|
||||
|
||||
public:
|
||||
Ref<ItemTemplate> get_item();
|
||||
Ref<ItemTemplate> get_item();
|
||||
void set_item(Ref<ItemTemplate> item);
|
||||
|
||||
int get_item_price() const;
|
||||
|
||||
int get_item_price() const;
|
||||
void set_item_price(int value);
|
||||
|
||||
int get_item_count() const;
|
||||
|
||||
int get_item_count() const;
|
||||
void set_item_count(int value);
|
||||
|
||||
int get_item_spawn_time() const;
|
||||
|
||||
int get_item_spawn_time() const;
|
||||
void set_item_spawn_time(int time);
|
||||
|
||||
|
||||
VendorItemDataEntry();
|
||||
~VendorItemDataEntry();
|
||||
|
||||
@ -29,9 +29,9 @@ protected:
|
||||
|
||||
private:
|
||||
Ref<ItemTemplate> _item;
|
||||
int _item_price;
|
||||
int _item_count;
|
||||
int _item_spawn_time;
|
||||
int _item_price;
|
||||
int _item_count;
|
||||
int _item_spawn_time;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -506,7 +506,6 @@ void Entity::sets_ai(Ref<EntityAI> value) {
|
||||
_s_ai->set_owner(this);
|
||||
}
|
||||
|
||||
|
||||
//// Pets ////
|
||||
|
||||
void Entity::adds_pet(Entity *entity) {
|
||||
@ -553,7 +552,7 @@ void Entity::removes_pet_index(int index) {
|
||||
Entity *pet = _s_pets.get(index);
|
||||
|
||||
ERR_CONTINUE(!ObjectDB::instance_validate(entity));
|
||||
|
||||
|
||||
_s_pets.get(i)->sets_pet_formation_index(i);
|
||||
}
|
||||
|
||||
@ -6528,7 +6527,7 @@ void Entity::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("gets_pet_count"), &Entity::gets_pet_count);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("addc_pet_path"), &Entity::addc_pet_path);
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("addc_pet", "entity"), &Entity::addc_pet_bind);
|
||||
ClassDB::bind_method(D_METHOD("getc_pet", "index"), &Entity::getc_pet);
|
||||
ClassDB::bind_method(D_METHOD("removec_pet_index", "index"), &Entity::removec_pet_index);
|
||||
|
@ -127,10 +127,10 @@ enum PlayerSendFlags {
|
||||
} \
|
||||
normalfunc(normal_var);
|
||||
|
||||
#define VRPCOBJP(rpcfunc, rpc_var1, rpc_var2, normalfunc, normal_var1, normal_var2) \
|
||||
if (is_inside_tree() && get_tree()->has_network_peer()) { \
|
||||
vrpc(#rpcfunc, rpc_var1, rpc_var2); \
|
||||
} \
|
||||
#define VRPCOBJP(rpcfunc, rpc_var1, rpc_var2, normalfunc, normal_var1, normal_var2) \
|
||||
if (is_inside_tree() && get_tree()->has_network_peer()) { \
|
||||
vrpc(#rpcfunc, rpc_var1, rpc_var2); \
|
||||
} \
|
||||
normalfunc(normal_var1, normal_var2);
|
||||
|
||||
#define ORPCOBJ(rpcfunc, rpc_var, normalfunc, normal_var) \
|
||||
@ -1086,7 +1086,7 @@ private:
|
||||
Ref<Bag> _c_target_bag;
|
||||
|
||||
// AI
|
||||
|
||||
|
||||
EntityEnums::AIStates _sai_state;
|
||||
EntityEnums::AIStates _sai_state_stored;
|
||||
|
||||
|
@ -18,10 +18,10 @@ void EntityResource::set_should_process(bool value) {
|
||||
_should_process = value;
|
||||
}
|
||||
|
||||
Ref<EntityResourceData> EntityResource::get_resource_data() {
|
||||
Ref<EntityResourceData> EntityResource::get_resource_data() {
|
||||
return _data;
|
||||
}
|
||||
void EntityResource::set_resource_data(Ref<EntityResourceData> value) {
|
||||
void EntityResource::set_resource_data(Ref<EntityResourceData> value) {
|
||||
_data = value;
|
||||
|
||||
if (_data.is_valid())
|
||||
|
@ -42,5 +42,4 @@ void EntityResourceData::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_text_description"), &EntityResourceData::get_text_description);
|
||||
ClassDB::bind_method(D_METHOD("set_text_description", "value"), &EntityResourceData::set_text_description);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::STRING, "text_description", PROPERTY_HINT_MULTILINE_TEXT), "set_text_description", "get_text_description");
|
||||
|
||||
}
|
||||
|
@ -8,11 +8,10 @@ Ref<EntitySkillData> EntitySkill::get_skill() {
|
||||
void EntitySkill::set_skill(Ref<EntitySkillData> value) {
|
||||
_skill = value;
|
||||
|
||||
if (_skill.is_valid())
|
||||
if (_skill.is_valid())
|
||||
_skill_id = _skill->get_id();
|
||||
else
|
||||
_skill_id = 0;
|
||||
|
||||
|
||||
emit_signal("skill_changed", Ref<EntitySkill>(this));
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ public:
|
||||
|
||||
bool get_disabled();
|
||||
void set_disabled(bool value);
|
||||
|
||||
|
||||
Dictionary to_dict();
|
||||
void from_dict(const Dictionary &dict);
|
||||
|
||||
|
@ -55,5 +55,4 @@ void EntitySkillData::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_text_description"), &EntitySkillData::get_text_description);
|
||||
ClassDB::bind_method(D_METHOD("set_text_description", "value"), &EntitySkillData::set_text_description);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::STRING, "text_description", PROPERTY_HINT_MULTILINE_TEXT), "set_text_description", "get_text_description");
|
||||
|
||||
}
|
||||
|
@ -79,7 +79,6 @@ void ComplexLevelStatData::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_spirit_for_level", "level"), &ComplexLevelStatData::get_spirit_for_level);
|
||||
ClassDB::bind_method(D_METHOD("set_spirit_for_level", "level", "value"), &ComplexLevelStatData::set_spirit_for_level);
|
||||
|
||||
|
||||
for (int i = 0; i < EntityEnums::MAX_LEVEL; ++i) {
|
||||
ADD_GROUP("Level " + String::num(i + 1), "level_" + String::num(i + 1));
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::INT, "level_" + String::num(i + 1) + "_agility"), "set_agility_for_level", "get_agility_for_level", i);
|
||||
|
@ -13,4 +13,3 @@ void LevelStatData::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_stat_diff", "stat", "old_level", "new_level"), &LevelStatData::get_stat_diff);
|
||||
}
|
||||
|
||||
|
@ -313,7 +313,7 @@ void Stat::apply_modifiers() {
|
||||
if (_modifier_apply_type == MODIFIER_APPLY_TYPE_STANDARD) {
|
||||
for (int i = 0; i < _modifiers.size(); ++i) {
|
||||
Ref<StatModifier> mod = _modifiers.get(i);
|
||||
|
||||
|
||||
_base += mod->get_base_mod();
|
||||
_bonus += mod->get_bonus_mod();
|
||||
_percent += mod->get_percent_mod();
|
||||
|
@ -163,7 +163,7 @@ public:
|
||||
void _from_dict(const Dictionary &dict);
|
||||
|
||||
Stat();
|
||||
Stat(Stat::StatId id, Entity* owner);
|
||||
Stat(Stat::StatId id, Entity *owner);
|
||||
Stat(Stat::StatId id, StatModifierApplyType modifier_apply_type, Entity *owner);
|
||||
~Stat();
|
||||
|
||||
|
@ -14,7 +14,7 @@ void StatData::set_stat_data_int(int index, Ref<StatDataEntry> entry) {
|
||||
|
||||
Ref<StatDataEntry> StatData::get_stat_data_enum(Stat::StatId stat_id) {
|
||||
ERR_FAIL_INDEX_V(stat_id, Stat::STAT_ID_TOTAL_STATS, Ref<StatDataEntry>(NULL));
|
||||
|
||||
|
||||
return Ref<StatDataEntry>(_entries[stat_id]);
|
||||
}
|
||||
|
||||
@ -39,7 +39,6 @@ void StatData::get_stat_for_stat(Ref<Stat> stat) {
|
||||
sd->get_stats_for_stat(stat);
|
||||
}
|
||||
|
||||
|
||||
StatData::StatData() {
|
||||
for (int i = 0; i < Stat::STAT_ID_TOTAL_STATS; ++i) {
|
||||
Ref<StatDataEntry> entry(memnew(StatDataEntry()));
|
||||
@ -48,7 +47,7 @@ StatData::StatData() {
|
||||
|
||||
_entries[i] = Ref<StatDataEntry>(entry);
|
||||
}
|
||||
|
||||
|
||||
get_stat_data_enum(Stat::STAT_ID_HEALTH)->set_base(100);
|
||||
get_stat_data_enum(Stat::STAT_ID_MANA)->set_base(100);
|
||||
get_stat_data_enum(Stat::STAT_ID_SPEED)->set_base(4.2);
|
||||
@ -75,10 +74,9 @@ void StatData::_bind_methods() {
|
||||
ADD_GROUP("Base Stats", "base_stat");
|
||||
for (int i = 0; i < Stat::STAT_ID_TOTAL_STATS; ++i) {
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "base_stat_" + Stat::stat_id_name(i), PROPERTY_HINT_RESOURCE_TYPE, "StatDataEntry"), "set_stat_data_enum", "get_stat_data_enum", i);
|
||||
}
|
||||
}
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_level_stat_data"), &StatData::get_level_stat_data);
|
||||
ClassDB::bind_method(D_METHOD("set_level_stat_data", "value"), &StatData::set_level_stat_data);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "level_stat_data", PROPERTY_HINT_RESOURCE_TYPE, "LevelStatData"), "set_level_stat_data", "get_level_stat_data");
|
||||
}
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
#ifndef STAT_DATA_H
|
||||
#define STAT_DATA_H
|
||||
|
||||
#include "scene/resources/curve.h"
|
||||
#include "core/resource.h"
|
||||
#include "scene/resources/curve.h"
|
||||
|
||||
#include "stat_data_entry.h"
|
||||
#include "stat.h"
|
||||
#include "level_stat_data.h"
|
||||
#include "stat.h"
|
||||
#include "stat_data_entry.h"
|
||||
|
||||
class StatData : public Resource {
|
||||
GDCLASS(StatData, Resource);
|
||||
GDCLASS(StatData, Resource);
|
||||
|
||||
public:
|
||||
Ref<StatDataEntry> get_stat_data_int(int index);
|
||||
@ -18,21 +18,20 @@ public:
|
||||
Ref<StatDataEntry> get_stat_data_enum(Stat::StatId stat_id);
|
||||
void set_stat_data_enum(Stat::StatId stat_id, Ref<StatDataEntry> entry);
|
||||
|
||||
Ref<LevelStatData> get_level_stat_data();
|
||||
Ref<LevelStatData> get_level_stat_data();
|
||||
void set_level_stat_data(Ref<LevelStatData> value);
|
||||
|
||||
void get_stat_for_stat(Ref<Stat> stat);
|
||||
void get_stat_for_stat(Ref<Stat> stat);
|
||||
|
||||
StatData();
|
||||
StatData();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
static void _bind_methods();
|
||||
|
||||
private:
|
||||
Ref<StatDataEntry> _entries[Stat::STAT_ID_TOTAL_STATS];
|
||||
|
||||
Ref<LevelStatData> _level_stat_data;
|
||||
|
||||
Ref<LevelStatData> _level_stat_data;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -18,13 +18,13 @@ public:
|
||||
|
||||
int get_id();
|
||||
void set_id(int value);
|
||||
|
||||
|
||||
float get_base_mod();
|
||||
void set_base_mod(float value);
|
||||
|
||||
|
||||
float get_bonus_mod();
|
||||
void set_bonus_mod(float value);
|
||||
|
||||
|
||||
float get_percent_mod();
|
||||
void set_percent_mod(float value);
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#include "entity_data_manager.h"
|
||||
|
||||
#include "./entities/data/entity_data.h"
|
||||
#include "./data/aura.h"
|
||||
#include "./data/craft_recipe.h"
|
||||
#include "./data/spell.h"
|
||||
#include "./entities/data/entity_data.h"
|
||||
|
||||
EntityDataManager *EntityDataManager::instance;
|
||||
|
||||
|
@ -75,16 +75,16 @@ public:
|
||||
Ref<ItemTemplate> get_item_template(int item_id);
|
||||
Ref<ItemTemplate> get_item_template_index(int index);
|
||||
int get_item_template_count();
|
||||
|
||||
String get_mob_data_folder();
|
||||
|
||||
String get_mob_data_folder();
|
||||
void set_mob_data_folder(String folder);
|
||||
Vector<Ref<EntityData> > *get_mob_datas();
|
||||
void add_mob_data(Ref<EntityData> aura);
|
||||
Ref<EntityData> get_mob_data(int item_id);
|
||||
Ref<EntityData> get_mob_data_index(int index);
|
||||
int get_mob_data_count();
|
||||
|
||||
String get_player_character_data_folder();
|
||||
|
||||
String get_player_character_data_folder();
|
||||
void set_player_character_data_folder(String folder);
|
||||
Vector<Ref<EntityData> > *get_player_character_datas();
|
||||
void add_player_character_data(Ref<EntityData> aura);
|
||||
@ -99,16 +99,16 @@ public:
|
||||
void load_characters();
|
||||
void load_craft_datas();
|
||||
void load_item_templates();
|
||||
void load_mob_datas();
|
||||
void load_player_character_datas();
|
||||
|
||||
void load_mob_datas();
|
||||
void load_player_character_datas();
|
||||
|
||||
void list_characters();
|
||||
void list_spells();
|
||||
void list_auras();
|
||||
void list_craft_data();
|
||||
void list_item_templates();
|
||||
void list_mob_datas();
|
||||
void list_player_character_datas();
|
||||
void list_mob_datas();
|
||||
void list_player_character_datas();
|
||||
|
||||
bool get_automatic_load() { return _automatic_load; }
|
||||
void set_automatic_load(bool load) { _automatic_load = load; }
|
||||
@ -143,12 +143,12 @@ private:
|
||||
String _item_template_folder;
|
||||
Vector<Ref<ItemTemplate> > _item_templates;
|
||||
HashMap<int, Ref<ItemTemplate> > _item_template_map;
|
||||
|
||||
String _mob_data_folder;
|
||||
|
||||
String _mob_data_folder;
|
||||
Vector<Ref<EntityData> > _mob_datas;
|
||||
HashMap<int, Ref<EntityData> > _mob_data_map;
|
||||
|
||||
String _player_character_data_folder;
|
||||
|
||||
String _player_character_data_folder;
|
||||
Vector<Ref<EntityData> > _player_character_datas;
|
||||
HashMap<int, Ref<EntityData> > _player_character_data_map;
|
||||
|
||||
|
@ -12,13 +12,13 @@ public:
|
||||
static const String BINDING_STRING_ENTITY_CONTOLLER;
|
||||
static const String BINDING_STRING_ENTITY_FLAGS;
|
||||
static const String BINDING_STRING_ENTITY_STATE_TYPES;
|
||||
static const String BINDING_STRING_CHARCATER_SKELETON_POINTS;
|
||||
static const String BINDING_STRING_AI_STATES;
|
||||
static const String BINDING_STRING_CHARCATER_SKELETON_POINTS;
|
||||
static const String BINDING_STRING_AI_STATES;
|
||||
static const String BINDING_STRING_PET_STATES;
|
||||
static const String BINDING_STRING_ENTITY_IMMUNITY_FLAGS;
|
||||
static const String BINDING_STRING_ENTITY_INTERACTION_TYPE;
|
||||
static const String BINDING_STRING_ENTITY_PLAYSTYLE_TYPE;
|
||||
static const String BINDING_STRING_ENTITY_GENDER;
|
||||
static const String BINDING_STRING_ENTITY_IMMUNITY_FLAGS;
|
||||
static const String BINDING_STRING_ENTITY_INTERACTION_TYPE;
|
||||
static const String BINDING_STRING_ENTITY_PLAYSTYLE_TYPE;
|
||||
static const String BINDING_STRING_ENTITY_GENDER;
|
||||
static const String BINDING_STRING_ENTITY_WINDOWS;
|
||||
|
||||
enum EntityType {
|
||||
@ -149,7 +149,7 @@ public:
|
||||
ENTITY_IMMUNITY_FLAG_DISPELL = 1 << 30,
|
||||
};
|
||||
|
||||
enum CharacterSkeletonPoints {
|
||||
enum CharacterSkeletonPoints {
|
||||
SKELETON_POINT_ROOT = 0,
|
||||
SKELETON_POINT_PELVIS = 1,
|
||||
SKELETON_POINT_SPINE = 2,
|
||||
@ -190,8 +190,8 @@ public:
|
||||
enum AIStates {
|
||||
AI_STATE_OFF = 0,
|
||||
AI_STATE_REST,
|
||||
AI_STATE_PATROL,
|
||||
AI_STATE_FOLLOW_PATH,
|
||||
AI_STATE_PATROL,
|
||||
AI_STATE_FOLLOW_PATH,
|
||||
AI_STATE_REGENERATE,
|
||||
AI_STATE_ATTACK,
|
||||
|
||||
@ -229,7 +229,6 @@ public:
|
||||
ENTITY_WINDOW_VENDOR = 2,
|
||||
};
|
||||
|
||||
|
||||
enum {
|
||||
GENDER_COUNT = 2,
|
||||
MAX_LEVEL = 50,
|
||||
|
@ -63,5 +63,4 @@ void AIFormation::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("_set_editor_description", "editor_description"), &AIFormation::set_editor_description);
|
||||
ClassDB::bind_method(D_METHOD("_get_editor_description"), &AIFormation::get_editor_description);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::STRING, "editor_description", PROPERTY_HINT_MULTILINE_TEXT, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_INTERNAL), "_set_editor_description", "_get_editor_description");
|
||||
|
||||
}
|
||||
|
@ -1,164 +1,155 @@
|
||||
#include "GenericAOESpell.h"
|
||||
namespace BS {
|
||||
namespace SpellsNS {
|
||||
namespace generic {
|
||||
GenericAOESpell::GenericAOESpell(Spell* spell) : SpellScript(spell){
|
||||
if (!Mathf::Approximately(spell->CastTime, (float)0)){
|
||||
this->hasCastTime = true;
|
||||
}
|
||||
if (!Mathf::Approximately(spell->Cooldown, (float)0)) {
|
||||
this->hasCooldown = true;
|
||||
}
|
||||
this->genericSpellAttribute = spell->GenericSpellData;
|
||||
this->spellHealAttribute = spell->SpellHealData;
|
||||
if (this->spellHealAttribute != null) {
|
||||
this->heal = true;
|
||||
}
|
||||
if ((spell->DamageMin > 0) && (spell->DamageMax > 0)) {
|
||||
this->damage = true;
|
||||
}
|
||||
this->aoeAttrib = spell->SpellAOEData;
|
||||
if (this->aoeAttrib == null) {
|
||||
Debug::LogError((*(new String("Spell ")) + *(spell->name)) + *(new String(" doesn't have an AOEAttribute attached!")));
|
||||
}
|
||||
this->rangeAttrib = spell->SpellRangeData;
|
||||
if (this->rangeAttrib != null) {
|
||||
this->range = true;
|
||||
}
|
||||
this->spellCastEffectAttribute = spell->SpellCastEffectData;
|
||||
if (this->spellCastEffectAttribute != null) {
|
||||
this->hasSpellCastEffect = true;
|
||||
}
|
||||
}
|
||||
void GenericAOESpell::StartCasting(WorldEntity* caster, float spellScale)
|
||||
{
|
||||
if ((this->genericSpellAttribute->NeedsTarget || this->damage) && !this->hasCastTime) {
|
||||
if (!SpellScript::CanCastTarget(caster, 0)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!SpellScript::CanCast(caster, 0)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
WorldEntity* worldEntity = null;
|
||||
if (this->genericSpellAttribute->NeedsTarget || this->damage) {
|
||||
worldEntity = SpellScript::GetTarget(caster);
|
||||
}
|
||||
if (!this->hasCastTime) {
|
||||
if (this->range && !SpellScript::isInRange(caster, worldEntity)) {
|
||||
return;
|
||||
}
|
||||
this->HandleSpellEffect(caster, worldEntity, spellScale);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if (!SpellScript::SpellCostCheck(caster)) {
|
||||
return;
|
||||
}
|
||||
SpellScript::DoStartCasting(caster, this->spellId, this->spell->NameKey, this->spell->CastTime, !this->genericSpellAttribute->CanMoveWhileCasting, spellScale);
|
||||
return;
|
||||
}
|
||||
}
|
||||
void GenericAOESpell::CastingFinished(WorldEntity* caster, float spellScale)
|
||||
{
|
||||
WorldEntity* worldEntity = null;
|
||||
if (this->genericSpellAttribute->NeedsTarget || this->damage) {
|
||||
worldEntity = SpellScript::GetTarget(caster);
|
||||
}
|
||||
if (this->genericSpellAttribute->NeedsTarget && (worldEntity == null)) {
|
||||
return;
|
||||
}
|
||||
if (this->range && !SpellScript::isInRange(caster, worldEntity)) {
|
||||
return;
|
||||
}
|
||||
this->HandleSpellEffect(caster, worldEntity, spellScale);
|
||||
if (this->hasCastTime && !this->genericSpellAttribute->CanMoveWhileCasting) {
|
||||
SpellScript::RemoveOnMoveHook(caster);
|
||||
}
|
||||
}
|
||||
void GenericAOESpell::SpellHit(WorldEntity* caster, WorldEntity* target, WorldSpell* worldSpell, Spell* spellGo, float spellScale)
|
||||
{
|
||||
if (target->CompareTag(new String("Player"))) {
|
||||
if (this->damage) {
|
||||
SpellScript::DealDamage(caster, target, spellScale);
|
||||
}
|
||||
if (this->heal) {
|
||||
SpellScript::Heal(caster, caster, spellScale);
|
||||
}
|
||||
if (this->spell->CasterAuraApply != 0) {
|
||||
SpellScript::ApplyAura(this->spell->CasterAuraApply, caster, spellScale);
|
||||
}
|
||||
if (this->spell->CasterAuraApply2 != 0) {
|
||||
SpellScript::ApplyAura(this->spell->CasterAuraApply2, caster, spellScale);
|
||||
}
|
||||
if (this->spell->TargetAuraApply != 0) {
|
||||
SpellScript::ApplyAura(this->spell->TargetAuraApply, target, spellScale);
|
||||
}
|
||||
if (this->spell->TargetAuraApply2 != 0) {
|
||||
SpellScript::ApplyAura(this->spell->TargetAuraApply2, target, spellScale);
|
||||
}
|
||||
}
|
||||
worldSpell->Destroy();
|
||||
}
|
||||
void GenericAOESpell::OnPlayerMove(Entity* caster)
|
||||
{
|
||||
SpellScript::DoCastFail((WorldEntity*)(caster), true);
|
||||
}
|
||||
void GenericAOESpell::HandleSpellEffect(WorldEntity* caster, WorldEntity* target, float spellScale)
|
||||
{
|
||||
if (!SpellScript::SpellCostCheckAndRemove(caster)) {
|
||||
return;
|
||||
}
|
||||
if (this->damage) {
|
||||
SpellScript::DealDamage(caster, target, spellScale);
|
||||
}
|
||||
if (this->heal) {
|
||||
SpellScript::Heal(caster, caster, spellScale);
|
||||
}
|
||||
if (this->spell->CasterAuraApply != 0) {
|
||||
SpellScript::ApplyAura(this->spell->CasterAuraApply, caster, spellScale);
|
||||
}
|
||||
if (this->spell->CasterAuraApply2 != 0) {
|
||||
SpellScript::ApplyAura(this->spell->CasterAuraApply2, caster, spellScale);
|
||||
}
|
||||
if (this->spell->TargetAuraApply != 0) {
|
||||
SpellScript::ApplyAura(this->spell->TargetAuraApply, target, spellScale);
|
||||
}
|
||||
if (this->spell->TargetAuraApply2 != 0) {
|
||||
SpellScript::ApplyAura(this->spell->TargetAuraApply2, target, spellScale);
|
||||
}
|
||||
if (this->spell->HasGlobalCooldown) {
|
||||
SpellScript::TriggerGlobalCooldown(caster);
|
||||
}
|
||||
SpellScript::SpellResourceGive(caster);
|
||||
if (this->hasCooldown) {
|
||||
SpellScript::AddCooldown(caster, this->spellId, this->spell->Cooldown);
|
||||
}
|
||||
SpellScript::SpellCastSuccess(caster);
|
||||
}
|
||||
void GenericAOESpell::COnSpellCastSuccess(WorldEntity* player)
|
||||
{
|
||||
if (!this->hasCastTime) {
|
||||
SpellScript::PlayStandardSpellCastFinish(player);
|
||||
return;
|
||||
}
|
||||
SpellScript::PlayStandardSpellCastFinish();
|
||||
}
|
||||
void GenericAOESpell::COnSpellCastStarted(WorldEntity* player)
|
||||
{
|
||||
if (this->hasSpellCastEffect) {
|
||||
SpellScript::AddSpellCastEffect(player);
|
||||
}
|
||||
}
|
||||
void GenericAOESpell::COnSpellCastEnded(WorldEntity* player)
|
||||
{
|
||||
if (this->hasSpellCastEffect) {
|
||||
SpellScript::RemoveSpellCastEffects(player);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
namespace SpellsNS {
|
||||
namespace generic {
|
||||
GenericAOESpell::GenericAOESpell(Spell *spell) :
|
||||
SpellScript(spell) {
|
||||
if (!Mathf::Approximately(spell->CastTime, (float)0)) {
|
||||
this->hasCastTime = true;
|
||||
}
|
||||
if (!Mathf::Approximately(spell->Cooldown, (float)0)) {
|
||||
this->hasCooldown = true;
|
||||
}
|
||||
this->genericSpellAttribute = spell->GenericSpellData;
|
||||
this->spellHealAttribute = spell->SpellHealData;
|
||||
if (this->spellHealAttribute != null) {
|
||||
this->heal = true;
|
||||
}
|
||||
if ((spell->DamageMin > 0) && (spell->DamageMax > 0)) {
|
||||
this->damage = true;
|
||||
}
|
||||
this->aoeAttrib = spell->SpellAOEData;
|
||||
if (this->aoeAttrib == null) {
|
||||
Debug::LogError((*(new String("Spell ")) + *(spell->name)) + *(new String(" doesn't have an AOEAttribute attached!")));
|
||||
}
|
||||
this->rangeAttrib = spell->SpellRangeData;
|
||||
if (this->rangeAttrib != null) {
|
||||
this->range = true;
|
||||
}
|
||||
this->spellCastEffectAttribute = spell->SpellCastEffectData;
|
||||
if (this->spellCastEffectAttribute != null) {
|
||||
this->hasSpellCastEffect = true;
|
||||
}
|
||||
}
|
||||
void GenericAOESpell::StartCasting(WorldEntity *caster, float spellScale) {
|
||||
if ((this->genericSpellAttribute->NeedsTarget || this->damage) && !this->hasCastTime) {
|
||||
if (!SpellScript::CanCastTarget(caster, 0)) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!SpellScript::CanCast(caster, 0)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
WorldEntity *worldEntity = null;
|
||||
if (this->genericSpellAttribute->NeedsTarget || this->damage) {
|
||||
worldEntity = SpellScript::GetTarget(caster);
|
||||
}
|
||||
if (!this->hasCastTime) {
|
||||
if (this->range && !SpellScript::isInRange(caster, worldEntity)) {
|
||||
return;
|
||||
}
|
||||
this->HandleSpellEffect(caster, worldEntity, spellScale);
|
||||
return;
|
||||
} else {
|
||||
if (!SpellScript::SpellCostCheck(caster)) {
|
||||
return;
|
||||
}
|
||||
SpellScript::DoStartCasting(caster, this->spellId, this->spell->NameKey, this->spell->CastTime, !this->genericSpellAttribute->CanMoveWhileCasting, spellScale);
|
||||
return;
|
||||
}
|
||||
}
|
||||
void GenericAOESpell::CastingFinished(WorldEntity *caster, float spellScale) {
|
||||
WorldEntity *worldEntity = null;
|
||||
if (this->genericSpellAttribute->NeedsTarget || this->damage) {
|
||||
worldEntity = SpellScript::GetTarget(caster);
|
||||
}
|
||||
if (this->genericSpellAttribute->NeedsTarget && (worldEntity == null)) {
|
||||
return;
|
||||
}
|
||||
if (this->range && !SpellScript::isInRange(caster, worldEntity)) {
|
||||
return;
|
||||
}
|
||||
this->HandleSpellEffect(caster, worldEntity, spellScale);
|
||||
if (this->hasCastTime && !this->genericSpellAttribute->CanMoveWhileCasting) {
|
||||
SpellScript::RemoveOnMoveHook(caster);
|
||||
}
|
||||
}
|
||||
void GenericAOESpell::SpellHit(WorldEntity *caster, WorldEntity *target, WorldSpell *worldSpell, Spell *spellGo, float spellScale) {
|
||||
if (target->CompareTag(new String("Player"))) {
|
||||
if (this->damage) {
|
||||
SpellScript::DealDamage(caster, target, spellScale);
|
||||
}
|
||||
if (this->heal) {
|
||||
SpellScript::Heal(caster, caster, spellScale);
|
||||
}
|
||||
if (this->spell->CasterAuraApply != 0) {
|
||||
SpellScript::ApplyAura(this->spell->CasterAuraApply, caster, spellScale);
|
||||
}
|
||||
if (this->spell->CasterAuraApply2 != 0) {
|
||||
SpellScript::ApplyAura(this->spell->CasterAuraApply2, caster, spellScale);
|
||||
}
|
||||
if (this->spell->TargetAuraApply != 0) {
|
||||
SpellScript::ApplyAura(this->spell->TargetAuraApply, target, spellScale);
|
||||
}
|
||||
if (this->spell->TargetAuraApply2 != 0) {
|
||||
SpellScript::ApplyAura(this->spell->TargetAuraApply2, target, spellScale);
|
||||
}
|
||||
}
|
||||
worldSpell->Destroy();
|
||||
}
|
||||
void GenericAOESpell::OnPlayerMove(Entity *caster) {
|
||||
SpellScript::DoCastFail((WorldEntity *)(caster), true);
|
||||
}
|
||||
void GenericAOESpell::HandleSpellEffect(WorldEntity *caster, WorldEntity *target, float spellScale) {
|
||||
if (!SpellScript::SpellCostCheckAndRemove(caster)) {
|
||||
return;
|
||||
}
|
||||
if (this->damage) {
|
||||
SpellScript::DealDamage(caster, target, spellScale);
|
||||
}
|
||||
if (this->heal) {
|
||||
SpellScript::Heal(caster, caster, spellScale);
|
||||
}
|
||||
if (this->spell->CasterAuraApply != 0) {
|
||||
SpellScript::ApplyAura(this->spell->CasterAuraApply, caster, spellScale);
|
||||
}
|
||||
if (this->spell->CasterAuraApply2 != 0) {
|
||||
SpellScript::ApplyAura(this->spell->CasterAuraApply2, caster, spellScale);
|
||||
}
|
||||
if (this->spell->TargetAuraApply != 0) {
|
||||
SpellScript::ApplyAura(this->spell->TargetAuraApply, target, spellScale);
|
||||
}
|
||||
if (this->spell->TargetAuraApply2 != 0) {
|
||||
SpellScript::ApplyAura(this->spell->TargetAuraApply2, target, spellScale);
|
||||
}
|
||||
if (this->spell->HasGlobalCooldown) {
|
||||
SpellScript::TriggerGlobalCooldown(caster);
|
||||
}
|
||||
SpellScript::SpellResourceGive(caster);
|
||||
if (this->hasCooldown) {
|
||||
SpellScript::AddCooldown(caster, this->spellId, this->spell->Cooldown);
|
||||
}
|
||||
SpellScript::SpellCastSuccess(caster);
|
||||
}
|
||||
void GenericAOESpell::COnSpellCastSuccess(WorldEntity *player) {
|
||||
if (!this->hasCastTime) {
|
||||
SpellScript::PlayStandardSpellCastFinish(player);
|
||||
return;
|
||||
}
|
||||
SpellScript::PlayStandardSpellCastFinish();
|
||||
}
|
||||
void GenericAOESpell::COnSpellCastStarted(WorldEntity *player) {
|
||||
if (this->hasSpellCastEffect) {
|
||||
SpellScript::AddSpellCastEffect(player);
|
||||
}
|
||||
}
|
||||
void GenericAOESpell::COnSpellCastEnded(WorldEntity *player) {
|
||||
if (this->hasSpellCastEffect) {
|
||||
SpellScript::RemoveSpellCastEffects(player);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace generic
|
||||
} // namespace SpellsNS
|
||||
} // namespace BS
|
||||
|
@ -1,74 +1,86 @@
|
||||
#pragma once
|
||||
#include <System/System.h>
|
||||
#include "SpellScript.h"
|
||||
#include "GenericSpellData.h"
|
||||
#include "SpellHealData.h"
|
||||
#include "SpellCastEffectData.h"
|
||||
#include "SpellAOEData.h"
|
||||
#include "SpellRangeData.h"
|
||||
#include "Spell.h"
|
||||
#include "Mathf.h"
|
||||
#include "Debug.h"
|
||||
#include "Entity.h"
|
||||
#include "GenericSpellData.h"
|
||||
#include "Mathf.h"
|
||||
#include "Spell.h"
|
||||
#include "SpellAOEData.h"
|
||||
#include "SpellCastEffectData.h"
|
||||
#include "SpellHealData.h"
|
||||
#include "SpellRangeData.h"
|
||||
#include "SpellScript.h"
|
||||
#include "WorldEntity.h"
|
||||
#include "WorldSpell.h"
|
||||
#include "Entity.h"
|
||||
#include <System/System.h>
|
||||
|
||||
using namespace UnityEngine;
|
||||
using namespace BS::Player;
|
||||
using namespace BS::SpellsNS::WorldSpells;
|
||||
using namespace System;
|
||||
namespace BS {
|
||||
namespace SpellsNS {
|
||||
namespace generic {
|
||||
class GenericAOESpell : public virtual SpellScript, public virtual Object
|
||||
{
|
||||
private:
|
||||
GenericSpellData* genericSpellAttribute;
|
||||
private:
|
||||
SpellHealData* spellHealAttribute;
|
||||
private:
|
||||
SpellCastEffectData* spellCastEffectAttribute;
|
||||
private:
|
||||
SpellAOEData* aoeAttrib;
|
||||
private:
|
||||
SpellRangeData* rangeAttrib;
|
||||
//Attribute: SerializeField*
|
||||
private:
|
||||
bool damage;
|
||||
//Attribute: SerializeField*
|
||||
private:
|
||||
bool heal;
|
||||
//Attribute: SerializeField*
|
||||
private:
|
||||
bool hasCooldown;
|
||||
//Attribute: SerializeField*
|
||||
private:
|
||||
bool hasCastTime;
|
||||
//Attribute: SerializeField*
|
||||
private:
|
||||
bool hasSpellCastEffect;
|
||||
//Attribute: SerializeField*
|
||||
private:
|
||||
bool range;
|
||||
public:
|
||||
GenericAOESpell(Spell* spell);
|
||||
public:
|
||||
virtual void StartCasting(WorldEntity* caster, float spellScale);
|
||||
public:
|
||||
virtual void CastingFinished(WorldEntity* caster, float spellScale);
|
||||
public:
|
||||
virtual void SpellHit(WorldEntity* caster, WorldEntity* target, WorldSpell* worldSpell, Spell* spellGo, float spellScale);
|
||||
public:
|
||||
virtual void OnPlayerMove(Entity* caster);
|
||||
private:
|
||||
void HandleSpellEffect(WorldEntity* caster, WorldEntity* target, float spellScale);
|
||||
public:
|
||||
virtual void COnSpellCastSuccess(WorldEntity* player);
|
||||
public:
|
||||
virtual void COnSpellCastStarted(WorldEntity* player);
|
||||
public:
|
||||
virtual void COnSpellCastEnded(WorldEntity* player);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
namespace SpellsNS {
|
||||
namespace generic {
|
||||
class GenericAOESpell : public virtual SpellScript, public virtual Object {
|
||||
private:
|
||||
GenericSpellData *genericSpellAttribute;
|
||||
|
||||
private:
|
||||
SpellHealData *spellHealAttribute;
|
||||
|
||||
private:
|
||||
SpellCastEffectData *spellCastEffectAttribute;
|
||||
|
||||
private:
|
||||
SpellAOEData *aoeAttrib;
|
||||
|
||||
private:
|
||||
SpellRangeData *rangeAttrib;
|
||||
//Attribute: SerializeField*
|
||||
private:
|
||||
bool damage;
|
||||
//Attribute: SerializeField*
|
||||
private:
|
||||
bool heal;
|
||||
//Attribute: SerializeField*
|
||||
private:
|
||||
bool hasCooldown;
|
||||
//Attribute: SerializeField*
|
||||
private:
|
||||
bool hasCastTime;
|
||||
//Attribute: SerializeField*
|
||||
private:
|
||||
bool hasSpellCastEffect;
|
||||
//Attribute: SerializeField*
|
||||
private:
|
||||
bool range;
|
||||
|
||||
public:
|
||||
GenericAOESpell(Spell *spell);
|
||||
|
||||
public:
|
||||
virtual void StartCasting(WorldEntity *caster, float spellScale);
|
||||
|
||||
public:
|
||||
virtual void CastingFinished(WorldEntity *caster, float spellScale);
|
||||
|
||||
public:
|
||||
virtual void SpellHit(WorldEntity *caster, WorldEntity *target, WorldSpell *worldSpell, Spell *spellGo, float spellScale);
|
||||
|
||||
public:
|
||||
virtual void OnPlayerMove(Entity *caster);
|
||||
|
||||
private:
|
||||
void HandleSpellEffect(WorldEntity *caster, WorldEntity *target, float spellScale);
|
||||
|
||||
public:
|
||||
virtual void COnSpellCastSuccess(WorldEntity *player);
|
||||
|
||||
public:
|
||||
virtual void COnSpellCastStarted(WorldEntity *player);
|
||||
|
||||
public:
|
||||
virtual void COnSpellCastEnded(WorldEntity *player);
|
||||
};
|
||||
} // namespace generic
|
||||
} // namespace SpellsNS
|
||||
} // namespace BS
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "../data/aura.h"
|
||||
|
||||
Entity *AuraApplyInfo::get_caster() const {
|
||||
return _caster;
|
||||
return _caster;
|
||||
}
|
||||
|
||||
void AuraApplyInfo::set_caster(Entity *value) {
|
||||
@ -11,21 +11,21 @@ void AuraApplyInfo::set_caster(Entity *value) {
|
||||
}
|
||||
|
||||
void AuraApplyInfo::set_caster_bind(Node *caster) {
|
||||
if (!caster) {
|
||||
return;
|
||||
}
|
||||
if (!caster) {
|
||||
return;
|
||||
}
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(caster);
|
||||
Entity *e = Object::cast_to<Entity>(caster);
|
||||
|
||||
if (!e) {
|
||||
return;
|
||||
}
|
||||
if (!e) {
|
||||
return;
|
||||
}
|
||||
|
||||
_caster = e;
|
||||
_caster = e;
|
||||
}
|
||||
|
||||
Entity *AuraApplyInfo::get_target() const {
|
||||
return _target;
|
||||
return _target;
|
||||
}
|
||||
|
||||
void AuraApplyInfo::set_target(Entity *value) {
|
||||
@ -33,34 +33,33 @@ void AuraApplyInfo::set_target(Entity *value) {
|
||||
}
|
||||
|
||||
void AuraApplyInfo::set_target_bind(Node *caster) {
|
||||
if (!caster) {
|
||||
return;
|
||||
}
|
||||
if (!caster) {
|
||||
return;
|
||||
}
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(caster);
|
||||
Entity *e = Object::cast_to<Entity>(caster);
|
||||
|
||||
if (!e) {
|
||||
return;
|
||||
}
|
||||
if (!e) {
|
||||
return;
|
||||
}
|
||||
|
||||
_target = e;
|
||||
_target = e;
|
||||
}
|
||||
|
||||
|
||||
float AuraApplyInfo::get_spell_scale() const {
|
||||
return _spell_scale;
|
||||
return _spell_scale;
|
||||
}
|
||||
|
||||
void AuraApplyInfo::set_spell_scale(float value) {
|
||||
_spell_scale = value;
|
||||
_spell_scale = value;
|
||||
}
|
||||
|
||||
Ref<Aura> AuraApplyInfo::get_aura() const {
|
||||
return Ref<Aura>(_aura);
|
||||
return Ref<Aura>(_aura);
|
||||
}
|
||||
|
||||
void AuraApplyInfo::set_aura(Ref<Aura> aura) {
|
||||
_aura = (*aura);
|
||||
_aura = (*aura);
|
||||
}
|
||||
|
||||
AuraApplyInfo::AuraApplyInfo() {
|
||||
@ -85,21 +84,19 @@ AuraApplyInfo::AuraApplyInfo(Entity *caster, Entity *target, float spell_scale)
|
||||
}
|
||||
|
||||
void AuraApplyInfo::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_caster"), &AuraApplyInfo::get_caster);
|
||||
ClassDB::bind_method(D_METHOD("set_caster", "caster"), &AuraApplyInfo::set_caster_bind);
|
||||
ClassDB::bind_method(D_METHOD("get_caster"), &AuraApplyInfo::get_caster);
|
||||
ClassDB::bind_method(D_METHOD("set_caster", "caster"), &AuraApplyInfo::set_caster_bind);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "caster", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), "set_caster", "get_caster");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_target"), &AuraApplyInfo::get_target);
|
||||
ClassDB::bind_method(D_METHOD("set_target", "target"), &AuraApplyInfo::set_target_bind);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "target", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), "set_target", "get_target");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_spell_scale"), &AuraApplyInfo::get_spell_scale);
|
||||
ClassDB::bind_method(D_METHOD("set_spell_scale", "value"), &AuraApplyInfo::set_spell_scale);
|
||||
ClassDB::bind_method(D_METHOD("get_spell_scale"), &AuraApplyInfo::get_spell_scale);
|
||||
ClassDB::bind_method(D_METHOD("set_spell_scale", "value"), &AuraApplyInfo::set_spell_scale);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "spell_scale"), "set_spell_scale", "get_spell_scale");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_aura"), &AuraApplyInfo::get_aura);
|
||||
ClassDB::bind_method(D_METHOD("set_aura", "aura"), &AuraApplyInfo::set_aura);
|
||||
ClassDB::bind_method(D_METHOD("get_aura"), &AuraApplyInfo::get_aura);
|
||||
ClassDB::bind_method(D_METHOD("set_aura", "aura"), &AuraApplyInfo::set_aura);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura", PROPERTY_HINT_RESOURCE_TYPE, "Aura"), "set_aura", "get_aura");
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef AURA_INFOS_H
|
||||
#define AURA_INFOS_H
|
||||
|
||||
#include "core/reference.h"
|
||||
#include "../entities/entity.h"
|
||||
#include "core/reference.h"
|
||||
|
||||
class Entity;
|
||||
class Aura;
|
||||
@ -39,5 +39,4 @@ private:
|
||||
Aura *_aura;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
//// SpellCastInfo ////
|
||||
|
||||
Entity *SpellCastInfo::get_caster() {
|
||||
Entity *SpellCastInfo::get_caster() {
|
||||
if (_caster && !ObjectDB::instance_validate(_caster)) {
|
||||
_caster = NULL;
|
||||
}
|
||||
@ -172,7 +172,6 @@ Dictionary SpellCastInfo::to_dict() {
|
||||
void SpellCastInfo::from_dict(const Dictionary &dict) {
|
||||
ERR_FAIL_COND(dict.empty());
|
||||
|
||||
|
||||
_has_cast_time = dict.get("has_cast_time", true);
|
||||
_cast_time = dict.get("cast_time", 0);
|
||||
|
||||
|
@ -19,40 +19,40 @@ public:
|
||||
bool add_item(Ref<ItemInstance> item);
|
||||
void add_item_at(int index, Ref<ItemInstance> item, bool signal = true);
|
||||
Ref<ItemInstance> get_item(const int index);
|
||||
Ref<ItemInstance> remove_item(const int index);
|
||||
void swap_items(const int item1_index, const int item2_index);
|
||||
Ref<ItemInstance> remove_item(const int index);
|
||||
void swap_items(const int item1_index, const int item2_index);
|
||||
void change_item_equip(int slot_id, Ref<ItemInstance> item);
|
||||
void set_item_count(int slot_id, int new_count);
|
||||
|
||||
bool can_add_item(Ref<ItemInstance> item);
|
||||
|
||||
|
||||
bool can_add_item(Ref<ItemInstance> item);
|
||||
|
||||
int get_item_count();
|
||||
int get_valid_item_count();
|
||||
|
||||
int get_size();
|
||||
void set_size(const int size);
|
||||
|
||||
bool is_full();
|
||||
bool is_overburdened();
|
||||
void set_size(const int size);
|
||||
|
||||
bool has_item(Ref<ItemTemplate> item, int count);
|
||||
bool is_full();
|
||||
bool is_overburdened();
|
||||
|
||||
bool has_item(Ref<ItemTemplate> item, int count);
|
||||
bool _has_item(Ref<ItemTemplate> item, int count);
|
||||
|
||||
void remove_items(Ref<ItemTemplate> item, int count);
|
||||
void _remove_items(Ref<ItemTemplate> item, int count);
|
||||
|
||||
|
||||
Dictionary to_dict();
|
||||
void from_dict(const Dictionary &dict);
|
||||
|
||||
Dictionary _to_dict();
|
||||
void _from_dict(const Dictionary &dict);
|
||||
|
||||
|
||||
Bag();
|
||||
~Bag();
|
||||
~Bag();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
|
||||
private:
|
||||
int _allowed_item_types;
|
||||
int _bag_size;
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "grid_bag.h"
|
||||
|
||||
#include "../data/item_template.h"
|
||||
#include "../data/item_instance.h"
|
||||
#include "../data/item_template.h"
|
||||
|
||||
int GridBag::get_allowed_item_types() const {
|
||||
return _allowed_item_types;
|
||||
@ -15,16 +15,16 @@ bool GridBag::add_item(Ref<ItemInstance> item) {
|
||||
ERR_FAIL_COND_V(!item.is_valid(), true);
|
||||
|
||||
Ref<ItemTemplate> item_template = item->get_item_template();
|
||||
|
||||
|
||||
ERR_FAIL_COND_V(!item_template.is_valid(), true);
|
||||
|
||||
|
||||
int _item_size_x = item_template->get_inventory_size_x();
|
||||
int _item_size_y = item_template->get_inventory_size_y();
|
||||
|
||||
|
||||
for (int x = 0; x < _size_x - _item_size_x; ++x) {
|
||||
for (int y = 0; y < _size_y - _item_size_y; ++y) {
|
||||
if (_space_map[x * _size_x + y] == 0) {
|
||||
|
||||
|
||||
bool found = true;
|
||||
for (int xx = x; xx < _item_size_x; ++xx) {
|
||||
for (int yy = y; yy < _item_size_y; ++yy) {
|
||||
@ -33,26 +33,24 @@ bool GridBag::add_item(Ref<ItemInstance> item) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!found)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (found) {
|
||||
item->set_inventory_position_x(x);
|
||||
item->set_inventory_position_y(y);
|
||||
|
||||
|
||||
_items.push_back(item);
|
||||
|
||||
|
||||
int index = _items.size() - 1;
|
||||
|
||||
|
||||
for (int xx = x; xx < _item_size_x; ++xx) {
|
||||
for (int yy = y; yy < _item_size_y; ++yy) {
|
||||
_space_map.set(xx * _size_x + yy, index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -67,17 +65,17 @@ bool GridBag::add_item_to_position(const int x, const int y, Ref<ItemInstance> i
|
||||
ERR_FAIL_COND_V(x > _size_x || y > _size_y, false);
|
||||
|
||||
Ref<ItemTemplate> item_template = item->get_item_template();
|
||||
|
||||
|
||||
ERR_FAIL_COND_V(!item_template.is_valid(), true);
|
||||
|
||||
|
||||
int _item_size_x = item_template->get_inventory_size_x();
|
||||
int _item_size_y = item_template->get_inventory_size_y();
|
||||
|
||||
|
||||
ERR_FAIL_COND_V(x + _item_size_x > _size_x || y + _item_size_y > _size_y, false);
|
||||
|
||||
|
||||
int sx = x + _item_size_x;
|
||||
int sy = y + _item_size_y;
|
||||
|
||||
|
||||
for (int xx = x; xx < sx; ++xx) {
|
||||
for (int yy = y; yy < sy; ++yy) {
|
||||
if (_space_map[xx * _size_x + yy] != 0) {
|
||||
@ -85,14 +83,14 @@ bool GridBag::add_item_to_position(const int x, const int y, Ref<ItemInstance> i
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
item->set_inventory_position_x(x);
|
||||
item->set_inventory_position_y(y);
|
||||
|
||||
|
||||
_items.push_back(item);
|
||||
|
||||
|
||||
int index = _items.size() - 1;
|
||||
|
||||
|
||||
for (int xx = x; xx < sx; ++xx) {
|
||||
for (int yy = y; yy < sy; ++yy) {
|
||||
_space_map.set(xx * _size_x + yy, index);
|
||||
@ -106,12 +104,12 @@ bool GridBag::can_add_item_at(const int x, const int y, const Ref<ItemInstance>
|
||||
ERR_FAIL_COND_V(!item.is_valid(), false);
|
||||
ERR_FAIL_COND_V(x < 0 || y < 0, false);
|
||||
ERR_FAIL_COND_V(x > _size_x || y > _size_y, false);
|
||||
|
||||
|
||||
int indx = _space_map[x * _size_x + y];
|
||||
|
||||
|
||||
if (indx != 0) {
|
||||
Ref<ItemInstance> it = _items[indx];
|
||||
|
||||
|
||||
if (it.is_valid()) {
|
||||
if (it->get_item_template() == item->get_item_template()) {
|
||||
//todo check stacks
|
||||
@ -119,19 +117,19 @@ bool GridBag::can_add_item_at(const int x, const int y, const Ref<ItemInstance>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ref<ItemTemplate> item_template = item->get_item_template();
|
||||
|
||||
|
||||
ERR_FAIL_COND_V(!item_template.is_valid(), true);
|
||||
|
||||
|
||||
int _item_size_x = item_template->get_inventory_size_x();
|
||||
int _item_size_y = item_template->get_inventory_size_y();
|
||||
|
||||
|
||||
ERR_FAIL_COND_V(x + _item_size_x > _size_x || y + _item_size_y > _size_y, false);
|
||||
|
||||
|
||||
int sx = x + _item_size_x;
|
||||
int sy = y + _item_size_y;
|
||||
|
||||
|
||||
for (int xx = x; xx < sx; ++xx) {
|
||||
for (int yy = y; yy < sy; ++yy) {
|
||||
if (_space_map[xx * _size_x + yy] != 0) {
|
||||
@ -139,27 +137,26 @@ bool GridBag::can_add_item_at(const int x, const int y, const Ref<ItemInstance>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
int GridBag::item_count_under_area(const int x, const int y, const int size_x, const int size_y) const {
|
||||
ERR_FAIL_COND_V(x < 0 || y < 0, false);
|
||||
ERR_FAIL_COND_V(x > _size_x || y > _size_y, false);
|
||||
|
||||
|
||||
ERR_FAIL_COND_V(x + size_x > _size_x || y + size_y > _size_y, false);
|
||||
|
||||
|
||||
int count = 0;
|
||||
int sx = x + size_x;
|
||||
int sy = y + size_y;
|
||||
|
||||
|
||||
for (int xx = x; xx < sx; ++xx) {
|
||||
for (int yy = y; yy < sy; ++yy) {
|
||||
if (_space_map[xx * _size_x + yy] != 0) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
@ -173,33 +170,33 @@ Ref<ItemInstance> GridBag::get_and_remove_item(const int index) {
|
||||
ERR_FAIL_INDEX_V(index, _items.size(), Ref<ItemInstance>(NULL));
|
||||
|
||||
Ref<ItemInstance> item = _items.get(index);
|
||||
|
||||
|
||||
_items.remove(index);
|
||||
|
||||
|
||||
//Go over everything, to make sure item site changes won't cause bugs.
|
||||
for (int x = 0; x < _size_x; ++x) {
|
||||
for (int y = 0; y < _size_y ; ++y) {
|
||||
for (int y = 0; y < _size_y; ++y) {
|
||||
int indx = x * _size_x + y;
|
||||
|
||||
|
||||
if (_space_map[indx] == index) {
|
||||
_space_map.set(indx, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return item;
|
||||
return item;
|
||||
}
|
||||
|
||||
void GridBag::remove_item(const int index) {
|
||||
ERR_FAIL_INDEX(index, _items.size());
|
||||
|
||||
_items.remove(index);
|
||||
|
||||
|
||||
//Go over everything, to make sure item site changes won't cause bugs.
|
||||
for (int x = 0; x < _size_x; ++x) {
|
||||
for (int y = 0; y < _size_y ; ++y) {
|
||||
for (int y = 0; y < _size_y; ++y) {
|
||||
int indx = x * _size_x + y;
|
||||
|
||||
|
||||
if (_space_map[indx] == index) {
|
||||
_space_map.set(indx, 0);
|
||||
}
|
||||
@ -210,7 +207,7 @@ void GridBag::remove_item(const int index) {
|
||||
void GridBag::basic_add_item(const Ref<ItemInstance> item) {
|
||||
_items.push_back(item);
|
||||
}
|
||||
void GridBag::basic_remove_item(const int index){
|
||||
void GridBag::basic_remove_item(const int index) {
|
||||
_items.remove(index);
|
||||
}
|
||||
|
||||
@ -233,14 +230,14 @@ int GridBag::get_size_y() const {
|
||||
}
|
||||
|
||||
void GridBag::set_size(const int x, const int y) {
|
||||
ERR_FAIL_COND(x == 0 || y == 0);
|
||||
ERR_FAIL_COND(x == 0 || y == 0);
|
||||
ERR_FAIL_COND(_size_x != 0 || _size_y != 0);
|
||||
|
||||
_size_x = x;
|
||||
_size_y = y;
|
||||
|
||||
|
||||
_space_map.resize(x * y);
|
||||
|
||||
|
||||
for (int i = 0; i < _space_map.size(); ++i) {
|
||||
_space_map.set(i, 0);
|
||||
}
|
||||
@ -248,7 +245,7 @@ void GridBag::set_size(const int x, const int y) {
|
||||
|
||||
GridBag::GridBag() {
|
||||
_allowed_item_types = 0x1FFF;
|
||||
|
||||
|
||||
_size_x = 0;
|
||||
_size_y = 0;
|
||||
}
|
||||
@ -262,28 +259,27 @@ void GridBag::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_allowed_item_types"), &GridBag::get_allowed_item_types);
|
||||
ClassDB::bind_method(D_METHOD("set_allowed_item_types", "count"), &GridBag::set_allowed_item_types);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "allowed_item_types", PROPERTY_HINT_FLAGS, ItemEnums::BINDING_STRING_ITEM_TYPE_FLAGS), "set_allowed_item_types", "get_allowed_item_types");
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("add_item", "item"), &GridBag::add_item);
|
||||
ClassDB::bind_method(D_METHOD("add_item_to_position", "x", "y", "item"), &GridBag::add_item_to_position);
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("can_add_item_at", "x", "y", "item"), &GridBag::can_add_item_at);
|
||||
ClassDB::bind_method(D_METHOD("item_count_under_area", "x", "y", "item"), &GridBag::item_count_under_area);
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_item", "index"), &GridBag::get_item);
|
||||
ClassDB::bind_method(D_METHOD("get_and_remove_item", "index"), &GridBag::get_and_remove_item);
|
||||
ClassDB::bind_method(D_METHOD("remove_item", "index"), &GridBag::remove_item);
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("basic_add_item", "item"), &GridBag::basic_add_item);
|
||||
ClassDB::bind_method(D_METHOD("basic_remove_item", "index"), &GridBag::basic_remove_item);
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_item_count"), &GridBag::get_item_count);
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_space_map_entry", "index"), &GridBag::get_space_map_entry);
|
||||
ClassDB::bind_method(D_METHOD("set_space_map_entry", "index", "value"), &GridBag::set_space_map_entry);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_size_x"), &GridBag::get_size_x);
|
||||
ClassDB::bind_method(D_METHOD("get_size_y"), &GridBag::get_size_y);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_size", "x", "y"), &GridBag::set_size);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_size", "x", "y"), &GridBag::set_size);
|
||||
}
|
||||
|
@ -15,45 +15,45 @@ class GridBag : public Reference {
|
||||
public:
|
||||
int get_allowed_item_types() const;
|
||||
void set_allowed_item_types(const int value);
|
||||
|
||||
|
||||
bool add_item(Ref<ItemInstance> item);
|
||||
bool add_item_to_position(const int x, const int y, Ref<ItemInstance> item);
|
||||
|
||||
|
||||
bool can_add_item_at(const int x, const int y, const Ref<ItemInstance> item) const;
|
||||
int item_count_under_area(const int x, const int y, const int size_x, const int size_y) const;
|
||||
|
||||
|
||||
Ref<ItemInstance> get_item(const int index) const;
|
||||
Ref<ItemInstance> get_and_remove_item(const int index);
|
||||
Ref<ItemInstance> get_and_remove_item(const int index);
|
||||
void remove_item(const int index);
|
||||
|
||||
|
||||
void basic_add_item(const Ref<ItemInstance> item);
|
||||
void basic_remove_item(const int index);
|
||||
|
||||
|
||||
int get_item_count() const;
|
||||
|
||||
int get_space_map_entry(const int index) const;
|
||||
void set_space_map_entry(const int index, const int value);
|
||||
|
||||
|
||||
int get_size_x() const;
|
||||
int get_size_y() const;
|
||||
|
||||
void set_size(const int x, const int y);
|
||||
|
||||
|
||||
void set_size(const int x, const int y);
|
||||
|
||||
//to_dict();
|
||||
//from_dict();
|
||||
|
||||
|
||||
GridBag();
|
||||
~GridBag();
|
||||
~GridBag();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
|
||||
private:
|
||||
int _allowed_item_types;
|
||||
|
||||
|
||||
int _size_x;
|
||||
int _size_y;
|
||||
|
||||
|
||||
Vector<Ref<ItemInstance> > _items;
|
||||
Vector<int> _space_map;
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "inventory.h"
|
||||
|
||||
#include "../data/item_template.h"
|
||||
#include "../data/item_instance.h"
|
||||
#include "../data/item_template.h"
|
||||
|
||||
#include "../entities/player.h"
|
||||
|
||||
@ -14,7 +14,7 @@ void Inventory::set_allowed_item_types(const int value) {
|
||||
}
|
||||
|
||||
Player *Inventory::get_target() const {
|
||||
return _target;
|
||||
return _target;
|
||||
}
|
||||
|
||||
void Inventory::set_target(Player *value) {
|
||||
@ -22,17 +22,17 @@ void Inventory::set_target(Player *value) {
|
||||
}
|
||||
|
||||
void Inventory::set_target_bind(Node *caster) {
|
||||
if (!caster) {
|
||||
return;
|
||||
}
|
||||
if (!caster) {
|
||||
return;
|
||||
}
|
||||
|
||||
Player *e = Object::cast_to<Player>(caster);
|
||||
Player *e = Object::cast_to<Player>(caster);
|
||||
|
||||
if (!e) {
|
||||
return;
|
||||
}
|
||||
if (!e) {
|
||||
return;
|
||||
}
|
||||
|
||||
_target = e;
|
||||
_target = e;
|
||||
}
|
||||
|
||||
Inventory::Inventory() {
|
||||
@ -43,14 +43,13 @@ Inventory::~Inventory() {
|
||||
}
|
||||
|
||||
void Inventory::_bind_methods() {
|
||||
ADD_SIGNAL(MethodInfo("changed", PropertyInfo(Variant::OBJECT, "inventory", PROPERTY_HINT_RESOURCE_TYPE, "Inventory")));
|
||||
|
||||
ADD_SIGNAL(MethodInfo("changed", PropertyInfo(Variant::OBJECT, "inventory", PROPERTY_HINT_RESOURCE_TYPE, "Inventory")));
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_allowed_item_types"), &Inventory::get_allowed_item_types);
|
||||
ClassDB::bind_method(D_METHOD("set_allowed_item_types", "count"), &Inventory::set_allowed_item_types);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "allowed_item_types", PROPERTY_HINT_FLAGS, ItemEnums::BINDING_STRING_ITEM_TYPE_FLAGS), "set_allowed_item_types", "get_allowed_item_types");
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_target"), &Inventory::get_target);
|
||||
ClassDB::bind_method(D_METHOD("set_target", "target"), &Inventory::set_target_bind);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "target", PROPERTY_HINT_RESOURCE_TYPE, "Player"), "set_target", "get_target");
|
||||
}
|
||||
|
||||
|
@ -16,17 +16,17 @@ class Inventory : public Reference {
|
||||
public:
|
||||
int get_allowed_item_types() const;
|
||||
void set_allowed_item_types(const int value);
|
||||
|
||||
|
||||
Player *get_target() const;
|
||||
void set_target(Player *caster);
|
||||
void set_target_bind(Node *caster);
|
||||
|
||||
|
||||
Inventory();
|
||||
~Inventory();
|
||||
~Inventory();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
|
||||
private:
|
||||
Player *_target;
|
||||
int _allowed_item_types;
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "bag.h"
|
||||
|
||||
#include "../data/item_template.h"
|
||||
#include "../data/item_instance.h"
|
||||
#include "../data/item_template.h"
|
||||
|
||||
int Bag::get_allowed_item_types() const {
|
||||
return _allowed_item_types;
|
||||
@ -12,10 +12,8 @@ void Bag::set_allowed_item_types(const int value) {
|
||||
}
|
||||
|
||||
bool Bag::add_item(Ref<ItemInstance> item) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
Ref<ItemInstance> Bag::get_item(const int index) const {
|
||||
ERR_FAIL_INDEX_V(index, _items.size(), Ref<ItemInstance>(NULL));
|
||||
|
||||
@ -26,54 +24,51 @@ Ref<ItemInstance> Bag::remove_item(const int index) {
|
||||
ERR_FAIL_INDEX_V(index, _items.size(), Ref<ItemInstance>(NULL));
|
||||
|
||||
Ref<ItemInstance> item = _items.get(index);
|
||||
|
||||
|
||||
_items.remove(index);
|
||||
|
||||
|
||||
//Go over everything, to make sure item site changes won't cause bugs.
|
||||
for (int x = 0; x < _size_x; ++x) {
|
||||
for (int y = 0; y < _size_y ; ++y) {
|
||||
for (int y = 0; y < _size_y; ++y) {
|
||||
int indx = x * _size_x + y;
|
||||
|
||||
|
||||
if (_space_map[indx] == index) {
|
||||
_space_map.set(indx, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return item;
|
||||
return item;
|
||||
}
|
||||
|
||||
bool Bag::can_add_item(const Ref<ItemInstance> item) const {
|
||||
|
||||
}
|
||||
|
||||
int Bag::get_item_count() const {
|
||||
return _items.size();
|
||||
}
|
||||
|
||||
|
||||
int Bag::get_size() const {
|
||||
return _items.size();
|
||||
}
|
||||
|
||||
void Bag::set_size(const int x, const int y) {
|
||||
ERR_FAIL_COND(x == 0 || y == 0);
|
||||
ERR_FAIL_COND(x == 0 || y == 0);
|
||||
ERR_FAIL_COND(_size_x != 0 || _size_y != 0);
|
||||
|
||||
_size_x = x;
|
||||
_size_y = y;
|
||||
|
||||
|
||||
_space_map.resize(x * y);
|
||||
|
||||
|
||||
for (int i = 0; i < _space_map.size(); ++i) {
|
||||
_space_map.set(i, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Bag::Bag() {
|
||||
_allowed_item_types = 0x1FFF;
|
||||
|
||||
|
||||
_size = 0;
|
||||
}
|
||||
|
||||
@ -85,28 +80,27 @@ void Bag::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_allowed_item_types"), &Bag::get_allowed_item_types);
|
||||
ClassDB::bind_method(D_METHOD("set_allowed_item_types", "count"), &Bag::set_allowed_item_types);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "allowed_item_types", PROPERTY_HINT_FLAGS, ItemEnums::BINDING_STRING_ITEM_TYPE_FLAGS), "set_allowed_item_types", "get_allowed_item_types");
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("add_item", "item"), &Bag::add_item);
|
||||
ClassDB::bind_method(D_METHOD("add_item_to_position", "x", "y", "item"), &Bag::add_item_to_position);
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("can_add_item_at", "x", "y", "item"), &Bag::can_add_item_at);
|
||||
ClassDB::bind_method(D_METHOD("item_count_under_area", "x", "y", "item"), &Bag::item_count_under_area);
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_item", "index"), &Bag::get_item);
|
||||
ClassDB::bind_method(D_METHOD("get_and_remove_item", "index"), &Bag::get_and_remove_item);
|
||||
ClassDB::bind_method(D_METHOD("remove_item", "index"), &Bag::remove_item);
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("basic_add_item", "item"), &Bag::basic_add_item);
|
||||
ClassDB::bind_method(D_METHOD("basic_remove_item", "index"), &Bag::basic_remove_item);
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_item_count"), &Bag::get_item_count);
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_space_map_entry", "index"), &Bag::get_space_map_entry);
|
||||
ClassDB::bind_method(D_METHOD("set_space_map_entry", "index", "value"), &Bag::set_space_map_entry);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_size_x"), &Bag::get_size_x);
|
||||
ClassDB::bind_method(D_METHOD("get_size_y"), &Bag::get_size_y);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_size", "x", "y"), &Bag::set_size);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_size", "x", "y"), &Bag::set_size);
|
||||
}
|
||||
|
@ -15,32 +15,32 @@ class Bag : public Reference {
|
||||
public:
|
||||
int get_allowed_item_types() const;
|
||||
void set_allowed_item_types(const int value);
|
||||
|
||||
|
||||
bool add_item(Ref<ItemInstance> item);
|
||||
Ref<ItemInstance> get_item(const int index) const;
|
||||
Ref<ItemInstance> remove_item(const int index);
|
||||
|
||||
bool can_add_item(Ref<ItemInstance> item);
|
||||
|
||||
Ref<ItemInstance> remove_item(const int index);
|
||||
|
||||
bool can_add_item(Ref<ItemInstance> item);
|
||||
|
||||
int get_item_count() const;
|
||||
|
||||
int get_size() const;
|
||||
void set_size(const int size);
|
||||
|
||||
bool is_full() const;
|
||||
|
||||
void set_size(const int size);
|
||||
|
||||
bool is_full() const;
|
||||
|
||||
//to_dict();
|
||||
//from_dict();
|
||||
|
||||
|
||||
Bag();
|
||||
~Bag();
|
||||
~Bag();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
|
||||
private:
|
||||
int _allowed_item_types;
|
||||
int _item_count;
|
||||
int _item_count;
|
||||
Vector<Ref<ItemInstance> > _items;
|
||||
};
|
||||
|
||||
|
10
item_enums.h
10
item_enums.h
@ -17,7 +17,7 @@ public:
|
||||
static const String BINDING_STRING_EQUIP_SLOTS;
|
||||
static const String BINDING_STRING_ARMOR_TYPE;
|
||||
static const String BINDING_STRING_ENTITY_TEXTURE_LAYERS;
|
||||
|
||||
|
||||
enum ItemRarity {
|
||||
ITEM_RARITY_NONE = 0,
|
||||
ITEM_RARITY_COMMON = 1,
|
||||
@ -27,7 +27,7 @@ public:
|
||||
ITEM_RARITY_MYTHIC = 5,
|
||||
ITEM_RARITY_ARTIFACT = 6,
|
||||
};
|
||||
|
||||
|
||||
enum ItemRarityFlag {
|
||||
ITEM_RARITY_FLAG_NONE = 0,
|
||||
ITEM_RARITY_FLAG_COMMON = 1 << 0,
|
||||
@ -37,7 +37,7 @@ public:
|
||||
ITEM_RARITY_FLAG_MYTHIC = 1 << 4,
|
||||
ITEM_RARITY_FLAG_ARTIFACT = 1 << 5,
|
||||
};
|
||||
|
||||
|
||||
enum ItemType {
|
||||
ITEM_TYPE_NONE = 0,
|
||||
ITEM_TYPE_EQUIPMENT = 1 << 0,
|
||||
@ -139,7 +139,7 @@ protected:
|
||||
BIND_ENUM_CONSTANT(ITEM_RARITY_HEROIC);
|
||||
BIND_ENUM_CONSTANT(ITEM_RARITY_MYTHIC);
|
||||
BIND_ENUM_CONSTANT(ITEM_RARITY_ARTIFACT);
|
||||
|
||||
|
||||
BIND_ENUM_CONSTANT(ITEM_RARITY_FLAG_NONE);
|
||||
BIND_ENUM_CONSTANT(ITEM_RARITY_FLAG_COMMON);
|
||||
BIND_ENUM_CONSTANT(ITEM_RARITY_FLAG_UNCOMMON);
|
||||
@ -147,7 +147,7 @@ protected:
|
||||
BIND_ENUM_CONSTANT(ITEM_RARITY_FLAG_HEROIC);
|
||||
BIND_ENUM_CONSTANT(ITEM_RARITY_FLAG_MYTHIC);
|
||||
BIND_ENUM_CONSTANT(ITEM_RARITY_FLAG_ARTIFACT);
|
||||
|
||||
|
||||
BIND_ENUM_CONSTANT(ITEM_TYPE_NONE);
|
||||
BIND_ENUM_CONSTANT(ITEM_TYPE_EQUIPMENT);
|
||||
BIND_ENUM_CONSTANT(ITEM_TYPE_WEAPON);
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef LOOT_DATA_CONTAINER_H
|
||||
#define LOOT_DATA_CONTAINER_H
|
||||
|
||||
#include "loot_data_base.h"
|
||||
#include "core/vector.h"
|
||||
#include "loot_data_base.h"
|
||||
|
||||
class LootDataContainter : public LootDataBase {
|
||||
GDCLASS(LootDataContainter, LootDataBase);
|
||||
|
@ -20,7 +20,6 @@ void LootDataItem::_get_loot(Array into) {
|
||||
}
|
||||
|
||||
LootDataItem::LootDataItem() {
|
||||
|
||||
}
|
||||
|
||||
void LootDataItem::_bind_methods() {
|
||||
|
@ -5,7 +5,6 @@
|
||||
|
||||
#include "loot_data_base.h"
|
||||
|
||||
|
||||
class LootDataItem : public LootDataBase {
|
||||
GDCLASS(LootDataItem, LootDataBase);
|
||||
|
||||
|
@ -206,10 +206,10 @@ SpellHealInfo::~SpellHealInfo() {
|
||||
}
|
||||
|
||||
void SpellHealInfo::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_immune"), &SpellHealInfo::get_immune);
|
||||
ClassDB::bind_method(D_METHOD("get_immune"), &SpellHealInfo::get_immune);
|
||||
ClassDB::bind_method(D_METHOD("set_immune", "value"), &SpellHealInfo::set_immune);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "immune"), "set_immune", "get_immune");
|
||||
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_heal"), &SpellHealInfo::get_heal);
|
||||
ClassDB::bind_method(D_METHOD("set_heal", "value"), &SpellHealInfo::set_heal);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "heal"), "set_heal", "get_heal");
|
||||
|
@ -23,9 +23,9 @@ protected:
|
||||
static void _bind_methods();
|
||||
|
||||
public:
|
||||
bool get_immune();
|
||||
bool get_immune();
|
||||
void set_immune(bool value);
|
||||
|
||||
|
||||
int get_heal();
|
||||
void set_heal(int value);
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef ACTION_BAR_BUTTON_ENTRY_H
|
||||
#define ACTION_BAR_BUTTON_ENTRY_H
|
||||
|
||||
#include "core/reference.h"
|
||||
#include "core/dictionary.h"
|
||||
#include "core/reference.h"
|
||||
|
||||
class ActionBarButtonEntry : public Reference {
|
||||
GDCLASS(ActionBarButtonEntry, Reference);
|
||||
|
@ -52,7 +52,7 @@ Ref<ActionBarButtonEntry> ActionBarEntry::get_button(int index) {
|
||||
return _button_entries.get(index);
|
||||
}
|
||||
|
||||
Dictionary ActionBarEntry::to_dict() const {
|
||||
Dictionary ActionBarEntry::to_dict() const {
|
||||
Dictionary dict;
|
||||
|
||||
dict["action_bar_id"] = _action_bar_id;
|
||||
@ -77,13 +77,13 @@ void ActionBarEntry::from_dict(const Dictionary &dict) {
|
||||
|
||||
_action_bar_id = dict.get("action_bar_id", 0);
|
||||
_slot_num = dict.get("slot_num", 0);
|
||||
|
||||
|
||||
Array arr = dict.get("button_entries", Array());
|
||||
|
||||
for (int i = 0; i < arr.size(); ++i) {
|
||||
Ref<ActionBarButtonEntry> e;
|
||||
e.instance();
|
||||
|
||||
|
||||
e->from_dict(arr.get(i));
|
||||
|
||||
_button_entries.push_back(e);
|
||||
|
@ -1,10 +1,10 @@
|
||||
#ifndef ACTION_BAR_ENTRY_H
|
||||
#define ACTION_BAR_ENTRY_H
|
||||
|
||||
#include "core/array.h"
|
||||
#include "core/dictionary.h"
|
||||
#include "core/reference.h"
|
||||
#include "core/vector.h"
|
||||
#include "core/dictionary.h"
|
||||
#include "core/array.h"
|
||||
|
||||
#include "action_bar_button_entry.h"
|
||||
|
||||
|
@ -130,4 +130,3 @@ void ActionBarProfile::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("from_actionbar_profile", "other"), &ActionBarProfile::from_actionbar_profile);
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
#ifndef ACTION_BAR_PROFILE_H
|
||||
#define ACTION_BAR_PROFILE_H
|
||||
|
||||
#include "core/array.h"
|
||||
#include "core/dictionary.h"
|
||||
#include "core/reference.h"
|
||||
#include "core/ustring.h"
|
||||
#include "core/vector.h"
|
||||
#include "core/dictionary.h"
|
||||
#include "core/array.h"
|
||||
|
||||
#include "action_bar_entry.h"
|
||||
|
||||
|
@ -1,43 +1,35 @@
|
||||
#include "class_profile.h"
|
||||
|
||||
|
||||
int ClassProfile::get_class_id() {
|
||||
return _class_id;
|
||||
return _class_id;
|
||||
}
|
||||
|
||||
void ClassProfile::set_class_id(int value)
|
||||
{
|
||||
_class_id = value;
|
||||
void ClassProfile::set_class_id(int value) {
|
||||
_class_id = value;
|
||||
}
|
||||
|
||||
String ClassProfile::get_character_class_name()
|
||||
{
|
||||
return _character_class_name;
|
||||
String ClassProfile::get_character_class_name() {
|
||||
return _character_class_name;
|
||||
}
|
||||
|
||||
void ClassProfile::set_character_class_name(String value)
|
||||
{
|
||||
_character_class_name = value;
|
||||
void ClassProfile::set_character_class_name(String value) {
|
||||
_character_class_name = value;
|
||||
}
|
||||
|
||||
int ClassProfile::get_level()
|
||||
{
|
||||
return _level;
|
||||
int ClassProfile::get_level() {
|
||||
return _level;
|
||||
}
|
||||
|
||||
void ClassProfile::set_level(int value)
|
||||
{
|
||||
_level = value;
|
||||
void ClassProfile::set_level(int value) {
|
||||
_level = value;
|
||||
}
|
||||
|
||||
int ClassProfile::get_xp()
|
||||
{
|
||||
return _xp;
|
||||
int ClassProfile::get_xp() {
|
||||
return _xp;
|
||||
}
|
||||
|
||||
void ClassProfile::set_xp(int value)
|
||||
{
|
||||
_xp = value;
|
||||
void ClassProfile::set_xp(int value) {
|
||||
_xp = value;
|
||||
}
|
||||
|
||||
bool ClassProfile::get_actionbar_locked() {
|
||||
@ -47,13 +39,11 @@ void ClassProfile::set_actionbar_locked(bool value) {
|
||||
_actionbar_locked = value;
|
||||
}
|
||||
|
||||
Ref<InputProfile> ClassProfile::get_input_profile()
|
||||
{
|
||||
return _input_profile;
|
||||
Ref<InputProfile> ClassProfile::get_input_profile() {
|
||||
return _input_profile;
|
||||
}
|
||||
Ref<ActionBarProfile> ClassProfile::get_action_bar_profile()
|
||||
{
|
||||
return _action_bar_profile;
|
||||
Ref<ActionBarProfile> ClassProfile::get_action_bar_profile() {
|
||||
return _action_bar_profile;
|
||||
}
|
||||
|
||||
Dictionary ClassProfile::get_custom_data() {
|
||||
@ -91,10 +81,9 @@ void ClassProfile::from_dict(const Dictionary &dict) {
|
||||
_custom_data = dict.get("custom_data", Dictionary());
|
||||
}
|
||||
|
||||
ClassProfile::ClassProfile()
|
||||
{
|
||||
_action_bar_profile = Ref<ActionBarProfile>(memnew( ActionBarProfile()));
|
||||
_input_profile = Ref<InputProfile>(memnew(InputProfile()));
|
||||
ClassProfile::ClassProfile() {
|
||||
_action_bar_profile = Ref<ActionBarProfile>(memnew(ActionBarProfile()));
|
||||
_input_profile = Ref<InputProfile>(memnew(InputProfile()));
|
||||
|
||||
_class_id = 0;
|
||||
_level = 0;
|
||||
@ -102,41 +91,37 @@ ClassProfile::ClassProfile()
|
||||
_actionbar_locked = false;
|
||||
}
|
||||
|
||||
ClassProfile::ClassProfile(int class_id)
|
||||
{
|
||||
_action_bar_profile = Ref<ActionBarProfile>(memnew( ActionBarProfile()));
|
||||
_input_profile = Ref<InputProfile>(memnew(InputProfile()));
|
||||
ClassProfile::ClassProfile(int class_id) {
|
||||
_action_bar_profile = Ref<ActionBarProfile>(memnew(ActionBarProfile()));
|
||||
_input_profile = Ref<InputProfile>(memnew(InputProfile()));
|
||||
|
||||
_class_id = class_id;
|
||||
_level = 50;
|
||||
_xp = 0;
|
||||
_class_id = class_id;
|
||||
_level = 50;
|
||||
_xp = 0;
|
||||
_actionbar_locked = false;
|
||||
load_defaults();
|
||||
load_defaults();
|
||||
}
|
||||
|
||||
ClassProfile::ClassProfile(String class_name, int class_id, int level, int xp, bool locked, bool pload_defaults)
|
||||
{
|
||||
_action_bar_profile = Ref<ActionBarProfile>(memnew( ActionBarProfile()));
|
||||
_input_profile = Ref<InputProfile>(memnew(InputProfile()));
|
||||
ClassProfile::ClassProfile(String class_name, int class_id, int level, int xp, bool locked, bool pload_defaults) {
|
||||
_action_bar_profile = Ref<ActionBarProfile>(memnew(ActionBarProfile()));
|
||||
_input_profile = Ref<InputProfile>(memnew(InputProfile()));
|
||||
|
||||
_character_class_name = class_name;
|
||||
_class_id = class_id;
|
||||
_level = level;
|
||||
_xp = xp;
|
||||
_class_id = class_id;
|
||||
_level = level;
|
||||
_xp = xp;
|
||||
_actionbar_locked = true;
|
||||
|
||||
if (pload_defaults) {
|
||||
load_defaults();
|
||||
}
|
||||
if (pload_defaults) {
|
||||
load_defaults();
|
||||
}
|
||||
}
|
||||
|
||||
void ClassProfile::load_defaults()
|
||||
{
|
||||
_action_bar_profile->load_defaults();
|
||||
void ClassProfile::load_defaults() {
|
||||
_action_bar_profile->load_defaults();
|
||||
}
|
||||
|
||||
void ClassProfile::_bind_methods()
|
||||
{
|
||||
void ClassProfile::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_class_id"), &ClassProfile::get_class_id);
|
||||
ClassDB::bind_method(D_METHOD("set_class_id", "value"), &ClassProfile::set_class_id);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "class_id"), "set_class_id", "get_class_id");
|
||||
@ -163,5 +148,3 @@ void ClassProfile::_bind_methods()
|
||||
ClassDB::bind_method(D_METHOD("from_dict", "dict"), &ClassProfile::from_dict);
|
||||
ClassDB::bind_method(D_METHOD("to_dict"), &ClassProfile::to_dict);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,10 +1,9 @@
|
||||
#ifndef CLASS_PROFILE_H
|
||||
#define CLASS_PROFILE_H
|
||||
|
||||
|
||||
#include "core/ustring.h"
|
||||
#include "core/reference.h"
|
||||
#include "core/dictionary.h"
|
||||
#include "core/reference.h"
|
||||
#include "core/ustring.h"
|
||||
|
||||
#include "actionbar/action_bar_profile.h"
|
||||
#include "input/input_profile.h"
|
||||
@ -13,18 +12,18 @@ class ClassProfile : public Reference {
|
||||
GDCLASS(ClassProfile, Reference);
|
||||
|
||||
public:
|
||||
int get_class_id();
|
||||
void set_class_id(int value);
|
||||
String get_character_class_name();
|
||||
void set_character_class_name(String value);
|
||||
int get_level();
|
||||
void set_level(int value);
|
||||
int get_xp();
|
||||
void set_xp(int value);
|
||||
int get_class_id();
|
||||
void set_class_id(int value);
|
||||
String get_character_class_name();
|
||||
void set_character_class_name(String value);
|
||||
int get_level();
|
||||
void set_level(int value);
|
||||
int get_xp();
|
||||
void set_xp(int value);
|
||||
bool get_actionbar_locked();
|
||||
void set_actionbar_locked(bool value);
|
||||
Ref<InputProfile> get_input_profile();
|
||||
Ref<ActionBarProfile> get_action_bar_profile();
|
||||
Ref<InputProfile> get_input_profile();
|
||||
Ref<ActionBarProfile> get_action_bar_profile();
|
||||
|
||||
Dictionary get_custom_data();
|
||||
void set_custom_data(const Dictionary &dict);
|
||||
@ -32,23 +31,23 @@ public:
|
||||
Dictionary to_dict() const;
|
||||
void from_dict(const Dictionary &dict);
|
||||
|
||||
ClassProfile();
|
||||
ClassProfile(int class_id);
|
||||
ClassProfile(String class_name, int class_id, int level, int xp, bool locked, bool load_defaults);
|
||||
void load_defaults();
|
||||
ClassProfile();
|
||||
ClassProfile(int class_id);
|
||||
ClassProfile(String class_name, int class_id, int level, int xp, bool locked, bool load_defaults);
|
||||
void load_defaults();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
private:
|
||||
String _character_class_name;
|
||||
int _class_id;
|
||||
int _level;
|
||||
int _xp;
|
||||
String _character_class_name;
|
||||
int _class_id;
|
||||
int _level;
|
||||
int _xp;
|
||||
bool _actionbar_locked;
|
||||
|
||||
Ref<InputProfile> _input_profile;
|
||||
Ref<ActionBarProfile> _action_bar_profile;
|
||||
Ref<InputProfile> _input_profile;
|
||||
Ref<ActionBarProfile> _action_bar_profile;
|
||||
|
||||
Dictionary _custom_data;
|
||||
};
|
||||
|
@ -8,16 +8,13 @@ class InputProfile : public Reference {
|
||||
GDCLASS(InputProfile, Reference);
|
||||
|
||||
public:
|
||||
|
||||
InputProfile() {}
|
||||
|
||||
protected:
|
||||
static void _bind_methods() {}
|
||||
|
||||
private:
|
||||
int placeholder;
|
||||
int placeholder;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -75,5 +75,4 @@ void InputProfileModifier::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_entry", "index"), &InputProfileModifier::get_entry);
|
||||
ClassDB::bind_method(D_METHOD("set_entry", "index", "value"), &InputProfileModifier::set_entry);
|
||||
ClassDB::bind_method(D_METHOD("remove_entry", "index"), &InputProfileModifier::remove_entry);
|
||||
|
||||
}
|
||||
|
@ -7,7 +7,6 @@
|
||||
|
||||
#include "input_profile_modifier_entry.h"
|
||||
|
||||
|
||||
class InputProfileModifier : public Reference {
|
||||
GDCLASS(InputProfileModifier, Reference);
|
||||
|
||||
@ -33,8 +32,8 @@ protected:
|
||||
static void _bind_methods();
|
||||
|
||||
private:
|
||||
Vector<String> *_modifier_actions;
|
||||
Vector<Ref<InputProfileModifierEntry> > *_entries;
|
||||
Vector<String> *_modifier_actions;
|
||||
Vector<Ref<InputProfileModifierEntry> > *_entries;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -17,7 +17,6 @@ void InputProfileModifierEntry::set_translate_to(String value) {
|
||||
}
|
||||
|
||||
InputProfileModifierEntry::InputProfileModifierEntry() {
|
||||
|
||||
}
|
||||
|
||||
void InputProfileModifierEntry::_bind_methods() {
|
||||
@ -29,4 +28,3 @@ void InputProfileModifierEntry::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_translate_to", "value"), &InputProfileModifierEntry::set_translate_to);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::STRING, "translate_to"), "set_translate_to", "get_translate_to");
|
||||
}
|
||||
|
||||
|
@ -20,9 +20,8 @@ protected:
|
||||
static void _bind_methods();
|
||||
|
||||
private:
|
||||
String _action;
|
||||
String _translate_to;
|
||||
String _action;
|
||||
String _translate_to;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -68,7 +68,7 @@ void ProfileManager::load() {
|
||||
if (has_method("_load")) {
|
||||
call("_load");
|
||||
} //else {
|
||||
//load_defaults();
|
||||
//load_defaults();
|
||||
//}
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ void ProfileManager::load_profile(String name) {
|
||||
load_defaults();
|
||||
}
|
||||
|
||||
int _last_used_class;
|
||||
int _last_used_class;
|
||||
|
||||
String _profile_name;
|
||||
|
||||
|
@ -12,10 +12,10 @@ class ProfileManager : public Node {
|
||||
public:
|
||||
static const String DEFAULT_PROFILE_FILE_NAME;
|
||||
|
||||
static ProfileManager *get_instance();
|
||||
static ProfileManager *get_instance();
|
||||
|
||||
int get_last_used_class();
|
||||
void set_last_used_class(int value);
|
||||
int get_last_used_class();
|
||||
void set_last_used_class(int value);
|
||||
|
||||
int get_class_profile_count();
|
||||
Ref<ClassProfile> get_class_profile_index(int index);
|
||||
@ -23,34 +23,34 @@ public:
|
||||
void clear_class_profiles();
|
||||
void remove_class_profile(int index);
|
||||
|
||||
Vector<Ref<ClassProfile> > &get_class_profiles();
|
||||
Ref<ClassProfile> get_class_profile(int class_id);
|
||||
Vector<Ref<ClassProfile> > &get_class_profiles();
|
||||
Ref<ClassProfile> get_class_profile(int class_id);
|
||||
|
||||
void save();
|
||||
void load();
|
||||
|
||||
void save_profile(String name);
|
||||
void load_profile(String name);
|
||||
void load_profile(String name);
|
||||
|
||||
void load_defaults();
|
||||
void load_defaults();
|
||||
|
||||
Dictionary to_dict() const;
|
||||
void from_dict(const Dictionary &dict);
|
||||
|
||||
ProfileManager();
|
||||
ProfileManager();
|
||||
~ProfileManager();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
static void _bind_methods();
|
||||
|
||||
private:
|
||||
static ProfileManager* _instance;
|
||||
static ProfileManager *_instance;
|
||||
|
||||
int _last_used_class;
|
||||
|
||||
String _profile_name;
|
||||
String _profile_name;
|
||||
|
||||
Vector<Ref<ClassProfile> > _class_profiles;
|
||||
Vector<Ref<ClassProfile> > _class_profiles;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -8,26 +8,26 @@
|
||||
#include "data/aura.h"
|
||||
#include "data/aura_group.h"
|
||||
#include "data/aura_stat_attribute.h"
|
||||
#include "data/xp_data.h"
|
||||
#include "data/equipment_data.h"
|
||||
#include "data/equipment_data_entry.h"
|
||||
#include "data/item_stat_modifier.h"
|
||||
#include "data/item_template_stat_modifier.h"
|
||||
#include "data/spell_cooldown_manipulation_data.h"
|
||||
#include "data/equipment_data.h"
|
||||
#include "data/equipment_data_entry.h"
|
||||
#include "data/xp_data.h"
|
||||
|
||||
#include "entities/data/entity_data.h"
|
||||
#include "entities/data/entity_class_data.h"
|
||||
#include "entities/data/vendor_item_data.h"
|
||||
#include "entities/data/vendor_item_data_entry.h"
|
||||
#include "entities/data/entity_data.h"
|
||||
#include "entities/data/entity_data_container.h"
|
||||
#include "entities/data/item_container_data.h"
|
||||
#include "entities/data/item_container_data_entry.h"
|
||||
#include "entities/data/entity_data_container.h"
|
||||
#include "entities/data/vendor_item_data.h"
|
||||
#include "entities/data/vendor_item_data_entry.h"
|
||||
|
||||
#include "entities/skills/entity_skill.h"
|
||||
#include "entities/skills/entity_skill_data.h"
|
||||
|
||||
#include "entities/data/talent_row_data.h"
|
||||
#include "entities/data/character_spec.h"
|
||||
#include "entities/data/talent_row_data.h"
|
||||
|
||||
#include "data/item_visual.h"
|
||||
#include "data/item_visual_entry.h"
|
||||
@ -37,40 +37,39 @@
|
||||
|
||||
#include "skeleton/character_bones.h"
|
||||
|
||||
#include "data/item_template.h"
|
||||
#include "data/item_instance.h"
|
||||
#include "data/item_template.h"
|
||||
|
||||
#include "data/spell.h"
|
||||
#include "entities/stats/stat.h"
|
||||
#include "entities/stats/stat_modifier.h"
|
||||
#include "entities/stats/stat_data.h"
|
||||
#include "entities/stats/stat_data_entry.h"
|
||||
#include "entities/stats/complex_level_stat_data.h"
|
||||
#include "entities/stats/level_stat_data.h"
|
||||
#include "entities/stats/simple_level_stat_data.h"
|
||||
#include "entities/stats/complex_level_stat_data.h"
|
||||
|
||||
#include "entities/stats/stat.h"
|
||||
#include "entities/stats/stat_data.h"
|
||||
#include "entities/stats/stat_data_entry.h"
|
||||
#include "entities/stats/stat_modifier.h"
|
||||
|
||||
#include "inventory/bag.h"
|
||||
//#include "inventory/inventory.h"
|
||||
|
||||
#include "data/craft_recipe_helper.h"
|
||||
#include "data/craft_recipe.h"
|
||||
#include "data/craft_recipe_helper.h"
|
||||
|
||||
#include "infos/spell_cast_info.h"
|
||||
#include "infos/aura_infos.h"
|
||||
#include "infos/spell_cast_info.h"
|
||||
|
||||
#include "pipelines/spell_damage_info.h"
|
||||
#include "pipelines/spell_heal_info.h"
|
||||
|
||||
#include "entities/resources/entity_resource_data.h"
|
||||
#include "entities/resources/entity_resource_cost_data.h"
|
||||
#include "entities/resources/entity_resource.h"
|
||||
#include "entities/resources/entity_resource_cost_data.h"
|
||||
#include "entities/resources/entity_resource_data.h"
|
||||
|
||||
#include "entities/auras/aura_data.h"
|
||||
#include "entities/entity.h"
|
||||
|
||||
#include "data/aura_trigger_data.h"
|
||||
#include "data/aura_stat_attribute.h"
|
||||
#include "data/aura_trigger_data.h"
|
||||
|
||||
#include "ui/unit_frame.h"
|
||||
|
||||
@ -79,32 +78,31 @@
|
||||
#include "skeleton/character_skeleton_2d.h"
|
||||
#include "skeleton/character_skeleton_3d.h"
|
||||
|
||||
#include "skeleton/species_model_data.h"
|
||||
#include "skeleton/entity_species_data.h"
|
||||
#include "skeleton/skeleton_model_entry.h"
|
||||
#include "skeleton/species_model_data.h"
|
||||
|
||||
#include "utility/entity_create_info.h"
|
||||
#include "utility/cooldown.h"
|
||||
#include "utility/cooldown.h"
|
||||
#include "utility/category_cooldown.h"
|
||||
#include "utility/cooldown.h"
|
||||
#include "utility/entity_create_info.h"
|
||||
|
||||
#include "loot/loot_data_base.h"
|
||||
#include "loot/loot_data_item.h"
|
||||
#include "loot/loot_data_container.h"
|
||||
#include "loot/loot_data_item.h"
|
||||
|
||||
#include "data/spell_effect_visual.h"
|
||||
#include "data/spell_effect_visual_simple.h"
|
||||
|
||||
#include "world_spells/world_spell_data.h"
|
||||
#include "world_spells/world_spell.h"
|
||||
#include "world_spells/world_spell_data.h"
|
||||
|
||||
#include "entities/ai/entity_ai.h"
|
||||
|
||||
#include "formations/ai_formation.h"
|
||||
|
||||
#include "profile_manager/input/input_profile.h"
|
||||
#include "profile_manager/input/input_profile_modifier.h"
|
||||
#include "profile_manager/input/input_profile_modifier_entry.h"
|
||||
#include "profile_manager/input/input_profile.h"
|
||||
|
||||
#include "profile_manager/actionbar/action_bar_button_entry.h"
|
||||
#include "profile_manager/actionbar/action_bar_entry.h"
|
||||
@ -129,14 +127,14 @@ void register_entity_spell_system_types() {
|
||||
|
||||
ClassDB::register_class<EntityData>();
|
||||
ClassDB::register_class<EntityClassData>();
|
||||
ClassDB::register_class<VendorItemData>();
|
||||
ClassDB::register_class<VendorItemDataEntry>();
|
||||
ClassDB::register_class<VendorItemData>();
|
||||
ClassDB::register_class<VendorItemDataEntry>();
|
||||
|
||||
ClassDB::register_class<EntityDataContainer>();
|
||||
ClassDB::register_class<EntityDataContainer>();
|
||||
|
||||
ClassDB::register_class<ItemContainerData>();
|
||||
ClassDB::register_class<ItemContainerData>();
|
||||
ClassDB::register_class<ItemContainerDataEntry>();
|
||||
|
||||
|
||||
ClassDB::register_class<XPData>();
|
||||
ClassDB::register_class<ItemStatModifier>();
|
||||
ClassDB::register_class<ItemTemplateStatModifier>();
|
||||
@ -173,7 +171,7 @@ void register_entity_spell_system_types() {
|
||||
ClassDB::register_class<ComplexLevelStatData>();
|
||||
|
||||
ClassDB::register_class<CharacterSpec>();
|
||||
|
||||
|
||||
ClassDB::register_class<Bag>();
|
||||
|
||||
ClassDB::register_class<SpellDamageInfo>();
|
||||
@ -207,24 +205,24 @@ void register_entity_spell_system_types() {
|
||||
ClassDB::register_class<EntitySpeciesData>();
|
||||
ClassDB::register_class<SpeciesModelData>();
|
||||
ClassDB::register_class<SkeletonModelEntry>();
|
||||
|
||||
ClassDB::register_class<Cooldown>();
|
||||
ClassDB::register_class<CategoryCooldown>();
|
||||
|
||||
ClassDB::register_class<Cooldown>();
|
||||
ClassDB::register_class<CategoryCooldown>();
|
||||
|
||||
ClassDB::register_class<LootDataBase>();
|
||||
ClassDB::register_class<LootDataItem>();
|
||||
ClassDB::register_class<LootDataContainter>();
|
||||
|
||||
ClassDB::register_class<SpellEffectVisual>();
|
||||
ClassDB::register_class<SpellEffectVisualSimple>();
|
||||
ClassDB::register_class<SpellEffectVisual>();
|
||||
ClassDB::register_class<SpellEffectVisualSimple>();
|
||||
|
||||
ClassDB::register_class<WorldSpellData>();
|
||||
ClassDB::register_class<WorldSpell>();
|
||||
ClassDB::register_class<WorldSpell>();
|
||||
|
||||
//AI
|
||||
ClassDB::register_class<EntityAI>();
|
||||
ClassDB::register_class<EntityAI>();
|
||||
|
||||
ClassDB::register_class<AIFormation>();
|
||||
ClassDB::register_class<AIFormation>();
|
||||
|
||||
//ProfileManager
|
||||
ClassDB::register_class<InputProfileModifier>();
|
||||
@ -240,6 +238,4 @@ void register_entity_spell_system_types() {
|
||||
}
|
||||
|
||||
void unregister_entity_spell_system_types() {
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,7 @@
|
||||
#include "character_bones.h"
|
||||
|
||||
|
||||
CharacterBones::CharacterBones() {
|
||||
|
||||
}
|
||||
|
||||
void CharacterBones::_bind_methods() {
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ public:
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
//private:
|
||||
//private:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -35,5 +35,4 @@ private:
|
||||
EntityEnums::EntityGender _gender;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -86,8 +86,8 @@ private:
|
||||
NodePath _animation_player_path;
|
||||
NodePath _animation_tree_path;
|
||||
|
||||
NodePath _bone_paths[EntityEnums::SKELETON_POINTS_MAX];
|
||||
|
||||
NodePath _bone_paths[EntityEnums::SKELETON_POINTS_MAX];
|
||||
|
||||
AnimationPlayer *_animation_player;
|
||||
AnimationTree *_animation_tree;
|
||||
|
||||
@ -98,5 +98,4 @@ private:
|
||||
Vector<Ref<SkeletonModelEntry> > _entries[EntityEnums::SKELETON_POINTS_MAX];
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -8,7 +8,6 @@ class EntitySkeletonData : public Resource {
|
||||
GDCLASS(EntitySkeletonData, Resource);
|
||||
|
||||
public:
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "entity_species_data.h"
|
||||
|
||||
#include "../data/spell.h"
|
||||
#include "../data/aura.h"
|
||||
#include "../data/spell.h"
|
||||
|
||||
int EntitySpeciesData::get_id() {
|
||||
return _id;
|
||||
@ -178,4 +178,4 @@ void EntitySpeciesData::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_auras"), &EntitySpeciesData::get_auras);
|
||||
ClassDB::bind_method(D_METHOD("set_auras", "auras"), &EntitySpeciesData::set_auras);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "auras", PROPERTY_HINT_NONE, "17/17:Aura", PROPERTY_USAGE_DEFAULT, "Aura"), "set_auras", "get_auras");
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,6 @@ public:
|
||||
Vector<Variant> get_auras();
|
||||
void set_auras(const Vector<Variant> &auras);
|
||||
|
||||
|
||||
String generate_name(int seed);
|
||||
|
||||
EntitySpeciesData();
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user