Index: common/tech.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/tech.h,v retrieving revision 1.23 diff -u -r1.23 tech.h --- common/tech.h 2001/09/06 19:48:15 1.23 +++ common/tech.h 2001/09/07 01:15:52 @@ -67,6 +67,7 @@ int req[2]; unsigned int flags; char *helptext; + char *first_message; /*Message displayed to the first player to get a tech */ }; int get_invention(struct player *plr, int tech); Index: data/default/techs.ruleset =================================================================== RCS file: /home/freeciv/CVS/freeciv/data/default/techs.ruleset,v retrieving revision 1.15 diff -u -r1.15 techs.ruleset --- data/default/techs.ruleset 2001/09/06 19:48:15 1.15 +++ data/default/techs.ruleset 2001/09/07 01:15:53 @@ -24,6 +24,7 @@ ; req1, req2 = advances required before researching this one ; flags = special flag strings ; helptext = optional help text string (set units ruleset for examples) +; first_message = Text seen when a player is the first to discover an advance. ; ; Special values for req1 and req2 are "None" (first section below) ; and "Never" (never available). If only one tech is required, @@ -254,6 +255,7 @@ req1 = "Invention" req2 = "Iron Working" flags = "" +first_message = _("Game: Nations tremble in fear of your new weapons.") [advance_horseback_riding] name = _("Horseback Riding") @@ -404,6 +406,8 @@ req1 = "Mysticism" req2 = "Literacy" flags = "Bonus_Tech" +first_message = _("Game: Great philosophers from all the world join \ +your civilization; you get an immediate advance.") [advance_physics] name = _("Physics") Index: server/plrhand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v retrieving revision 1.196 diff -u -r1.196 plrhand.c --- server/plrhand.c 2001/09/06 19:48:16 1.196 +++ server/plrhand.c 2001/09/07 01:16:06 @@ -312,9 +312,11 @@ plr->research.researched=saved_bulbs; } + if (was_first && advances[tech_found].first_message != NULL) { + notify_player(plr,"%s",advances[tech_found].first_message); + } + if (bonus_tech_hack) { - notify_player(plr, _("Game: Great scientists from all the world join " - "your civilization: you get an immediate advance.")); tech_researched(plr); } } Index: server/ruleset.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/ruleset.c,v retrieving revision 1.78 diff -u -r1.78 ruleset.c --- server/ruleset.c 2001/09/06 19:48:16 1.78 +++ server/ruleset.c 2001/09/07 01:16:17 @@ -375,13 +375,13 @@ } /************************************************************************** - Lookup optional helptext, returning allocated memory or NULL. + Lookup optional string, returning allocated memory or NULL. **************************************************************************/ -static char *lookup_helptext(struct section_file *file, char *prefix) +static char *lookup_string(struct section_file *file, char *prefix,char *suffix) { char *sval; - sval = secfile_lookup_str_default(file, NULL, "%s.helptext", prefix); + sval = secfile_lookup_str_default(file, NULL, "%s.%s", prefix,suffix); if (sval) { sval = skip_leading_spaces(sval); if (strlen(sval)) { @@ -390,6 +390,15 @@ } return NULL; } + + +/************************************************************************** + Lookup optional helptext, returning allocated memory or NULL. +**************************************************************************/ +static char *lookup_helptext(struct section_file *file, char *prefix) +{ + return lookup_string(file,prefix,"helptext"); +} /************************************************************************** Look up a terrain name in the tile_types array and return its index. @@ -519,7 +528,9 @@ free(slist); a->helptext = lookup_helptext(file, sec[i]); - + + a->first_message = lookup_string(file, sec[i], "first_message"); + a++; }