- m_disturb_timer += dtime;
-
- if(!m_falling)
- {
- m_shooting_timer -= dtime;
- if(m_shooting_timer <= 0.0 && m_shooting){
- m_shooting = false;
-
- std::string shoot_type = m_properties->get("shoot_type");
- v3f shoot_pos(0,0,0);
- shoot_pos.Y += m_properties->getFloat("shoot_y") * BS;
- if(shoot_type == "fireball"){
- v3f dir(cos(m_yaw/180*PI),0,sin(m_yaw/180*PI));
- dir.Y = m_shoot_y;
- dir.normalize();
- v3f speed = dir * BS * 10.0;
- v3f pos = m_base_position + shoot_pos;
- dstream<<__FUNCTION_NAME<<": Shooting fireball from "<<PP(pos)
- <<" at speed "<<PP(speed)<<std::endl;
- Settings properties;
- properties.set("looks", "fireball");
- properties.setV3F("speed", speed);
- properties.setFloat("die_age", 5.0);
- properties.set("move_type", "constant_speed");
- properties.setFloat("hp", 1000);
- properties.set("lock_full_brightness", "true");
- properties.set("player_hit_damage", "9");
- properties.set("player_hit_distance", "2");
- properties.set("player_hit_interval", "1");
- ServerActiveObject *obj = new MobV2SAO(m_env, 0,
- pos, &properties);
- //m_env->addActiveObjectAsStatic(obj);
- m_env->addActiveObject(obj);
- } else {
- dstream<<__FUNCTION_NAME<<": Unknown shoot_type="<<shoot_type
- <<std::endl;
- }
- }