void CharacterComponent::useSpecialOnBeing(Entity &user, int id, Entity *b) { SpecialMap::iterator it = mSpecials.find(id); if (!specialUseCheck(it)) return; SpecialValue &special = it->second; if (special.specialInfo->target != SpecialManager::TARGET_BEING) return; //tell script engine to cast the spell Script *script = ScriptManager::currentState(); script->prepare(special.specialInfo->useCallback); script->push(&user); script->push(b); script->push(special.specialInfo->id); script->execute(user.getMap()); }
void Character::useSpecialOnPoint(int id, int x, int y) { SpecialMap::iterator it = mSpecials.find(id); if (!specialUseCheck(it)) return; SpecialValue &special = it->second; if (special.specialInfo->target != SpecialManager::TARGET_POINT) return; //tell script engine to cast the spell Script *script = ScriptManager::currentState(); script->prepare(special.specialInfo->useCallback); script->push(this); script->push(x); script->push(y); script->push(special.specialInfo->id); script->execute(getMap()); }