Skip to content

Instantly share code, notes, and snippets.

@ennorehling
Created October 24, 2015 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ennorehling/83a23af71bb122831cbf to your computer and use it in GitHub Desktop.
Save ennorehling/83a23af71bb122831cbf to your computer and use it in GitHub Desktop.
local function curse(r)
if not r:get_flag("rain") then
msg = message.create("rain")
msg:set_region("region", r)
msg:send_region(r)
r:set_flag("rain")
end
end
function rain.update(id)
f = get_faction(id)
for r in regions() do
for u in r.units do
if u.faction==f then
curse(r)
break
end
end
end
end
function test_rain_message()
msg = message.create("rain")
msg:set_region("region", r)
assert_equal("In " .. r.name .. " setzt sinntflutartgier Regen ein", msg:render("de"))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment