mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-02-22 17:18:12 +01:00
Fix compile for 4.0.
This commit is contained in:
parent
f92758ce3d
commit
9fd0c23f5b
@ -27,6 +27,12 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "core/version.h"
|
#include "core/version.h"
|
||||||
|
|
||||||
|
#if VERSION_MAJOR >= 4
|
||||||
|
#define PoolStringArray PackedStringArray
|
||||||
|
|
||||||
|
#define POOL_STRING_ARRAY PACKED_STRING_ARRAY
|
||||||
|
#endif
|
||||||
|
|
||||||
int Aura::get_id() const {
|
int Aura::get_id() const {
|
||||||
return _id;
|
return _id;
|
||||||
}
|
}
|
||||||
@ -1053,14 +1059,12 @@ void Aura::_removes_dispell(Ref<AuraData> aura) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Aura::_supdate(Ref<AuraData> aura, float delta) {
|
void Aura::_supdate(Ref<AuraData> aura, float delta) {
|
||||||
|
|
||||||
bool remove = false;
|
bool remove = false;
|
||||||
|
|
||||||
remove = aura->update(delta);
|
remove = aura->update(delta);
|
||||||
|
|
||||||
//ontick
|
//ontick
|
||||||
while (aura->get_unhandled_ticks() > 0) {
|
while (aura->get_unhandled_ticks() > 0) {
|
||||||
|
|
||||||
if (aura->get_damage() != 0) {
|
if (aura->get_damage() != 0) {
|
||||||
Ref<SpellDamageInfo> dpd = Ref<SpellDamageInfo>(memnew(SpellDamageInfo()));
|
Ref<SpellDamageInfo> dpd = Ref<SpellDamageInfo>(memnew(SpellDamageInfo()));
|
||||||
|
|
||||||
@ -1090,7 +1094,6 @@ void Aura::_supdate(Ref<AuraData> aura, float delta) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Aura::_setup_aura_data(Ref<AuraData> data, Ref<AuraApplyInfo> info) {
|
void Aura::_setup_aura_data(Ref<AuraData> data, Ref<AuraApplyInfo> info) {
|
||||||
|
|
||||||
#if VERSION_MAJOR < 4
|
#if VERSION_MAJOR < 4
|
||||||
ERR_FAIL_COND(!ObjectDB::instance_validate(info->get_caster()));
|
ERR_FAIL_COND(!ObjectDB::instance_validate(info->get_caster()));
|
||||||
#else
|
#else
|
||||||
@ -1131,7 +1134,6 @@ void Aura::_calculate_initial_damage(Ref<AuraData> aura_data, Ref<AuraApplyInfo>
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Aura::_handle_aura_damage(Ref<AuraData> aura_data, Ref<SpellDamageInfo> info) {
|
void Aura::_handle_aura_damage(Ref<AuraData> aura_data, Ref<SpellDamageInfo> info) {
|
||||||
|
|
||||||
#if VERSION_MAJOR < 4
|
#if VERSION_MAJOR < 4
|
||||||
ERR_FAIL_COND(!ObjectDB::instance_validate(info->get_dealer()));
|
ERR_FAIL_COND(!ObjectDB::instance_validate(info->get_dealer()));
|
||||||
#else
|
#else
|
||||||
@ -1186,7 +1188,6 @@ void Aura::_handle_aura_heal(Ref<AuraData> aura_data, Ref<SpellHealInfo> info) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Aura::_validate_property(PropertyInfo &property) const {
|
void Aura::_validate_property(PropertyInfo &property) const {
|
||||||
|
|
||||||
String prop = property.name;
|
String prop = property.name;
|
||||||
if (prop.begins_with("StatModAttribute_")) {
|
if (prop.begins_with("StatModAttribute_")) {
|
||||||
int frame = prop.get_slicec('/', 0).get_slicec('_', 1).to_int();
|
int frame = prop.get_slicec('/', 0).get_slicec('_', 1).to_int();
|
||||||
|
@ -40,7 +40,6 @@ SOFTWARE.
|
|||||||
#include "./resources/entity_resource_speed.h"
|
#include "./resources/entity_resource_speed.h"
|
||||||
#include "./skills/entity_skill.h"
|
#include "./skills/entity_skill.h"
|
||||||
#include "scene/2d/node_2d.h"
|
#include "scene/2d/node_2d.h"
|
||||||
#include "scene/3d/spatial.h"
|
|
||||||
|
|
||||||
#include "core/script_language.h"
|
#include "core/script_language.h"
|
||||||
|
|
||||||
@ -114,7 +113,11 @@ void Entity::setc_guid(int value) {
|
|||||||
//Transforms
|
//Transforms
|
||||||
Transform Entity::get_transform_3d(bool only_stored) const {
|
Transform Entity::get_transform_3d(bool only_stored) const {
|
||||||
if (!only_stored && _body_3d) {
|
if (!only_stored && _body_3d) {
|
||||||
|
#if VERSION_MAJOR < 4
|
||||||
ERR_FAIL_COND_V(!ObjectDB::instance_validate(_body_3d), _transform);
|
ERR_FAIL_COND_V(!ObjectDB::instance_validate(_body_3d), _transform);
|
||||||
|
#else
|
||||||
|
ERR_FAIL_COND_V(!_body_3d, _transform);
|
||||||
|
#endif
|
||||||
|
|
||||||
return _body_3d->get_transform();
|
return _body_3d->get_transform();
|
||||||
}
|
}
|
||||||
@ -123,7 +126,11 @@ Transform Entity::get_transform_3d(bool only_stored) const {
|
|||||||
}
|
}
|
||||||
void Entity::set_transform_3d(const Transform &transform, bool only_stored) {
|
void Entity::set_transform_3d(const Transform &transform, bool only_stored) {
|
||||||
if (!only_stored && _body_3d) {
|
if (!only_stored && _body_3d) {
|
||||||
|
#if VERSION_MAJOR < 4
|
||||||
ERR_FAIL_COND(!ObjectDB::instance_validate(_body_3d));
|
ERR_FAIL_COND(!ObjectDB::instance_validate(_body_3d));
|
||||||
|
#else
|
||||||
|
ERR_FAIL_COND(!_body_3d);
|
||||||
|
#endif
|
||||||
|
|
||||||
return _body_3d->set_transform(transform);
|
return _body_3d->set_transform(transform);
|
||||||
}
|
}
|
||||||
@ -133,7 +140,11 @@ void Entity::set_transform_3d(const Transform &transform, bool only_stored) {
|
|||||||
|
|
||||||
Transform2D Entity::get_transform_2d(bool only_stored) const {
|
Transform2D Entity::get_transform_2d(bool only_stored) const {
|
||||||
if (!only_stored && _body_2d) {
|
if (!only_stored && _body_2d) {
|
||||||
|
#if VERSION_MAJOR < 4
|
||||||
ERR_FAIL_COND_V(!ObjectDB::instance_validate(_body_2d), _transform_2d);
|
ERR_FAIL_COND_V(!ObjectDB::instance_validate(_body_2d), _transform_2d);
|
||||||
|
#else
|
||||||
|
ERR_FAIL_COND_V(!_body_2d, _transform_2d);
|
||||||
|
#endif
|
||||||
|
|
||||||
return _body_2d->get_transform();
|
return _body_2d->get_transform();
|
||||||
}
|
}
|
||||||
@ -142,7 +153,11 @@ Transform2D Entity::get_transform_2d(bool only_stored) const {
|
|||||||
}
|
}
|
||||||
void Entity::set_transform_2d(const Transform2D &transform, bool only_stored) {
|
void Entity::set_transform_2d(const Transform2D &transform, bool only_stored) {
|
||||||
if (!only_stored && _body_2d) {
|
if (!only_stored && _body_2d) {
|
||||||
|
#if VERSION_MAJOR < 4
|
||||||
ERR_FAIL_COND(!ObjectDB::instance_validate(_body_2d));
|
ERR_FAIL_COND(!ObjectDB::instance_validate(_body_2d));
|
||||||
|
#else
|
||||||
|
ERR_FAIL_COND(!_body_2d);
|
||||||
|
#endif
|
||||||
|
|
||||||
return _body_2d->set_transform(_transform_2d);
|
return _body_2d->set_transform(_transform_2d);
|
||||||
}
|
}
|
||||||
@ -225,7 +240,6 @@ EntityEnums::EntityRelationType Entity::getc_relation_to_bind(Node *to) {
|
|||||||
return getc_relation_to(e);
|
return getc_relation_to(e);
|
||||||
}
|
}
|
||||||
EntityEnums::EntityRelationType Entity::getc_relation_to(Entity *to) {
|
EntityEnums::EntityRelationType Entity::getc_relation_to(Entity *to) {
|
||||||
|
|
||||||
#if VERSION_MAJOR < 4
|
#if VERSION_MAJOR < 4
|
||||||
ERR_FAIL_COND_V(!ObjectDB::instance_validate(to), EntityEnums::ENTITY_RELATION_TYPE_NEUTRAL);
|
ERR_FAIL_COND_V(!ObjectDB::instance_validate(to), EntityEnums::ENTITY_RELATION_TYPE_NEUTRAL);
|
||||||
#else
|
#else
|
||||||
@ -462,7 +476,6 @@ void Entity::sets_entity_data(Ref<EntityData> value) {
|
|||||||
if (get_body() == NULL && value.is_valid() && value->get_entity_species_data().is_valid() &&
|
if (get_body() == NULL && value.is_valid() && value->get_entity_species_data().is_valid() &&
|
||||||
value->get_entity_species_data()->get_model_data().is_valid() &&
|
value->get_entity_species_data()->get_model_data().is_valid() &&
|
||||||
value->get_entity_species_data()->get_model_data()->get_body().is_valid()) {
|
value->get_entity_species_data()->get_model_data()->get_body().is_valid()) {
|
||||||
|
|
||||||
Node *node = value->get_entity_species_data()->get_model_data()->get_body()->instance();
|
Node *node = value->get_entity_species_data()->get_model_data()->get_body()->instance();
|
||||||
|
|
||||||
add_child(node);
|
add_child(node);
|
||||||
@ -484,7 +497,6 @@ void Entity::setc_entity_data(Ref<EntityData> value) {
|
|||||||
if (get_body() == NULL && value.is_valid() && value->get_entity_species_data().is_valid() &&
|
if (get_body() == NULL && value.is_valid() && value->get_entity_species_data().is_valid() &&
|
||||||
value->get_entity_species_data()->get_model_data().is_valid() &&
|
value->get_entity_species_data()->get_model_data().is_valid() &&
|
||||||
value->get_entity_species_data()->get_model_data()->get_body().is_valid()) {
|
value->get_entity_species_data()->get_model_data()->get_body().is_valid()) {
|
||||||
|
|
||||||
Node *node = value->get_entity_species_data()->get_model_data()->get_body()->instance();
|
Node *node = value->get_entity_species_data()->get_model_data()->get_body()->instance();
|
||||||
|
|
||||||
add_child(node);
|
add_child(node);
|
||||||
@ -769,7 +781,6 @@ void Entity::setup_actionbars() {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (is_deserialized()) {
|
if (is_deserialized()) {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -791,7 +802,6 @@ void Entity::setup_actionbars() {
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
if (!gets_bag().is_valid()) {
|
if (!gets_bag().is_valid()) {
|
||||||
|
|
||||||
Ref<Bag> bag;
|
Ref<Bag> bag;
|
||||||
bag.instance();
|
bag.instance();
|
||||||
|
|
||||||
@ -3939,17 +3949,17 @@ void Entity::cast_spell_successc(Ref<SpellCastInfo> info) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//// Cooldowns ////
|
//// Cooldowns ////
|
||||||
Vector<Ref<Cooldown> > *Entity::cooldowns_gets() {
|
Vector<Ref<Cooldown>> *Entity::cooldowns_gets() {
|
||||||
return &_s_cooldowns;
|
return &_s_cooldowns;
|
||||||
}
|
}
|
||||||
Vector<Ref<Cooldown> > *Entity::cooldowns_getc() {
|
Vector<Ref<Cooldown>> *Entity::cooldowns_getc() {
|
||||||
return &_c_cooldowns;
|
return &_c_cooldowns;
|
||||||
}
|
}
|
||||||
|
|
||||||
HashMap<int, Ref<Cooldown> > *Entity::cooldown_get_maps() {
|
HashMap<int, Ref<Cooldown>> *Entity::cooldown_get_maps() {
|
||||||
return &_s_cooldown_map;
|
return &_s_cooldown_map;
|
||||||
}
|
}
|
||||||
HashMap<int, Ref<Cooldown> > *Entity::cooldown_get_mapc() {
|
HashMap<int, Ref<Cooldown>> *Entity::cooldown_get_mapc() {
|
||||||
return &_c_cooldown_map;
|
return &_c_cooldown_map;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4093,10 +4103,10 @@ int Entity::cooldown_getc_count() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Category Cooldowns
|
//Category Cooldowns
|
||||||
Vector<Ref<CategoryCooldown> > Entity::category_cooldowns_gets() {
|
Vector<Ref<CategoryCooldown>> Entity::category_cooldowns_gets() {
|
||||||
return _s_category_cooldowns;
|
return _s_category_cooldowns;
|
||||||
}
|
}
|
||||||
Vector<Ref<CategoryCooldown> > Entity::category_cooldowns_getc() {
|
Vector<Ref<CategoryCooldown>> Entity::category_cooldowns_getc() {
|
||||||
return _c_category_cooldowns;
|
return _c_category_cooldowns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4656,7 +4666,6 @@ void Entity::aura_removess_with_group(Ref<AuraGroup> aura_group) {
|
|||||||
Ref<AuraData> ad = _s_auras.get(i);
|
Ref<AuraData> ad = _s_auras.get(i);
|
||||||
|
|
||||||
if (ad->get_aura()->get_aura_group() == aura_group) {
|
if (ad->get_aura()->get_aura_group() == aura_group) {
|
||||||
|
|
||||||
aura_removec(ad);
|
aura_removec(ad);
|
||||||
|
|
||||||
_s_auras.remove(i);
|
_s_auras.remove(i);
|
||||||
@ -4989,7 +4998,8 @@ void Entity::talents_sclear() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Entity::talent_addc(int talent) {
|
void Entity::talent_addc(int talent) {
|
||||||
if (talent_hasc(talent)) return;
|
if (talent_hasc(talent))
|
||||||
|
return;
|
||||||
|
|
||||||
_c_talents.push_back(talent);
|
_c_talents.push_back(talent);
|
||||||
|
|
||||||
|
@ -60,6 +60,13 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "core/version.h"
|
#include "core/version.h"
|
||||||
|
|
||||||
|
#if VERSION_MAJOR < 4
|
||||||
|
#include "scene/3d/spatial.h"
|
||||||
|
#else
|
||||||
|
#include "scene/3d/node_3d.h"
|
||||||
|
#define Spatial Node3D
|
||||||
|
#endif
|
||||||
|
|
||||||
class EntityData;
|
class EntityData;
|
||||||
class AuraData;
|
class AuraData;
|
||||||
class Spell;
|
class Spell;
|
||||||
@ -695,11 +702,11 @@ public:
|
|||||||
|
|
||||||
//// Cooldowns ////
|
//// Cooldowns ////
|
||||||
|
|
||||||
Vector<Ref<Cooldown> > *cooldowns_gets();
|
Vector<Ref<Cooldown>> *cooldowns_gets();
|
||||||
Vector<Ref<Cooldown> > *cooldowns_getc();
|
Vector<Ref<Cooldown>> *cooldowns_getc();
|
||||||
|
|
||||||
HashMap<int, Ref<Cooldown> > *cooldown_get_maps();
|
HashMap<int, Ref<Cooldown>> *cooldown_get_maps();
|
||||||
HashMap<int, Ref<Cooldown> > *cooldown_get_mapc();
|
HashMap<int, Ref<Cooldown>> *cooldown_get_mapc();
|
||||||
|
|
||||||
bool cooldown_hass(int spell_id);
|
bool cooldown_hass(int spell_id);
|
||||||
void cooldown_adds(int spell_id, float value);
|
void cooldown_adds(int spell_id, float value);
|
||||||
@ -717,8 +724,8 @@ public:
|
|||||||
|
|
||||||
//Category Cooldowns
|
//Category Cooldowns
|
||||||
|
|
||||||
Vector<Ref<CategoryCooldown> > category_cooldowns_gets();
|
Vector<Ref<CategoryCooldown>> category_cooldowns_gets();
|
||||||
Vector<Ref<CategoryCooldown> > category_cooldowns_getc();
|
Vector<Ref<CategoryCooldown>> category_cooldowns_getc();
|
||||||
|
|
||||||
bool category_cooldown_hass(int category_id);
|
bool category_cooldown_hass(int category_id);
|
||||||
void category_cooldown_adds(int category_id, float value);
|
void category_cooldown_adds(int category_id, float value);
|
||||||
@ -1126,8 +1133,8 @@ private:
|
|||||||
|
|
||||||
//// Resources ////
|
//// Resources ////
|
||||||
|
|
||||||
Vector<Ref<EntityResource> > _s_resources;
|
Vector<Ref<EntityResource>> _s_resources;
|
||||||
Vector<Ref<EntityResource> > _c_resources;
|
Vector<Ref<EntityResource>> _c_resources;
|
||||||
|
|
||||||
//// GCD ////
|
//// GCD ////
|
||||||
|
|
||||||
@ -1148,8 +1155,8 @@ private:
|
|||||||
|
|
||||||
//// AuraComponent ////
|
//// AuraComponent ////
|
||||||
|
|
||||||
Vector<Ref<AuraData> > _s_auras;
|
Vector<Ref<AuraData>> _s_auras;
|
||||||
Vector<Ref<AuraData> > _c_auras;
|
Vector<Ref<AuraData>> _c_auras;
|
||||||
|
|
||||||
EntityEnums::EntityType _s_entity_type;
|
EntityEnums::EntityType _s_entity_type;
|
||||||
EntityEnums::EntityType _c_entity_type;
|
EntityEnums::EntityType _c_entity_type;
|
||||||
@ -1160,14 +1167,14 @@ private:
|
|||||||
int _c_entity_flags;
|
int _c_entity_flags;
|
||||||
|
|
||||||
//// Cooldowns ////
|
//// Cooldowns ////
|
||||||
Vector<Ref<Cooldown> > _s_cooldowns;
|
Vector<Ref<Cooldown>> _s_cooldowns;
|
||||||
Vector<Ref<Cooldown> > _c_cooldowns;
|
Vector<Ref<Cooldown>> _c_cooldowns;
|
||||||
|
|
||||||
HashMap<int, Ref<Cooldown> > _s_cooldown_map;
|
HashMap<int, Ref<Cooldown>> _s_cooldown_map;
|
||||||
HashMap<int, Ref<Cooldown> > _c_cooldown_map;
|
HashMap<int, Ref<Cooldown>> _c_cooldown_map;
|
||||||
|
|
||||||
Vector<Ref<CategoryCooldown> > _s_category_cooldowns;
|
Vector<Ref<CategoryCooldown>> _s_category_cooldowns;
|
||||||
Vector<Ref<CategoryCooldown> > _c_category_cooldowns;
|
Vector<Ref<CategoryCooldown>> _c_category_cooldowns;
|
||||||
|
|
||||||
int _s_active_category_cooldowns;
|
int _s_active_category_cooldowns;
|
||||||
int _c_active_category_cooldowns;
|
int _c_active_category_cooldowns;
|
||||||
@ -1187,8 +1194,8 @@ private:
|
|||||||
|
|
||||||
//// Data ////
|
//// Data ////
|
||||||
|
|
||||||
Vector<Ref<EntityDataContainer> > _s_data;
|
Vector<Ref<EntityDataContainer>> _s_data;
|
||||||
Vector<Ref<EntityDataContainer> > _c_data;
|
Vector<Ref<EntityDataContainer>> _c_data;
|
||||||
|
|
||||||
//// Actionbars ////
|
//// Actionbars ////
|
||||||
|
|
||||||
@ -1197,21 +1204,21 @@ private:
|
|||||||
|
|
||||||
//// Crafting System ////
|
//// Crafting System ////
|
||||||
|
|
||||||
Vector<Ref<CraftRecipe> > _s_craft_recipes;
|
Vector<Ref<CraftRecipe>> _s_craft_recipes;
|
||||||
Vector<Ref<CraftRecipe> > _c_craft_recipes;
|
Vector<Ref<CraftRecipe>> _c_craft_recipes;
|
||||||
|
|
||||||
//// Known Spells ////
|
//// Known Spells ////
|
||||||
|
|
||||||
int _s_free_spell_points;
|
int _s_free_spell_points;
|
||||||
int _c_free_spell_points;
|
int _c_free_spell_points;
|
||||||
|
|
||||||
Vector<Ref<Spell> > _s_spells;
|
Vector<Ref<Spell>> _s_spells;
|
||||||
Vector<Ref<Spell> > _c_spells;
|
Vector<Ref<Spell>> _c_spells;
|
||||||
|
|
||||||
//// Skills ////
|
//// Skills ////
|
||||||
|
|
||||||
Vector<Ref<EntitySkill> > _s_skills;
|
Vector<Ref<EntitySkill>> _s_skills;
|
||||||
Vector<Ref<EntitySkill> > _c_skills;
|
Vector<Ref<EntitySkill>> _c_skills;
|
||||||
|
|
||||||
//// Stat Allocations ////
|
//// Stat Allocations ////
|
||||||
|
|
||||||
@ -1255,7 +1262,7 @@ private:
|
|||||||
|
|
||||||
// Callbacks
|
// Callbacks
|
||||||
|
|
||||||
Vector<Ref<SpellCastInfo> > _physics_process_scis;
|
Vector<Ref<SpellCastInfo>> _physics_process_scis;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -28,6 +28,12 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "level_stat_data.h"
|
#include "level_stat_data.h"
|
||||||
|
|
||||||
|
#include "core/version.h"
|
||||||
|
|
||||||
|
#if VERSION_MAJOR >= 4
|
||||||
|
#define REAL FLOAT
|
||||||
|
#endif
|
||||||
|
|
||||||
class StatData : public Resource {
|
class StatData : public Resource {
|
||||||
GDCLASS(StatData, Resource);
|
GDCLASS(StatData, Resource);
|
||||||
|
|
||||||
|
@ -33,6 +33,14 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "core/bind/core_bind.h"
|
#include "core/bind/core_bind.h"
|
||||||
|
|
||||||
|
#include "core/version.h"
|
||||||
|
|
||||||
|
#if VERSION_MAJOR >= 4
|
||||||
|
#define PoolStringArray PackedStringArray
|
||||||
|
|
||||||
|
#define POOL_STRING_ARRAY PACKED_STRING_ARRAY
|
||||||
|
#endif
|
||||||
|
|
||||||
class ESSResourceDB;
|
class ESSResourceDB;
|
||||||
class ESSEntitySpawner;
|
class ESSEntitySpawner;
|
||||||
class EntityCreateInfo;
|
class EntityCreateInfo;
|
||||||
|
Loading…
Reference in New Issue
Block a user