diff -ru freeciv.orig/common/game.c freeciv/common/game.c --- freeciv.orig/common/game.c Fri Feb 25 13:28:50 2000 +++ freeciv/common/game.c Fri Feb 25 14:29:49 2000 @@ -736,6 +736,7 @@ game.unhappysize = GAME_DEFAULT_UNHAPPYSIZE; game.foodbox = GAME_DEFAULT_FOODBOX; game.aqueductloss= GAME_DEFAULT_AQUEDUCTLOSS; + game.killcitizen = GAME_DEFAULT_KILLCITIZEN; game.scorelog = GAME_DEFAULT_SCORELOG; game.techpenalty = GAME_DEFAULT_TECHPENALTY; game.civstyle = GAME_DEFAULT_CIVSTYLE; diff -ru freeciv.orig/common/game.h freeciv/common/game.h --- freeciv.orig/common/game.h Fri Feb 25 13:28:50 2000 +++ freeciv/common/game.h Fri Feb 25 14:16:27 2000 @@ -75,6 +75,7 @@ int save_nturns; int foodbox; int aqueductloss; + int killcitizen; int techpenalty; int razechance; int scorelog; @@ -232,6 +233,10 @@ #define GAME_DEFAULT_AQUEDUCTLOSS 0 #define GAME_MIN_AQUEDUCTLOSS 0 #define GAME_MAX_AQUEDUCTLOSS 100 + +#define GAME_DEFAULT_KILLCITIZEN 1 +#define GAME_MIN_KILLCITIZEN 0 +#define GAME_MAX_KILLCITIZEN 15 #define GAME_DEFAULT_TECHPENALTY 100 #define GAME_MIN_TECHPENALTY 0 diff -ru freeciv.orig/common/unit.c freeciv/common/unit.c --- freeciv.orig/common/unit.c Thu Jan 20 12:50:55 2000 +++ freeciv/common/unit.c Fri Feb 25 14:27:26 2000 @@ -731,6 +731,13 @@ /************************************************************************** ... **************************************************************************/ +int kills_citizen_after_attack(struct unit *punit) { + return (game.killcitizen >> ((int)unit_types[punit->type].move_type-1)) & 1; +} + +/************************************************************************** +... +**************************************************************************/ int can_unit_add_to_city(struct unit *punit) { struct city *pcity; diff -ru freeciv.orig/common/unit.h freeciv/common/unit.h --- freeciv.orig/common/unit.h Sun Jan 2 12:51:27 2000 +++ freeciv/common/unit.h Fri Feb 25 14:25:18 2000 @@ -281,6 +281,7 @@ int is_ground_unittype(Unit_Type_id id); int can_unit_build_city(struct unit *punit); int can_unit_add_to_city(struct unit *punit); +int kills_citizen_after_attack(struct unit *punit); struct unit_type *get_unit_type(Unit_Type_id id); char *unit_activity_text(struct unit *punit); diff -ru freeciv.orig/server/gamehand.c freeciv/server/gamehand.c --- freeciv.orig/server/gamehand.c Fri Feb 25 13:28:51 2000 +++ freeciv/server/gamehand.c Fri Feb 25 14:32:02 2000 @@ -360,6 +360,8 @@ } game.aqueductloss = secfile_lookup_int_default(file, game.aqueductloss, "game.aqueductloss"); + game.killcitizen = secfile_lookup_int_default(file, game.killcitizen, + "game.killcitizen"); game.turnblock = secfile_lookup_int_default(file,game.turnblock, "game.turnblock"); game.barbarianrate = secfile_lookup_int_default(file, game.barbarianrate, @@ -570,6 +572,7 @@ secfile_insert_int(file, game.spacerace, "game.spacerace"); secfile_insert_int(file, game.diplchance, "game.diplchance"); secfile_insert_int(file, game.aqueductloss, "game.aqueductloss"); + secfile_insert_int(file, game.killcitizen, "game.killcitizen"); secfile_insert_int(file, game.turnblock, "game.turnblock"); secfile_insert_int(file, game.barbarianrate, "game.barbarians"); secfile_insert_int(file, game.onsetbarbarian, "game.onsetbarbs"); diff -ru freeciv.orig/server/stdinhand.c freeciv/server/stdinhand.c --- freeciv.orig/server/stdinhand.c Fri Feb 25 13:28:51 2000 +++ freeciv/server/stdinhand.c Fri Feb 25 14:57:50 2000 @@ -483,6 +483,17 @@ "in the tile). If set to a value between 0 and 100, this will be used " "as the percent chance of \"occupying\" territory.") }, + { "killcitizen", &game.killcitizen, + SSET_RULES, SSET_TO_CLIENT, + GAME_MIN_KILLCITIZEN, GAME_MAX_KILLCITIZEN, GAME_DEFAULT_KILLCITIZEN, + N_("Reduce city population after attack"), + N_("This flag indicates if city population is reduced after successful " + "attack of enemy unit, depending on its movement type (OR-ed) :\n" + "1 = land\n" + "2 = sea\n" + "4 = heli\n" + "8 = air") }, + /* Flexible rules: these can be changed after the game has started. * Should such flexible rules exist? diplchance is included here * to duplicate its previous behaviour (and note diplchance is only used diff -ru freeciv.orig/server/unithand.c freeciv/server/unithand.c --- freeciv.orig/server/unithand.c Fri Feb 25 13:28:51 2000 +++ freeciv/server/unithand.c Fri Feb 25 14:20:47 2000 @@ -530,7 +530,7 @@ if(punit->moves_left<0) punit->moves_left=0; - if (punit->hp && (pcity=map_get_city(def_x, def_y)) && pcity->size>1 && !city_got_citywalls(pcity) && is_ground_unit(punit)) { + if (punit->hp && (pcity=map_get_city(def_x, def_y)) && pcity->size>1 && !city_got_citywalls(pcity) && kills_citizen_after_attack(punit)) { pcity->size--; city_auto_remove_worker(pcity); city_refresh(pcity); @@ -1394,4 +1394,3 @@ do_paradrop(pplayer,punit,req->x, req->y); } } -