From 17c633469ebee14ebbc286160633f79c17be38e2 Mon Sep 17 00:00:00 2001 From: MewMew <=> Date: Mon, 29 Oct 2018 20:44:00 +0100 Subject: [PATCH] Caver Miner Update --- maps/cave_miner_changelog.txt | 3 +++ maps/cave_miner_kaboomsticks.lua | 13 +++++++++---- maps/labyrinth.lua | 5 +++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/maps/cave_miner_changelog.txt b/maps/cave_miner_changelog.txt index b8d47390..539bd17e 100644 --- a/maps/cave_miner_changelog.txt +++ b/maps/cave_miner_changelog.txt @@ -1,3 +1,6 @@ +0.18 +cargo wagons, tanks and cars can now only detonate with less than 150 health + 0.17 explosives are now a new game mechanic loot rebalances diff --git a/maps/cave_miner_kaboomsticks.lua b/maps/cave_miner_kaboomsticks.lua index 99e77581..778d4c13 100644 --- a/maps/cave_miner_kaboomsticks.lua +++ b/maps/cave_miner_kaboomsticks.lua @@ -86,7 +86,7 @@ end local function create_explosion_schedule(entity) local inventory = defines.inventory.chest - if entity.name == "car" then inventory = defines.inventory.car_trunk end + if entity.type == "car" then inventory = defines.inventory.car_trunk end local i = entity.get_inventory(inventory) local explosives_amount = i.get_item_count("explosives") if explosives_amount < 1 then return end @@ -113,9 +113,14 @@ local function create_explosion_schedule(entity) entity.die("player") end -local function on_entity_damaged(event) - if event.entity.type == "container" or event.entity.type == "logistic-container" or event.entity.type == "cargo-wagon" or event.entity.name == "car" then - if math.random(1,3) == 1 or event.entity.health <= 0 then create_explosion_schedule(event.entity) end +local function on_entity_damaged(event) + local entity = event.entity + if entity.type == "container" or entity.type == "logistic-container" then + if math.random(1,3) == 1 or entity.health <= 0 then create_explosion_schedule(event.entity) return end + end + if entity.type == "cargo-wagon" or entity.type == "car" then + if entity.health <= 0 then create_explosion_schedule(entity) return end + if entity.health < 150 and math.random(1,3) == 1 then create_explosion_schedule(entity) return end end end diff --git a/maps/labyrinth.lua b/maps/labyrinth.lua index 4c1b4b5f..2e8dfbe7 100644 --- a/maps/labyrinth.lua +++ b/maps/labyrinth.lua @@ -8,7 +8,7 @@ simplex_noise = simplex_noise.d2 local event = require 'utils.event' local unique_rooms = require "maps.labyrinth_unique_rooms" -local labyrinth_difficulty_curve = 500 --- How much size the labyrinth needs to have the highest difficulty. +local labyrinth_difficulty_curve = 400 --- How much size the labyrinth needs to have the highest difficulty. local function create_labyrinth_difficulty_gui(player) if player.gui.top["labyrinth_difficulty"] then player.gui.top["labyrinth_difficulty"].destroy() end @@ -898,7 +898,8 @@ local function on_player_joined_game(event) player.insert {name = 'iron-axe', count = 1} player.insert {name = 'pistol', count = 1} player.insert {name = 'firearm-magazine', count = 32} - end + end + create_labyrinth_difficulty_gui(player) end local inserters = {"inserter", "long-handed-inserter", "burner-inserter", "fast-inserter", "filter-inserter", "stack-filter-inserter", "stack-inserter"}