1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-03-25 21:29:06 +02:00
This commit is contained in:
danielmartin0 2022-03-14 17:37:18 +00:00
parent 3406def506
commit 4d2e6fd7da
12 changed files with 39 additions and 32 deletions

View File

@ -171,11 +171,11 @@ function Public.base_evolution()
else
evo = (0.0201 * (overworldx/40)) * Math.sloped(Common.difficulty(), 1/5)
if overworldx > 600 and overworldx < 1000 then --extra slope from 600 to 1000 adds 2.5% evo
if overworldx > 600 and overworldx < 1000 then
evo = evo + (0.0025 * (overworldx - 600)/40)
elseif overworldx > 1000 then
evo = evo + 0.0025 * 10
end
end --extra slope from 600 to 1000 adds 2.5% evo
end
return evo
@ -396,7 +396,7 @@ Public.research_buffs = { --currently disabled anyway
function Public.flamers_tech_multipliers()
return 0.75
return 0.8
end
function Public.flamers_base_nerf()
@ -510,8 +510,8 @@ Public.covered1_entry_price_data_raw = { --watch out that the raw_materials ches
price = {name = 'burner-inserter', count = 300},
raw_materials = {{name = 'iron-plate', count = 900}}}, {}},
{1, 0.05, 0.7, false, {
price = {name = 'small-lamp', count = 400},
raw_materials = {{name = 'iron-plate', count = 800}, {name = 'copper-plate', count = 1200}}}, {}},
price = {name = 'small-lamp', count = 300},
raw_materials = {{name = 'iron-plate', count = 600}, {name = 'copper-plate', count = 900}}}, {}},
{1, 0, 1, false, {
price = {name = 'firearm-magazine', count = 700},
raw_materials = {{name = 'iron-plate', count = 2800}}}, {}},

View File

@ -1144,7 +1144,7 @@ function Public.send_important_items_from_player_to_crew(player, all_items)
local to_remove = {}
for iii = 1, #player_inv[ii], 1 do
-- local item_stack = player_inv[ii][iii] --don't do this as LuaItemStack is a reference!
if player_inv[ii][iii].valid and player_inv[ii][iii].valid_for_read then
if player_inv[ii] and player_inv[ii][iii].valid and player_inv[ii][iii].valid_for_read then
if all_items or (player_inv[ii][iii].name and Utils.contains(Public.important_items, player_inv[ii][iii].name)) then
to_remove[#to_remove + 1] = player_inv[ii][iii]
any = true

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.1'
Public.version_float = 1.111
Public.version_string = '1.1.1.2'
Public.version_float = 1.112
Public.blueprint_library_allowed = true
Public.blueprint_importing_allowed = true

View File

@ -1447,7 +1447,7 @@ local function event_on_rocket_launched(event)
end
local force = memory.force
Common.notify_force_light(force,'Granted ' .. string.format('%.1fk', Balance.rocket_launch_coin_reward/1000) .. ' [item=coin] and ' .. string.format('%.1fk', destination.dynamic_data.rocketcoalreward/1000) .. ' fuel.')
Common.notify_force_light(force,'Granted ' .. string.format('%.1fk', Balance.rocket_launch_coin_reward/1000) .. ' doubloons and ' .. string.format('%.1fk', destination.dynamic_data.rocketcoalreward/1000) .. ' fuel.')
if destination.dynamic_data.quest_type == Quest.enum.TIME and (not destination.dynamic_data.quest_complete) then
destination.dynamic_data.quest_progressneeded = 1

View File

@ -80,7 +80,7 @@ function Public.generate_overworld_destination(p)
island_subtype_raffle = Utils.ordered_table_with_values_removed(island_subtype_raffle, Surfaces.Island.enum.STANDARD)
end
if macrop.x == 18 then
island_subtype_raffle = Utils.ordered_table_with_values_removed('none') --flying-robot-frame cost is here, and we just make sure there's an island to see it
island_subtype_raffle = Utils.ordered_table_with_values_removed(island_subtype_raffle, 'none') --flying-robot-frame cost is here, and we just make sure there's an island to see it
end
if macrop.x == 19 then
island_subtype_raffle = Utils.ordered_table_with_values_removed(island_subtype_raffle, Surfaces.Island.enum.SWAMP)
@ -159,7 +159,11 @@ function Public.generate_overworld_destination(p)
else
type = Surfaces.enum.ISLAND
subtype = island_subtype_raffle[Math.random(#island_subtype_raffle)]
if #island_subtype_raffle > 0 then
subtype = island_subtype_raffle[Math.random(#island_subtype_raffle)]
else
subtype = 'none'
end
if subtype == 'none' then
type = nil

View File

@ -57,10 +57,10 @@ function Public.parrot_0()
local memory = Memory.get_crew_memory()
Common.parrot_speak(memory.force, 'We can wait here for as long as we like.')
end
function Public.parrot_80()
local memory = Memory.get_crew_memory()
Common.parrot_speak(memory.force, 'Let\'s build out the ship?')
end
-- function Public.parrot_80()
-- local memory = Memory.get_crew_memory()
-- Common.parrot_speak(memory.force, 'Let\'s build out the ship?')
-- end
function Public.parrot_boats_warning()
local memory = Memory.get_crew_memory()
Common.parrot_speak(memory.force, '200 leagues? I think we\'re being chased...')

View File

@ -46,7 +46,7 @@ function Public.quest_reward()
elseif rng <= 0.7 then
ret = {name = 'solid-fuel', count = Math.ceil(450 * multiplier), display_sprite = '[item=solid-fuel]', display_amount = string.format('%.0f', Math.ceil(450 * multiplier))}
elseif rng <= 0.9 then
ret = {name = 'coin', count = Math.ceil(6000 * (multiplier^(1/2))), display_sprite = '[item=coin]', display_amount = string.format('%.1fk', Math.ceil(6 * (multiplier^(1/2))))}
ret = {name = 'coin', count = Math.ceil(6000 * (multiplier^(1/2))), display_sprite = 'doubloons', display_amount = string.format('%.1fk', Math.ceil(6 * (multiplier^(1/2))))}
else
ret = {name = 'piercing-rounds-magazine', count = Math.ceil(250 * multiplier), display_sprite = '[item=piercing-rounds-magazine]', display_amount = string.format('%.0f', Math.ceil(250 * multiplier))}
end

View File

@ -73,13 +73,13 @@ Public.display_form = {
[enum.GOURMET] = 'Gourmet',
}
Public.explanation = {
[enum.DECKHAND] = 'They move faster and generate ore for the captain\'s cabin whilst onboard above deck, but move slower offboard.',
[enum.DECKHAND] = 'They move faster and generate ore for the cabin whilst onboard above deck, but move slower offboard.',
[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.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 ore for the captain\'s cabin whilst below deck, but move slower offboard.',
[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.',
[enum.LUMBERJACK] = 'They find more resources when chopping trees.',
[enum.MASTER_ANGLER] = 'They fish at much greater distance, and catch more.',
@ -87,10 +87,10 @@ Public.explanation = {
[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, but poorly otherwise.',
[enum.IRON_LEG] = 'They are very resistant to damage when carrying 3500 iron ore.',
[enum.QUARTERMASTER] = 'They give nearby crewmates extra physical attack, and generate ore for the captain\'s cabin for each one.',
[enum.QUARTERMASTER] = 'They give nearby crewmates extra physical attack, and generate ore for the cabin for each one.',
[enum.DREDGER] = 'They find surprising items when they fish.',
[enum.SMOLDERING] = 'They periodically convert wood into coal, if they have less than 50 coal.',
[enum.GOURMET] = 'They generate ore for the captain\'s cabin by eating fish in fancy locations.',
[enum.GOURMET] = 'They generate ore for the cabin by eating fish in fancy locations.',
}
Public.class_unlocks = {

View File

@ -59,7 +59,7 @@ function Public.event_on_market_item_purchased(event)
if offer_type == 'nothing' then
decay_type = 'one-off'
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'
decay_type = 'fast_decay'
elseif dock_bool and purchase_bool and (offer_giveitem_name) then
decay_type = 'one-off'
elseif simple_efficiency_trade_bool or special_purchase_bool then
@ -153,16 +153,16 @@ function Public.event_on_market_item_purchased(event)
if price[2] then
local fish = price[2].name
if fish == 'raw-fish' then fish = 'fish' end
Common.notify_force_light(player.force, player.name .. ' is trading away ' .. price[1].amount .. ' ' .. price[1].name .. ' and ' .. fish .. ' for ' .. this_offer.offer.count .. ' ' .. this_offer.offer.item .. '...')
Common.notify_force_light(player.force, player.name .. ' traded away ' .. price[1].amount .. ' ' .. price[1].name .. ' and ' .. fish .. ' for ' .. this_offer.offer.count .. ' ' .. this_offer.offer.item .. '.')
else
if price[1].name == 'coin' then
Common.notify_force_light(player.force, player.name .. ' bought ' ..this_offer.offer.count .. ' ' .. this_offer.offer.item .. ' for ' .. price[1].amount .. ' ' .. price[1].name .. '...')
Common.notify_force_light(player.force, player.name .. ' bought ' ..this_offer.offer.count .. ' ' .. this_offer.offer.item .. ' for ' .. price[1].amount .. ' ' .. price[1].name .. '.')
elseif this_offer.offer.item == 'coin' then
local sold_amount = price[1].amount
if sold_amount == 1 then sold_amount = 'a' end
Common.notify_force_light(player.force, player.name .. ' sold ' .. sold_amount .. ' ' .. price[1].name .. ' for ' .. this_offer.offer.count .. ' ' .. this_offer.offer.item .. '...')
Common.notify_force_light(player.force, player.name .. ' sold ' .. sold_amount .. ' ' .. price[1].name .. ' for ' .. this_offer.offer.count .. ' ' .. this_offer.offer.item .. '.')
else
Common.notify_force_light(player.force, player.name .. ' is trading away ' .. price[1].amount .. ' ' .. price[1].name .. ' for ' .. this_offer.offer.count .. ' ' .. this_offer.offer.item .. '...')
Common.notify_force_light(player.force, player.name .. ' traded away ' .. price[1].amount .. ' ' .. price[1].name .. ' for ' .. this_offer.offer.count .. ' ' .. this_offer.offer.item .. '.')
end
end
end
@ -177,7 +177,7 @@ 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 decay_type == 'fast_decay' then decay_param = Balance.barter_decay_parameter()^3 end
if not inv then return end
local flying_text_color = {r = 255, g = 255, b = 255}

View File

@ -56,6 +56,9 @@ function Public.terrain(args)
else
if noises.mood(p) > 0.66 then
args.tiles[#args.tiles + 1] = {name = 'water', position = args.p}
if Math.random(100) == 1 then
args.entities[#args.entities + 1] = {name = 'fish', position = args.p}
end
else
args.tiles[#args.tiles + 1] = {name = 'sand-3', position = args.p}
end

View File

@ -378,8 +378,8 @@ function Public.destination_on_crewboat_hits_shore(destination)
if memory.overworldx == 0 then
Parrot.parrot_0()
elseif memory.overworldx == 80 then
Parrot.parrot_80()
-- elseif memory.overworldx == 80 then
-- Parrot.parrot_80()
end
if destination.subtype == Islands.enum.RADIOACTIVE then

View File

@ -245,9 +245,9 @@ function Public.prune_offline_characters_list(tickinterval)
local any = false
for ii = 1, 5, 1 do
if player_inv[ii].valid then
if player_inv[ii] and player_inv[ii].valid then
for iii = 1, #player_inv[ii], 1 do
if player_inv[ii][iii].valid and player_inv[ii][iii].valid_for_read then
if player_inv[ii][iii] and player_inv[ii][iii].valid and player_inv[ii][iii].valid_for_read then
-- items[#items + 1] = player_inv[ii][iii]
Common.give_items_to_crew(player_inv[ii][iii])
any = true
@ -256,7 +256,7 @@ function Public.prune_offline_characters_list(tickinterval)
end
end
if any then
Common.notify_force_light(memory.force, 'Offline player\'s items recovered.')
Common.notify_force_light(memory.force, 'Offline player\'s items recovered to cabin.')
end
for ii = 1, 5, 1 do
if player_inv[ii].valid then