forked from github/server
added a lua module that marks factions as cursed
This commit is contained in:
parent
a00fdf9316
commit
f0a9cc8233
|
@ -0,0 +1,28 @@
|
|||
require 'bit32'
|
||||
|
||||
local function curse(file)
|
||||
for line in file:lines() do
|
||||
f = get_faction(line)
|
||||
if not f then
|
||||
print("no such faction: " .. line)
|
||||
elseif bit32.band(16, f.flags)==0 then
|
||||
print("cursing " .. tostring(f))
|
||||
f.flags = f.flags + 16
|
||||
else
|
||||
print("already cursed: " .. tostring(f))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local cursed = {}
|
||||
|
||||
function cursed.init()
|
||||
print("curses!")
|
||||
local f = io.open("cursed.txt", "r")
|
||||
if f then
|
||||
print("found cursed.txt")
|
||||
curse(f)
|
||||
end
|
||||
end
|
||||
|
||||
return cursed
|
|
@ -14,5 +14,6 @@ return {
|
|||
require('eressea.astral'),
|
||||
require('eressea.locales'),
|
||||
require('eressea.jsreport'),
|
||||
require('eressea.ents')
|
||||
require('eressea.ents'),
|
||||
require('eressea.cursed')
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue