added a lua module that marks factions as cursed

This commit is contained in:
Enno Rehling 2015-08-31 11:19:16 +02:00
parent 94850e86cb
commit 4dc94323d8
2 changed files with 30 additions and 1 deletions

View File

@ -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

View File

@ -14,5 +14,6 @@ return {
require('eressea.astral'),
require('eressea.locales'),
require('eressea.jsreport'),
require('eressea.ents')
require('eressea.ents'),
require('eressea.cursed')
}