void sanguis::server::entities::enemies::skills::mother_spider::on_die( sanguis::server::entities::enemies::enemy const &_enemy ) { sanguis::server::weapons::weapon const &primary_weapon( FCPPT_ASSERT_OPTIONAL_ERROR( _enemy.primary_weapon() ).get() ); sanguis::server::environment::object &environment( FCPPT_ASSERT_OPTIONAL_ERROR( _enemy.environment() ).get() ); // TODO: Make copies of enemies smaller fcppt::algorithm::repeat( 1u, [ &_enemy, &primary_weapon, &environment ] { sanguis::server::environment::insert_no_result( environment, fcppt::unique_ptr_to_base< sanguis::server::entities::with_id >( fcppt::make_unique_ptr< sanguis::server::entities::enemies::normal >( sanguis::server::entities::enemies::parameters{ _enemy.enemy_type(), environment.load_context(), _enemy.armor(), _enemy.mass(), // TODO: This parameter should probably be of type max_health sanguis::server::health{ _enemy.max_health().get() } / sanguis::server::health{ 4.f }, _enemy.max_movement_speed(), _enemy.create_ai(), primary_weapon.clone(), sanguis::server::pickup_probability{ 0.f }, _enemy.exp() / sanguis::server::exp{ 4.f }, _enemy.difficulty(), sanguis::server::entities::spawn_owner( sanguis::server::entities::auto_weak_link{} ), sanguis::server::auras::container{} } ) ), sanguis::server::entities::insert_parameters_center( _enemy.center() ) ); } ); }
void sanguis::server::entities::enemies::skills::scatter::update( sanguis::server::entities::enemies::enemy &_entity ) { if( !sge::timer::reset_when_expired( cooldown_timer_ ) ) return; fcppt::optional::maybe_void( _entity.environment(), [ this, &_entity ]( fcppt::reference< sanguis::server::environment::object > const _environment ) { fcppt::algorithm::repeat( // TODO 5, [ this, &_entity, _environment ] { sanguis::server::damage::modified_array const damage_modifiers( sanguis::server::entities::modify_damages( _entity, sanguis::server::damage::explosive() ) ); sanguis::server::environment::insert_no_result( _environment.get(), fcppt::unique_ptr_to_base< sanguis::server::entities::with_id >( fcppt::make_unique_ptr< sanguis::server::entities::projectiles::scatter >( random_generator_, _environment.get().load_context(), _entity.team(), sanguis::server::direction( _entity.angle().get() ), sanguis::server::entities::projectiles::scatter_create( [ damage_modifiers ]( sanguis::server::environment::object &_env, sanguis::server::team const _team, sanguis::server::angle const _angle ) { return fcppt::unique_ptr_to_base< sanguis::server::entities::with_id >( fcppt::make_unique_ptr< sanguis::server::entities::projectiles::rocket >( _env.load_context(), _team, // TODO sanguis::server::damage::unit( 10.f ), damage_modifiers, // TODO sanguis::server::aoe( 100.f ), sanguis::server::direction( _angle.get() ) ) ); } ) ) ), sanguis::server::entities::insert_parameters( _entity.center(), _entity.angle() ) ); } ); } ); }