A potpourri of changes:
- do not mention a mail being sent when hiscore is broken, this feature is disabled. - when a player dies, reset eater position. Also pick startup position closer to the MSDOS version of the game. - use {s,}random instead of {s,}rand. ok deanna@ for my yearly ports commit.
This commit is contained in:
parent
a734a30e65
commit
3efbeaf828
@ -1,9 +1,9 @@
|
||||
# $OpenBSD: Makefile,v 1.22 2008/04/25 13:54:27 deanna Exp $
|
||||
# $OpenBSD: Makefile,v 1.23 2008/04/25 22:39:33 miod Exp $
|
||||
|
||||
COMMENT= win land without colliding with 'flyers' and 'eaters'
|
||||
|
||||
DISTNAME= xonix-1.4
|
||||
PKGNAME= ${DISTNAME}p3
|
||||
PKGNAME= ${DISTNAME}p4
|
||||
CATEGORIES= games
|
||||
|
||||
MASTER_SITES= ftp://ftp.interface-business.de/pub/outgoing/
|
||||
|
261
games/xonix/patches/patch-xonix_c
Normal file
261
games/xonix/patches/patch-xonix_c
Normal file
@ -0,0 +1,261 @@
|
||||
$OpenBSD: patch-xonix_c,v 1.1 2008/04/25 22:39:36 miod Exp $
|
||||
--- xonix.c.orig Thu Sep 14 11:52:10 1995
|
||||
+++ xonix.c Sat Feb 9 16:39:07 2008
|
||||
@@ -97,6 +97,7 @@ Boolean HorizontalBounceCheck (int x, int y, int size,
|
||||
unsigned char *bouncePartner);
|
||||
Boolean VerticalBounceCheck (int x, int y, int size,
|
||||
unsigned char *bouncePartner);
|
||||
+void InitialEaterPosition (int);
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* Do_New startet ein komplett neues Spiel */
|
||||
@@ -199,7 +200,44 @@ void NewRunner (void)
|
||||
return;
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * Sets the initial position and direction of a given eater.
|
||||
+ */
|
||||
+void InitialEaterPosition (int eater)
|
||||
+{
|
||||
+ gEater[eater].sx = EATER_SIZE;
|
||||
+ gEater[eater].sy = EATER_SIZE;
|
||||
+ gEater[eater].dx = 1;
|
||||
+ gEater[eater].dy = 1;
|
||||
|
||||
+ switch (eater % 4) /* Anfangsrichtung der Fresser */
|
||||
+ {
|
||||
+ case 0:
|
||||
+ gEater[eater].x = H_STEPS - RATIO;
|
||||
+ gEater[eater].y = V_STEPS - RATIO - 1 - eater * 4;
|
||||
+ break;
|
||||
+
|
||||
+ case 1:
|
||||
+ gEater[eater].x = H_STEPS - RATIO - eater * 4;
|
||||
+ gEater[eater].y = V_STEPS - RATIO;
|
||||
+ gEater[eater].dy *= -1;
|
||||
+ break;
|
||||
+
|
||||
+ case 2:
|
||||
+ gEater[eater].x = H_STEPS - RATIO - eater * 4;
|
||||
+ gEater[eater].y = 0;
|
||||
+ gEater[eater].dx *= -1;
|
||||
+ break;
|
||||
+
|
||||
+ case 3:
|
||||
+ gEater[eater].x = 0;
|
||||
+ gEater[eater].y = V_STEPS - RATIO;
|
||||
+ gEater[eater].dx *= -1;
|
||||
+ gEater[eater].dy *= -1;
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* NewEater erzeugt einen neuen Fresser im Rahmenbereich und traegt ihn in */
|
||||
/* das Statusfeld ein */
|
||||
@@ -209,37 +247,8 @@ void NewEater (void)
|
||||
{
|
||||
if (gEaterCount < MAX_EATER)
|
||||
{
|
||||
- gEater[gEaterCount].sx = EATER_SIZE;
|
||||
- gEater[gEaterCount].sy = EATER_SIZE;
|
||||
- gEater[gEaterCount].dx = 1;
|
||||
- gEater[gEaterCount].dy = 1;
|
||||
+ InitialEaterPosition (gEaterCount);
|
||||
|
||||
- switch (gEaterCount % 4) /* Anfangsrichtung der Fresser */
|
||||
- {
|
||||
- case 0:
|
||||
- gEater[gEaterCount].x = H_STEPS - RATIO;
|
||||
- gEater[gEaterCount].y = V_STEPS - RATIO - 1 - gEaterCount * 4;
|
||||
- break;
|
||||
-
|
||||
- case 1:
|
||||
- gEater[gEaterCount].x = H_STEPS - RATIO - gEaterCount * 4;
|
||||
- gEater[gEaterCount].y = V_STEPS - RATIO;
|
||||
- gEater[gEaterCount].dy *= -1;
|
||||
- break;
|
||||
-
|
||||
- case 2:
|
||||
- gEater[gEaterCount].x = H_STEPS - RATIO - gEaterCount * 4;
|
||||
- gEater[gEaterCount].y = 0;
|
||||
- gEater[gEaterCount].dx *= -1;
|
||||
- break;
|
||||
-
|
||||
- case 3:
|
||||
- gEater[gEaterCount].x = 0;
|
||||
- gEater[gEaterCount].y = V_STEPS - RATIO;
|
||||
- gEater[gEaterCount].dx *= -1;
|
||||
- gEater[gEaterCount].dy *= -1;
|
||||
- break;
|
||||
- }
|
||||
/* Fresser in Statusfeld eintragen */
|
||||
|
||||
*(gMyStatusArea
|
||||
@@ -1092,7 +1101,7 @@ void FillNewArea (void)
|
||||
/* Spielfigur angeknabbert, wird TRUE zurueckgegeben. */
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
-Boolean NewEaterPosition (void)
|
||||
+Boolean NewEaterPosition (Boolean reset)
|
||||
{
|
||||
int i, j;
|
||||
int nextX, nextY;
|
||||
@@ -1102,68 +1111,72 @@ Boolean NewEaterPosition (void)
|
||||
GWorldEntry ();
|
||||
|
||||
returnFlag = FALSE;
|
||||
- hbFlag = FALSE;
|
||||
- vbFlag = FALSE;
|
||||
|
||||
- for (i = 0; i < gEaterCount; i ++)
|
||||
+ if (reset == FALSE)
|
||||
{
|
||||
- nextX = gEater[i].x + gEater[i].dx;
|
||||
- nextY = gEater[i].y + gEater[i].dy;
|
||||
+ hbFlag = FALSE;
|
||||
+ vbFlag = FALSE;
|
||||
|
||||
- if ((nextX >= 0) && (nextX < H_STEPS)) /* Alles bleibt im Rahmen */
|
||||
+ for (i = 0; i < gEaterCount; i ++)
|
||||
{
|
||||
- if ((bouncePartner = *(gMyStatusArea + gEater[i].y * H_STEPS +
|
||||
- nextX)) != (unsigned char) FILLED) /* Bumm !!! */
|
||||
+ nextX = gEater[i].x + gEater[i].dx;
|
||||
+ nextY = gEater[i].y + gEater[i].dy;
|
||||
+
|
||||
+ if ((nextX >= 0) && (nextX < H_STEPS)) /* Alles bleibt im Rahmen */
|
||||
{
|
||||
- if ((bouncePartner & (unsigned char) RUNNER) ==
|
||||
- (unsigned char) RUNNER) /* Aetsch ! */
|
||||
+ if ((bouncePartner = *(gMyStatusArea + gEater[i].y * H_STEPS +
|
||||
+ nextX)) != (unsigned char) FILLED) /* Bumm !!! */
|
||||
{
|
||||
- returnFlag = TRUE;
|
||||
- }
|
||||
+ if ((bouncePartner & (unsigned char) RUNNER) ==
|
||||
+ (unsigned char) RUNNER) /* Aetsch ! */
|
||||
+ {
|
||||
+ returnFlag = TRUE;
|
||||
+ }
|
||||
|
||||
+ hbFlag = TRUE;
|
||||
+ gEater[i].dx *= -1;
|
||||
+ }
|
||||
+ }
|
||||
+ else /* Hier darf keiner 'raus */
|
||||
+ {
|
||||
hbFlag = TRUE;
|
||||
- gEater[i].dx *= -1;
|
||||
+ gEater[i].dx *= -1; /* Wende !!! */
|
||||
}
|
||||
- }
|
||||
- else /* Hier darf keiner 'raus */
|
||||
- {
|
||||
- hbFlag = TRUE;
|
||||
- gEater[i].dx *= -1; /* Wende !!! */
|
||||
- }
|
||||
|
||||
- if ((nextY >= 0) && (nextY < V_STEPS)) /* Alles bleibt im Rahmen */
|
||||
- {
|
||||
- if ((bouncePartner = *(gMyStatusArea + nextY * H_STEPS +
|
||||
- gEater[i].x)) != (unsigned char) FILLED) /* Bumm ! */
|
||||
- {
|
||||
- if ((bouncePartner & (unsigned char) RUNNER) ==
|
||||
- (unsigned char) RUNNER) /* Aetsch ! */
|
||||
- {
|
||||
- returnFlag = TRUE;
|
||||
- }
|
||||
+ if ((nextY >= 0) && (nextY < V_STEPS)) /* Alles bleibt im Rahmen */
|
||||
+ {
|
||||
+ if ((bouncePartner = *(gMyStatusArea + nextY * H_STEPS +
|
||||
+ gEater[i].x)) != (unsigned char) FILLED) /* Bumm ! */
|
||||
+ {
|
||||
+ if ((bouncePartner & (unsigned char) RUNNER) ==
|
||||
+ (unsigned char) RUNNER) /* Aetsch ! */
|
||||
+ {
|
||||
+ returnFlag = TRUE;
|
||||
+ }
|
||||
|
||||
- vbFlag = TRUE;
|
||||
- gEater[i].dy *= -1;
|
||||
- }
|
||||
- }
|
||||
- else /* Hier darf keiner 'raus */
|
||||
- {
|
||||
- vbFlag = TRUE;
|
||||
- gEater[i].dy *= -1; /* Wende !!! */
|
||||
- }
|
||||
+ vbFlag = TRUE;
|
||||
+ gEater[i].dy *= -1;
|
||||
+ }
|
||||
+ }
|
||||
+ else /* Hier darf keiner 'raus */
|
||||
+ {
|
||||
+ vbFlag = TRUE;
|
||||
+ gEater[i].dy *= -1; /* Wende !!! */
|
||||
+ }
|
||||
|
||||
- if ((vbFlag == FALSE) && (hbFlag == FALSE)) /* evtl. nur diagonal */
|
||||
- {
|
||||
- if ((bouncePartner = *(gMyStatusArea + nextY * H_STEPS +
|
||||
- nextX)) != (unsigned char) FILLED) /* Bumm ! */
|
||||
+ if ((vbFlag == FALSE) && (hbFlag == FALSE)) /* evtl. nur diagonal */
|
||||
{
|
||||
- gEater[i].dx *= -1;
|
||||
- gEater[i].dy *= -1;
|
||||
+ if ((bouncePartner = *(gMyStatusArea + nextY * H_STEPS +
|
||||
+ nextX)) != (unsigned char) FILLED) /* Bumm ! */
|
||||
+ {
|
||||
+ gEater[i].dx *= -1;
|
||||
+ gEater[i].dy *= -1;
|
||||
|
||||
- if ((bouncePartner & (unsigned char) RUNNER) ==
|
||||
+ if ((bouncePartner & (unsigned char) RUNNER) ==
|
||||
(unsigned char) RUNNER) /* Aetsch ! */
|
||||
- {
|
||||
- returnFlag = TRUE;
|
||||
+ {
|
||||
+ returnFlag = TRUE;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1180,8 +1193,15 @@ Boolean NewEaterPosition (void)
|
||||
|
||||
UnsetEaterToStatus (gEater[i].x, gEater[i].y);
|
||||
|
||||
- gEater[i].x += gEater[i].dx;
|
||||
- gEater[i].y += gEater[i].dy;
|
||||
+ if (reset == TRUE)
|
||||
+ {
|
||||
+ InitialEaterPosition (i);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ gEater[i].x += gEater[i].dx;
|
||||
+ gEater[i].y += gEater[i].dy;
|
||||
+ }
|
||||
|
||||
SetEaterToStatus (gEater[i].x, gEater[i].y);
|
||||
|
||||
@@ -1247,6 +1267,7 @@ void GetNewPlayer (void)
|
||||
else
|
||||
{
|
||||
NewRunner ();
|
||||
+ NewEaterPosition (TRUE); /* reset eater position */
|
||||
|
||||
BELL ();
|
||||
}
|
||||
@@ -1435,8 +1456,8 @@ void Animate (void)
|
||||
|
||||
default:
|
||||
|
||||
- if (NewEaterPosition () == TRUE)/* Spielfigur von Fresser "ange-*/
|
||||
- { /* knabbert" */
|
||||
+ if (NewEaterPosition (FALSE) == TRUE) /* Spielfigur von Fresser */
|
||||
+ { /* "angeknabbert" */
|
||||
GetNewPlayer ();
|
||||
}
|
||||
else if (NewFlyerPosition () == TRUE) /* Spur der Spielfigur von*/
|
17
games/xonix/patches/patch-xonix_h
Normal file
17
games/xonix/patches/patch-xonix_h
Normal file
@ -0,0 +1,17 @@
|
||||
$OpenBSD: patch-xonix_h,v 1.1 2008/04/25 22:39:36 miod Exp $
|
||||
--- xonix.h.orig Fri Sep 8 09:51:30 1995
|
||||
+++ xonix.h Sat Feb 9 13:59:09 2008
|
||||
@@ -288,11 +288,11 @@ extern void ShowHighScore (void);
|
||||
|
||||
#endif /* USE_X11 */
|
||||
|
||||
-#ifdef __FreeBSD__
|
||||
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||
|
||||
#define rand() random()
|
||||
#define srand(x) srandom(x)
|
||||
|
||||
-#endif /* __FreeBSD */
|
||||
+#endif /* __FreeBSD__ || __OpenBSD__ */
|
||||
|
||||
#endif /* XONIX_H */
|
14
games/xonix/patches/patch-xonix_man
Normal file
14
games/xonix/patches/patch-xonix_man
Normal file
@ -0,0 +1,14 @@
|
||||
$OpenBSD: patch-xonix_man,v 1.1 2008/04/25 22:39:36 miod Exp $
|
||||
--- xonix.man.orig Sat Feb 9 16:43:48 2008
|
||||
+++ xonix.man Sat Feb 9 16:43:59 2008
|
||||
@@ -73,9 +73,7 @@ the game; de-iconizing will continue it.
|
||||
|
||||
On Posix-compliant systems, there is also a high-score file,
|
||||
\fB$PROJECTROOT/\fP\fIlib/X11/xonix/scores\fP. It records the top ten
|
||||
-xonix players for that machine. As a special compile-time option,
|
||||
-a mail is sent to the previous xonix score leader when he's lost
|
||||
-his first rank.
|
||||
+xonix players for that machine.
|
||||
|
||||
.SH WIDGETS
|
||||
\fIXonix\fP uses the X Toolkit and the Athena Widget Set.
|
Loading…
Reference in New Issue
Block a user