Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] (PR#8877) patch: design for generalized specialists
Home

[Freeciv-Dev] (PR#8877) patch: design for generalized specialists

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#8877) patch: design for generalized specialists
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 13 Dec 2004 10:10:50 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=8877 >

Here's another interesting patch.  This one adds SMAC-like specialists.
 It seems to work ok, but without graphics for them it's pretty unplayable.

-jason

Index: server/savegame.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/savegame.c,v
retrieving revision 1.213
diff -u -r1.213 savegame.c
--- server/savegame.c   13 Dec 2004 16:20:55 -0000      1.213
+++ server/savegame.c   13 Dec 2004 18:08:30 -0000
@@ -1958,8 +1958,8 @@
 
     specialist_type_iterate(sp) {
       pcity->specialists[sp]
-       = secfile_lookup_int(file, "player%d.c%d.n%s", plrno, i,
-                            game.rgame.specialists[sp].name);
+       = secfile_lookup_int_default(file, 0, "player%d.c%d.n%s", plrno, i,
+                                    game.rgame.specialists[sp].name);
     } specialist_type_iterate_end;
 
     for (j = 0; j < NUM_TRADEROUTES; j++)
Index: server/sanitycheck.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/sanitycheck.c,v
retrieving revision 1.56
diff -u -r1.56 sanitycheck.c
--- server/sanitycheck.c        8 Dec 2004 04:28:26 -0000       1.56
+++ server/sanitycheck.c        13 Dec 2004 18:08:30 -0000
@@ -258,10 +258,19 @@
     }
   } city_map_iterate_end;
   if (workers + city_specialists(pcity) != pcity->size + 1) {
-    die("%s is illegal (size%d w%d s%s) in %s line %d",
-       pcity->name, pcity->size, workers,
-       specialists_string(pcity->specialists), file, line);
+    int diff = pcity->size + 1 - workers - city_specialists(pcity);
 
+    SANITY_CHECK(workers + city_specialists(pcity) == pcity->size + 1);
+    freelog(LOG_ERROR, "%s is illegal (size%d w%d s%s) in %s line %d",
+           pcity->name, pcity->size, workers,
+           specialists_string(pcity->specialists), file, line);
+    while (diff > 0) {
+      pcity->specialists[DEFAULT_SPECIALIST]++;
+      diff--;
+    }
+    if (diff < 0) {
+      /* ??? */
+    }
   }
 }
 
Index: data/default/cities.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/default/cities.ruleset,v
retrieving revision 1.14
diff -u -r1.14 cities.ruleset
--- data/default/cities.ruleset 8 Dec 2004 16:53:53 -0000       1.14
+++ data/default/cities.ruleset 13 Dec 2004 18:08:30 -0000
@@ -21,16 +21,33 @@
 ; the city is of a certain size.
 [specialist]
 
-types = _("elvis"), _("scientist"), _("taxman")
-elvis_short_name = _("?Elvis:E")
-elvis_min_size = 0
-elvis_bonus_luxury = 2
-scientist_short_name = _("?Scientist:S")
-scientist_min_size = 5
-scientist_bonus_science = 3
-taxman_short_name = _("?Taxman:T")
-taxman_min_size = 5
-taxman_bonus_gold = 3
+types = _("doctor"), _("empath"), _("engineer"), _("librarian"), 
_("technician"), _("thinker"), _("transcend")
+doctor_short_name = _("?Doctor:D")
+doctor_min_size = 0
+doctor_bonus_luxury = 2
+empath_short_name = _("?Empath:M")
+empath_min_size = 6
+empath_bonus_gold = 2
+empath_bonus_luxury = 2
+engineer_short_name = _("?Engineer:G")
+engineer_min_size = 9
+engineer_bonus_gold = 3
+engineer_bonus_science = 2
+librarian_short_name = _("?Librarian:L")
+librarian_min_size = 4
+librarian_bonus_science = 3
+technician_min_size = 4
+technician_short_name = _("?Technician:T")
+technician_bonus_gold = 3
+thinker_min_size = 9
+thinker_short_name = _("?Thinker:K")
+thinker_bonus_science = 3
+thinker_bonus_luxury = 1
+transcend_min_size = 14
+transcend_short_name = _("?Transcend:C")
+transcend_bonus_gold = 2
+transcend_bonus_science = 4
+transcend_bonus_luxury = 2
 
 changable_tax = 1
 ;forced_science = 0
Index: data/misc/small.spec
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/misc/small.spec,v
retrieving revision 1.9
diff -u -r1.9 small.spec
--- data/misc/small.spec        1 Dec 2004 19:21:17 -0000       1.9
+++ data/misc/small.spec        13 Dec 2004 18:08:30 -0000
@@ -76,9 +76,21 @@
 
 ; Citizen icons:
 
+  ; Elvises
   0, 23, "specialist.elvis_0"
+  0, 23, "specialist.empath_0"
+  0, 23, "specialist.doctor_0"
+
+  ; Scientists
   0, 24, "specialist.scientist_0"
+  0, 24, "specialist.librarian_0"
+  0, 24, "specialist.thinker_0"
+  0, 24, "specialist.transcend_0"
+
+  ; Taxmen
   0, 25, "specialist.taxman_0"
+  0, 25, "specialist.engineer_0"
+  0, 25, "specialist.technician_0"
 
   0, 26, "citizen.content_0"
   0, 27, "citizen.content_1"

[Prev in Thread] Current Thread [Next in Thread]