Complete.Org: Mailing Lists: Archives: freeciv-dev: December 1998:
[Freeciv-Dev] huts
Home

[Freeciv-Dev] huts

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] huts
From: Peter Schaefer <schaefer@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 14 Dec 1998 17:52:31 +0100

(unithand.inuit.diff)
--
Peter Schaefer           mailto:schaefer@xxxxxxxxxxxxxxxxxxxxxxxxxxx     
X-Url: http://wwwhoppe.math.uni-augsburg.de/~schaefer/
coz' hackers LOVE irix
--- ../unithand.c.cvs   Sun Dec 13 23:13:44 1998
+++ server/unithand.c   Mon Dec 14 18:44:20 1998
@@ -611,8 +611,12 @@
   case 6:
   case 7:
 /*this function is hmmm a hack */
-    notify_player_ex(pplayer, punit->x, punit->y, E_NOEVENT,
-                 "Game: You found ancient scrolls of wisdom."); 
+    /* you get research worth about 100 bulbs from the hut, average */
+    /* the next line could just as well read game.freecost instead of */
+    /* game.freecost/2, but I[McFred] felt like halving the chance */
+    if( myrand(research_time(pplayer)) <
+       100+(long int)game.freecost/2*research_time(pplayer)
+       )
     {
       int res=pplayer->research.researched;
       int wasres=pplayer->research.researching;
@@ -619,6 +623,9 @@
 
       choose_random_tech(pplayer);
  
+      notify_player_ex(pplayer, punit->x, punit->y, E_NOEVENT,
+                 "Game: You found ancient scrolls of wisdom."); 
+
       pplayer->research.researchpoints++;
       if (pplayer->research.researching!=A_NONE) {
        notify_player_ex(pplayer, punit->x, punit->y, E_NOEVENT,
@@ -654,6 +661,9 @@
        pplayer->research.researching=wasres;
       }
      do_free_cost(pplayer);
+    }else{
+      notify_player_ex(pplayer, punit->x, punit->y, E_NOEVENT,
+                 "Game: You found ancient scrolls, describing an advance you 
already know."); 
     }
     break;
   case 8:
@@ -667,6 +677,13 @@
       notify_player_ex(pplayer, punit->x, punit->y, E_NOEVENT,
                       "Game: An abandoned village is here.");
     else {
+      if( map_get_terrain(punit->x, punit->y)==T_ARCTIC )
+       notify_player_ex(pplayer, punit->x, punit->y, E_NOEVENT,
+                  "Game: Your unit has been cowardly slaughtered by a band of 
eskimos.");
+      else if( map_get_terrain(punit->x, punit->y)==T_DESERT )
+       notify_player_ex(pplayer, punit->x, punit->y, E_NOEVENT,
+                  "Game: Your unit languishes in the desert heat.");
+      else
       notify_player_ex(pplayer, punit->x, punit->y, E_NOEVENT,
                       "Game: Your unit has been cowardly slaughtered by a band 
of barbarians");
       wipe_unit(pplayer, punit);
@@ -679,8 +696,17 @@
 
       create_city(pplayer, punit->x, punit->y, city_name_suggestion(pplayer));
     } else {
-      notify_player_ex(pplayer, punit->x, punit->y, E_NOEVENT,
+
+      if( map_get_terrain(punit->x, punit->y)==T_ARCTIC )
+       notify_player_ex(pplayer, punit->x, punit->y, E_NOEVENT,
+                  "Game: Friendly inuit are impressed by you, and join you.");
+      else if( map_get_terrain(punit->x, punit->y)==T_DESERT )
+       notify_player_ex(pplayer, punit->x, punit->y, E_NOEVENT,
+                  "Game: Friendly nomads that have run out of water\n      
thank you for your help, and join you.");
+      else
+       notify_player_ex(pplayer, punit->x, punit->y, E_NOEVENT,
                   "Game: Friendly nomads are impressed by you, and join you");
+    
       create_unit(pplayer, punit->x, punit->y, U_SETTLERS, 0, punit->homecity, 
-1);
     }
     break;
@@ -703,7 +729,13 @@
        {
          unit_list_iterate(map_get_tile(x,y)->units, punit) {
            if ((pplayer->player_no != punit->owner)&&
-               (punit->activity == ACTIVITY_SENTRY))
+               (punit->activity == ACTIVITY_SENTRY)&&
+               (punit->moves_left))
+             if(
+               ( map_get_terrain(x,y)!= T_OCEAN
+                || is_water_unit(punit->type)
+                || is_at_coast(x,y))
+               )
              {
                set_unit_activity(punit, ACTIVITY_IDLE);
                send_unit_info(0,punit,0);

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] huts, Peter Schaefer <=