forked from github/server
Merge remote-tracking branch 'upstream/develop' into develop
This commit is contained in:
commit
c19bed02fe
|
@ -33,10 +33,17 @@
|
||||||
<xi:include href="config://default/adamantium.xml"/>
|
<xi:include href="config://default/adamantium.xml"/>
|
||||||
<equipment>
|
<equipment>
|
||||||
<set name="first_unit">
|
<set name="first_unit">
|
||||||
<item name="conquesttoken" amount="1"/>
|
<item name="log" amount="50"/>
|
||||||
<item name="log" amount="30"/>
|
<item name="stone" amount="50"/>
|
||||||
<item name="stone" amount="30"/>
|
<item name="iron" amount="50"/>
|
||||||
<item name="money" amount="4200"/>
|
<item name="laen" amount="10"/>
|
||||||
|
<item name="sword" amount="1"/>
|
||||||
|
<item name="mallorn" amount="10"/>
|
||||||
|
<item name="skillpotion" amount="5"/>
|
||||||
|
<item name="p2" amount="5"/>
|
||||||
|
<item name="money" amount="20000"/>
|
||||||
|
<skill name="perception" level="30"/>
|
||||||
|
<skill name="melee" level="1"/>
|
||||||
</set>
|
</set>
|
||||||
<set name="new_faction">
|
<set name="new_faction">
|
||||||
<item name="adamantium" amount="1"/>
|
<item name="adamantium" amount="1"/>
|
||||||
|
@ -53,7 +60,6 @@
|
||||||
<!-- Game specific settings -->
|
<!-- Game specific settings -->
|
||||||
|
|
||||||
<order name="pay" disable="yes"/>
|
<order name="pay" disable="yes"/>
|
||||||
<order name="besiege" disable="yes"/>
|
|
||||||
|
|
||||||
<skill name="alchemy" enable="true"/>
|
<skill name="alchemy" enable="true"/>
|
||||||
<skill name="crossbow" enable="true"/>
|
<skill name="crossbow" enable="true"/>
|
||||||
|
@ -94,11 +100,7 @@
|
||||||
<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"/>
|
||||||
<param name="world.era" value="2"/>
|
|
||||||
<param name="seed.population.min" value="8"/>
|
|
||||||
<param name="seed.population.max" value="8"/>
|
|
||||||
<param name="rules.reserve.twophase" value="1"/>
|
<param name="rules.reserve.twophase" value="1"/>
|
||||||
<param name="rules.owners.force_leave" value="0"/>
|
|
||||||
<param name="rules.give.max_men" value="-1"/>
|
<param name="rules.give.max_men" value="-1"/>
|
||||||
<param name="rules.check_overload" value="0"/>
|
<param name="rules.check_overload" value="0"/>
|
||||||
<param name="rules.limit.faction" value="2500"/>
|
<param name="rules.limit.faction" value="2500"/>
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
|
|
||||||
<equipment>
|
<equipment>
|
||||||
<set name="first_unit">
|
<set name="first_unit">
|
||||||
<item name="conquesttoken" amount="1"/>
|
|
||||||
<item name="log" amount="10"/>
|
<item name="log" amount="10"/>
|
||||||
<item name="stone" amount="10"/>
|
<item name="stone" amount="10"/>
|
||||||
<item name="money" amount="5000"/>
|
<item name="money" amount="5000"/>
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
|
|
||||||
<equipment>
|
<equipment>
|
||||||
<set name="first_unit">
|
<set name="first_unit">
|
||||||
<item name="conquesttoken" amount="1"/>
|
|
||||||
<item name="log" amount="10"/>
|
<item name="log" amount="10"/>
|
||||||
<item name="stone" amount="10"/>
|
<item name="stone" amount="10"/>
|
||||||
<item name="money" amount="5000"/>
|
<item name="money" amount="5000"/>
|
||||||
|
|
|
@ -1,12 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
MACHINE=`uname -m`
|
|
||||||
[ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang"
|
|
||||||
[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc"
|
|
||||||
[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc"
|
|
||||||
[ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc"
|
|
||||||
BUILD="build-$MACHINE-$CC-Debug"
|
|
||||||
|
|
||||||
function usage() {
|
function usage() {
|
||||||
cat <<HEREDOC
|
cat <<HEREDOC
|
||||||
usage: $0 [-t <turn>] [-g <game>] [-f <file>] command [args]
|
usage: $0 [-t <turn>] [-g <game>] [-f <file>] command [args]
|
||||||
|
@ -89,7 +82,7 @@ rm -rf reports
|
||||||
mkdir -p reports
|
mkdir -p reports
|
||||||
|
|
||||||
SUPP="$SOURCE/share/ubuntu-12_04.supp"
|
SUPP="$SOURCE/share/ubuntu-12_04.supp"
|
||||||
SERVER="$SOURCE/$BUILD/eressea/eressea"
|
SERVER="$SOURCE/Debug/eressea/eressea"
|
||||||
VALGRIND=$(which valgrind)
|
VALGRIND=$(which valgrind)
|
||||||
if [ ! -z $VALGRIND ]; then
|
if [ ! -z $VALGRIND ]; then
|
||||||
SERVER="$VALGRIND --suppressions=$SUPP --error-exitcode=1 --leak-check=no $SERVER"
|
SERVER="$VALGRIND --suppressions=$SUPP --error-exitcode=1 --leak-check=no $SERVER"
|
||||||
|
|
|
@ -9,7 +9,9 @@ local function read_players()
|
||||||
local str = input:read("*line")
|
local str = input:read("*line")
|
||||||
if str==nil then break end
|
if str==nil then break end
|
||||||
local email, race, lang = str:match("([^ ]*) ([^ ]*) ([^ ]*)")
|
local email, race, lang = str:match("([^ ]*) ([^ ]*) ([^ ]*)")
|
||||||
table.insert(players, { race = race, lang = lang, email = email })
|
if string.char(string.byte(email, 1))~='#' then
|
||||||
|
table.insert(players, { race = race, lang = lang, email = email })
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return players
|
return players
|
||||||
end
|
end
|
||||||
|
@ -17,21 +19,12 @@ end
|
||||||
local function seed(r, email, race, lang)
|
local function seed(r, email, race, lang)
|
||||||
local f = faction.create(email, race, lang)
|
local f = faction.create(email, race, lang)
|
||||||
local u = unit.create(f, r)
|
local u = unit.create(f, r)
|
||||||
u:set_skill("perception", 30)
|
equip_unit(u, "new_faction")
|
||||||
u:add_item("money", 20000)
|
equip_unit(u, "first_unit")
|
||||||
items = {
|
equip_unit(u, "first_" .. race, 7) -- disable old callbacks
|
||||||
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("mining", 30)
|
||||||
unit.create(f, r, 5):set_skill("quarrying", 30)
|
unit.create(f, r, 5):set_skill("quarrying", 30)
|
||||||
|
f:set_origin(r)
|
||||||
return f
|
return f
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -50,12 +43,13 @@ local function dump_selection(sel)
|
||||||
end
|
end
|
||||||
|
|
||||||
players = read_players()
|
players = read_players()
|
||||||
local limit = 30000
|
local peasants = 20000
|
||||||
|
local trees = 1000
|
||||||
local turn = get_turn()
|
local turn = get_turn()
|
||||||
local sel
|
local sel
|
||||||
if #players > 0 then
|
if #players > 0 then
|
||||||
eressea.read_game(("%d.dat"):format(turn))
|
eressea.read_game(("%d.dat"):format(turn))
|
||||||
sel = p.select(regions(), limit)
|
sel = p.select(regions(), peasants, trees)
|
||||||
if #sel > 0 then
|
if #sel > 0 then
|
||||||
local best = dump_selection(sel)
|
local best = dump_selection(sel)
|
||||||
print("finest region, " .. best.score .. " points: " .. tostring(best.r))
|
print("finest region, " .. best.score .. " points: " .. tostring(best.r))
|
||||||
|
|
|
@ -13,12 +13,11 @@ local function score(r, res)
|
||||||
return peas
|
return peas
|
||||||
end
|
end
|
||||||
|
|
||||||
local function select(regions, limit)
|
local function select(regions, peasants, trees)
|
||||||
local sel = {}
|
local sel = {}
|
||||||
for r in regions do
|
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 score(r, "peasant") >= peasants and score(r, "tree") >= trees then
|
||||||
if s >= limit then
|
|
||||||
table.insert(sel, r)
|
table.insert(sel, r)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -434,7 +434,9 @@ static int tolua_equipunit(lua_State * L)
|
||||||
{
|
{
|
||||||
unit *u = (unit *)tolua_tousertype(L, 1, 0);
|
unit *u = (unit *)tolua_tousertype(L, 1, 0);
|
||||||
const char *eqname = tolua_tostring(L, 2, 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue