1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-18 03:21:36 +02:00

Caver Miner Update

This commit is contained in:
MewMew 2018-10-29 20:44:00 +01:00
parent 0b70f736d2
commit 17c633469e
3 changed files with 15 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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"}