Exemple #1
0
static void xyz_move_notify(object old_env)
{
	mixed nx, ny, nz;
	object common;
	object new_env;

	new_env = query_environment();

	if (!old_env || !new_env) {
		return;
	}

	common = THING_SUBD->query_common_container(old_env, new_env);

	if (!common) {
		nx = 0;
		ny = 0;
		nz = 0;
	} else {
		nx = query_x_position();
		ny = query_y_position();
		nz = query_z_position();

		for (; old_env != common; old_env = old_env->query_environment()) {
			nx += old_env->query_x_position();
			ny += old_env->query_y_position();
			nz += old_env->query_z_position();
		}

		for (; new_env != common; new_env = new_env->query_environment()) {
			nx -= new_env->query_x_position();
			ny -= new_env->query_y_position();
			nz -= new_env->query_z_position();
		}
	}

	set_x_position(nx);
	set_y_position(ny);
	set_z_position(nz);
}
Exemple #2
0
	}

	if (!target) {
		send_out("Oops, " + TEXT_SUBD->generate_brief_definite(exit) + " doesn't have a destination.\n");
		return;
	}

	if (actor->query_property("is_immobile")) {
		send_out("You're stuck like glue and can't move.\n");
		return;
	}

	if (query_user()->query_class() >= 2) {
		emit_from(actor, actor, " ", ({ "leave", "leaves" }), " through ", exit, ".");
		actor->set_x_position(exit->query_x_position());
		actor->set_y_position(exit->query_y_position());
		actor->set_z_position(exit->query_z_position());
		actor->move(target, 1);
	} else {
		int heavy, big;

		if (!target->query_virtual()) {
			if (actor->query_total_mass() > target->query_max_mass() - target->query_contained_mass()) {
				heavy = 1;
			}

			if (actor->query_total_volume() > target->query_capacity() - target->query_contained_volume()) {
				big = 1;
			}

			if (heavy) {