mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-02-20 17:14:44 +01:00
Cleaned up SpellDamageInfo and SpellHealInfo.
This commit is contained in:
parent
24a85e3b7c
commit
1aa751f959
@ -1136,7 +1136,7 @@ void Aura::_handle_aura_damage(Ref<AuraData> aura_data, Ref<SpellDamageInfo> inf
|
||||
}
|
||||
|
||||
info->damage_set(aura_data->damage_get());
|
||||
//info->source_set_type(get_aura_type());
|
||||
info->aura_source_set(Ref<Aura>(this));
|
||||
|
||||
if (info->dealer_get()) {
|
||||
info->dealer_get()->sdeal_damage_to(info);
|
||||
|
@ -995,7 +995,7 @@ void Spell::_handle_effect(Ref<SpellCastInfo> info) {
|
||||
Ref<SpellDamageInfo> sdi;
|
||||
sdi.instance();
|
||||
|
||||
sdi->source_set(Ref<Spell>(this));
|
||||
sdi->spell_source_set(Ref<Spell>(this));
|
||||
sdi->dealer_set(info->caster_get());
|
||||
sdi->receiver_set(info->target_get());
|
||||
|
||||
|
@ -30,39 +30,39 @@ SOFTWARE.
|
||||
|
||||
#include "../defines.h"
|
||||
|
||||
bool SpellDamageInfo::get_immune() {
|
||||
bool SpellDamageInfo::get_immune() const {
|
||||
return _crit;
|
||||
}
|
||||
void SpellDamageInfo::set_immune(bool value) {
|
||||
void SpellDamageInfo::set_immune(const bool value) {
|
||||
_crit = value;
|
||||
}
|
||||
|
||||
int SpellDamageInfo::damage_get() {
|
||||
int SpellDamageInfo::damage_get() const {
|
||||
return _damage;
|
||||
}
|
||||
void SpellDamageInfo::damage_set(int value) {
|
||||
void SpellDamageInfo::damage_set(const int value) {
|
||||
_damage = value;
|
||||
}
|
||||
|
||||
bool SpellDamageInfo::crit_get() {
|
||||
bool SpellDamageInfo::crit_get() const {
|
||||
return _crit;
|
||||
}
|
||||
void SpellDamageInfo::crit_set(bool value) {
|
||||
void SpellDamageInfo::crit_set(const bool value) {
|
||||
_crit = value;
|
||||
}
|
||||
|
||||
int SpellDamageInfo::amount_absorbed_get() {
|
||||
int SpellDamageInfo::amount_absorbed_get() const {
|
||||
return _amount_absorbed;
|
||||
}
|
||||
void SpellDamageInfo::amount_absorbed_set(int value) {
|
||||
void SpellDamageInfo::amount_absorbed_set(const int value) {
|
||||
_amount_absorbed = value;
|
||||
}
|
||||
|
||||
SpellEnums::SpellType SpellDamageInfo::spell_type_get() {
|
||||
return _spell_type;
|
||||
int SpellDamageInfo::damage_type_get() const {
|
||||
return _damage_type;
|
||||
}
|
||||
void SpellDamageInfo::spell_type_set(SpellEnums::SpellType value) {
|
||||
_spell_type = value;
|
||||
void SpellDamageInfo::damage_type_set(const int value) {
|
||||
_damage_type = value;
|
||||
}
|
||||
|
||||
Entity *SpellDamageInfo::dealer_get() {
|
||||
@ -122,41 +122,39 @@ Ref<Spell> SpellDamageInfo::spell_source_get() {
|
||||
return Ref<Spell>(_damage_source);
|
||||
}
|
||||
|
||||
void SpellDamageInfo::spell_source_set(Ref<Spell> value) {
|
||||
void SpellDamageInfo::spell_source_set(const Ref<Spell> &value) {
|
||||
_damage_source_type = DAMAGE_SOURCE_SPELL;
|
||||
_damage_source = value;
|
||||
|
||||
ERR_FAIL_COND(!value.is_valid());
|
||||
|
||||
_damage_source_id = value->get_id();
|
||||
if (value.is_valid())
|
||||
_damage_source_id = value->get_id();
|
||||
}
|
||||
|
||||
Ref<Aura> SpellDamageInfo::aura_source_get() {
|
||||
return Ref<Aura>(_damage_source);
|
||||
}
|
||||
|
||||
void SpellDamageInfo::aura_source_set(Ref<Aura> value) {
|
||||
void SpellDamageInfo::aura_source_set(const Ref<Aura> &value) {
|
||||
_damage_source_type = DAMAGE_SOURCE_AURA;
|
||||
_damage_source = value;
|
||||
|
||||
ERR_FAIL_COND(!value.is_valid());
|
||||
|
||||
_damage_source_id = value->get_id();
|
||||
if (value.is_valid())
|
||||
_damage_source_id = value->get_id();
|
||||
}
|
||||
|
||||
int SpellDamageInfo::source_get_id() {
|
||||
int SpellDamageInfo::source_get_id() const {
|
||||
return _damage_source_id;
|
||||
}
|
||||
|
||||
void SpellDamageInfo::source_set_id(int value) {
|
||||
void SpellDamageInfo::source_set_id(const int value) {
|
||||
_damage_source_id = value;
|
||||
}
|
||||
|
||||
SpellDamageInfo::DamageSourceType SpellDamageInfo::source_get_type() {
|
||||
int SpellDamageInfo::source_get_type() const {
|
||||
return _damage_source_type;
|
||||
}
|
||||
|
||||
void SpellDamageInfo::source_set_type(DamageSourceType value) {
|
||||
void SpellDamageInfo::source_set_type(const int value) {
|
||||
_damage_source_type = value;
|
||||
}
|
||||
|
||||
@ -194,7 +192,8 @@ Dictionary SpellDamageInfo::to_dict() {
|
||||
dict["amount_absorbed"] = _amount_absorbed;
|
||||
dict["crit"] = _crit;
|
||||
|
||||
dict["spell_type"] = _spell_type;
|
||||
dict["damage_type"] = _damage_type;
|
||||
|
||||
dict["damage_source_type"] = _damage_source_type;
|
||||
dict["damage_source_id"] = _damage_source_id;
|
||||
|
||||
@ -210,27 +209,25 @@ void SpellDamageInfo::from_dict(const Dictionary &dict) {
|
||||
_amount_absorbed = dict.get("amount_absorbed", 0);
|
||||
_crit = dict.get("crit", false);
|
||||
|
||||
_spell_type = static_cast<SpellEnums::SpellType>(static_cast<int>(dict.get("spell_type", SpellEnums::SPELL_TYPE_NONE)));
|
||||
_damage_source_type = static_cast<DamageSourceType>(static_cast<int>(dict.get("damage_source_type", DAMAGE_SOURCE_UNKNOWN)));
|
||||
_damage_type = dict.get("spell_type", 0);
|
||||
_damage_source_type = dict.get("damage_source_type", DAMAGE_SOURCE_UNKNOWN);
|
||||
_damage_source_id = dict.get("damage_source_id", 0);
|
||||
}
|
||||
|
||||
SpellDamageInfo::SpellDamageInfo() {
|
||||
_immune = false;
|
||||
_damage = 0;
|
||||
_original_damage = 0;
|
||||
_crit = false;
|
||||
_spell_type = SpellEnums::SPELL_TYPE_NONE;
|
||||
_damage_type = 0;
|
||||
_dealer = NULL;
|
||||
_receiver = NULL;
|
||||
_damage_source_type = DAMAGE_SOURCE_UNKNOWN;
|
||||
//Ref<Reference> _damage_source = Ref<;
|
||||
_damage_source_id = 0;
|
||||
}
|
||||
|
||||
SpellDamageInfo::~SpellDamageInfo() {
|
||||
//_dealer = NULL;
|
||||
//_receiver = NULL;
|
||||
//_damage_source = Ref<Reference>(NULL);
|
||||
_damage_source.unref();
|
||||
}
|
||||
|
||||
void SpellDamageInfo::_bind_methods() {
|
||||
@ -250,9 +247,9 @@ void SpellDamageInfo::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("amount_absorbed_set", "value"), &SpellDamageInfo::amount_absorbed_set);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "amount_absorbed"), "amount_absorbed_set", "amount_absorbed_get");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("spell_type_get"), &SpellDamageInfo::spell_type_get);
|
||||
ClassDB::bind_method(D_METHOD("spell_type_set", "value"), &SpellDamageInfo::spell_type_set);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "spell_type", PROPERTY_HINT_ENUM, "None, Melee, Magic"), "spell_type_set", "spell_type_get");
|
||||
ClassDB::bind_method(D_METHOD("damage_type_get"), &SpellDamageInfo::damage_type_get);
|
||||
ClassDB::bind_method(D_METHOD("damage_type_set", "value"), &SpellDamageInfo::damage_type_set);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "damage_type_get"), "damage_type_set", "damage_type_get");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("dealer_get"), &SpellDamageInfo::dealer_get);
|
||||
ClassDB::bind_method(D_METHOD("dealer_set", "value"), &SpellDamageInfo::dealer_set_bind);
|
||||
@ -264,19 +261,27 @@ void SpellDamageInfo::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("source_get"), &SpellDamageInfo::source_get);
|
||||
ClassDB::bind_method(D_METHOD("source_set", "value"), &SpellDamageInfo::source_set);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "damage_source", PROPERTY_HINT_RESOURCE_TYPE, "Resource"), "source_set", "source_get");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "source", PROPERTY_HINT_RESOURCE_TYPE, "Resource"), "source_set", "source_get");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("spell_source_get"), &SpellDamageInfo::spell_source_get);
|
||||
ClassDB::bind_method(D_METHOD("spell_source_set", "value"), &SpellDamageInfo::spell_source_set);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "spell_source", PROPERTY_HINT_RESOURCE_TYPE, "Spell"), "spell_source_set", "spell_source_get");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("aura_source_get"), &SpellDamageInfo::aura_source_get);
|
||||
ClassDB::bind_method(D_METHOD("aura_source_set", "value"), &SpellDamageInfo::aura_source_set);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_source", PROPERTY_HINT_RESOURCE_TYPE, "Aura"), "aura_source_set", "aura_source_get");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("source_get_id"), &SpellDamageInfo::source_get_id);
|
||||
ClassDB::bind_method(D_METHOD("source_set_id", "value"), &SpellDamageInfo::source_set_id);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "damage_source_id"), "source_set_id", "source_get_id");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "source_id"), "source_set_id", "source_get_id");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("source_get_type"), &SpellDamageInfo::source_get_type);
|
||||
ClassDB::bind_method(D_METHOD("source_set_type", "value"), &SpellDamageInfo::source_set_type);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "damage_source_type", PROPERTY_HINT_ENUM, "Unknown,Spell,Aura"), "source_set_type", "source_get_type");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "source_type"), "source_set_type", "source_get_type");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("reset"), &SpellDamageInfo::reset);
|
||||
|
||||
BIND_ENUM_CONSTANT(DAMAGE_SOURCE_UNKNOWN);
|
||||
BIND_ENUM_CONSTANT(DAMAGE_SOURCE_SPELL);
|
||||
BIND_ENUM_CONSTANT(DAMAGE_SOURCE_AURA);
|
||||
BIND_CONSTANT(DAMAGE_SOURCE_UNKNOWN);
|
||||
BIND_CONSTANT(DAMAGE_SOURCE_SPELL);
|
||||
BIND_CONSTANT(DAMAGE_SOURCE_AURA);
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ class SpellDamageInfo : public Reference {
|
||||
|
||||
public:
|
||||
enum DamageSourceType {
|
||||
DAMAGE_SOURCE_UNKNOWN,
|
||||
DAMAGE_SOURCE_UNKNOWN = 0,
|
||||
DAMAGE_SOURCE_SPELL,
|
||||
DAMAGE_SOURCE_AURA,
|
||||
};
|
||||
@ -45,20 +45,20 @@ protected:
|
||||
static void _bind_methods();
|
||||
|
||||
public:
|
||||
bool get_immune();
|
||||
void set_immune(bool value);
|
||||
bool get_immune() const;
|
||||
void set_immune(const bool value);
|
||||
|
||||
int damage_get();
|
||||
void damage_set(int value);
|
||||
int damage_get() const;
|
||||
void damage_set(const int value);
|
||||
|
||||
bool crit_get();
|
||||
void crit_set(bool value);
|
||||
bool crit_get() const;
|
||||
void crit_set(const bool value);
|
||||
|
||||
int amount_absorbed_get();
|
||||
void amount_absorbed_set(int value);
|
||||
int amount_absorbed_get() const;
|
||||
void amount_absorbed_set(const int value);
|
||||
|
||||
SpellEnums::SpellType spell_type_get();
|
||||
void spell_type_set(SpellEnums::SpellType value);
|
||||
int damage_type_get() const;
|
||||
void damage_type_set(const int value);
|
||||
|
||||
Entity *dealer_get();
|
||||
void dealer_set(Entity *value);
|
||||
@ -72,16 +72,16 @@ public:
|
||||
void source_set(Ref<Reference> value);
|
||||
|
||||
Ref<Spell> spell_source_get();
|
||||
void spell_source_set(Ref<Spell> value);
|
||||
void spell_source_set(const Ref<Spell> &value);
|
||||
|
||||
Ref<Aura> aura_source_get();
|
||||
void aura_source_set(Ref<Aura> value);
|
||||
void aura_source_set(const Ref<Aura> &value);
|
||||
|
||||
int source_get_id();
|
||||
void source_set_id(int value);
|
||||
int source_get_id() const;
|
||||
void source_set_id(const int value);
|
||||
|
||||
DamageSourceType source_get_type();
|
||||
void source_set_type(DamageSourceType value);
|
||||
int source_get_type() const;
|
||||
void source_set_type(const int value);
|
||||
|
||||
void reset();
|
||||
|
||||
@ -98,9 +98,9 @@ private:
|
||||
int _original_damage;
|
||||
int _amount_absorbed;
|
||||
bool _crit;
|
||||
SpellEnums::SpellType _spell_type;
|
||||
int _damage_type;
|
||||
|
||||
DamageSourceType _damage_source_type;
|
||||
int _damage_source_type;
|
||||
Ref<Reference> _damage_source;
|
||||
int _damage_source_id;
|
||||
|
||||
@ -111,6 +111,4 @@ private:
|
||||
NodePath _receiver_path;
|
||||
};
|
||||
|
||||
VARIANT_ENUM_CAST(SpellDamageInfo::DamageSourceType);
|
||||
|
||||
#endif
|
||||
|
@ -30,11 +30,11 @@ SOFTWARE.
|
||||
|
||||
#include "../defines.h"
|
||||
|
||||
bool SpellHealInfo::get_immune() {
|
||||
return _immune;
|
||||
bool SpellHealInfo::get_immune() const {
|
||||
return _crit;
|
||||
}
|
||||
void SpellHealInfo::set_immune(bool value) {
|
||||
_immune = value;
|
||||
void SpellHealInfo::set_immune(const bool value) {
|
||||
_crit = value;
|
||||
}
|
||||
|
||||
int SpellHealInfo::heal_get() {
|
||||
@ -45,35 +45,34 @@ void SpellHealInfo::heal_set(int value) {
|
||||
_heal = value;
|
||||
}
|
||||
|
||||
bool SpellHealInfo::crit_get() {
|
||||
bool SpellHealInfo::crit_get() const {
|
||||
return _crit;
|
||||
}
|
||||
|
||||
void SpellHealInfo::crit_set(bool value) {
|
||||
void SpellHealInfo::crit_set(const bool value) {
|
||||
_crit = value;
|
||||
}
|
||||
|
||||
int SpellHealInfo::amount_absorbed_get() {
|
||||
int SpellHealInfo::amount_absorbed_get() const {
|
||||
return _amount_absorbed;
|
||||
}
|
||||
|
||||
void SpellHealInfo::amount_absorbed_set(int value) {
|
||||
void SpellHealInfo::amount_absorbed_set(const int value) {
|
||||
_amount_absorbed = value;
|
||||
}
|
||||
|
||||
SpellEnums::SpellType SpellHealInfo::spell_type_get() {
|
||||
return _spell_type;
|
||||
int SpellHealInfo::heal_type_get() const {
|
||||
return _heal_type;
|
||||
}
|
||||
|
||||
void SpellHealInfo::spell_type_set(SpellEnums::SpellType value) {
|
||||
_spell_type = value;
|
||||
void SpellHealInfo::heal_type_set(const int value) {
|
||||
_heal_type = value;
|
||||
}
|
||||
|
||||
Entity *SpellHealInfo::dealer_get() {
|
||||
return _dealer;
|
||||
}
|
||||
|
||||
void SpellHealInfo::dealer_set(Node *value) {
|
||||
void SpellHealInfo::dealer_set(Entity *value) {
|
||||
_dealer = value;
|
||||
}
|
||||
void SpellHealInfo::dealer_set_bind(Node *value) {
|
||||
if (!value) {
|
||||
return;
|
||||
}
|
||||
@ -90,8 +89,10 @@ void SpellHealInfo::dealer_set(Node *value) {
|
||||
Entity *SpellHealInfo::receiver_get() {
|
||||
return _receiver;
|
||||
}
|
||||
|
||||
void SpellHealInfo::receiver_set(Node *value) {
|
||||
void SpellHealInfo::receiver_set(Entity *value) {
|
||||
_receiver = value;
|
||||
}
|
||||
void SpellHealInfo::receiver_set_bind(Node *value) {
|
||||
if (!value) {
|
||||
return;
|
||||
}
|
||||
@ -108,51 +109,53 @@ void SpellHealInfo::receiver_set(Node *value) {
|
||||
Ref<Reference> SpellHealInfo::source_get() {
|
||||
return _heal_source;
|
||||
}
|
||||
|
||||
void SpellHealInfo::source_set(Ref<Reference> value) {
|
||||
_heal_source_type = HEAL_SOURCE_UNKNOWN;
|
||||
_heal_source = value;
|
||||
_heal_source_id = 0;
|
||||
|
||||
if (value->has_method("get_id")) {
|
||||
_heal_source_id = value->call("get_id");
|
||||
}
|
||||
}
|
||||
|
||||
Ref<Spell> SpellHealInfo::spell_source_get() {
|
||||
return Ref<Spell>(_heal_source);
|
||||
}
|
||||
|
||||
void SpellHealInfo::spell_source_set(Ref<Spell> value) {
|
||||
void SpellHealInfo::spell_source_set(const Ref<Spell> &value) {
|
||||
_heal_source_type = HEAL_SOURCE_SPELL;
|
||||
_heal_source = value;
|
||||
|
||||
ERR_FAIL_COND(!value.is_valid());
|
||||
|
||||
_heal_source_id = value->get_id();
|
||||
if (value.is_valid())
|
||||
_heal_source_id = value->get_id();
|
||||
}
|
||||
|
||||
Ref<Aura> SpellHealInfo::aura_source_get() {
|
||||
return Ref<Aura>(_heal_source);
|
||||
}
|
||||
|
||||
void SpellHealInfo::aura_source_set(Ref<Aura> value) {
|
||||
void SpellHealInfo::aura_source_set(const Ref<Aura> &value) {
|
||||
_heal_source_type = HEAL_SOURCE_AURA;
|
||||
_heal_source = value;
|
||||
|
||||
ERR_FAIL_COND(!value.is_valid());
|
||||
|
||||
_heal_source_id = value->get_id();
|
||||
if (value.is_valid())
|
||||
_heal_source_id = value->get_id();
|
||||
}
|
||||
|
||||
int SpellHealInfo::source_get_id() {
|
||||
int SpellHealInfo::source_get_id() const {
|
||||
return _heal_source_id;
|
||||
}
|
||||
|
||||
void SpellHealInfo::source_set_id(int value) {
|
||||
void SpellHealInfo::source_set_id(const int value) {
|
||||
_heal_source_id = value;
|
||||
}
|
||||
|
||||
SpellHealInfo::HealSourceType SpellHealInfo::source_get_type() {
|
||||
int SpellHealInfo::source_get_type() const {
|
||||
return _heal_source_type;
|
||||
}
|
||||
|
||||
void SpellHealInfo::source_set_type(HealSourceType value) {
|
||||
void SpellHealInfo::source_set_type(const int value) {
|
||||
_heal_source_type = value;
|
||||
}
|
||||
|
||||
@ -190,7 +193,8 @@ Dictionary SpellHealInfo::to_dict() {
|
||||
dict["amount_absorbed"] = _amount_absorbed;
|
||||
dict["crit"] = _crit;
|
||||
|
||||
dict["spell_type"] = _spell_type;
|
||||
dict["heal_type"] = _heal_type;
|
||||
|
||||
dict["heal_source_type"] = _heal_source_type;
|
||||
dict["heal_source_id"] = _heal_source_id;
|
||||
|
||||
@ -205,32 +209,30 @@ void SpellHealInfo::from_dict(const Dictionary &dict) {
|
||||
_original_heal = dict.get("original_heal", 0);
|
||||
_amount_absorbed = dict.get("amount_absorbed", 0);
|
||||
_crit = dict.get("crit", false);
|
||||
_heal_type = dict.get("heal_type", SpellEnums::SPELL_TYPE_NONE);
|
||||
|
||||
_spell_type = static_cast<SpellEnums::SpellType>(static_cast<int>(dict.get("spell_type", SpellEnums::SPELL_TYPE_NONE)));
|
||||
_heal_source_type = static_cast<HealSourceType>(static_cast<int>(dict.get("heal_source_type", HEAL_SOURCE_UNKNOWN)));
|
||||
_heal_source_type = dict.get("heal_source_type", HEAL_SOURCE_UNKNOWN);
|
||||
_heal_source_id = dict.get("heal_source_id", 0);
|
||||
}
|
||||
|
||||
SpellHealInfo::SpellHealInfo() {
|
||||
_immune = false;
|
||||
_heal = 0;
|
||||
_original_heal = 0;
|
||||
_crit = false;
|
||||
_spell_type = SpellEnums::SPELL_TYPE_NONE;
|
||||
_heal_type = 0;
|
||||
_dealer = NULL;
|
||||
_receiver = NULL;
|
||||
_heal_source_type = HEAL_SOURCE_UNKNOWN;
|
||||
//Ref<Reference> _heal_source = Ref<;
|
||||
_heal_source_id = 0;
|
||||
_immune = false;
|
||||
}
|
||||
|
||||
SpellHealInfo::~SpellHealInfo() {
|
||||
//_dealer = NULL;
|
||||
//_receiver = NULL;
|
||||
//_heal_source = Ref<Reference>(NULL);
|
||||
_heal_source.unref();
|
||||
}
|
||||
|
||||
void SpellHealInfo::_bind_methods() {
|
||||
|
||||
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");
|
||||
@ -247,33 +249,41 @@ void SpellHealInfo::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("amount_absorbed_set", "value"), &SpellHealInfo::amount_absorbed_set);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "amount_absorbed"), "amount_absorbed_set", "amount_absorbed_get");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("spell_type_get"), &SpellHealInfo::spell_type_get);
|
||||
ClassDB::bind_method(D_METHOD("spell_type_set", "value"), &SpellHealInfo::spell_type_set);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "spell_type", PROPERTY_HINT_ENUM, "None, Melee, Magic"), "spell_type_set", "spell_type_get");
|
||||
ClassDB::bind_method(D_METHOD("heal_type_get"), &SpellHealInfo::heal_type_get);
|
||||
ClassDB::bind_method(D_METHOD("heal_type_set", "value"), &SpellHealInfo::heal_type_set);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "heal_type_get"), "heal_type_set", "heal_type_get");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("dealer_get"), &SpellHealInfo::dealer_get);
|
||||
ClassDB::bind_method(D_METHOD("dealer_set", "value"), &SpellHealInfo::dealer_set);
|
||||
ClassDB::bind_method(D_METHOD("dealer_set", "value"), &SpellHealInfo::dealer_set_bind);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "dealer", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), "dealer_set", "dealer_get");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("receiver_get"), &SpellHealInfo::receiver_get);
|
||||
ClassDB::bind_method(D_METHOD("receiver_set", "value"), &SpellHealInfo::receiver_set);
|
||||
ClassDB::bind_method(D_METHOD("receiver_set", "value"), &SpellHealInfo::receiver_set_bind);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "receiver", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), "receiver_set", "receiver_get");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("source_get"), &SpellHealInfo::source_get);
|
||||
ClassDB::bind_method(D_METHOD("source_set", "value"), &SpellHealInfo::source_set);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "heal_source", PROPERTY_HINT_RESOURCE_TYPE, "Resource"), "source_set", "source_get");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "source", PROPERTY_HINT_RESOURCE_TYPE, "Resource"), "source_set", "source_get");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("spell_source_get"), &SpellHealInfo::spell_source_get);
|
||||
ClassDB::bind_method(D_METHOD("spell_source_set", "value"), &SpellHealInfo::spell_source_set);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "spell_source", PROPERTY_HINT_RESOURCE_TYPE, "Spell"), "spell_source_set", "spell_source_get");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("aura_source_get"), &SpellHealInfo::aura_source_get);
|
||||
ClassDB::bind_method(D_METHOD("aura_source_set", "value"), &SpellHealInfo::aura_source_set);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_source", PROPERTY_HINT_RESOURCE_TYPE, "Aura"), "aura_source_set", "aura_source_get");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("source_get_id"), &SpellHealInfo::source_get_id);
|
||||
ClassDB::bind_method(D_METHOD("source_set_id", "value"), &SpellHealInfo::source_set_id);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "heal_source_id"), "source_set_id", "source_get_id");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "source_id"), "source_set_id", "source_get_id");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("source_get_type"), &SpellHealInfo::source_get_type);
|
||||
ClassDB::bind_method(D_METHOD("source_set_type", "value"), &SpellHealInfo::source_set_type);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "heal_source_type", PROPERTY_HINT_ENUM, "Unknown, Spell, Aura"), "source_set_type", "source_get_type");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "source_type"), "source_set_type", "source_get_type");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("reset"), &SpellHealInfo::reset);
|
||||
|
||||
BIND_ENUM_CONSTANT(HEAL_SOURCE_UNKNOWN);
|
||||
BIND_ENUM_CONSTANT(HEAL_SOURCE_SPELL);
|
||||
BIND_ENUM_CONSTANT(HEAL_SOURCE_AURA);
|
||||
BIND_CONSTANT(HEAL_SOURCE_UNKNOWN);
|
||||
BIND_CONSTANT(HEAL_SOURCE_SPELL);
|
||||
BIND_CONSTANT(HEAL_SOURCE_AURA);
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ class SpellHealInfo : public Reference {
|
||||
|
||||
public:
|
||||
enum HealSourceType {
|
||||
HEAL_SOURCE_UNKNOWN,
|
||||
HEAL_SOURCE_UNKNOWN = 0,
|
||||
HEAL_SOURCE_SPELL,
|
||||
HEAL_SOURCE_AURA,
|
||||
};
|
||||
@ -45,41 +45,46 @@ protected:
|
||||
static void _bind_methods();
|
||||
|
||||
public:
|
||||
bool get_immune();
|
||||
void set_immune(bool value);
|
||||
|
||||
int heal_get();
|
||||
void heal_set(int value);
|
||||
|
||||
bool crit_get();
|
||||
void crit_set(bool value);
|
||||
bool get_immune() const;
|
||||
void set_immune(const bool value);
|
||||
|
||||
int amount_absorbed_get();
|
||||
void amount_absorbed_set(int value);
|
||||
int damage_get() const;
|
||||
void damage_set(const int value);
|
||||
|
||||
SpellEnums::SpellType spell_type_get();
|
||||
void spell_type_set(SpellEnums::SpellType value);
|
||||
bool crit_get() const;
|
||||
void crit_set(const bool value);
|
||||
|
||||
int amount_absorbed_get() const;
|
||||
void amount_absorbed_set(const int value);
|
||||
|
||||
int heal_type_get() const;
|
||||
void heal_type_set(const int value);
|
||||
|
||||
Entity *dealer_get();
|
||||
void dealer_set(Node *value);
|
||||
void dealer_set(Entity *value);
|
||||
void dealer_set_bind(Node *value);
|
||||
|
||||
Entity *receiver_get();
|
||||
void receiver_set(Node *value);
|
||||
void receiver_set(Entity *value);
|
||||
void receiver_set_bind(Node *value);
|
||||
|
||||
Ref<Reference> source_get();
|
||||
void source_set(Ref<Reference> value);
|
||||
|
||||
Ref<Spell> spell_source_get();
|
||||
void spell_source_set(Ref<Spell> value);
|
||||
void spell_source_set(const Ref<Spell> &value);
|
||||
|
||||
Ref<Aura> aura_source_get();
|
||||
void aura_source_set(Ref<Aura> value);
|
||||
void aura_source_set(const Ref<Aura> &value);
|
||||
|
||||
int source_get_id();
|
||||
void source_set_id(int value);
|
||||
int source_get_id() const;
|
||||
void source_set_id(const int value);
|
||||
|
||||
HealSourceType source_get_type();
|
||||
void source_set_type(HealSourceType value);
|
||||
int source_get_type() const;
|
||||
void source_set_type(const int value);
|
||||
|
||||
void reset();
|
||||
|
||||
@ -96,9 +101,9 @@ private:
|
||||
int _original_heal;
|
||||
int _amount_absorbed;
|
||||
bool _crit;
|
||||
SpellEnums::SpellType _spell_type;
|
||||
int _heal_type;
|
||||
|
||||
HealSourceType _heal_source_type;
|
||||
int _heal_source_type;
|
||||
Ref<Reference> _heal_source;
|
||||
int _heal_source_id;
|
||||
|
||||
@ -109,6 +114,4 @@ private:
|
||||
NodePath _receiver_path;
|
||||
};
|
||||
|
||||
VARIANT_ENUM_CAST(SpellHealInfo::HealSourceType);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user