From 97be613e3d26b5c1272fe0b5c627cf1bd66d8885 Mon Sep 17 00:00:00 2001 From: Zahir Khan Date: Wed, 27 Nov 2019 20:26:37 -0500 Subject: [PATCH] Added random turkey message every 10min --- map_gen/maps/turkey.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/map_gen/maps/turkey.lua b/map_gen/maps/turkey.lua index ce9fdc85..fe7c4200 100644 --- a/map_gen/maps/turkey.lua +++ b/map_gen/maps/turkey.lua @@ -2,6 +2,8 @@ local b = require "map_gen.shared.builders" local pic = require "map_gen.data.presets.turkey" local RS = require 'map_gen.shared.redmew_surface' local MGSP = require 'resources.map_gen_settings' +local Event = require 'utils.event' +local turkey_message_random = require 'resources.turkey_messages' RS.set_map_gen_settings( { @@ -9,6 +11,16 @@ RS.set_map_gen_settings( } ) +Event.add( + defines.events.on_tick, + function(event) + if event.tick % 60*600 == 0 then + local message = turkey_message_random[math.random(#turkey_message_random)] + game.print(message) + end + end +) + pic = b.decompress(pic) local shape = b.picture(pic)