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

> [EMAIL PROTECTED] - Sun Feb 11 13:57:16 2007]:
> 
>  Untested patch to limit Triremes to Ocean tiles. Applies on top of
> Deep Ocean patch #34265.
>  Also, Triremes do not get move bonus from Nuclear Power.

Here is a more complicated spur-of-the-moment patch, it includes the
trireme limitation and 34265, as well as removing all the
trireme-specific code (much of which is already deprecated with the
removal of dangerous tiles).

-jason

Index: version.in
===================================================================
--- version.in	(revision 12631)
+++ version.in	(working copy)
@@ -24,4 +24,4 @@
 #   - Avoid adding a new manditory capbility to the development branch for
 #     as long as possible.  We want to maintain network compatibility with
 #     the stable branch for as long as possible.
-FREECIV_NETWORK_CAPSTRING("+Freeciv.Devel.2007.Jan.21")
+FREECIV_NETWORK_CAPSTRING("+Freeciv.Devel.2007.Feb.12")
Index: doc/README.effects
===================================================================
--- doc/README.effects	(revision 12631)
+++ doc/README.effects	(working copy)
@@ -120,9 +120,6 @@
 No_Anarchy
     No period of anarchy between government changes.
 
-No_Sink_Deep
-    Triremes no longer sink when on dangerous seas.
-
 Nuke_Proof
     City is nuke proof.
 
Index: server/ruleset.c
===================================================================
--- server/ruleset.c	(revision 12631)
+++ server/ruleset.c	(working copy)
@@ -1014,19 +1014,6 @@
     free(def_vblist);
   }
 
-  /* highseas loss pct */
-  def_vblist = secfile_lookup_int_vec(file, &vet_levels_default,
-  		  	"veteran_system.veteran_highseas_loss_pct");
-  for (i = 0; i < vet_levels_default; i++) {
-    game.trireme_loss_chance[i] = def_vblist[i];
-  }
-  for (; i < MAX_VET_LEVELS; i++) {
-    game.trireme_loss_chance[i] = 50; /* default */
-  }
-  if (def_vblist) {
-    free(def_vblist);
-  }
-  
   /* move bonus */
   def_vblist = secfile_lookup_int_vec(file, &vet_levels_default,
                                       "veteran_system.veteran_move_bonus");
@@ -3205,8 +3192,6 @@
 {
   struct packet_ruleset_game misc_p;
 
-  memcpy(misc_p.trireme_loss_chance, game.trireme_loss_chance, 
-         sizeof(game.trireme_loss_chance));
   memcpy(misc_p.work_veteran_chance, game.work_veteran_chance, 
          sizeof(game.work_veteran_chance));
   memcpy(misc_p.veteran_chance, game.veteran_chance, 
Index: server/unithand.c
===================================================================
--- server/unithand.c	(revision 12631)
+++ server/unithand.c	(working copy)
@@ -951,10 +951,6 @@
     notify_player(unit_owner(punit), src_tile, E_BAD_COMMAND,
 		     _("%s can only move into your own zone of control."),
 		     unit_type(punit)->name);
-  } else if (reason == MR_TRIREME) {
-    notify_player(unit_owner(punit), src_tile, E_BAD_COMMAND,
-		     _("%s cannot move that far from the coast line."),
-		     unit_type(punit)->name);
   }
   return FALSE;
 }
Index: data/amplio/terrain2.spec
===================================================================
--- data/amplio/terrain2.spec	(revision 12631)
+++ data/amplio/terrain2.spec	(working copy)
@@ -144,76 +144,113 @@
 tiles = { "row", "column","tag"
 
 ; ocean cell sprites.  See doc/README.graphics
- 0, 0,  "t.ocean_cell_u000"
- 0, 2,  "t.ocean_cell_u100"
- 0, 4,  "t.ocean_cell_u010"
- 0, 6,  "t.ocean_cell_u110"
- 0, 8,  "t.ocean_cell_u001"
- 0, 10, "t.ocean_cell_u101"
- 0, 12, "t.ocean_cell_u011"
- 0, 14, "t.ocean_cell_u111"
+ 0, 0,  "t.l0.ocean_cell_u000"
+ 0, 2,  "t.l0.ocean_cell_u100"
+ 0, 4,  "t.l0.ocean_cell_u010"
+ 0, 6,  "t.l0.ocean_cell_u110"
+ 0, 8,  "t.l0.ocean_cell_u001"
+ 0, 10, "t.l0.ocean_cell_u101"
+ 0, 12, "t.l0.ocean_cell_u011"
+ 0, 14, "t.l0.ocean_cell_u111"
  
- 1, 0,  "t.ocean_cell_d000"
- 1, 2,  "t.ocean_cell_d100"
- 1, 4,  "t.ocean_cell_d010"
- 1, 6,  "t.ocean_cell_d110"
- 1, 8,  "t.ocean_cell_d001"
- 1, 10, "t.ocean_cell_d101"
- 1, 12, "t.ocean_cell_d011"
- 1, 14, "t.ocean_cell_d111"
+ 1, 0,  "t.l0.ocean_cell_d000"
+ 1, 2,  "t.l0.ocean_cell_d100"
+ 1, 4,  "t.l0.ocean_cell_d010"
+ 1, 6,  "t.l0.ocean_cell_d110"
+ 1, 8,  "t.l0.ocean_cell_d001"
+ 1, 10, "t.l0.ocean_cell_d101"
+ 1, 12, "t.l0.ocean_cell_d011"
+ 1, 14, "t.l0.ocean_cell_d111"
 
- 2, 0,  "t.ocean_cell_l000"
- 2, 2,  "t.ocean_cell_l100"
- 2, 4,  "t.ocean_cell_l010"
- 2, 6,  "t.ocean_cell_l110"
- 2, 8,  "t.ocean_cell_l001"
- 2, 10, "t.ocean_cell_l101"
- 2, 12, "t.ocean_cell_l011"
- 2, 14, "t.ocean_cell_l111"
+ 2, 0,  "t.l0.ocean_cell_l000"
+ 2, 2,  "t.l0.ocean_cell_l100"
+ 2, 4,  "t.l0.ocean_cell_l010"
+ 2, 6,  "t.l0.ocean_cell_l110"
+ 2, 8,  "t.l0.ocean_cell_l001"
+ 2, 10, "t.l0.ocean_cell_l101"
+ 2, 12, "t.l0.ocean_cell_l011"
+ 2, 14, "t.l0.ocean_cell_l111"
 
- 2, 1,  "t.ocean_cell_r000"
- 2, 3,  "t.ocean_cell_r100"
- 2, 5,  "t.ocean_cell_r010"
- 2, 7,  "t.ocean_cell_r110"
- 2, 9,  "t.ocean_cell_r001"
- 2, 11, "t.ocean_cell_r101"
- 2, 13, "t.ocean_cell_r011"
- 2, 15, "t.ocean_cell_r111"
+ 2, 1,  "t.l0.ocean_cell_r000"
+ 2, 3,  "t.l0.ocean_cell_r100"
+ 2, 5,  "t.l0.ocean_cell_r010"
+ 2, 7,  "t.l0.ocean_cell_r110"
+ 2, 9,  "t.l0.ocean_cell_r001"
+ 2, 11, "t.l0.ocean_cell_r101"
+ 2, 13, "t.l0.ocean_cell_r011"
+ 2, 15, "t.l0.ocean_cell_r111"
 
+; deep ocean coasts.
+ 0, 1,  "t.l0.deep_cell_u000"
+ 6, 2,  "t.l0.deep_cell_u100"
+ 6, 4,  "t.l0.deep_cell_u010"
+ 6, 6,  "t.l0.deep_cell_u110"
+ 6, 8,  "t.l0.deep_cell_u001"
+ 6, 10, "t.l0.deep_cell_u101"
+ 6, 12, "t.l0.deep_cell_u011"
+ 6, 14, "t.l0.deep_cell_u111"
+ 
+ 0, 1,  "t.l0.deep_cell_d000"
+ 7, 2,  "t.l0.deep_cell_d100"
+ 7, 4,  "t.l0.deep_cell_d010"
+ 7, 6,  "t.l0.deep_cell_d110"
+ 7, 8,  "t.l0.deep_cell_d001"
+ 7, 10, "t.l0.deep_cell_d101"
+ 7, 12, "t.l0.deep_cell_d011"
+ 7, 14, "t.l0.deep_cell_d111"
+
+ 0, 1,  "t.l0.deep_cell_l000"
+ 8, 2,  "t.l0.deep_cell_l100"
+ 8, 4,  "t.l0.deep_cell_l010"
+ 8, 6,  "t.l0.deep_cell_l110"
+ 8, 8,  "t.l0.deep_cell_l001"
+ 8, 10, "t.l0.deep_cell_l101"
+ 8, 12, "t.l0.deep_cell_l011"
+ 8, 14, "t.l0.deep_cell_l111"
+
+ 0, 1,  "t.l0.deep_cell_r000"
+ 8, 3,  "t.l0.deep_cell_r100"
+ 8, 5,  "t.l0.deep_cell_r010"
+ 8, 7,  "t.l0.deep_cell_r110"
+ 8, 9,  "t.l0.deep_cell_r001"
+ 8, 11, "t.l0.deep_cell_r101"
+ 8, 13, "t.l0.deep_cell_r011"
+ 8, 15, "t.l0.deep_cell_r111"
+
 ; Deep Ocean sprites.
- 3, 0,  "t.deep_cell_u000"
- 3, 2,  "t.deep_cell_u100"
- 3, 4,  "t.deep_cell_u010"
- 3, 6,  "t.deep_cell_u110"
- 3, 8,  "t.deep_cell_u001"
- 3, 10, "t.deep_cell_u101"
- 3, 12, "t.deep_cell_u011"
- 3, 14, "t.deep_cell_u111"
+ 3, 0,  "t.l1.deep_cell_u000"
+ 3, 2,  "t.l1.deep_cell_u100"
+ 3, 4,  "t.l1.deep_cell_u010"
+ 3, 6,  "t.l1.deep_cell_u110"
+ 3, 8,  "t.l1.deep_cell_u001"
+ 3, 10, "t.l1.deep_cell_u101"
+ 3, 12, "t.l1.deep_cell_u011"
+ 3, 14, "t.l1.deep_cell_u111"
  
- 4, 0,  "t.deep_cell_d000"
- 4, 2,  "t.deep_cell_d100"
- 4, 4,  "t.deep_cell_d010"
- 4, 6,  "t.deep_cell_d110"
- 4, 8,  "t.deep_cell_d001"
- 4, 10, "t.deep_cell_d101"
- 4, 12, "t.deep_cell_d011"
- 4, 14, "t.deep_cell_d111"
+ 4, 0,  "t.l1.deep_cell_d000"
+ 4, 2,  "t.l1.deep_cell_d100"
+ 4, 4,  "t.l1.deep_cell_d010"
+ 4, 6,  "t.l1.deep_cell_d110"
+ 4, 8,  "t.l1.deep_cell_d001"
+ 4, 10, "t.l1.deep_cell_d101"
+ 4, 12, "t.l1.deep_cell_d011"
+ 4, 14, "t.l1.deep_cell_d111"
 
- 5, 0,  "t.deep_cell_l000"
- 5, 2,  "t.deep_cell_l100"
- 5, 4,  "t.deep_cell_l010"
- 5, 6,  "t.deep_cell_l110"
- 5, 8,  "t.deep_cell_l001"
- 5, 10, "t.deep_cell_l101"
- 5, 12, "t.deep_cell_l011"
- 5, 14, "t.deep_cell_l111"
+ 5, 0,  "t.l1.deep_cell_l000"
+ 5, 2,  "t.l1.deep_cell_l100"
+ 5, 4,  "t.l1.deep_cell_l010"
+ 5, 6,  "t.l1.deep_cell_l110"
+ 5, 8,  "t.l1.deep_cell_l001"
+ 5, 10, "t.l1.deep_cell_l101"
+ 5, 12, "t.l1.deep_cell_l011"
+ 5, 14, "t.l1.deep_cell_l111"
 
- 5, 1,  "t.deep_cell_r000"
- 5, 3,  "t.deep_cell_r100"
- 5, 5,  "t.deep_cell_r010"
- 5, 7,  "t.deep_cell_r110"
- 5, 9,  "t.deep_cell_r001"
- 5, 11, "t.deep_cell_r101"
- 5, 13, "t.deep_cell_r011"
- 5, 15, "t.deep_cell_r111"
+ 5, 1,  "t.l1.deep_cell_r000"
+ 5, 3,  "t.l1.deep_cell_r100"
+ 5, 5,  "t.l1.deep_cell_r010"
+ 5, 7,  "t.l1.deep_cell_r110"
+ 5, 9,  "t.l1.deep_cell_r001"
+ 5, 11, "t.l1.deep_cell_r101"
+ 5, 13, "t.l1.deep_cell_r011"
+ 5, 15, "t.l1.deep_cell_r111"
 }
Index: data/amplio.tilespec
===================================================================
--- data/amplio.tilespec	(revision 12631)
+++ data/amplio.tilespec	(working copy)
@@ -167,6 +167,7 @@
 ; - There is no coast drawn beteen Deep Ocean and land tiles
 [terrain_deep]
 is_blended = 0
+is_reversed = 1
 num_layers = 2
 layer0_match_style = "bool"
 layer0_match_type  = "ocean"
Index: data/default/effects.ruleset
===================================================================
--- data/default/effects.ruleset	(revision 12631)
+++ data/default/effects.ruleset	(working copy)
@@ -886,6 +886,15 @@
       "UnitClass", "Sea", "Local"
     }
 
+[effect_coastal_defense_trireme]
+name	= "Defend_Bonus"
+value	= 100
+reqs	=
+    { "type", "name", "range"
+      "Building", "Coastal Defense", "City"
+      "UnitClass", "Trireme", "Local"
+    }
+
 [effect_colosseum]
 name	= "Make_Content"
 value	= 3
@@ -1248,6 +1257,24 @@
       "UnitClass", "Sea", "Local"
     }
 
+[effect_port_facility_trireme]
+name	= "Veteran_Build"
+value	= 1
+reqs	=
+    { "type", "name", "range"
+      "Building", "Port Facility", "City"
+      "UnitClass", "Trireme", "Local"
+    }
+
+[effect_port_facility_trireme_1]
+name	= "HP_Regen"
+value	= 100
+reqs	=
+    { "type", "name", "range"
+      "Building", "Port Facility", "City"
+      "UnitClass", "Trireme", "Local"
+    }
+
 [effect_power_plant]
 name	= "Output_Bonus"
 value	= 25
@@ -1681,6 +1708,24 @@
       "UnitClass", "Sea", "Local"
     }
 
+[effect_lighthouse_trireme_move]
+name	= "Move_Bonus"
+value	= 1
+reqs	=
+    { "type", "name", "range"
+      "Building", "Lighthouse", "Player"
+      "UnitClass", "Trireme", "Local"
+    }
+
+[effect_lighthouse_trireme_veteran]
+name	= "Veteran_Build"
+value	= 1
+reqs	=
+    { "type", "name", "range"
+      "Building", "Lighthouse", "Player"
+      "UnitClass", "Trireme", "Local"
+    }
+
 [effect_magellans_expedition]
 name	= "Move_Bonus"
 value	= 2
@@ -1690,6 +1735,15 @@
       "UnitClass", "Sea", "Local"
     }
 
+[effect_magellan_trireme]
+name	= "Move_Bonus"
+value	= 2
+reqs	=
+    { "type", "name", "range"
+      "Building", "Magellan's Expedition", "Player"
+      "UnitClass", "Trireme", "Local"
+    }
+
 [effect_manhattan_project]
 name	= "Enable_Nuke"
 value	= 1
Index: data/default/units.ruleset
===================================================================
--- data/default/units.ruleset	(revision 12631)
+++ data/default/units.ruleset	(working copy)
@@ -99,6 +99,13 @@
 hp_loss_pct   = 0
 flags         = "TerrainSpeed", "DamageSlows"
 
+[unitclass_trireme]
+name          = _("Trireme")
+move_type     = "Sea"
+min_speed     = 2
+hp_loss_pct   = 0
+flags         = "TerrainSpeed", "DamageSlows"
+
 [unitclass_heli]
 name          = _("Helicopter")
 move_type     = "Both"
@@ -1186,7 +1193,7 @@
 
 [unit_trireme]
 name          = _("Trireme")
-class         = "Sea"
+class         = "Trireme"
 tech_req      = "Map Making"
 obsolete_by   = "Caravel"
 graphic       = "u.trireme"
@@ -1210,7 +1217,7 @@
 uk_food       = 0
 uk_gold       = 0
 cargo         = "Land"
-flags         = "Trireme", "BadCityDefender"
+flags         = "BadCityDefender"
 roles         = "Ferryboat"
 
 [unit_caravel]
Index: data/default/terrain.ruleset
===================================================================
--- data/default/terrain.ruleset	(revision 12631)
+++ data/default/terrain.ruleset	(working copy)
@@ -216,6 +216,45 @@
  work with.\
 ")
 
+[terrain_deep_ocean]
+name                 = _("Deep Ocean")
+graphic              = "deep"
+graphic_alt	     = "ocean"
+identifier	     = " "
+movement_cost        = 1
+defense_bonus        = 0
+food                 = 1
+shield               = 0
+trade                = 2
+resources            = "Fish", "Whales"
+road_trade_incr      = 0
+road_time            = 0
+irrigation_result    = "no"
+irrigation_food_incr = 0
+irrigation_time      = 0
+mining_result        = "no"
+mining_shield_incr   = 0
+mining_time          = 0
+transform_result     = "Ocean"
+transform_time       = 36
+rail_time            = 3
+airbase_time         = 3
+fortress_time        = 3
+clean_pollution_time = 3
+clean_fallout_time   = 3
+warmer_wetter_result = "no"
+warmer_drier_result  = "no"
+cooler_wetter_result = "no"
+cooler_drier_result  = "no"
+native_to            = "Sea", "Air", "Missile", "Helicopter"
+flags                = "Oceanic", "NoPollution", "UnsafeCoast", "NoCities"
+property_ocean_depth = 80
+helptext	     = _("\
+Oceans cover much of the world, and only sea units can travel on them.\
+\n\n\
+Ocean squares can never be polluted or subjected to fallout.\
+")
+
 [terrain_desert]
 name                 = _("Desert")
 graphic              = "desert"
@@ -453,7 +492,7 @@
 name                 = _("Ocean")
 graphic              = "ocean"
 graphic_alt	     = "-"
-identifier	     = " "
+identifier	     = "_"
 movement_cost        = 1
 defense_bonus        = 0
 food                 = 1
@@ -479,9 +518,9 @@
 warmer_drier_result  = "no"
 cooler_wetter_result = "no"
 cooler_drier_result  = "no"
-native_to            = "Sea", "Air", "Missile", "Helicopter"
+native_to            = "Sea", "Trireme", "Air", "Missile", "Helicopter"
 flags                = "Oceanic", "NoPollution", "UnsafeCoast", "NoCities"
-property_ocean_depth = 10
+property_ocean_depth = 30
 helptext	     = _("\
 Oceans cover much of the world, and only sea units (Triremes and\
  other boats) can travel on them.\
Index: data/isotrident.tilespec
===================================================================
--- data/isotrident.tilespec	(revision 12631)
+++ data/isotrident.tilespec	(working copy)
@@ -149,6 +149,7 @@
 
 [terrain_deep]
 is_blended = 0
+is_reversed = 1
 num_layers = 1
 layer0_match_style = "bool"
 layer0_match_type = "ocean"
Index: common/unittype.c
===================================================================
--- common/unittype.c	(revision 12631)
+++ common/unittype.c	(working copy)
@@ -48,7 +48,7 @@
   "TradeRoute" ,"HelpWonder", "IgZOC", "NonMil", "IgTer", 
   "OneAttack", "Pikemen", "Horse", "IgWall", "FieldUnit", 
   "AEGIS", "AttackAny", "Marines", "Partial_Invis", "Settlers", "Diplomat",
-  "Trireme", "Nuclear", "Spy", "Transform", "Paratroopers",
+  "Nuclear", "Spy", "Transform", "Paratroopers",
   "Airbase", "Cities", "No_Land_Attack",
   "AddToCity", "Fanatic", "GameLoss", "Unique", "Unbribable", 
   "Undisbandable", "SuperSpy", "NoHome", "NoVeteran", "Bombarder",
Index: common/tech.c
===================================================================
--- common/tech.c	(revision 12631)
+++ common/tech.c	(working copy)
@@ -42,7 +42,7 @@
 static const char *flag_names[] = {
   "Bonus_Tech", "Bridge", "Railroad", "Fortress",
   "Population_Pollution_Inc", 
-  "Airbase", "Farmland", "Reduce_Trireme_Loss1", "Reduce_Trireme_Loss2", 
+  "Airbase", "Farmland",
   "Build_Airborne"
 };
 /* Note that these strings must correspond with the enums in tech_flag_id,
Index: common/unit.h
===================================================================
--- common/unit.h	(revision 12631)
+++ common/unit.h	(working copy)
@@ -73,7 +73,7 @@
   MR_BAD_ACTIVITY, MR_BAD_DESTINATION, MR_BAD_MAP_POSITION,
   MR_DESTINATION_OCCUPIED_BY_NON_ALLIED_UNIT,
   MR_NO_TRANSPORTER_CAPACITY,
-  MR_DESTINATION_OCCUPIED_BY_NON_ALLIED_CITY, MR_TRIREME
+  MR_DESTINATION_OCCUPIED_BY_NON_ALLIED_CITY
 };
 
 enum add_build_city_result {
Index: common/unittype.h
===================================================================
--- common/unittype.h	(revision 12631)
+++ common/unittype.h	(working copy)
@@ -75,7 +75,6 @@
   F_PARTIAL_INVIS,    /* Invisibile except when adjacent (Submarine) */   
   F_SETTLERS,         /* Does not include ability to found cities */
   F_DIPLOMAT,    
-  F_TRIREME,          /* Trireme sinking effect */
   F_NUCLEAR,          /* Nuclear attack effect */
   F_SPY,              /* Enhanced spy abilities */
   F_TRANSFORM,        /* Can transform terrain types (Engineers) */
Index: common/tech.h
===================================================================
--- common/tech.h	(revision 12631)
+++ common/tech.h	(working copy)
@@ -59,8 +59,6 @@
   TF_POPULATION_POLLUTION_INC,  /* Increase the pollution factor created by popultaion by one */
   TF_AIRBASE,   /* "Airbase" unit types can build Airbases */
   TF_FARMLAND,  /* "Settler" unit types can build farmland */
-  TF_REDUCE_TRIREME_LOSS1, /* Reduces chance of Trireme being lost at sea */
-  TF_REDUCE_TRIREME_LOSS2, /* Reduces chance of Trireme being lost at sea */
   TF_BUILD_AIRBORNE, /* Player can build air units */
   TF_LAST
 };
Index: common/packets.def
===================================================================
--- common/packets.def	(revision 12631)
+++ common/packets.def	(working copy)
@@ -1092,7 +1092,6 @@
   UINT8 default_specialist;
 
   TECH_LIST global_init_techs[MAX_NUM_TECH_LIST];
-  UINT8 trireme_loss_chance[MAX_VET_LEVELS];
   UINT8 work_veteran_chance[MAX_VET_LEVELS];
   UINT8 veteran_chance[MAX_VET_LEVELS];
 end
Index: common/aicore/pf_tools.c
===================================================================
--- common/aicore/pf_tools.c	(revision 12631)
+++ common/aicore/pf_tools.c	(working copy)
@@ -38,11 +38,7 @@
                                    const struct tile *src_tile,
                                    const struct tile *dest_tile)
 {
-  if (!dest_tile->city
-      && BV_ISSET(param->unit_flags, F_TRIREME)
-      && !is_safe_ocean(dest_tile)) {
-    return PF_IMPOSSIBLE_MC;
-  } else if (unit_class_flag(param->class, UCF_TERRAIN_SPEED)) {
+  if (unit_class_flag(param->class, UCF_TERRAIN_SPEED)) {
     return map_move_cost(src_tile, dest_tile);
   } else {
     return SINGLE_MOVE;
Index: common/movement.c
===================================================================
--- common/movement.c	(revision 12631)
+++ common/movement.c	(working copy)
@@ -169,11 +169,6 @@
     return TRUE;
   }
 
-  /* A trireme unit cannot exist in an ocean tile without access to land. */
-  if (unit_flag(punit, F_TRIREME) && !is_safe_ocean(ptile)) {
-    return FALSE;
-  }
-
   return is_native_tile(punit->type, ptile);
 }
 
@@ -379,7 +374,6 @@
     6) There are no peaceful but un-allied units on the target tile.
     7) There is not a peaceful but un-allied city on the target tile.
     8) There is no non-allied unit blocking (zoc) [or igzoc is true].
-    9) Triremes cannot move out of sight from land.
 **************************************************************************/
 enum unit_move_result test_unit_move_to_tile(const struct unit_type *punittype,
 					     const struct player *unit_owner,
@@ -458,11 +452,6 @@
     return MR_ZOC;
   }
 
-  /* 9) */
-  if (unit_type_flag(punittype, F_TRIREME) && !is_safe_ocean(dst_tile)) {
-    return MR_TRIREME;
-  }
-
   return MR_OK;
 }
 
Index: common/effects.c
===================================================================
--- common/effects.c	(revision 12631)
+++ common/effects.c	(working copy)
@@ -61,7 +61,6 @@
   /* TODO: "Make_Content_Pct", */
   "Make_Happy",
   "No_Anarchy",
-  "No_Sink_Deep",
   "Nuke_Proof",
   /* TODO: "Pollu_Adj", */
   /* TODO: "Pollu_Pct", */
Index: common/packets_gen.c
===================================================================
--- common/packets_gen.c	(revision 12631)
+++ common/packets_gen.c	(working copy)
@@ -22378,7 +22378,7 @@
 
 #define cmp_packet_ruleset_game_100 cmp_const
 
-BV_DEFINE(packet_ruleset_game_100_fields, 5);
+BV_DEFINE(packet_ruleset_game_100_fields, 4);
 
 static struct packet_ruleset_game *receive_packet_ruleset_game_100(struct connection *pc, enum packet_type type)
 {
@@ -22423,7 +22423,7 @@
       int readin;
     
       dio_get_uint8(&din, &readin);
-      real_packet->trireme_loss_chance[i] = readin;
+      real_packet->work_veteran_chance[i] = readin;
     }
       }
     }
@@ -22438,21 +22438,6 @@
       int readin;
     
       dio_get_uint8(&din, &readin);
-      real_packet->work_veteran_chance[i] = readin;
-    }
-      }
-    }
-  }
-  if (BV_ISSET(fields, 4)) {
-    
-    {
-      int i;
-    
-      for (i = 0; i < MAX_VET_LEVELS; i++) {
-        {
-      int readin;
-    
-      dio_get_uint8(&din, &readin);
       real_packet->veteran_chance[i] = readin;
     }
       }
@@ -22518,7 +22503,7 @@
       if(!differ) {
         int i;
         for (i = 0; i < MAX_VET_LEVELS; i++) {
-          if (old->trireme_loss_chance[i] != real_packet->trireme_loss_chance[i]) {
+          if (old->work_veteran_chance[i] != real_packet->work_veteran_chance[i]) {
             differ = TRUE;
             break;
           }
@@ -22534,7 +22519,7 @@
       if(!differ) {
         int i;
         for (i = 0; i < MAX_VET_LEVELS; i++) {
-          if (old->work_veteran_chance[i] != real_packet->work_veteran_chance[i]) {
+          if (old->veteran_chance[i] != real_packet->veteran_chance[i]) {
             differ = TRUE;
             break;
           }
@@ -22544,22 +22529,6 @@
   if(differ) {different++;}
   if(differ) {BV_SET(fields, 3);}
 
-
-    {
-      differ = (MAX_VET_LEVELS != MAX_VET_LEVELS);
-      if(!differ) {
-        int i;
-        for (i = 0; i < MAX_VET_LEVELS; i++) {
-          if (old->veteran_chance[i] != real_packet->veteran_chance[i]) {
-            differ = TRUE;
-            break;
-          }
-        }
-      }
-    }
-  if(differ) {different++;}
-  if(differ) {BV_SET(fields, 4);}
-
   if (different == 0 && !force_send_of_unchanged) {
     return 0;
   }
@@ -22578,7 +22547,7 @@
       int i;
 
       for (i = 0; i < MAX_VET_LEVELS; i++) {
-        dio_put_uint8(&dout, real_packet->trireme_loss_chance[i]);
+        dio_put_uint8(&dout, real_packet->work_veteran_chance[i]);
       }
     } 
   }
@@ -22588,16 +22557,6 @@
       int i;
 
       for (i = 0; i < MAX_VET_LEVELS; i++) {
-        dio_put_uint8(&dout, real_packet->work_veteran_chance[i]);
-      }
-    } 
-  }
-  if (BV_ISSET(fields, 4)) {
-  
-    {
-      int i;
-
-      for (i = 0; i < MAX_VET_LEVELS; i++) {
         dio_put_uint8(&dout, real_packet->veteran_chance[i]);
       }
     } 
Index: common/effects.h
===================================================================
--- common/effects.h	(revision 12631)
+++ common/effects.h	(working copy)
@@ -48,7 +48,6 @@
   /* TODO: EFT_MAKE_CONTENT_PCT, */
   EFT_MAKE_HAPPY,
   EFT_NO_ANARCHY,
-  EFT_NO_SINK_DEEP,
   EFT_NUKE_PROOF,
   /* TODO: EFT_POLLU_ADJ, */
   /* TODO: EFT_POLLU_PCT, */
Index: common/packets_gen.h
===================================================================
--- common/packets_gen.h	(revision 12631)
+++ common/packets_gen.h	(working copy)
@@ -803,7 +803,6 @@
 struct packet_ruleset_game {
   int default_specialist;
   int global_init_techs[MAX_NUM_TECH_LIST];
-  int trireme_loss_chance[MAX_VET_LEVELS];
   int work_veteran_chance[MAX_VET_LEVELS];
   int veteran_chance[MAX_VET_LEVELS];
 };
Index: common/map.c
===================================================================
--- common/map.c	(revision 12631)
+++ common/map.c	(working copy)
@@ -548,20 +548,6 @@
   return count_terrain_flag_near_tile(ptile, TRUE, FALSE, TER_OCEANIC) > 0;
 }
 
-/****************************************************************************
-  Return TRUE if this ocean terrain is adjacent to a safe coastline.
-****************************************************************************/
-bool is_safe_ocean(const struct tile *ptile)
-{
-  adjc_iterate(ptile, adjc_tile) {
-    if (adjc_tile->terrain != T_UNKNOWN
-        && !terrain_has_flag(adjc_tile->terrain, TER_UNSAFE_COAST)) {
-      return TRUE;
-    }
-  } adjc_iterate_end;
-  return FALSE;
-}
-
 /***************************************************************
 ...
 ***************************************************************/
Index: common/game.h
===================================================================
--- common/game.h	(revision 12631)
+++ common/game.h	(working copy)
@@ -112,7 +112,6 @@
     bool save_private_map; /* FoW map; will be created if not saved */
   } save_options;
 
-  int trireme_loss_chance[MAX_VET_LEVELS];
   int work_veteran_chance[MAX_VET_LEVELS];
   int veteran_chance[MAX_VET_LEVELS];
 
Index: common/map.h
===================================================================
--- common/map.h	(revision 12631)
+++ common/map.h	(working copy)
@@ -246,7 +246,6 @@
 int map_move_cost_unit(struct unit *punit, const struct tile *ptile);
 int map_move_cost_ai(const struct tile *tile0, const struct tile *tile1);
 int map_move_cost(const struct tile *src_tile, const struct tile *dst_tile);
-bool is_safe_ocean(const struct tile *ptile);
 bool is_cardinally_adj_to_ocean(const struct tile *ptile);
 bv_special get_tile_infrastructure_set(const struct tile *ptile,
 					  int *count);
Index: ai/aiexplorer.c
===================================================================
--- ai/aiexplorer.c	(revision 12631)
+++ ai/aiexplorer.c	(working copy)
@@ -62,51 +62,6 @@
   return 50 + (50 / map.num_valid_dirs * (ocean - land));
 }
 
-/***************************************************************
-Is a tile likely to be coastline, given information that the 
-player actually has.
-***************************************************************/
-static bool is_likely_coastline(struct tile *ptile, struct player *pplayer)
-{
-  int likely = 50;
-  int t;
-
-  adjc_iterate(ptile, ptile1) {
-    if ((t = likely_ocean(ptile1, pplayer)) == 0) {
-      return TRUE;
-    }
-    /* If all t values are 50, likely stays at 50. If all approach zero,
-     * ie are unlikely to be ocean, the tile is likely to be coastline, so
-     * likely will approach 100. If all approach 100, likely will 
-     * approach zero. */
-    likely += (50 - t) / map.num_valid_dirs;
-    
-  } adjc_iterate_end;
-
-  return (likely > 50);
-}
-
-/***************************************************************
-Is there a chance that a trireme would be lost, given information that 
-the player actually has.
-***************************************************************/
-static bool is_likely_trireme_loss(struct tile *ptile, struct player *pplayer, 
-                             	   struct unit *punit)
-{
-  /*
-   * If we are in a city or next to land, we have no chance of losing
-   * the ship.  To make this really useful for ai planning purposes, we'd
-   * need to confirm that we can exist/move at the x,y location we are given.
-   */
-  if ((likely_ocean(ptile, pplayer) < 50) || 
-      is_likely_coastline(ptile, pplayer) ||
-      get_unit_bonus(punit, EFT_NO_SINK_DEEP) > 0) {
-    return FALSE;
-  } else {
-    return TRUE;
-  }
-}
-
 /**************************************************************************
 Return a value indicating how desirable it is to explore the given tile.
 In general, we want to discover unknown terrain of the opposite kind to
@@ -158,18 +113,6 @@
   int desirable = 0;
   int unknown = 0;
 
-  /* First do some checks that would make a tile completely non-desirable.
-   * If we're a trireme and we could die at the given tile, or if there
-   * is a city on the tile, or if the tile is not accessible, or if the 
-   * tile is on a different continent, or if we're a barbarian and
-   * the tile has a hut, don't go there. */
-  if ((unit_flag(punit, F_TRIREME) && 
-       is_likely_trireme_loss(ptile, pplayer, punit))
-      || tile_get_city(ptile)
-      || (is_barbarian(pplayer) && tile_has_special(ptile, S_HUT))) {
-    return 0;
-  }
-
   /* What value we assign to the number of land and water tiles
    * depends on if we're a land or water unit. */
   if (is_ground_unit(punit)) {
@@ -357,19 +300,6 @@
 	UNIT_LOG(LOG_DEBUG, punit, "recursively exploring...");
 	return ai_manage_explorer(punit);          
       } else {
-	/* Something went wrong. What to do but return?
-	 * Answer: if we're a trireme we could get to this point,
-	 * but only with a non-full complement of movement points,
-	 * in which case the goto code is simply requesting a
-	 * one turn delay (the next tile we would occupy is not safe).
-	 * In that case, we should just wait. */
-        if (unit_flag(punit, F_TRIREME) 
-            && (punit->moves_left != unit_move_rate(punit))) {
-          /* we're a trireme with non-full complement of movement points,
-           * so wait until next turn. */
-	  UNIT_LOG(LOG_DEBUG, punit, "done exploring (had to hold)...");
-          return TRUE;
-        }
 	UNIT_LOG(LOG_DEBUG, punit, "done exploring (all finished)...");
 	return FALSE;
       }
Index: ai/aitools.c
===================================================================
--- ai/aitools.c	(revision 12631)
+++ ai/aitools.c	(working copy)
@@ -544,10 +544,6 @@
   const double p_killed = chance_killed_at(ptile, risk_cost, param);
   double danger = value * p_killed;
 
-  if (is_ocean(ptile->terrain) && !is_safe_ocean(ptile)) {
-    danger += risk_cost->ocean_cost;
-  }
-
   /* Adjust for the fact that we might not stop at this tile,
    * and for our fearfulness */
   risk += danger * risk_cost->fearfulness;
Index: ai/aitools.h
===================================================================
--- ai/aitools.h	(revision 12631)
+++ ai/aitools.h	(working copy)
@@ -47,7 +47,6 @@
 {
   double base_value;
   double fearfulness;
-  double ocean_cost;
   double unsafe_terrain_cost;
   double enemy_zoc_cost;
 };
Index: ai/aicity.c
===================================================================
--- ai/aicity.c	(revision 12631)
+++ ai/aicity.c	(working copy)
@@ -462,9 +462,6 @@
   case EFT_REVEAL_CITIES:
   case EFT_NO_ANARCHY:
     break;  /* Useless for AI */
-  case EFT_NO_SINK_DEEP:
-    v += 15 + ai->stats.units.triremes * 5;
-    break;
   case EFT_NUKE_PROOF:
     if (ai->threats.nuclear) {
       v += pcity->size * unit_list_size(pcity->tile->units) * (capital + 1)
@@ -1413,13 +1410,8 @@
     }
     if (punittype) {
       int cost = unit_upgrade_price(pplayer, punit->type, punittype);
-      int real_limit = limit;
 
-      /* Triremes are DANGEROUS!! We'll do anything to upgrade 'em. */
-      if (unit_flag(punit, F_TRIREME)) {
-        real_limit = pplayer->ai.est_upkeep;
-      }
-      if (pplayer->economic.gold - cost > real_limit) {
+      if (pplayer->economic.gold - cost > limit) {
         CITY_LOG(LOG_BUY, pcity, "Upgraded %s to %s for %d (%s)",
                  unit_type(punit)->name, punittype->name, cost,
                  military ? "military" : "civilian");
Index: ai/aidata.c
===================================================================
--- ai/aidata.c	(revision 12631)
+++ ai/aidata.c	(working copy)
@@ -202,9 +202,6 @@
       break;
     }
 
-    if (unit_flag(punit, F_TRIREME)) {
-      ai->stats.units.triremes++;
-    }
     if (unit_class_flag(get_unit_class(unit_type(punit)), UCF_MISSILE)) {
       ai->stats.units.missiles++;
     }
Index: ai/aidata.h
===================================================================
--- ai/aidata.h	(revision 12631)
+++ ai/aidata.h	(working copy)
@@ -110,7 +110,7 @@
     /* Counts of specific types of units. */
     struct {
       /* Unit-flag counts. */
-      int triremes, missiles;
+      int missiles;
 
       /* Move-type counts (air includes helicoptor here). */
       int land, sea, air;
Index: ai/aiunit.c
===================================================================
--- ai/aiunit.c	(revision 12631)
+++ ai/aiunit.c	(working copy)
@@ -1066,11 +1066,6 @@
       int boatspeed = boattype->move_rate;
       int move_time = (WARMAP_SEACOST(acity->tile)) / boatspeed;
       
-      if (unit_type_flag(boattype, F_TRIREME) && move_time > 2) {
-        /* FIXME: Should also check for LIGHTHOUSE */
-        /* Return something prohibitive */
-        return 999;
-      }
       if (boat) {
         /* Time to get to the boat */
         move_time += (WARMAP_COST(boat->tile) + speed - 1) / speed;
Index: client/packhand.c
===================================================================
--- client/packhand.c	(revision 12631)
+++ client/packhand.c	(working copy)
@@ -2590,7 +2590,6 @@
   DEFAULT_SPECIALIST = packet->default_specialist;
 
   for (i = 0; i < MAX_VET_LEVELS; i++) {
-    game.trireme_loss_chance[i] = packet->trireme_loss_chance[i];
     game.work_veteran_chance[i] = packet->work_veteran_chance[i];
     game.veteran_chance[i] = packet->work_veteran_chance[i];
   }
Index: client/helpdata.c
===================================================================
--- client/helpdata.c	(revision 12631)
+++ client/helpdata.c	(working copy)
@@ -1007,23 +1007,6 @@
     sprintf(buf + strlen(buf),
 	    _("* May become veteran through training or combat.\n"));
   }
-  if (unit_type_flag(utype, F_TRIREME)) {
-    Tech_type_id tech1 = find_tech_by_flag(0, TF_REDUCE_TRIREME_LOSS1);
-    Tech_type_id tech2 = find_tech_by_flag(0, TF_REDUCE_TRIREME_LOSS2);
-    sprintf(buf + strlen(buf),
-	    _("* Must end turn in a city or next to land,"
-	      " or has a 50%% risk of being lost at sea.\n"));
-    if (tech1 != A_LAST) {
-      sprintf(buf + strlen(buf),
-	      _("* The discovery of %s reduces the risk to 25%%.\n"),
-	      get_tech_name(game.player_ptr, tech1));
-    }
-    if (tech2 != A_LAST) {
-      sprintf(buf + strlen(buf),
-	      _("* %s reduces the risk to 12%%.\n"),
-	      get_tech_name(game.player_ptr, tech2));
-    }
-  }
   if (utype->fuel > 0) {
     char allowed_units[10][64];
     int num_allowed_units = 0;
@@ -1135,12 +1118,6 @@
 				 "an immediate advance.\n"),
 	    get_tech_name(game.player_ptr, i));
   }
-  if (tech_flag(i, TF_REDUCE_TRIREME_LOSS1))
-    sprintf(buf + strlen(buf), _("* Reduces the chance of losing boats "
-				 "on the high seas to 25%%.\n"));
-  if (tech_flag(i, TF_REDUCE_TRIREME_LOSS2))
-    sprintf(buf + strlen(buf), _("* Reduces the chance of losing boats "
-				 "on the high seas to 12%%.\n"));
   if (tech_flag(i, TF_POPULATION_POLLUTION_INC))
     sprintf(buf + strlen(buf), _("* Increases the pollution generated by "
 				 "the population.\n"));
Index: client/tilespec.c
===================================================================
--- client/tilespec.c	(revision 12644)
+++ client/tilespec.c	(working copy)
@@ -106,6 +106,7 @@
   } layer[MAX_NUM_LAYERS];
 
   bool is_blended;
+  bool is_reversed;
   struct sprite *blend[4]; /* indexed by a direction4 */
 
   struct sprite *mine;
@@ -1444,6 +1445,9 @@
     terr->name = mystrdup(terrains[i] + strlen("terrain_"));
     terr->is_blended = secfile_lookup_bool(file, "%s.is_blended",
 					    terrains[i]);
+    terr->is_reversed = secfile_lookup_bool_default(file, FALSE,
+						    "%s.is_reversed",
+						    terrains[i]);
     terr->num_layers = secfile_lookup_int(file, "%s.num_layers",
 					  terrains[i]);
     terr->num_layers = CLIP(1, terr->num_layers, MAX_NUM_LAYERS);
@@ -2595,6 +2599,7 @@
 {
   struct terrain_drawing_data *draw;
   char buffer1[MAX_LEN_NAME + 20];
+  char buffer2[MAX_LEN_NAME + 20];
   int i, l;
   
   if (pterrain->name[0] == '\0') {
@@ -2668,13 +2673,19 @@
 	      assert(0); /* Impossible. */
 	      break;
 	    case MATCH_BOOLEAN:
-	      my_snprintf(buffer1, sizeof(buffer1), "t.%s_cell_%c%d%d%d",
+	      my_snprintf(buffer1, sizeof(buffer1), "t.l%d.%s_cell_%c%d%d%d",
+			  l,
 			  draw->name, dirs[dir],
 			  (value >> 0) & 1,
 			  (value >> 1) & 1,
 			  (value >> 2) & 1);
+	      my_snprintf(buffer2, sizeof(buffer2), "t.%s_cell_%c%d%d%d",
+			  draw->name, dirs[dir],
+			  (value >> 0) & 1,
+			  (value >> 1) & 1,
+			  (value >> 2) & 1);
 	      draw->layer[l].cells[i]
-		= lookup_sprite_tag_alt(t, buffer1, "", TRUE, "tile_type",
+		= lookup_sprite_tag_alt(t, buffer1, buffer2, TRUE, "tile_type",
 					pterrain->name);
 	      break;
 	    case MATCH_FULL:
@@ -3539,7 +3550,7 @@
 ****************************************************************************/
 static int fill_terrain_sprite_array(struct tileset *t,
 				     struct drawn_sprite *sprs,
-				     int layer,
+				     int layer_num,
 				     const struct tile *ptile,
 				     struct terrain **tterrain_near)
 {
@@ -3547,7 +3558,7 @@
   struct sprite *sprite;
   struct terrain *pterrain = ptile->terrain;
   struct terrain_drawing_data *draw = t->sprites.terrain[pterrain->index];
-  const int l = layer;
+  const int l = (draw->is_reversed ? (draw->num_layers - layer_num - 1) : layer_num);
   int i, tileno;
   struct tile *adjc_tile;
 
@@ -3559,7 +3570,7 @@
   /* FIXME: this should avoid calling load_sprite since it's slow and
    * increases the refcount without limit. */
   if (ptile->spec_sprite && (sprite = load_sprite(t, ptile->spec_sprite))) {
-    if (layer == 0) {
+    if (l == 0) {
       ADD_SPRITE_SIMPLE(sprite);
       return 1;
     } else {
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to