# See the file COPYING, distributed with empire, for restriction
# and warranty information.
-# Change the line below for your compiler. You will probably want
-# 'cc'. ('mcc' is a "merge compiler" that takes errors, merges them
-# with the source, and tosses you into an editor. I also use various
-# cross compilers on this line.)
-
-#CC = mcc
-#CC = cpccc
-CC = cc
-
# Change the line below for your system. If you are on a Sun or Vax,
# you may want BSD.
# Use -g to compile the program for debugging.
-#DEBUG = -g -DDEBUG
-DEBUG = -O
+DEBUG = -g -DDEBUG
+#DEBUG = -O
# Use -p to profile the program.
#PROFILE = -p -DPROFILE
# Define all necessary libraries. 'curses' is necessary. 'termcap'
# is needed on BSD systems.
-LIBS = -lcurses
+LIBS = -ldcurses
#LIBS = -lcurses -ltermcap
# You shouldn't have to modify anything below this line.
-FLAGS = $(DEBUG) $(PROFILE) -c -D$(SYS)
-CCCMD = $(CC) $(FLAGS)
+CFLAGS = $(DEBUG) $(PROFILE) -D$(SYS)
INS = /etc/install
FILES = \
empire: $(OFILES)
$(CC) $(PROFILE) -o empire $(OFILES) $(LIBS)
-$(OFILES): extern.h empire.h
- $(CCCMD) $<
-
lint: $(FILES)
lint -u -D$(SYS) $(FILES) -lcurses
static view_map_t emap[MAP_SIZE]; /* pruned explore map */
+int load_army();
+ void move_objective();
+
void
comp_move (nmoves)
int nmoves;
piece_info_t *obj;
{
long move_away();
- void move_objective();
long find_attack();
void make_army_load_map(), make_unload_map(), make_tt_load_map();
void board_ship();
-/* $Id$ - (c) Copyright 1987, 1988 Chuck Simmons */
+/* $Id: display.c,v 1.5 1992/08/18 22:39:00 esr Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */
/*
* Copyright (C) 1987, 1988 Chuck Simmons
static int save_cursor; /* currently displayed cursor position */
static int change_ok = TRUE; /* true if new sector may be displayed */
+static void show_loc();
+static disp_square();
+
#ifdef A_COLOR
void init_colors()
{
view_map_t vmap[];
long loc; /* location to display */
{
- void print_sector(), show_loc();
+ void print_sector();
if (change_ok || whose != whose_map || !on_screen (loc))
print_sector (whose, vmap, loc_sector (loc));
*/
-static disp_square(vp)
+static int disp_square(vp)
view_map_t *vp;
{
#ifdef A_COLOR
#include "empire.h"
#include "extern.h"
+void e_move();
+
void
edit(edit_cursor)
long edit_cursor;
{
char e_cursor();
void e_leave(), e_print(), e_random();
- void e_stasis(), e_move(), e_end(), e_wake(), e_sleep();
+ void e_stasis(), e_end(), e_wake(), e_sleep();
void e_info(), e_prod(), e_help(), e_explore();
void e_fill(), e_land(), e_city_func(), e_transport();
void e_attack(), e_repair();
-/* $Id$ - (c) Copyright 1987, 1988 Chuck Simmons */
+/* $Id: empire.c,v 1.2 1990/03/29 23:22:07 eric Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */
/*
* Copyright (C) 1987, 1988 Chuck Simmons
#include "empire.h"
#include "extern.h"
+void c_examine(), c_movie();
+
void
empire () {
void do_command();
do_command (orders)
char orders;
{
- void c_debug(), c_quit(), c_sector(), c_map(), c_examine();
- void c_give(), c_movie();
+ void c_debug(), c_quit(), c_sector(), c_map();
+ void c_give();
char e;
int ncycle;
-/* $Id$ - (c) Copyright 1987, 1988 Chuck Simmons */
+/* $Id: extern.h,v 1.2 1990/03/29 23:22:44 eric Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */
/*
* Copyright (C) 1987, 1988 Chuck Simmons
void rndini(); /* math routines */
long irand();
int dist();
-int sqrt();
+int isqrt();
int find_nearest_city();
city_info_t *find_city(); /* object routines */
#include "empire.h"
#include "extern.h"
+long remove_land();
+
/*
Initialize a new game. Here we generate a new random map, put cities
on the map, select cities for each opponent, and zero out the lists of
static long land[MAP_SIZE];
void place_cities () {
- long regen_land(), remove_land();
+ long regen_land();
long placed, i, loc;
long num_land;
-/* $Id$ - (c) Copyright 1987, 1988 Chuck Simmons */
+/* $Id: main.c,v 1.2 1990/03/29 23:22:23 eric Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */
/*
* Copyright (C) 1987, 1988 Chuck Simmons
/* compute min distance between cities */
land = MAP_SIZE * (100 - WATER_RATIO) / 100; /* available land */
land /= NUM_CITY; /* land per city */
- MIN_CITY_DIST = sqrt (land); /* distance between cities */
+ MIN_CITY_DIST = isqrt (land); /* distance between cities */
empire (); /* call main routine */
return (0);
-/* $Id$ - (c) Copyright 1987, 1988 Chuck Simmons */
+/* $Id: map.c,v 1.2 1990/03/30 11:23:26 eric Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */
/*
* Copyright (C) 1987, 1988 Chuck Simmons
STATIC int terrain_type();
STATIC void start_perimeter();
STATIC void add_cell();
+STATIC int vmap_count_path ();
static perimeter_t p1; /* perimeter list for use as needed */
static perimeter_t p2;
of the square root using Newton's method.
*/
-int sqrt (n)
+int isqrt (n)
int n;
{
int guess;
#include "empire.h"
#include "extern.h"
+void fatal();
+void move_to_dest();
+void move_army_to_city();
+
void
user_move () {
void piece_move();
move_land (obj)
piece_info_t *obj;
{
- void move_to_dest();
-
long best_dist, best_loc;
long new_dist;
piece_info_t *p;
user_skip (obj)
piece_info_t *obj;
{
- void move_army_to_city();
-
if (obj->type == ARMY && user_map[obj->loc].contents == 'O')
move_army_to_city (obj, obj->loc);
else obj->moved++;
piece_info_t *obj;
long loc;
{
- void fatal();
-
int enemy_killed;
enemy_killed = FALSE;