mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-04-19 21:33:15 +02:00
A lot of work, mostly on the entity bindings. Added a lot of callbacks, and fixed a few bugs.
This commit is contained in:
parent
4f3c21a0cf
commit
c3828efe05
308
data/aura.cpp
308
data/aura.cpp
@ -77,28 +77,6 @@ void Aura::set_ability_scale_data_id(int value) {
|
||||
ability_scale_data_id = value;
|
||||
}
|
||||
|
||||
/*
|
||||
AnimationCurve *Aura::getDamageLevelScaling() {
|
||||
return this->damageLevelScaling;
|
||||
}
|
||||
|
||||
AnimationCurve *Aura::getAbsorbLevelScaling() {
|
||||
return this->absorbLevelScaling;
|
||||
}
|
||||
|
||||
AnimationCurve *Aura::getHealLevelScaling() {
|
||||
return this->healLevelScaling;
|
||||
}*/
|
||||
|
||||
/*
|
||||
void Aura::Start() {
|
||||
AbilityScalingDataLoader::getInstance()->GetData(this->abilityScaleDataId)->RegisterOnAssetLoaded(new AbilityScalingDataLoaderHelper::AssetLoadedAction(DELEGATE_FUNC(Aura::OnAuraAbilityScalingDataLoaded, _1)));
|
||||
if (this->AuraEffectData->Enabled) {
|
||||
this->AuraEffectData->LoadEffect();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
float Aura::get_damage_scale_for_level(int level) {
|
||||
//return this->getDamageLevelScaling()->Evaluate((float)(level));
|
||||
return 1;
|
||||
@ -427,7 +405,7 @@ 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);
|
||||
}
|
||||
@ -460,109 +438,124 @@ void Aura::supdate(Ref<AuraData> aura, float delta) {
|
||||
call("_supdate", aura, delta);
|
||||
}
|
||||
|
||||
void Aura::son_before_cast(Ref<SpellCastInfo> info) {
|
||||
void Aura::son_before_cast(Ref<AuraData> aura, Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_son_before_cast"))
|
||||
call("_son_before_cast", info);
|
||||
call("_son_before_cast", aura, info);
|
||||
}
|
||||
|
||||
void Aura::son_before_cast_target(Ref<SpellCastInfo> info) {
|
||||
void Aura::son_before_cast_target(Ref<AuraData> aura, Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_son_before_cast_target"))
|
||||
call("_son_before_cast_target", info);
|
||||
call("_son_before_cast_target", aura, info);
|
||||
}
|
||||
|
||||
void Aura::son_cast_finished(Ref<SpellCastInfo> info) {
|
||||
void Aura::son_cast_finished(Ref<AuraData> aura, Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_son_cast_finished"))
|
||||
call("_son_cast_finished", info);
|
||||
call("_son_cast_finished", aura, info);
|
||||
}
|
||||
|
||||
void Aura::son_cast_started(Ref<SpellCastInfo> info) {
|
||||
void Aura::son_cast_started(Ref<AuraData> aura, Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_son_cast_started"))
|
||||
call("_son_cast_started", info);
|
||||
call("_son_cast_started", aura, info);
|
||||
}
|
||||
|
||||
void Aura::son_cast_failed(Ref<SpellCastInfo> info) {
|
||||
void Aura::son_cast_failed(Ref<AuraData> aura, Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_son_cast_failed"))
|
||||
call("_son_cast_failed", info);
|
||||
call("_son_cast_failed", aura, info);
|
||||
}
|
||||
|
||||
void Aura::son_cast_finished_target(Ref<SpellCastInfo> info) {
|
||||
void Aura::son_cast_finished_target(Ref<AuraData> aura, Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_son_cast_finished_target"))
|
||||
call("_son_cast_finished_target", info);
|
||||
call("_son_cast_finished_target", aura, info);
|
||||
}
|
||||
|
||||
void Aura::son_hit(Ref<SpellDamageInfo> data) {
|
||||
void Aura::son_hit(Ref<AuraData> aura, Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
if (has_method("_son_hit"))
|
||||
call("_son_hit", data);
|
||||
call("_son_hit", aura, data);
|
||||
}
|
||||
|
||||
void Aura::son_before_damage(Ref<SpellDamageInfo> data) {
|
||||
void Aura::son_before_damage(Ref<AuraData> aura, Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
if (has_method("_son_before_damage"))
|
||||
call("_son_before_damage", data);
|
||||
call("_son_before_damage", aura, data);
|
||||
}
|
||||
|
||||
void Aura::son_damage_receive(Ref<SpellDamageInfo> data) {
|
||||
void Aura::son_damage_receive(Ref<AuraData> aura, Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
if (has_method("_son_damage_receive"))
|
||||
call("_son_damage_receive", data);
|
||||
call("_son_damage_receive", aura, data);
|
||||
}
|
||||
|
||||
void Aura::son_dealt_damage(Ref<SpellDamageInfo> data) {
|
||||
void Aura::son_dealt_damage(Ref<AuraData> aura, Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
if (has_method("_son_dealt_damage"))
|
||||
call("_son_dealt_damage", data);
|
||||
call("_son_dealt_damage", aura, data);
|
||||
}
|
||||
|
||||
void Aura::son_damage_dealt(Ref<SpellDamageInfo> data) {
|
||||
void Aura::son_damage_dealt(Ref<AuraData> aura, Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
if (has_method("_son_damage_dealt"))
|
||||
call("_son_damage_dealt", data);
|
||||
call("_son_damage_dealt", aura, data);
|
||||
}
|
||||
|
||||
void Aura::son_before_heal(Ref<SpellHealInfo> data) {
|
||||
void Aura::son_before_heal(Ref<AuraData> aura, Ref<SpellHealInfo> data) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
if (has_method("_son_before_heal"))
|
||||
call("_son_before_heal", data);
|
||||
call("_son_before_heal", aura, data);
|
||||
}
|
||||
|
||||
void Aura::son_heal_receive(Ref<SpellHealInfo> data) {
|
||||
void Aura::son_heal_receive(Ref<AuraData> aura, Ref<SpellHealInfo> data) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
if (has_method("_son_heal_receive"))
|
||||
call("_son_heal_receive", data);
|
||||
call("_son_heal_receive", aura, data);
|
||||
}
|
||||
|
||||
void Aura::son_dealt_heal(Ref<SpellHealInfo> data) {
|
||||
void Aura::son_dealt_heal(Ref<AuraData> aura, Ref<SpellHealInfo> data) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
if (has_method("_son_dealt_heal"))
|
||||
call("_son_dealt_heal", data);
|
||||
call("_son_dealt_heal", aura, data);
|
||||
}
|
||||
|
||||
void Aura::son_heal_dealt(Ref<SpellHealInfo> data) {
|
||||
void Aura::son_heal_dealt(Ref<AuraData> aura, Ref<SpellHealInfo> data) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
if (has_method("_son_heal_dealt"))
|
||||
call("_son_heal_dealt", data);
|
||||
call("_son_heal_dealt", aura, data);
|
||||
}
|
||||
|
||||
void Aura::son_remove_expired(Ref<AuraData> aura) {
|
||||
@ -605,6 +598,67 @@ void Aura::son_death(Ref<AuraData> data) {
|
||||
call("_son_death", data);
|
||||
}
|
||||
|
||||
void Aura::son_cooldown_added(Ref<AuraData> data, Ref<Cooldown> cooldown) {
|
||||
if (has_method("_son_cooldown_added"))
|
||||
call("_son_cooldown_added", data, cooldown);
|
||||
}
|
||||
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);
|
||||
}
|
||||
void Aura::son_category_cooldown_removed(Ref<AuraData> data, Ref<CategoryCooldown> category_cooldown) {
|
||||
if (has_method("_son_category_cooldown_removed"))
|
||||
call("_son_category_cooldown_removed", data, category_cooldown);
|
||||
}
|
||||
|
||||
void Aura::con_cast_failed(Ref<AuraData> data, Ref<SpellCastInfo> info) {
|
||||
if (has_method("_con_cast_failed"))
|
||||
call("_con_cast_failed", data, info);
|
||||
}
|
||||
void Aura::con_cast_started(Ref<AuraData> data, Ref<SpellCastInfo> info) {
|
||||
if (has_method("_con_cast_started"))
|
||||
call("_con_cast_started", data, info);
|
||||
}
|
||||
void Aura::con_cast_state_changed(Ref<AuraData> data, Ref<SpellCastInfo> info) {
|
||||
if (has_method("_con_cast_state_changed"))
|
||||
call("_con_cast_state_changed", data, info);
|
||||
}
|
||||
void Aura::con_cast_finished(Ref<AuraData> data, Ref<SpellCastInfo> info) {
|
||||
if (has_method("_con_cast_finished"))
|
||||
call("_con_cast_finished", data, info);
|
||||
}
|
||||
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"))
|
||||
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);
|
||||
}
|
||||
void Aura::con_cooldown_removed(Ref<AuraData> data, Ref<Cooldown> cooldown) {
|
||||
if (has_method("_con_cooldown_removed"))
|
||||
call("_con_cooldown_removed", data, cooldown);
|
||||
}
|
||||
void Aura::con_category_cooldown_added(Ref<AuraData> data, Ref<CategoryCooldown> category_cooldown) {
|
||||
if (has_method("_con_category_cooldown_added"))
|
||||
call("_con_category_cooldown_added", data, category_cooldown);
|
||||
}
|
||||
void Aura::con_category_cooldown_removed(Ref<AuraData> data, Ref<CategoryCooldown> category_cooldown) {
|
||||
if (has_method("_con_category_cooldown_removed"))
|
||||
call("_con_category_cooldown_removed", data, category_cooldown);
|
||||
}
|
||||
|
||||
void Aura::con_aura_added(Ref<AuraData> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
@ -626,9 +680,36 @@ void Aura::con_aura_refresh(Ref<AuraData> data) {
|
||||
call("_con_aura_refresh", data);
|
||||
}
|
||||
|
||||
void Aura::con_death(Ref<AuraData> data) {
|
||||
if (has_method("_con_death"))
|
||||
call("_con_death", data);
|
||||
void Aura::con_damage_dealt(Ref<AuraData> data, Ref<SpellDamageInfo> info) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_con_damage_dealt"))
|
||||
call("_con_damage_dealt", data, 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);
|
||||
}
|
||||
|
||||
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){
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_con_dealt_heal"))
|
||||
call("_con_dealt_heal", data, info);
|
||||
}
|
||||
|
||||
void Aura::setup_aura_data(Ref<AuraData> data, Ref<AuraApplyInfo> info) {
|
||||
@ -859,24 +940,24 @@ void Aura::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("_supdate", "aura", "delta"), &Aura::_supdate);
|
||||
|
||||
//EventHandlers
|
||||
ClassDB::bind_method(D_METHOD("son_before_cast", "info"), &Aura::son_before_cast);
|
||||
ClassDB::bind_method(D_METHOD("son_before_cast_target", "info"), &Aura::son_before_cast_target);
|
||||
ClassDB::bind_method(D_METHOD("son_cast_started", "info"), &Aura::son_cast_started);
|
||||
ClassDB::bind_method(D_METHOD("son_cast_failed", "info"), &Aura::son_cast_failed);
|
||||
ClassDB::bind_method(D_METHOD("son_cast_finished", "info"), &Aura::son_cast_finished);
|
||||
ClassDB::bind_method(D_METHOD("son_cast_finished_target", "info"), &Aura::son_cast_finished_target);
|
||||
ClassDB::bind_method(D_METHOD("son_before_cast", "aura", "info"), &Aura::son_before_cast);
|
||||
ClassDB::bind_method(D_METHOD("son_before_cast_target", "aura", "info"), &Aura::son_before_cast_target);
|
||||
ClassDB::bind_method(D_METHOD("son_cast_started", "aura", "info"), &Aura::son_cast_started);
|
||||
ClassDB::bind_method(D_METHOD("son_cast_failed", "aura", "info"), &Aura::son_cast_failed);
|
||||
ClassDB::bind_method(D_METHOD("son_cast_finished", "aura", "info"), &Aura::son_cast_finished);
|
||||
ClassDB::bind_method(D_METHOD("son_cast_finished_target", "aura", "info"), &Aura::son_cast_finished_target);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("son_hit", "data"), &Aura::son_hit);
|
||||
ClassDB::bind_method(D_METHOD("son_hit", "aura", "data"), &Aura::son_hit);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("son_before_damage", "data"), &Aura::son_before_damage);
|
||||
ClassDB::bind_method(D_METHOD("son_damage_receive", "data"), &Aura::son_damage_receive);
|
||||
ClassDB::bind_method(D_METHOD("son_dealt_damage", "data"), &Aura::son_dealt_damage);
|
||||
ClassDB::bind_method(D_METHOD("son_damage_dealt", "data"), &Aura::son_damage_dealt);
|
||||
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", "data"), &Aura::son_before_heal);
|
||||
ClassDB::bind_method(D_METHOD("son_heal_receive", "data"), &Aura::son_heal_receive);
|
||||
ClassDB::bind_method(D_METHOD("son_dealt_heal", "data"), &Aura::son_dealt_heal);
|
||||
ClassDB::bind_method(D_METHOD("son_heal_dealt", "data"), &Aura::son_heal_dealt);
|
||||
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);
|
||||
ClassDB::bind_method(D_METHOD("son_heal_dealt", "aura", "data"), &Aura::son_heal_dealt);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("son_remove", "aura"), &Aura::son_remove);
|
||||
ClassDB::bind_method(D_METHOD("son_remove_expired", "aura"), &Aura::son_remove_expired);
|
||||
@ -886,25 +967,31 @@ void Aura::_bind_methods() {
|
||||
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_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);
|
||||
|
||||
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")));
|
||||
BIND_VMETHOD(MethodInfo("_son_cast_failed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_cast_finished", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
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_before_cast", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_before_cast_target", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_cast_started", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_cast_failed", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_cast_finished", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_cast_finished_target", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
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_hit", 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_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_damage_receive", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_dealt_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_damage_dealt", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_son_before_heal", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_heal_receive", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_dealt_heal", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_heal_dealt", 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")));
|
||||
BIND_VMETHOD(MethodInfo("_son_heal_dealt", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_son_remove", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData")));
|
||||
BIND_VMETHOD(MethodInfo("_son_remove_expired", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData")));
|
||||
@ -914,18 +1001,57 @@ void Aura::_bind_methods() {
|
||||
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_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")));
|
||||
BIND_VMETHOD(MethodInfo("_son_category_cooldown_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "category_cooldown", PROPERTY_HINT_RESOURCE_TYPE, "CategoryCooldown")));
|
||||
|
||||
//Clientside Event Handlers
|
||||
ClassDB::bind_method(D_METHOD("con_cast_failed", "data", "info"), &Aura::con_cast_failed);
|
||||
ClassDB::bind_method(D_METHOD("con_cast_started", "data", "info"), &Aura::con_cast_started);
|
||||
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_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_death", "data"), &Aura::con_death);
|
||||
|
||||
|
||||
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);
|
||||
|
||||
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_death", 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")));
|
||||
|
||||
//Calculations / Queries
|
||||
ClassDB::bind_method(D_METHOD("setup_aura_data", "data", "info"), &Aura::setup_aura_data);
|
||||
|
||||
|
58
data/aura.h
58
data/aura.h
@ -20,6 +20,9 @@
|
||||
#include "../pipelines/spell_heal_info.h"
|
||||
#include "../infos/spell_cast_info.h"
|
||||
|
||||
#include "../utility/cooldown.h"
|
||||
#include "../utility/category_cooldown.h"
|
||||
|
||||
class AuraApplyInfo;
|
||||
class AuraScript;
|
||||
class Entity;
|
||||
@ -206,24 +209,24 @@ public:
|
||||
virtual void _sremove_dispell(Ref<AuraData> aura);
|
||||
|
||||
//EventHandlers
|
||||
void son_before_cast(Ref<SpellCastInfo> info);
|
||||
void son_before_cast_target(Ref<SpellCastInfo> info);
|
||||
void son_cast_started(Ref<SpellCastInfo> info);
|
||||
void son_cast_failed(Ref<SpellCastInfo> info);
|
||||
void son_cast_finished(Ref<SpellCastInfo> info);
|
||||
void son_cast_finished_target(Ref<SpellCastInfo> info);
|
||||
void son_before_cast(Ref<AuraData> aura, Ref<SpellCastInfo> info);
|
||||
void son_before_cast_target(Ref<AuraData> aura, Ref<SpellCastInfo> info);
|
||||
void son_cast_started(Ref<AuraData> aura, Ref<SpellCastInfo> info);
|
||||
void son_cast_failed(Ref<AuraData> aura, Ref<SpellCastInfo> info);
|
||||
void son_cast_finished(Ref<AuraData> aura, Ref<SpellCastInfo> info);
|
||||
void son_cast_finished_target(Ref<AuraData> aura, Ref<SpellCastInfo> info);
|
||||
|
||||
void son_hit(Ref<SpellDamageInfo> data);
|
||||
void son_hit(Ref<AuraData> aura, 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_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(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_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);
|
||||
void son_heal_dealt(Ref<AuraData> aura, Ref<SpellHealInfo> data);
|
||||
|
||||
void son_remove(Ref<AuraData> aura);
|
||||
void son_remove_expired(Ref<AuraData> aura);
|
||||
@ -233,12 +236,35 @@ public:
|
||||
void son_after_aura_applied(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);
|
||||
|
||||
//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_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_death(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);
|
||||
|
||||
//Calculations / Queries
|
||||
void setup_aura_data(Ref<AuraData> data, Ref<AuraApplyInfo> info);
|
||||
|
@ -284,6 +284,98 @@ void CharacterClass::son_death_bind(Node *entity) {
|
||||
son_death(e);
|
||||
}
|
||||
|
||||
void CharacterClass::son_cooldown_added(Ref<Cooldown> cooldown) {
|
||||
if (has_method("_son_cooldown_added"))
|
||||
call("_son_cooldown_added", cooldown);
|
||||
}
|
||||
void CharacterClass::son_cooldown_removed(Ref<Cooldown> cooldown) {
|
||||
if (has_method("_son_cooldown_removed"))
|
||||
call("_son_cooldown_removed", cooldown);
|
||||
}
|
||||
|
||||
void CharacterClass::son_category_cooldown_added(Ref<CategoryCooldown> category_cooldown) {
|
||||
if (has_method("_son_category_cooldown_added"))
|
||||
call("_son_category_cooldown_added", category_cooldown);
|
||||
}
|
||||
void CharacterClass::son_category_cooldown_removed(Ref<CategoryCooldown> category_cooldown) {
|
||||
if (has_method("_son_category_cooldown_removed"))
|
||||
call("_son_category_cooldown_removed", category_cooldown);
|
||||
}
|
||||
|
||||
//Clientside Event Handlers
|
||||
void CharacterClass::con_cast_failed(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_con_cast_failed"))
|
||||
call("_con_cast_failed", info);
|
||||
}
|
||||
void CharacterClass::con_cast_started(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_con_cast_started"))
|
||||
call("_con_cast_started", info);
|
||||
}
|
||||
void CharacterClass::con_cast_state_changed(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_con_cast_state_changed"))
|
||||
call("_con_cast_state_changed", info);
|
||||
}
|
||||
void CharacterClass::con_cast_finished(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_con_cast_finished"))
|
||||
call("_con_cast_finished", info);
|
||||
}
|
||||
void CharacterClass::con_spell_cast_success(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_con_spell_cast_success"))
|
||||
call("_con_spell_cast_success", info);
|
||||
}
|
||||
|
||||
void CharacterClass::con_death(Entity *entity) {
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
|
||||
if (has_method("_con_death"))
|
||||
call("_con_death", entity);
|
||||
}
|
||||
|
||||
void CharacterClass::con_death_bind(Node *entity) {
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
ERR_FAIL_COND(e == NULL);
|
||||
|
||||
con_death(e);
|
||||
}
|
||||
|
||||
void CharacterClass::con_cooldown_added(Ref<Cooldown> cooldown) {
|
||||
ERR_FAIL_COND(!cooldown.is_valid());
|
||||
|
||||
if (has_method("_con_cooldown_added"))
|
||||
call("_con_cooldown_added", cooldown);
|
||||
}
|
||||
void CharacterClass::con_cooldown_removed(Ref<Cooldown> cooldown) {
|
||||
ERR_FAIL_COND(!cooldown.is_valid());
|
||||
|
||||
if (has_method("_con_cooldown_removed"))
|
||||
call("_con_cooldown_removed", cooldown);
|
||||
}
|
||||
void CharacterClass::con_category_cooldown_added(Ref<CategoryCooldown> category_cooldown) {
|
||||
ERR_FAIL_COND(!category_cooldown.is_valid());
|
||||
|
||||
if (has_method("_con_category_cooldown_added"))
|
||||
call("_con_category_cooldown_added", category_cooldown);
|
||||
}
|
||||
void CharacterClass::con_category_cooldown_removed(Ref<CategoryCooldown> category_cooldown) {
|
||||
ERR_FAIL_COND(!category_cooldown.is_valid());
|
||||
|
||||
if (has_method("_con_category_cooldown_removed"))
|
||||
call("_con_category_cooldown_removed", category_cooldown);
|
||||
}
|
||||
|
||||
void CharacterClass::con_aura_added(Ref<AuraData> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
@ -305,21 +397,35 @@ void CharacterClass::con_aura_refresh(Ref<AuraData> data) {
|
||||
call("_con_aura_refresh", data);
|
||||
}
|
||||
|
||||
void CharacterClass::con_death(Entity *entity) {
|
||||
if (has_method("_con_death"))
|
||||
call("_con_death", entity);
|
||||
void CharacterClass::con_damage_dealt(Ref<SpellDamageInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_con_damage_dealt"))
|
||||
call("_con_damage_dealt", info);
|
||||
}
|
||||
|
||||
void CharacterClass::con_death_bind(Node *entity) {
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
void CharacterClass::con_dealt_damage(Ref<SpellDamageInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
ERR_FAIL_COND(e == NULL);
|
||||
|
||||
con_death(e);
|
||||
if (has_method("_con_dealt_damage"))
|
||||
call("_con_dealt_damage", info);
|
||||
}
|
||||
|
||||
void CharacterClass::con_heal_dealt(Ref<SpellHealInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_con_heal_dealt"))
|
||||
call("_con_heal_dealt", info);
|
||||
}
|
||||
|
||||
void CharacterClass::con_dealt_heal(Ref<SpellHealInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_con_dealt_heal"))
|
||||
call("_con_dealt_heal", info);
|
||||
}
|
||||
|
||||
|
||||
void CharacterClass::sai_follow(Entity *entity) {
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
|
||||
@ -407,41 +513,6 @@ void CharacterClass::_validate_property(PropertyInfo &property) const {
|
||||
}
|
||||
|
||||
void CharacterClass::_bind_methods() {
|
||||
BIND_VMETHOD(MethodInfo("_son_before_cast", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_before_cast_target", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_cast_started", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_cast_failed", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_cast_finished", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_cast_finished_target", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_son_hit", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_son_before_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_damage_receive", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_dealt_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_damage_dealt", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_son_before_heal", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_heal_receive", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_dealt_heal", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_heal_dealt", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
|
||||
|
||||
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, "Entity")));
|
||||
|
||||
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_death", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "Entity")));
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_sai_follow", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity")));
|
||||
BIND_VMETHOD(MethodInfo("_sai_rest", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity")));
|
||||
BIND_VMETHOD(MethodInfo("_sai_regenerate", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity")));
|
||||
BIND_VMETHOD(MethodInfo("_sai_attack", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity")));
|
||||
|
||||
//EventHandlers
|
||||
ClassDB::bind_method(D_METHOD("son_before_cast", "info"), &CharacterClass::son_before_cast);
|
||||
ClassDB::bind_method(D_METHOD("son_before_cast_target", "info"), &CharacterClass::son_before_cast_target);
|
||||
@ -466,12 +537,83 @@ void CharacterClass::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("son_after_aura_applied", "data"), &CharacterClass::son_after_aura_applied);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("son_death", "data"), &CharacterClass::son_death_bind);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("son_cooldown_added", "cooldown"), &CharacterClass::son_cooldown_added);
|
||||
ClassDB::bind_method(D_METHOD("son_cooldown_removed", "cooldown"), &CharacterClass::son_cooldown_removed);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("son_category_cooldown_added", "category_cooldown"), &CharacterClass::son_category_cooldown_added);
|
||||
ClassDB::bind_method(D_METHOD("son_category_cooldown_removed", "category_cooldown"), &CharacterClass::son_category_cooldown_removed);
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_son_before_cast", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_before_cast_target", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_cast_started", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_cast_failed", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_cast_finished", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_cast_finished_target", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_son_hit", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_son_before_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_damage_receive", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_dealt_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_damage_dealt", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_son_before_heal", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_heal_receive", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_dealt_heal", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_son_heal_dealt", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
|
||||
|
||||
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, "Entity")));
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_sai_follow", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity")));
|
||||
BIND_VMETHOD(MethodInfo("_sai_rest", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity")));
|
||||
BIND_VMETHOD(MethodInfo("_sai_regenerate", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity")));
|
||||
BIND_VMETHOD(MethodInfo("_sai_attack", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity")));
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_son_cooldown_added", PropertyInfo(Variant::OBJECT, "cooldown", PROPERTY_HINT_RESOURCE_TYPE, "Cooldown")));
|
||||
BIND_VMETHOD(MethodInfo("_son_cooldown_removed", PropertyInfo(Variant::OBJECT, "cooldown", PROPERTY_HINT_RESOURCE_TYPE, "Cooldown")));
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_son_category_cooldown_added", PropertyInfo(Variant::OBJECT, "category_cooldown", PROPERTY_HINT_RESOURCE_TYPE, "CategoryCooldown")));
|
||||
BIND_VMETHOD(MethodInfo("_son_category_cooldown_removed", PropertyInfo(Variant::OBJECT, "category_cooldown", PROPERTY_HINT_RESOURCE_TYPE, "CategoryCooldown")));
|
||||
|
||||
|
||||
//Clientside Event Handlers
|
||||
ClassDB::bind_method(D_METHOD("con_cast_failed", "info"), &CharacterClass::con_cast_failed);
|
||||
ClassDB::bind_method(D_METHOD("con_cast_started", "info"), &CharacterClass::con_cast_started);
|
||||
ClassDB::bind_method(D_METHOD("con_cast_state_changed", "info"), &CharacterClass::con_cast_state_changed);
|
||||
ClassDB::bind_method(D_METHOD("con_cast_finished", "info"), &CharacterClass::con_cast_finished);
|
||||
ClassDB::bind_method(D_METHOD("con_spell_cast_success", "info"), &CharacterClass::con_spell_cast_success);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("con_death", "data"), &CharacterClass::con_death_bind);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("con_cooldown_added", "cooldown"), &CharacterClass::con_cooldown_added);
|
||||
ClassDB::bind_method(D_METHOD("con_cooldown_removed", "cooldown"), &CharacterClass::con_cooldown_removed);
|
||||
ClassDB::bind_method(D_METHOD("con_category_cooldown_added", "cooldown"), &CharacterClass::con_category_cooldown_added);
|
||||
ClassDB::bind_method(D_METHOD("con_category_cooldown_removed", "cooldown"), &CharacterClass::con_category_cooldown_removed);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("con_aura_added", "data"), &CharacterClass::con_aura_added);
|
||||
ClassDB::bind_method(D_METHOD("con_aura_removed", "data"), &CharacterClass::con_aura_removed);
|
||||
ClassDB::bind_method(D_METHOD("con_aura_refresh", "data"), &CharacterClass::con_aura_refresh);
|
||||
ClassDB::bind_method(D_METHOD("con_death", "data"), &CharacterClass::con_death_bind);
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_con_cast_failed", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_con_cast_started", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_con_cast_state_changed", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_con_cast_finished", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
BIND_VMETHOD(MethodInfo("_con_spell_cast_success", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_con_death", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "Entity")));
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_con_cooldown_added", PropertyInfo(Variant::OBJECT, "cooldown", PROPERTY_HINT_RESOURCE_TYPE, "Cooldown")));
|
||||
BIND_VMETHOD(MethodInfo("_con_cooldown_removed", PropertyInfo(Variant::OBJECT, "cooldown", PROPERTY_HINT_RESOURCE_TYPE, "Cooldown")));
|
||||
BIND_VMETHOD(MethodInfo("_con_category_cooldown_added", PropertyInfo(Variant::OBJECT, "category_cooldown", PROPERTY_HINT_RESOURCE_TYPE, "CategoryCooldown")));
|
||||
BIND_VMETHOD(MethodInfo("_con_category_cooldown_removed", 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")));
|
||||
|
||||
ClassDB::bind_method(D_METHOD("sai_follow", "entity"), &CharacterClass::sai_follow_bind);
|
||||
ClassDB::bind_method(D_METHOD("sai_rest", "entity"), &CharacterClass::sai_rest_bind);
|
||||
|
@ -14,6 +14,9 @@
|
||||
#include "../pipelines/spell_heal_info.h"
|
||||
#include "../infos/spell_cast_info.h"
|
||||
|
||||
#include "../utility/cooldown.h"
|
||||
#include "../utility/category_cooldown.h"
|
||||
|
||||
class Aura;
|
||||
class Spell;
|
||||
class Entity;
|
||||
@ -112,13 +115,35 @@ public:
|
||||
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);
|
||||
|
||||
//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_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_death(Entity *entity);
|
||||
void con_death_bind(Node *entity);
|
||||
|
||||
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);
|
||||
|
||||
// AI //
|
||||
void sai_follow(Entity *entity);
|
||||
|
@ -80,7 +80,11 @@ Entity *AuraData::get_owner() {
|
||||
return _owner;
|
||||
}
|
||||
|
||||
void AuraData::set_owner(Node *value) {
|
||||
void AuraData::set_owner(Entity *value) {
|
||||
_owner = value;
|
||||
}
|
||||
|
||||
void AuraData::set_owner_bind(Node *value) {
|
||||
if (!value) {
|
||||
return;
|
||||
}
|
||||
@ -98,7 +102,11 @@ Entity *AuraData::get_caster() {
|
||||
return _caster;
|
||||
}
|
||||
|
||||
void AuraData::set_caster(Node *value) {
|
||||
void AuraData::set_caster(Entity *value) {
|
||||
_caster = value;
|
||||
}
|
||||
|
||||
void AuraData::set_caster_bind(Node *value) {
|
||||
if (!value) {
|
||||
return;
|
||||
}
|
||||
@ -247,11 +255,11 @@ void AuraData::_bind_methods() {
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "remaining_time"), "set_remaining_time", "get_remaining_time");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_owner"), &AuraData::get_owner);
|
||||
ClassDB::bind_method(D_METHOD("set_owner", "value"), &AuraData::set_owner);
|
||||
ClassDB::bind_method(D_METHOD("set_owner", "value"), &AuraData::set_owner_bind);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "owner", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), "set_owner", "get_owner");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_caster"), &AuraData::get_caster);
|
||||
ClassDB::bind_method(D_METHOD("set_caster", "value"), &AuraData::set_caster);
|
||||
ClassDB::bind_method(D_METHOD("set_caster", "value"), &AuraData::set_caster_bind);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "caster", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), "set_caster", "get_caster");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_caster_guid"), &AuraData::get_caster_guid);
|
||||
|
@ -22,10 +22,12 @@ public:
|
||||
bool update(float delta);
|
||||
|
||||
Entity *get_owner();
|
||||
void set_owner(Node *value);
|
||||
void set_owner(Entity *value);
|
||||
void set_owner_bind(Node *value);
|
||||
|
||||
Entity *get_caster();
|
||||
void set_caster(Node *value);
|
||||
void set_caster(Entity *value);
|
||||
void set_caster_bind(Node *value);
|
||||
|
||||
int get_caster_guid();
|
||||
void set_caster_guid(int value);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -300,16 +300,16 @@ public:
|
||||
void son_before_aura_applied(Ref<AuraData> data);
|
||||
void son_after_aura_applied(Ref<AuraData> 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_hit(Ref<SpellDamageInfo> info);
|
||||
void son_before_damage(Ref<SpellDamageInfo> info);
|
||||
void son_damage_receive(Ref<SpellDamageInfo> info);
|
||||
void son_dealt_damage(Ref<SpellDamageInfo> info);
|
||||
void son_damage_dealt(Ref<SpellDamageInfo> info);
|
||||
|
||||
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_heal(Ref<SpellHealInfo> info);
|
||||
void son_heal_receive(Ref<SpellHealInfo> info);
|
||||
void son_dealt_heal(Ref<SpellHealInfo> info);
|
||||
void son_heal_dealt(Ref<SpellHealInfo> info);
|
||||
|
||||
void son_before_cast(Ref<SpellCastInfo> info);
|
||||
void son_before_cast_target(Ref<SpellCastInfo> info);
|
||||
@ -320,37 +320,53 @@ public:
|
||||
|
||||
void son_death();
|
||||
|
||||
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);
|
||||
|
||||
//Clientside EventHandlers
|
||||
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();
|
||||
|
||||
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);
|
||||
|
||||
//Clientside Event Handlers
|
||||
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);
|
||||
|
||||
//Modifiers/Requesters
|
||||
void sapply_passives_damage_receive(Ref<SpellDamageInfo> data);
|
||||
void sapply_passives_damage_deal(Ref<SpellDamageInfo> data);
|
||||
void sapply_passives_damage_receive(Ref<SpellDamageInfo> info);
|
||||
void sapply_passives_damage_deal(Ref<SpellDamageInfo> info);
|
||||
|
||||
void sapply_passives_heal_receive(Ref<SpellHealInfo> data);
|
||||
void sapply_passives_heal_deal(Ref<SpellHealInfo> data);
|
||||
void sapply_passives_heal_receive(Ref<SpellHealInfo> info);
|
||||
void sapply_passives_heal_deal(Ref<SpellHealInfo> info);
|
||||
|
||||
//Spell operations
|
||||
void scast_spell(int spell_id);
|
||||
void crequest_spell_cast(int spell_id);
|
||||
|
||||
//Damage Operations
|
||||
void stake_damage(Ref<SpellDamageInfo> data);
|
||||
void sdeal_damage_to(Ref<SpellDamageInfo> data);
|
||||
void stake_damage(Ref<SpellDamageInfo> info);
|
||||
void sdeal_damage_to(Ref<SpellDamageInfo> info);
|
||||
|
||||
//Heal Operations
|
||||
void stake_heal(Ref<SpellHealInfo> data);
|
||||
void sdeal_heal_to(Ref<SpellHealInfo> data);
|
||||
void stake_heal(Ref<SpellHealInfo> info);
|
||||
void sdeal_heal_to(Ref<SpellHealInfo> info);
|
||||
|
||||
//Aura Manipulation
|
||||
void sadd_aura(Ref<AuraData> aura);
|
||||
@ -380,25 +396,14 @@ public:
|
||||
|
||||
//Update
|
||||
void update_auras(float delta);
|
||||
|
||||
//Clientside hooks
|
||||
void creceive_damage_taken(Ref<SpellDamageInfo> data);
|
||||
void creceiveon_damage_dealt(Ref<SpellDamageInfo> data);
|
||||
void creceive_heal_taken(Ref<SpellHealInfo> data);
|
||||
void creceiveon_heal_dealt(Ref<SpellHealInfo> data);
|
||||
|
||||
//Old, hook loading update when needed
|
||||
void setup_on_player_moves(Entity *bopmccc, Vector<int> *sspells); //load -> remove, just store spellIds
|
||||
|
||||
//Old stuff, remove or update
|
||||
void resurrect();
|
||||
void creceive_resurrect();
|
||||
void creceive_died();
|
||||
void creceive_mana_changed(int amount);
|
||||
bool gets_is_dead();
|
||||
bool getc_is_dead();
|
||||
|
||||
|
||||
//// Casting System ////
|
||||
|
||||
Ref<SpellCastInfo> gets_spell_cast_info();
|
||||
@ -441,12 +446,9 @@ public:
|
||||
int getc_cooldown_count();
|
||||
|
||||
//Category Cooldowns
|
||||
Vector<Ref<CategoryCooldown> > *gets_category_cooldowns();
|
||||
Vector<Ref<CategoryCooldown> > *getc_category_cooldowns();
|
||||
|
||||
HashMap<int, Ref<CategoryCooldown> > * gets_category_cooldown_map();
|
||||
HashMap<int, Ref<CategoryCooldown> > * getc_category_cooldown_map();
|
||||
|
||||
Vector<Ref<CategoryCooldown> > gets_category_cooldowns();
|
||||
Vector<Ref<CategoryCooldown> > getc_category_cooldowns();
|
||||
|
||||
bool hass_category_cooldown(int category_id);
|
||||
void adds_category_cooldown(int category_id, float value);
|
||||
void removes_category_cooldown(int category_id);
|
||||
@ -519,9 +521,6 @@ public:
|
||||
|
||||
String random_name();
|
||||
|
||||
String request_spell_name(int spellId);
|
||||
String request_spell_description(int spellId, int level);
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
virtual void _notification(int p_what);
|
||||
@ -650,9 +649,9 @@ private:
|
||||
|
||||
Vector<Ref<CategoryCooldown> > _s_category_cooldowns;
|
||||
Vector<Ref<CategoryCooldown> > _c_category_cooldowns;
|
||||
|
||||
HashMap<int, Ref<CategoryCooldown> > _s_category_cooldown_map;
|
||||
HashMap<int, Ref<CategoryCooldown> > _c_category_cooldown_map;
|
||||
|
||||
int _s_active_category_cooldowns;
|
||||
int _c_active_category_cooldowns;
|
||||
|
||||
//// targetComponent ////
|
||||
|
||||
@ -674,4 +673,3 @@ private:
|
||||
VARIANT_ENUM_CAST(Entity::InventorySizes);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
#include "entity_enums.h"
|
||||
|
||||
const String EntityEnums::BINDING_STRING_PLAYER_RESOURCE_TYPES = "None, Rage, Mana, Energy, Time Anomaly";
|
||||
const String EntityEnums::BINDING_STRING_ENTITY_TYPES = "None, Player, AI, Mob";
|
||||
const String EntityEnums::BINDING_STRING_ENTITY_STATE_TYPES = "None, Stun, Root, Frozen, Silenced, Disoriented, Feared, Burning, Cold, Cursed, Pacified";
|
||||
const String EntityEnums::BINDING_STRING_CHARCATER_SKELETON_POINTS = "Root, Pelvis, Spine, Spine 1, Spine 2, Neck, Head, Left Clavicle, Left upper Arm, Left Forearm, Left Hand, Left Thumb Base, Left Thumb End, Left Fingers Base, Left Fingers End, Right Clavicle, Right upper Arm, Right Forearm, Right Hand, Right Thumb Base, Right Thumb End, Right Fingers Base, Right Fingers End, Left Thigh, Left Calf, Left Foot, Right Thigh, Right Calf, Right Foot";
|
||||
const String EntityEnums::BINDING_STRING_PLAYER_RESOURCE_TYPES = "None,Rage,Mana,Energy,Time Anomaly";
|
||||
const String EntityEnums::BINDING_STRING_ENTITY_TYPES = "None,Player,AI,Mob";
|
||||
const String EntityEnums::BINDING_STRING_ENTITY_STATE_TYPES = "None,Stun,Root,Frozen,Silenced,Disoriented,Feared,Burning,Cold,Cursed,Pacified";
|
||||
const String EntityEnums::BINDING_STRING_CHARCATER_SKELETON_POINTS = "Root,Pelvis,Spine,Spine 1,Spine 2,Neck,Head,Left Clavicle,Left upper Arm,Left Forearm,Left Hand,Left Thumb Base,Left Thumb End,Left Fingers Base,Left Fingers End,Right Clavicle,Right upper Arm,Right Forearm,Right Hand,Right Thumb Base,Right Thumb End,Right Fingers Base,Right Fingers End,Left Thigh,Left Calf,Left Foot,Right Thigh,Right Calf,Right Foot";
|
||||
const String EntityEnums::BINDING_STRING_AI_STATES = "Off,Rest,Patrol,Follow Path,Regenerate,Attack";
|
||||
|
||||
|
@ -6,7 +6,11 @@ Entity *AuraApplyInfo::get_caster() const {
|
||||
return _caster;
|
||||
}
|
||||
|
||||
void AuraApplyInfo::set_caster(Node *caster) {
|
||||
void AuraApplyInfo::set_caster(Entity *value) {
|
||||
_caster = value;
|
||||
}
|
||||
|
||||
void AuraApplyInfo::set_caster_bind(Node *caster) {
|
||||
if (!caster) {
|
||||
return;
|
||||
}
|
||||
@ -21,10 +25,14 @@ void AuraApplyInfo::set_caster(Node *caster) {
|
||||
}
|
||||
|
||||
Entity *AuraApplyInfo::get_target() const {
|
||||
return _caster;
|
||||
return _target;
|
||||
}
|
||||
|
||||
void AuraApplyInfo::set_target(Node *caster) {
|
||||
void AuraApplyInfo::set_target(Entity *value) {
|
||||
_target = value;
|
||||
}
|
||||
|
||||
void AuraApplyInfo::set_target_bind(Node *caster) {
|
||||
if (!caster) {
|
||||
return;
|
||||
}
|
||||
@ -35,7 +43,7 @@ void AuraApplyInfo::set_target(Node *caster) {
|
||||
return;
|
||||
}
|
||||
|
||||
_caster = e;
|
||||
_target = e;
|
||||
}
|
||||
|
||||
|
||||
@ -78,11 +86,11 @@ 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);
|
||||
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);
|
||||
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);
|
||||
|
@ -12,11 +12,12 @@ class AuraApplyInfo : public Reference {
|
||||
|
||||
public:
|
||||
Entity *get_caster() const;
|
||||
void set_caster(Node *caster);
|
||||
void set_caster(Entity *caster);
|
||||
void set_caster_bind(Node *caster);
|
||||
|
||||
Entity *get_target() const;
|
||||
void set_target(Node *caster);
|
||||
|
||||
void set_target(Entity *caster);
|
||||
void set_target_bind(Node *caster);
|
||||
|
||||
float get_spell_scale() const;
|
||||
void set_spell_scale(float value);
|
||||
|
@ -8,7 +8,11 @@ Entity *SpellCastInfo::get_caster() const {
|
||||
return _caster;
|
||||
}
|
||||
|
||||
void SpellCastInfo::set_caster(Node *caster) {
|
||||
void SpellCastInfo::set_caster(Entity *value) {
|
||||
_caster = value;
|
||||
}
|
||||
|
||||
void SpellCastInfo::set_caster_bind(Node *caster) {
|
||||
if (!caster) {
|
||||
return;
|
||||
}
|
||||
@ -26,7 +30,11 @@ Entity *SpellCastInfo::get_target() const {
|
||||
return _target;
|
||||
}
|
||||
|
||||
void SpellCastInfo::set_target(Node *target) {
|
||||
void SpellCastInfo::set_target(Entity *value) {
|
||||
_target = value;
|
||||
}
|
||||
|
||||
void SpellCastInfo::set_target_bind(Node *target) {
|
||||
if (!target) {
|
||||
return;
|
||||
}
|
||||
@ -130,11 +138,11 @@ SpellCastInfo::~SpellCastInfo() {
|
||||
|
||||
void SpellCastInfo::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_caster"), &SpellCastInfo::get_caster);
|
||||
ClassDB::bind_method(D_METHOD("set_caster", "caster"), &SpellCastInfo::set_caster);
|
||||
ClassDB::bind_method(D_METHOD("set_caster", "caster"), &SpellCastInfo::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"), &SpellCastInfo::get_target);
|
||||
ClassDB::bind_method(D_METHOD("set_target", "caster"), &SpellCastInfo::set_target);
|
||||
ClassDB::bind_method(D_METHOD("set_target", "caster"), &SpellCastInfo::set_target_bind);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "target", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), "set_target", "get_target");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_has_cast_time"), &SpellCastInfo::get_has_cast_time);
|
||||
|
@ -12,10 +12,12 @@ class SpellCastInfo : public Reference {
|
||||
|
||||
public:
|
||||
Entity *get_caster() const;
|
||||
void set_caster(Node *caster);
|
||||
void set_caster(Entity *caster);
|
||||
void set_caster_bind(Node *caster);
|
||||
|
||||
Entity *get_target() const;
|
||||
void set_target(Node *caster);
|
||||
void set_target(Entity *caster);
|
||||
void set_target_bind(Node *caster);
|
||||
|
||||
bool get_has_cast_time() const;
|
||||
void set_has_cast_time(bool value);
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "item_enums.h"
|
||||
|
||||
|
||||
const String ItemEnums::BINDING_STRING_RARITY = "None, Common, Uncommon, Superior, Heroic, Mythic, Artifact, Class Neck";
|
||||
const String ItemEnums::BINDING_STRING_ITEM_TYPE = "None, Weapon, Craft, Currency, Item";
|
||||
const String ItemEnums::BINDING_STRING_ITEM_SUB_TYPE = "None, Two Hand, One Hand, Left Hand, Right Hand";
|
||||
const String ItemEnums::BINDING_STRING_ITEM_SUB_SUB_TYPE = "None, Sword, Bow, Axe";
|
||||
const String ItemEnums::BINDING_STRING_RARITY = "None,Common,Uncommon,Superior,Heroic,Mythic,Artifact,Class Neck";
|
||||
const String ItemEnums::BINDING_STRING_ITEM_TYPE = "None,Weapon,Craft,Currency,Item";
|
||||
const String ItemEnums::BINDING_STRING_ITEM_SUB_TYPE = "None,Two Hand,One Hand,Left Hand,Right Hand";
|
||||
const String ItemEnums::BINDING_STRING_ITEM_SUB_SUB_TYPE = "None,Sword,Bow,Axe";
|
||||
|
@ -40,7 +40,11 @@ Entity *SpellDamageInfo::get_dealer() {
|
||||
return _dealer;
|
||||
}
|
||||
|
||||
void SpellDamageInfo::set_dealer(Node *value) {
|
||||
void SpellDamageInfo::set_dealer(Entity *value) {
|
||||
_dealer = value;
|
||||
}
|
||||
|
||||
void SpellDamageInfo::set_dealer_bind(Node *value) {
|
||||
if (!value) {
|
||||
return;
|
||||
}
|
||||
@ -58,7 +62,11 @@ Entity *SpellDamageInfo::get_receiver() {
|
||||
return _receiver;
|
||||
}
|
||||
|
||||
void SpellDamageInfo::set_receiver(Node *value) {
|
||||
void SpellDamageInfo::set_receiver(Entity *value) {
|
||||
_receiver = value;
|
||||
}
|
||||
|
||||
void SpellDamageInfo::set_receiver_bind(Node *value) {
|
||||
if (!value) {
|
||||
return;
|
||||
}
|
||||
@ -161,11 +169,11 @@ void SpellDamageInfo::_bind_methods() {
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "spell_type", PROPERTY_HINT_ENUM, "None, Melee, Magic"), "set_spell_type", "get_spell_type");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_dealer"), &SpellDamageInfo::get_dealer);
|
||||
ClassDB::bind_method(D_METHOD("set_dealer", "value"), &SpellDamageInfo::set_dealer);
|
||||
ClassDB::bind_method(D_METHOD("set_dealer", "value"), &SpellDamageInfo::set_dealer_bind);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "dealer", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), "set_dealer", "get_dealer");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_receiver"), &SpellDamageInfo::get_receiver);
|
||||
ClassDB::bind_method(D_METHOD("set_receiver", "value"), &SpellDamageInfo::set_receiver);
|
||||
ClassDB::bind_method(D_METHOD("set_receiver", "value"), &SpellDamageInfo::set_receiver_bind);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "receiver", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), "set_receiver", "get_receiver");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_damage_source"), &SpellDamageInfo::get_damage_source);
|
||||
|
@ -36,10 +36,12 @@ public:
|
||||
void set_spell_type(SpellEnums::SpellType value);
|
||||
|
||||
Entity *get_dealer();
|
||||
void set_dealer(Node *value);
|
||||
void set_dealer(Entity *value);
|
||||
void set_dealer_bind(Node *value);
|
||||
|
||||
Entity *get_receiver();
|
||||
void set_receiver(Node *value);
|
||||
void set_receiver(Entity *value);
|
||||
void set_receiver_bind(Node *value);
|
||||
|
||||
Ref<Reference> get_damage_source();
|
||||
void set_damage_source(Ref<Reference> value);
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "spell_enums.h"
|
||||
|
||||
const String SpellEnums::BINDING_STRING_SPELL_TYPES = "None, Melee, Holy, Shadow, Nature, Fire, Frost, Lightning, Chaos";
|
||||
const String SpellEnums::BINDING_STRING_DIMINISHING_RETURN_CATEGORIES = "None, Root, Stun";
|
||||
const String SpellEnums::BINDING_STRING_TRIGGER_EVENTS = "None, S On Before Damage, S On Damage Receive, S On Hit, S On Damage Dealt, S Aura Remove, S Aura Dispell, S On Before Aura Applied, S On After Aura Applied, C On Aura Added, C On Aura Removed, C On Aura Refreshed";
|
||||
const String SpellEnums::BINDING_STRING_DAMAGE_TYPES = "None, Melee, Holy, Shadow, Nature, Fire, Frost, Lightning, Chaos";
|
||||
const String SpellEnums::BINDING_STRING_AURA_TYPES = "None, Magic, Poison, Physical, Curse, Bleed";
|
||||
const String SpellEnums::BINDING_STRING_SPELL_TYPES = "Melee,Holy,Shadow,Nature,Fire,Frost,Lightning,Chaos";
|
||||
const String SpellEnums::BINDING_STRING_DIMINISHING_RETURN_CATEGORIES = "None,Root,Stun";
|
||||
const String SpellEnums::BINDING_STRING_TRIGGER_EVENTS = "None,S On Before Damage,S On Damage Receive,S On Hit,S On Damage Dealt,S Aura Remove,S Aura Dispell,S On Before Aura Applied,S On After Aura Applied,C On Aura Added,C On Aura Removed,C On Aura Refreshed";
|
||||
const String SpellEnums::BINDING_STRING_DAMAGE_TYPES = "Melee,Holy,Shadow,Nature,Fire,Frost,Lightning,Chaos";
|
||||
const String SpellEnums::BINDING_STRING_AURA_TYPES = "None,Magic,Poison,Physical,Curse,Bleed";
|
||||
|
@ -1,27 +1,27 @@
|
||||
#include "category_cooldown.h"
|
||||
|
||||
int CategoryCooldown::get_category_id()
|
||||
int CategoryCooldown::get_category_id() const
|
||||
{
|
||||
return _category_id;
|
||||
}
|
||||
|
||||
void CategoryCooldown::set_category_id(int value)
|
||||
void CategoryCooldown::set_category_id(const int value)
|
||||
{
|
||||
_category_id = value;
|
||||
}
|
||||
|
||||
int CategoryCooldown::get_remaining()
|
||||
float CategoryCooldown::get_remaining() const
|
||||
{
|
||||
return _remaining;
|
||||
|
||||
}
|
||||
|
||||
void CategoryCooldown::set_remaining(int value)
|
||||
void CategoryCooldown::set_remaining(const float value)
|
||||
{
|
||||
_remaining = value;
|
||||
}
|
||||
|
||||
bool CategoryCooldown::update(float delta) {
|
||||
bool CategoryCooldown::update(const float delta) {
|
||||
_remaining -= delta;
|
||||
|
||||
if (_remaining <= 0) {
|
||||
@ -41,7 +41,7 @@ void CategoryCooldown::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_remaining"), &CategoryCooldown::get_remaining);
|
||||
ClassDB::bind_method(D_METHOD("set_remaining", "value"), &CategoryCooldown::set_remaining);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "remaining"), "set_remaining", "get_remaining");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "remaining"), "set_remaining", "get_remaining");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("update", "delta"), &CategoryCooldown::update);
|
||||
}
|
||||
|
@ -7,20 +7,20 @@ class CategoryCooldown : public Reference {
|
||||
GDCLASS(CategoryCooldown, Reference);
|
||||
|
||||
public:
|
||||
int get_category_id();
|
||||
void set_category_id(int value);
|
||||
int get_category_id() const;
|
||||
void set_category_id(const int value);
|
||||
|
||||
int get_remaining();
|
||||
void set_remaining(int value);
|
||||
float get_remaining() const;
|
||||
void set_remaining(const float value);
|
||||
|
||||
bool update(float delta);
|
||||
bool update(const float delta);
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
private:
|
||||
int _category_id;
|
||||
int _remaining;
|
||||
float _remaining;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1,27 +1,27 @@
|
||||
#include "cooldown.h"
|
||||
|
||||
int Cooldown::get_spell_id()
|
||||
{
|
||||
int Cooldown::get_spell_id() const
|
||||
{
|
||||
return _spell_id;
|
||||
}
|
||||
|
||||
void Cooldown::set_spell_id(int value)
|
||||
void Cooldown::set_spell_id(const int value)
|
||||
{
|
||||
_spell_id = value;
|
||||
}
|
||||
|
||||
int Cooldown::get_remaining()
|
||||
float Cooldown::get_remaining() const
|
||||
{
|
||||
return _remaining;
|
||||
|
||||
}
|
||||
|
||||
void Cooldown::set_remaining(int value)
|
||||
void Cooldown::set_remaining(const float value)
|
||||
{
|
||||
_remaining = value;
|
||||
}
|
||||
|
||||
bool Cooldown::update(float delta) {
|
||||
bool Cooldown::update(const float delta) {
|
||||
_remaining -= delta;
|
||||
|
||||
if (_remaining <= 0) {
|
||||
@ -41,7 +41,7 @@ void Cooldown::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_remaining"), &Cooldown::get_remaining);
|
||||
ClassDB::bind_method(D_METHOD("set_remaining", "value"), &Cooldown::set_remaining);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "remaining"), "set_remaining", "get_remaining");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "remaining"), "set_remaining", "get_remaining");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("update", "delta"), &Cooldown::update);
|
||||
}
|
||||
|
@ -7,20 +7,20 @@ class Cooldown : public Reference {
|
||||
GDCLASS(Cooldown, Reference);
|
||||
|
||||
public:
|
||||
int get_spell_id();
|
||||
void set_spell_id(int value);
|
||||
int get_spell_id() const;
|
||||
void set_spell_id(const int value);
|
||||
|
||||
int get_remaining();
|
||||
void set_remaining(int value);
|
||||
float get_remaining() const;
|
||||
void set_remaining(const float value);
|
||||
|
||||
bool update(float delta);
|
||||
bool update(const float delta);
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
private:
|
||||
int _spell_id;
|
||||
int _remaining;
|
||||
float _remaining;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user