diff -ru -X /home/jjm/cvs/no.freeciv FreecivCVS/common/game.c freeciv/common/game.c --- FreecivCVS/common/game.c Sun Mar 12 23:32:58 2000 +++ freeciv/common/game.c Wed Mar 15 17:31:48 2000 @@ -735,6 +735,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 -X /home/jjm/cvs/no.freeciv FreecivCVS/common/game.h freeciv/common/game.h --- FreecivCVS/common/game.h Wed Mar 15 09:56:50 2000 +++ freeciv/common/game.h Wed Mar 15 17:31:48 2000 @@ -75,6 +75,7 @@ int save_nturns; int foodbox; int aqueductloss; + int killcitizen; int techpenalty; int razechance; int scorelog; @@ -239,6 +240,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 -X /home/jjm/cvs/no.freeciv FreecivCVS/common/unit.c freeciv/common/unit.c --- FreecivCVS/common/unit.c Wed Mar 15 13:09:25 2000 +++ freeciv/common/unit.c Wed Mar 15 17:31:48 2000 @@ -732,6 +732,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 -X /home/jjm/cvs/no.freeciv FreecivCVS/common/unit.h freeciv/common/unit.h --- FreecivCVS/common/unit.h Wed Mar 15 09:04:25 2000 +++ freeciv/common/unit.h Wed Mar 15 17:31:48 2000 @@ -282,6 +282,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 -X /home/jjm/cvs/no.freeciv FreecivCVS/data/helpdata.txt freeciv/data/helpdata.txt --- FreecivCVS/data/helpdata.txt Thu Feb 10 07:50:25 2000 +++ freeciv/data/helpdata.txt Wed Mar 15 17:31:48 2000 @@ -790,6 +790,10 @@ hit points less than they otherwise would) each turn that they do \ not end in a city. Damaged units in Sentry mode will wake up when \ they have regained all of their hit points.\ +"), _("\ +Depending upon server options, any set of unit types may reduce \ +the population of a City without City Walls by one point upon a \ +successful attack.\ ") [help_gen_units] diff -ru -X /home/jjm/cvs/no.freeciv FreecivCVS/server/gamehand.c freeciv/server/gamehand.c --- FreecivCVS/server/gamehand.c Sun Mar 12 23:33:07 2000 +++ freeciv/server/gamehand.c Wed Mar 15 17:31:48 2000 @@ -363,6 +363,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, @@ -574,6 +576,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 -X /home/jjm/cvs/no.freeciv FreecivCVS/server/stdinhand.c freeciv/server/stdinhand.c --- FreecivCVS/server/stdinhand.c Sun Mar 12 23:33:08 2000 +++ freeciv/server/stdinhand.c Wed Mar 15 17:31:48 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 -X /home/jjm/cvs/no.freeciv FreecivCVS/server/unithand.c freeciv/server/unithand.c --- FreecivCVS/server/unithand.c Wed Mar 15 09:04:27 2000 +++ freeciv/server/unithand.c Wed Mar 15 17:31:48 2000 @@ -526,7 +526,11 @@ 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); @@ -1389,7 +1393,6 @@ do_paradrop(pplayer,punit,req->x, req->y); } } - /************************************************************************** ... **************************************************************************/