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) {
|
if (r->attribs) {
|
||||||
attrib * a = a_find(r->attribs, &at_racename);
|
attrib * a = a_find(r->attribs, &at_racename);
|
||||||
if (a) {
|
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
|
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}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util", "common\util.vcproj", "{F70CFB27-8A2F-E447-B452-4E1C590EDA6D}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kernel", "common\kernel.vcproj", "{6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D}"
|
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}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eressea", "eressea.vcproj", "{AD80EB0B-7CB4-42F2-9C95-8CCEF68DB387}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SubversionScc) = preSolution
|
|
||||||
Svn-Managed = True
|
|
||||||
Manager = AnkhSVN - Subversion Support for Visual Studio
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Win32 = Debug|Win32
|
Debug|Win32 = Debug|Win32
|
||||||
Profile|Win32 = Profile|Win32
|
Profile|Win32 = Profile|Win32
|
||||||
|
@ -59,4 +55,8 @@ Global
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
GlobalSection(SubversionScc) = preSolution
|
||||||
|
Svn-Managed = True
|
||||||
|
Manager = AnkhSVN - Subversion Support for Visual Studio
|
||||||
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|
|
@ -276,7 +276,7 @@
|
||||||
<!-- end cerddor -->
|
<!-- end cerddor -->
|
||||||
|
|
||||||
<!-- new gwyrrd -->
|
<!-- 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 -->
|
<!-- Segen der Erde -->
|
||||||
<resource name="aura" amount="1" cost="level"/>
|
<resource name="aura" amount="1" cost="level"/>
|
||||||
</spell>
|
</spell>
|
||||||
|
|
|
@ -48,9 +48,9 @@ function horse_produce(r, n)
|
||||||
end
|
end
|
||||||
|
|
||||||
function log_limit(r)
|
function log_limit(r)
|
||||||
if r:get_flag(1) then -- RF_MALLORN
|
-- if r:get_flag(1) then -- RF_MALLORN
|
||||||
return 0
|
-- return 0
|
||||||
end
|
-- end
|
||||||
return r:get_resource("tree") + r:get_resource("sapling")
|
return r:get_resource("tree") + r:get_resource("sapling")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -43,9 +43,9 @@ function horse_produce(r, n)
|
||||||
end
|
end
|
||||||
|
|
||||||
function log_limit(r)
|
function log_limit(r)
|
||||||
if r:get_flag(1) then -- RF_MALLORN
|
-- if r:get_flag(1) then -- RF_MALLORN
|
||||||
return 0
|
-- return 0
|
||||||
end
|
-- end
|
||||||
return r:get_resource("tree") + r:get_resource("sapling")
|
return r:get_resource("tree") + r:get_resource("sapling")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -501,6 +501,42 @@ function test_leave()
|
||||||
assert(u.building==b1)
|
assert(u.building==b1)
|
||||||
end
|
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()
|
function test_storage()
|
||||||
free_game()
|
free_game()
|
||||||
local r = region.create(0, 0, "plain")
|
local r = region.create(0, 0, "plain")
|
||||||
|
@ -547,12 +583,14 @@ tests = {
|
||||||
["herbalism"] = test_herbalism,
|
["herbalism"] = test_herbalism,
|
||||||
["storage"] = test_storage,
|
["storage"] = test_storage,
|
||||||
["taxes"] = test_taxes,
|
["taxes"] = test_taxes,
|
||||||
|
["mallorn"] = test_mallorn,
|
||||||
["upkeep"] = test_upkeep,
|
["upkeep"] = test_upkeep,
|
||||||
["id"] = test_id,
|
["id"] = test_id,
|
||||||
["work"] = test_work,
|
["work"] = test_work,
|
||||||
["market"] = test_market
|
["market"] = test_market
|
||||||
}
|
}
|
||||||
mytests = {
|
mytests = {
|
||||||
|
["mallorn"] = test_mallorn,
|
||||||
["recruit2"] = test_recruit2
|
["recruit2"] = test_recruit2
|
||||||
}
|
}
|
||||||
fail = 0
|
fail = 0
|
||||||
|
|
Loading…
Reference in a new issue