1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-22 03:38:48 +02:00

v1.0.3.9.9

This commit is contained in:
danielmartin0 2022-03-03 00:19:20 +00:00
parent fe48859374
commit b166b46010
22 changed files with 154 additions and 104 deletions

View File

@ -19,7 +19,7 @@ softmod_info_updates_1=Development
softmod_info_updates_2=Pirate Ship 1.0.3 is currently in testing! The gameplay is reworked to center around a fuel mechanic. This should make for a clear central objective. Please play and help us tune the gameplay. \n\nRecent significant changes: Fuel mechanic replaces gold. Silo death is no longer a lose condition. Additional silos can appear to deconstrain power input. Weakened chest/furnace/pipe resistance to biters. Dock trades revamped. Game made much easier for small crews.
softmod_info_credits_1=Credits
softmod_info_credits_2=Softmod designed and written by thesixthroc. Comfy codebase and help from Gerkiz, Hanakocz and Mew @ Comfy Industries (https://getcomfy.eu). Most island structure blueprints contributed by Mattisso.\n\n"Those white gloves. I'll never forget them 'till the day I die." - Dr. John
softmod_info_credits_2=Softmod designed and written by thesixthroc. Comfy codebase and help from Gerkiz, Hanakocz and Mew @ Comfy Industries (https://getcomfy.eu). Most island structure blueprints contributed by Mattisso.\n\nContact us via Discord. getcomfy.eu\n\n"Those white gloves. I'll never forget them 'till the day I die." - Dr. John
softmod_info_credits_2_old=Softmod designed and written by thesixthroc. Comfy codebase help from Gerkiz, Hanakocz and Mew @ Comfy Industries (https://getcomfy.eu). Most island structure blueprints were contributed by Mattisso. Gold sprite by Clint Bellanger. Parrot sprites by @pixelthen.\n\n"Those white gloves. I'll never forget them 'till the day I die." - Dr. John
softmod_info_body_promote=by thesixthroc

View File

@ -11,6 +11,7 @@ local Structures = require 'maps.pirates.structures.structures'
local Boats = require 'maps.pirates.structures.boats.boats'
local Surfaces = require 'maps.pirates.surfaces.surfaces'
local Islands = require 'maps.pirates.surfaces.islands.islands'
local IslandsCommon = require 'maps.pirates.surfaces.islands.common'
local Sea = require 'maps.pirates.surfaces.sea.sea'
local Crew = require 'maps.pirates.crew'
local Quest = require 'maps.pirates.quest'
@ -137,7 +138,7 @@ function Public.try_main_attack()
if Math.random(500) == 1 then wave_size_multiplier = 5 end --variance in attack sizes
end
local group = Public.spawn_group_of_scripted_biters(2/3, 6, 128, wave_size_multiplier)
local group = Public.spawn_group_of_scripted_biters(2/3, 6, 180, wave_size_multiplier)
local target = Public.generate_main_attack_target()
if not group or not group.valid or not target or not target.valid then return end
@ -163,7 +164,7 @@ function Public.try_secondary_attack()
local surface = game.surfaces[Common.current_destination().surface_name]
local group = Public.spawn_group_of_scripted_biters(2/3, 12, 128, wave_size_multiplier)
local group = Public.spawn_group_of_scripted_biters(2/3, 12, 180, wave_size_multiplier)
if not (group and group.valid) then return end
local target
@ -195,7 +196,7 @@ function Public.try_rogue_attack()
local surface = game.surfaces[Common.current_destination().surface_name]
local group = Public.spawn_group_of_scripted_biters(1/2, 6, 128, wave_size_multiplier)
local group = Public.spawn_group_of_scripted_biters(1/2, 6, 180, wave_size_multiplier)
if not (group and group.valid) then return end
local target = Public.generate_side_attack_target(surface, group.position)
if not (target and target.valid) then return end
@ -405,6 +406,10 @@ function Public.try_spawner_spend_fraction_of_available_pollution_on_biters(spaw
base_pollution_cost_multiplier = base_pollution_cost_multiplier * Balance.scripted_biters_pollution_cost_multiplier()
if destination.subtype and destination.subtype == IslandsCommon.enum.SWAMP then
base_pollution_cost_multiplier = base_pollution_cost_multiplier * 0.85 --biters 15% more aggressive
end
if budget >= minimum_avg_units * Common.averageUnitPollutionCost(evolution) * base_pollution_cost_multiplier then
local function spawn(name2)
@ -422,7 +427,7 @@ function Public.try_spawner_spend_fraction_of_available_pollution_on_biters(spaw
temp_floating_pollution = temp_floating_pollution - unittype_pollutioncost
budget = budget - unittype_pollutioncost
-- flow statistics should reflect the number of biters generated, without factors for extra expenditure:
-- flow statistics should reflect the number of biters generated. Therefore it should mismatch the actual pollution spent, because it should miss all the factors that can vary:
game.pollution_statistics.on_flow(name2, - CoreData.biterPollutionValues[name2] * Balance.scripted_biters_pollution_cost_multiplier())
return biter.unit_number

View File

@ -66,7 +66,7 @@ end
function Public.silo_count()
local E = Public.silo_energy_needed_MJ()
return Math.ceil(E/(16.8*150)) --no more than 2.5 minutes to charge it
return Math.ceil(E/(16.8 * 160)) --no more than this many seconds to charge it
end
@ -96,7 +96,7 @@ function Public.fuel_depletion_rate_static()
local rate
if Common.overworldx() > 0 then
rate = 380 * (0 + (Common.overworldx()/40)^(10/10)) * Public.crew_scale()^(1/6) * Math.sloped(Common.difficulty(), 3/5) / T --the extra player dependency accounts for the fact that even in compressed time, more players get more resources...
rate = 380 * (0 + (Common.overworldx()/40)^(10/10)) * Public.crew_scale()^(1/6) * Math.sloped(Common.difficulty(), 3/5) / T --most of the crewsize dependence is through T, i.e. the coal cost per island stays the same... but the extra player dependency accounts for the fact that even in compressed time, more players seem to get more resources per island
else
rate = 0
end
@ -107,7 +107,7 @@ end
function Public.fuel_depletion_rate_sailing()
if (not Common.overworldx()) then return 0 end
return - 8 * (1 + 0.13 * (Common.overworldx()/40)^(10/10))
return - 7.5 * (1 + 0.13 * (Common.overworldx()/40)^(10/10)) * Math.sloped(Common.difficulty(), 4/5)
end
function Public.silo_total_pollution()
@ -250,7 +250,7 @@ end
function Public.island_richness_avg_multiplier()
return 0.7 + 0.1 * (Common.overworldx()/40)^(7/10)
end
end --tuned tbh
function Public.resource_quest_multiplier()
return (1.0 + 0.075 * (Common.overworldx()/40)^(8/10)) * Math.sloped(Common.difficulty(), 1/3) * (Public.crew_scale())^(1/8)
@ -258,7 +258,7 @@ end
function Public.apply_crew_buffs_per_x(force)
force.laboratory_productivity_bonus = force.laboratory_productivity_bonus + 10/100 * 1/40
force.laboratory_productivity_bonus = Math.max(0, 10/100 * (Common.overworldx()/40) - (10*(Common.difficulty()) - 5)) --difficulty causes lab productivity boosts to start later
end
function Public.class_cost()
@ -273,7 +273,7 @@ Public.silo_max_hp = 8000
function Public.pistol_damage_multiplier() return 1.95 end
Public.kraken_spawns_base_extra_evo = 0.2
Public.kraken_spawns_base_extra_evo = 0.3
function Public.kraken_evo_increase_per_shot()
return 1/100 * 0.04 --started off low, currently slowly upping to see
@ -284,7 +284,7 @@ function Public.kraken_kill_reward()
end
function Public.kraken_health()
return Math.ceil(2500 * Math.max(1, 1 + 0.1 * ((Common.overworldx()/40)^(13/10)-6)) * (Public.crew_scale()^(5/8)) * Math.sloped(Common.difficulty(), 1/2))
return Math.ceil(3000 * Math.max(1, 1 + 0.1 * ((Common.overworldx()/40)^(13/10)-6)) * (Public.crew_scale()^(5/8)) * Math.sloped(Common.difficulty(), 3/4))
end
Public.kraken_regen_scale = 0.1 --starting off low
@ -321,7 +321,7 @@ function Public.main_shop_cost_multiplier()
end
function Public.covered_entry_price_scale()
return (1 + 0.025 * (Common.overworldx()/40 - 1))
return 0.9 * (1 + 0.025 * (Common.overworldx()/40 - 1)) * ((1 + Public.crew_scale())^(1/3)) * Math.sloped(Common.difficulty(), 1/2) --whilst resource scales tend to be held fixed with crew size, we account slightly for the fact that more players tend to handcraft more
end
function Public.barter_decay_parameter()
@ -496,7 +496,7 @@ function Public.covered1_entry_price()
local overworldx = memory.overworldx or 0
local game_completion_progress = Math.sloped(Common.difficulty(),1/2) * Common.game_completion_progress()
local game_completion_progress = Math.min(Math.sloped(Common.difficulty(),1/2) * Common.game_completion_progress(), 1)
local data = Public.covered1_entry_price_data()
local types, weights = {}, {}
@ -522,6 +522,7 @@ function Public.covered1_entry_price()
local res = Utils.deepcopy(Math.raffle(types, weights))
res.price.count = Math.ceil(res.price.count * Public.covered_entry_price_scale())
for i, _ in pairs(res.raw_materials) do
res.raw_materials[i].count = Math.ceil(res.raw_materials[i].count * Public.covered_entry_price_scale())
end

View File

@ -298,9 +298,11 @@ function Public.give(player, stacks, spill_position, spill_surface)
-- count total of that item they have:
local new_total_count = 0
local cursor_stack = player.cursor_stack
if cursor_stack and cursor_stack.valid_for_read and cursor_stack.name == itemname and cursor_stack.count and cursor_stack.count > 0 then
new_total_count = new_total_count + cursor_stack.count
if player then
local cursor_stack = player.cursor_stack
if cursor_stack and cursor_stack.valid_for_read and cursor_stack.name == itemname and cursor_stack.count and cursor_stack.count > 0 then
new_total_count = new_total_count + cursor_stack.count
end
end
if inv and inv.get_item_count(itemname) and inv.get_item_count(itemname) > 0 then
new_total_count = new_total_count + inv.get_item_count(itemname)

View File

@ -5,8 +5,8 @@ local inspect = require 'utils.inspect'.inspect
local Public = {}
Public.scenario_id_name = 'pirates'
Public.version_string = '1.0.3.9.8'
Public.version_float = 1.0398
Public.version_string = '1.0.3.9.9'
Public.version_float = 1.0399
Public.blueprint_library_allowed = false
Public.blueprint_importing_allowed = true
@ -111,6 +111,18 @@ Public.difficulty_options = {
-- right = {value = 'infinity', icon = 'achievement/mass-production-1', text = 'Infinity'},
-- }
function Public.highscore_difficulty_displayform(difficulty_value)
if difficulty_value < 1 then
return 'Easy'
elseif difficulty_value == 1 then
return 'Normal'
elseif difficulty_value <= 1.5 then
return 'Hard'
else
return 'Nightmare'
end
end
Public.daynightcycle_types = {
{displayname = 'Static', 0},
{displayname = 'Slow Cyclic', ticksperday = 100000},

View File

@ -148,7 +148,7 @@ function Public.try_win()
game.play_sound{path='utility/game_won', volume_modifier=0.9}
memory.victory_pause_until_tick = game.tick + 60*5
memory.victory_pause_until_tick = game.tick + 60*20
memory.victory_continue_message = true
end
end
@ -779,10 +779,12 @@ function Public.reset_crew_and_enemy_force(id)
-- these are redundant I think...?:
crew_force.recipes['centrifuge'].enabled = false
crew_force.recipes['flamethrower-turret'].enabled = false
crew_force.technologies['railway'].researched = true --needed for purple sci
crew_force.recipes['rail'].enabled = true --needed for purple sci
crew_force.recipes['locomotive'].enabled = false
crew_force.recipes['car'].enabled = false
crew_force.recipes['cargo-wagon'].enabled = false
crew_force.recipes['rail'].enabled = true --needed for purple sci
-- crew_force.recipes['underground-belt'].enabled = false
-- crew_force.recipes['fast-underground-belt'].enabled = false
@ -862,7 +864,7 @@ function Public.reset_crew_and_enemy_force(id)
crew_force.technologies['logistics-3'].enabled = true
crew_force.technologies['nuclear-fuel-reprocessing'].enabled = false
crew_force.technologies['railway'].enabled = false
-- crew_force.technologies['railway'].enabled = false
crew_force.technologies['automated-rail-transportation'].enabled = false
crew_force.technologies['braking-force-1'].enabled = false
crew_force.technologies['braking-force-2'].enabled = false

View File

@ -770,7 +770,8 @@ function Public.update_gui(player)
flow1.silo_progressbar.visible = false
-- flow1.silo_label_1.caption = string.format('[achievement=there-is-no-spoon]: +%.0f[item=sulfur]', destination.dynamic_data.rocketcoalreward)
flow1.silo_label_1.caption = string.format('Launch: %.0f[item=coal] , ' .. Balance.rocket_launch_coin_reward .. '[item=coin]', destination.dynamic_data.rocketcoalreward)
flow1.silo_label_1.caption = string.format('Launched for %.0f[item=coal] , ' .. Balance.rocket_launch_coin_reward .. '[item=coin]', destination.dynamic_data.rocketcoalreward)
--@TODO: Make the items non-bold, check that the font color works
flow1.silo_label_1.style.font_color = GuiCommon.achieved_font_color
else
local tooltip = 'The rocket is launching...'

View File

@ -200,11 +200,11 @@ function Public.update(player)
if flow2.selected_tab_index == 1 then
flow2.style.height = 400
elseif flow2.selected_tab_index == 2 then
flow2.style.height = 420
flow2.style.height = 400
elseif flow2.selected_tab_index == 3 then
flow2.style.height = 590
elseif flow2.selected_tab_index == 4 then
flow2.style.height = 280
flow2.style.height = 330
end
end

View File

@ -11,6 +11,7 @@ local inspect = require 'utils.inspect'.inspect
local SpamProtection = require 'utils.spam_protection'
local Memory = require 'maps.pirates.memory'
local Utils = require 'maps.pirates.utils_local'
local CoreData = require 'maps.pirates.coredata'
local module_name = 'Highscore'
local score_dataset = 'highscores'
@ -433,10 +434,11 @@ local function score_gui(data)
a = 1,
}
-- displayforms:
local n = entry.completion_time > 0 and Utils.time_mediumform(entry.completion_time or 0) or 'N/A'
local l = entry.leagues_travelled > 0 and entry.leagues_travelled or '?'
local v = entry.version > 0 and entry.version or '?'
local d = entry.difficulty > 0 and entry.difficulty or '?'
local d = entry.difficulty > 0 and CoreData.highscore_difficulty_displayform(entry.difficulty) or '?'
local c = entry.max_players > 0 and entry.max_players or '?'
local line = {
{caption = entry.name, color = special_color},

View File

@ -54,7 +54,7 @@ function Public.silo_died()
-- Crew.try_lose('silo destroyed')
--@TEMPORARY:
Common.notify_force(force, 'The silo was destroyed. Until recently, this would lose you the game, but not anymore :)')
Common.notify_force(force, 'The silo was destroyed.')
end
destination.dynamic_data.rocketsilos[1].destroy()
@ -78,7 +78,8 @@ function Public.damage_silo(final_damage_amount)
destination.dynamic_data.rocketsilohp = Math.max(0, Math.floor(destination.dynamic_data.rocketsilohp - final_damage_amount2))
if destination.dynamic_data.rocketsilohp > destination.dynamic_data.rocketsilomaxhp then destination.dynamic_data.rocketsilohp = destination.dynamic_data.rocketsilomaxhp end
if destination.dynamic_data.rocketsilohp <= 0 and (not destination.dynamic_data.rocketlaunched) then
if destination.dynamic_data.rocketsilohp <= 0 then
-- if destination.dynamic_data.rocketsilohp <= 0 and (not destination.dynamic_data.rocketlaunched) then
Public.silo_died()
rendering.destroy(destination.dynamic_data.rocketsilohptext)
else
@ -196,6 +197,10 @@ local function kraken_damage(event)
adjusted_damage = adjusted_damage / 1.5
end
if event.damage_type.name and (event.damage_type.name == 'laser') then
adjusted_damage = adjusted_damage / 10 --laser turrets are in range
end
local healthbar = memory.healthbars[unit_number]
if not healthbar then return end
@ -453,7 +458,7 @@ local function event_on_player_mined_entity(event)
destination.dynamic_data.wood_remaining = destination.dynamic_data.wood_remaining - amount
if memory.classes_table and memory.classes_table[event.player_index] and memory.classes_table[event.player_index] == Classes.enum.LUMBERJACK then
give[#give + 1] = {name = 'wood', count = amount + 3}
give[#give + 1] = {name = 'wood', count = amount + 4}
if Math.random(7) == 1 then
give[#give + 1] = {name = 'coin', count = 20}
end
@ -471,7 +476,7 @@ local function event_on_player_mined_entity(event)
elseif entity.type == 'fish' then
if not event.buffer then return end
local amount = 4
local amount = 3 --4 feels good but 3 encourages more fishing
Common.give(player, {{name = 'raw-fish', count = amount}}, entity.position)
event.buffer.clear()
@ -484,7 +489,7 @@ local function event_on_player_mined_entity(event)
if memory.overworldx > 0 then
if memory.classes_table and memory.classes_table[event.player_index] and memory.classes_table[event.player_index] == Classes.enum.PROSPECTOR then
give[#give + 1] = {name = 'coin', count = 4}
give[#give + 1] = {name = entity.name, count = 6}
give[#give + 1] = {name = entity.name, count = 7}
else
if memory.overworldx > 0 then
give[#give + 1] = {name = 'coin', count = 1}

View File

@ -46,9 +46,9 @@ Public.chest_loot_data_raw = {
{60, -1, 1, true, 'piercing-rounds-magazine', 8, 18},
{20, 0, 1, false, 'assembling-machine-2', 1, 3},
{20, 0, 1, false, 'solar-panel', 2, 5},
{40, -1, 1, true, 'speed-module', 1, 3},
{40, 0, 1, true, 'speed-module-2', 1, 3},
{40, 0, 2, true, 'speed-module-3', 1, 3},
{40, -1, 0.5, true, 'speed-module', 1, 3},
{40, 0, 1.5, true, 'speed-module-2', 1, 2},
{40, 0, 2, true, 'speed-module-3', 1, 1},
{4, -1, 1, true, 'effectivity-module', 1, 3},
{4, 0, 1, true, 'effectivity-module-2', 1, 3},
{4, 0, 2, true, 'effectivity-module-3', 1, 3},
@ -62,7 +62,7 @@ Public.chest_loot_data_raw = {
{2, 0.2, 1, false, 'electric-engine-unit', 1, 1},
{4, 0, 2, true, 'rocket-launcher', 1, 1},
{8, 0, 2, true, 'rocket', 16, 32},
{8, 0, 2, true, 'rocket', 4, 24},
{3, 0, 0.5, false, 'stack-inserter', 1, 3},
{1, 0, 0.5, false, 'stack-filter-inserter', 1, 3},
@ -115,9 +115,9 @@ Public.chest_loot_data_raw = {
{8, -0.5, 0.5, true, 'automation-science-pack', 4, 32},
{8, -0.6, 0.6, true, 'logistic-science-pack', 4, 32},
{6, -0.1, 1, true, 'military-science-pack', 8, 32},
{6, 0.2, 1.4, true, 'chemical-science-pack', 16, 32},
-- {6, 0.3, 1.5, true, 'production-science-pack', 16, 32},
{4, 0.4, 1.5, true, 'utility-science-pack', 16, 32},
{6, -0.5, 1.5, true, 'chemical-science-pack', 8, 24},
{6, 0, 1.5, true, 'production-science-pack', 8, 24},
-- {4, 0.4, 1.5, true, 'utility-science-pack', 16, 32},
-- {10, 0.5, 1.5, true, 'space-science-pack', 16, 32},
--early-game:
@ -270,11 +270,14 @@ function Public.chest_loot(number_of_items, game_completion_progress)
local platesrng = Math.random(5)
if platesrng <= 2 then
ret[#ret + 1] = {name = 'iron-plate', count = 120}
ret[#ret + 1] = ret[1]
ret[1] = {name = 'iron-plate', count = 120}
elseif platesrng <= 4 then
ret[#ret + 1] = {name = 'copper-plate', count = 120}
ret[#ret + 1] = ret[1]
ret[1] = {name = 'copper-plate', count = 120}
else
ret[#ret + 1] = {name = 'steel-plate', count = 20}
ret[#ret + 1] = ret[1]
ret[1] = {name = 'steel-plate', count = 120}
end
return ret

View File

@ -69,7 +69,7 @@ function Public.generate_overworld_destination(p)
if _DEBUG then
-- Edit these to force a type/subtype in debug:
subtype = Surfaces.Island.enum.RADIOACTIVE
-- subtype = Surfaces.Island.enum.RADIOACTIVE
-- type = Surfaces.enum.ISLAND
-- subtype = nil
end
@ -89,6 +89,8 @@ function Public.generate_overworld_destination(p)
elseif macrop.x == 5 then --biter boats appear
type = Surfaces.enum.ISLAND
subtype = Surfaces.Island.enum.STANDARD
elseif macrop.x == 8 then --game length decrease, pending more content
type = nil
elseif macrop.x == 9 then --just before krakens
type = Surfaces.enum.ISLAND
subtype = Surfaces.Island.enum.RED_DESERT
@ -101,9 +103,11 @@ function Public.generate_overworld_destination(p)
type = Surfaces.enum.ISLAND
subtype = Surfaces.Island.enum.RADIOACTIVE
--electric engines needed at 20
elseif macrop.x == 20 then --space because we need to add more content to the game around here, it's too long otherwise
elseif macrop.x == 17 then --game length decrease, pending more content
type = nil
elseif macrop.x == 21 then --space because we need to add more content to the game around here, it's too long otherwise
elseif macrop.x == 20 then --game length decrease, pending more content
type = nil
elseif macrop.x == 21 then --game length decrease, pending more content. also kinda fun to have to steer in realtime due to double space
type = nil
elseif macrop.x == 24 then
type = Surfaces.enum.ISLAND
@ -173,28 +177,28 @@ function Public.generate_overworld_destination(p)
local normal_costitems = {'small-lamp', 'engine-unit', 'advanced-circuit'}
local base_cost_0 = {
['small-lamp'] = Math.ceil(((macrop.x-2)^(1/2))*30),
['small-lamp'] = Math.ceil(((macrop.x-2)^(2/3))*25),
}
local base_cost_1 = {
['small-lamp'] = Math.ceil(((macrop.x-2)^(1/2))*30),
['engine-unit'] = Math.ceil(((macrop.x-7)^(1/2))*20),
['small-lamp'] = Math.ceil(((macrop.x-2)^(2/3))*25),
['engine-unit'] = Math.ceil(((macrop.x-7)^(2/3))*18),
}
local base_cost_2 = {
['small-lamp'] = Math.ceil(((macrop.x-2)^(1/2))*30),
['engine-unit'] = Math.ceil(((macrop.x-7)^(1/2))*20),
['advanced-circuit'] = Math.ceil(((macrop.x-15)^(1/2))*10),
['small-lamp'] = Math.ceil(((macrop.x-2)^(2/3))*25),
['engine-unit'] = Math.ceil(((macrop.x-7)^(2/3))*18),
['advanced-circuit'] = Math.ceil(((macrop.x-15)^(2/3))*8),
}
local base_cost_3 = {
['small-lamp'] = Math.ceil(((macrop.x-2)^(1/2))*30),
['engine-unit'] = Math.ceil(((macrop.x-7)^(1/2))*20),
['advanced-circuit'] = Math.ceil(((macrop.x-15)^(1/2))*10),
['electric-engine-unit'] = Math.ceil(((macrop.x-20)^(1/2))*5),
['small-lamp'] = Math.ceil(((macrop.x-2)^(2/3))*25),
['engine-unit'] = Math.ceil(((macrop.x-7)^(2/3))*18),
['advanced-circuit'] = Math.ceil(((macrop.x-15)^(2/3))*8),
['electric-engine-unit'] = Math.ceil(((macrop.x-18)^(2/3))*5),
}
-- local base_cost_4 = {
-- ['small-lamp'] = Math.ceil(((macrop.x-2)^(1/2))*30),
-- ['engine-unit'] = Math.ceil(((macrop.x-7)^(1/2))*20),
-- ['advanced-circuit'] = Math.ceil(((macrop.x-15)^(1/2))*10),
-- ['electric-engine-unit'] = Math.ceil(((macrop.x-20)^(1/2))*5),
-- ['small-lamp'] = Math.ceil(((macrop.x-2)^(2/3))*25),
-- ['engine-unit'] = Math.ceil(((macrop.x-7)^(2/3))*20),
-- ['advanced-circuit'] = Math.ceil(((macrop.x-15)^(2/3))*8),
-- ['electric-engine-unit'] = Math.ceil(((macrop.x-20)^(2/3))*5),
-- }
if macrop.x == 0 then
-- if _DEBUG then
@ -219,11 +223,11 @@ function Public.generate_overworld_destination(p)
end
elseif macrop.x == 18 then --a super small amount of electric-engine-unit on a relatively early level so that they see they need lubricant
cost_to_leave = {
['small-lamp'] = Math.ceil(((macrop.x-2)^(1/2))*30),
['engine-unit'] = Math.ceil(((macrop.x-7)^(1/2))*20),
['small-lamp'] = Math.ceil(((macrop.x-2)^(2/3))*25),
['engine-unit'] = Math.ceil(((macrop.x-7)^(2/3))*18),
['electric-engine-unit'] = 2,
}
elseif macrop.x <= 22 then
elseif macrop.x <= 23 then
if macrop.x % 3 > 0 then
cost_to_leave = base_cost_2
else

View File

@ -465,7 +465,7 @@ function Public.retreat_from_island()
if boat.state and boat.state == Boats.enum_state.RETREATING then return end
boat.state = Boats.enum_state.RETREATING
boat.speed = 1.2
boat.speed = 1.25
Boats.place_boat(boat, CoreData.moving_boat_floor, false, false)

View File

@ -36,28 +36,28 @@ Public.market_barters = {
}
Public.market_permanent_offers = {
{price = {{'coin', 3999}}, offer = {type = 'give-item', item = 'iron-ore', count = 800}},
{price = {{'coin', 3999}}, offer = {type = 'give-item', item = 'copper-ore', count = 800}},
{price = {{'coin', 3999}}, offer = {type = 'give-item', item = 'crude-oil-barrel', count = 120}},
{price = {{'coin', 4999}}, offer = {type = 'give-item', item = 'beacon', count = 2}},
{price = {{'coin', 2799}}, offer = {type = 'give-item', item = 'speed-module', count = 2}},
{price = {{'coin', 4000}}, offer = {type = 'give-item', item = 'iron-ore', count = 800}},
{price = {{'coin', 4000}}, offer = {type = 'give-item', item = 'copper-ore', count = 800}},
{price = {{'coin', 4000}}, offer = {type = 'give-item', item = 'crude-oil-barrel', count = 120}},
{price = {{'coin', 5000}}, offer = {type = 'give-item', item = 'beacon', count = 2}},
{price = {{'coin', 2800}}, offer = {type = 'give-item', item = 'speed-module', count = 2}},
}
-- cheap but one-off
Public.market_sales = {
{price = {{'coin', 2499}}, offer = {type = 'give-item', item = 'coal', count = 900}},
{price = {{'coin', 2499}}, offer = {type = 'give-item', item = 'firearm-magazine', count = 500}},
{price = {{'coin', 2499}}, offer = {type = 'give-item', item = 'piercing-rounds-magazine', count = 75}},
{price = {{'coin', 2499}}, offer = {type = 'give-item', item = 'uranium-rounds-magazine', count = 25}},
{price = {{'coin', 2499}}, offer = {type = 'give-item', item = 'piercing-shotgun-shell', count = 60}},
{price = {{'coin', 2499}}, offer = {type = 'give-item', item = 'raw-fish', count = 300}},
{price = {{'coin', 2499}}, offer = {type = 'give-item', item = 'laser-turret', count = 1}},
{price = {{'coin', 2499}}, offer = {type = 'give-item', item = 'vehicle-machine-gun', count = 2}},
{price = {{'coin', 2499}}, offer = {type = 'give-item', item = 'substation', count = 6}},
{price = {{'coin', 2499}}, offer = {type = 'give-item', item = 'modular-armor', count = 1}},
{price = {{'coin', 2499}}, offer = {type = 'give-item', item = 'distractor-capsule', count = 10}},
{price = {{'coin', 2499}}, offer = {type = 'give-item', item = 'destroyer-capsule', count = 5}},
{price = {{'coin', 2499}}, offer = {type = 'give-item', item = 'coin', count = 4000}},
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'coal', count = 900}},
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'firearm-magazine', count = 500}},
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'piercing-rounds-magazine', count = 75}},
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'uranium-rounds-magazine', count = 25}},
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'piercing-shotgun-shell', count = 60}},
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'raw-fish', count = 300}},
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'laser-turret', count = 1}},
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'vehicle-machine-gun', count = 2}},
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'substation', count = 6}},
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'modular-armor', count = 1}},
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'distractor-capsule', count = 10}},
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'destroyer-capsule', count = 5}},
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'coin', count = 4000}},
}

View File

@ -78,7 +78,7 @@ Public.main_shop_data_1 = {
[Upgrades.enum.UNLOCK_MERCHANTS] = {
tooltip = 'Unlock merchant ships.',
what_you_get_sprite_buttons = {['entity/market'] = false},
base_cost = {coins = 10000, fuel = 2500},
base_cost = {coins = 10000, fuel = 2000},
},
}
@ -370,11 +370,17 @@ function Public.event_on_market_item_purchased(event)
-- Static doesn't decay
-- Barter decays
local decay_type
local dock_bool = destination.type == SurfacesCommon.enum.DOCK
local purchase_bool = (price and price[1] and price[1].name and (price[1].name == 'coin'))
local simple_efficiency_trade_bool = (price and price[1] and price[1].name and (price[1].name == 'pistol' or price[1].name == 'burner-mining-drill'))
if offer_type == 'nothing' then
decay_type = 'one-off'
elseif destination.type == SurfacesCommon.enum.DOCK and (price and price[1] and price[1].name and (price[1].name == 'coin')) and (offer_giveitem_name and not (offer_giveitem_name == 'stone' or offer_giveitem_name == 'iron-ore' or offer_giveitem_name == 'crude-oil-barrel' or offer_giveitem_name == 'copper-ore')) then
elseif dock_bool and purchase_bool and (offer_giveitem_name) and not (offer_giveitem_name == 'stone' or offer_giveitem_name == 'iron-ore' or offer_giveitem_name == 'copper-ore') then
decay_type = 'one-off'
elseif (price and price[1] and price[1].name and (price[1].name == 'pistol' or price[1].name == 'burner-mining-drill')) or (offer_giveitem_name and (offer_giveitem_name == 'defender-capsule' or offer_giveitem_name == 'gun-turret')) then
elseif dock_bool and purchase_bool and (offer_giveitem_name) and (offer_giveitem_name == 'stone' or offer_giveitem_name == 'iron-ore' or offer_giveitem_name == 'copper-ore' or offer_giveitem_name == 'crude-oil-barrel') then
decay_type = 'double_decay'
elseif simple_efficiency_trade_bool or (offer_giveitem_name and (offer_giveitem_name == 'defender-capsule' or offer_giveitem_name == 'gun-turret')) then
decay_type = 'static'
else
decay_type = 'decay'
@ -433,6 +439,9 @@ function Public.event_on_market_item_purchased(event)
Common.flying_text(player.surface, player.position, text1 .. ' [font=count-font]' .. text2 .. '[/font]')
else
local decay_param = Balance.barter_decay_parameter()
if decay_type == 'double_decay' then decay_param = Balance.barter_decay_parameter()^2 end
if not inv then return end
local flying_text_color = {r = 255, g = 255, b = 255}
local text1 = '[color=1,1,1]+' .. this_offer.offer.count .. '[/color] [item=' .. alloffers[offer_index].offer.item .. ']'
@ -441,7 +450,7 @@ function Public.event_on_market_item_purchased(event)
Common.flying_text(player.surface, player.position, text1 .. ' [font=count-font]' .. text2 .. '[/font]')
--update market trades:
alloffers[offer_index].offer.count = Math.max(Math.floor(alloffers[offer_index].offer.count * Balance.barter_decay_parameter()),1)
alloffers[offer_index].offer.count = Math.max(Math.floor(alloffers[offer_index].offer.count * decay_param),1)
market.clear_market_items()
for _, offer in pairs(alloffers) do

View File

@ -61,7 +61,7 @@ Public.Data.cabin_splitters = {
{x = -4, y = -8.5, direction = defines.direction.north, type = 7},
{x = -5, y = -9.5, direction = defines.direction.north, type = 7},
{x = -3, y = -7.5, direction = defines.direction.north, type = 8},
{x = 0.5, y = -7, direction = defines.direction.west, type = 9},
{x = 0.5, y = -7, direction = defines.direction.west, type = 8},
}
Public.Data.output_chest = {x = 3.5, y = -6.5}

View File

@ -331,10 +331,10 @@ function Public.underground_worms_ai()
worms[#worms] = nil
end
local max_worms = 35
local max_worms = Math.ceil(45 * Math.sloped(Common.difficulty(), 1/2))
-- spawn worms
if game.tick % 210 == 0 then
if game.tick % 90 == 0 then
if #worms < max_worms then
local island_center = destination.static_params.islandcenter_position
local r = Math.max(destination.static_params.width, destination.static_params.height)/2

View File

@ -186,7 +186,7 @@ local function swamp_tick()
local memory = Memory.get_crew_memory()
local destination = Common.current_destination()
if destination.subtype == IslandsCommon.enum.SWAMP then
if destination.subtype and destination.subtype == IslandsCommon.enum.SWAMP then
if memory.boat and memory.boat.surface_name and memory.boat.surface_name == destination.surface_name then
local surface = game.surfaces[destination.surface_name]
if not (surface and surface.valid) then return end

View File

@ -138,10 +138,10 @@ local function walkways_tick()
local memory = Memory.get_crew_memory()
local destination = Common.current_destination()
if destination.subtype == IslandsCommon.enum.WALKWAYS then
if destination.subtype and destination.subtype == IslandsCommon.enum.WALKWAYS then
for _, player in pairs(game.connected_players) do
if player.force.name == memory.force_name and player.surface == game.surfaces[destination.surface_name] and player.character and player.character.valid and game.surfaces[destination.surface_name].get_tile(player.position).name == 'water-shallow' then
player.character.damage(50, game.forces['environment'], 'fire')
player.character.damage(12, game.forces['environment'], 'fire')
if not (player.character and player.character.valid) then
Common.notify_force(player.force, player.name .. ' froze to death.')
end
@ -152,7 +152,7 @@ local function walkways_tick()
end
local event = require 'utils.event'
event.on_nth_tick(90, walkways_tick)
event.on_nth_tick(20, walkways_tick)
return Public

View File

@ -282,7 +282,7 @@ function Public.pick_up_tick(tickinterval)
map.state = 'picked_up'
rendering.destroy(map.mapobject_rendering)
Common.notify_force(player.force, player.name .. ' found a map. Treasure location revealed.')
Common.notify_force_light(player.force, player.name .. ' found a map. Treasure location revealed.')
map.x_renderings = {
rendering.draw_line{
@ -519,7 +519,7 @@ function Public.place_cached_structures(tickinterval)
end
covered_data.wooden_chests = {}
for i, p in ipairs(hardcoded_data.wooden_chests) do
for k, p in ipairs(hardcoded_data.wooden_chests) do
local e = surface.create_entity{name = 'wooden-chest', position = Math.vector_sum(special.position, p), force = string.format('ancient-friendly-%03d', memory.id)}
if e and e.valid then
e.minable = false
@ -528,7 +528,7 @@ function Public.place_cached_structures(tickinterval)
local inv = e.get_inventory(defines.inventory.chest)
local loot = Loot.covered_wooden_chest_loot()
if i==1 then loot[#loot + 1] = {name = 'coin', count = 1500} end
if k==1 then loot[1] = {name = 'coin', count = 1500} end
for j = 1, #loot do
local l = loot[j]
inv.insert(l)
@ -989,13 +989,18 @@ function Public.silo_update(tickinterval)
local pollution = e/1000000 * Balance.silo_total_pollution() / Balance.silo_energy_needed_MJ()
if p and pollution then
game.surfaces[destination.surface_name].pollute(p, pollution)
game.pollution_statistics.on_flow('rocket-silo', pollution)
if not memory.floating_pollution then memory.floating_pollution = 0 end
-- Eventually I want to reformulate pollution not to pull from the map directly, but to pull from pollution_statistics. Previously all the silo pollution went to the map, but this causes a lag ~1-2 minutes. So as a compromise, let's send half to floating_pollution directly, and half to the map:
memory.floating_pollution = memory.floating_pollution + pollution/2
game.surfaces[destination.surface_name].pollute(p, pollution/2)
if destination.dynamic_data.rocketsiloenergyconsumed >= destination.dynamic_data.rocketsiloenergyneeded and (not (silo.rocket_parts == 100)) and (destination.dynamic_data.silocharged == false) and memory.game_lost == false then
-- silo.energy = 0
silo.rocket_parts = 100
silo.destructible = false
-- No longer destructible since no longer a lose con:
-- silo.destructible = false
destination.dynamic_data.silocharged = true
end
end
@ -1112,7 +1117,7 @@ function Public.silo_insta_update()
local silos = destination.dynamic_data.rocketsilos
if silos and silos[1] and silos[1].valid then
if silos and silos[1] and silos[1].valid then --need the first silo to be alive in order to charge any others
if destination.dynamic_data.silocharged then
for i, silo in ipairs(silos) do
silo.energy = silo.electric_buffer_size

View File

@ -75,7 +75,7 @@ function Public.update_character_properties(tickinterval)
if memory.classes_table and memory.classes_table[player_index] then
local class = memory.classes_table[player_index]
if class == Classes.enum.SCOUT then
speed_boost = speed_boost + 0.3
speed_boost = speed_boost + 0.35
elseif class == Classes.enum.DECKHAND or class == Classes.enum.BOATSWAIN or class == Classes.enum.SHORESMAN then
local surfacedata = Surfaces.SurfacesCommon.decode_surface_name(player.surface.name)
local type = surfacedata.type

View File

@ -242,12 +242,11 @@ function Public.standard_string_form_of_time_in_seconds(time)
local str2 = ''
local hours = Math.floor(Math.ceil(time2) / 3600)
local minutes = Math.floor(Math.ceil(time2) / 60)
local seconds = Math.ceil(time2) % 60
-- if hours >= 1 then
-- str2 = string.format('%.0fh%.0fm%.0fs', hours, minutes, seconds)
-- elseif minutes >= 1 then
if minutes >= 1 then
str2 = string.format('%.0fm%.0fs', minutes, seconds)
local seconds = Math.ceil(time2)
if hours >= 1 then
str2 = string.format('%.0fh%.0fm%.0fs', hours, minutes % 60, seconds % 60)
elseif minutes >= 1 then
str2 = string.format('%.0fm%.0fs', minutes, seconds % 60)
else
str2 = string.format('%.0fs', seconds)
end