forked from github/server
Merge branch 'version-3-4' of https://github.com/badgerman/eressea into badgerman-version-3-4
Conflicts: src/laws.c
This commit is contained in:
commit
c3ed521d4f
|
@ -58,6 +58,7 @@
|
|||
<order name="tax" disable="yes"/>
|
||||
<order name="entertain" disable="yes"/>
|
||||
<order name="sell" disable="yes"/>
|
||||
<order name="origin" disable="yes"/>
|
||||
|
||||
<skill name="armorer" enable="true"/>
|
||||
<skill name="bow" enable="true"/>
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
<?xml version="1.0"?>
|
||||
<resources>
|
||||
|
||||
<resource name="money">
|
||||
<item weight="0"/>
|
||||
</resource>
|
||||
|
||||
<resource name="ao_healing" appearance="amulet">
|
||||
<item weight="0" score="6000"/>
|
||||
</resource>
|
||||
|
|
|
@ -712,6 +712,42 @@ function test_golem_use_four_iron()
|
|||
assert_equal(4, u1:get_item("towershield"))
|
||||
end
|
||||
|
||||
function skip_test_silver_weight_stops_movement()
|
||||
local r1 = region.create(1, 1, "plain")
|
||||
local r2 = region.create(2, 1, "plain")
|
||||
region.create(3, 1, "plain")
|
||||
local f1 = faction.create("noreply@eressea.de", "human", "de")
|
||||
local u1 = unit.create(f1, r1, 1)
|
||||
u1:clear_orders()
|
||||
u1:add_order("NACH OST")
|
||||
u1:add_item("money", 540)
|
||||
assert_equal(1540, u1.weight)
|
||||
process_orders()
|
||||
assert_equal(r2, u1.region)
|
||||
u1:add_item("money", 1)
|
||||
process_orders()
|
||||
assert_equal(r2, u1.region)
|
||||
end
|
||||
|
||||
function skip_test_silver_weight_stops_ship()
|
||||
local r1 = region.create(1, 1, "ocean")
|
||||
local r2 = region.create(2, 1, "ocean")
|
||||
region.create(3, 1, "ocean")
|
||||
local f1 = faction.create("noreply@eressea.de", "human", "de")
|
||||
local u1 = unit.create(f1, r1, 1)
|
||||
u1:set_skill("sailing", 3)
|
||||
local s1 = ship.create(r1, "canoe")
|
||||
u1.ship = s1
|
||||
u1:clear_orders()
|
||||
u1:add_order("NACH OST")
|
||||
u1:add_item("money", 2000)
|
||||
process_orders()
|
||||
assert_equal(r2, u1.region)
|
||||
u1:add_item("money", 1)
|
||||
process_orders()
|
||||
assert_equal(r2, u1.region)
|
||||
end
|
||||
|
||||
function test_building_owner_can_enter_ship()
|
||||
local r1 = region.create(1, 2, "plain")
|
||||
local f1 = faction.create("noreply@eressea.de", "human", "de")
|
||||
|
@ -734,3 +770,12 @@ function test_building_owner_can_enter_ship()
|
|||
assert_equal(s1, u1.ship)
|
||||
assert_equal(null, u1.building, "owner of the building can not go into a ship")
|
||||
end
|
||||
|
||||
function test_weightless_silver()
|
||||
local r1 = region.create(1, 2, "plain")
|
||||
local f1 = faction.create("noreply@eressea.de", "human", "de")
|
||||
local u1 = unit.create(f1, r1, 1)
|
||||
assert_equal(1000, u1.weight)
|
||||
u1:add_item("money", 540)
|
||||
assert_equal(1000, u1.weight)
|
||||
end
|
||||
|
|
|
@ -143,6 +143,27 @@ static void test_fix_demand(CuTest *tc) {
|
|||
test_cleanup();
|
||||
}
|
||||
|
||||
static void test_core_resources(CuTest *tc) {
|
||||
resource_type * rtype;
|
||||
test_cleanup();
|
||||
init_resources();
|
||||
CuAssertPtrNotNull(tc, rtype = rt_find("money"));
|
||||
CuAssertPtrNotNull(tc, rtype->itype);
|
||||
CuAssertPtrNotNull(tc, rtype->uchange);
|
||||
CuAssertPtrNotNull(tc, rtype->itype->give);
|
||||
CuAssertPtrNotNull(tc, rtype = rt_find("peasant"));
|
||||
CuAssertPtrEquals(tc, 0, rtype->itype);
|
||||
CuAssertPtrNotNull(tc, rtype = rt_find("person"));
|
||||
CuAssertPtrEquals(tc, 0, rtype->itype);
|
||||
CuAssertPtrNotNull(tc, rtype = rt_find("permaura"));
|
||||
CuAssertPtrEquals(tc, 0, rtype->itype);
|
||||
CuAssertPtrNotNull(tc, rtype = rt_find("hp"));
|
||||
CuAssertPtrEquals(tc, 0, rtype->itype);
|
||||
CuAssertPtrNotNull(tc, rtype = rt_find("aura"));
|
||||
CuAssertPtrEquals(tc, 0, rtype->itype);
|
||||
test_cleanup();
|
||||
}
|
||||
|
||||
CuSuite *get_item_suite(void)
|
||||
{
|
||||
CuSuite *suite = CuSuiteNew();
|
||||
|
@ -153,5 +174,6 @@ CuSuite *get_item_suite(void)
|
|||
SUITE_ADD_TEST(suite, test_finditemtype);
|
||||
SUITE_ADD_TEST(suite, test_findresourcetype);
|
||||
SUITE_ADD_TEST(suite, test_fix_demand);
|
||||
SUITE_ADD_TEST(suite, test_core_resources);
|
||||
return suite;
|
||||
}
|
||||
|
|
22
src/laws.c
22
src/laws.c
|
@ -4347,17 +4347,17 @@ void init_processor(void)
|
|||
add_proc_order(p, K_GROUP, group_cmd, 0, NULL);
|
||||
|
||||
p += 10;
|
||||
add_proc_order(p, K_QUIT, quit_cmd, 0, NULL);
|
||||
add_proc_order(p, K_URSPRUNG, origin_cmd, 0, NULL);
|
||||
add_proc_order(p, K_ALLY, ally_cmd, 0, NULL);
|
||||
add_proc_order(p, K_PREFIX, prefix_cmd, 0, NULL);
|
||||
add_proc_order(p, K_SETSTEALTH, setstealth_cmd, 0, NULL);
|
||||
add_proc_order(p, K_STATUS, status_cmd, 0, NULL);
|
||||
add_proc_order(p, K_COMBATSPELL, combatspell_cmd, 0, NULL);
|
||||
add_proc_order(p, K_DISPLAY, display_cmd, 0, NULL);
|
||||
add_proc_order(p, K_NAME, name_cmd, 0, NULL);
|
||||
add_proc_order(p, K_GUARD, guard_off_cmd, 0, NULL);
|
||||
add_proc_order(p, K_RESHOW, reshow_cmd, 0, NULL);
|
||||
add_proc_order(p, K_QUIT, &quit_cmd, 0, NULL);
|
||||
add_proc_order(p, K_URSPRUNG, &origin_cmd, 0, NULL);
|
||||
add_proc_order(p, K_ALLY, &ally_cmd, 0, NULL);
|
||||
add_proc_order(p, K_PREFIX, &prefix_cmd, 0, NULL);
|
||||
add_proc_order(p, K_SETSTEALTH, &setstealth_cmd, 0, NULL);
|
||||
add_proc_order(p, K_STATUS, &status_cmd, 0, NULL);
|
||||
add_proc_order(p, K_COMBATSPELL, &combatspell_cmd, 0, NULL);
|
||||
add_proc_order(p, K_DISPLAY, &display_cmd, 0, NULL);
|
||||
add_proc_order(p, K_NAME, &name_cmd, 0, NULL);
|
||||
add_proc_order(p, K_GUARD, &guard_off_cmd, 0, NULL);
|
||||
add_proc_order(p, K_RESHOW, &reshow_cmd, 0, NULL);
|
||||
|
||||
if (get_param_int(global.parameters, "rules.alliances", 0) == 1) {
|
||||
p += 10;
|
||||
|
|
Loading…
Reference in New Issue