/*
* 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
* ---
*
* hap_fact.c: Happiness effect on che
- *
+ *
* Known contributors to this file:
* Steve McClure, 1996
*/
#include <config.h>
-#include <stdio.h>
-#include <ctype.h>
#include "misc.h"
-#include "player.h"
-#include "xy.h"
#include "nat.h"
#include "nsc.h"
-#include "common.h"
+#include "player.h"
+#include "prototypes.h"
+#include "xy.h"
double
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;
+}