Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2003:
[Freeciv-Dev] Re: (PR#5103) ai diplomacy
Home

[Freeciv-Dev] Re: (PR#5103) ai diplomacy

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#5103) ai diplomacy
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Tue, 19 Aug 2003 08:54:23 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Fri, 15 Aug 2003, Gregory Berkolaiko wrote:
> That's right. The other alliance members because they are forced by the
> terms of the alliance (they are actually doing an honourable thing, should
> they get a rep. bonus?), but it cannot be your fault that they are
> declaring war on you!

Okay, here's a patch that changes this. We now have the alliance members
declare war on the aggressor, as it should be, but give them due reason
(casus bellum). However, note how I have changed the workings of casus
bellum (reason_to_cancel). If we have high enough reason_to_cancel we can
cut through several treaty levels at the same time without suffering
reputation loss or fall of the senate, while previously you could only
cancel one.

Untested.

  - Per

"The truth is there is an ideological struggle between those who believe
that the best way to grow the economy is to give more money to the
wealthy, and the Democrats who believe that the wealthy will make more
money if average people do better." -- Bill Clinton, November 2000

Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.287
diff -u -r1.287 plrhand.c
--- server/plrhand.c    19 Aug 2003 15:37:43 -0000      1.287
+++ server/plrhand.c    19 Aug 2003 15:48:52 -0000
@@ -933,7 +933,7 @@
 
   /* 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;
+    pplayer->diplstates[pplayer2->player_no].has_reason_to_cancel--;
     if (has_senate && !repeat) {
       notify_player(pplayer, _("The senate passes your bill because of the "
                               "constant provocations of the %s."),
@@ -1012,15 +1012,16 @@
         && !pplayers_at_war(pplayer, other)) {
       struct packet_generic_values packet;
 
-      /* A declaration of war by A against B also means A declares
-       * war against all of B's allies. Yes, A gets the blame. */
-      packet.id = other->player_no;
+      /* A declaration of war by A against B also means every ally of B
+       * also declares war against A, and with casus bellum. */
+      other->diplstates[pplayer->player_no].has_reason_to_cancel = 3;
+      packet.id = pplayer->player_no;
       packet.value1 = CLAUSE_LAST;
       notify_player_ex(other, -1, -1, E_TREATY_BROKEN,
                       _("Game: %s has attacked one of your allies! "
                          "The alliance brings you into the war as well."),
                        pplayer->name);
-      handle_player_cancel_pact(pplayer, &packet);
+      handle_player_cancel_pact(other, &packet);
     }
   } players_iterate_end;
 }

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