13 #include "gb/GB_server.h" 14 #include "gb/buffers.h" 15 #include "gb/files_shl.h" 16 #include "gb/mobiliz.h" 17 #include "gb/shlmisc.h" 18 #include "gb/tweakables.h" 22 player_t Playernum = g.player;
23 governor_t Governor = g.governor;
26 if (g.level != ScopeLevel::LEVEL_PLAN) {
27 sprintf(buf,
"scope must be a planet (%d).\n", g.level);
28 notify(Playernum, Governor, buf);
32 g.out <<
"You are not authorized to do that here.\n";
35 if (!
enufAP(Playernum
, Governor
, Stars[g.snum]->AP[Playernum - 1]
, APcount
)) {
41 if (argv.size() < 2) {
43 "Current investment : %d Technology production/update: %.3f\n",
44 p.info[Playernum - 1].tech_invest,
46 (
int)(p.info[Playernum - 1].popn)
));
47 notify(Playernum, Governor, buf);
50 short invest = std::stoi(argv[1]);
53 g.out <<
"Illegal value.\n";
57 p.info[Playernum - 1].tech_invest = invest;
63 sprintf(buf,
" New (ideal) tech production: %.3f (this planet)\n",
65 (
int)(p.info[Playernum - 1].popn)
));
66 notify(Playernum, Governor, buf);
70 double scale = (
double)popn / 10000.;
71 return (
TECH_INVEST * log10((
double)investment * scale + 1.0));
Planet getplanet(const starnum_t star, const planetnum_t pnum)
void deductAPs(const player_t Playernum, const governor_t Governor, unsigned int n, starnum_t snum, int sdata)
int enufAP(int Playernum, int Governor, unsigned short AP, int x)
double tech_prod(int investment, int popn)
void putplanet(const Planet &p, startype *star, const int pnum)
void technology(const command_t &argv, GameObj &g)
int control(int Playernum, int Governor, startype *star)