forked from github/server
MACHE Mallorn / MACHE Holz
This commit is contained in:
parent
48f82ece17
commit
4b33326891
6 changed files with 52 additions and 13 deletions
|
@ -129,7 +129,8 @@ terrain_name(const struct region * r)
|
|||
if (r->attribs) {
|
||||
attrib * a = a_find(r->attribs, &at_racename);
|
||||
if (a) {
|
||||
return get_racename(a);
|
||||
const char * str = get_racename(a);
|
||||
if (str) return str;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
# Visual C++ Express 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util", "common\util.vcproj", "{F70CFB27-8A2F-E447-B452-4E1C590EDA6D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kernel", "common\kernel.vcproj", "{6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D}"
|
||||
|
@ -19,10 +19,6 @@ EndProject
|
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eressea", "eressea.vcproj", "{AD80EB0B-7CB4-42F2-9C95-8CCEF68DB387}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SubversionScc) = preSolution
|
||||
Svn-Managed = True
|
||||
Manager = AnkhSVN - Subversion Support for Visual Studio
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Profile|Win32 = Profile|Win32
|
||||
|
@ -59,4 +55,8 @@ Global
|
|||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(SubversionScc) = preSolution
|
||||
Svn-Managed = True
|
||||
Manager = AnkhSVN - Subversion Support for Visual Studio
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -276,7 +276,7 @@
|
|||
<!-- end cerddor -->
|
||||
|
||||
<!-- new gwyrrd -->
|
||||
<spell name="blessedharvest" type="gwyrrd" rank="5" level="1" index="25" ship="true" far="true" variable="true">
|
||||
<spell name="blessedharvest" type="gwyrrd" rank="5" level="20" index="25" ship="true" far="true" variable="true">
|
||||
<!-- Segen der Erde -->
|
||||
<resource name="aura" amount="1" cost="level"/>
|
||||
</spell>
|
||||
|
|
|
@ -48,9 +48,9 @@ function horse_produce(r, n)
|
|||
end
|
||||
|
||||
function log_limit(r)
|
||||
if r:get_flag(1) then -- RF_MALLORN
|
||||
return 0
|
||||
end
|
||||
-- if r:get_flag(1) then -- RF_MALLORN
|
||||
-- return 0
|
||||
-- end
|
||||
return r:get_resource("tree") + r:get_resource("sapling")
|
||||
end
|
||||
|
||||
|
|
|
@ -43,9 +43,9 @@ function horse_produce(r, n)
|
|||
end
|
||||
|
||||
function log_limit(r)
|
||||
if r:get_flag(1) then -- RF_MALLORN
|
||||
return 0
|
||||
end
|
||||
-- if r:get_flag(1) then -- RF_MALLORN
|
||||
-- return 0
|
||||
-- end
|
||||
return r:get_resource("tree") + r:get_resource("sapling")
|
||||
end
|
||||
|
||||
|
|
|
@ -501,6 +501,42 @@ function test_leave()
|
|||
assert(u.building==b1)
|
||||
end
|
||||
|
||||
function test_mallorn()
|
||||
free_game()
|
||||
local r = region.create(0, 0, "plain")
|
||||
r:set_flag(1, false) -- not mallorn
|
||||
r:set_resource("tree", 100)
|
||||
assert(r:get_resource("tree")==100)
|
||||
local m = region.create(0, 0, "plain")
|
||||
m:set_flag(1, true) -- not mallorn
|
||||
m:set_resource("tree", 100)
|
||||
assert(m:get_resource("tree")==100)
|
||||
|
||||
local f = faction.create("enno@eressea.de", "human", "de")
|
||||
|
||||
local u1 = unit.create(f, r, 1)
|
||||
u1:add_item("money", u1.number * 100)
|
||||
u1:set_skill("forestry", 2)
|
||||
u1:clear_orders()
|
||||
u1:add_order("MACHE HOLZ")
|
||||
|
||||
local u2 = unit.create(f, m, 1)
|
||||
u2:add_item("money", u2.number * 100)
|
||||
u2:set_skill("forestry", 2)
|
||||
u2:clear_orders()
|
||||
u2:add_order("MACHE HOLZ")
|
||||
|
||||
local u3 = unit.create(f, m, 1)
|
||||
u3:add_item("money", u3.number * 100)
|
||||
u3:set_skill("forestry", 2)
|
||||
u3:clear_orders()
|
||||
u3:add_order("MACHE Mallorn")
|
||||
process_orders()
|
||||
assert(u1:get_item("log")==2)
|
||||
assert(u2:get_item("log")==2)
|
||||
assert(u3:get_item("mallorn")==1)
|
||||
end
|
||||
|
||||
function test_storage()
|
||||
free_game()
|
||||
local r = region.create(0, 0, "plain")
|
||||
|
@ -547,12 +583,14 @@ tests = {
|
|||
["herbalism"] = test_herbalism,
|
||||
["storage"] = test_storage,
|
||||
["taxes"] = test_taxes,
|
||||
["mallorn"] = test_mallorn,
|
||||
["upkeep"] = test_upkeep,
|
||||
["id"] = test_id,
|
||||
["work"] = test_work,
|
||||
["market"] = test_market
|
||||
}
|
||||
mytests = {
|
||||
["mallorn"] = test_mallorn,
|
||||
["recruit2"] = test_recruit2
|
||||
}
|
||||
fail = 0
|
||||
|
|
Loading…
Reference in a new issue