2019-04-20 14:02:55 +02:00
|
|
|
#include "aura_infos.h"
|
|
|
|
|
|
|
|
#include "../data/aura.h"
|
|
|
|
|
|
|
|
Entity *AuraApplyInfo::get_caster() const {
|
2020-01-09 04:27:19 +01:00
|
|
|
return _caster;
|
2019-04-20 14:02:55 +02:00
|
|
|
}
|
|
|
|
|
2019-08-05 01:36:33 +02:00
|
|
|
void AuraApplyInfo::set_caster(Entity *value) {
|
|
|
|
_caster = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
void AuraApplyInfo::set_caster_bind(Node *caster) {
|
2020-01-09 04:27:19 +01:00
|
|
|
if (!caster) {
|
|
|
|
return;
|
|
|
|
}
|
2019-04-20 14:02:55 +02:00
|
|
|
|
2020-01-09 04:27:19 +01:00
|
|
|
Entity *e = Object::cast_to<Entity>(caster);
|
2019-04-20 14:02:55 +02:00
|
|
|
|
2020-01-09 04:27:19 +01:00
|
|
|
if (!e) {
|
|
|
|
return;
|
|
|
|
}
|
2019-04-20 14:02:55 +02:00
|
|
|
|
2020-01-09 04:27:19 +01:00
|
|
|
_caster = e;
|
2019-04-20 14:02:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Entity *AuraApplyInfo::get_target() const {
|
2020-01-09 04:27:19 +01:00
|
|
|
return _target;
|
2019-04-20 14:02:55 +02:00
|
|
|
}
|
|
|
|
|
2019-08-05 01:36:33 +02:00
|
|
|
void AuraApplyInfo::set_target(Entity *value) {
|
|
|
|
_target = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
void AuraApplyInfo::set_target_bind(Node *caster) {
|
2020-01-09 04:27:19 +01:00
|
|
|
if (!caster) {
|
|
|
|
return;
|
|
|
|
}
|
2019-04-20 14:02:55 +02:00
|
|
|
|
2020-01-09 04:27:19 +01:00
|
|
|
Entity *e = Object::cast_to<Entity>(caster);
|
2019-04-20 14:02:55 +02:00
|
|
|
|
2020-01-09 04:27:19 +01:00
|
|
|
if (!e) {
|
|
|
|
return;
|
|
|
|
}
|
2019-04-20 14:02:55 +02:00
|
|
|
|
2020-01-09 04:27:19 +01:00
|
|
|
_target = e;
|
2019-04-20 14:02:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
float AuraApplyInfo::get_spell_scale() const {
|
2020-01-09 04:27:19 +01:00
|
|
|
return _spell_scale;
|
2019-04-20 14:02:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void AuraApplyInfo::set_spell_scale(float value) {
|
2020-01-09 04:27:19 +01:00
|
|
|
_spell_scale = value;
|
2019-04-20 14:02:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Ref<Aura> AuraApplyInfo::get_aura() const {
|
2020-01-09 04:27:19 +01:00
|
|
|
return Ref<Aura>(_aura);
|
2019-04-20 14:02:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void AuraApplyInfo::set_aura(Ref<Aura> aura) {
|
2020-01-09 04:27:19 +01:00
|
|
|
_aura = (*aura);
|
2019-04-20 14:02:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
AuraApplyInfo::AuraApplyInfo() {
|
|
|
|
_caster = NULL;
|
|
|
|
_target = NULL;
|
|
|
|
_spell_scale = 0;
|
|
|
|
_aura = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
AuraApplyInfo::AuraApplyInfo(Entity *caster, Entity *target, float spell_scale, Aura *aura) {
|
|
|
|
_caster = caster;
|
|
|
|
_target = target;
|
|
|
|
_spell_scale = spell_scale;
|
|
|
|
_aura = aura;
|
|
|
|
}
|
|
|
|
|
|
|
|
AuraApplyInfo::AuraApplyInfo(Entity *caster, Entity *target, float spell_scale) {
|
|
|
|
_caster = caster;
|
|
|
|
_target = target;
|
|
|
|
_spell_scale = spell_scale;
|
|
|
|
_aura = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void AuraApplyInfo::_bind_methods() {
|
2020-01-09 04:27:19 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("get_caster"), &AuraApplyInfo::get_caster);
|
|
|
|
ClassDB::bind_method(D_METHOD("set_caster", "caster"), &AuraApplyInfo::set_caster_bind);
|
2019-04-20 14:02:55 +02:00
|
|
|
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);
|
2019-08-05 01:36:33 +02:00
|
|
|
ClassDB::bind_method(D_METHOD("set_target", "target"), &AuraApplyInfo::set_target_bind);
|
2019-04-20 14:02:55 +02:00
|
|
|
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "target", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), "set_target", "get_target");
|
|
|
|
|
2020-01-09 04:27:19 +01:00
|
|
|
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);
|
2019-04-20 14:02:55 +02:00
|
|
|
ADD_PROPERTY(PropertyInfo(Variant::REAL, "spell_scale"), "set_spell_scale", "get_spell_scale");
|
|
|
|
|
2020-01-09 04:27:19 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("get_aura"), &AuraApplyInfo::get_aura);
|
|
|
|
ClassDB::bind_method(D_METHOD("set_aura", "aura"), &AuraApplyInfo::set_aura);
|
2019-04-20 14:02:55 +02:00
|
|
|
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura", PROPERTY_HINT_RESOURCE_TYPE, "Aura"), "set_aura", "get_aura");
|
|
|
|
}
|