object.h revision 1.1 1 /* $Header: /tank/opengrok/rsync2/NetBSD/src/games/warp/object.h,v 1.1 2020/11/09 23:37:05 kamil Exp $ */
2
3 /* $Log: object.h,v $
4 /* Revision 1.1 2020/11/09 23:37:05 kamil
5 /* Add Warp Kit, Version 7.0 by Larry Wall
6 /*
7 /* Warp is a real-time space war game that doesn't get boring very quickly.
8 /* Read warp.doc and the manual page for more information.
9 /*
10 /* games/warp originally distributed with 4.3BSD-Reno, is back to the BSD
11 /* world via NetBSD. Its remnants were still mentioned in games/Makefile.
12 /*
13 /* Larry Wall, the original author and the copyright holder, generously
14 /* donated the game and copyright to The NetBSD Foundation, Inc.
15 /*
16 /* Import the game sources as-is from 4.3BSD-Reno, with the cession
17 /* of the copyright and license to BSD-2-clause NetBSD-style.
18 /*
19 /* Signed-off-by: Larry Wall <larry (at) wall.org>
20 /* Signed-off-by: Kamil Rytarowski <kamil (at) netbsd.org>
21 /*
22 * Revision 7.0.1.2 86/12/12 17:01:38 lwall
23 * Baseline for net release.
24 *
25 * Revision 7.0.1.1 86/10/16 10:52:30 lwall
26 * Added Damage. Fixed random bugs.
27 *
28 * Revision 7.0 86/10/08 15:13:04 lwall
29 * Split into separate files. Added amoebas and pirates.
30 *
31 */
32
33 #define Root 0
34 #define Base 1
35 #define Enterprise 2
36 #define Star 3
37 #define Torp 4
38 #define Enemy 5
39 #define Web 6
40 #define Crusher 7
41
42 typedef struct object {
43 char posx, posy;
44 #ifdef SIGNEDCHAR
45 char velx, vely;
46 #else
47 short velx, vely;
48 #endif
49 struct object *next, *prev, *contend;
50 long energy;
51 long mass;
52 char type;
53 char image;
54 char strategy;
55 char flags;
56 } OBJECT;
57
58 #define PIRATE 1 /* we may mutiny */
59 #define FRIENDLY 2 /* we aren't really an enemy, for now */
60 #define STATIC 4 /* we are not in the movers list at the moment */
61 #define COUNTDOWN 8 /* we are counting down for something */
62 #define CLOAKS 16 /* we can cloak */
63
64 #ifdef DOINIT
65 OBJECT root = {0, 0, 0, 0, &root, &root, 0, 0, 0, Root, '?', 0, 0};
66 #else
67 EXT OBJECT root;
68 #endif
69
70 #ifdef DOINIT
71 OBJECT free_root = {0, 0, 0, 0, &free_root, &free_root, 0, 0, 0, Root, '?', 0, 0};
72 #else
73 EXT OBJECT free_root;
74 #endif
75
76 EXT OBJECT *ent;
77 EXT OBJECT *base;
78 EXT OBJECT *enemies;
79 EXT OBJECT *movers;
80 EXT OBJECT *realapollo;
81 EXT OBJECT *nuke;
82
83 EXT OBJECT *occupant[YSIZE][XSIZE];
84
85 OBJECT *make_object();
86
87 void unmake_object();
88 void free_object();
89 void object_init();
90