[Freeciv-Dev] patch: reveal map
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
here is a patch to reveal map at start of the game
works like /set revealmap 1 to reveal map
default is 0
help is included
great for scenario games..
there are options 0 - no reveal and 1 - reveal all map.
this could maybe be later changed to more options, like all the rest
numbers being radius on how
much is seen from starting point.. or something?
other matters..
is there any way to make scenario maps yourself at the moment?
i've been thinking about possibility to make/use very advanced scenarios
which could include
advanced civilizations, roads, railroads, ready armies, even ready
treaties etc.
and one other thing would be to make kind of mix between generators and
ready scenarios
like you could set world to have shape about like that and to have oil
about there, whales
about there, civilization ruins about there and so on.., so you wouldn't
never know exactly what kind of
map you are playing ... and only shape of land would be shown at start
if using revealmap..
-Dizzyfish
Index: common/game.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/game.c,v
retrieving revision 1.77
diff -u -r1.77 game.c
--- game.c 2000/06/16 17:01:29 1.77
+++ game.c 2000/06/27 22:54:43
@@ -753,6 +753,7 @@
game.spacerace = GAME_DEFAULT_SPACERACE;
game.fogofwar = GAME_DEFAULT_FOGOFWAR;
game.fogofwar_old= game.fogofwar;
+ game.revealmap = GAME_DEFAULT_REVEALMAP;
game.auto_ai_toggle = GAME_DEFAULT_AUTO_AI_TOGGLE;
game.barbarianrate = GAME_DEFAULT_BARBARIANRATE;
game.onsetbarbarian = GAME_DEFAULT_ONSETBARBARIAN;
Index: common/game.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/game.h,v
retrieving revision 1.61
diff -u -r1.61 game.h
--- game.h 2000/06/07 16:17:39 1.61
+++ game.h 2000/06/27 22:54:43
@@ -96,7 +96,7 @@
int fogofwar;
int fogofwar_old; /* as the fog_of_war bit get changed by setting
the server we need to remember the old setting */
-
+ int revealmap;
int num_unit_types;
int num_tech_types; /* including A_NONE */
@@ -223,6 +223,10 @@
#define GAME_DEFAULT_FOGOFWAR 1
#define GAME_MIN_FOGOFWAR 0
#define GAME_MAX_FOGOFWAR 1
+
+#define GAME_DEFAULT_REVEALMAP 0
+#define GAME_MIN_REVEALMAP 0
+#define GAME_MAX_REVEALMAP 1
#define GAME_DEFAULT_DIPLCHANCE 80
#define GAME_MIN_DIPLCHANCE 1
Index: server/civserver.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/civserver.c,v
retrieving revision 1.167
diff -u -r1.167 civserver.c
--- civserver.c 2000/06/24 13:42:51 1.167
+++ civserver.c 2000/06/27 22:54:46
@@ -467,6 +467,9 @@
if(game.is_new_game)
init_new_game();
+
+ if(game.revealmap == 1)
+ reveal_map_to_all();
game.is_new_game = 0;
Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.141
diff -u -r1.141 plrhand.c
--- plrhand.c 2000/06/24 18:31:39 1.141
+++ plrhand.c 2000/06/27 22:54:49
@@ -1338,6 +1338,23 @@
}
}
+
+/**************************************************************************
+...
+**************************************************************************/
+
+void reveal_map_to_all(void)
+{
+ int i=0;
+ struct player *pplayer;
+
+ for (i=0;i<game.nplayers;i++) {
+ pplayer = &game.players[i];
+ map_know_all(pplayer);
+ }
+}
+
+
/**************************************************************************
...
**************************************************************************/
Index: server/plrhand.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.h,v
retrieving revision 1.23
diff -u -r1.23 plrhand.h
--- plrhand.h 2000/06/18 15:50:21 1.23
+++ plrhand.h 2000/06/27 22:54:49
@@ -75,6 +75,7 @@
void do_conquer_cost(struct player *pplayer);
void show_ending(void);
void show_map_to_all(void);
+void reveal_map_to_all(void);
void player_load(struct player *plr, int plrno, struct section_file *file);
void player_map_load(struct player *plr, int plrno, struct section_file *file);
void player_save(struct player *plr, int plrno, struct section_file *file);
Index: server/stdinhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/stdinhand.c,v
retrieving revision 1.119
diff -u -r1.119 stdinhand.c
--- stdinhand.c 2000/06/24 05:04:00 1.119
+++ stdinhand.c 2000/06/27 22:54:53
@@ -480,6 +480,14 @@
" 4 = heli\n"
" 8 = air") },
+ { "revealmap", &game.revealmap,
+ SSET_RULES_FLEXIBLE, SSET_TO_CLIENT,
+ GAME_MIN_REVEALMAP, GAME_MAX_REVEALMAP, GAME_DEFAULT_REVEALMAP,
+ N_("Whether to reveal map at start or not"),
+ N_("If this is set to 1, world map will be shown to players at start\n"
+ "When used with fog of war reveals the map but not other players\n"
+ "Useful especially when playing scenario maps.") },
+
/* Flexible rules: these can be changed after the game has started.
*
* The distinction between "rules" and "flexible rules" is not always
- [Freeciv-Dev] patch: reveal map,
Jussi Asp <=
|
|