[Freeciv-Dev] (PR#2290) [rff] onsetwar
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
undisclosed-recipients:; |
Subject: |
[Freeciv-Dev] (PR#2290) [rff] onsetwar |
From: |
"Thomas Strub via RT" <rt@xxxxxxxxxxxxxx> |
Date: |
Sat, 9 Nov 2002 15:23:26 -0800 |
Reply-to: |
rt@xxxxxxxxxxxxxx |
Hi,
this is another request for feature.
After chatting with other players one said to me that it could be a nice
option to have onsetwar. An option like onsetbarbs, but the difference
is only that its not possible to make hostile actions until the time to
onsetwar is over.
Think without borders and a "5 mile" zone in water there are to much
hostile posibilities left. But its a begin.
Thomas
--
Thomas Strub *** eMail ue80@xxxxxxxxxxxxxxxxxxx
Nur weil das Aufzeichnen, Kopieren und Schnüffeln bei elektronischem
Datenverkehr leichter als bei der klassischen Post ist, darf man es nicht
einfach tun.
? ddddd
? fastwar
? onsetwar.diff
Index: common/game.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/game.c,v
retrieving revision 1.150
diff -u -r1.150 game.c
--- common/game.c 2 Nov 2002 13:33:53 -0000 1.150
+++ common/game.c 9 Nov 2002 23:16:23 -0000
@@ -691,6 +691,7 @@
game.auto_ai_toggle = GAME_DEFAULT_AUTO_AI_TOGGLE;
game.notradesize = GAME_DEFAULT_NOTRADESIZE;
game.fulltradesize = GAME_DEFAULT_FULLTRADESIZE;
+ game.onsetwar = GAME_DEFAULT_ONSETWAR;
game.barbarianrate = GAME_DEFAULT_BARBARIANRATE;
game.onsetbarbarian = GAME_DEFAULT_ONSETBARBARIAN;
game.nbarbarians = 0;
Index: common/game.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/game.h,v
retrieving revision 1.115
diff -u -r1.115 game.h
--- common/game.h 7 Nov 2002 15:32:39 -0000 1.115
+++ common/game.h 9 Nov 2002 23:16:24 -0000
@@ -86,6 +86,7 @@
int min_players, max_players, nplayers;
int aifill;
int notradesize, fulltradesize;
+ int onsetwar;
int barbarianrate;
int onsetbarbarian;
int nbarbarians;
@@ -410,6 +411,11 @@
#define GAME_DEFAULT_FULLTRADESIZE 1
#define GAME_MIN_FULLTRADESIZE 1
#define GAME_MAX_FULLTRADESIZE 50
+
+#define GAME_DEFAULT_ONSETWAR GAME_START_YEAR
+#define GAME_MIN_ONSETWAR GAME_START_YEAR
+#define GAME_MAX_ONSETWAR GAME_MAX_END_YEAR
+
#define GAME_DEFAULT_BARBARIANRATE 2
#define GAME_MIN_BARBARIANRATE 0
Index: common/player.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/player.c,v
retrieving revision 1.101
diff -u -r1.101 player.c
--- common/player.c 7 Nov 2002 18:55:25 -0000 1.101
+++ common/player.c 9 Nov 2002 23:16:24 -0000
@@ -553,6 +553,7 @@
const struct player *pplayer2)
{
enum diplstate_type ds = pplayer_get_diplstate(pplayer, pplayer2)->type;
+ if (game.year < game.onsetwar) return FALSE;
if (pplayer == pplayer2) return FALSE;
if (is_barbarian(pplayer) || is_barbarian(pplayer2))
return TRUE;
Index: server/diplomats.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/diplomats.c,v
retrieving revision 1.31
diff -u -r1.31 diplomats.c
--- server/diplomats.c 28 Oct 2002 17:06:12 -0000 1.31
+++ server/diplomats.c 9 Nov 2002 23:16:24 -0000
@@ -70,6 +70,15 @@
if (!cplayer || !pplayers_at_war(pplayer, cplayer))
return;
+ if (game.year < game.onsetwar){
+ notify_player_ex(pplayer, pdiplomat->x, pdiplomat->y,
+ E_MY_DIPLOMAT_FAILED,
+ _("Game: You can't poison cities before onsetwar is
over."));
+ return;
+ }
+
+
+
freelog (LOG_DEBUG, "poison: unit: %d", pdiplomat->id);
/* If not a Spy, can't poison. */
@@ -335,6 +344,13 @@
if (!uplayer || pplayers_allied(pplayer, uplayer))
return;
+ if (game.year < game.onsetwar){
+ notify_player_ex(pplayer, pdiplomat->x, pdiplomat->y,
+ E_MY_DIPLOMAT_FAILED,
+ _("Game: You can't sabotage unit before onsetwar is
over."));
+ return;
+ }
+
freelog (LOG_DEBUG, "sabotage-unit: unit: %d", pdiplomat->id);
/* If not a Spy, can't sabotage unit. */
@@ -385,6 +401,7 @@
- It's not the only unit on the square
(this is handled outside this function).
- You are allied with the unit owner.
+ - Its before on-set-war is over.
- Otherwise, the unit will be bribed.
- A successful briber will try to move onto the victim's square.
@@ -403,6 +420,12 @@
if (!uplayer || pplayers_allied(pplayer, uplayer))
return;
+ if (game.year < game.onsetwar){
+ notify_player_ex(pplayer, pdiplomat->x, pdiplomat->y,
+ E_MY_DIPLOMAT_FAILED,
+ _("Game: You can't bribe units before onsetwar is
over."));
+ return;
+ }
freelog (LOG_DEBUG, "bribe-unit: unit: %d", pdiplomat->id);
/* Update bribe cost. */
@@ -508,6 +531,13 @@
if ((cplayer == pplayer) || !cplayer)
return;
+ if (game.year < game.onsetwar){
+ notify_player_ex(pplayer, pdiplomat->x, pdiplomat->y,
+ E_MY_DIPLOMAT_FAILED,
+ _("Game: You can't steal techs before onsetwar is
over."));
+ return;
+ }
+
freelog (LOG_DEBUG, "steal-tech: unit: %d", pdiplomat->id);
/* If not a Spy, do something random. */
@@ -718,6 +748,13 @@
if (!cplayer || pplayers_allied(cplayer, pplayer))
return;
+ if (game.year < game.onsetwar){
+ notify_player_ex(pplayer, pdiplomat->x, pdiplomat->y,
+ E_MY_DIPLOMAT_FAILED,
+ _("Game: You can't incite revolt before onsetwar is
over."));
+ return;
+ }
+
freelog (LOG_DEBUG, "incite: unit: %d", pdiplomat->id);
/* Check for city from a bribable government. */
@@ -848,6 +885,13 @@
if (!cplayer || !pplayers_at_war(pplayer, cplayer))
return;
+ if (game.year < game.onsetwar){
+ notify_player_ex(pplayer, pdiplomat->x, pdiplomat->y,
+ E_MY_DIPLOMAT_FAILED,
+ _("Game: You can't sabotage before onsetwar is over."));
+ return;
+ }
+
freelog (LOG_DEBUG, "sabotage: unit: %d", pdiplomat->id);
/* If not a Spy, do something random. */
Index: server/savegame.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/savegame.c,v
retrieving revision 1.96
diff -u -r1.96 savegame.c
--- server/savegame.c 7 Nov 2002 18:55:26 -0000 1.96
+++ server/savegame.c 9 Nov 2002 23:16:25 -0000
@@ -1843,6 +1843,8 @@
"game.turnblock");
game.fixedlength = secfile_lookup_bool_default(file,game.fixedlength,
"game.fixedlength");
+ game.onsetwar = secfile_lookup_int_default(file, game.onsetwar,
+ "game.onsetwar");
game.barbarianrate = secfile_lookup_int_default(file, game.barbarianrate,
"game.barbarians");
game.onsetbarbarian = secfile_lookup_int_default(file, game.onsetbarbarian,
@@ -2173,6 +2175,7 @@
secfile_insert_bool(file, game.turnblock, "game.turnblock");
secfile_insert_bool(file, game.savepalace, "game.savepalace");
secfile_insert_bool(file, game.fixedlength, "game.fixedlength");
+ secfile_insert_int(file, game.onsetwar, "game.onsetwar");
secfile_insert_int(file, game.barbarianrate, "game.barbarians");
secfile_insert_int(file, game.onsetbarbarian, "game.onsetbarbs");
secfile_insert_int(file, game.occupychance, "game.occupychance");
Index: server/stdinhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/stdinhand.c,v
retrieving revision 1.261
diff -u -r1.261 stdinhand.c
--- server/stdinhand.c 7 Nov 2002 18:55:26 -0000 1.261
+++ server/stdinhand.c 9 Nov 2002 23:16:27 -0000
@@ -574,6 +574,12 @@
* packet_game_info) should probably not be flexible, or at
* least need extra care to be flexible.
*/
+ GEN_INT("onsetwar", game.onsetwar, SSET_RULES_FLEXIBLE,
+ SSET_TO_CLIENT,
+ N_("War onset year"),
+ N_("No hostile actions possible before that year."), NULL,
+ GAME_MIN_ONSETWAR, GAME_MAX_ONSETWAR,
+ GAME_DEFAULT_ONSETWAR)
GEN_INT("barbarians", game.barbarianrate, SSET_RULES_FLEXIBLE,
SSET_TO_CLIENT,
N_("Barbarian appearance frequency"),
- [Freeciv-Dev] (PR#2290) [rff] onsetwar,
Thomas Strub via RT <=
Message not available
|
|