forked from github/server
christmas implementation (not very fast, but working)
This commit is contained in:
parent
3067eb51ea
commit
dd58ca4830
3 changed files with 20 additions and 6 deletions
|
@ -85,6 +85,7 @@ function process(orders)
|
||||||
process_orders()
|
process_orders()
|
||||||
|
|
||||||
-- post-turn updates:
|
-- post-turn updates:
|
||||||
|
update_xmas2006()
|
||||||
update_embassies()
|
update_embassies()
|
||||||
update_guards()
|
update_guards()
|
||||||
update_scores()
|
update_scores()
|
||||||
|
|
|
@ -11,9 +11,9 @@ end
|
||||||
|
|
||||||
function xmas2004()
|
function xmas2004()
|
||||||
if get_gamename() == "Eressea" then
|
if get_gamename() == "Eressea" then
|
||||||
if not get_flag("xm04") then
|
if not get_key("xm04") then
|
||||||
print("Es weihnachtet sehr (2004)")
|
print("Es weihnachtet sehr (2004)")
|
||||||
set_flag("xm04", true)
|
set_key("xm04", true)
|
||||||
for f in factions() do
|
for f in factions() do
|
||||||
f:add_item("speedsail", 1)
|
f:add_item("speedsail", 1)
|
||||||
f:add_notice("santa2004")
|
f:add_notice("santa2004")
|
||||||
|
|
|
@ -1,14 +1,27 @@
|
||||||
function use_xmastree(u, amount)
|
function use_xmastree(u, amount)
|
||||||
print("NOT IMPLEMENTED: use_xmastree")
|
u.region:set_key("xm06", true)
|
||||||
-- u:use_pooled("xmastree", amount)
|
u:use_pooled("xmastree", amount)
|
||||||
return -1
|
return -1
|
||||||
end
|
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()
|
function xmas2006()
|
||||||
if get_gamename() == "Eressea" then
|
if get_gamename() == "Eressea" then
|
||||||
if not get_flag("xm06") then
|
if not get_key("xm06") then
|
||||||
print("Es weihnachtet sehr (2006)")
|
print("Es weihnachtet sehr (2006)")
|
||||||
set_flag("xm06", true)
|
set_key("xm06", true)
|
||||||
for f in factions() do
|
for f in factions() do
|
||||||
f:add_item("xmastree", 1)
|
f:add_item("xmastree", 1)
|
||||||
f:add_notice("santa2006")
|
f:add_notice("santa2006")
|
||||||
|
|
Loading…
Reference in a new issue