void CSwordSlashController::process(const std::shared_ptr<Logic::IMessage> &message) { if((message->getType().compare("TOUCHED") == 0)) { Logic::CEntity *otherEntity = dynamic_cast<TOUCHED*>(message.get())->getEntidad(); if(otherEntity) { if (otherEntity->getTag() == "enemy") { if(_damage>0) { std::shared_ptr<DAMAGED> m(new DAMAGED()); m->setFloat(_damage); m->setString(_entity->getType()); otherEntity->emitMessage(m); std::shared_ptr<PUSH> pushMessage(new PUSH()); pushMessage->setDirection(_direction); pushMessage->setSpeed(0.5f); otherEntity->emitMessage(pushMessage, this); //BaseSubsystems::Log::Debug("ÑAPA: " + std::to_string(_damage)); } Logic::CEntityFactory::getSingletonPtr()->createEntityByType("ChispaDanhoEnemy", otherEntity->getCenterPosition(), _entity->getMap()); } } } } // process