comparison src/stats.c @ 8:0836fb919dfa

First entry of Paradise Server 2.9 patch 10 Beta
author darius
date Sat, 06 Dec 1997 04:37:05 +0000
parents
children
comparison
equal deleted inserted replaced
7:814de70c9f67 8:0836fb919dfa
1 /*--------------------------------------------------------------------------
2 NETREK II -- Paradise
3
4 Permission to use, copy, modify, and distribute this software and its
5 documentation, or any derivative works thereof, for any NON-COMMERCIAL
6 purpose and without fee is hereby granted, provided that this copyright
7 notice appear in all copies. No representations are made about the
8 suitability of this software for any purpose. This software is provided
9 "as is" without express or implied warranty.
10
11 Xtrek Copyright 1986 Chris Guthrie
12 Netrek (Xtrek II) Copyright 1989 Kevin P. Smith
13 Scott Silvey
14 Paradise II (Netrek II) Copyright 1993 Larry Denys
15 Kurt Olsen
16 Brandon Gillespie
17 --------------------------------------------------------------------------*/
18
19 #include "config.h"
20 #include "defs.h"
21 #include "struct.h"
22 #include "shmem.h"
23
24 void
25 credit_armiesbombed(plyr, armies, plan)
26 struct player *plyr;
27 int armies;
28 struct planet *plan;
29 {
30 double factor;
31
32 if (!status->tourn)
33 return; /* nothing counts outside T-mode */
34
35 plyr->p_armsbomb += armies; /* inc armies bombed */
36
37 /* no honor in beating up on someone who isn't there */
38 factor = (plan->pl_owner == NOBODY) ? 0.5 : 1.0;
39
40 plyr->p_stats.st_di += 0.02 * armies * factor; /* inc players DI */
41 #ifdef WB_BOMBING_CREDIT
42 if (plyr->p_ship.s_type == WARBASE)
43 plyr->p_stats.st_di += 0.02 * armies * factor;
44 #endif
45 plyr->p_kills += 0.02 * armies * factor; /* increase players kills */
46
47 armies = random_round(factor * armies);
48
49 status->armsbomb += armies;
50 plyr->p_stats.st_tarmsbomb += armies; /* increase player stats */
51 #ifdef WB_BOMBING_CREDIT
52 if (plyr->p_ship.s_type == WARBASE)
53 plyr->p_stats.st_tarmsbomb += armies;
54 #endif
55 checkmaxkills(plyr->p_no); /* check if over max kills */
56 }