SHARE
TWEET

Untitled

a guest Sep 20th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function test_rider_leads_horses()
  2.     local r0 = region.create(0, 0, "plain")
  3.     local r1 = region.create(1, 0, "plain")
  4.     local r2 = region.create(2, 0, "plain")
  5.     local r3 = region.create(3, 0, "plain")
  6.     local f = faction.create("human")
  7.     -- lead 1 extra horse per level while riding:
  8.     local u1 = unit.create(f, r0, 1)
  9.     u1:set_skill("riding", 1)
  10.     u1:add_item("horse", 2)
  11.     u1:add_order("NACH O O O")
  12.     -- too heavy to ride, walk the horses:
  13.     local u2 = unit.create(f, r0, 1)
  14.     u2:set_skill("riding", 1)
  15.     u1:add_item("horse", 2)
  16.     u2:add_item("money", 2000 * 2)
  17.     u2:add_order("NACH O O")
  18.  
  19.     process_orders()
  20.     print(u1.region.x, u2.region.x)
  21.     assert_equal(r1, u2.region)
  22.     assert_equal(r2, u1.region)
  23. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top