diff -u3NrX /home/perrin/freeciv/diff_ignore freeciv/client/options.c freeciv-phased/client/options.c --- freeciv/client/options.c Mon Mar 18 19:51:25 2002 +++ freeciv-phased/client/options.c Wed Apr 3 00:46:20 2002 @@ -158,6 +158,7 @@ GEN_EV(N_("Unit Built"), E_UNIT_BUILD), GEN_EV(N_("Unit Defender Destroyed"), E_UNIT_LOST), GEN_EV(N_("Unit Defender Survived"), E_UNIT_WIN), + GEN_EV(N_("Unit Relocated"), E_UNIT_RELOCATED), GEN_EV(N_("Collapse to Anarchy"), E_ANARCHY), GEN_EV(N_("Diplomat Actions - Enemy"), E_DIPLOMATED), GEN_EV(N_("Tech from Great Library"), E_TECH_GAIN), @@ -174,7 +175,6 @@ GEN_EV(N_("Spaceship Events"), E_SPACESHIP), GEN_EV(N_("Barbarian Uprising"), E_UPRISING ), GEN_EV(N_("Worklist Events"), E_WORKLIST), - GEN_EV(N_("Pact Cancelled"), E_CANCEL_PACT), GEN_EV(N_("Diplomatic Incident"), E_DIPL_INCIDENT), GEN_EV(N_("First Contact"), E_FIRST_CONTACT), GEN_EV(N_("City May Soon Grow"), E_CITY_MAY_SOON_GROW), @@ -202,6 +202,12 @@ GEN_EV(N_("Report"), E_REPORT), GEN_EV(N_("Broadcast Report"), E_BROADCAST_REPORT), GEN_EV(N_("Nation Selected"), E_NATION_SELECTED), + GEN_EV(N_("Civil War"), E_CIVIL_WAR), + GEN_EV(N_("City Transfer"), E_CITY_TRANSFER), + GEN_EV(N_("Treaty - Ceasefire"), E_TREATY_CEASEFIRE), + GEN_EV(N_("Treaty - Peace"), E_TREATY_PEACE), + GEN_EV(N_("Treaty - Alliance"), E_TREATY_ALLIANCE), + GEN_EV(N_("Treaty - Broken"), E_TREATY_BROKEN), GEN_EV_TERMINATOR }; diff -u3NrX /home/perrin/freeciv/diff_ignore freeciv/common/events.h freeciv-phased/common/events.h --- freeciv/common/events.h Tue Mar 26 01:34:22 2002 +++ freeciv-phased/common/events.h Wed Apr 3 00:46:27 2002 @@ -35,6 +35,7 @@ E_UNIT_BUILD, E_UNIT_LOST, E_UNIT_WIN, + E_UNIT_RELOCATED, E_ANARCHY, E_DIPLOMATED, E_TECH_GAIN, @@ -51,7 +52,6 @@ E_SPACESHIP, E_UPRISING, E_WORKLIST, - E_CANCEL_PACT, E_DIPL_INCIDENT, E_FIRST_CONTACT, E_CITY_MAY_SOON_GROW, @@ -79,6 +79,12 @@ E_REPORT, E_BROADCAST_REPORT, E_NATION_SELECTED, + E_CIVIL_WAR, + E_CITY_TRANSFER, + E_TREATY_CEASEFIRE, + E_TREATY_PEACE, + E_TREATY_ALLIANCE, + E_TREATY_BROKEN, /* Note: If you add a new event, make sure you make a similar change to message_text in client/options.c */ diff -u3NrX /home/perrin/freeciv/diff_ignore freeciv/server/diplhand.c freeciv-phased/server/diplhand.c --- freeciv/server/diplhand.c Tue Mar 26 01:34:28 2002 +++ freeciv-phased/server/diplhand.c Wed Apr 3 01:16:29 2002 @@ -25,6 +25,7 @@ #include "packets.h" #include "player.h" #include "unit.h" +#include "events.h" #include "citytools.h" #include "cityturn.h" @@ -272,18 +273,19 @@ switch (pclause->type) { case CLAUSE_ADVANCE: - notify_player(pdest, _("Game: You are taught the knowledge of %s."), - advances[pclause->value].name); + notify_player_ex(pdest, -1, -1, E_TECH_GAIN, + _("Game: You are taught the knowledge of %s."), + get_tech_name(pdest, pclause->value)); - notify_embassies(pdest,pgiver, + notify_embassies(pdest, pgiver, _("Game: The %s have aquired %s from the %s."), get_nation_name_plural(pdest->nation), - advances[pclause->value].name, + get_tech_name(pdest, pclause->value), get_nation_name_plural(pgiver->nation)); gamelog(GAMELOG_TECH, "%s acquire %s (Treaty) from %s", get_nation_name_plural(pdest->nation), - advances[pclause->value].name, + get_tech_name(pdest, pclause->value), get_nation_name_plural(pgiver->nation)); do_dipl_cost(pdest); @@ -316,10 +318,12 @@ break; } - notify_player(pdest, _("Game: You receive city of %s from %s."), + notify_player_ex(pdest, pcity->x, pcity->y, E_CITY_TRANSFER, + _("Game: You receive city of %s from %s."), pcity->name, pgiver->name); - notify_player(pgiver, _("Game: You give city of %s to %s."), + notify_player_ex(pgiver, pcity->x, pcity->y, E_CITY_LOST, + _("Game: You give city of %s to %s."), pcity->name, pdest->name); transfer_city(pdest, pcity, -1, TRUE, TRUE, FALSE); @@ -330,9 +334,11 @@ pgiver->diplstates[pdest->player_no].turns_left=16; pdest->diplstates[pgiver->player_no].type=DS_CEASEFIRE; pdest->diplstates[pgiver->player_no].turns_left=16; - notify_player(pgiver, _("Game: You agree on a cease-fire with %s."), + notify_player_ex(pgiver, -1, -1, E_TREATY_CEASEFIRE, + _("Game: You agree on a cease-fire with %s."), pdest->name); - notify_player(pdest, _("Game: You agree on a cease-fire with %s."), + notify_player_ex(pdest, -1, -1, E_TREATY_CEASEFIRE, + _("Game: You agree on a cease-fire with %s."), pgiver->name); check_city_workers(plr0); check_city_workers(plr1); @@ -340,19 +346,23 @@ case CLAUSE_PEACE: pgiver->diplstates[pdest->player_no].type=DS_PEACE; pdest->diplstates[pgiver->player_no].type=DS_PEACE; - notify_player(pgiver, _("Game: You agree on peace with %s."), + notify_player_ex(pgiver, -1, -1, E_TREATY_PEACE, + _("Game: You agree on a peace treaty with %s."), pdest->name); - notify_player(pdest, _("Game: You agree on peace with %s."), - pgiver->name); + notify_player_ex(pdest, -1, -1, E_TREATY_PEACE, + _("Game: You agree on a peace treaty with %s."), + pgiver->name); check_city_workers(plr0); check_city_workers(plr1); break; case CLAUSE_ALLIANCE: pgiver->diplstates[pdest->player_no].type=DS_ALLIANCE; pdest->diplstates[pgiver->player_no].type=DS_ALLIANCE; - notify_player(pgiver, _("Game: You agree on an alliance with %s."), + notify_player_ex(pgiver, -1, -1, E_TREATY_ALLIANCE, + _("Game: You agree on an alliance with %s."), pdest->name); - notify_player(pdest, _("Game: You agree on an alliance with %s."), + notify_player_ex(pdest, -1, -1, E_TREATY_ALLIANCE, + _("Game: You agree on an alliance with %s."), pgiver->name); check_city_workers(plr0); check_city_workers(plr1); diff -u3NrX /home/perrin/freeciv/diff_ignore freeciv/server/plrhand.c freeciv-phased/server/plrhand.c --- freeciv/server/plrhand.c Sat Mar 30 17:40:49 2002 +++ freeciv-phased/server/plrhand.c Wed Apr 3 01:33:59 2002 @@ -569,10 +569,9 @@ } /************************************************************************** - if target has more techs than pplayer, pplayer will get a random of these - the clients will both be notified. - I have notified only those with embassies in pplayer's country - adm4 - FIXME: this should be in plrhand + If target has more techs than pplayer, pplayer will get a random of + these, the clients will both be notified and the conquer cost penalty + applied. Used for diplomats and city conquest. **************************************************************************/ void get_a_tech(struct player *pplayer, struct player *target) { @@ -585,44 +584,41 @@ } } if (j == 0) { + /* we've moved on to future tech */ if (target->future_tech > pplayer->future_tech) { found_new_future_tech(pplayer); - - notify_player(pplayer, _("Game: You acquire Future Tech %d from %s."), - pplayer->future_tech, target->name); - notify_player(target, - _("Game: %s discovered Future Tech. %d in the city."), - pplayer->name, pplayer->future_tech); - notify_embassies(pplayer, target, - _("Game: The %s discovered Future Tech %d from the %s (conq)"), - get_nation_name_plural(pplayer->nation), - pplayer->future_tech, get_nation_name_plural(target->nation)); + i = game.num_tech_types + pplayer->future_tech; + } else { + return; /* nothing to learn here, move on */ + } + } else { + /* pick random tech */ + j=myrand(j)+1; + for (i=0;ination), - advances[i].name, + get_tech_name(pplayer, i), get_nation_name_plural(target->nation)); - notify_player(pplayer, _("Game: You acquired %s from %s."), - advances[i].name, target->name); - notify_player(target, _("Game: %s discovered %s in the city."), pplayer->name, - advances[i].name); + notify_player_ex(pplayer, -1, -1, E_TECH_GAIN, + _("Game: You steal %s from the %s."), + get_tech_name(pplayer, i), + get_nation_name_plural(target->nation)); + + notify_player(target, _("Game: The %s stole %s from you!"), + get_nation_name_plural(pplayer->nation), + get_tech_name(pplayer, i)); + notify_embassies(pplayer, target, _("Game: The %s have stolen %s from the %s."), - get_nation_name_plural(pplayer->nation), - advances[i].name, - get_nation_name_plural(target->nation)); + get_nation_name_plural(pplayer->nation), + get_tech_name(pplayer, i), + get_nation_name_plural(target->nation)); do_conquer_cost(pplayer); found_new_tech(pplayer, i, FALSE, TRUE); @@ -925,16 +921,14 @@ check_city_workers(pplayer); check_city_workers(pplayer2); - notify_player(pplayer, - _("Game: The diplomatic state between the %s and the %s is now %s."), - get_nation_name_plural(pplayer->nation), - get_nation_name_plural(pplayer2->nation), - diplstate_text(new_type)); - notify_player_ex(pplayer2, -1, -1, E_NOEVENT, - _("Game: %s cancelled the diplomatic agreement!"), - pplayer->name); - notify_player_ex(pplayer2, -1, -1, E_CANCEL_PACT, + notify_player_ex(pplayer, -1, -1, E_TREATY_BROKEN, _("Game: The diplomatic state between the %s and the %s is now %s."), + get_nation_name_plural(pplayer->nation), + get_nation_name_plural(pplayer2->nation), + diplstate_text(new_type)); + notify_player_ex(pplayer2, -1, -1, E_TREATY_BROKEN, + _("Game: %s cancelled the diplomatic agreement! The diplomatic " + "state between the %s and the %s is now %s."), pplayer->name, get_nation_name_plural(pplayer2->nation), get_nation_name_plural(pplayer->nation), diplstate_text(new_type)); @@ -1778,7 +1772,7 @@ freelog(LOG_VERBOSE, "%s's nation is thrust into civil war, created AI player %s", pplayer->name, cplayer->name); - notify_player(pplayer, + notify_player_ex(pplayer, -1, -1, E_CIVIL_WAR, _("Game: Your nation is thrust into civil war, " " %s is declared the leader of the rebel states."), cplayer->name); @@ -1798,8 +1792,9 @@ transfer_city(cplayer, pcity, -1, FALSE, FALSE, FALSE); freelog(LOG_VERBOSE, "%s declares allegiance to %s", pcity->name, cplayer->name); - notify_player(pplayer, _("Game: %s declares allegiance to %s."), - pcity->name,cplayer->name); + notify_player_ex(pplayer, pcity->x, pcity->y, E_CITY_LOST, + _("Game: %s declares allegiance to %s."), + pcity->name, cplayer->name); i--; } } diff -u3NrX /home/perrin/freeciv/diff_ignore freeciv/server/unittools.c freeciv-phased/server/unittools.c --- freeciv/server/unittools.c Wed Mar 27 14:59:15 2002 +++ freeciv-phased/server/unittools.c Tue Apr 2 23:02:59 2002 @@ -1040,7 +1040,8 @@ "Moved %s's %s due to changing land to sea at (%d, %d).", unit_owner(punit2)->name, unit_name(punit2->type), punit2->x, punit2->y); - notify_player(unit_owner(punit2), + notify_player_ex(unit_owner(punit2), + punit2->x, punit2->y, E_UNIT_RELOCATED, _("Game: Moved your %s due to changing" " land to sea at (%d, %d)."), unit_name(punit2->type), punit2->x, punit2->y); @@ -1062,7 +1063,8 @@ "Embarked %s's %s due to changing land to sea at (%d, %d).", unit_owner(punit2)->name, unit_name(punit2->type), punit2->x, punit2->y); - notify_player(unit_owner(punit2), + notify_player_ex(unit_owner(punit2), + punit2->x, punit2->y, E_UNIT_RELOCATED, _("Game: Embarked your %s due to changing" " land to sea at (%d, %d)."), unit_name(punit2->type), punit2->x, punit2->y); @@ -1077,7 +1079,8 @@ "Disbanded %s's %s due to changing land to sea at (%d, %d).", unit_owner(punit2)->name, unit_name(punit2->type), punit2->x, punit2->y); - notify_player(unit_owner(punit2), + notify_player_ex(unit_owner(punit2), + punit2->x, punit2->y, E_UNIT_LOST, _("Game: Disbanded your %s due to changing" " land to sea at (%d, %d)."), unit_name(punit2->type), punit2->x, punit2->y); @@ -1100,7 +1103,8 @@ "Moved %s's %s due to changing sea to land at (%d, %d).", unit_owner(punit2)->name, unit_name(punit2->type), punit2->x, punit2->y); - notify_player(unit_owner(punit2), + notify_player_ex(unit_owner(punit2), + punit2->x, punit2->y, E_UNIT_RELOCATED, _("Game: Moved your %s due to changing" " sea to land at (%d, %d)."), unit_name(punit2->type), punit2->x, punit2->y); @@ -1121,7 +1125,8 @@ "Docked %s's %s due to changing sea to land at (%d, %d).", unit_owner(punit2)->name, unit_name(punit2->type), punit2->x, punit2->y); - notify_player(unit_owner(punit2), + notify_player_ex(unit_owner(punit2), + punit2->x, punit2->y, E_UNIT_RELOCATED, _("Game: Docked your %s due to changing" " sea to land at (%d, %d)."), unit_name(punit2->type), punit2->x, punit2->y);