5 #include "gb/commands/colonies.h" 11 #include "gb/GB_server.h" 12 #include "gb/buffers.h" 13 #include "gb/files_shl.h" 14 #include "gb/getplace.h" 21 #include "gb/tweakables.h" 26 player_t Playernum = g.player;
27 governor_t Governor = g.governor;
30 if (!
isset(Stars[star]->explored, Playernum))
return;
32 for (
auto i = 0; i < Stars[star]->numplanets; i++) {
35 if (pl.info[Playernum - 1].explored &&
36 pl.info[Playernum - 1].numsectsowned &&
37 (!Governor || Stars[star]->governor[Playernum - 1] == Governor)) {
39 " %c %4.4s/%-4.4s%c%4d%3d%5d%8ld%3d%6lu%5d%6d " 40 "%3d/%-3d%3.0f/%-3d%3d/%-3d",
41 Psymbol[pl.type], Stars[star]->name, Stars[star]->pnames[i],
42 (pl.info[Playernum - 1].autorep ?
'*' :
' '),
43 Stars[star]->governor[Playernum - 1],
44 pl.info[Playernum - 1].numsectsowned,
45 pl.info[Playernum - 1].tech_invest, pl.info[Playernum - 1].popn,
46 pl.info[Playernum - 1].crystals, pl.info[Playernum - 1].resource,
47 pl.info[Playernum - 1].destruct, pl.info[Playernum - 1].fuel,
48 pl.info[Playernum - 1].tax, pl.info[Playernum - 1].newtax,
50 pl.info[Playernum - 1].comread, pl.info[Playernum - 1].mob_set);
51 notify(Playernum, Governor, buf);
52 for (
auto j = 1; j <= Num_races; j++)
53 if ((j != Playernum) && (pl.info[j - 1].numsectsowned > 0)) {
54 sprintf(buf,
" %d", j);
55 notify(Playernum, Governor, buf);
63 void colonies(
const command_t &argv, GameObj &g) {
64 const player_t Playernum = g.player;
65 const governor_t Governor = g.governor;
69 notify(Playernum, Governor,
70 " ========== Colonization Report ==========\n");
71 notify(Playernum, Governor,
72 " Planet gov sec tech popn x res " 73 "des fuel tax cmpt/tox mob Aliens\n");
75 race = races[Playernum - 1];
79 for (starnum_t star = 0; star < Sdata.numstars; star++)
82 for (
int i = 1; i < argv.size(); i++) {
83 where = getplace(g, argv[i], 0);
84 if (where.err || (where.level == ScopeLevel::LEVEL_UNIV) ||
85 (where.level == ScopeLevel::LEVEL_SHIP)) {
86 sprintf(buf,
"Bad location `%s'.\n", argv[i].c_str());
87 notify(Playernum, Governor, buf);
90 colonies_at_star(g, race, where.snum);
Planet getplanet(const starnum_t star, const planetnum_t pnum)
double compatibility(const Planet &planet, const Race *race)
void getsdata(struct stardata *S)
void getstar(startype **s, int star)
void colonies(const command_t &argv, GameObj &g)
void colonies_at_star(GameObj &g, Race *race, starnum_t star)