Пример #1
0
// add animation
int16 Op_AddAnimation() {
	int stepY = popVar();
	int stepX = popVar();
	int direction = popVar();
	int start = popVar();
	int type = popVar();
	int obj = popVar();
	int overlay = popVar();

	if (!overlay) {
		overlay = currentScriptPtr->overlayNumber;
	}

	if (direction >= 0 && direction <= 3) {
		actorStruct *si;

		si = addAnimation(&actorHead, overlay, obj, direction, type);

		if (si) {
			objectParamsQuery params;

			getMultipleObjectParam(overlay, obj, &params);

			si->x = params.X;
			si->y = params.Y;
			si->x_dest = -1;
			si->y_dest = -1;
			si->endDirection = -1;
			si->start = start;
			si->stepX = stepX;
			si->stepY = stepY;

			int newFrame = ABS(actor_end[direction][0]) - 1;

			int zoom = computeZoom(params.Y);

			if (actor_end[direction][0] < 0) {
				zoom = -zoom;
			}

			getPixel(params.X, params.Y);

			setObjectPosition(overlay, obj, 3, newFrame + start);
			setObjectPosition(overlay, obj, 4, zoom);
			setObjectPosition(overlay, obj, 5, numPoly);

			animationStart = false;
		}
	}

	return 0;
}
Пример #2
0
void set_anim(int ovl, int obj, int start, int x, int y, int mat, int state) {
	int newf, zoom;

	newf = ABS(mat) - 1;

	zoom = computeZoom(y);
	if (mat < 0)
		zoom = -zoom;

	setObjectPosition(ovl, obj, 0, x);
	setObjectPosition(ovl, obj, 1, y);
	setObjectPosition(ovl, obj, 2, y);
	setObjectPosition(ovl, obj, 4, zoom);
	setObjectPosition(ovl, obj, 3, newf + start);
	setObjectPosition(ovl, obj, 5, state);
}
Пример #3
0
int16 Op_SetObjectAtNode() {
	int16 node = popVar();
	int16 obj = popVar();
	int16 ovl = popVar();

	if (!ovl)
		ovl = currentScriptPtr->overlayNumber;

	int nodeInfo[2];

	if (!getNode(nodeInfo, node)) {
		setObjectPosition(ovl, obj, 0, nodeInfo[0]);
		setObjectPosition(ovl, obj, 1, nodeInfo[1]);
		setObjectPosition(ovl, obj, 2, nodeInfo[1]);
		setObjectPosition(ovl, obj, 4, computeZoom(nodeInfo[1]));
	}

	return 0;
}
Пример #4
0
int16 Op_GetZoom() {
	return (computeZoom(popVar()));
}
Пример #5
0
void processActorWalk(MovementEntry &resx_y, int16 *inc_droite, int16 *inc_droite0,
                      int16 *inc_chemin, point* cor_joueur,
                      int16 solution0[NUM_NODES + 3][2], int16 *inc_jo1, int16 *inc_jo2,
                      int16 *dir_perso, int16 *inc_jo0, int16 num) {
	int u = 0;
	inc_jo = *inc_jo0;

	int i = *inc_chemin;

	if (!*inc_droite) {
		int x1 = solution0[i][0];
		int y1 = solution0[i][1];
		i++;
		if (solution0[i][0] != -1) {
			do {
				if (solution0[i][0] != -2) {
					int x2 = solution0[i][0];
					int y2 = solution0[i][1];
					if ((x1 == x2) && (y1 == y2)) {
						resx_y.x = -1;
						resx_y.y = -1;
						freePerso(num);

						return;
					}

					*inc_droite0 = cor_droite(x1, y1, x2, y2, cor_joueur);
					*dir_perso = resx_y.direction = direction(x1, y1, x2, y2, *inc_jo1, *inc_jo2);
					*inc_jo0 = inc_jo;
					u = 1;
				} else
					i++;

			} while (solution0[i][0] != -1 && !u);
		}
		if (!u) {
			resx_y.x = -1;
			resx_y.y = -1;
			freePerso(num);

			return;
		}
		*inc_chemin = i;
	}

	resx_y.x = cor_joueur[*inc_droite].x;
	resx_y.y = cor_joueur[*inc_droite].y;
	resx_y.direction = *dir_perso;
	resx_y.zoom = computeZoom(resx_y.y);

	getPixel(resx_y.x, resx_y.y);
	resx_y.poly = numPoly;

	u = subOp23(resx_y.zoom, inc_jo);
	if (!u)
		u = 1;
	*inc_droite += u;

	if ((*inc_droite) >= (*inc_droite0)) {
		*inc_droite = 0;
		resx_y.x = solution0[*inc_chemin][0];
		resx_y.y = solution0[*inc_chemin][1];
	}

}