christmas implementation (not very fast, but working)

This commit is contained in:
Enno Rehling 2007-01-13 21:30:36 +00:00
parent 3067eb51ea
commit dd58ca4830
3 changed files with 20 additions and 6 deletions

View File

@ -85,6 +85,7 @@ function process(orders)
process_orders()
-- post-turn updates:
update_xmas2006()
update_embassies()
update_guards()
update_scores()

View File

@ -11,9 +11,9 @@ end
function xmas2004()
if get_gamename() == "Eressea" then
if not get_flag("xm04") then
if not get_key("xm04") then
print("Es weihnachtet sehr (2004)")
set_flag("xm04", true)
set_key("xm04", true)
for f in factions() do
f:add_item("speedsail", 1)
f:add_notice("santa2004")

View File

@ -1,14 +1,27 @@
function use_xmastree(u, amount)
print("NOT IMPLEMENTED: use_xmastree")
-- u:use_pooled("xmastree", amount)
u.region:set_key("xm06", true)
u:use_pooled("xmastree", amount)
return -1
end
function update_xmas2006()
if get_season == "winter" then
for r in regions() do
if r:get_key("xm06") then
trees = r:get_resource("tree")
if trees>0 then
r:set_resource("tree", trees * 1.1)
end
end
end
end
end
function xmas2006()
if get_gamename() == "Eressea" then
if not get_flag("xm06") then
if not get_key("xm06") then
print("Es weihnachtet sehr (2006)")
set_flag("xm06", true)
set_key("xm06", true)
for f in factions() do
f:add_item("xmastree", 1)
f:add_notice("santa2006")