Created
September 9, 2019 19:38
-
-
Save ennorehling/a23b971504e3949d1d9b0a05894019d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function test_rider_leads_horses() | |
local r0 = region.create(0, 0, "plain") | |
local r1 = region.create(1, 0, "plain") | |
local r2 = region.create(2, 0, "plain") | |
local r3 = region.create(3, 0, "plain") | |
local f = faction.create("human") | |
-- lead 1 extra horse per level while riding: | |
local u1 = unit.create(f, r0, 1) | |
u1:set_skill("riding", 1) | |
u1:add_item("horse", 2) | |
u1:add_order("NACH O O O") | |
-- too heavy to ride, walk the horses: | |
local u2 = unit.create(f, r0, 1) | |
u2:set_skill("riding", 1) | |
u1:add_item("horse", 2) | |
u2:add_item("money", 2000 * 2) | |
u2:add_order("NACH O O") | |
process_orders() | |
print(u1.region.x, u2.region.x) | |
assert_equal(r1, u2.region) | |
assert_equal(r2, u1.region) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment