[net.sources.games] search with hack/rogue-like movement

wws@whuxlm.UUCP (Stoll W William) (08/31/85)

A few days ago I posted some suggestions for search to make
it easier for people with hack mentalities.  Well, I had some
time today and made the changes.  For a list of what you get
if you fix the makefile to include the -DHACK option, see
the comment at the beginning of the Makefile.

Maybe tomorrow I'll make it work under SVR2...  :-).

Bill Stoll, ..!whuxlm!wws

P.S. How do you lock onto other ships without colliding first?


--- sorry I don't have the fancy file-updating stuff. ---
*** diff of original Makefile with HACKed Makefile ***
6a7,16
> # If you don't want the following changes, take out the flag -DHACK
> # 1) either hack/rogue direction keys or keypad may be used
> # 2) 'h' (homing cmd) replaced by 'H' or 'p'
> # 3) Either '.' or '0' will phaser
> # 4) 'b' (broadcast) replaced by 'B'
> # 5) 'j' (join group) replaced by 'J'
> # 6) 'l' (list players in group) replaced by 'L'
> # 7) 'n' (nuke) replaced by ' ' (spacebar)
> # 8) upward velocity (and position) is positive instead of negative.
> #
17c27
< OPTIONS=-DINET -DLIBDIR=\"${LIBDIR}
---
> OPTIONS=-DINET -DHACK -DLIBDIR=\"${LIBDIR}
45c55
< 	install -s -o ${ROOT} -g ${GROUP} -m 6751 searchd /etc/searchd
---
> 	install -s -o ${ROOT} -g ${GROUP} -m 6751 searchd ${ETCDIR}/searchd

*** diff of original cmds1.c with HACKed cmds1.c ***
56a57,85
> #ifdef HACK
> 	/* allow either way of moving (in hack mode) */
> 	switch (where) {
> 	case NOHACK:
> 		where = NO;
> 		break;
> 	case NEHACK:
> 		where = NE;
> 		break;
> 	case EAHACK:
> 		where = EA;
> 		break;
> 	case SEHACK:
> 		where = SE;
> 		break;
> 	case SOHACK:
> 		where = SO;
> 		break;
> 	case SWHACK:
> 		where = SW;
> 		break;
> 	case WEHACK:
> 		where = WE;
> 		break;
> 	case NWHACK:
> 		where = NW;
> 		break;
> 	}
> #endif
183a213
> #ifdef HACK
184a215,223
> 		put(p, "%d  %d", val->u_alien.cx, 0 - val->u_alien.cy);
> 	else if (isplayer(val))
> 		put(p, "%d  %d", val->u_player.curx, 0 - val->u_player.cury);
> 	else if (isbase(val))
> 		put(p, "%d  %d", val->u_sbase.xpos, 0 - val->u_sbase.ypos);
> 	else
> 		put(p, "%d  %d", val->u_torps.torx, 0 - val->u_torps.tory);
> #else
> 	if (isalien(val))
191a231
> #endif

*** diff of original cmds2.c with HACKed cmds2.c ***
53a54,82
> #ifdef HACK
> 	/* allow either way of moving (in hack mode) */
> 	switch (c) {
> 	case NOHACK:
> 		c = NO;
> 		break;
> 	case NEHACK:
> 		c = NE;
> 		break;
> 	case EAHACK:
> 		c = EA;
> 		break;
> 	case SEHACK:
> 		c = SE;
> 		break;
> 	case SOHACK:
> 		c = SO;
> 		break;
> 	case SWHACK:
> 		c = SW;
> 		break;
> 	case WEHACK:
> 		c = WE;
> 		break;
> 	case NWHACK:
> 		c = NW;
> 		break;
> 	}
> #endif

*** diff of original defines.h with HACKed defines.h ***
88a89,99
>  * Input directional keyboard defs used in hack-movement mode
>  */
> #define	NOHACK	'k'
> #define	NEHACK	'u'
> #define	EAHACK	'l'
> #define	SEHACK	'n'
> #define	SOHACK	'j'
> #define	SWHACK	'b'
> #define	WEHACK	'h'
> #define	NWHACK	'y'
> /*

*** diff of original main.c with HACKed main.c ***
294a295,299
> #ifdef HACK
> 				case 'p':	/* position (quicker than
> 						   using shift key) */
> 				case 'H':	/* home */
> #else
295a301
> #endif
309a316,318
> #ifdef HACK
> 				case ' ':	/* spacebar replaces nuke */
> #else
310a320
> #endif
312a323,325
> #ifdef HACK
> 				case 'J':	/* join */
> #else
313a327
> #endif
318a333,334
> 				case 'B':	/* broadcast */
> #ifndef HACK
319a336
> #endif
357a375,377
> #ifdef HACK
> 			case 'L':	/* list */
> #else
358a379
> #endif
363a385,387
> #ifdef HACK
> 			case '.':	/* phaser */
> #endif
398a423,425
> #ifdef HACK
> 				cput(VLDATA, p, "%d %d", p->offx, 0 - p->offy);
> #else
399a427
> #endif
415a444,446
> #ifdef HACK
> 			case 'J':	/* join */
> #else
416a448
> #endif
418a451,453
> #ifdef HACK
> 			case 'B':	/* broadcast */
> #else
419a455
> #endif
424c460,464
< 			case 'h':
---
> #ifdef HACK
> 			case 'H':	/* home */
> #else
> 			case 'h': 
> #endif
428a469,471
> #ifdef HACK
> 			case ' ':	/* spacebar replaces nuke */
> #else
429a473
> #endif
442a487,515
> #ifdef HACK
> 			/* allow either way of moving (in hack mode) */
> 			switch (c) {
> 			case NOHACK:
> 				c = NO;
> 				break;
> 			case NEHACK:
> 				c = NE;
> 				break;
> 			case EAHACK:
> 				c = EA;
> 				break;
> 			case SEHACK:
> 				c = SE;
> 				break;
> 			case SOHACK:
> 				c = SO;
> 				break;
> 			case SWHACK:
> 				c = SW;
> 				break;
> 			case WEHACK:
> 				c = WE;
> 				break;
> 			case NWHACK:
> 				c = NW;
> 				break;
> 			}
> #endif
477a551,553
> #ifdef HACK
> 			cput(VLDATA, p, "%d %d", p->offx, 0 - p->offy);
> #else
478a555
> #endif
744a822,824
> #ifdef HACK
> 				cput(POS2DATA, p, "%d", 0 - p->cury);
> #else
745a826
> #endif

lars@myab.UUCP (lars) (09/07/85)

In article <827@whuxlm.UUCP> wws@whuxlm.UUCP (Stoll W William) writes:
>Maybe tomorrow I'll make it work under SVR2...  :-).

We ported search to SVR2.2 using messages.

However, there seems to be a bug in the system regarding messages:

The system hangs. Debug information yields that the number of messages on a
queue doesn't correspond to the real number of messages in the queue.

This happens very seldom, and sometimes only the message queue 'hangs'.

If you know anything about this bug, or is interested in the game, please
answer by mail. If a large enough number of requests for the games are
recieved, I will post the source to the net. I will also summarize
bug reports and fixes regarding message queues.
-- 
    ______________________________________________________
	Lars Pensjo
	{decvax,philabs}!mcvax!enea!chalmers!myab!lars