forked from github/server
Merge pull request #251 from badgerman/hotfix-3-5-3
return to old mechanism of equipping the first unit, and give some ba…
This commit is contained in:
commit
c37974eaf4
|
@ -33,10 +33,13 @@
|
||||||
<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="mallorn" amount="10"/>
|
||||||
|
<item name="skillpotion" amount="5"/>
|
||||||
|
<item name="money" amount="20000"/>
|
||||||
</set>
|
</set>
|
||||||
<set name="new_faction">
|
<set name="new_faction">
|
||||||
<item name="adamantium" amount="1"/>
|
<item name="adamantium" amount="1"/>
|
||||||
|
|
|
@ -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"/>
|
||||||
|
|
|
@ -17,19 +17,10 @@ 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)
|
||||||
|
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: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("mining", 30)
|
||||||
unit.create(f, r, 5):set_skill("quarrying", 30)
|
unit.create(f, r, 5):set_skill("quarrying", 30)
|
||||||
return f
|
return f
|
||||||
|
|
|
@ -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 not r.units() then
|
if not r.plane and 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)
|
||||||
|
|
|
@ -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