diff --exclude-from=../.diff_ignore -u -r -N freeciv-cvs/common/Makefile.am freeciv/common/Makefile.am --- freeciv-cvs/common/Makefile.am Mon May 10 10:23:22 1999 +++ freeciv/common/Makefile.am Wed Jun 2 23:51:14 1999 @@ -38,4 +38,6 @@ tech.c \ tech.h \ unit.c \ - unit.h + unit.h \ + government.c \ + governemnt.h diff --exclude-from=../.diff_ignore -u -r -N freeciv-cvs/common/government.c freeciv/common/government.c --- freeciv-cvs/common/government.c Thu Jan 1 01:00:00 1970 +++ freeciv/common/government.c Fri Jun 4 01:56:33 1999 @@ -0,0 +1,72 @@ +/********************************************************************** + Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +***********************************************************************/ +#include +#include + +#include + +/* governemnts.ruleset, anyone? -- SKi */ +struct government governments[] = { + { + "Anarchy", "Mr.", "Mrs.", /* correct? -- SKi */ + 100, 90, + NO_UPKEEP, 0, 0, 0, + 0, CITY_SIZE_FREE, 0, 0, + ENTIRE_CITY + }, + { + "Despotism", "Emperor", "Empress", /* sp? -- SKi */ + 60, 80, + NO_UPKEEP, 0, 0, 0, + 0, CITY_SIZE_FREE, 0, 0, + ENTIRE_CITY + }, + { + "Monarchy", "King", "Queen", + 70, 70, + NO_UPKEEP, 0, 1, 0, + 0, 3, 0, 0, + 3 + }, +/* + { + "Fundamentalism", "Priest", "Priestess", + 60, 30, + NO_UPKEEP, 0, 0, 0, + 0, 10, 0, 0, + 0 + }, +*/ + { + "Communism", "Comrade", "Comrade", + 80, 50, + NO_UPKEEP, 0, 1, 0, + 0, 3, 0, 0, + 0 + }, + { + "Republic", "President", "President", + 80, 40, + 0, 1, 1, 0, + 1, 0, 0, 0, + 0 + }, + { + "Democracy", "President", "President", + 100, 30, + 1, 1, 1, 0, + 0, 0, 0, 0, + 0 + } +}; + diff --exclude-from=../.diff_ignore -u -r -N freeciv-cvs/common/government.h freeciv/common/government.h --- freeciv-cvs/common/government.h Thu Jan 1 01:00:00 1970 +++ freeciv/common/government.h Fri Jun 4 01:26:52 1999 @@ -0,0 +1,69 @@ +/********************************************************************** + Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +***********************************************************************/ +#ifndef __GOVERNMENT_H +#define __GOVERNMENT_H + +#include "genlist.h" +#include "shared.h" +#include "limits.h" + +/* governements.ruleset anyone? -- SKi */ +enum government_type { + G_ANARCHY, + G_DESPOTISM, + G_MONARCHY, +/* G_FUNDAMENTALISM, */ + G_COMMUNISM, + G_REPUBLIC, + G_DEMOCRACY, + G_LAST +}; + +/* speical values for extra_* fields -- SKi */ +#define NO_UPKEEP (INT_MAX) +/* special values for free_* fields -- SKi */ +/*#define ALL_UNITS_FREE (INT_MAX)*/ +#define CITY_SIZE_FREE (INT_MAX-1) +/* generic special values (for modifiers) -- SKi */ +#define ENTIRE_CITY (INT_MAX-1) + +struct government +{ + char* name; + char* male_ruler_title; + char* female_ruler_title; + + /* max rate that can go to one place -- SKi */ + int max_rate; + /* something to do with civil wars I suppose -- SKi */ + int civil_war; + + /* cost modifiers -- SKi*/ + int extra_happy_cost; + int extra_shield_cost; + int extra_food_cost; + int extra_gold_cost; + + /* number of units that a city does not have to "pay" for --SKi */ + int free_happy; + int free_shield; + int free_food; + int free_gold; + + /* various modifiers */ +// int extra_bribe_cost; + int military_contentment_mod; +}; +extern struct government governments[]; + +#endif diff --exclude-from=../.diff_ignore -u -r -N freeciv-cvs/common/player.c freeciv/common/player.c --- freeciv-cvs/common/player.c Fri May 14 21:57:22 1999 +++ freeciv/common/player.c Fri Jun 4 01:27:10 1999 @@ -20,6 +20,7 @@ #include #include #include +#include extern int is_server; @@ -127,24 +128,6 @@ "Genghis" }; -int government_rates[G_LAST] = { - 100, 60, 70, 80, 80, 100 -}; - -int government_civil_war[G_LAST] = { - 90, 80, 70, 50, 40, 30 -}; - -char *government_names[G_LAST] = { - "Anarchy", "Despotism", "Monarchy", - "Communism", "Republic", "Democracy" -}; - -char *ruler_titles[G_LAST] = { - "Mr.", "Emperor", "King", /* even for Elizabeth */ - "Comrade", "President", "President" -}; - /*************************************************************** ... ***************************************************************/ @@ -190,7 +173,7 @@ ***************************************************************/ char *get_ruler_title(enum government_type type) { - return ruler_titles[type]; + return governments[type].male_ruler_title; } /*************************************************************** @@ -198,7 +181,7 @@ ***************************************************************/ int get_government_max_rate(enum government_type type) { - return government_rates[type]; + return governments[type].max_rate; } /*************************************************************** @@ -207,7 +190,7 @@ int get_government_civil_war_prob(enum government_type type) { if(type >= G_ANARCHY && type < G_LAST) - return government_civil_war[type]; + return governments[type].civil_war; return 0; } @@ -216,7 +199,7 @@ ***************************************************************/ char *get_government_name(enum government_type type) { - return government_names[type]; + return governments[type].name; } /*************************************************************** diff --exclude-from=../.diff_ignore -u -r -N freeciv-cvs/common/player.h freeciv/common/player.h --- freeciv-cvs/common/player.h Sat Mar 27 12:43:14 1999 +++ freeciv/common/player.h Fri Jun 4 01:23:13 1999 @@ -17,6 +17,7 @@ #include "unit.h" #include "city.h" #include "spaceship.h" +#include "government.h" struct tile; @@ -24,10 +25,6 @@ #define PLAYER_DEFAULT_SCIENCE_RATE 50 #define PLAYER_DEFAULT_LUXURY_RATE 0 #define TECH_GOALS 10 -enum government_type { - G_ANARCHY, G_DESPOTISM, G_MONARCHY, G_COMMUNISM, G_REPUBLIC, G_DEMOCRACY, - G_LAST -}; enum race_type { R_ROMAN, R_BABYLONIAN, R_GERMAN, R_EGYPTIAN, R_AMERICAN, R_GREEK, R_INDIAN,