You've already forked ComfyFactorio
mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-09-16 09:06:21 +02:00
v1.0.4.6.1
This commit is contained in:
@@ -5,8 +5,8 @@ local inspect = require 'utils.inspect'.inspect
|
|||||||
local Public = {}
|
local Public = {}
|
||||||
|
|
||||||
Public.scenario_id_name = 'pirates'
|
Public.scenario_id_name = 'pirates'
|
||||||
Public.version_string = '1.0.4.6'
|
Public.version_string = '1.0.4.6.1'
|
||||||
Public.version_float = 1.046
|
Public.version_float = 1.0461
|
||||||
|
|
||||||
Public.blueprint_library_allowed = true
|
Public.blueprint_library_allowed = true
|
||||||
Public.blueprint_importing_allowed = true
|
Public.blueprint_importing_allowed = true
|
||||||
@@ -40,7 +40,7 @@ Public.colors = {
|
|||||||
notify_gameover = {r=249, g=84, b=84},
|
notify_gameover = {r=249, g=84, b=84},
|
||||||
renderingtext_green = {r=88, g=219, b=88},
|
renderingtext_green = {r=88, g=219, b=88},
|
||||||
renderingtext_yellow = {r=79, g=136, b=209},
|
renderingtext_yellow = {r=79, g=136, b=209},
|
||||||
quartermaster_rendering = {r=237, g=157, b=45},
|
quartermaster_rendering = {r=237, g=157, b=45, a=0.3},
|
||||||
}
|
}
|
||||||
|
|
||||||
Public.static_boat_floor = 'brown-refined-concrete'
|
Public.static_boat_floor = 'brown-refined-concrete'
|
||||||
|
@@ -81,11 +81,11 @@ function Public.update(player)
|
|||||||
if memory.active_sea_enemies.krakens[i] then krakens = true break end
|
if memory.active_sea_enemies.krakens[i] then krakens = true break end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if krakens then --@FIXME: somehow this isn't triggering?
|
if krakens then
|
||||||
button.tooltip = string.format('Local biter evolution\n\nBase: %.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.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
|
button.number = Balance.kraken_spawns_base_extra_evo + evo
|
||||||
else
|
else
|
||||||
button.tooltip = string.format('Local biter evolution\n\nBase: %.2f\nTotal: %.2f', evolution_base, evo)
|
button.tooltip = string.format('Local biter evolution\n\nLeagues: %.2f\nTotal: %.2f', evolution_base, evo)
|
||||||
button.number = evo
|
button.number = evo
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@@ -154,7 +154,7 @@ function Public.click(event)
|
|||||||
-- local shop_data = Shop.main_shop_data
|
-- local shop_data = Shop.main_shop_data
|
||||||
|
|
||||||
-- if eventname == 'buy_button' then
|
-- if eventname == 'buy_button' then
|
||||||
-- Shop.main_shop_try_purchase(event.element.parent.name)
|
-- Shop.Captains.main_shop_try_purchase(event.element.parent.name)
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
if eventname ~= 'camera' then return end
|
if eventname ~= 'camera' then return end
|
||||||
|
@@ -175,7 +175,7 @@ function Public.click(event)
|
|||||||
local memory = Memory.get_crew_memory()
|
local memory = Memory.get_crew_memory()
|
||||||
|
|
||||||
if eventname == 'buy_button' then
|
if eventname == 'buy_button' then
|
||||||
Shop.main_shop_try_purchase(player, event.element.parent.name)
|
Shop.Captains.main_shop_try_purchase(player, event.element.parent.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@@ -976,7 +976,8 @@ local function event_on_research_finished(event)
|
|||||||
p_force.recipes['locomotive'].enabled = false
|
p_force.recipes['locomotive'].enabled = false
|
||||||
p_force.recipes['car'].enabled = false
|
p_force.recipes['car'].enabled = false
|
||||||
p_force.recipes['cargo-wagon'].enabled = false
|
p_force.recipes['cargo-wagon'].enabled = false
|
||||||
p_force.recipes['rail'].enabled = true
|
p_force.recipes['slowdown-capsule'].enabled = false
|
||||||
|
-- p_force.recipes['rail'].enabled = false
|
||||||
end
|
end
|
||||||
|
|
||||||
local function event_on_player_joined_game(event)
|
local function event_on_player_joined_game(event)
|
||||||
|
@@ -326,8 +326,9 @@ Public.maze_treasure_data_raw = {
|
|||||||
{2, -1, 1, true, 'rocket', 18, 24},
|
{2, -1, 1, true, 'rocket', 18, 24},
|
||||||
{2, -1, 1, false, 'stack-inserter', 8, 10},
|
{2, -1, 1, false, 'stack-inserter', 8, 10},
|
||||||
{2, -1, 1, false, 'stack-filter-inserter', 5, 6},
|
{2, -1, 1, false, 'stack-filter-inserter', 5, 6},
|
||||||
{2, -1, 1, false, 'poison-capsule', 10, 12},
|
{2, 0, 1, false, 'poison-capsule', 10, 12},
|
||||||
{2, -1, 1, false, 'slowdown-capsule', 8, 10},
|
{2, 0, 1, false, 'destroyer-capsule', 6, 6},
|
||||||
|
{2, 0, 1, false, 'slowdown-capsule', 8, 8},
|
||||||
|
|
||||||
{2, 0, 1, false, 'uranium-rounds-magazine', 15, 25},
|
{2, 0, 1, false, 'uranium-rounds-magazine', 15, 25},
|
||||||
{2, 0, 1, false, 'artillery-shell', 5, 7},
|
{2, 0, 1, false, 'artillery-shell', 5, 7},
|
||||||
@@ -353,11 +354,10 @@ Public.maze_treasure_data_raw = {
|
|||||||
{0.5, 0, 0.8, false, 'assembling-machine-3', 3, 3},
|
{0.5, 0, 0.8, false, 'assembling-machine-3', 3, 3},
|
||||||
{1, 0, 0.7, false, 'electric-furnace', 4, 6},
|
{1, 0, 0.7, false, 'electric-furnace', 4, 6},
|
||||||
|
|
||||||
{1, 0, 0.9, false, 'destroyer-capsule', 6, 6},
|
|
||||||
|
|
||||||
{1, 0, 0.8, false, 'modular-armor', 1, 1},
|
{1, 0, 0.8, false, 'modular-armor', 1, 1},
|
||||||
{1, 0, 2, true, 'power-armor', 1, 1},
|
{1, 0, 2, true, 'power-armor', 1, 1},
|
||||||
{0.08, 0, 2, true, "power-armor-mk2", 1, 1},
|
{0.1, 0, 2, true, 'power-armor-mk2', 1, 1},
|
||||||
|
|
||||||
{2, -1, 1, true, 'solar-panel-equipment', 3, 4},
|
{2, -1, 1, true, 'solar-panel-equipment', 3, 4},
|
||||||
{2, -1, 1, true, 'battery-equipment', 1, 1},
|
{2, -1, 1, true, 'battery-equipment', 1, 1},
|
||||||
@@ -390,41 +390,42 @@ function Public.maze_treasure_loot()
|
|||||||
end
|
end
|
||||||
|
|
||||||
Public.dredger_loot_raw = {
|
Public.dredger_loot_raw = {
|
||||||
{20, 0, 1, false, 'iron-plate', 1, 1},
|
{10, 0, 1, false, 'iron-plate', 1, 1},
|
||||||
{20, 0, 1, false, 'copper-plate', 1, 1},
|
{10, 0, 1, false, 'copper-plate', 1, 1},
|
||||||
{20, 0, 1, false, 'coal', 1, 1},
|
{10, 0, 1, false, 'coal', 1, 1},
|
||||||
|
|
||||||
{2, 0, 1, false, 'small-electric-pole', 1, 1},
|
{2, 0, 1, false, 'small-electric-pole', 1, 1},
|
||||||
{1, 0, 1, false, 'medium-electric-pole', 1, 1},
|
{1, 0, 1, false, 'medium-electric-pole', 1, 1},
|
||||||
{0.1, 0, 1, false, 'big-electric-pole', 1, 1},
|
{0.1, 0, 1, false, 'big-electric-pole', 1, 1},
|
||||||
|
|
||||||
|
{0.2, 0, 1, false, 'poison-capsule', 1, 1},
|
||||||
{0.2, 0, 1, false, 'slowdown-capsule', 1, 1},
|
{0.2, 0, 1, false, 'slowdown-capsule', 1, 1},
|
||||||
{0.2, 0, 1, false, 'destroyer-capsule', 1, 1},
|
{0.2, 0, 1, false, 'destroyer-capsule', 1, 1},
|
||||||
{0.2, 0, 1, false, 'defender-capsule', 1, 1},
|
{0.2, 0, 1, false, 'defender-capsule', 1, 1},
|
||||||
{0.2, 0, 1, false, 'distractor-capsule', 1, 1},
|
{0.2, 0, 1, false, 'distractor-capsule', 1, 1},
|
||||||
|
|
||||||
{10, 0, 1, false, 'automation-science-pack', 1, 1},
|
{5, 0, 1, false, 'automation-science-pack', 1, 1},
|
||||||
{10, 0, 1, false, 'logistic-science-pack', 1, 1},
|
{5, 0, 1, false, 'logistic-science-pack', 1, 1},
|
||||||
{4, 0, 1, false, 'military-science-pack', 1, 1},
|
{2, 0, 1, false, 'military-science-pack', 1, 1},
|
||||||
{4, 0, 1, false, 'chemical-science-pack', 1, 1},
|
{2, 0, 1, false, 'chemical-science-pack', 1, 1},
|
||||||
{4, 0, 1, false, 'production-science-pack', 1, 1},
|
{2, 0, 1, false, 'production-science-pack', 1, 1},
|
||||||
|
|
||||||
{0.0001, 0, 0.8, false, 'modular-armor', 1, 1},
|
{0.0003, 0, 0.75, false, 'modular-armor', 1, 1},
|
||||||
{0.0001, 0, 2, true, 'power-armor', 1, 1},
|
{0.0003, 0, 2, true, 'power-armor', 1, 1},
|
||||||
{0.00008, 0, 2, true, "power-armor-mk2", 1, 1},
|
{0.0001, 0, 2, true, 'power-armor-mk2', 1, 1},
|
||||||
|
|
||||||
{0.002, -1, 1, true, 'solar-panel-equipment', 1, 1},
|
{0.006, -1, 1, true, 'solar-panel-equipment', 1, 1},
|
||||||
{0.002, -1, 1, true, 'battery-equipment', 1, 1},
|
{0.006, -1, 1, true, 'battery-equipment', 1, 1},
|
||||||
{0.001, 0, 2, true, 'battery-mk2-equipment', 1, 1},
|
{0.003, 0, 2, true, 'battery-mk2-equipment', 1, 1},
|
||||||
{0.002, -1, 1, true, 'energy-shield-equipment', 1, 1},
|
{0.006, -1, 1, true, 'energy-shield-equipment', 1, 1},
|
||||||
{0.001, 0, 2, true, 'energy-shield-mk2-equipment', 1, 1},
|
{0.003, 0, 2, true, 'energy-shield-mk2-equipment', 1, 1},
|
||||||
{0.001, -1, 1, true, 'personal-roboport-equipment', 1, 1},
|
{0.003, -1, 1, true, 'personal-roboport-equipment', 1, 1},
|
||||||
{0.005, 0, 2, true, 'personal-roboport-mk2-equipment', 1, 1},
|
{0.015, 0, 2, true, 'personal-roboport-mk2-equipment', 1, 1},
|
||||||
{0.005, 0, 0.8, false, 'night-vision-equipment', 1, 1},
|
{0.015, 0, 0.8, false, 'night-vision-equipment', 1, 1},
|
||||||
{0.001, 0, 1, false, 'personal-laser-defense-equipment', 1, 1},
|
{0.003, 0, 1, false, 'personal-laser-defense-equipment', 1, 1},
|
||||||
{0.005, 0, 1, false, 'fusion-reactor-equipment', 1, 1},
|
{0.015, 0, 1, false, 'fusion-reactor-equipment', 1, 1},
|
||||||
{0.002, 0, 1, false, 'exoskeleton-equipment', 1, 1},
|
{0.006, 0, 1, false, 'exoskeleton-equipment', 1, 1},
|
||||||
{0.005, 0, 1, false, 'personal-laser-defense', 1, 1},
|
{0.015, 0, 1, false, 'personal-laser-defense', 1, 1},
|
||||||
}
|
}
|
||||||
|
|
||||||
function Public.dredger_loot()
|
function Public.dredger_loot()
|
||||||
|
@@ -277,8 +277,8 @@ local function crew_tick()
|
|||||||
ClassTickFunctions.update_character_properties(30)
|
ClassTickFunctions.update_character_properties(30)
|
||||||
end
|
end
|
||||||
|
|
||||||
if tick % 20 == 0 then
|
if tick % 30 == 0 then
|
||||||
ClassTickFunctions.class_renderings(20)
|
ClassTickFunctions.class_renderings(30)
|
||||||
end
|
end
|
||||||
|
|
||||||
if tick % 120 == 0 then
|
if tick % 120 == 0 then
|
||||||
|
@@ -531,6 +531,8 @@ function Public.go_from_currentdestination_to_sea()
|
|||||||
memory.boat.position = new_boatposition
|
memory.boat.position = new_boatposition
|
||||||
memory.boat.surface_name = seaname
|
memory.boat.surface_name = seaname
|
||||||
|
|
||||||
|
memory.kraken_evo = 0 --reset
|
||||||
|
|
||||||
memory.loadingticks = nil
|
memory.loadingticks = nil
|
||||||
memory.mapbeingloadeddestination_index = nil
|
memory.mapbeingloadeddestination_index = nil
|
||||||
|
|
||||||
|
@@ -79,7 +79,7 @@ Public.explanation = {
|
|||||||
[enum.SAMURAI] = 'They are tough, and *with no weapon equipped* fight well by melee, but poorly otherwise.',
|
[enum.SAMURAI] = 'They are tough, and *with no weapon equipped* fight well by melee, but poorly otherwise.',
|
||||||
[enum.MERCHANT] = 'They generate 40 coins per league, but are frail.',
|
[enum.MERCHANT] = 'They generate 40 coins per league, but are frail.',
|
||||||
[enum.SHORESMAN] = 'They move slightly faster and generate ore for the captain\'s cabin whilst offboard, but move slower onboard.',
|
[enum.SHORESMAN] = 'They move slightly faster and generate ore for the captain\'s cabin whilst offboard, but move slower onboard.',
|
||||||
[enum.BOATSWAIN] = 'They move faster and generate lots of ore for the captain\'s cabin whilst below deck, but move slower offboard.',
|
[enum.BOATSWAIN] = 'They move faster and generate ore for the captain\'s cabin whilst below deck, but move slower offboard.',
|
||||||
[enum.PROSPECTOR] = 'They find more resources when handmining ore.',
|
[enum.PROSPECTOR] = 'They find more resources when handmining ore.',
|
||||||
[enum.LUMBERJACK] = 'They find more resources when chopping trees.',
|
[enum.LUMBERJACK] = 'They find more resources when chopping trees.',
|
||||||
[enum.MASTER_ANGLER] = 'They fish at much greater distance, and catch more.',
|
[enum.MASTER_ANGLER] = 'They fish at much greater distance, and catch more.',
|
||||||
@@ -87,7 +87,7 @@ Public.explanation = {
|
|||||||
[enum.CHIEF_EXCAVATOR] = 'They find many more resources when handmining ore.',
|
[enum.CHIEF_EXCAVATOR] = 'They find many more resources when handmining ore.',
|
||||||
[enum.HATAMOTO] = 'They are very tough, and *with no weapon equipped* fight well by melee.',
|
[enum.HATAMOTO] = 'They are very tough, and *with no weapon equipped* fight well by melee.',
|
||||||
[enum.IRON_LEG] = 'They are very resistant to damage when carrying 2500 iron ore.',
|
[enum.IRON_LEG] = 'They are very resistant to damage when carrying 2500 iron ore.',
|
||||||
[enum.QUARTERMASTER] = 'Nearby crewmates generate a little ore for the captain\'s cabin, and have extra physical attack.',
|
[enum.QUARTERMASTER] = 'They give nearby crewmates extra physical attack, and generate ore for the captain\'s cabin for each one.',
|
||||||
[enum.DREDGER] = 'They find surprising items when they fish.',
|
[enum.DREDGER] = 'They find surprising items when they fish.',
|
||||||
[enum.SMOLDERING] = 'They periodically convert wood into coal, if they have less than 25 coal.',
|
[enum.SMOLDERING] = 'They periodically convert wood into coal, if they have less than 25 coal.',
|
||||||
[enum.GOURMET] = 'They generate ore for the captain\'s cabin by eating fish in fancy locations on an empty stomach.',
|
[enum.GOURMET] = 'They generate ore for the captain\'s cabin by eating fish in fancy locations on an empty stomach.',
|
||||||
|
@@ -97,7 +97,7 @@ Public.main_shop_data_2 = {
|
|||||||
},
|
},
|
||||||
artillery_shell = {
|
artillery_shell = {
|
||||||
tooltip = '8 cannon shells.',
|
tooltip = '8 cannon shells.',
|
||||||
what_you_get_sprite_buttons = {['item/artillery-shell'] = 10},
|
what_you_get_sprite_buttons = {['item/artillery-shell'] = 8},
|
||||||
base_cost = {coins = 800, fuel = 10},
|
base_cost = {coins = 800, fuel = 10},
|
||||||
},
|
},
|
||||||
artillery_remote = {
|
artillery_remote = {
|
||||||
|
@@ -56,8 +56,9 @@ Public.market_sales = {
|
|||||||
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'vehicle-machine-gun', count = 2}},
|
{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 = 'substation', count = 6}},
|
||||||
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'modular-armor', count = 1}},
|
{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 = 'distractor-capsule', count = 15}},
|
||||||
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'destroyer-capsule', count = 5}},
|
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'destroyer-capsule', count = 10}},
|
||||||
|
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'slowdown-capsule', count = 10}},
|
||||||
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'coin', count = 4000}},
|
{price = {{'coin', 2500}}, offer = {type = 'give-item', item = 'coin', count = 4000}},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -42,7 +42,7 @@ function Public.class_renderings(tickinterval)
|
|||||||
local player_index = player.index
|
local player_index = player.index
|
||||||
if memory.classes_table[player_index] == Classes.enum.QUARTERMASTER then
|
if memory.classes_table[player_index] == Classes.enum.QUARTERMASTER then
|
||||||
local r = memory.quartermaster_renderings[player_index]
|
local r = memory.quartermaster_renderings[player_index]
|
||||||
processed_renderings[#processed_renderings + 1] = player_index
|
processed_renderings[player_index] = true
|
||||||
if Common.validate_player_and_character(player) then
|
if Common.validate_player_and_character(player) then
|
||||||
if r and rendering.is_valid(r) then
|
if r and rendering.is_valid(r) then
|
||||||
rendering.set_target(r, player.character)
|
rendering.set_target(r, player.character)
|
||||||
@@ -198,7 +198,7 @@ function Public.class_rewards_tick(tickinterval)
|
|||||||
|
|
||||||
if memory.classes_table and memory.classes_table[player_index] then
|
if memory.classes_table and memory.classes_table[player_index] then
|
||||||
local class = memory.classes_table[player_index]
|
local class = memory.classes_table[player_index]
|
||||||
if class == Classes.enum.DECKHAND or class == Classes.enum.SHORESMAN or class == Classes.enum.BOATSWAIN then
|
if class == Classes.enum.DECKHAND or class == Classes.enum.SHORESMAN or class == Classes.enum.BOATSWAIN or class == Classes.enum.QUARTERMASTER then --watch out for this line!
|
||||||
local surfacedata = Surfaces.SurfacesCommon.decode_surface_name(player.surface.name)
|
local surfacedata = Surfaces.SurfacesCommon.decode_surface_name(player.surface.name)
|
||||||
local type = surfacedata.type
|
local type = surfacedata.type
|
||||||
local on_ship_bool = type == Surfaces.enum.HOLD or type == Surfaces.enum.CABIN or type == Surfaces.enum.CROWSNEST or (player.surface.name == memory.boat.surface_name and Boats.on_boat(memory.boat, player.position))
|
local on_ship_bool = type == Surfaces.enum.HOLD or type == Surfaces.enum.CABIN or type == Surfaces.enum.CROWSNEST or (player.surface.name == memory.boat.surface_name and Boats.on_boat(memory.boat, player.position))
|
||||||
@@ -210,18 +210,11 @@ function Public.class_rewards_tick(tickinterval)
|
|||||||
Classes.class_ore_grant(player, 7)
|
Classes.class_ore_grant(player, 7)
|
||||||
elseif class == Classes.enum.SHORESMAN and (not on_ship_bool) then
|
elseif class == Classes.enum.SHORESMAN and (not on_ship_bool) then
|
||||||
Classes.class_ore_grant(player, 3)
|
Classes.class_ore_grant(player, 3)
|
||||||
end
|
elseif class == Classes.enum.QUARTERMASTER then
|
||||||
end
|
local nearby_players = #player.surface.find_entities_filtered{position = player.position, radius = Common.quartermaster_range, name = 'character'}
|
||||||
end
|
|
||||||
|
|
||||||
if game.tick % (tickinterval*3) == 0 then
|
if nearby_players > 1 then
|
||||||
local nearby_players = player.surface.find_entities_filtered{position = player.position, radius = Common.quartermaster_range, name = 'character'}
|
Classes.class_ore_grant(player, nearby_players - 1)
|
||||||
|
|
||||||
for _, p2 in pairs(nearby_players) do
|
|
||||||
if p2.player and p2.player.valid then
|
|
||||||
local p2_index = p2.player.index
|
|
||||||
if p2_index ~= player_index and memory.classes_table[p2_index] and memory.classes_table[p2_index] == Classes.enum.QUARTERMASTER then
|
|
||||||
Classes.class_ore_grant(p2, 2)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user