Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2005:
[Freeciv-Dev] (PR#13222) my senate always dissolves
Home

[Freeciv-Dev] (PR#13222) my senate always dissolves

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13222) my senate always dissolves
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 15 Jun 2005 14:41:32 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13222 >

Here is a partial fix.

In this design you cannot declare war if the senate doesn't let you. 
Instead you get a message telling you to either dissolve the senate or
wait, if you want to declare war.  As far as I'm concerned this fixes
the gameplay issue.

However there's still a UI issue in that dissolving the senate isn't
easy or intuitive.  If you're in republic you can't go to
government->choose->republic since that won't do anything.  You have to
go to government->choose->revolution (or government->choose->monarchy),
choose yes, then declare war, then pick your new government
(government->choose->republic).  This would all be solved if there was a
new menu entry government->choose->dissolve (or just
government->dissolve) that basically did the same thing the old senate
dissolving did.

-jason

Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.388
diff -u -r1.388 plrhand.c
--- server/plrhand.c    14 Jun 2005 18:49:09 -0000      1.388
+++ server/plrhand.c    15 Jun 2005 21:38:21 -0000
@@ -1101,7 +1101,7 @@
   enum diplstate_type old_type;
   enum diplstate_type new_type;
   struct player *pplayer2;
-  bool has_senate, repeat = FALSE;
+  bool repeat = FALSE;
 
   if (!is_valid_player_id(other_player_id)) {
     return;
@@ -1109,7 +1109,6 @@
 
   old_type = pplayer->diplstates[other_player_id].type;
   pplayer2 = get_player(other_player_id);
-  has_senate = (get_player_bonus(pplayer, EFT_HAS_SENATE) > 0);
 
   /* can't break a pact with yourself */
   if (pplayer == pplayer2) {
@@ -1133,8 +1132,23 @@
   }
 
   /* else, breaking a treaty */
-
 repeat_break_treaty:
+
+  /* The senate may not allow you to break the treaty.  In this case you
+   * must first dissolve the senate then you can break it.  This is waived
+   * if you have statue of liberty since you could easily just dissolve and
+   * then recreate it. */
+  if (pplayer->diplstates[pplayer2->player_no].has_reason_to_cancel <= 0
+      && get_player_bonus(pplayer, EFT_HAS_SENATE) > 0
+      && get_player_bonus(pplayer, EFT_ANY_GOVERNMENT) == 0) {
+    notify_player_ex(pplayer, NULL, E_TREATY_BROKEN,
+                    _("The senate will not allow you to break treaty "
+                      "with the %s.  You must either dissolve the senate "
+                      "or wait until a more timely moment."),
+                    get_nation_name_plural(pplayer2->nation));
+    return;
+  }
+
   /* check what the new status will be */
   switch(old_type) {
   case DS_NO_CONTACT: /* possible if someone declares war on our ally */
@@ -1186,22 +1200,20 @@
   }
 
   /* if there's a reason to cancel the pact, do it without penalty */
-  if (pplayer->diplstates[pplayer2->player_no].has_reason_to_cancel > 0) {
-    pplayer->diplstates[pplayer2->player_no].has_reason_to_cancel = 0;
-    if (has_senate && !repeat) {
+  if (get_player_bonus(pplayer, EFT_HAS_SENATE) > 0 && !repeat) {
+    if (pplayer->diplstates[pplayer2->player_no].has_reason_to_cancel > 0) {
       notify_player_ex(pplayer, NULL, E_TREATY_BROKEN,
-                       _("The senate passes your bill because of the "
-                         "constant provocations of the %s."),
-                       get_nation_name_plural(pplayer2->nation));
-    }
-  } else {
-    if (has_senate && pplayer->revolution_finishes < 0) {
-        notify_player_ex(pplayer, NULL, E_ANARCHY,
-                         _("The senate decides to dissolve "
-                         "rather than support your actions any longer."));
-       handle_player_change_government(pplayer, pplayer->government);
+                      _("The senate passes your bill because of the "
+                        "constant provocations of the %s."),
+                      get_nation_name_plural(pplayer2->nation));
+    } else {
+      notify_player_ex(pplayer, NULL, E_TREATY_BROKEN,
+                      _("The senate refuses to break treaty with the %s, "
+                        "but you have no trouble finding a new senate."),
+                      get_nation_name_plural(pplayer2->nation));
     }
   }
+  pplayer->diplstates[pplayer2->player_no].has_reason_to_cancel = 0;
 
   send_player_info(pplayer, NULL);
   send_player_info(pplayer2, NULL);

[Prev in Thread] Current Thread [Next in Thread]