From 3202f9d5cfb68df83b55d7f58b3b8572060a1c94 Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Sat, 4 Jun 2022 14:43:08 +0100 Subject: [PATCH] cleanup; more treasure chests; harder electronic circuit leaving costs --- control.lua | 2 +- locale/en/pirates.cfg | 6 +++--- maps/pirates/api_events.lua | 7 ++++--- maps/pirates/gui/evo.lua | 6 +++++- maps/pirates/overworld.lua | 20 +++++++++---------- maps/pirates/surfaces/hold.lua | 2 +- maps/pirates/surfaces/islands/first/first.lua | 16 +++++++++------ .../surfaces/islands/standard/standard.lua | 2 +- .../standard_variant/standard_variant.lua | 2 +- maps/pirates/surfaces/sea/kraken.lua | 2 +- 10 files changed, 37 insertions(+), 28 deletions(-) diff --git a/control.lua b/control.lua index df144849..21182d2e 100644 --- a/control.lua +++ b/control.lua @@ -1,6 +1,6 @@ require 'utils.data_stages' _LIFECYCLE = _STAGE.control -- Control stage -_DEBUG = false +_DEBUG = true _DUMP_ENV = false require 'utils.server' diff --git a/locale/en/pirates.cfg b/locale/en/pirates.cfg index 802480f0..76c54a4a 100644 --- a/locale/en/pirates.cfg +++ b/locale/en/pirates.cfg @@ -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__. diff --git a/maps/pirates/api_events.lua b/maps/pirates/api_events.lua index 34aa3dc2..f76b448f 100644 --- a/maps/pirates/api_events.lua +++ b/maps/pirates/api_events.lua @@ -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 diff --git a/maps/pirates/gui/evo.lua b/maps/pirates/gui/evo.lua index 117639ec..145eb678 100644 --- a/maps/pirates/gui/evo.lua +++ b/maps/pirates/gui/evo.lua @@ -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 diff --git a/maps/pirates/overworld.lua b/maps/pirates/overworld.lua index e926bed6..bad4e499 100644 --- a/maps/pirates/overworld.lua +++ b/maps/pirates/overworld.lua @@ -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 diff --git a/maps/pirates/surfaces/hold.lua b/maps/pirates/surfaces/hold.lua index aa13b4d9..3e73ac58 100644 --- a/maps/pirates/surfaces/hold.lua +++ b/maps/pirates/surfaces/hold.lua @@ -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{ diff --git a/maps/pirates/surfaces/islands/first/first.lua b/maps/pirates/surfaces/islands/first/first.lua index f9b0c12b..89186bec 100644 --- a/maps/pirates/surfaces/islands/first/first.lua +++ b/maps/pirates/surfaces/islands/first/first.lua @@ -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 diff --git a/maps/pirates/surfaces/islands/standard/standard.lua b/maps/pirates/surfaces/islands/standard/standard.lua index b9bf75d9..01922859 100644 --- a/maps/pirates/surfaces/islands/standard/standard.lua +++ b/maps/pirates/surfaces/islands/standard/standard.lua @@ -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) diff --git a/maps/pirates/surfaces/islands/standard_variant/standard_variant.lua b/maps/pirates/surfaces/islands/standard_variant/standard_variant.lua index 160449ca..e7cc458b 100644 --- a/maps/pirates/surfaces/islands/standard_variant/standard_variant.lua +++ b/maps/pirates/surfaces/islands/standard_variant/standard_variant.lua @@ -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) diff --git a/maps/pirates/surfaces/sea/kraken.lua b/maps/pirates/surfaces/sea/kraken.lua index 0a7d2e2e..8955c313 100644 --- a/maps/pirates/surfaces/sea/kraken.lua +++ b/maps/pirates/surfaces/sea/kraken.lua @@ -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