Author: jtn
Date: Mon Jan 25 19:35:35 2016
New Revision: 31604

URL: http://svn.gna.org/viewcvs/freeciv?rev=31604&view=rev
Log:
Improvements to tutorial scenario: explain what to do with boats, and
warn about killstack.

See gna patch #2911.

Modified:
    branches/S2_5/data/scenarios/tutorial.sav

Modified: branches/S2_5/data/scenarios/tutorial.sav
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/data/scenarios/tutorial.sav?rev=31604&r1=31603&r2=31604&view=diff
==============================================================================
--- branches/S2_5/data/scenarios/tutorial.sav   (original)
+++ branches/S2_5/data/scenarios/tutorial.sav   Mon Jan 25 19:35:35 2016
@@ -2,7 +2,8 @@
 [scenario]
 is_scenario=TRUE
 name=_("Tutorial")
-description=_("Play this tutorial scenario to get an introduction to Freeciv.")
+description=_("Play this tutorial scenario to get an introduction to Freeciv.\
+ This is intended for single-player games.")
 
 [savefile]
 options=" +version2"
@@ -65,6 +66,11 @@
   return (tile.terrain.id == find.terrain(terrain_name).id)
 end
 
+-- TODO:
+-- Hint to check science after building 1st city?
+-- Words for first military unit?
+-- Hint to build workers?
+
 function turn_callback(turn, year)
   if turn == 0 then
     notify.event(nil, nil, E.SCRIPT,
@@ -73,8 +79,36 @@
 end
 signal.connect('turn_started', 'turn_callback')
 
+-- Check for and warn about vulnerable stacks.
+function check_stacks(tile, player)
+  if not vuln_stack_warning
+     and server.setting.get("killstack") == "ENABLED"
+     and not (tile:city()
+              or tile:has_base('Fortress') or tile:has_base('Airbase')) then
+    n_our_units = 0
+    for unit in tile:units_iterate() do
+      if unit.owner == player then
+        n_our_units = n_our_units + 1
+      end
+    end
+    -- Do not complain about 2 units, as that is a common defensive
+    -- formation: civilian plus bodyguard
+    if n_our_units >= 3 then
+      notify.event(player, tile, E.SCRIPT,
+_("Outside of a city, or a fortress or airbase, if a 'stack' of units\n\
+on a single tile is attacked, the strongest unit defends; and if that\n\
+unit is defeated, ALL of the units on the tile are killed.  Therefore,\n\
+it's often a good idea to spread units out, avoiding 'stacks' of units\n\
+like this, particularly on land."))
+      vuln_stack_warning = true
+    end
+  end
+end
+vuln_stack_warning = false
+
 function unit_moved_callback(unit, src_tile, dst_tile)
   if unit.owner:is_human() then
+    check_stacks(dst_tile, unit.owner)
     if citiesbuilt == 0
       and has_unit_type_name(unit, 'Settlers')
       and (has_tile_terrain_name(dst_tile, 'Grassland')
@@ -96,7 +130,7 @@
 _("Congratulations, you have founded your second city.  This city will\nbehave 
almost exactly like the first one - it will be slightly different\nbecause of 
the terrain around it.  You probably want to build\nsettlers here too."))
     elseif citiesbuilt == 2 then
       notify.event(city.owner, city.tile, E.SCRIPT,
-_("You have built your third city!  Your civilization seems to be\nthriving.  
It might be time to think about a military.  Pick one of\nthe cities that has a 
high production, and convert it into a military\nbase. Build a Barracks there 
first, then start work on a military\nunit.  Pick the best unit you have 
available - at the beginning of\nthe game, Warriors will be the only choice, 
but soon you will have \nplenty of options.\n\nThis might also be a good time 
to use the worklist feature of the\ncity dialog production report.  Click on 
Barracks, then click Change\nto begin building them.  Then double-click on a 
military unit to\nappend it to the worklist.  As soon as the Barracks are 
complete the\ncity will automatically switch over to producing the unit."))
+_("You have built your third city!  Your civilization seems to be\nthriving.  
It might be time to think about a military.  Pick one of\nthe cities that has a 
high production, and turn it into a military\ncenter.  Build a Barracks there 
first, then start work on a military\nunit.  Pick the best unit you have 
available - at the beginning of\nthe game, Warriors will be the only choice, 
but soon you will have\nplenty of options.\n\nThis might also be a good time to 
use the worklist feature of the\ncity dialog production report.  Click on 
Barracks, then click Change\nto begin building them.  Then double-click on a 
military unit to\nappend it to the worklist.  As soon as the Barracks are 
complete the\ncity will automatically switch over to producing the unit."))
     elseif citiesbuilt == 3 then
       notify.event(city.owner, city.tile, E.SCRIPT,
 _("Another city!  You are really getting the hang of this.  You\nprobably have 
a pretty good idea what to do with new cities by\nnow.  Take a moment to look 
at the bar below the city on the map\nview.  This display shows some useful 
information about the city.\nThe flag and background color indicate what 
civilization the city\nbelongs to (this will be useful when you meet other 
civilizations).\nThe top row of the bar also shows the name and size of the 
city, and\nwill show one or more stars to indicate if there are units in 
the\ncity.  The bottom row shows what the city is building, and how long 
it\nwill take; it also shows how long the city will take to grow to the\nnext 
largest size."))
@@ -118,7 +152,7 @@
       growth2msg = true
     elseif size == 3 and not growth3msg then
       notify.event(city.owner, city.tile, E.SCRIPT,
-_("Your city has grown again!  Now with three citizens you have\na fair amount 
of choice over where the city should focus its\nresources.  A city with three 
citizens gets to work three\ndifferent tiles, in addition to its center tile 
which is worked\nfor free.  In the city dialog, the map shows which tiles are 
worked\nand how much food, shields, and trade each provides.  Food is used\nto 
grow your city, shields are used for production of buildings\nand units, while 
trade provides taxable revenue that can be\nturned into science research, gold, 
or luxuries.\n\nClick on a worked tile to remove the citizen from that tile.  
Then\nclick on an unworked tile to place a citizen there.  You may place\nup to 
three citizens on tiles, of course.  The remaining citizens are\nall 
specialists - right now they are all entertainers which provide\nonly luxuries 
(which will not be useful until later)."))
+_("Your city has grown again!  Now with three citizens you have\na fair amount 
of choice over where the city should focus its\nresources.  A city with three 
citizens gets to work three\ndifferent tiles, in addition to its center tile 
which is worked\nfor free.  In the city dialog, the map shows which tiles are 
worked\nand how much food, shields, and trade each provides.  Food is used\nto 
grow your city, shields are used for production of buildings\nand units, while 
trade provides taxable revenue that can be\nturned into science research, gold, 
or luxuries.\n\nClick on a worked tile to remove the citizen from that tile.  
Then\nclick on an unworked tile to place a citizen there.  You may place\nup to 
three citizens on tiles, of course.  The remaining citizens are\nall 
specialists - by default they are all entertainers which provide\nonly luxuries 
(which will not be useful until later)."))
       growth3msg = true
     elseif size == 5 and not growth5msg then
       notify.event(city.owner, city.tile, E.SCRIPT,
@@ -160,9 +194,29 @@
 _("Your second Settlers should also be used to build a new city.\nNotice how 
when you move the Settlers away from your existing cities\nan outline is drawn 
around them.  This shows the area that would be\ncovered by a city built at 
this location; it fits in with the outline\nalready on the map view that shows 
which tiles are covered by your\nexisting cities.  Generally when building new 
cities you want to make\nsure that all tiles are covered by at least one city, 
but after that\nit is best that your cities overlap as little as possible.  
Spreading\nout cities properly gives each city access to more resources, 
allowing\nthem to grow to larger sizes."))
     end
     settlersbuilt = settlersbuilt + 1
+  elseif has_unit_type_name(unit, 'Trireme')
+    or has_unit_type_name(unit, 'Caravel')
+    or has_unit_type_name(unit, 'Frigate')
+    or has_unit_type_name(unit, 'Galleon')
+    or has_unit_type_name(unit, 'Transport') then
+    -- Let us assume that if they do not build any early boats, they
+    -- will not survive long enough to reach Submarine/Carrier
+    if boatsbuilt == 0 then
+      notify.event(unit.owner, unit.tile, E.SCRIPT,
+_("You have built your first waterborne unit.  These can transport\n\
+other units across water, allowing you to explore and settle new\n\
+lands.  You can load land units onto your boat in one of two ways.\n\
+When your boat and the unit you want to transport are in the same\n\
+city, select the latter and press L to load the unit; or if the boat\n\
+is adjacent to a land tile, you can move the unit from there onto the\n\
+boat.  When you want to disembark, select the transported unit and\n\
+press U, or move it onto a land tile."))
+    end
+    boatsbuilt = boatsbuilt + 1
   end
 end
 settlersbuilt = 0
+boatsbuilt = 0
 signal.connect('unit_built', 'unit_built_callback')
 
 function building_built_callback(building, city)


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to