1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-02-11 13:39:14 +02:00

mountain fortress tweaks

This commit is contained in:
hanakocz 2020-04-18 06:09:55 +02:00
parent c71a2eeac3
commit b66f9df935
4 changed files with 21 additions and 14 deletions

View File

@ -77,8 +77,8 @@ local market_offers = {
}
local function create_wagon_room()
local width = 17
local height = 39
local width = 32
local height = 64
local map_gen_settings = {
["width"] = width,
["height"] = height,
@ -98,8 +98,8 @@ local function create_wagon_room()
surface.request_to_generate_chunks({0,0}, 1)
surface.force_generate_chunk_requests()
for x = width * -0.5 + 1, width * 0.5, 1 do
for y = height * -0.5, height * 0.5, 1 do
for x = width * -0.5, width * 0.5 - 1, 1 do
for y = height * -0.5, height * 0.5 - 1, 1 do
surface.set_tiles({{name = "tutorial-grid", position = {x,y}}})
if math.random(1, 5) == 1 and y > 2 then
surface.spill_item_stack({x + math.random(0, 9) * 0.1,y + math.random(0, 9) * 0.1},{name = "raw-fish", count = 1}, false)
@ -107,20 +107,20 @@ local function create_wagon_room()
end
end
for x = width * -0.5 + 6, width * 0.5 - 5, 1 do
for y = height * -0.5 + 2, height * -0.5 + 4, 1 do
for x = width * -0.5 + 4, width * 0.5 - 5, 1 do
for y = height * -0.5 + 4, height * -0.5 + 6, 1 do
local p = {x,y}
surface.set_tiles({{name = "water", position = p}})
if math.random(1, 2) == 1 then surface.create_entity({name = "fish", position = p}) end
end
end
local market = surface.create_entity({name = "market", position = {0, height * -0.5 + 7}, force="neutral", create_build_effect_smoke = false})
local market = surface.create_entity({name = "market", position = {0, height * -0.5 + 9}, force="neutral", create_build_effect_smoke = false})
market.minable = false
market.destructible = false
for _, offer in pairs(market_offers) do market.add_market_item(offer) end
for _, x in pairs({width * -0.5, width * 0.5 + 1}) do
for _, x in pairs({width * -0.5 -0.5, width * 0.5 + 0.5}) do
local e = surface.create_entity({name = "car", position = {x, 0}, force = "player", create_build_effect_smoke = false})
e.get_inventory(defines.inventory.fuel).insert({name = "wood", count = 16})
e.destructible = false
@ -133,7 +133,7 @@ local function create_wagon_room()
e.ai_settings.allow_try_return_to_spawner = false
local positions = {}
for x = width * -0.5 + 2, width * 0.5 - 1, 1 do
for x = width * -0.5 + 2, width * 0.5 - 2, 1 do
for y = 4, height * 0.5 - 1, 1 do
positions[#positions + 1] = {x = x, y = y}
end

View File

@ -181,7 +181,7 @@ local function hidden_biter(entity)
if math_random(1, 64) == 1 then
BiterHealthBooster.add_boss_unit(unit, m * 10 + 1, 0.38)
else
BiterHealthBooster.add_unit(unit, m * 0.2 + 1)
BiterHealthBooster.add_unit(unit, m * 0.1 + 1)
end
end
@ -290,6 +290,7 @@ local function on_entity_died(event)
end
if event.entity.force.index == 3 then
if event.entity.name == "character" then return end
--local r_max = 15 - math.floor(math.abs(event.entity.position.y) / (level_depth * 0.5))
--if r_max < 3 then r_max = 3 end
if math_random(1,8) == 1 then

View File

@ -199,6 +199,7 @@ local function process_level_8_position(p, seed, tiles, entities, markets, treas
end
if math_random(1,96) == 1 then entities[#entities + 1] = {name = scrap_entities[math_random(1, scrap_entities_index)], position = p, force = "enemy"} end
if math_random(1,5) > 1 then entities[#entities + 1] = {name="mineable-wreckage", position=p} end
if math_random(1,256) == 1 then entities[#entities + 1] = {name ="land-mine", position = p, force = "enemy"} end
return
end
return
@ -215,7 +216,7 @@ local function process_level_8_position(p, seed, tiles, entities, markets, treas
if scrapyard > -0.15 and scrapyard < 0.15 then
if math_floor(large_caves * 10) % 4 < 3 then
tiles[#tiles + 1] = {name = "dirt-7", position = p}
if math_random(1,2) == 1 then entities[#entities + 1] = {name = rock_raffle[math_random(1, size_of_rock_raffle)], position = p} end
if math_random(1,2) == 1 then entities[#entities + 1] = {name = rock_raffle[math_random(1, size_of_rock_raffle)], position = p} end
return
end
end
@ -223,6 +224,7 @@ local function process_level_8_position(p, seed, tiles, entities, markets, treas
if math_random(1,64) == 1 and cave_ponds > 0.6 then entities[#entities + 1] = {name = "crude-oil", position = p, amount = get_oil_amount(p)} end
tiles[#tiles + 1] = {name = "stone-path", position = p}
if math_random(1,256) == 1 then entities[#entities +1] = {name ="land-mine", position = p, force = "enemy"} end
end
local function process_level_7_position(p, seed, tiles, entities, markets, treasure)

View File

@ -7,16 +7,20 @@ local math_abs = math.abs
local LootRaffle = require "functions.loot_raffle"
function Public.treasure_chest(surface, position, container_name)
local budget = 32 + math_abs(position.y) * 5
local budget = 32 + math_abs(position.y) * 2
budget = budget * math_random(25, 175) * 0.01
if math_random(1,200) == 1 then budget = budget * 5 end
if math_random(1,200) == 1 then
budget = budget * 10
container_name = "compilatron-chest"
end
budget = math_floor(budget) + 1
local item_stacks = LootRaffle.roll(budget, 16)
local item_stacks = LootRaffle.roll(budget, 8)
local container = surface.create_entity({name = container_name, position = position, force = "neutral"})
for _, item_stack in pairs(item_stacks) do
container.insert(item_stack)
end
container.minable = false
end
function Public.treasure_chest_old(surface, position, container_name)