Example #1
0
void
sanguis::server::world::pickup_spawner::spawn_health(
	sanguis::server::center const _center,
	sanguis::server::entities::enemies::difficulty const _difficulty
)
{
	this->spawn_entity(
		fcppt::unique_ptr_to_base<
			sanguis::server::entities::with_id
		>(
			fcppt::make_unique_ptr<
				sanguis::server::entities::pickups::health
			>(
				env_.load_context(),
				sanguis::server::team::players,
				sanguis::server::health(
					10.f
					*
					std::sqrt(
						_difficulty.get()
					)
				)
			)
		),
		_center
	);
}
Example #2
0
sanguis::server::entities::with_id_unique_ptr
sanguis::server::world::make_destructible(
	sanguis::creator::destructible_type const _destructible_type,
	sanguis::server::environment::load_context &_load_context,
	sanguis::server::world::difficulty const _difficulty
)
{
	sanguis::server::entities::enemies::difficulty const difficulty(
		fcppt::cast::int_to_float<
			sanguis::server::entities::enemies::difficulty_value
		>(
			_difficulty.get()
		)
		*
		fcppt::literal<
			sanguis::server::entities::enemies::difficulty_value
		>(
			5
		)
	);

	return
		fcppt::unique_ptr_to_base<
			sanguis::server::entities::with_id
		>(
			fcppt::make_unique_ptr<
				sanguis::server::entities::destructible
			>(
				_destructible_type,
				_load_context,
				sanguis::server::health(
					1.f
					*
					difficulty.get()
				),
				sanguis::server::damage::no_armor(),
				difficulty
			)
		);
}