-
Notifications
You must be signed in to change notification settings - Fork 2
/
enter.c
94 lines (87 loc) · 2.24 KB
/
enter.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
* enter.c
*
* This version modified to work as the client in a socket based protocol.
*/
#include "copyright.h"
#include <stdio.h>
#include <sys/types.h>
#include <errno.h>
#include <pwd.h>
#include <string.h>
#include <ctype.h>
#include "netrek.h"
/* Enter the game */
void
enter()
{
redrawTstats();
}
/*
* Doesn't really openmem, but it will set some stuff up...
*/
void
openmem()
{
int i;
players = universe.players;
torps = universe.torps;
plasmatorps = universe.plasmatorps;
status = universe.status;
planets = universe.planets;
phasers = universe.phasers;
mctl = universe.mctl;
messages = universe.messages;
for (i = 0; i < MAXPLAYER; i++) {
players[i].p_status = PFREE;
players[i].p_cloakphase = 0;
players[i].p_no = i;
players[i].p_ntorp = 0;
players[i].p_explode = 1;
players[i].p_stats.st_tticks = 1;
}
mctl->mc_current = 0;
status->time = 1;
status->timeprod = 1;
status->kills = 1;
status->losses = 1;
status->time = 1;
status->planets = 1;
status->armsbomb = 1;
for (i = 0; i < MAXPLAYER * MAXTORP; i++) {
torps[i].t_status = TFREE;
torps[i].t_no = i;
torps[i].t_owner = (i / MAXTORP);
}
for (i = 0; i < MAXPLAYER; i++) {
phasers[i].ph_status = PHFREE;
}
for (i = 0; i < MAXPLAYER * MAXPLASMA; i++) {
plasmatorps[i].pt_status = PTFREE;
plasmatorps[i].pt_no = i;
plasmatorps[i].pt_owner = (i / MAXPLASMA);
}
for (i = 0; i < MAXPLANETS; i++) {
planets[i].pl_no = i;
}
/* initialize planet redraw for moving planets */
for (i = 0; i < MAXPLANETS; i++) {
pl_update[i].plu_update = -1;
}
}
#if 0
void
drawTstats()
{
char buf[BUFSIZ];
sprintf(buf, "Flags Warp Dam Shd Torps Kills Armies Fuel Wtemp Etemp");
W_WriteText(tstatw, 50, 5, textColor, buf, strlen(buf), W_RegularFont);
sprintf(buf,
"Maximum: %2d %3d %3d %3d %6d %3d %3d",
me->p_ship.s_maxspeed, me->p_ship.s_maxdamage,
me->p_ship.s_maxshield, me->p_ship.s_maxarmies,
me->p_ship.s_maxfuel, me->p_ship.s_maxwpntemp / 10,
me->p_ship.s_maxegntemp / 10);
W_WriteText(tstatw, 50, 27, textColor, buf, strlen(buf), W_RegularFont);
}
#endif