(hap_req): New.

(nati, populace): Use it.

(populace, nati): Change hap, pct from float to double, because they
are used as double.

(nati): Print happiness needed with just two decimals, like the other
levels.
This commit is contained in:
Markus Armbruster 2006-05-06 11:07:35 +00:00
parent 222847bb75
commit 97be5018e2
4 changed files with 15 additions and 13 deletions

View file

@ -62,3 +62,11 @@ hap_fact(struct natstr *tnat, struct natstr *vnat)
hap_fact = 0.8;
return hap_fact;
}
/* Return happiness required to keep NP's citizens happy. */
double
hap_req(struct natstr *np)
{
return (np->nat_level[NAT_TLEV] - 40.0) / 40.0
+ np->nat_level[NAT_ELEV] / 3.0;
}