From a28ca695fdc80d8972ae4a8084cd423c6b59e08d Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 5 Jul 2015 15:19:38 +0200 Subject: [PATCH 1/8] start new hotfix branch --- src/buildno.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buildno.h b/src/buildno.h index d1f3c3fcf..813baf03b 100644 --- a/src/buildno.h +++ b/src/buildno.h @@ -1,3 +1,3 @@ #define VERSION_MAJOR 3 #define VERSION_MINOR 5 -#define VERSION_BUILD 2 +#define VERSION_BUILD 3 From 9185b2af2875a79ee961e6892e14b5d31c0d2c57 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 5 Jul 2015 14:16:17 +0200 Subject: [PATCH 2/8] simplify test setup: as long as all games have nmr.removenewbie set to off by their config, no test should need to disable it. --- scripts/eressea/tests/common.lua | 2 -- scripts/eressea/tests/orders.lua | 1 - scripts/tests/e2/guard.lua | 1 - scripts/tests/e2/movement.lua | 1 - scripts/tests/e2/shiplanding.lua | 1 - scripts/tests/e3/spells.lua | 1 - scripts/tests/movement.lua | 1 - scripts/tests/pool.lua | 1 - 8 files changed, 9 deletions(-) diff --git a/scripts/eressea/tests/common.lua b/scripts/eressea/tests/common.lua index 365b87195..9d3f9a306 100644 --- a/scripts/eressea/tests/common.lua +++ b/scripts/eressea/tests/common.lua @@ -26,7 +26,6 @@ module("tests.eressea.common", package.seeall, lunit.testcase) function setup() eressea.free_game() - eressea.settings.set("nmr.removenewbie", "0") eressea.settings.set("nmr.timeout", "0") eressea.settings.set("NewbieImmunity", "0") eressea.settings.set("rules.economy.food", "4") @@ -981,7 +980,6 @@ module("tests.report", package.seeall, lunit.testcase) function setup() eressea.free_game() - eressea.settings.set("nmr.removenewbie", "0") eressea.settings.set("nmr.timeout", "0") eressea.settings.set("rules.economy.food", "4") end diff --git a/scripts/eressea/tests/orders.lua b/scripts/eressea/tests/orders.lua index af1ba8863..ea32fabdc 100644 --- a/scripts/eressea/tests/orders.lua +++ b/scripts/eressea/tests/orders.lua @@ -16,7 +16,6 @@ function setup() u = _G.unit.create(f, r, 1) u:clear_orders() eressea.settings.set("rules.economy.food", "4") - eressea.settings.set("nmr.removenewbie", "0") eressea.settings.set("nmr.timeout", "0") eressea.settings.set("NewbieImmunity", "0") end diff --git a/scripts/tests/e2/guard.lua b/scripts/tests/e2/guard.lua index 1afd011e9..b1c9d9c4f 100644 --- a/scripts/tests/e2/guard.lua +++ b/scripts/tests/e2/guard.lua @@ -4,7 +4,6 @@ module("tests.e2.guard", package.seeall, lunit.testcase) function setup() eressea.free_game() - eressea.settings.set("nmr.removenewbie", "0") eressea.settings.set("nmr.timeout", "0") eressea.settings.set("NewbieImmunity", "0") eressea.settings.set("rules.economy.food", "4") diff --git a/scripts/tests/e2/movement.lua b/scripts/tests/e2/movement.lua index ef62873d8..7e20e41ca 100644 --- a/scripts/tests/e2/movement.lua +++ b/scripts/tests/e2/movement.lua @@ -4,7 +4,6 @@ module("tests.e2.movement", package.seeall, lunit.testcase) function setup() eressea.free_game() - eressea.settings.set("nmr.removenewbie", "0") eressea.settings.set("nmr.timeout", "0") eressea.settings.set("NewbieImmunity", "0") end diff --git a/scripts/tests/e2/shiplanding.lua b/scripts/tests/e2/shiplanding.lua index 2d9225b8d..a46a7da37 100644 --- a/scripts/tests/e2/shiplanding.lua +++ b/scripts/tests/e2/shiplanding.lua @@ -4,7 +4,6 @@ module("tests.e2.shiplanding", package.seeall, lunit.testcase) function setup() eressea.free_game() - eressea.settings.set("nmr.removenewbie", "0") eressea.settings.set("nmr.timeout", "0") eressea.settings.set("NewbieImmunity", "0") end diff --git a/scripts/tests/e3/spells.lua b/scripts/tests/e3/spells.lua index 7afe96d8e..c4f0aadaf 100644 --- a/scripts/tests/e3/spells.lua +++ b/scripts/tests/e3/spells.lua @@ -5,7 +5,6 @@ module("tests.e3.spells", package.seeall, lunit.testcase) function setup() eressea.game.reset() eressea.settings.set("magic.fumble.enable", "0") - eressea.settings.set("nmr.removenewbie", "0") eressea.settings.set("nmr.timeout", "0") eressea.settings.set("rules.peasants.growth", "0") end diff --git a/scripts/tests/movement.lua b/scripts/tests/movement.lua index e27831cc8..110b5b2a2 100644 --- a/scripts/tests/movement.lua +++ b/scripts/tests/movement.lua @@ -4,7 +4,6 @@ module("tests.movement", package.seeall, lunit.testcase) function setup() eressea.free_game() - eressea.settings.set("nmr.removenewbie", "0") eressea.settings.set("nmr.timeout", "0") eressea.settings.set("rules.ships.storms", "0") conf = [[{ diff --git a/scripts/tests/pool.lua b/scripts/tests/pool.lua index 3ee3d54db..bf32eda87 100644 --- a/scripts/tests/pool.lua +++ b/scripts/tests/pool.lua @@ -6,7 +6,6 @@ function setup() eressea.game.reset() eressea.config.reset() eressea.settings.set("rules.economy.food", "0") - eressea.settings.set("nmr.removenewbie", "0") eressea.settings.set("nmr.timeout", "0") eressea.settings.set("rules.magic.playerschools", "") conf = [[{ From 3074a6077dd71096e9753073526f6ce780e19ad5 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 4 Jul 2015 23:42:41 +0200 Subject: [PATCH 3/8] avoid monsters: only seed new factions in hexes that have no units nearby. --- scripts/populate.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/populate.lua b/scripts/populate.lua index dfd07b5dd..5df2ad92f 100644 --- a/scripts/populate.lua +++ b/scripts/populate.lua @@ -6,7 +6,7 @@ local function score(r, res) local x, y, rn local peas = r:get_resource(res) for _, rn in pairs(r.adj) do - if rn then + if rn and not rn.units() then peas = peas + rn:get_resource(res) end end @@ -16,7 +16,7 @@ end local function select(regions, limit) local sel = {} for r in regions do - if r.terrain~="ocean" and r.units()==nil then + if r.terrain~="ocean" and not r.units() then s = score(r) if s >= limit then table.insert(sel, r) From 4e67c4ac3f0c7a1acae3db1a532b339d2b3c0fa4 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 5 Jul 2015 14:07:59 +0200 Subject: [PATCH 4/8] do not remove new players for missing their first turn. --- conf/e2/config.xml | 2 +- src/laws.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/e2/config.xml b/conf/e2/config.xml index f99176432..2fcaad800 100644 --- a/conf/e2/config.xml +++ b/conf/e2/config.xml @@ -89,7 +89,7 @@ - + diff --git a/src/laws.c b/src/laws.c index 13e486c2c..fe201670c 100755 --- a/src/laws.c +++ b/src/laws.c @@ -113,7 +113,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* - exported global symbols ----------------------------------- */ -static int RemoveNMRNewbie(void) +static bool RemoveNMRNewbie(void) { static int value = -1; static int gamecookie = -1; @@ -122,7 +122,7 @@ static int RemoveNMRNewbie(void) value = get_param_int(global.parameters, "nmr.removenewbie", 0); gamecookie = global.cookie; } - return value; + return value!=0; } static void checkorders(void) From 6672251b2d909bf4fdca1bfa6dd6c982504f87ac Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 26 Jun 2015 14:19:36 +0200 Subject: [PATCH 5/8] fewer units for new players, two players per region --- scripts/newplayer.lua | 44 ++++++++++--------------------------------- 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/scripts/newplayer.lua b/scripts/newplayer.lua index 239eb487b..9d64f585b 100644 --- a/scripts/newplayer.lua +++ b/scripts/newplayer.lua @@ -30,38 +30,8 @@ local function seed(r, email, race, lang) for it, num in pairs(items) do u:add_item(it, num) end - u = nil - skills ={ - "crossbow", - "bow", - "building", - "trade", - "forestry", - "catapult", - "herbalism", - "training", - "riding", - "armorer", - "shipcraft", - "melee", - "sailing", - "polearm", - "espionage", - "roadwork", - "tactics", - "stealth", - "weaponsmithing", - "cartmaking", - "taxation", - "stamina" - } - unit.create(f, r, 50):set_skill("entertainment", 15) unit.create(f, r, 5):set_skill("mining", 30) unit.create(f, r, 5):set_skill("quarrying", 30) - for _, sk in ipairs(skills) do - u = u or unit.create(f, r, 5) - if u:set_skill(sk, 15)>0 then u=nil end - end return f end @@ -94,11 +64,16 @@ end math.randomseed(os.time()) local newbs = {} +local per_region = 2 +local num_seeded = 2 +local start = nil for _, p in ipairs(players) do - local index = math.random(#sel) - local start = nil - while not start or start.units() do - start = sel[index] + if num_seeded == per_region then + while not start or start.units() do + local index = math.random(#sel) + start = sel[index] + end + num_seeded = 0 end local dupe = false for f in factions() do @@ -109,6 +84,7 @@ for _, p in ipairs(players) do end end if not dupe then + num_seeded = num_seeded + 1 f = seed(start, p.email, p.race or "human", p.lang or "de") print("new faction ".. tostring(f) .. " starts in ".. tostring(start)) table.insert(newbs, f) From 7906d4469dd7ef61a97fe5083b6bbfd951845f36 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 5 Jul 2015 16:40:49 +0200 Subject: [PATCH 6/8] return to old mechanism of equipping the first unit, and give some basic necessities to special races. --- conf/e2/config.xml | 11 +++++++---- conf/e3/config.xml | 1 - conf/e4/config.xml | 1 - scripts/newplayer.lua | 15 +++------------ scripts/populate.lua | 2 +- src/bindings.c | 4 +++- 6 files changed, 14 insertions(+), 20 deletions(-) diff --git a/conf/e2/config.xml b/conf/e2/config.xml index 2fcaad800..9b0a90851 100644 --- a/conf/e2/config.xml +++ b/conf/e2/config.xml @@ -33,10 +33,13 @@ - - - - + + + + + + + diff --git a/conf/e3/config.xml b/conf/e3/config.xml index 7d9a71ab2..e0669c527 100644 --- a/conf/e3/config.xml +++ b/conf/e3/config.xml @@ -32,7 +32,6 @@ - diff --git a/conf/e4/config.xml b/conf/e4/config.xml index a6439db21..1924ff2c9 100644 --- a/conf/e4/config.xml +++ b/conf/e4/config.xml @@ -32,7 +32,6 @@ - diff --git a/scripts/newplayer.lua b/scripts/newplayer.lua index 9d64f585b..4ef429b2a 100644 --- a/scripts/newplayer.lua +++ b/scripts/newplayer.lua @@ -17,19 +17,10 @@ end local function seed(r, email, race, lang) local f = faction.create(email, race, lang) local u = unit.create(f, r) + equip_unit(u, "new_faction") + equip_unit(u, "first_unit") + equip_unit(u, "first_" .. race, 7) -- disable old callbacks u:set_skill("perception", 30) - u:add_item("money", 20000) - items = { - log = 50, - stone = 50, - iron = 50, - laen = 10, - mallorn = 10, - skillpotion = 5 - } - for it, num in pairs(items) do - u:add_item(it, num) - end unit.create(f, r, 5):set_skill("mining", 30) unit.create(f, r, 5):set_skill("quarrying", 30) return f diff --git a/scripts/populate.lua b/scripts/populate.lua index 5df2ad92f..9ab1b5bcb 100644 --- a/scripts/populate.lua +++ b/scripts/populate.lua @@ -16,7 +16,7 @@ end local function select(regions, limit) local sel = {} for r in regions do - if r.terrain~="ocean" and not r.units() then + if not r.plane and r.terrain~="ocean" and not r.units() then s = score(r) if s >= limit then table.insert(sel, r) diff --git a/src/bindings.c b/src/bindings.c index 169c91d0c..5fcf4ef1f 100755 --- a/src/bindings.c +++ b/src/bindings.c @@ -434,7 +434,9 @@ static int tolua_equipunit(lua_State * L) { unit *u = (unit *)tolua_tousertype(L, 1, 0); const char *eqname = tolua_tostring(L, 2, 0); - equip_unit(u, get_equipment(eqname)); + int mask = (int)tolua_tonumber(L, 3, EQUIP_ALL); + assert(mask > 0); + equip_unit_mask(u, get_equipment(eqname), mask); return 0; } From c1ba6a99e39a5130c3d2b81dfe7f19c06c664c24 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 5 Jul 2015 18:45:15 +0200 Subject: [PATCH 7/8] add a holy ground curse to all new starting regions. --- scripts/newplayer.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/newplayer.lua b/scripts/newplayer.lua index 4ef429b2a..ccd651f03 100644 --- a/scripts/newplayer.lua +++ b/scripts/newplayer.lua @@ -64,6 +64,7 @@ for _, p in ipairs(players) do local index = math.random(#sel) start = sel[index] end + create_curse(nil, r, 'holyground', 1, 52) num_seeded = 0 end local dupe = false From 77b1bd6ef3b518384719021d9855d04ef4904758 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 11 Jul 2015 14:33:09 +0200 Subject: [PATCH 8/8] updte submoduiles before building --- s/build | 1 + 1 file changed, 1 insertion(+) diff --git a/s/build b/s/build index 068a669a1..9711e6da8 100755 --- a/s/build +++ b/s/build @@ -29,6 +29,7 @@ if [ ! -d $ROOT/$BIN_DIR ]; then exit fi +git submodule update cd $ROOT/$BIN_DIR make $MAKEOPTS && make test cd $OLDPWD