1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-05-13 21:56:29 +02:00

new stuff, fixes

This commit is contained in:
hanakocz 2020-02-17 17:37:22 +01:00 committed by GitHub
parent 48df91db17
commit e0cf887347
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 124 additions and 84 deletions

View File

@ -190,8 +190,8 @@ Public.send_near_biters_to_objective = function()
local surface = random_target.surface
local pollution = surface.get_pollution(random_target.position)
local success = false
if pollution > 300 then
surface.pollute(random_target.position, -100)
if pollution > 200 then
surface.pollute(random_target.position, -50)
--game.print("sending objective wave")
success = true
else
@ -268,8 +268,8 @@ local function send_group(unit_group, nearest_player_unit)
local target = targets[math_random(1, #targets)]
local surface = target.surface
local pollution = surface.get_pollution(target.position)
if pollution > 300 then
surface.pollute(target.position, -100)
if pollution > 200 then
surface.pollute(target.position, -50)
--game.print("sending unit group attack")
local commands = {}

View File

@ -209,10 +209,10 @@ local function talks(nearby_characters)
return true
end
local function desync()
local function desync(event)
if global.comfybubble then global.comfybubble.destroy() end
local m = 12
local m2 = m * 0.005
--local m = 12
--local m2 = m * 0.005
-- for i = 1, 32, 1 do
-- global.comfylatron.surface.create_entity({
-- name = "iron-ore-particle",
@ -223,10 +223,20 @@ local function desync()
-- movement = {m2 - (math.random(0, m) * 0.01), m2 - (math.random(0, m) * 0.01)}
-- })
-- end
global.comfylatron.surface.create_entity({name = "medium-explosion", position = global.comfylatron.position})
global.comfylatron.surface.create_entity({name = "flying-text", position = global.comfylatron.position, text = "desync", color = {r = 150, g = 0, b = 0}})
global.comfylatron.destroy()
global.comfylatron = nil
if math_random(1,4) == 1 then
global.comfylatron.surface.create_entity({name = "medium-explosion", position = global.comfylatron.position})
global.comfylatron.surface.create_entity({name = "flying-text", position = global.comfylatron.position, text = "desync", color = {r = 150, g = 0, b = 0}})
global.comfylatron.destroy()
global.comfylatron = nil
else
global.comfylatron.surface.create_entity({name = "flying-text", position = global.comfylatron.position, text = "desync evaded", color = {r = 0, g = 150, b = 0}})
if event.cause then
if event.cause.valid and event.cause.player then
game.print("Comfylatron: I got you this time! Back to work, " .. event.cause.player.name .. "!", {r = 200, g = 0, b = 0})
event.cause.die("player", global.comfylatron)
end
end
end
end
local function alone()
@ -391,7 +401,7 @@ local function on_entity_damaged(event)
if not global.comfylatron then return end
if not event.entity.valid then return end
if event.entity ~= global.comfylatron then return end
desync()
desync(event)
end
local function on_tick()

View File

@ -123,12 +123,12 @@ local function update_gui(player)
[5] = {c = "--\n"}
}
local upgt = {
[1] = {t = "[1]: + 5000 Train Max HP. Current: " .. objective.max_health .. "\n Cost : 2500 coins + 3000 copper plates\n"},
[2] = {t = "[2]: Pollution Filter. Actual value of pollution made: " .. math_floor(300/(objective.filterupgradetier/3+1)) .. "%,\n Cost: 4000 coins + 1000 green circuits\n"},
[1] = {t = "[1]: + 5000 Train Max HP. Current: " .. objective.max_health .. "\n Cost : " .. math_floor(2500 * (1 + objective.hpupgradetier /4)) .. " coins + 3000 copper plates\n"},
[2] = {t = "[2]: Pollution Filter. Actual value of pollution made: " .. math_floor(300/(objective.filterupgradetier/3+1)) .. "%\n Buyable once per 3 jumps.\n Cost: 5000 coins + 2000 green circuits\n"},
[3] = {t = "[3]: Add additional row of Acumulators.\n Cost: 2500 coins + 200 batteries\n"},
[4] = {t = "[4]: Add item pickup distance to players.Current: +" .. objective.pickupupgradetier .. ",\n Cost: 1000 coins + 400 red inserters\n"},
[5] = {t = "[5]: Add +5 inventory slots. Buyable once per 5 jumps.\n Cost: 2000 coins + " .. chests[objective.invupgradetier + 1].c},
[6] = {t = "[6]: Use up more repair tools on train at once. Current: +" .. objective.toolsupgradetier .. "\n Cost: 1000 coins + 200 repair tools\n"},
[4] = {t = "[4]: Add item pickup distance to players.Current: +" .. objective.pickupupgradetier .. ",\n Cost: " .. 1000 * (1 + objective.pickupupgradetier) .. " coins + 400 red inserters\n"},
[5] = {t = "[5]: Add +5 inventory slots. Buyable once per 5 jumps.\n Cost: " .. 2000 * (1 + objective.invupgradetier) .." coins + " .. chests[objective.invupgradetier + 1].c},
[6] = {t = "[6]: Use up more repair tools on train at once. Current: +" .. objective.toolsupgradetier .. "\n Cost: " .. 1000 * (1 + objective.toolsupgradetier) .. " coins + " .. 200 * (1 + objective.toolsupgradetier) .. " repair tools\n"},
[7] = {t = "[7]: Add piping through wagon sides to create water sources for each wagon.\n Cost: 2000 coins + 500 pipes\n"},
[8] = {t = "[8]: Add comfylatron chests that output outside (into cargo wagon 2 and 3)\n Cost: 2000 coins + 100 fast inserters\n"},
[9] = {t = "[9]: Add storage chests to the sides of wagons.\n Buyable once per 5 jumps.\n Cost: 5000 coins + " .. chests[objective.boxupgradetier + 1].c}
@ -141,7 +141,7 @@ local function update_gui(player)
[5] = {t = "[5]: Inventory maxed. Research Mining Productivity for more.\n"},
[6] = {t = "[6]: Repairing at top speed of 5 packs.\n"},
[7] = {t = "[7]: Piping created. Don't spill it!\n"},
[8] = {t = "[8]: Chests created.\n"},
[8] = {t = "[8]: Output chests created.\n"},
[9] = {t = "[9]: Storage chests fully upgraded.\n"}
}
local tooltip = "Insert needed items into chest with upgrade number.\nUpgrading can take a minute.\n\n"

View File

@ -173,7 +173,14 @@ local function create_wagon_room()
surface.daytime = 0.1
surface.request_to_generate_chunks({0,0}, 12)
surface.force_generate_chunk_requests()
local carfpos = {
[1]={x=-33,y=-127},[2]={x=-33,y=-128},[3]={x=-33,y=-129},[4]={x=-33,y=-130},[5]={x=32,y=-127},[6]={x=32,y=-128},[7]={x=32,y=-129},[8]={x=32,y=-130},
[9]={x=-33,y=-2},[10]={x=-33,y=-1},[11]={x=-33,y=0},[12]={x=-33,y=1},[13]={x=32,y=-2},[14]={x=32,y=-1},[15]={x=32,y=0},[16]={x=32,y=1},
[17]={x=-33,y=126},[18]={x=-33,y=127},[19]={x=-33,y=128},[20]={x=-33,y=129},[21]={x=32,y=126},[22]={x=32,y=127},[23]={x=32,y=128},[24]={x=32,y=129}
}
for i = 1, 24, 1 do
surface.set_tiles({{name = "tutorial-grid", position = {carfpos[i].x,carfpos[i].y}}})
end
for x = width * -0.5, width * 0.5 - 1, 1 do
for y = height * 0.5, height * 0.7, 1 do
surface.set_tiles({{name = "out-of-map", position = {x,y}}})

View File

@ -14,6 +14,7 @@ require "maps.chronosphere.chronobubles"
require "maps.chronosphere.ores"
require "on_tick_schedule"
require "modules.biter_noms_you"
local Server = require 'utils.server'
local Ai = require "maps.chronosphere.ai"
local unearthing_worm = require "functions.unearthing_worm"
local unearthing_biters = require "functions.unearthing_biters"
@ -49,7 +50,9 @@ function generate_overworld(surface, optplanet)
local planet = nil
if not optplanet then
planet = chronobuble.determine_planet(nil)
game.print("Planet info: " .. planet[1].name.name .. ", Ore richness: " .. planet[1].ore_richness.name .. ", Speed of day: " .. planet[1].day_speed.name, {r=0.98, g=0.66, b=0.22})
local message = "Planet info: " .. planet[1].name.name .. ", Ore richness: " .. planet[1].ore_richness.name .. ", Speed of day: " .. planet[1].day_speed.name
game.print(message, {r=0.98, g=0.66, b=0.22})
Server.to_discord_embed(message)
global.objective.planet = planet
else
planet = optplanet
@ -200,16 +203,24 @@ function Public.reset_map()
game.difficulty_settings.technology_price_multiplier = 0.5
game.map_settings.enemy_evolution.destroy_factor = 0.001
game.difficulty_settings.technology_price_multiplier = 0.6
game.map_settings.enemy_evolution.destroy_factor = 0.006
game.map_settings.enemy_evolution.pollution_factor = 0
game.map_settings.enemy_evolution.time_factor = 4e-05
game.map_settings.enemy_evolution.time_factor = 8e-05
game.map_settings.enemy_expansion.enabled = true
game.map_settings.enemy_expansion.max_expansion_cooldown = 3600
game.map_settings.enemy_expansion.min_expansion_cooldown = 3600
game.map_settings.enemy_expansion.settler_group_max_size = 8
game.map_settings.enemy_expansion.settler_group_min_size = 16
game.map_settings.pollution.enabled = true
game.map_settings.pollution.pollution_restored_per_tree_damage = 0.1
game.map_settings.pollution.min_pollution_to_damage_trees = 1
game.map_settings.pollution.max_pollution_to_restore_trees = 0
game.map_settings.pollution.pollution_with_max_forest_damage = 10
game.map_settings.pollution.pollution_per_tree_damage = 0.5
game.map_settings.pollution.ageing = 0
game.map_settings.pollution.diffusion_ratio = 0.1
game.map_settings.pollution.enemy_attack_pollution_consumption_modifier = 0.5
game.forces.player.technologies["land-mine"].enabled = false
game.forces.player.technologies["landfill"].enabled = false
@ -299,8 +310,9 @@ local function check_upgrades()
local inv = global.hpchest.get_inventory(defines.inventory.chest)
local countcoins = inv.get_item_count("coin")
local count2 = inv.get_item_count("copper-plate")
if countcoins >= 2500 and count2 >= 3000 and objective.hpupgradetier < 18 then
inv.remove({name = "coin", count = 2500})
local coincost = math_floor(2500 * (1 + objective.hpupgradetier /4))
if countcoins >= coincost and count2 >= 3000 and objective.hpupgradetier < 18 then
inv.remove({name = "coin", count = coincost})
inv.remove({name = "copper-plate", count = 3000})
game.print("Comfylatron: Train's max HP was upgraded.", {r=0.98, g=0.66, b=0.22})
objective.hpupgradetier = objective.hpupgradetier + 1
@ -312,9 +324,9 @@ local function check_upgrades()
local inv = global.filterchest.get_inventory(defines.inventory.chest)
local countcoins = inv.get_item_count("coin")
local count2 = inv.get_item_count("electronic-circuit")
if countcoins >= 4000 and count2 >= 1000 and objective.filterupgradetier < 9 then
inv.remove({name = "coin", count = 4000})
inv.remove({name = "electronic-circuit", count = 1000})
if countcoins >= 5000 and count2 >= 2000 and objective.filterupgradetier < 9 and objective.chronojumps >= (objective.filterupgradetier + 1) * 3 then
inv.remove({name = "coin", count = 5000})
inv.remove({name = "electronic-circuit", count = 2000})
game.print("Comfylatron: Train's pollution filter was upgraded.", {r=0.98, g=0.66, b=0.22})
objective.filterupgradetier = objective.filterupgradetier + 1
end
@ -335,12 +347,13 @@ local function check_upgrades()
local inv = global.playerchest.get_inventory(defines.inventory.chest)
local countcoins = inv.get_item_count("coin")
local count2 = inv.get_item_count("long-handed-inserter")
if countcoins >= 1000 and count2 >= 400 and objective.pickupupgradetier < 4 then
inv.remove({name = "coin", count = 1000})
local coincost = 1000 * (1 + objective.pickupupgradetier)
if countcoins >= coincost and count2 >= 400 and objective.pickupupgradetier < 4 then
inv.remove({name = "coin", count = coincost})
inv.remove({name = "long-handed-inserter", count = 400})
game.print("Comfylatron: Players now have additional red inserter installed on shoulders, increasing their item pickup range.", {r=0.98, g=0.66, b=0.22})
objective.pickupupgradetier = objective.pickupupgradetier + 1
game.forces.player.character_item_pickup_distance_bonus = game.forces.player.character_item_pickup_distance_bonus + 1
game.forces.player.character_loot_pickup_distance_bonus = game.forces.player.character_loot_pickup_distance_bonus + 1
end
end
if global.invchest and global.invchest.valid then
@ -357,8 +370,9 @@ local function check_upgrades()
item = "logistic-chest-storage"
end
local count2 = inv.get_item_count(item)
if countcoins >= 2000 and count2 >= 250 and objective.invupgradetier < 4 and objective.chronojumps >= (objective.invupgradetier + 1) * 5 then
inv.remove({name = "coin", count = 2000})
local coincost = 2000 * (1 + objective.invupgradetier)
if countcoins >= coincost and count2 >= 250 and objective.invupgradetier < 4 and objective.chronojumps >= (objective.invupgradetier + 1) * 5 then
inv.remove({name = "coin", count = coincost})
inv.remove({name = item, count = 250})
game.print("Comfylatron: Players now can carry more trash in their unsorted inventories.", {r=0.98, g=0.66, b=0.22})
objective.invupgradetier = objective.invupgradetier + 1
@ -370,9 +384,11 @@ local function check_upgrades()
local inv = global.toolschest.get_inventory(defines.inventory.chest)
local countcoins = inv.get_item_count("coin")
local count2 = inv.get_item_count("repair-pack")
if countcoins >= 1000 and count2 >= 200 and objective.toolsupgradetier < 4 then
inv.remove({name = "coin", count = 1000})
inv.remove({name = "repair-pack", count = 200})
local coincost = 1000 * (1 + objective.toolsupgradetier)
local toolscost = 200 * (1 + objective.toolsupgradetier)
if countcoins >= coincost and count2 >= toolscost and objective.toolsupgradetier < 4 then
inv.remove({name = "coin", count = coincost})
inv.remove({name = "repair-pack", count = toolscost})
game.print("Comfylatron: Train now gets repaired with additional repair kit at once.", {r=0.98, g=0.66, b=0.22})
objective.toolsupgradetier = objective.toolsupgradetier + 1
end
@ -459,14 +475,14 @@ local function check_upgrades()
chests[#chests + 1] = {name="wooden-chest", position= {-33 ,-189 + i}, force = "player"}
chests[#chests + 1] = {name="wooden-chest", position= {32 ,-189 + i}, force = "player"}
elseif objective.boxupgradetier == 2 then
chests[#chests + 1] = {name="iron-chest", position= {-33 ,-189 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="iron-chest", position= {32 ,-189 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="iron-chest", position= {-33 ,-189 + i}, force = "player", fast_replace = true}
chests[#chests + 1] = {name="iron-chest", position= {32 ,-189 + i}, force = "player", fast_replace = true}
elseif objective.boxupgradetier == 3 then
chests[#chests + 1] = {name="steel-chest", position= {-33 ,-189 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="steel-chest", position= {32 ,-189 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="steel-chest", position= {-33 ,-189 + i}, force = "player", fast_replace = true}
chests[#chests + 1] = {name="steel-chest", position= {32 ,-189 + i}, force = "player", fast_replace = true}
elseif objective.boxupgradetier == 4 then
chests[#chests + 1] = {name="logistic-chest-storage", position= {-33 ,-189 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="logistic-chest-storage", position= {32 ,-189 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="logistic-chest-storage", position= {-33 ,-189 + i}, force = "player", fast_replace = true}
chests[#chests + 1] = {name="logistic-chest-storage", position= {32 ,-189 + i}, force = "player", fast_replace = true}
end
end
for i = 1, 58, 1 do
@ -474,14 +490,14 @@ local function check_upgrades()
chests[#chests + 1] = {name="wooden-chest", position= {-33 ,-127 + i}, force = "player"}
chests[#chests + 1] = {name="wooden-chest", position= {32 ,-127 + i}, force = "player"}
elseif objective.boxupgradetier == 2 then
chests[#chests + 1] = {name="iron-chest", position= {-33 ,-127 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="iron-chest", position= {32 ,-127 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="iron-chest", position= {-33 ,-127 + i}, force = "player", fast_replace = true}
chests[#chests + 1] = {name="iron-chest", position= {32 ,-127 + i}, force = "player", fast_replace = true}
elseif objective.boxupgradetier == 3 then
chests[#chests + 1] = {name="steel-chest", position= {-33 ,-127 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="steel-chest", position= {32 ,-127 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="steel-chest", position= {-33 ,-127 + i}, force = "player", fast_replace = true}
chests[#chests + 1] = {name="steel-chest", position= {32 ,-127 + i}, force = "player", fast_replace = true}
elseif objective.boxupgradetier == 4 then
chests[#chests + 1] ={name="logistic-chest-storage", position= {-33 ,-127 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] ={name="logistic-chest-storage", position= {32 ,-127 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] ={name="logistic-chest-storage", position= {-33 ,-127 + i}, force = "player", fast_replace = true}
chests[#chests + 1] ={name="logistic-chest-storage", position= {32 ,-127 + i}, force = "player", fast_replace = true}
end
end
for i = 1, 58, 1 do
@ -489,14 +505,14 @@ local function check_upgrades()
chests[#chests + 1] = {name="wooden-chest", position= {-33 ,-61 + i}, force = "player"}
chests[#chests + 1] = {name="wooden-chest", position= {32 ,-61 + i}, force = "player"}
elseif objective.boxupgradetier == 2 then
chests[#chests + 1] = {name="iron-chest", position= {-33 ,-61 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="iron-chest", position= {32 ,-61 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="iron-chest", position= {-33 ,-61 + i}, force = "player", fast_replace = true}
chests[#chests + 1] = {name="iron-chest", position= {32 ,-61 + i}, force = "player", fast_replace = true}
elseif objective.boxupgradetier == 3 then
chests[#chests + 1] = {name="steel-chest", position= {-33 ,-61 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="steel-chest", position= {32 ,-61 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="steel-chest", position= {-33 ,-61 + i}, force = "player", fast_replace = true}
chests[#chests + 1] = {name="steel-chest", position= {32 ,-61 + i}, force = "player", fast_replace = true}
elseif objective.boxupgradetier == 4 then
chests[#chests + 1] = {name="logistic-chest-storage", position= {-33 ,-61 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="logistic-chest-storage", position= {32 ,-61 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="logistic-chest-storage", position= {-33 ,-61 + i}, force = "player", fast_replace = true}
chests[#chests + 1] = {name="logistic-chest-storage", position= {32 ,-61 + i}, force = "player", fast_replace = true}
end
end
for i = 1, 58, 1 do
@ -504,14 +520,14 @@ local function check_upgrades()
chests[#chests + 1] = {name="wooden-chest", position= {-33 ,1 + i}, force = "player"}
chests[#chests + 1] = {name="wooden-chest", position= {32 ,1 + i}, force = "player"}
elseif objective.boxupgradetier == 2 then
chests[#chests + 1] = {name="iron-chest", position= {-33 ,1 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="iron-chest", position= {32 ,1 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="iron-chest", position= {-33 ,1 + i}, force = "player", fast_replace = true}
chests[#chests + 1] = {name="iron-chest", position= {32 ,1 + i}, force = "player", fast_replace = true}
elseif objective.boxupgradetier == 3 then
chests[#chests + 1] = {name="steel-chest", position= {-33 ,1 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="steel-chest", position= {32 ,1 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="steel-chest", position= {-33 ,1 + i}, force = "player", fast_replace = true}
chests[#chests + 1] = {name="steel-chest", position= {32 ,1 + i}, force = "player", fast_replace = true}
elseif objective.boxupgradetier == 4 then
chests[#chests + 1] = {name="logistic-chest-storage", position= {-33 ,1 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="logistic-chest-storage", position= {32 ,1 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="logistic-chest-storage", position= {-33 ,1 + i}, force = "player", fast_replace = true}
chests[#chests + 1] = {name="logistic-chest-storage", position= {32 ,1 + i}, force = "player", fast_replace = true}
end
end
for i = 1, 58, 1 do
@ -519,14 +535,14 @@ local function check_upgrades()
chests[#chests + 1] = {name="wooden-chest", position= {-33 ,67 + i}, force = "player"}
chests[#chests + 1] = {name="wooden-chest", position= {32 ,67 + i}, force = "player"}
elseif objective.boxupgradetier == 2 then
chests[#chests + 1] = {name="iron-chest", position= {-33 ,67 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="iron-chest", position= {32 ,67 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="iron-chest", position= {-33 ,67 + i}, force = "player", fast_replace = true}
chests[#chests + 1] = {name="iron-chest", position= {32 ,67 + i}, force = "player", fast_replace = true}
elseif objective.boxupgradetier == 3 then
chests[#chests + 1] = {name="steel-chest", position= {-33 ,67 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="steel-chest", position= {32 ,67 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="steel-chest", position= {-33 ,67 + i}, force = "player", fast_replace = true}
chests[#chests + 1] = {name="steel-chest", position= {32 ,67 + i}, force = "player", fast_replace = true}
elseif objective.boxupgradetier == 4 then
chests[#chests + 1] = {name="logistic-chest-storage", position= {-33 ,67 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="logistic-chest-storage", position= {32 ,67 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="logistic-chest-storage", position= {-33 ,67 + i}, force = "player", fast_replace = true}
chests[#chests + 1] = {name="logistic-chest-storage", position= {32 ,67 + i}, force = "player", fast_replace = true}
end
end
for i = 1, 58, 1 do
@ -534,14 +550,14 @@ local function check_upgrades()
chests[#chests + 1] = {name="wooden-chest", position= {-33 ,129 + i}, force = "player"}
chests[#chests + 1] = {name="wooden-chest", position= {32 ,129 + i}, force = "player"}
elseif objective.boxupgradetier == 2 then
chests[#chests + 1] = {name="iron-chest", position= {-33 ,129 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="iron-chest", position= {32 ,129 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="iron-chest", position= {-33 ,129 + i}, force = "player", fast_replace = true}
chests[#chests + 1] = {name="iron-chest", position= {32 ,129 + i}, force = "player", fast_replace = true}
elseif objective.boxupgradetier == 3 then
chests[#chests + 1] = {name="steel-chest", position= {-33 ,129 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="steel-chest", position= {32 ,129 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="steel-chest", position= {-33 ,129 + i}, force = "player", fast_replace = true}
chests[#chests + 1] = {name="steel-chest", position= {32 ,129 + i}, force = "player", fast_replace = true}
elseif objective.boxupgradetier == 4 then
chests[#chests + 1] = {name="logistic-chest-storage", position= {-33 ,129 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="logistic-chest-storage", position= {32 ,129 + i}, force = "player", fast_replace = true, player = "Hanakocz"}
chests[#chests + 1] = {name="logistic-chest-storage", position= {-33 ,129 + i}, force = "player", fast_replace = true}
chests[#chests + 1] = {name="logistic-chest-storage", position= {32 ,129 + i}, force = "player", fast_replace = true}
end
end
local surface = game.surfaces["cargo_wagon"]
@ -646,8 +662,10 @@ function chronojump(choice)
local planet = nil
if choice then
planet = chronobuble.determine_planet(choice)
game.print("Planet info: " .. planet[1].name.name .. ", Ore richness: " .. planet[1].ore_richness.name .. ", Speed of day: " .. planet[1].day_speed.name, {r=0.98, g=0.66, b=0.22})
local message = "Planet info: " .. planet[1].name.name .. ", Ore richness: " .. planet[1].ore_richness.name .. ", Speed of day: " .. planet[1].day_speed.name
game.print(message, {r=0.98, g=0.66, b=0.22})
global.objective.planet = planet
Server.to_discord_embed(message)
end
generate_overworld(surface, planet)
game.forces.player.set_spawn_position({12, 10}, surface)
@ -661,7 +679,10 @@ function chronojump(choice)
else
game.forces["enemy"].evolution_factor = 1
end
game.map_settings.enemy_evolution.time_factor = 4e-05 + 2e-06 * objective.chronojumps
game.map_settings.enemy_evolution.time_factor = 8e-05 + 4e-06 * objective.chronojumps
surface.pollute(global.locomotive.position, 200 * (4 / (objective.filterupgradetier / 2 + 1)) * (1 + global.objective.chronojumps))
game.forces.scrapyard.set_ammo_damage_modifier("bullet", objective.chronojumps / 20)
game.forces.scrapyard.set_turret_attack_modifier("gun-turret", objective.chronojumps / 20)
end
local function check_chronoprogress()
@ -690,10 +711,10 @@ local function charge_chronosphere()
for i = 1, #acus, 1 do
if not acus[i].valid then return end
local energy = acus[i].energy
if energy > 3000000 and objective.chronotimer < objective.chrononeeds - 62 and objective.chronotimer > 130 then
if energy > 3000000 and objective.chronotimer < objective.chrononeeds - 182 and objective.chronotimer > 130 then
acus[i].energy = acus[i].energy - 3000000
objective.chronotimer = objective.chronotimer + 1
game.surfaces[global.active_surface_index].pollute(global.locomotive.position, 100 * (4 / (objective.filterupgradetier / 2 + 1)))
game.surfaces[global.active_surface_index].pollute(global.locomotive.position, 200 * (4 / (objective.filterupgradetier / 2 + 1)))
--log("energy charged from acu")
end
end
@ -770,7 +791,9 @@ local function on_init()
T.main_caption_color = {r = 150, g = 150, b = 0}
T.sub_caption_color = {r = 0, g = 150, b = 0}
global.objective.game_lost = true
game.create_force("scrapyard")
game.forces.scrapyard.set_friend('enemy', true)
game.forces.enemy.set_friend('scrapyard', true)
--global.rocks_yield_ore_maximum_amount = 999
--global.rocks_yield_ore_base_amount = 50
--global.rocks_yield_ore_distance_modifier = 0.025

View File

@ -321,7 +321,7 @@ local function process_scrapyard_position(p, seed, tiles, entities, treasure, pl
if scrapyard < -0.25 or scrapyard > 0.25 then
if math_random(1, 256) == 1 and math_sqrt(p.x * p.x + p.y * p.y) > 50 then
entities[#entities + 1] = {name="gun-turret", position=p, force = "enemy"}
entities[#entities + 1] = {name="gun-turret", position=p, force = "scrapyard"}
end
tiles[#tiles + 1] = {name = "dirt-7", position = p}
if scrapyard < -0.55 or scrapyard > 0.55 then
@ -432,7 +432,7 @@ local function forest_chunk(surface, left_top, level, planet)
for _, entity in pairs(entities) do
if surface.can_place_entity(entity) then
local e = surface.create_entity(entity)
if e.name == "biter-spawner" or e.name == "spitter-spawner" then
if e.name == "biter-spawner" or e.name == "spitter-spawner" or e.name == "small-worm-turret" or e.name == "medium-worm-turret" or e.name == "big-worm-turret" or e.name == "behemoth-worm-turret" then
if math_abs(e.position.x) > 420 or math_abs(e.position.y) > 420 then e.destructible = false end
end
end
@ -461,7 +461,7 @@ local function biter_chunk(surface, left_top, level, planet)
for _, entity in pairs(entities) do
if surface.can_place_entity(entity) then
local e = surface.create_entity(entity)
if e.name == "biter-spawner" or e.name == "spitter-spawner" then
if e.name == "biter-spawner" or e.name == "spitter-spawner" or e.name == "small-worm-turret" or e.name == "medium-worm-turret" or e.name == "big-worm-turret" or e.name == "behemoth-worm-turret" then
if math_abs(e.position.x) > 420 or math_abs(e.position.y) > 420 then e.destructible = false end
end
end
@ -525,7 +525,7 @@ local function normal_chunk(surface, left_top, level, planet)
else
if surface.can_place_entity(entity) then
local e = surface.create_entity(entity)
if e.name == "biter-spawner" or e.name == "spitter-spawner" then
if e.name == "biter-spawner" or e.name == "spitter-spawner" or e.name == "small-worm-turret" or e.name == "medium-worm-turret" or e.name == "big-worm-turret" or e.name == "behemoth-worm-turret" then
if math_abs(e.position.x) > 420 or math_abs(e.position.y) > 420 then e.destructible = false end
end
end

View File

@ -119,8 +119,8 @@ function Public.treasure_chest(surface, position, container_name)
{{name = "decider-combinator", count = math_random(4,8)}, weight = 2, d_min = 0.1, d_max = 1},
{{name = "power-switch", count = 1}, weight = 2, d_min = 0.1, d_max = 1},
{{name = "programmable-speaker", count = math_random(2,4)}, weight = 1, d_min = 0.1, d_max = 1},
{{name = "green-wire", count = math_random(50,99)}, weight = 4, d_min = 0.1, d_max = 1},
{{name = "red-wire", count = math_random(50,99)}, weight = 4, d_min = 0.1, d_max = 1},
{{name = "green-wire", count = math_random(10,29)}, weight = 4, d_min = 0.1, d_max = 1},
{{name = "red-wire", count = math_random(10,29)}, weight = 4, d_min = 0.1, d_max = 1},
{{name = "chemical-plant", count = math_random(1,3)}, weight = 3, d_min = 0.3, d_max = 1},
{{name = "burner-mining-drill", count = math_random(2,4)}, weight = 3, d_min = 0.0, d_max = 0.2},
{{name = "electric-mining-drill", count = math_random(2,4)}, weight = 3, d_min = 0.2, d_max = 1},
@ -160,7 +160,7 @@ function Public.treasure_chest(surface, position, container_name)
}
local jumps = 0
if global.objective.chronojumps then jumps = global.objective.chronojumps end
local distance_to_center = (jumps / 50)
local distance_to_center = (jumps / 50)
if distance_to_center > 1 then distance_to_center = 1 end
for _, t in pairs (chest_loot) do