1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-03-17 20:58:13 +02:00

v1.1.1.5.0

This commit is contained in:
danielmartin0 2022-03-17 01:40:18 +00:00
parent b068529190
commit 446971f70e
28 changed files with 275 additions and 172 deletions

View File

@ -43,6 +43,6 @@ resources_needed_tooltip_1=At the next destination, resources will be needed in
resources_needed_tooltip_2=The captain can undock early by clicking this button, but only if enough resources have been stored in the captain's cabin.\n\nCost on arrival: __1__\nLeaving now will spend: __2__
resources_needed_tooltip_3=The captain can undock by clicking this button, but only if enough resources are stored in the captain's cabin.
resources_needed_tooltip_1_rocketvariant=At the next destination, these resources will be needed in order to undock early.\n\nFewer resources will be needed the longer you stay, eventually dropping to zero..\n\nThe silo represents a rocket launch.
resources_needed_tooltip_2_rocketvariant=The captain can undock early by clicking this button, but only if enough resources have been stored in the captain's cabin.\n\nThe silo represents a rocket launch.\n\nnCost on arrival: __1__\nLeaving now will spend: __2__
resources_needed_tooltip_3_rocketvariant=The captain can undock by clicking this button, but only if enough resources are stored in the captain's cabin.\n\nThe silo represents a rocket launch.
resources_needed_tooltip_2_rocketvariant=The captain can undock early by clicking this button, but only if enough resources have been stored in the captain's cabin.\n\nThe silo represents a rocket launch rather than a resource.\n\nnCost on arrival: __1__\nLeaving now will spend: __2__
resources_needed_tooltip_3_rocketvariant=The captain can undock by clicking this button, but only if enough resources are stored in the captain's cabin.\n\nThe silo represents a rocket launch rather than a resource.
fuel_tooltip=__1__ stored fuel.\n\nTo store more, send it to the captain's cabin. If the ship runs out of fuel, the crew loses.\n\n*Click* to open the Captain's Store, which only the captain and their officers are authorised to use.

View File

@ -36,7 +36,7 @@ function Public.cost_to_leave_multiplier()
-- return Math.sloped(Common.difficulty(), 9/10)
-- extra factor now that the cost scales with time:
return Math.sloped(Common.difficulty(), 9/10) * 1.5
return Math.sloped(Common.difficulty(), 9/10)
end
Public.rocket_launch_coin_reward = 5000
@ -139,7 +139,9 @@ function Public.boat_passive_pollution_per_minute(time)
if (Common.overworldx()/40) > 25 then T = T * 0.9 end
if time then
if time >= 95/100 * T then
if time >= 100/100 * T then --will still happen regularly, on islands without an auto-undock timer
boost = 20
elseif time >= 95/100 * T then
boost = 16
elseif time >= 90/100 * T then
boost = 12
@ -162,9 +164,9 @@ function Public.boat_passive_pollution_per_minute(time)
end
function Public.base_evolution()
function Public.base_evolution_leagues(leagues)
local evo
local overworldx = Common.overworldx()
local overworldx = leagues
if overworldx == 0 then
evo = 0
@ -238,10 +240,10 @@ function Public.evolution_per_full_silo_charge()
end
function Public.bonus_damage_to_humans()
local ret = 0.050
local ret = 0.025
local diff = Common.difficulty()
if diff <= 0.7 then ret = 0.025 end
if diff >= 1.3 then ret = 0.075 end
if diff <= 0.7 then ret = 0 end
if diff >= 1.3 then ret = 0.050 end
return ret
end
@ -290,7 +292,7 @@ end
function Public.island_richness_avg_multiplier()
local ret
-- local base = 0.7 + 0.1 * (Common.overworldx()/40)^(7/10) --tuned tbh
local base = 0.73 + 0.105 * (Common.overworldx()/40)^(7/10) --tuned tbh
local base = 0.73 + 0.110 * (Common.overworldx()/40)^(7/10) --tuned tbh
ret = base * Math.sloped(Public.crew_scale(), 1/20) --we don't really have resources scaling by player count in this resource-constrained scenario, but we scale a little, to accommodate each player filling their inventory with useful tools. also, I would do 1/14, but we go even slightly lower because we're applying this somewhat sooner than players actually get there.
@ -326,8 +328,16 @@ function Public.kraken_evo_increase_per_shot()
return 1/100 * 0.07
end
function Public.sandworm_evo_increase_per_spawn()
if _DEBUG then
return 1/100
else
return 1/100 * 1/15 * Math.sloped(Common.difficulty(), 1)
end
end
function Public.kraken_kill_reward()
return {{name = 'sulfuric-acid-barrel', count = 5}}
return {{name = 'sulfuric-acid-barrel', count = 10}}
end
function Public.kraken_health()

View File

@ -5,8 +5,8 @@ local inspect = require 'utils.inspect'.inspect
local Public = {}
Public.scenario_id_name = 'pirates'
Public.version_string = '1.1.1.4.2'
Public.version_float = 1.1142
Public.version_string = '1.1.1.5.0'
Public.version_float = 1.1150
Public.blueprint_library_allowed = true
Public.blueprint_importing_allowed = true

View File

@ -68,13 +68,21 @@ function Public.full_update(player)
-- else
local destination = Common.current_destination()
local evolution_base = 0
local evolution_time = 0
local evolution_silo = 0
local evolution_nests = 0
local evolution_leagues = nil
local evolution_kraken = nil
local evolution_time = nil
local evolution_silo = nil
local evolution_nests = nil
local evolution_sandwurms = nil
local evolution_total = nil
local types = {'leagues', 'kraken', 'time', 'silo', 'nests', 'sandwurms'}
local str = 'Local biter evolution\n\n'
if memory.boat and memory.boat.state and (memory.boat.state == Boats.enum_state.ATSEA_SAILING or memory.boat.state == Boats.enum_state.ATSEA_LOADING_MAP) then
evolution_base = evo - (memory.kraken_evo or 0)
-- here Kraken.kraken_slots
evolution_leagues = evo - (memory.kraken_evo or 0)
local krakens = false
if memory.active_sea_enemies and memory.active_sea_enemies.krakens then
for i = 1, Kraken.kraken_slots do
@ -82,26 +90,53 @@ function Public.full_update(player)
end
end
if krakens then
button.tooltip = string.format('Local biter evolution\n\nLeagues: %.2f\nKraken: %.2f\nTotal: %.2f', evolution_base, Balance.kraken_spawns_base_extra_evo + (memory.kraken_evo or 0), Balance.kraken_spawns_base_extra_evo + evo)
button.number = Balance.kraken_spawns_base_extra_evo + evo
evolution_kraken = Balance.kraken_spawns_base_extra_evo + (memory.kraken_evo or 0)
evolution_total = evolution_leagues + Balance.kraken_spawns_base_extra_evo
else
button.tooltip = string.format('Local biter evolution\n\nLeagues: %.2f\nTotal: %.2f', evolution_base, evo)
button.number = evo
evolution_total = evolution_leagues
end
else
if destination and destination.dynamic_data then
evolution_base = destination.dynamic_data.evolution_accrued_leagues or 0
evolution_time = destination.dynamic_data.evolution_accrued_time or 0
evolution_nests = destination.dynamic_data.evolution_accrued_nests or 0
evolution_silo = destination.dynamic_data.evolution_accrued_silo or 0
evolution_leagues = destination.dynamic_data.evolution_accrued_leagues
evolution_time = destination.dynamic_data.evolution_accrued_time
evolution_nests = destination.dynamic_data.evolution_accrued_nests
evolution_silo = destination.dynamic_data.evolution_accrued_silo
evolution_sandwurms = destination.dynamic_data.evolution_accrued_sandwurms
end
button.tooltip = string.format('Local biter evolution\n\nLeagues: %.2f\nTime: %.2f\nNests: %.2f\nSilo: %.2f\nTotal: %.2f', evolution_base, evolution_time, evolution_nests, evolution_silo, evo)
button.number = evo
evolution_total = (evolution_leagues or 0) + (evolution_time or 0) + (evolution_nests or 0) + (evolution_silo or 0) + (evolution_sandwurms or 0)
end
-- end
-- if sprite then
-- button.sprite = spritem
-- end
for _, type in ipairs(types) do
if type == 'leagues' then
if evolution_leagues then
str = str .. string.format('Leagues: %.2f\n', evolution_leagues)
end
elseif type == 'kraken' then
if evolution_kraken then
str = str .. string.format('Kraken: %.2f\n', evolution_kraken)
end
elseif type == 'time' then
if evolution_time then
str = str .. string.format('Time: %.2f\n', evolution_time)
end
elseif type == 'silo' then
if evolution_silo then
str = str .. string.format('Silo: %.2f\n', evolution_silo)
end
elseif type == 'nests' then
if evolution_nests then
str = str .. string.format('Nests: %.2f\n', evolution_nests)
end
elseif type == 'sandwurms' then
if evolution_sandwurms then
str = str .. string.format('Sandwurms: %.2f\n', evolution_sandwurms)
end
end
end
str = str .. string.format('Total: %.2f', evolution_total)
button.number = evolution_total
button.tooltip = str
end
end

View File

@ -549,7 +549,7 @@ function Public.update_gui(player)
flow2.fuel_label_1.caption = Utils.bignumber_abbrevform(memory.stored_fuel or 0) .. '[item=coal]'
flow2.fuel_label_2.caption = Utils.negative_rate_abbrevform(memory.fuel_depletion_rate_memoized or 0)
local color_scale = Math.max(Math.min((- (memory.fuel_depletion_rate_memoized or 0))/50, 1),0)
local color_scale = Math.max(Math.min((- (memory.fuel_depletion_rate_memoized or 0))/30, 1),0)
flow2.fuel_label_2.style.font_color = {
r = GuiCommon.fuel_color_1.r * (1-color_scale) + GuiCommon.fuel_color_2.r * color_scale,
g = GuiCommon.fuel_color_1.g * (1-color_scale) + GuiCommon.fuel_color_2.g * color_scale,
@ -886,7 +886,7 @@ function Public.update_gui(player)
flow1.silo_label_3.caption = Math.floor(dynamic_data.rocketcoalreward/100)/10 .. 'k[item=coal], ' .. Math.floor(Balance.rocket_launch_coin_reward/100)/10 .. 'k[item=coin]'
local tooltip = 'The rocket has launched, and this is the reward.'
local tooltip = 'This island\'s rocket has launched, and this is the reward.'
flow1.tooltip = tooltip
flow1.silo_label_1.tooltip = tooltip
flow1.silo_label_3.tooltip = tooltip
@ -961,7 +961,7 @@ function Public.update_gui(player)
local tooltip = ''
if quest_complete then
tooltip = 'The quest is complete, and this is the reward.'
tooltip = 'This island\'s quest is complete, and this is the reward.'
flow1.quest_label_1.caption = 'Quest:'
flow1.quest_label_1.style.font_color = GuiCommon.achieved_font_color
flow1.quest_label_2.visible = true

View File

@ -259,28 +259,28 @@ local function damage_to_players_changes(event)
local class = memory.classes_table and memory.classes_table[player_index]
local damage_multiplier = 1
if class and class == Classes.enum.MERCHANT then
damage_multiplier = damage_multiplier * 1.5
elseif class and class == Classes.enum.SCOUT then
damage_multiplier = damage_multiplier * 1.25
elseif class and class == Classes.enum.SAMURAI then
damage_multiplier = damage_multiplier * 0.25
elseif class and class == Classes.enum.HATAMOTO then --lethal damage needs to be unaffected
damage_multiplier = damage_multiplier * 0.15
elseif class and class == Classes.enum.IRON_LEG then --lethal damage needs to be unaffected
local inv = event.entity.get_inventory(defines.inventory.character_main)
if not (inv and inv.valid) then return end
local count = inv.get_item_count('iron-ore')
if count and count >= 3500 then
damage_multiplier = damage_multiplier * 0.15
end
else
damage_multiplier = damage_multiplier * (1 + Balance.bonus_damage_to_humans())
end
if event.damage_type.name == 'poison' then --make all poison damage stronger
damage_multiplier = damage_multiplier * 1.25
damage_multiplier = damage_multiplier * 1.5
else
if class and class == Classes.enum.SCOUT then
damage_multiplier = damage_multiplier * 1.25
-- elseif class and class == Classes.enum.MERCHANT then
-- damage_multiplier = damage_multiplier * 1.10
elseif class and class == Classes.enum.SAMURAI then
damage_multiplier = damage_multiplier * 0.25
elseif class and class == Classes.enum.HATAMOTO then --lethal damage needs to be unaffected
damage_multiplier = damage_multiplier * 0.16
elseif class and class == Classes.enum.IRON_LEG then --lethal damage needs to be unaffected
local inv = event.entity.get_inventory(defines.inventory.character_main)
if not (inv and inv.valid) then return end
local count = inv.get_item_count('iron-ore')
if count and count >= 3500 then
damage_multiplier = damage_multiplier * 0.14
end
else
damage_multiplier = damage_multiplier * (1 + Balance.bonus_damage_to_humans())
end
end
@ -872,16 +872,31 @@ local function spawner_died(event)
local destination = Common.current_destination()
if (destination and destination.type and destination.type == Surfaces.enum.ISLAND) then
local extra_evo = Balance.evolution_per_nest_kill()
Common.increment_evo(extra_evo)
if destination.dynamic_data then
destination.dynamic_data.evolution_accrued_nests = destination.dynamic_data.evolution_accrued_nests + extra_evo
local not_boat = true
if memory.enemyboats and #memory.enemyboats > 0 then
for i = 1, #memory.enemyboats do
local eb = memory.enemyboats[i]
if eb.spawner and eb.spawner.valid and event.entity and event.entity.valid and event.entity == eb.spawner then
not_boat = false
break
end
end
end
if not_boat then
local extra_evo = Balance.evolution_per_nest_kill()
Common.increment_evo(extra_evo)
if destination.dynamic_data then
destination.dynamic_data.evolution_accrued_nests = destination.dynamic_data.evolution_accrued_nests + extra_evo
end
end
end
end
local function event_on_entity_died(event)
--== MODDING NOTE: event.cause is not always provided.
local entity = event.entity
if not (entity and entity.valid) then return end
if not (event.force and event.force.valid) then return end
@ -918,6 +933,7 @@ local function event_on_entity_died(event)
if entity and entity.valid and entity.force and entity.force.name == memory.enemy_force_name then
if (entity.name == 'biter-spawner' or entity.name == 'spitter-spawner') then
spawner_died(event)
-- I think the only reason krakens don't trigger this right now is that they are destroyed rather than .die()
else
local destination = Common.current_destination()
if not (destination and destination.dynamic_data and destination.dynamic_data.quest_type and (not destination.dynamic_data.quest_complete)) then return end

View File

@ -145,7 +145,9 @@ Public.chest_loot_data_raw = {
{6, 0, 2, true, 'utility-science-pack', 3, 3},
{0.5, 0.2, 1.4, true, 'construction-robot', 5, 15},
{2, 0.6, 1.4, true, 'roboport', 1, 1},
{2, 0.5, 1.5, true, 'roboport', 1, 1},
{2, 0.5, 1.5, false, 'logistic-chest-passive-provider', 2, 2},
{2, 0.5, 1.5, false, 'logistic-robot', 5, 15},
{4, 0.2, 1.2, true, 'lubricant-barrel', 1, 4},
@ -353,7 +355,8 @@ Public.maze_treasure_data_raw = {
{2, 0, 1.5, true, 'coin', 3000, 6500},
{3, 0, 0.9, false, 'beacon', 1, 1},
{3, 0, 1, false, 'construction-robot', 30, 40},
{1, 0, 1, false, 'construction-robot', 30, 40},
{3, 0, 1, false, 'logistic-chest-passive-provider', 2, 2},
{1, 0.2, 1.8, true, 'explosive-rocket', 6, 8},
@ -402,7 +405,7 @@ Public.dredger_loot_raw = {
{8, 0, 1, false, 'iron-plate', 1, 1},
{8, 0, 1, false, 'copper-plate', 1, 1},
{8, 0, 1, false, 'coal', 1, 1},
{8, 0, 1, false, 'coin', 1, 1},
{10, 0, 1, false, 'coin', 1, 1},
{2, 0, 1, false, 'small-electric-pole', 1, 1},
{1, 0, 1, false, 'medium-electric-pole', 1, 1},
@ -425,9 +428,9 @@ Public.dredger_loot_raw = {
{4, 0, 1, false, 'automation-science-pack', 1, 1},
{4, 0, 1, false, 'logistic-science-pack', 1, 1},
{2, 0, 1, false, 'military-science-pack', 1, 1},
{2, 0, 1, false, 'chemical-science-pack', 1, 1},
{2, 0, 1, false, 'production-science-pack', 1, 1},
{1, 0, 1, false, 'utility-science-pack', 1, 1},
{1, 0, 1, false, 'chemical-science-pack', 1, 1},
{1, 0, 1, false, 'production-science-pack', 1, 1},
{0.5, 0, 1, false, 'utility-science-pack', 1, 1},
{0.012, 0, 0.8, false, 'night-vision-equipment', 1, 1},
{0.01, 0, 1, false, 'exoskeleton-equipment', 1, 1},

View File

@ -47,7 +47,7 @@ function Public.try_ore_spawn(surface, realp, source_name, density_bonus)
local placed
if choice == 'crude-oil' then
placed = Common.oil_abstract_to_real(choices[choice]/2 + 10) * (0.6 + Math.random())
placed = Common.oil_abstract_to_real(6 + 0.7*choices[choice]/(Math.max(1, Math.ceil((choices[choice]/4)^(1/2))))) * (0.8 + 0.4 * Math.random()) --thesixthroc's magic function, just plot this to see that it makes sense
placed = Math.min(placed, Common.oil_abstract_to_real(choices[choice]))

View File

@ -101,20 +101,19 @@ function Public.generate_overworld_destination(p)
elseif macrop.x == 2 then
type = Surfaces.enum.ISLAND
subtype = Surfaces.Island.enum.STANDARD_VARIANT --aesthetically different to first map
elseif (macrop.x > 25 and (macrop.x - 22) % 18 == 0) then --we want this to overwrite dock, so putting it here
elseif (macrop.x > 25 and (macrop.x - 22) % 20 == 0) then --we want this to overwrite dock, so putting it here
type = Surfaces.enum.ISLAND
subtype = Surfaces.Island.enum.RADIOACTIVE
elseif (macrop.x > 25 and (macrop.x - 22) % 18 == 10) then --we want this to overwrite dock, so putting it here
elseif (macrop.x > 25 and (macrop.x - 22) % 20 == 18) then --we want this to overwrite dock, so putting it here
type = Surfaces.enum.ISLAND
subtype = Surfaces.Island.enum.MAZE
elseif (macrop.x > 25 and (macrop.x - 22) % 18 == 14) then --we want this to overwrite dock, so putting it here
type = Surfaces.enum.ISLAND
subtype = Surfaces.Island.enum.WALKWAYS
elseif macrop.x == 23 then --overwrite dock. rocket launch cost
type = Surfaces.enum.ISLAND
subtype = Surfaces.Island.enum.WALKWAYS
elseif macrop.y == -1 and (((macrop.x % 4) == 3 and macrop.x ~= 15) or macrop.x == 14) then --avoid x=15 because radioactive is there
type = Surfaces.enum.DOCK
elseif macrop.x == 3 then
type = nil
elseif macrop.x == 5 then --biter boats appear. large island works well so players run off
type = Surfaces.enum.ISLAND
subtype = Surfaces.Island.enum.STANDARD
@ -175,7 +174,7 @@ function Public.generate_overworld_destination(p)
if _DEBUG and type == Surfaces.enum.ISLAND then
-- warning: the first map is unique in that it isn't all loaded by the time you arrive, which can cause issues. For example, structures might get placed after ore, thereby deleting the ore underneath them.
subtype = Surfaces.Island.enum.WALKWAYS
subtype = Surfaces.Island.enum.MAZE
-- subtype = nil
-- type = Surfaces.enum.DOCK
end
@ -192,43 +191,37 @@ function Public.generate_overworld_destination(p)
local static_params = Utils.deepcopy(scope.Data.static_params_default)
local base_cost_to_undock
-- These need to scale up slower than the static fuel depletion rate:
local normal_costitems = {'electronic-circuit', 'advanced-circuit'}
-- local normal_costitems = {'electronic-circuit', 'engine-unit', 'advanced-circuit'}
local base_cost_0 = {
['electronic-circuit'] = Math.ceil(((macrop.x-2)^(2/3))*80),
}
-- These need to scale up slightly slower than the static fuel depletion rate, so you're increasingly incentivised to leave:
local base_cost_1 = {
['electronic-circuit'] = Math.ceil(((macrop.x-2)^(2/3))*80),
-- ['engine-unit'] = Math.ceil(((macrop.x-7)^(2/3))*12),
['electronic-circuit'] = Math.ceil(((macrop.x-2)^(2/3))*120),
}
local base_cost_2 = {
['electronic-circuit'] = Math.ceil(((macrop.x-2)^(2/3))*80),
-- ['engine-unit'] = Math.ceil(((macrop.x-7)^(2/3))*12),
['advanced-circuit'] = Math.ceil(((macrop.x-14)^(2/3))*12),
['electronic-circuit'] = Math.ceil(((macrop.x-2)^(2/3))*180),
['advanced-circuit'] = Math.ceil(((macrop.x-14)^(2/3))*18),
-- the below got this response from a new player: "This feels... underwhelming."
-- ['electronic-circuit'] = Math.ceil(((macrop.x-2)^(2/3))*120),
-- ['advanced-circuit'] = Math.ceil(((macrop.x-14)^(2/3))*18),
}
local base_cost_2b = {
['electronic-circuit'] = Math.ceil(((macrop.x-2)^(2/3))*80),
-- ['engine-unit'] = Math.ceil(((macrop.x-7)^(2/3))*12),
['electronic-circuit'] = Math.ceil(((macrop.x-2)^(2/3))*180),
['flying-robot-frame'] = 2,
}
local base_cost_2c = {
['electronic-circuit'] = Math.ceil(((macrop.x-2)^(2/3))*80),
-- ['engine-unit'] = Math.ceil(((macrop.x-7)^(2/3))*12),
['advanced-circuit'] = Math.ceil(((macrop.x-14)^(2/3))*12),
['launch_rocket'] = true,
}
local base_cost_3 = {
['electronic-circuit'] = Math.ceil(((macrop.x-2)^(2/3))*80),
-- ['engine-unit'] = Math.ceil(((macrop.x-7)^(2/3))*12),
['advanced-circuit'] = Math.ceil(((macrop.x-14)^(2/3))*12),
['flying-robot-frame'] = Math.ceil(((macrop.x-18)^(2/3))*10),
['electronic-circuit'] = Math.ceil(((macrop.x-2)^(2/3))*140),
['advanced-circuit'] = Math.ceil(((macrop.x-14)^(2/3))*20),
['launch_rocket'] = true,
}
local base_cost_4 = {
['electronic-circuit'] = Math.ceil(((macrop.x-2)^(2/3))*80),
-- ['engine-unit'] = Math.ceil(((macrop.x-7)^(2/3))*12),
['advanced-circuit'] = Math.ceil(((macrop.x-14)^(2/3))*12),
['electronic-circuit'] = Math.ceil(((macrop.x-2)^(2/3))*140),
['advanced-circuit'] = Math.ceil(((macrop.x-14)^(2/3))*20),
['flying-robot-frame'] = Math.ceil(((macrop.x-18)^(2/3))*10),
['launch_rocket'] = true,
}
local base_cost_5 = {
['electronic-circuit'] = Math.ceil(((macrop.x-2)^(2/3))*140),
['advanced-circuit'] = Math.ceil(((macrop.x-14)^(2/3))*20),
['flying-robot-frame'] = Math.ceil(((macrop.x-18)^(2/3))*10),
}
if macrop.x == 0 then
@ -245,7 +238,7 @@ function Public.generate_overworld_destination(p)
-- base_cost_to_undock = {['electronic-circuit'] = 5}
base_cost_to_undock = nil
elseif macrop.x <= 9 then
base_cost_to_undock = base_cost_0
base_cost_to_undock = base_cost_1
elseif macrop.x <= 15 then
if macrop.x % 3 > 0 then
base_cost_to_undock = base_cost_1
@ -260,12 +253,13 @@ function Public.generate_overworld_destination(p)
else
base_cost_to_undock = nil
end
-- after this point, mandatory
elseif macrop.x <= 23 then
base_cost_to_undock = base_cost_2c
elseif macrop.x <= 24 then
base_cost_to_undock = base_cost_3
elseif macrop.x <= 24 then
base_cost_to_undock = base_cost_4
else
base_cost_to_undock = Utils.deepcopy(base_cost_4)
base_cost_to_undock = Utils.deepcopy(base_cost_5)
local delete = normal_costitems[Math.random(#normal_costitems)]
base_cost_to_undock[delete] = nil
if macrop.x % 2 == 0 then
@ -461,7 +455,7 @@ function Public.generate_overworld_destination(p)
end
if _DEBUG then
kraken_count = 1
-- kraken_count = 1
end
if position_candidates then
@ -640,6 +634,9 @@ function Public.try_overworld_move_v2(vector) --islands stay, crowsnest moves
Balance.apply_crew_buffs_per_x(memory.force)
end
-- add some evo: (this will get reset upon arriving at a destination anyway, so this is just relevant for sea monsters and the like:)
local extra_evo = Balance.base_evolution_leagues(memory.overworldx) - Balance.base_evolution_leagues(memory.overworldx - vector.x)
Common.increment_evo(extra_evo)
end
if memory.overworldx >= CoreData.victory_x then

View File

@ -75,7 +75,7 @@ function Public.parrot_radioactive_tip_1()
end
function Public.parrot_radioactive_tip_2()
local memory = Memory.get_crew_memory()
Common.parrot_speak(memory.force, 'The biters don\'t care if we pollute here, they only care how long we stay...')
Common.parrot_speak(memory.force, 'The biters don\'t care if we pollute here, but they evolve fast...')
end
function Public.parrot_maze_tip_1()
local memory = Memory.get_crew_memory()

View File

@ -562,7 +562,7 @@ function Public.go_from_currentdestination_to_sea()
memory.enemy_force.reset_evolution()
--@FIX: This doesn't change the evo during sea travel, which is relevant now that krakens are in the game:
local base_evo = Balance.base_evolution()
local base_evo = Balance.base_evolution_leagues(memory.overworldx)
Common.set_evo(base_evo)
memory.kraken_evo = 0

View File

@ -77,7 +77,7 @@ Public.explanation = {
[enum.FISHERMAN] = 'They fish at greater distance.',
[enum.SCOUT] = 'They are faster, but frail and deal less damage.',
[enum.SAMURAI] = 'They are tough, and *with no weapon equipped* fight well by melee, but poorly otherwise.',
[enum.MERCHANT] = 'They generate 40 doubloons per league, but are frail.',
[enum.MERCHANT] = 'They generate 40 doubloons per league.',
[enum.SHORESMAN] = 'They move slightly faster and generate ore for the cabin whilst offboard, but move slower onboard.',
[enum.BOATSWAIN] = 'They move faster and generate ore for the cabin whilst below deck, but move slower offboard.',
[enum.PROSPECTOR] = 'They find more resources when handmining ore.',

View File

@ -80,10 +80,10 @@ function Public.revoke_class(captain, player)
local force = memory.force
if force and force.valid and player.index and memory.classes_table[player.index] then
Common.notify_force_light(force, string.format('%s revoked %s from %s.', captain.name, Public.display_form[memory.classes_table[player.index]]), player.name)
memory.spare_classes[#memory.spare_classes + 1] = memory.classes_table[player.index]
memory.classes_table[player.index] = nil
Common.notify_force_light(force, string.format('%s revoked %s from %s.', captain.name, Classes.display_form[memory.classes_table[player.index]]), player.name)
end
end

View File

@ -66,7 +66,7 @@ Public.main_shop_data_1 = {
[Upgrades.enum.MORE_POWER] = {
tooltip = 'Upgrade the ship\'s power.',
what_you_get_sprite_buttons = {['utility/status_working'] = false},
base_cost = {coins = 5000, fuel = 800},
base_cost = {coins = 5000, fuel = 500},
},
[Upgrades.enum.EXTRA_HOLD] = {
tooltip = 'Upgrade the ship\'s hold.',

View File

@ -34,24 +34,24 @@ Public.offers_rockets = {
}
Public.offers_default = {
{price = {{'coin', 750}}, offer = {type = 'give-item', item = 'copper-plate', count = 150}},
{price = {{'coin', 750}}, offer = {type = 'give-item', item = 'iron-plate', count = 150}},
{price = {{'coin', 600}}, offer = {type = 'give-item', item = 'copper-plate', count = 150}},
{price = {{'coin', 600}}, offer = {type = 'give-item', item = 'iron-plate', count = 150}},
{price = {{'coin', 450}}, offer = {type = 'give-item', item = 'piercing-rounds-magazine', count = 14}},
{price = {{'coin', 700}}, offer = {type = 'give-item', item = 'heavy-armor', count = 1}},
{price = {{'coin', 200}}, offer = {type = 'give-item', item = 'gun-turret', count = 2}},
{price = {{'coin', 400}}, offer = {type = 'give-item', item = 'grenade', count = 10}},
{price = {{'coin', 300}}, offer = {type = 'give-item', item = 'defender-capsule', count = 3}},
{price = {{'coin', 400}}, offer = {type = 'give-item', item = 'distractor-capsule', count = 3}},
{price = {{'coin', 400}}, offer = {type = 'give-item', item = 'destroyer-capsule', count = 1}},
{price = {{'coin', 500}}, offer = {type = 'give-item', item = 'slowdown-capsule', count = 5}},
{price = {{'coin', 500}}, offer = {type = 'give-item', item = 'poison-capsule', count = 5}},
{price = {{'coin', 500}}, offer = {type = 'give-item', item = 'gate', count = 12}},
{price = {{'coin', 500}}, offer = {type = 'give-item', item = 'gate', count = 10}},
{price = {{'coin', 100}}, offer = {type = 'give-item', item = 'storage-tank', count = 4}},
{price = {{'coin', 200}}, offer = {type = 'give-item', item = 'big-electric-pole', count = 8}},
{price = {{'coin', 200}}, offer = {type = 'give-item', item = 'steel-furnace', count = 2}},
{price = {{'coin', 300}}, offer = {type = 'give-item', item = 'stack-inserter', count = 1}},
{price = {{'coin', 400}}, offer = {type = 'give-item', item = 'piercing-shotgun-shell', count = 6}},
{price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'flying-robot-frame', count = 2}},
{price = {{'coin', 200}}, offer = {type = 'give-item', item = 'steel-furnace', count = 4}},
{price = {{'coin', 300}}, offer = {type = 'give-item', item = 'stack-inserter', count = 3}},
{price = {{'coin', 750}}, offer = {type = 'give-item', item = 'piercing-shotgun-shell', count = 9}},
{price = {{'coin', 800}}, offer = {type = 'give-item', item = 'flamethrower', count = 1}},
{price = {{'coin', 1500}}, offer = {type = 'give-item', item = 'flamethrower-ammo', count = 4}},
{price = {{'coin', 1500}}, offer = {type = 'give-item', item = 'flying-robot-frame', count = 1}},
}

View File

@ -37,8 +37,8 @@ Public.market_barters = {
}
Public.market_permanent_offers = {
{price = {{'coin', 3000}}, offer = {type = 'give-item', item = 'iron-ore', count = 800}},
{price = {{'coin', 3000}}, offer = {type = 'give-item', item = 'copper-ore', count = 800}},
{price = {{'coin', 2400}}, offer = {type = 'give-item', item = 'iron-ore', count = 800}},
{price = {{'coin', 2400}}, offer = {type = 'give-item', item = 'copper-ore', count = 800}},
{price = {{'coin', 3000}}, offer = {type = 'give-item', item = 'crude-oil-barrel', count = 100}},
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'fast-loader', count = 1}},
{price = {{'coin', 5000}}, offer = {type = 'give-item', item = 'beacon', count = 2}},
@ -48,14 +48,12 @@ Public.market_permanent_offers = {
-- cheap but one-off
Public.market_sales = {
{price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'coal', count = 900}},
{price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'firearm-magazine', count = 500}},
{price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'piercing-rounds-magazine', count = 75}},
{price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'uranium-rounds-magazine', count = 30}},
{price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'piercing-shotgun-shell', count = 50}},
{price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'raw-fish', count = 300}},
{price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'laser-turret', count = 1}},
{price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'vehicle-machine-gun', count = 3}},
{price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'substation', count = 5}},
{price = {{'coin', 3000}}, offer = {type = 'give-item', item = 'modular-armor', count = 1}},
{price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'distractor-capsule', count = 20}},
{price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'poison-capsule', count = 20}},
@ -63,48 +61,50 @@ Public.market_sales = {
{price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'coin', count = 4000}},
{price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'roboport', count = 1}},
{price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'construction-robot', count = 10}},
{price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'logistic-chest-passive-provider', count = 2}},
{price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'logistic-robot', count = 2}},
}
function Public.dock_generate_offers(how_many_barters, how_many_sales)
local ret = {}
-- function Public.dock_generate_offers(how_many_barters, how_many_sales)
-- local ret = {}
local toaddcount
-- local toaddcount
local barterscopy = Utils.deepcopy(Public.market_barters)
toaddcount = how_many_barters
while toaddcount>0 and #barterscopy > 0 do
local index = Math.random(#barterscopy)
local toadd = barterscopy[index]
ret[#ret + 1] = toadd
for i = index, #barterscopy - 1 do
barterscopy[i] = barterscopy[i+1]
end
barterscopy[#barterscopy] = nil
toaddcount = toaddcount - 1
end
-- local barterscopy = Utils.deepcopy(Public.market_barters)
-- toaddcount = how_many_barters
-- while toaddcount>0 and #barterscopy > 0 do
-- local index = Math.random(#barterscopy)
-- local toadd = barterscopy[index]
-- ret[#ret + 1] = toadd
-- for i = index, #barterscopy - 1 do
-- barterscopy[i] = barterscopy[i+1]
-- end
-- barterscopy[#barterscopy] = nil
-- toaddcount = toaddcount - 1
-- end
for _, offer in pairs(Public.market_permanent_offers) do
ret[#ret + 1] = offer
end
-- for _, offer in pairs(Public.market_permanent_offers) do
-- ret[#ret + 1] = offer
-- end
local salescopy = Utils.deepcopy(Public.market_sales)
toaddcount = how_many_sales
while toaddcount>0 and #salescopy > 0 do
local index = Math.random(#salescopy)
local toadd = salescopy[index]
ret[#ret + 1] = toadd
for i = index, #salescopy - 1 do
salescopy[i] = salescopy[i+1]
end
salescopy[#salescopy] = nil
toaddcount = toaddcount - 1
end
-- local salescopy = Utils.deepcopy(Public.market_sales)
-- toaddcount = how_many_sales
-- while toaddcount>0 and #salescopy > 0 do
-- local index = Math.random(#salescopy)
-- local toadd = salescopy[index]
-- ret[#ret + 1] = toadd
-- for i = index, #salescopy - 1 do
-- salescopy[i] = salescopy[i+1]
-- end
-- salescopy[#salescopy] = nil
-- toaddcount = toaddcount - 1
-- end
return ret
end
-- return ret
-- end
function Public.create_dock_markets(surface, p)

View File

@ -208,6 +208,23 @@ Public.maze_undefended_camp = {
},
}
Public.maze_mines = {
name = 'maze_mines',
width = 24,
height = 24,
doNotDestroyExistingEntities = true,
components = {
{
type = 'entities_randomlyplaced',
name = 'land-mine',
force = 'ancient-hostile',
offset = {x = 0, y = 0},
count = 20,
r = 12,
},
},
}
Public.maze_labs = {
name = 'maze_labs',
width = 12,

View File

@ -20,6 +20,8 @@ Public.maze_defended_camp = {}
Public.maze_defended_camp.Data = Data.maze_defended_camp
Public.maze_undefended_camp = {}
Public.maze_undefended_camp.Data = Data.maze_undefended_camp
Public.maze_mines = {}
Public.maze_mines.Data = Data.maze_mines
Public.maze_worms = {}
Public.maze_worms.Data = Data.maze_worms
Public.maze_belts_1 = {}

View File

@ -215,10 +215,20 @@ function Public.spawn_ores_on_arrival(destination, points_to_avoid)
if p then points_to_avoid[#points_to_avoid + 1] = {x=p.x, y=p.y, r=11} end
if ore == 'crude-oil' then
local amount = Common.oil_abstract_to_real(destination.static_params.abstract_ore_amounts[ore])
surface.create_entity{name = 'crude-oil', amount = amount, position = p}
--@TODO: Make this into a collection of multiple oil patches
local count = Math.max(1, Math.ceil((destination.static_params.abstract_ore_amounts[ore]/3)^(1/2)))
local amount = Common.oil_abstract_to_real(destination.static_params.abstract_ore_amounts[ore]) / count
for i = 1, count do
local p2 = {p.x + Math.random(-7, 7), p.y + Math.random(-7, 7)}
local whilesafety = 0
while (not surface.can_place_entity{name = 'crude-oil', position = p2}) and whilesafety < 30 do
p2 = {p.x + Math.random(-7, 7), p.y + Math.random(-7, 7)}
whilesafety = whilesafety + 1
end
surface.create_entity{name = 'crude-oil', position = p2, amount = amount}
end
destination.dynamic_data.ore_types_spawned[ore] = true
else

View File

@ -25,7 +25,7 @@ function Public.base_ores()
['iron-ore'] = 6.5,
['coal'] = 4.0,
['stone'] = 2.0,
['crude-oil'] = 15,
['crude-oil'] = 25,
}
end

View File

@ -134,7 +134,7 @@ local function terrain_entity_at_relative_position(args, entity)
end
local free_labyrinth_cell_raffle = {
empty = 17,
empty = 16.5,
maze_labs = 0.6,
maze_defended_camp = 1,
maze_undefended_camp = 0.25,
@ -145,6 +145,7 @@ local free_labyrinth_cell_raffle = {
maze_belts_2 = 0.2,
maze_belts_3 = 0.2,
maze_belts_4 = 0.2,
maze_mines = 0.2,
maze_treasure = 0.7,
}

View File

@ -13,7 +13,7 @@ Public.static_params_default = {
starting_time_of_day = 0.45,
brightness_visual_weights = {0.8, 0.8, 0.8},
daynightcycletype = 4,
min_brightness = 0,
min_brightness = 0.05,
base_starting_treasure = 1000,
base_starting_rock_material = 1200,
base_starting_wood = 800,

View File

@ -15,7 +15,6 @@ Public.terraingen_frame_height = 700
Public.static_params_default = {
starting_time_of_day = 0,
daynightcycletype = 1,
solar_power_multiplier = 1,
default_decoratives = true,
base_starting_treasure = 0,
base_starting_rock_material = 8600,
@ -30,7 +29,7 @@ function Public.base_ores() --here, just for the visualisation:
}
end
local rscale = 180
local rscale = 175
local hscale = 0.16
Public.noiseparams = {
radius = {

View File

@ -313,6 +313,13 @@ function Public.underground_worms_ai()
Effects.worm_emerge_effect(surface, emerge_position)
indices_to_remove[#indices_to_remove + 1] = i
if w.chart_tag then w.chart_tag.destroy() end
local extra_evo = Balance.sandworm_evo_increase_per_spawn()
Common.increment_evo(extra_evo)
if destination.dynamic_data then
destination.dynamic_data.evolution_accrued_sandwurms = destination.dynamic_data.evolution_accrued_sandwurms + extra_evo
end
end
end

View File

@ -26,7 +26,7 @@ function Public.base_ores()
['iron-ore'] = 3.6,
['coal'] = 4.8,
['stone'] = 0.5,
['crude-oil'] = 50,
['crude-oil'] = 80,
}
end

View File

@ -12,7 +12,7 @@ Public.terraingen_frame_height = 896
Public.static_params_default = {
starting_time_of_day = 0,
daynightcycletype = 4,
min_brightness = 0.1,
min_brightness = 0.05,
brightness_visual_weights = {1, 1, 1}, --almost pitch black
default_decoratives = false,
base_starting_rock_material = 800,
@ -23,7 +23,7 @@ function Public.base_ores()
['copper-ore'] = 2.6,
['iron-ore'] = 2.8,
['coal'] = 4,
['crude-oil'] = 100,
['crude-oil'] = 120,
}
end

View File

@ -268,12 +268,18 @@ function Public.destination_on_arrival(destination)
end
memory.enemy_force.reset_evolution()
local base_evo = Balance.base_evolution()
local base_evo = Balance.base_evolution_leagues(memory.overworldx)
Common.set_evo(base_evo)
destination.dynamic_data.evolution_accrued_leagues = base_evo
destination.dynamic_data.evolution_accrued_time = 0
destination.dynamic_data.evolution_accrued_nests = 0
destination.dynamic_data.evolution_accrued_silo = 0
if destination.subtype == Islands.enum.RED_DESERT then
destination.dynamic_data.evolution_accrued_sandwurms = 0
else
destination.dynamic_data.evolution_accrued_nests = 0
end
if destination.subtype ~= Islands.enum.RADIOACTIVE then
destination.dynamic_data.evolution_accrued_silo = 0
end
memory.scripted_biters = {}
memory.scripted_unit_groups = {}
@ -635,7 +641,7 @@ function Public.create_surface(destination)
surface.solar_power_multiplier = destination.static_params.solar_power_multiplier or 1
surface.show_clouds = destination.static_params.clouds or false
surface.min_brightness = destination.static_params.min_brightness or 0
surface.min_brightness = destination.static_params.min_brightness or 0.15
surface.brightness_visual_weights = destination.static_params.brightness_visual_weights or {1, 1, 1}
surface.daytime = destination.static_params.starting_time_of_day or 0
@ -698,7 +704,7 @@ function Public.clean_up(destination)
local ef = memory.enemy_force
if ef and ef.valid then
memory.enemy_force.reset_evolution()
local base_evo = Balance.base_evolution()
local base_evo = Balance.base_evolution_leagues(memory.overworldx)
Common.set_evo(base_evo)
end
end

View File

@ -279,7 +279,7 @@ function Public.periodic_free_resources(tickinterval)
Common.give_items_to_crew(Balance.periodic_free_resources_per_destination_5_seconds())
if game.tick % (300*28) == 0 and (destination and destination.subtype and destination.subtype == Islands.enum.RADIOACTIVE) then -- every 140 seconds
if game.tick % (300*30) == 0 and (destination and destination.subtype and destination.subtype == Islands.enum.RADIOACTIVE) then -- every 150 seconds
local count = 2
Common.give_items_to_crew{{name = 'sulfuric-acid-barrel', count = count}}
local force = memory.force