mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-02-22 17:18:12 +01:00
Added fail cond checks, to the new spell system functions inside Aura, Spell, and Entity, to prevent crashes.
This commit is contained in:
parent
e2bf5a5286
commit
d06a6615a0
@ -237,147 +237,205 @@ void Aura::set_aura_stat_attribute_percent_mod(int index, float value) {
|
||||
}
|
||||
|
||||
void Aura::sapply_simple(Entity *caster, Entity *target, float spell_scale) {
|
||||
ERR_FAIL_COND(caster == NULL || target == NULL);
|
||||
|
||||
Ref<AuraApplyInfo> info(memnew(AuraApplyInfo(caster, target, spell_scale, this)));
|
||||
|
||||
sapply(info);
|
||||
}
|
||||
|
||||
void Aura::sapply(Ref<AuraApplyInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
//always exists
|
||||
call("_sapply", info);
|
||||
}
|
||||
|
||||
void Aura::sremove(Ref<AuraData> aura) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
|
||||
//always exists
|
||||
call("_sremove", aura);
|
||||
}
|
||||
|
||||
void Aura::sremove_expired(Ref<AuraData> aura) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
|
||||
//always exists
|
||||
call("_sremove_expired", aura);
|
||||
}
|
||||
|
||||
void Aura::sremove_dispell(Ref<AuraData> aura) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
|
||||
//always exists
|
||||
call("_sremove_dispell", aura);
|
||||
}
|
||||
|
||||
void Aura::supdate(Ref<AuraData> aura, float delta) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
|
||||
//always exists
|
||||
call("_supdate", aura, delta);
|
||||
}
|
||||
|
||||
void Aura::son_before_cast(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_son_before_cast"))
|
||||
call("_son_before_cast", info);
|
||||
}
|
||||
|
||||
void Aura::son_before_cast_target(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_son_before_cast_target"))
|
||||
call("_son_before_cast_target", info);
|
||||
}
|
||||
|
||||
void Aura::son_cast_finished(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_son_cast_finished"))
|
||||
call("_son_cast_finished", info);
|
||||
}
|
||||
|
||||
void Aura::son_cast_started(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_son_cast_started"))
|
||||
call("_son_cast_started", info);
|
||||
}
|
||||
|
||||
void Aura::son_cast_failed(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_son_cast_failed"))
|
||||
call("_son_cast_failed", info);
|
||||
}
|
||||
|
||||
void Aura::son_cast_finished_target(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_son_cast_finished_target"))
|
||||
call("_son_cast_finished_target", info);
|
||||
}
|
||||
|
||||
void Aura::son_before_damage(Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
if (has_method("_son_before_damage"))
|
||||
call("_son_before_damage", data);
|
||||
}
|
||||
|
||||
void Aura::son_damage_receive(Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
if (has_method("_son_damage_receive"))
|
||||
call("_son_damage_receive", data);
|
||||
}
|
||||
|
||||
void Aura::son_hit(Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
if (has_method("_son_hit"))
|
||||
call("_son_hit", data);
|
||||
}
|
||||
|
||||
void Aura::son_damage_dealt(Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
if (has_method("_son_damage_dealt"))
|
||||
call("_son_damage_dealt", data);
|
||||
}
|
||||
|
||||
void Aura::son_remove_expired(Ref<AuraData> aura) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
|
||||
if (has_method("_son_remove_expired"))
|
||||
call("_son_remove_expired", aura);
|
||||
}
|
||||
|
||||
void Aura::son_remove(Ref<AuraData> aura) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
|
||||
if (has_method("_son_remove"))
|
||||
call("_son_remove", aura);
|
||||
}
|
||||
|
||||
void Aura::son_remove_dispell(Ref<AuraData> aura) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
|
||||
if (has_method("_son_remove_dispell"))
|
||||
call("_son_remove_dispell", aura);
|
||||
}
|
||||
|
||||
void Aura::son_before_aura_applied(Ref<AuraData> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
if (has_method("_son_before_aura_applied"))
|
||||
call("_son_before_aura_applied", data);
|
||||
}
|
||||
|
||||
void Aura::son_after_aura_applied(Ref<AuraData> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
if (has_method("_son_after_aura_applied"))
|
||||
call("_son_after_aura_applied", data);
|
||||
}
|
||||
|
||||
void Aura::con_added(Ref<AuraData> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
if (has_method("_con_added"))
|
||||
call("_con_added", data);
|
||||
}
|
||||
|
||||
void Aura::con_removed(Ref<AuraData> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
if (has_method("_con_removed"))
|
||||
call("_con_removed", data);
|
||||
}
|
||||
|
||||
void Aura::con_refresh(Ref<AuraData> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
if (has_method("_con_refresh"))
|
||||
call("_con_refresh", data);
|
||||
}
|
||||
|
||||
void Aura::sapply_passives_damage_receive(Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
//always exists
|
||||
call("_sapply_passives_damage_receive", data);
|
||||
}
|
||||
|
||||
void Aura::sapply_passives_damage_deal(Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
//always exists
|
||||
call("_sapply_passives_damage_deal", data);
|
||||
}
|
||||
|
||||
void Aura::setup_aura_data(Ref<AuraData> data, Ref<AuraApplyInfo> info) {
|
||||
ERR_FAIL_COND(!data.is_valid() || !info.is_valid());
|
||||
|
||||
//always exists
|
||||
call("setup_aura_data", data, info);
|
||||
}
|
||||
|
||||
void Aura::calculate_initial_damage(Ref<AuraData> aura_data, Ref<AuraApplyInfo> info) {
|
||||
ERR_FAIL_COND(!aura_data.is_valid() || !info.is_valid());
|
||||
|
||||
//always exists
|
||||
call("_calculate_initial_damage", aura_data, info);
|
||||
}
|
||||
|
||||
void Aura::handle_aura_damage(Ref<AuraData> aura_data, Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!aura_data.is_valid() || !data.is_valid());
|
||||
|
||||
//always exists
|
||||
call("_handle_aura_damage", aura_data, data);
|
||||
}
|
||||
|
@ -72,6 +72,8 @@ float Spell::get_absorb_scale_for_level(int level) {
|
||||
//// Spell System ////
|
||||
|
||||
void Spell::sstart_casting_simple(Entity *caster, float spell_scale) {
|
||||
ERR_FAIL_COND(caster == NULL);
|
||||
|
||||
Ref<SpellCastInfo> info = Ref<SpellCastInfo>(memnew(SpellCastInfo()));
|
||||
|
||||
info->set_caster(caster);
|
||||
@ -82,10 +84,11 @@ void Spell::sstart_casting_simple(Entity *caster, float spell_scale) {
|
||||
info->set_spell(Ref<Spell>(this));
|
||||
|
||||
sstart_casting(info);
|
||||
|
||||
}
|
||||
|
||||
void Spell::sinterrupt_cast_simple(Entity *caster) {
|
||||
ERR_FAIL_COND(caster == NULL);
|
||||
|
||||
Ref<SpellCastInfo> info(memnew(SpellCastInfo()));
|
||||
|
||||
info->set_caster(caster);
|
||||
@ -95,6 +98,8 @@ void Spell::sinterrupt_cast_simple(Entity *caster) {
|
||||
}
|
||||
|
||||
void Spell::sstart_casting_triggered_simple(Entity *caster) {
|
||||
ERR_FAIL_COND(caster == NULL);
|
||||
|
||||
Ref<SpellCastInfo> info(memnew(SpellCastInfo()));
|
||||
|
||||
info->set_caster(caster);
|
||||
@ -106,86 +111,116 @@ void Spell::sstart_casting_triggered_simple(Entity *caster) {
|
||||
//Script methods
|
||||
|
||||
void Spell::sstart_casting(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_sstart_casting")) {
|
||||
call("_sstart_casting", info);
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::sstart_casting_triggered(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_sstart_casting_triggered")) {
|
||||
call("_sstart_casting_triggered", info);
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::sinterrupt_cast(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_sinterrupt_cast")) {
|
||||
call("_sinterrupt_cast", info);
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::sfinish_cast(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_sfinish_cast")) {
|
||||
call("_sfinish_cast", info);
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::son_cast_player_moved(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_son_cast_player_moved")) {
|
||||
call("_son_cast_player_moved", info);
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::son_cast_damage_received(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_son_cast_damage_received")) {
|
||||
call("_son_cast_damage_received", info);
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::son_spell_hit(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_son_spell_hit")) {
|
||||
call("_son_spell_hit", info);
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::con_spell_cast_started(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_con_spell_cast_started")) {
|
||||
call("_con_spell_cast_started", info);
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::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 Spell::con_spell_cast_failed(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_con_spell_cast_failed")) {
|
||||
call("_con_spell_cast_failed", info);
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::con_spell_cast_ended(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_con_spell_cast_ended")) {
|
||||
call("_con_spell_cast_ended", info);
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::con_spell_cast_interrupted(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
if (has_method("_con_spell_cast_interrupted")) {
|
||||
call("_con_spell_cast_interrupted", info);
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::calculate_initial_damage(Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!data.is_valid() || data->get_receiver() == NULL);
|
||||
|
||||
call("_calculate_initial_damage", data);
|
||||
}
|
||||
|
||||
void Spell::handle_spell_damage(Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!data.is_valid() || data->get_receiver() == NULL);
|
||||
|
||||
call("_handle_spell_damage", data);
|
||||
}
|
||||
|
||||
void Spell::_sstart_casting(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid() || info->get_spell() == NULL);
|
||||
|
||||
Ref<Spell> spell = info->get_spell();
|
||||
|
||||
if (spell->get_needs_target() || spell->get_has_damage()) {
|
||||
@ -431,7 +466,6 @@ void Spell::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("_calculate_initial_damage", "info"), &Spell::_calculate_initial_damage);
|
||||
ClassDB::bind_method(D_METHOD("_handle_spell_damage", "info"), &Spell::_handle_spell_damage);
|
||||
|
||||
|
||||
//Properties
|
||||
ClassDB::bind_method(D_METHOD("get_spell_id"), &Spell::get_spell_id);
|
||||
ClassDB::bind_method(D_METHOD("set_spell_id", "value"), &Spell::set_spell_id);
|
||||
@ -708,10 +742,8 @@ void Spell::_bind_methods() {
|
||||
BIND_ENUM_CONSTANT(SPELL_PROJECTILE_TYPE_STATIONARY);
|
||||
}
|
||||
|
||||
|
||||
//// SpellScript Old
|
||||
|
||||
|
||||
/*
|
||||
void Spell::TriggerGlobalCooldown(Entity* player)
|
||||
{
|
||||
@ -1249,8 +1281,6 @@ void Spell::AnimStop(Entity* player)
|
||||
bool arg_0A_0 = BSSettings::Getinstance()->AnimStopEnabled;
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
//Generic
|
||||
|
||||
/*
|
||||
@ -1444,4 +1474,3 @@ void GenericSpell::COnSpellCastEnded(WorldEntity* player)
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
@ -426,6 +426,8 @@ Ref<Stat> Entity::get_stat_enum(Stat::StatId stat_id) {
|
||||
}
|
||||
|
||||
void Entity::set_stat_enum(Stat::StatId stat_id, Ref<Stat> entry) {
|
||||
ERR_FAIL_COND(!entry.is_valid());
|
||||
|
||||
//ERR_FAIL_COND(stat_id == Stat::STAT_ID_NONE);
|
||||
|
||||
if (stat_id == Stat::STAT_ID_NONE) {
|
||||
@ -438,6 +440,8 @@ void Entity::set_stat_enum(Stat::StatId stat_id, Ref<Stat> entry) {
|
||||
}
|
||||
|
||||
void Entity::stake_damage(Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
//serverside
|
||||
|
||||
if (gets_is_dead()) {
|
||||
@ -472,6 +476,8 @@ void Entity::stake_damage(Ref<SpellDamageInfo> data) {
|
||||
}
|
||||
|
||||
void Entity::son_damage_dealt(Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
//serverside
|
||||
for (int i = 0; i < _s_auras->size(); ++i) {
|
||||
Ref<AuraData> ad = _s_auras->get(i);
|
||||
@ -481,6 +487,8 @@ void Entity::son_damage_dealt(Ref<SpellDamageInfo> data) {
|
||||
}
|
||||
|
||||
void Entity::sdeal_damage_to(Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
//serverside
|
||||
|
||||
if (gets_is_dead()) {
|
||||
@ -548,11 +556,15 @@ void Entity::creceive_resurrect() {
|
||||
}
|
||||
|
||||
void Entity::creceive_damage_taken(Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
//the current c health should probably be set here.
|
||||
emit_signal("con_damage_taken", this, data);
|
||||
}
|
||||
|
||||
void Entity::creceiveon_damage_dealt(Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
//the current c health should probably be set here.
|
||||
emit_signal("con_damage_dealt", this, data);
|
||||
}
|
||||
@ -589,6 +601,8 @@ void Entity::creceive_mana_changed(int amount) {
|
||||
}
|
||||
|
||||
void Entity::son_before_aura_applied(Ref<AuraData> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
for (int i = 0; i < _s_auras->size(); ++i) {
|
||||
Ref<AuraData> ad = _s_auras->get(i);
|
||||
|
||||
@ -597,6 +611,8 @@ void Entity::son_before_aura_applied(Ref<AuraData> data) {
|
||||
}
|
||||
|
||||
void Entity::son_after_aura_applied(Ref<AuraData> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
for (int i = 0; i < _s_auras->size(); ++i) {
|
||||
Ref<AuraData> ad = _s_auras->get(i);
|
||||
|
||||
@ -663,6 +679,8 @@ void Entity::update_auras(float delta) {
|
||||
}
|
||||
|
||||
void Entity::son_before_cast(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
for (int i = 0; i < _s_auras->size(); ++i) {
|
||||
Ref<AuraData> ad = _s_auras->get(i);
|
||||
|
||||
@ -671,6 +689,8 @@ void Entity::son_before_cast(Ref<SpellCastInfo> info) {
|
||||
}
|
||||
|
||||
void Entity::son_before_cast_target(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
for (int i = 0; i < _s_auras->size(); ++i) {
|
||||
Ref<AuraData> ad = _s_auras->get(i);
|
||||
|
||||
@ -679,6 +699,8 @@ void Entity::son_before_cast_target(Ref<SpellCastInfo> info) {
|
||||
}
|
||||
|
||||
void Entity::son_hit(Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
for (int i = 0; i < _s_auras->size(); ++i) {
|
||||
Ref<AuraData> ad = _s_auras->get(i);
|
||||
|
||||
@ -687,6 +709,8 @@ void Entity::son_hit(Ref<SpellDamageInfo> data) {
|
||||
}
|
||||
|
||||
void Entity::son_before_damage(Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
for (int i = 0; i < _s_auras->size(); ++i) {
|
||||
Ref<AuraData> ad = _s_auras->get(i);
|
||||
|
||||
@ -695,6 +719,8 @@ void Entity::son_before_damage(Ref<SpellDamageInfo> data) {
|
||||
}
|
||||
|
||||
void Entity::son_damage_receive(Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
for (int i = 0; i < _s_auras->size(); ++i) {
|
||||
Ref<AuraData> ad = _s_auras->get(i);
|
||||
|
||||
@ -703,6 +729,8 @@ void Entity::son_damage_receive(Ref<SpellDamageInfo> data) {
|
||||
}
|
||||
|
||||
void Entity::son_dealt_damage(Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
for (int i = 0; i < _s_auras->size(); ++i) {
|
||||
Ref<AuraData> ad = _s_auras->get(i);
|
||||
|
||||
@ -711,6 +739,8 @@ void Entity::son_dealt_damage(Ref<SpellDamageInfo> data) {
|
||||
}
|
||||
|
||||
void Entity::sapply_passives_damage_receive(Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
for (int i = 0; i < _s_auras->size(); ++i) {
|
||||
Ref<AuraData> ad = _s_auras->get(i);
|
||||
|
||||
@ -719,6 +749,8 @@ void Entity::sapply_passives_damage_receive(Ref<SpellDamageInfo> data) {
|
||||
}
|
||||
|
||||
void Entity::sapply_passives_damage_deal(Ref<SpellDamageInfo> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
for (int i = 0; i < _s_auras->size(); ++i) {
|
||||
Ref<AuraData> ad = _s_auras->get(i);
|
||||
|
||||
@ -727,6 +759,8 @@ void Entity::sapply_passives_damage_deal(Ref<SpellDamageInfo> data) {
|
||||
}
|
||||
|
||||
void Entity::son_cast_finished(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
for (int i = 0; i < _s_auras->size(); ++i) {
|
||||
Ref<AuraData> ad = _s_auras->get(i);
|
||||
|
||||
@ -735,6 +769,8 @@ void Entity::son_cast_finished(Ref<SpellCastInfo> info) {
|
||||
}
|
||||
|
||||
void Entity::son_cast_started(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
for (int i = 0; i < _s_auras->size(); ++i) {
|
||||
Ref<AuraData> ad = _s_auras->get(i);
|
||||
|
||||
@ -743,6 +779,8 @@ void Entity::son_cast_started(Ref<SpellCastInfo> info) {
|
||||
}
|
||||
|
||||
void Entity::son_cast_failed(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
for (int i = 0; i < _s_auras->size(); ++i) {
|
||||
Ref<AuraData> ad = _s_auras->get(i);
|
||||
|
||||
@ -751,6 +789,8 @@ void Entity::son_cast_failed(Ref<SpellCastInfo> info) {
|
||||
}
|
||||
|
||||
void Entity::son_cast_finished_target(Ref<SpellCastInfo> info) {
|
||||
ERR_FAIL_COND(!info.is_valid());
|
||||
|
||||
for (int i = 0; i < _s_auras->size(); ++i) {
|
||||
Ref<AuraData> ad = _s_auras->get(i);
|
||||
|
||||
@ -759,6 +799,8 @@ void Entity::son_cast_finished_target(Ref<SpellCastInfo> info) {
|
||||
}
|
||||
|
||||
void Entity::sadd_aura(Ref<AuraData> aura) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
|
||||
son_before_aura_applied(aura);
|
||||
|
||||
aura->set_owner(this);
|
||||
@ -773,6 +815,8 @@ void Entity::sadd_aura(Ref<AuraData> aura) {
|
||||
}
|
||||
|
||||
void Entity::sremove_aura(Ref<AuraData> aura) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
|
||||
for (int i = 0; i < _s_auras->size(); i++) {
|
||||
Ref<AuraData> ad = _s_auras->get(i);
|
||||
|
||||
@ -792,6 +836,8 @@ void Entity::sremove_aura(Ref<AuraData> aura) {
|
||||
|
||||
|
||||
void Entity::sremove_aura_expired(Ref<AuraData> aura) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
|
||||
for (int i = 0; i < _s_auras->size(); i++) {
|
||||
Ref<AuraData> ad = _s_auras->get(i);
|
||||
|
||||
@ -810,6 +856,8 @@ void Entity::sremove_aura_expired(Ref<AuraData> aura) {
|
||||
}
|
||||
|
||||
void Entity::sremove_aura_dispelled(Ref<AuraData> aura) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
|
||||
for (int i = 0; i < _s_auras->size(); i++) {
|
||||
Ref<AuraData> ad = _s_auras->get(i);
|
||||
|
||||
@ -828,11 +876,15 @@ void Entity::sremove_aura_dispelled(Ref<AuraData> aura) {
|
||||
}
|
||||
|
||||
void Entity::cadd_aura(Ref<AuraData> data) {
|
||||
ERR_FAIL_COND(!data.is_valid());
|
||||
|
||||
_c_auras->push_back(data);
|
||||
emit_signal("caura_added", data);
|
||||
}
|
||||
|
||||
void Entity::cremove_aura(Ref<AuraData> aura) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
|
||||
for (int i = 0; i < _c_auras->size(); i++) {
|
||||
if (_c_auras->get(i) == aura) {
|
||||
_c_auras->remove(i);
|
||||
@ -844,6 +896,8 @@ void Entity::cremove_aura(Ref<AuraData> aura) {
|
||||
}
|
||||
|
||||
void Entity::cremove_aura_dispelled(Ref<AuraData> aura) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
|
||||
for (int i = 0; i < _c_auras->size(); i++) {
|
||||
if (_c_auras->get(i) == aura) {
|
||||
_c_auras->remove(i);
|
||||
@ -855,6 +909,8 @@ void Entity::cremove_aura_dispelled(Ref<AuraData> aura) {
|
||||
}
|
||||
|
||||
void Entity::cremove_aura_expired(Ref<AuraData> aura) {
|
||||
ERR_FAIL_COND(!aura.is_valid());
|
||||
|
||||
for (int i = 0; i < _c_auras->size(); i++) {
|
||||
if (_c_auras->get(i) == aura) {
|
||||
_c_auras->remove(i);
|
||||
|
Loading…
Reference in New Issue
Block a user