home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
games
/
volume13
/
thricken
/
patch1
/
patches01
Wrap
Text File
|
1992-08-03
|
11KB
|
514 lines
diff -c ./Makefile ../thricken-1.1/Makefile
*** ./Makefile Mon Jun 22 02:05:54 1992
--- ../thricken-1.1/Makefile Mon Jun 22 01:45:26 1992
***************
*** 5,13 ****
LIBS = -lcurses -ltermcap
# directories
! BINDIR = /dcs/89/rince/open/bin.$(ARCH)
! LIBDIR = /dcs/89/rince/open/lib/thricken
! MANDIR = /dcs/89/rince/open/man
OBJ = files.o main.o scores.o screen.o
--- 5,14 ----
LIBS = -lcurses -ltermcap
# directories
! HOME = /dcs/89/rince/open
! BINDIR = $(HOME)/bin.$(ARCH)
! LIBDIR = $(HOME)/lib/thricken
! MANDIR = $(HOME)/man
OBJ = files.o main.o scores.o screen.o
***************
*** 22,40 ****
install: thricken thricken.6
# the game
! -mkdir -p $(BINDIR)
chmod a+xr $(BINDIR)
-cp thricken $(BINDIR)
chmod a+x $(BINDIR)/thricken
# the data files
! -mkdir -p $(LIBDIR)
chmod a+xr $(LIBDIR)
-cp data/* $(LIBDIR)
chmod a+r $(LIBDIR)/*
# the man page
! -mkdir -p $(MANDIR)/man6
chmod a+xr $(MANDIR)/man6
-cp thricken.6 $(MANDIR)/man6
chmod a+r $(MANDIR)/man6/thricken.6
--- 23,42 ----
install: thricken thricken.6
# the game
! -mkdir $(BINDIR)
chmod a+xr $(BINDIR)
-cp thricken $(BINDIR)
chmod a+x $(BINDIR)/thricken
# the data files
! -mkdir $(LIBDIR)
chmod a+xr $(LIBDIR)
-cp data/* $(LIBDIR)
chmod a+r $(LIBDIR)/*
# the man page
! -mkdir $(MANDIR)
! -mkdir $(MANDIR)/man6
chmod a+xr $(MANDIR)/man6
-cp thricken.6 $(MANDIR)/man6
chmod a+r $(MANDIR)/man6/thricken.6
diff -c ./README ../thricken-1.1/README
*** ./README Mon Jun 22 02:05:53 1992
--- ../thricken-1.1/README Mon Jun 22 01:21:59 1992
***************
*** 1,3 ****
--- 1,5 ----
+ Thricken Version 1.1
+
This is the game of thricken - written by James 'Rince' Bonfield.
You may redistribute and modify any of this source provided that my name is
still mentioned in connection with the pieces of code I have written.
Common subdirectories: ./data and ../thricken-1.1/data
diff -c ./extern.h ../thricken-1.1/extern.h
*** ./extern.h Mon Jun 22 02:06:00 1992
--- ../thricken-1.1/extern.h Mon Jun 22 01:09:54 1992
***************
*** 1,6 ****
extern int load_level(int level);
extern void init_display();
! extern int draw_map(int y,int x);
extern void update_wins();
extern void draw_stats(char level);
extern void draw_you(char y, char x, char c);
--- 1,6 ----
extern int load_level(int level);
extern void init_display();
! extern void draw_map(int y,int x);
extern void update_wins();
extern void draw_stats(char level);
extern void draw_you(char y, char x, char c);
diff -c ./files.c ../thricken-1.1/files.c
*** ./files.c Mon Jun 22 02:06:00 1992
--- ../thricken-1.1/files.c Mon Jun 22 01:09:54 1992
***************
*** 1,3 ****
--- 1,4 ----
+ #include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <stdio.h>
***************
*** 5,14 ****
char *readline(FILE *fp);
int read_sprites();
char *spr_file, *data_file;
int load_level(int level) {
! int i,j;
FILE *fp;
char *level_file = strdup("xxlevel");
--- 6,16 ----
char *readline(FILE *fp);
int read_sprites();
+ int read_sprdata();
char *spr_file, *data_file;
int load_level(int level) {
! int i;
FILE *fp;
char *level_file = strdup("xxlevel");
***************
*** 35,42 ****
free(author);
author = strdup(readline(fp));
fclose(fp);
! read_sprites();
! read_sprdata();
}
char *readline(FILE *fp) {
--- 37,48 ----
free(author);
author = strdup(readline(fp));
fclose(fp);
! if (read_sprites() != 0)
! return -1;
! if (read_sprdata() != 0)
! return -1;
!
! return 0;
}
char *readline(FILE *fp) {
***************
*** 45,52 ****
* a bit of a kludge.
*/
static char buf[1024];
- int i=0;
- char c = '\0';
if (fgets(buf,1000,fp) == (char *)0)
return (char *)-1;
--- 51,56 ----
***************
*** 54,61 ****
return buf;
}
!
! read_sprites() {
FILE *fp;
char spr;
char *ptr;
--- 58,64 ----
return buf;
}
! int read_sprites() {
FILE *fp;
char spr;
char *ptr;
***************
*** 71,79 ****
sprite[spr][j][i] = ptr[i];
}
}
}
! read_sprdata() {
FILE *fp;
int i;
char *ptr;
--- 74,83 ----
sprite[spr][j][i] = ptr[i];
}
}
+ return 0;
}
! int read_sprdata() {
FILE *fp;
int i;
char *ptr;
***************
*** 108,111 ****
--- 112,116 ----
*(ptr+8)=0;c->dirs = strdup(ptr+4);
*(ptr+4)=0;c->coll = strdup(ptr+1);
}
+ return 0;
}
diff -c ./main.c ../thricken-1.1/main.c
*** ./main.c Mon Jun 22 02:06:01 1992
--- ../thricken-1.1/main.c Mon Jun 22 01:44:35 1992
***************
*** 1,9 ****
--- 1,13 ----
+ #include <stdlib.h>
+ #include <stdio.h>
#include <signal.h>
#include <errno.h>
#include <curses.h>
#include <string.h>
+
#include "thricken.h"
#include "extern.h"
+ #include "patchlevel.h"
extern int draw_sprite(WINDOW *w, int y,int x,char spr);
extern WINDOW *gw,*sw,*lw;
***************
*** 10,15 ****
--- 14,25 ----
void init();
char query_map(char y, char x);
+ void play_game(unsigned char startl,int moves);
+ void move_dir(char dir,char key);
+ void set_map(char y, char x, char p);
+ void save_map();
+ void restore_map();
+
char face[] = "<v^>";
char keys[] = "hjkl";
/* short cut for setting up n1 & n2 */
***************
*** 17,24 ****
char xs,ys;
! main(int argc, char **argv) {
! char c,level=-1;
extern char *optarg;
--- 27,34 ----
char xs,ys;
! int main(int argc, char **argv) {
! int c,level=-1;
extern char *optarg;
***************
*** 60,68 ****
}
startlevel = level;
play_game(level,moves);
}
! play_game(char startl,int moves) {
char c,t1,t2,t3,t4;
char dir;
--- 70,80 ----
}
startlevel = level;
play_game(level,moves);
+
+ return 0;
}
! void play_game(unsigned char startl,int smoves) {
char c,t1,t2,t3,t4;
char dir;
***************
*** 71,77 ****
do {
llevel = level;
lscore = score;
! lmoves = moves;
if (load_level(level) == -1) {
nocbreak();
echo();
--- 83,89 ----
do {
llevel = level;
lscore = score;
! moves = lmoves = smoves;
if (load_level(level) == -1) {
nocbreak();
echo();
***************
*** 118,124 ****
} while (1);
}
! move_dir(char dir,char key) {
char n1,n2,bang;
char nx,ny,mx,my;
struct coll *c;
--- 130,136 ----
} while (1);
}
! void move_dir(char dir,char key) {
char n1,n2,bang;
char nx,ny,mx,my;
struct coll *c;
***************
*** 176,186 ****
return map[(y+rows+1)%rows][(x+cols+1)%cols];
}
! set_map(char y, char x, char p) {
map[(y+rows+1)%rows][(x+cols+1)%cols]=p;
}
! save_map() {
int i;
for (i=0; i<100; i++) {
--- 188,198 ----
return map[(y+rows+1)%rows][(x+cols+1)%cols];
}
! void set_map(char y, char x, char p) {
map[(y+rows+1)%rows][(x+cols+1)%cols]=p;
}
! void save_map() {
int i;
for (i=0; i<100; i++) {
***************
*** 199,205 ****
oldpos.y = y;
}
! restore_map() {
int i;
for (i=0; i<100; i++) {
--- 211,217 ----
oldpos.y = y;
}
! void restore_map() {
int i;
for (i=0; i<100; i++) {
***************
*** 216,220 ****
moves = oldpos.moves;
x = oldpos.x;
y = oldpos.y;
-
}
--- 228,231 ----
Only in .: patch1
diff -c ./patchlevel.h ../thricken-1.1/patchlevel.h
*** ./patchlevel.h Mon Jun 22 02:06:16 1992
--- ../thricken-1.1/patchlevel.h Mon Jun 22 01:46:12 1992
***************
*** 0 ****
--- 1,10 ----
+ /* Patch 1:
+ * Fixed a few portability probs (such as use of signed vs unsigned)
+ * Updated manual page
+ * Fixed move counter
+ * Tidied up general coding - more checks for errors and better typed functions
+ * James Bonfield
+ */
+
+ char ident[] = "@(#)thricken: Version 1, patchlevel 1, May 22, 1992";
+ #define PATCHLEVEL 1
diff -c ./scores.c ../thricken-1.1/scores.c
*** ./scores.c Mon Jun 22 02:06:01 1992
--- ../thricken-1.1/scores.c Mon Jun 22 01:09:55 1992
***************
*** 35,40 ****
--- 35,41 ----
}
p=getpwuid(getuid());
+ /* should check return of find_level here (-1 = failure) */
l = find_level(getuid())->level;
/* if we cheated and started on a higher level then stop here */
***************
*** 112,118 ****
static struct scored ret;
if ((fp = open_scores(fp,"r")) == NULL) {
! return;
}
p=getpwuid(uid);
do {
--- 113,119 ----
static struct scored ret;
if ((fp = open_scores(fp,"r")) == NULL) {
! return (struct scored *)-1;
}
p=getpwuid(uid);
do {
diff -c ./screen.c ../thricken-1.1/screen.c
*** ./screen.c Mon Jun 22 02:06:01 1992
--- ../thricken-1.1/screen.c Mon Jun 22 01:09:55 1992
***************
*** 1,3 ****
--- 1,5 ----
+ #include <stdio.h>
+ #include <stdlib.h>
#include <signal.h>
#include <fcntl.h>
#include <curses.h>
***************
*** 20,27 ****
}
void init_display() {
! int i,j;
! char *ptr,s;
FILE *fp;
initscr();
signal(SIGTSTP,stop);
--- 22,28 ----
}
void init_display() {
! int i;
FILE *fp;
initscr();
signal(SIGTSTP,stop);
***************
*** 57,63 ****
exit(1);
}
! draw_sprite(WINDOW *w, int y, int x, char spr) {
int i,j;
for (j=0; j<SPRHEIGHT; j++)
--- 58,64 ----
exit(1);
}
! void draw_sprite(WINDOW *w, int y, int x, char spr) {
int i,j;
for (j=0; j<SPRHEIGHT; j++)
***************
*** 65,71 ****
mvwaddch(w,y+j,x+i,sprite[spr][j][i]);
}
! draw_map(int y, int x) {
int i,j;
for (i=0; i<SCRWIDTH; i++)
--- 66,72 ----
mvwaddch(w,y+j,x+i,sprite[spr][j][i]);
}
! void draw_map(int y, int x) {
int i,j;
for (i=0; i<SCRWIDTH; i++)
diff -c ./thricken.6 ../thricken-1.1/thricken.6
*** ./thricken.6 Mon Jun 22 02:06:02 1992
--- ../thricken-1.1/thricken.6 Mon Jun 22 01:09:55 1992
***************
*** 26,31 ****
--- 26,48 ----
the game into thinking you've completed the first 5 levels by starting on
level 5. Level 0 is the first level.
.sp
+ The keys are defined as follows :
+ .ta 1i 2i
+ .br
+ h left
+ .br
+ j down
+ .br
+ k up
+ .br
+ l right
+ .br
+ q quit
+ .br
+ s save (to memory)
+ .br
+ r restore (from memory)
+ .sp
Should you wish to give the game a different feel when using a different set
of sprites and rules you may specify a directory as an argument using the
.I -d directory