Complete.Org: Mailing Lists: Archives: freeciv-dev: May 1999:
[Freeciv-Dev] patch: spaceship event type
Home

[Freeciv-Dev] patch: spaceship event type

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] patch: spaceship event type
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Sun, 9 May 1999 21:18:43 +1000 (EST)

This patch adds a new event/messages type E_SPACESHIP, for important 
spaceship events: spaceship started, launched, lost, landed.

I added a single new event time to cover all of these events,
since they will not happen often, and there are already too 
many event types...

-- David
diff -u -r --exclude-from exclude freeciv-cvs/client/options.c 
fc-adv/client/options.c
--- freeciv-cvs/client/options.c        Mon May  3 22:40:56 1999
+++ fc-adv/client/options.c     Sun May  9 21:18:23 1999
@@ -89,6 +89,7 @@
   "Unit Attack Failed       ",          /* E_UNIT_LOST_ATT */
   "Unit Attack Succeeded    ",          /* E_UNIT_WIN_ATT */
   "Suggest Growth Throttling",          /* E_CITY_GRAN_THROTTLE */
+  "Spaceship Events         ",          /* E_SPACESHIP */
 };
 
 /**************************************************************************
diff -u -r --exclude-from exclude freeciv-cvs/common/events.h 
fc-adv/common/events.h
--- freeciv-cvs/common/events.h Sat Apr 10 15:16:40 1999
+++ fc-adv/common/events.h      Sun May  9 21:18:23 1999
@@ -48,6 +48,7 @@
   E_UNIT_LOST_ATT,
   E_UNIT_WIN_ATT,
   E_CITY_GRAN_THROTTLE,
+  E_SPACESHIP,
   E_LAST
 };
 
diff -u -r --exclude-from exclude freeciv-cvs/server/cityturn.c 
fc-adv/server/cityturn.c
--- freeciv-cvs/server/cityturn.c       Tue May  4 20:47:17 1999
+++ fc-adv/server/cityturn.c    Sun May  9 21:18:23 1999
@@ -1039,7 +1039,7 @@
        update_tech(pplayer, 1000000); 
       }
       if (space_part && pplayer->spaceship.state == SSHIP_NONE) {
-       notify_player_ex(0, pcity->x, pcity->y, E_NOEVENT,
+       notify_player_ex(0, pcity->x, pcity->y, E_SPACESHIP,
                         "Game: The %s have started building a spaceship!",
                         get_race_name_plural(pplayer->race));
        pplayer->spaceship.state = SSHIP_STARTED;
diff -u -r --exclude-from exclude freeciv-cvs/server/spacerace.c 
fc-adv/server/spacerace.c
--- freeciv-cvs/server/spacerace.c      Tue Feb 16 22:37:22 1999
+++ fc-adv/server/spacerace.c   Sun May  9 21:18:23 1999
@@ -19,6 +19,7 @@
 #include <packets.h>
 #include <spaceship.h>
 #include <log.h>
+#include <events.h>
 
 #include "plrhand.h"
 #include "civserver.h"
@@ -167,7 +168,8 @@
   ship->launch_year = game.year;
   arrival = ship->launch_year + (int) ship->travel_time;
   
-  notify_player(0, "Game: The %s have launched a spaceship! It is estimated to 
"
+  notify_player_ex(0, 0, 0, E_SPACESHIP,
+               "Game: The %s have launched a spaceship! It is estimated to "
                "arrive on Alpha Centauri in %s.",
                races[pplayer->race].name,
                textyear(arrival));
@@ -325,7 +327,8 @@
 **************************************************************************/
 void spaceship_lost(struct player *pplayer)
 {
-  notify_player(0, "Game: With the capture of %s's capital, the %s"
+  notify_player_ex(0, 0, 0, E_SPACESHIP,
+               "Game: With the capture of %s's capital, the %s"
                " spaceship is lost!", pplayer->name,
                get_race_name(pplayer->race));
   spaceship_init(&pplayer->spaceship);
@@ -362,8 +365,9 @@
   if (best_pplayer) {
     best_pplayer->spaceship.state = SSHIP_ARRIVED;
     server_state = GAME_OVER_STATE;
-    notify_player(0, "Game: The %s spaceship has arrived at Alpha Centauri.",
-                 get_race_name(best_pplayer->race));
+    notify_player_ex(0, 0, 0, E_SPACESHIP,
+                    "Game: The %s spaceship has arrived at Alpha Centauri.",
+                    get_race_name(best_pplayer->race));
   }
 }
 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] patch: spaceship event type, David Pfitzner <=