Merge pull request #250 from badgerman/feature/newplayer-fixes

some fixes for new players
This commit is contained in:
Enno Rehling 2015-07-05 15:21:54 +02:00
commit 6df1e3eeb0
11 changed files with 5 additions and 14 deletions

View File

@ -90,7 +90,7 @@
<param name="entertain.base" value="0"/> <param name="entertain.base" value="0"/>
<param name="entertain.perlevel" value="20"/> <param name="entertain.perlevel" value="20"/>
<param name="nmr.timeout" value="5"/> <param name="nmr.timeout" value="5"/>
<param name="nmr.removenewbie" value="10"/> <param name="nmr.removenewbie" value="0"/>
<param name="GiveRestriction" value="3"/> <param name="GiveRestriction" value="3"/>
<param name="hunger.long" value="1"/> <param name="hunger.long" value="1"/>
<param name="init_spells" value="0"/> <param name="init_spells" value="0"/>

View File

@ -6,7 +6,7 @@ local function score(r, res)
local x, y, rn local x, y, rn
local peas = r:get_resource(res) local peas = r:get_resource(res)
for _, rn in pairs(r.adj) do for _, rn in pairs(r.adj) do
if rn then if rn and not rn.units() then
peas = peas + rn:get_resource(res) peas = peas + rn:get_resource(res)
end end
end end
@ -16,7 +16,7 @@ end
local function select(regions, limit) local function select(regions, limit)
local sel = {} local sel = {}
for r in regions do 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) s = score(r)
if s >= limit then if s >= limit then
table.insert(sel, r) table.insert(sel, r)

View File

@ -26,7 +26,6 @@ module("tests.common", package.seeall, lunit.testcase)
function setup() function setup()
eressea.free_game() eressea.free_game()
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0") eressea.settings.set("NewbieImmunity", "0")
eressea.settings.set("rules.economy.food", "4") eressea.settings.set("rules.economy.food", "4")
@ -961,7 +960,6 @@ module("tests.report", package.seeall, lunit.testcase)
function setup() function setup()
eressea.free_game() eressea.free_game()
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("rules.economy.food", "4") eressea.settings.set("rules.economy.food", "4")
end end

View File

@ -4,7 +4,6 @@ module("tests.e2.guard", package.seeall, lunit.testcase)
function setup() function setup()
eressea.free_game() eressea.free_game()
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0") eressea.settings.set("NewbieImmunity", "0")
eressea.settings.set("rules.economy.food", "4") eressea.settings.set("rules.economy.food", "4")

View File

@ -4,7 +4,6 @@ module("tests.e2.movement", package.seeall, lunit.testcase)
function setup() function setup()
eressea.free_game() eressea.free_game()
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0") eressea.settings.set("NewbieImmunity", "0")
end end

View File

@ -4,7 +4,6 @@ module("tests.e2.shiplanding", package.seeall, lunit.testcase)
function setup() function setup()
eressea.free_game() eressea.free_game()
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0") eressea.settings.set("NewbieImmunity", "0")
end end

View File

@ -5,7 +5,6 @@ module("tests.e3.spells", package.seeall, lunit.testcase)
function setup() function setup()
eressea.game.reset() eressea.game.reset()
eressea.settings.set("magic.fumble.enable", "0") eressea.settings.set("magic.fumble.enable", "0")
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("rules.peasants.growth", "0") eressea.settings.set("rules.peasants.growth", "0")
end end

View File

@ -4,7 +4,6 @@ module("tests.movement", package.seeall, lunit.testcase)
function setup() function setup()
eressea.free_game() eressea.free_game()
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("rules.ships.storms", "0") eressea.settings.set("rules.ships.storms", "0")
conf = [[{ conf = [[{

View File

@ -16,7 +16,6 @@ function setup()
u = _G.unit.create(f, r, 1) u = _G.unit.create(f, r, 1)
u:clear_orders() u:clear_orders()
eressea.settings.set("rules.economy.food", "4") eressea.settings.set("rules.economy.food", "4")
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0") eressea.settings.set("NewbieImmunity", "0")
end end

View File

@ -6,7 +6,6 @@ function setup()
eressea.game.reset() eressea.game.reset()
eressea.config.reset() eressea.config.reset()
eressea.settings.set("rules.economy.food", "0") eressea.settings.set("rules.economy.food", "0")
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("rules.magic.playerschools", "") eressea.settings.set("rules.magic.playerschools", "")
conf = [[{ conf = [[{

View File

@ -113,7 +113,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/* - exported global symbols ----------------------------------- */ /* - exported global symbols ----------------------------------- */
static int RemoveNMRNewbie(void) static bool RemoveNMRNewbie(void)
{ {
static int value = -1; static int value = -1;
static int gamecookie = -1; static int gamecookie = -1;
@ -122,7 +122,7 @@ static int RemoveNMRNewbie(void)
value = get_param_int(global.parameters, "nmr.removenewbie", 0); value = get_param_int(global.parameters, "nmr.removenewbie", 0);
gamecookie = global.cookie; gamecookie = global.cookie;
} }
return value; return value!=0;
} }
static void age_unit(region * r, unit * u) static void age_unit(region * r, unit * u)