/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* ---
*
* populace.c: Return workforce available
- *
+ *
* Known contributors to this file:
* Dave Pare, 1986
*/
#include <config.h>
-#include "misc.h"
-#include "sect.h"
-#include "nat.h"
-#include "file.h"
-#include "path.h"
-#include "xy.h"
#include "land.h"
-#include "update.h"
-#include "subs.h"
-#include "gen.h"
-#include "common.h"
#include "lost.h"
+#include "path.h"
+#include "update.h"
void
populace(struct natstr *np, struct sctstr *sp, int etu)
{
- float hap;
- float tech;
- float edu;
- float pct;
+ double hap, pct;
int n;
int civ = sp->sct_item[I_CIVIL];
int mil = sp->sct_item[I_MILIT];
}
hap = np->nat_level[NAT_HLEV];
- edu = np->nat_level[NAT_ELEV];
- tech = np->nat_level[NAT_TLEV];
- pct = (double)((tech - 40) / 40.0 + edu / 3.0);
+ pct = hap_req(np);
if (sp->sct_own == sp->sct_oldown && hap < pct &&
- chance(((double)pct - (double)hap) / (double)5.0)) {
+ chance((pct - hap) / 5.0)) {
/*
* zap the loyalty of unhappy civilians.
* there is a 20% chance per hap point below the
if (n < 0)
n = 0;
sp->sct_work = n;
- if (chance((double)work_red / 1000.0)) {
+ if (chance(work_red / 1000.0)) {
/*
* small chance of rebellion...
* if work_red is (max) 67,