1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-10 00:43:27 +02:00

cleanup; more treasure chests; harder electronic circuit leaving costs

This commit is contained in:
danielmartin0 2022-06-04 14:43:08 +01:00
parent e7b3e76177
commit 3202f9d5cf
10 changed files with 37 additions and 28 deletions

View File

@ -1,6 +1,6 @@
require 'utils.data_stages'
_LIFECYCLE = _STAGE.control -- Control stage
_DEBUG = false
_DEBUG = true
_DUMP_ENV = false
require 'utils.server'

View File

@ -127,9 +127,9 @@ granted_kraken_kill=Kraken killed.
granted_periodic_barrel=
granted_quest_complete=Quest completed.
granted_1=__1__ Granted: __2__.
granted_2=__1__ Granted: __2__, __3__.
granted_3=__1__ Granted: __2__, __3__, __4__.
granted_1=__1__ __2__.
granted_2=__1__ __2__, __3__.
granted_3=__1__ __2__, __3__, __4__.
approaching_destination=Approaching destination __1__, __2__.
loading_destination=Loading destination __1__, __2__.

View File

@ -289,9 +289,9 @@ local function damage_to_players_changes(event)
-- damage_multiplier = damage_multiplier * 1.10
elseif class and class == Classes.enum.SAMURAI then
damage_multiplier = damage_multiplier * Balance.samurai_damage_taken_multiplier
elseif class and class == Classes.enum.HATAMOTO then --lethal damage needs to be unaffected
elseif class and class == Classes.enum.HATAMOTO then
damage_multiplier = damage_multiplier * Balance.hatamoto_damage_taken_multiplier
elseif class and class == Classes.enum.IRON_LEG then --lethal damage needs to be unaffected
elseif class and class == Classes.enum.IRON_LEG then
if memory.class_auxiliary_data[player_index] and memory.class_auxiliary_data[player_index].iron_leg_active then
damage_multiplier = damage_multiplier * Balance.iron_leg_damage_taken_multiplier
end
@ -307,12 +307,13 @@ local function damage_to_players_changes(event)
if damage_multiplier > 1 then
event.entity.health = event.entity.health - event.final_damage_amount * (damage_multiplier - 1)
elseif damage_multiplier < 1 and event.final_health > 0 then --lethal damage needs to be unaffected, else they never die
elseif damage_multiplier < 1 and event.final_health > 0 then --lethal damage case isn't this easy
event.entity.health = event.entity.health + event.final_damage_amount * (1 - damage_multiplier)
end
-- deal with damage reduction on lethal damage for players
-- Piratux wrote this code — it tracks player health (except passive regen), and intervenes on a lethal damage event, so it should work most of the time.
local player = game.players[player_index]
if not (player and player.valid and player.character and player.character.valid) then
return

View File

@ -106,7 +106,11 @@ function Public.full_update(player)
evolution_total = (evolution_leagues or 0) + (evolution_time or 0) + (evolution_nests or 0) + (evolution_silo or 0) + (evolution_sandwurms or 0)
end
local str = {'',{'pirates.gui_evo_tooltip_1', string.format('%.2f\n', evolution_total)}}
local str = {'',{'pirates.gui_evo_tooltip_1', string.format('%.2f', evolution_total)}}
if evolution_leagues or evolution_time or evolution_nests or evolution_silo or evolution_sandwurms then
str[#str+1] = {'','\n'}
end
for _, type in ipairs(types) do
if type == 'leagues' then

View File

@ -229,33 +229,33 @@ function Public.generate_overworld_destination(p)
['electronic-circuit'] = Math.ceil(((macro_p.x-2)^(2/3))*120),
}
local base_cost_2 = {
['electronic-circuit'] = Math.ceil(((macro_p.x-2)^(2/3))*180),
['advanced-circuit'] = Math.ceil(((macro_p.x-14)^(2/3))*18),
['electronic-circuit'] = Math.ceil(((macro_p.x-2)^(2/3))*200),
['advanced-circuit'] = Math.ceil(((macro_p.x-14)^(2/3))*22),
-- the below got this response from a new player: "This feels... underwhelming."
-- ['electronic-circuit'] = Math.ceil(((macro_p.x-2)^(2/3))*120),
-- ['advanced-circuit'] = Math.ceil(((macro_p.x-14)^(2/3))*18),
}
local base_cost_2b = {
['electronic-circuit'] = Math.ceil(((macro_p.x-2)^(2/3))*180),
['electronic-circuit'] = Math.ceil(((macro_p.x-2)^(2/3))*200),
['flying-robot-frame'] = 3,
}
local base_cost_3 = {
['electronic-circuit'] = Math.ceil(((macro_p.x-2)^(2/3))*140),
['advanced-circuit'] = Math.ceil(((macro_p.x-14)^(2/3))*18),
['electronic-circuit'] = Math.ceil(((macro_p.x-2)^(2/3))*160),
['advanced-circuit'] = Math.ceil(((macro_p.x-14)^(2/3))*22),
['launch_rocket'] = true,
}
local base_cost_4 = {
['electronic-circuit'] = Math.ceil(((macro_p.x-2)^(2/3))*100),
['advanced-circuit'] = Math.ceil(((macro_p.x-14)^(2/3))*18),
['electronic-circuit'] = Math.ceil(((macro_p.x-2)^(2/3))*140),
['advanced-circuit'] = Math.ceil(((macro_p.x-14)^(2/3))*22),
['flying-robot-frame'] = Math.ceil(((macro_p.x-18)^(2/3))*15),
['launch_rocket'] = true,
}
local base_cost_5 = {
['electronic-circuit'] = Math.ceil(((macro_p.x-2)^(2/3))*100),
['advanced-circuit'] = Math.ceil(((macro_p.x-14)^(2/3))*18),
['electronic-circuit'] = Math.ceil(((macro_p.x-2)^(2/3))*140),
['advanced-circuit'] = Math.ceil(((macro_p.x-14)^(2/3))*22),
['flying-robot-frame'] = Math.ceil(((macro_p.x-18)^(2/3))*10),
-- ['electronic-circuit'] = Math.ceil(((macro_p.x-2)^(2/3))*100),
-- ['advanced-circuit'] = Math.ceil(((macro_p.x-14)^(2/3))*18),
-- ['advanced-circuit'] = Math.ceil(((macro_p.x-14)^(2/3))*22),
-- ['flying-robot-frame'] = Math.ceil(((macro_p.x-18)^(2/3))*10),
}
-- if macro_p.x == 0 then

View File

@ -234,7 +234,7 @@ function Public.create_hold_surface(nth)
else
if nth==2 then
if memory.shiphold_rendering_1 then
rendering.set_text(memory.shiphold_rendering_1, {'pirates.surface_label_hold_nth', -1})
rendering.set_text(memory.shiphold_rendering_1, {'pirates.surface_label_hold_nth', 1})
end
end
rendering.draw_text{

View File

@ -61,13 +61,17 @@ function Public.terrain(args)
if noises.height(p) > 0.2 then
if noises.forest_abs(p) > 0.65 then
local treedensity = 0.4 * Math.slopefromto(noises.forest_abs_suppressed(p), 0.6, 0.85)
if noises.forest(p) > 0.87 then
if Math.random(1,100) < treedensity*100 then args.entities[#args.entities + 1] = {name = 'tree-01', position = args.p, visible_on_overworld = true} end
elseif noises.forest(p) < -1.4 then
if Math.random(1,100) < treedensity*100 then args.entities[#args.entities + 1] = {name = 'tree-03', position = args.p, visible_on_overworld = true} end
if (not args.iconized_generation) and Math.random(1600) == 1 then
args.specials[#args.specials + 1] = {name = 'chest', position = args.p}
else
if Math.random(1,100) < treedensity*100 then args.entities[#args.entities + 1] = {name = 'tree-02', position = args.p, visible_on_overworld = true} end
local treedensity = 0.4 * Math.slopefromto(noises.forest_abs_suppressed(p), 0.6, 0.85)
if noises.forest(p) > 0.87 then
if Math.random(1,100) < treedensity*100 then args.entities[#args.entities + 1] = {name = 'tree-01', position = args.p, visible_on_overworld = true} end
elseif noises.forest(p) < -1.4 then
if Math.random(1,100) < treedensity*100 then args.entities[#args.entities + 1] = {name = 'tree-03', position = args.p, visible_on_overworld = true} end
else
if Math.random(1,100) < treedensity*100 then args.entities[#args.entities + 1] = {name = 'tree-02', position = args.p, visible_on_overworld = true} end
end
end
end
end

View File

@ -62,7 +62,7 @@ function Public.terrain(args)
if noises.height(p) > 0.06 then
if noises.forest_abs_suppressed(p) > 0.5 then
if (not args.iconized_generation) and noises.forest_abs_suppressed(p) < 0.75 and Math.random(2000) == 1 then
if (not args.iconized_generation) and noises.forest_abs_suppressed(p) < 0.75 and Math.random(1300) == 1 then
args.specials[#args.specials + 1] = {name = 'chest', position = args.p}
else
local forest_noise = noises.forest(p)

View File

@ -66,7 +66,7 @@ function Public.terrain(args)
if noises.height(p) > 0.11 then
if noises.forest_abs_suppressed(p) > 0.7 then
if (not args.iconized_generation) and noises.forest_abs_suppressed(p) < 1 and Math.random(750) == 1 then -- high amounts of this
if (not args.iconized_generation) and noises.forest_abs_suppressed(p) < 1 and Math.random(700) == 1 then -- high amounts of this
args.specials[#args.specials + 1] = {name = 'chest', position = args.p}
else
local forest_noise = noises.forest(p)

View File

@ -303,7 +303,7 @@ function Public.kraken_die(kraken_id)
local reward_fuel = Balance.kraken_kill_reward_fuel()
memory.stored_fuel = memory.stored_fuel + reward_fuel
local message = {'pirates.granted_3', {'pirates.granted_kraken_kill'}, Math.floor(reward_items[2].count/100)/10 .. 'k [item=coin]', reward_fuel .. ' [item=coal]', reward_items[1].count .. ' [item=sulfuric-acid-barrel]'}
local message = {'pirates.granted_3', {'pirates.granted_kraken_kill'}, reward_items[2].count .. ' [item=coin]', reward_fuel .. ' [item=coal]', reward_items[1].count .. ' [item=sulfuric-acid-barrel]'}
Common.notify_force_light(memory.force,message)
memory.playtesting_stats.coins_gained_by_krakens = memory.playtesting_stats.coins_gained_by_krakens + reward_items[2].count