From 1b429183150e43b8cccc413913e1d4147812a188 Mon Sep 17 00:00:00 2001 From: cogito <> Date: Sat, 11 Jan 2020 13:25:24 +0100 Subject: [PATCH] planet_prison: enable flashlight by default Forcing a player to buy a flashlight is a bad idea. This patch removes possiblity of flashlight buying as he'll have it by default. --- maps/planet_prison.lua | 24 ++++++++---------------- maps/planet_prison/config.lua | 28 ---------------------------- 2 files changed, 8 insertions(+), 44 deletions(-) diff --git a/maps/planet_prison.lua b/maps/planet_prison.lua index de2a5073..c6754c4f 100644 --- a/maps/planet_prison.lua +++ b/maps/planet_prison.lua @@ -231,14 +231,12 @@ local function redraw_gui(p) p.gui.left.add(button) end - if perks.flashlight then - button = { - type = "button", - name = "flashlight_toggle", - caption = "Toggle flashlight" - } - p.gui.left.add(button) - end + button = { + type = "button", + name = "flashlight_toggle", + caption = "Toggle flashlight" + } + p.gui.left.add(button) end local function print_merchant_position(player) @@ -313,8 +311,7 @@ local function init_player(p) p.force = game.create_force(p.name) p.force.set_friend("neutral", true) global.this.perks[p.name] = { - flashlight = false, - flashlight_enabled = false, + flashlight_enable = true, minimap = false, chat_global = true, } @@ -718,12 +715,7 @@ local function on_market_item_purchased(e) local o = m.get_market_items()[e.offer_index].offer local perks = global.this.perks[p.name] - if o.effect_description == "Construct a flashlight" then - perks.flashlight = true - perks.flashlight_enable = true - p.character.enable_flashlight() - redraw_gui(p) - elseif o.effect_description == "Construct a GPS receiver" then + if o.effect_description == "Construct a GPS receiver" then perks.minimap = true p.minimap_enabled = true end diff --git a/maps/planet_prison/config.lua b/maps/planet_prison/config.lua index 9758f20f..88e676ef 100644 --- a/maps/planet_prison/config.lua +++ b/maps/planet_prison/config.lua @@ -153,34 +153,6 @@ public.technologies = { } public.merchant_offer = { - { - price = { - { - type = "item", - name = "iron-plate", - amount = 5 - }, - { - type = "item", - name = "copper-cable", - amount = 2 - }, - { - type = "item", - name = "electronic-circuit", - amount = 1 - }, - { - type = "item", - name = "small-lamp", - amount = 1 - } - }, - offer = { - type = "nothing", - effect_description = "Construct a flashlight", - }, - }, { price = { {