mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-02-20 17:14:44 +01:00
Temporarily added back start_casting into EntityClassData.
This commit is contained in:
parent
316d75d344
commit
a1a4a9c7d2
@ -294,6 +294,26 @@ void EntityClassData::_setup_resources(Node *entity) {
|
||||
}
|
||||
}
|
||||
|
||||
void EntityClassData::start_casting(int spell_id, Entity *caster, float spellScale) {
|
||||
if (_spells.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < _spells.size(); i++) {
|
||||
Ref<Spell> s = _spells[i];
|
||||
|
||||
if (s == NULL) {
|
||||
print_error("class doesn't have spell! spell_id: " + itos(spell_id));
|
||||
return;
|
||||
}
|
||||
|
||||
if (s->get_id() == spell_id) {
|
||||
s->cast_starts_simple(caster, spellScale);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EntityClassData::EntityClassData() {
|
||||
_id = 0;
|
||||
_spell_points_per_level = 1;
|
||||
|
@ -135,6 +135,8 @@ public:
|
||||
void setup_resources(Entity *entity);
|
||||
void _setup_resources(Node *entity);
|
||||
|
||||
void start_casting(int spell_id, Entity *caster, float spellScale);
|
||||
|
||||
EntityClassData();
|
||||
~EntityClassData();
|
||||
|
||||
|
@ -331,8 +331,8 @@ void EntityData::sinteract_bind(Node *entity) {
|
||||
}
|
||||
|
||||
void EntityData::start_casting(int spell_id, Entity *caster, float spellScale) {
|
||||
//if (_entity_class_data.is_valid())
|
||||
// _entity_class_data->start_casting(spell_id, caster, spellScale);
|
||||
if (_entity_class_data.is_valid())
|
||||
_entity_class_data->start_casting(spell_id, caster, spellScale);
|
||||
}
|
||||
|
||||
void EntityData::notification_saura(int what, Ref<AuraData> data) {
|
||||
|
Loading…
Reference in New Issue
Block a user