]> git.pond.sub.org Git - empserver/blobdiff - src/lib/common/hap_fact.c
Update copyright notice
[empserver] / src / lib / common / hap_fact.c
index 05baba791d9cf2e984fff66bd42a4b4d7474273b..a1436633091fa9e0967356efc0918c6fdd3476ab 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2000, 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
  *
  *  ---
  *
- *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- *  related information and legal notices. It is expected that any future
- *  projects/authors will amend these files as needed.
+ *  See files README, COPYING and CREDITS in the root of the source
+ *  tree for related information and legal notices.  It is expected
+ *  that future projects/authors will amend these files as needed.
  *
  *  ---
  *
  *  hap_fact.c: Happiness effect on che
- * 
+ *
  *  Known contributors to this file:
  *     Steve McClure, 1996
  */
 
-#include <stdio.h>
-#include <ctype.h>
+#include <config.h>
+
 #include "misc.h"
-#include "player.h"
-#include "var.h"
-#include "xy.h"
-#include "sect.h"
 #include "nat.h"
-#include "news.h"
 #include "nsc.h"
-#include "item.h"
-#include "file.h"
-#include "common.h"
+#include "player.h"
+#include "prototypes.h"
+#include "xy.h"
 
 double
 hap_fact(struct natstr *tnat, struct natstr *vnat)
@@ -65,3 +60,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;
+}