Project

General

Profile

Feature #98 » 0002-Add-disaster-type-Robbery.patch

Marko Lindqvist, 01/07/2024 10:03 AM

View differences:

common/city.h
* radius. */
int tile_cache_radius_sq;
/* the productions */
/* The productions */
int surplus[O_LAST]; /* Final surplus in each category. */
int waste[O_LAST]; /* Waste/corruption in each category. */
int unhappy_penalty[O_LAST]; /* Penalty from unhappy cities. */
......
int bonus[O_LAST];
int abs_bonus[O_LAST];
/* the physics */
/* The physics */
int food_stock;
int shield_stock;
int pollution; /* not saved */
common/disaster.h
#define SPECENUM_VALUE5NAME "Fallout"
#define SPECENUM_VALUE6 DE_REDUCE_DESTROY
#define SPECENUM_VALUE6NAME "ReducePopDestroy"
#define SPECENUM_VALUE7 DE_ROBBERY
#define SPECENUM_VALUE7NAME "Robbery"
#define SPECENUM_COUNT DE_COUNT
#define SPECENUM_BITVECTOR bv_disaster_effects
#include "specenum_gen.h"
data/alien/game.ruleset
; - "EmptyProdStock" = Destroy current production
; - "Pollution" = One tile surrounding city polluted
; - "Fallout" = One tile surrounding city polluted with fallout
; - "Robbery" = Player loses city's five turn trade worth of gold
;
; */ <-- avoid gettext warnings
data/civ1/game.ruleset
; - "EmptyProdStock" = Destroy current production
; - "Pollution" = One tile surrounding city polluted
; - "Fallout" = One tile surrounding city polluted with fallout
; - "Robbery" = Player loses city's five turn trade worth of gold
;
; */ <-- avoid gettext warnings
data/civ2/game.ruleset
; - "EmptyProdStock" = Destroy current production
; - "Pollution" = One tile surrounding city polluted
; - "Fallout" = One tile surrounding city polluted with fallout
; - "Robbery" = Player loses city's five turn trade worth of gold
;
; */ <-- avoid gettext warnings
data/civ2civ3/game.ruleset
; - "EmptyProdStock" = Destroy current production
; - "Pollution" = One tile surrounding city polluted
; - "Fallout" = One tile surrounding city polluted with fallout
; - "Robbery" = Player loses city's five turn trade worth of gold
;
; */ <-- avoid gettext warnings
data/classic/game.ruleset
; - "EmptyProdStock" = Destroy current production
; - "Pollution" = One tile surrounding city polluted
; - "Fallout" = One tile surrounding city polluted with fallout
; - "Robbery" = Player loses city's five turn trade worth of gold
;
; */ <-- avoid gettext warnings
data/goldkeep/game.ruleset
; - "EmptyProdStock" = Destroy current production
; - "Pollution" = One tile surrounding city polluted
; - "Fallout" = One tile surrounding city polluted with fallout
; - "Robbery" = Player loses city's five turn trade worth of gold
;
; */ <-- avoid gettext warnings
data/granularity/game.ruleset
; - "EmptyProdStock" = Destroy current production
; - "Pollution" = One tile surrounding city polluted
; - "Fallout" = One tile surrounding city polluted with fallout
; - "Robbery" = Player loses city's five turn trade worth of gold
;
; */ <-- avoid gettext warnings
data/multiplayer/game.ruleset
; - "EmptyProdStock" = Destroy current production
; - "Pollution" = One tile surrounding city polluted
; - "Fallout" = One tile surrounding city polluted with fallout
; - "Robbery" = Player loses city's five turn trade worth of gold
;
; */ <-- avoid gettext warnings
data/ruledit/comments-3.3.txt
; - \"EmptyProdStock\" = Destroy current production\n\
; - \"Pollution\" = One tile surrounding city polluted\n\
; - \"Fallout\" = One tile surrounding city polluted with fallout\n\
; - \"Robbery\" = Player loses city\'s five turn trade worth of gold\n\
;\n\
; */ <-- avoid gettext warnings\n\
"
data/sandbox/game.ruleset
; - "EmptyProdStock" = Destroy current production
; - "Pollution" = One tile surrounding city polluted
; - "Fallout" = One tile surrounding city polluted with fallout
; - "Robbery" = Player loses city's five turn trade worth of gold
;
; */ <-- avoid gettext warnings
data/stub/game.ruleset
; - "EmptyProdStock" = Destroy current production
; - "Pollution" = One tile surrounding city polluted
; - "Fallout" = One tile surrounding city polluted with fallout
; - "Robbery" = Player loses city's five turn trade worth of gold
;
; */ <-- avoid gettext warnings
data/webperimental/game.ruleset
; - "EmptyProdStock" = Destroy current production
; - "Pollution" = One tile surrounding city polluted
; - "Fallout" = One tile surrounding city polluted with fallout
; - "Robbery" = Player loses city's five turn trade worth of gold
;
; */ <-- avoid gettext warnings
server/cityturn.c
_("%s was hit by %s."), city_name_get(pcity),
disaster_name_translation(pdis));
if (disaster_has_effect(pdis, DE_ROBBERY)) {
if (pplayer->economic.gold > 0 && pcity->prod[O_TRADE] > 0) {
int amount = pcity->prod[O_TRADE] * 5;
amount = MIN(pplayer->economic.gold, amount);
pplayer->economic.gold -= amount;
notify_player(pplayer, ptile, E_DISASTER, ftc_server,
PL_("Robbery in %s. %d gold stolen.",
"Robbery in %s. %d gold stolen.", amount),
city_link(pcity), amount);
had_internal_effect = TRUE;
}
}
if (disaster_has_effect(pdis, DE_POLLUTION)) {
if (place_pollution(pcity, EC_POLLUTION)) {
notify_player(pplayer, ptile, E_DISASTER, ftc_server,
(2-2/2)