From 08c2582d961747e2b5b35fddea13ebb6c8a2acb6 Mon Sep 17 00:00:00 2001
From: Kalle Olavi Niemitalo <kon@iki.fi>
Date: Mon, 1 Mar 2010 02:41:49 +0200
Subject: [PATCHv4 6/6] Randomize positions of trees and morels

RandomPosition = {-6, -6, 6, 6} for trees seems a good balance between
making forests look natural and letting the player see which tile each
tree is blocking.
---
 units/morels/unit-morels.lua |    7 +++++++
 units/tree/unit-tree.lua     |    3 ++-
 units/tree02/unit-tree02.lua |    1 +
 units/tree03/unit-tree03.lua |    1 +
 units/tree04/unit-tree04.lua |    1 +
 5 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/units/morels/unit-morels.lua b/units/morels/unit-morels.lua
index 39c26ce..357648c 100644
--- a/units/morels/unit-morels.lua
+++ b/units/morels/unit-morels.lua
@@ -46,6 +46,7 @@ DefineUnitType("unit-morel-1", {
     Image = {"file", "units/morels/morel_1.png", "size", {64, 128}},
     Shadow = {"file", "units/morels/morel_1s.png", "size", {64, 128}},
     Offset = {0, -20},
+    RandomPosition = {-4, -8, 3, 8},
     Animations = "animations-morels",
     Icon = "icon-morel-1",
     Construction = "construction-morels",
@@ -84,6 +85,7 @@ DefineUnitType("unit-morel-2", {
     Image = {"file", "units/morels/morel_2.png", "size", {64, 128}},
     Shadow = {"file", "units/morels/morel_2s.png", "size", {64, 128}},
     Offset = {0, -22},
+    RandomPosition = {-5, -8, 6, 8},
     Animations = "animations-morels",
     Icon = "icon-morel-2",
     Construction = "construction-morels",
@@ -122,6 +124,7 @@ DefineUnitType("unit-morel-3", {
     Image = {"file", "units/morels/morel_3.png", "size", {64, 128}},
     Shadow = {"file", "units/morels/morel_3s.png", "size", {64, 128}},
     Offset = {0, -22},
+    RandomPosition = {-5, -5, 2, 7},
     Animations = "animations-morels",
     Icon = "icon-morel-3",
     Construction = "construction-morels",
@@ -160,6 +163,7 @@ DefineUnitType("unit-morel-4", {
     Image = {"file", "units/morels/morel_4.png", "size", {64, 128}},
     Shadow = {"file", "units/morels/morel_4s.png", "size", {64, 128}},
     Offset = {0, -19},
+    RandomPosition = {-3, -8, 3, 6},
     Animations = "animations-morels",
     Icon = "icon-morel-4",
     Construction = "construction-morels",
@@ -198,6 +202,7 @@ DefineUnitType("unit-morel-5", {
     Image = {"file", "units/morels/morel_5.png", "size", {64, 128}},
     Shadow = {"file", "units/morels/morel_5s.png", "size", {64, 128}},
     Offset = {0, -16},
+    RandomPosition = {-6, -9, 6, 9},
     Animations = "animations-morels",
     Icon = "icon-morel-5",
     Construction = "construction-morels",
@@ -236,6 +241,7 @@ DefineUnitType("unit-morel-6", {
     Image = {"file", "units/morels/morel_6.png", "size", {64, 128}},
     Shadow = {"file", "units/morels/morel_6s.png", "size", {64, 128}},
     Offset = {0, -23},
+    RandomPosition = {-1, -6, 4, 7},
     Animations = "animations-morels",
     Icon = "icon-morel-6",
     Construction = "construction-morels",
@@ -274,6 +280,7 @@ DefineUnitType("unit-morel-7", {
     Image = {"file", "units/morels/morel_7.png", "size", {64, 128}},
     Shadow = {"file", "units/morels/morel_7s.png", "size", {64, 128}},
     Offset = {0, -24},
+    RandomPosition = {-9, -11, 9, 11},
     Animations = "animations-morels",
     Icon = "icon-morel-7",
     Construction = "construction-morels",
diff --git a/units/tree/unit-tree.lua b/units/tree/unit-tree.lua
index 7dab792..2686716 100644
--- a/units/tree/unit-tree.lua
+++ b/units/tree/unit-tree.lua
@@ -48,8 +48,9 @@ DefineConstruction("construction-tree", {
 DefineUnitType("unit-tree", {
     Name = "Tree",
     Image = {"file", "units/tree/tree01.png", "size", {105, 105}},
-    Offset = {16, -24},
+    Offset = {18, -28},
     Shadow = {"file", "units/tree/tree01_s.png", "size", {105, 105}},
+    RandomPosition = {-6, -6, 6, 6},
     Animations = "animations-tree",
     Icon = "icon-tree",
     Construction = "construction-tree",
diff --git a/units/tree02/unit-tree02.lua b/units/tree02/unit-tree02.lua
index a3f4a7e..57141c1 100644
--- a/units/tree02/unit-tree02.lua
+++ b/units/tree02/unit-tree02.lua
@@ -39,6 +39,7 @@ DefineUnitType("unit-tree02", {
     Image = {"file", "units/tree02/tree02.png", "size", {128, 128}},
     Offset = {0, -24},
     Shadow = {"file", "units/tree02/tree02_s.png", "size", {128, 128}},
+    RandomPosition = {-6, -6, 6, 6},
     Animations = "animations-tree02",
     Icon = "icon-tree",
     Construction = "construction-tree",
diff --git a/units/tree03/unit-tree03.lua b/units/tree03/unit-tree03.lua
index a73390b..9ec26a1 100644
--- a/units/tree03/unit-tree03.lua
+++ b/units/tree03/unit-tree03.lua
@@ -39,6 +39,7 @@ DefineUnitType("unit-tree03", {
     Image = {"file", "units/tree03/tree03.png", "size", {128, 128}},
     Offset = {0, -24},
     Shadow = {"file", "units/tree03/tree03_s.png", "size", {128, 128}},
+    RandomPosition = {-6, -6, 6, 6},
     Animations = "animations-tree03",
     Icon = "icon-tree",
     Construction = "construction-tree",
diff --git a/units/tree04/unit-tree04.lua b/units/tree04/unit-tree04.lua
index 0fc7aea..8c81cf6 100644
--- a/units/tree04/unit-tree04.lua
+++ b/units/tree04/unit-tree04.lua
@@ -39,6 +39,7 @@ DefineUnitType("unit-tree04", {
     Image = {"file", "units/tree04/tree04.png", "size", {128, 128}},
     Offset = {0, -24},
     Shadow = {"file", "units/tree04/tree04_s.png", "size", {128, 128}},
+    RandomPosition = {-6, -6, 6, 6},
     Animations = "animations-tree04",
     Icon = "icon-tree",
     EnergyValue = 5000,
-- 
1.7.0

