Skip to content

Commit

Permalink
Merge pull request #1442 from RedRafe/updates/frontier
Browse files Browse the repository at this point in the history
Update Frontier to 2.0
  • Loading branch information
grilledham authored Nov 10, 2024
2 parents 90d5fbb + 9fcc254 commit 8645e4b
Show file tree
Hide file tree
Showing 44 changed files with 146 additions and 129 deletions.
2 changes: 1 addition & 1 deletion features/landfill_remover.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ local floor = math.floor
local ceil = math.ceil
local fast_remove = table.fast_remove

local collision_mask = {'floor-layer', 'object-layer', 'resource-layer'}
local collision_mask = {'floor', 'object', 'resource'}
local whitelist = defines.deconstruction_item.tile_filter_mode.whitelist
local entity_whitelist = defines.deconstruction_item.entity_filter_mode.whitelist

Expand Down
4 changes: 2 additions & 2 deletions locale/en/redmew_features.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ item_sold_out=SOLD OUT!
item_is_free=FREE!
generic_item_disabled_message=Item is disabled
not_enough_currency=Missing __1__ __2__ to buy __3__
item_with_player_limit_description=You have bought this item __1__ out of __plural_for_parameter_2_{1=1 time|rest=__2__ times}__
item_with_player_limit_description=You have bought this item __1__ out of __plural_for_parameter__2__{1=1 time|rest=__2__ times}__
item_no_longer_available=This item is no longer available in the market
item_disabled_reason=__1__ is disabled. __2__
no_inventory_space=Insufficient inventory space
Expand Down Expand Up @@ -218,5 +218,5 @@ err_no_armor=[color=blue][Battery recharge][/color] No valid armor to charge was
err_no_accumulators=[color=blue][Battery recharge][/color] No accumulators nearby.
[clear_corpses]
count=[color=blue][Cleaner][/color] __1__ __plural_for_parameter_1_{1=corpse|rest=corpses}__ removed.
count=[color=blue][Cleaner][/color] __1__ __plural_for_parameter__1__{1=corpse|rest=corpses}__ removed.
clear=[color=blue][Cleaner][/color] already clear.
6 changes: 3 additions & 3 deletions locale/en/redmew_maps.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ gps=[gps=__1__,__2__,__3__]
tile_unlock=__1__ has unlocked new grounds! __2__
[frontier]
add_rocket=Adding __1__ extra __plural_for_parameter_1_{1=launch|rest=launches}__ thanks to the death of __2__. __3__ __plural_for_parameter_3_{1=rocket|rest=rockets}__ to go!
add_rocket=Adding __1__ extra __plural_for_parameter__1__{1=launch|rest=launches}__ thanks to the death of __2__. __3__ __plural_for_parameter__3__{1=rocket|rest=rockets}__ to go!
earn_coin=[achievement=steamrolled] you steal another treasure [item=coin] from the Kraken's army.
empty_rocket=[color=purple][Kraken][/color] The God of the Sea accepts your rocket offer and rewards you with magic fishes
kraken_eat=[color=purple][Kraken][/color] ate __1__ and was delicious!
loot_chest=[achievement=golem] You find an hidden [color=orange]treasure[/color] beneath the enemy forces
abort=[color=blue][Mapkeeper][/color] Aborting map restart
restart=[color=blue][Mapkeeper][/color] Map is restarting in __1__ __plural_for_parameter_1_{1=second|rest=seconds}__
rocket_launched=[color=blue][Mapkeeper][/color] __1__ __plural_for_parameter_1_{1=rocket|rest=rockets}__ launched, __2__ __plural_for_parameter_2_{1=rocket|rest=rockets}__ to go!
restart=[color=blue][Mapkeeper][/color] Map is restarting in __1__ __plural_for_parameter__1__{1=second|rest=seconds}__
rocket_launched=[color=blue][Mapkeeper][/color] __1__ __plural_for_parameter__1__{1=rocket|rest=rockets}__ launched, __2__ __plural_for_parameter__2__{1=rocket|rest=rockets}__ to go!
rockets_to_launch=Remaining rockets to launch
shop_funds=Available team funds
shop_funds_alert=[color=blue][Mapkeeper][/color] __1__ has rerolled the Spawn shop offers! Remaining funds: [color=green]__2__[/color] x [img=item/coin]
Expand Down
2 changes: 1 addition & 1 deletion locale/fi/redmew_features.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ item_sold_out=Loppuun myyty!
item_is_free=ILMAISEN!
generic_item_disabled_message=Kohde on poistettu käytöstä
not_enough_currency=Puuttuu __1__ __2__ ostamaan __3__
item_with_player_limit_description=Olet ostanut tämän kohteen __1__ __plural_for_parameter_2_{1=1 aikaväli rest=__2__ kertaa}__
item_with_player_limit_description=Olet ostanut tämän kohteen __1__ __plural_for_parameter__2__{1=1 aikaväli rest=__2__ kertaa}__
item_no_longer_available=Tämä tuote ei ole enää saatavilla markkinoilla
item_disabled_reason=__1__ on poistettu käytöstä. __2__
no_inventory_space=Riittämätön varaston tila
Expand Down
2 changes: 1 addition & 1 deletion locale/no/redmew_features.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ item_sold_out=UTSOLGT!
item_is_free=GRATIS!
generic_item_disabled_message=Elementet er deaktivert
not_enough_currency=Mangler __1__ __2__ for å kjøpe __3__
item_with_player_limit_description=Du har kjøpt denne tingen __1__ av __plural_for_parameter_2_{1=1 time|rest=__2__ times}__
item_with_player_limit_description=Du har kjøpt denne tingen __1__ av __plural_for_parameter__2__{1=1 time|rest=__2__ times}__
item_no_longer_available=Denne tingen er ikke lenger tilgjengelig i markedet
item_disabled_reason=__1__ er deaktivert. __2__
no_inventory_space=Ikke nok inventar plass
Expand Down
2 changes: 1 addition & 1 deletion locale/ru/redmew_features.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ item_sold_out=ПРОДАНО!
item_is_free=БЕСПЛАТНО!
generic_item_disabled_message=Предмет отключен
not_enough_currency=Отсутствует __1__ __2__ для покупки __3__
item_with_player_limit_description=Вы купили этот элемент __1__ из __plural_for_parameter_2_{1=1 единожды|rest=__2__ раз}__
item_with_player_limit_description=Вы купили этот элемент __1__ из __plural_for_parameter__2__{1=1 единожды|rest=__2__ раз}__
item_no_longer_available=Этот предмет больше не доступен на рынке
item_disabled_reason=__1__ отключен. __2__
no_inventory_space=Недостаточно места в инвентаре
Expand Down
2 changes: 1 addition & 1 deletion locale/zh-CN/redmew_features.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ item_sold_out=售罄!
item_is_free=免费!
generic_item_disabled_message=物品已禁用
not_enough_currency=缺少 __1__ __2__ 来购买 __3__
item_with_player_limit_description=您已从__plural_for_parameter_2_中购买此项目__1__{1=1 time|rest=__2__ times}__
item_with_player_limit_description=您已从__plural_for_parameter__2__中购买此项目__1__{1=1 time|rest=__2__ times}__
item_no_longer_available=此物品在超市中不再可用
item_disabled_reason=__1__ 已禁用。 __2__
no_inventory_space=库存空间不足
Expand Down
4 changes: 2 additions & 2 deletions map_gen/entities/neko_bridged_rivers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ local function run_terrain_module(x, y, world)

if
math.floor(terrain_D) % 5 == 1 and math.random(1, 70) == 1 and
surface.can_place_entity {name = 'rock-big', position = pos}
surface.can_place_entity {name = 'big-rock', position = pos}
then
surface.create_entity {name = 'rock-big', position = pos}
surface.create_entity {name = 'big-rock', position = pos}
end
else
if terrain_D >= 20 then
Expand Down
2 changes: 1 addition & 1 deletion map_gen/maps/april_fools/modules/biter_ores.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ local function spawn_ores_on_death(event)
ore_type = found_ores[math.random(1,#found_ores)].name
end

if surface.get_tile(position).collides_with("ground-tile") then
if surface.get_tile(position).collides_with("ground_tile") then
surface.create_entity{name = ore_type, position = position, amount = ore_amount_to_add}
end
--return since we might have changed found_ores
Expand Down
6 changes: 3 additions & 3 deletions map_gen/maps/april_fools/modules/meteOres.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ local function drop_meteors()
local map_position = {x = chunk_position.x * 32 + rand_x, y = chunk_position.y * 32 + rand_y}

-- Spawn Rock
if surface.get_tile(map_position).collides_with('ground-tile') then
if surface.get_tile(map_position).collides_with('ground_tile') then
surface.create_entity({name = 'huge-rock', position = map_position, move_stuck_players = true,})
surface.create_entity({name = 'massive-explosion', position = map_position,})
end
Expand Down Expand Up @@ -113,7 +113,7 @@ local function drop_meteors()
if b < a then
ore_amount = math.random(b * ORE_DENSITY - b * (ORE_DENSITY - 8), b * ORE_DENSITY + b * (ORE_DENSITY - 8))
end
if surface.get_tile(map_position.x + x, map_position.y + y).collides_with('ground-tile') then
if surface.get_tile(map_position.x + x, map_position.y + y).collides_with('ground_tile') then
if ores == 'mixed' then
ore_type = BASIC_ORES[math.random(1, #BASIC_ORES)]
end
Expand All @@ -130,7 +130,7 @@ local function drop_meteors()
local biter_position = {
map_position.x + math.random(-METEOR_SIZE, METEOR_SIZE),
map_position.y + math.random(-METEOR_SIZE, METEOR_SIZE)}
if surface.get_tile(biter_position).collides_with('ground-tile') then
if surface.get_tile(biter_position).collides_with('ground_tile') then
surface.create_entity{
name = biters[unit_index],
position = biter_position,
Expand Down
2 changes: 1 addition & 1 deletion map_gen/maps/april_fools/modules/random_ores.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ local function on_built_miner(event)
if rand >= MAX_RAND*(1 - extra_percent) then
local rand_ore = table.get_random_weighted(ORES)

if (rand_ore ~= ore.name) and surface.get_tile(ore.position.x, ore.position.y).collides_with('ground-tile') then
if (rand_ore ~= ore.name) and surface.get_tile(ore.position.x, ore.position.y).collides_with('ground_tile') then
local amount = ore.amount
local ore_position = ore.position
ore.destroy()
Expand Down
2 changes: 1 addition & 1 deletion map_gen/maps/april_fools/scenario/cave_collapse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ local function create_collapse_template(positions, surface)
end

local function create_collapse_alert(surface, position)
local target = surface.create_entity({ position = position, name = 'rock-big' })
local target = surface.create_entity({ position = position, name = 'big-rock' })
for _, player in pairs(game.connected_players) do
player.add_custom_alert(target, collapse_alert, { 'diggy.cave_collapse' }, true)
end
Expand Down
3 changes: 2 additions & 1 deletion map_gen/maps/april_fools/scenario/restart_command.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ local Restart = require 'features.restart_command'
local ShareGlobals = require 'map_gen.maps.april_fools.scenario.shared_globals'
local ScoreTracker = require 'utils.score_tracker'
local PlayerStats = require 'features.player_stats'
local RS = require 'map_gen.shared.redmew_surface'
local format_number = require 'util'.format_number

return function(config)
Expand Down Expand Up @@ -143,7 +144,7 @@ return function(config)
local total_ore = 0
local ore_totals_message = '('
for ore_name in pairs(ore_products) do
local count = game.forces["player"].get_item_production_statistics.get_input_count(ore_name)
local count = game.forces["player"].get_item_production_statistics(RS.get_surface_name()).get_input_count(ore_name)
total_ore = total_ore + count
ore_totals_message = ore_totals_message..ore_name:gsub( "-ore", "")..": "..format_number(count, true)..", "
end
Expand Down
14 changes: 7 additions & 7 deletions map_gen/maps/april_fools/scenario/template.lua
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,19 @@ end

Template.diggy_rocks = {
'rock-huge-volcanic',
'rock-big-volcanic',
'big-rock-volcanic',
'rock-huge-black',
'rock-big-black',
'big-rock-black',
'rock-huge-grey',
'rock-big-grey',
'big-rock-grey',
'rock-huge-red',
'rock-big-red',
'big-rock-red',
'rock-huge-white',
'rock-big-white',
'big-rock-white',
'rock-huge-brown',
'rock-big-brown',
'big-rock-brown',
'rock-huge-dustyrose',
'rock-big-dustyrose',
'big-rock-dustyrose',
}
Template.diggy_rocks_map = util.list_to_map(Template.diggy_rocks)

Expand Down
1 change: 0 additions & 1 deletion map_gen/maps/crash_site/scenario.lua
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,6 @@ Global.register_init(
local surface = game.surfaces[1]
surface.map_gen_settings = {width = 2, height = 2}
surface.clear()
game.forces.player.set_surface_hidden('nauvis', true)
game.forces.player.lock_space_location('nauvis')

local seed = RS.get_surface().map_gen_settings.seed
Expand Down
3 changes: 2 additions & 1 deletion map_gen/maps/danger_ores/modules/restart_command.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ local MapPoll = require 'map_gen.maps.danger_ores.modules.map_poll'
local ShareGlobals = require 'map_gen.maps.danger_ores.modules.shared_globals'
local ScoreTracker = require 'utils.score_tracker'
local PlayerStats = require 'features.player_stats'
local RS = require 'map_gen.shared.redmew_surface'
local format_number = require 'util'.format_number

return function(config)
Expand Down Expand Up @@ -145,7 +146,7 @@ return function(config)
local total_ore = 0
local ore_totals_message = '('
for ore_name in pairs(ore_products) do
local count = game.forces["player"].get_item_production_statistics.get_input_count(ore_name)
local count = game.forces["player"].get_item_production_statistics(RS.get_surface_name()).get_input_count(ore_name)
total_ore = total_ore + count
ore_totals_message = ore_totals_message..ore_name:gsub( "-ore", "")..": "..format_number(count, true)..", "
end
Expand Down
2 changes: 0 additions & 2 deletions map_gen/maps/danger_ores/presets/danger_ore_quality.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ Event.on_init(function()

RS.get_surface().always_day = true
RS.get_surface().peaceful_mode = true

game.forces.player.set_surface_hidden('nauvis', true)
end)

require 'map_gen.maps.danger_ores.modules.robot_cargo_capacity'
Expand Down
2 changes: 1 addition & 1 deletion map_gen/maps/deprecated_borg_planet_v2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ return function(_, _, world) -- luacheck: ignore 561
end

if noise_trees < -0.5 and (tile_to_insert == 'sand-3' or tile_to_insert == 'sand-1') and random(15) == 1 then
insert(entities, {name = 'rock-big'})
insert(entities, {name = 'big-rock'})
end

local noise_water_1 = perlin.noise(((world.x + seed) / 200), ((world.y + seed) / 200), 0)
Expand Down
2 changes: 1 addition & 1 deletion map_gen/maps/diggy/feature/cutscene.lua
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ local function cutscene_function(player_index, waypoint_index, params)
local radius = 10
local entity
repeat
entity = RS.get_surface().find_entities_filtered {position = {0, 0}, radius = radius, name = 'rock-big', limit = 1}
entity = RS.get_surface().find_entities_filtered {position = {0, 0}, radius = radius, name = 'big-rock', limit = 1}
if radius <= 10 then
radius = 0
end
Expand Down
4 changes: 2 additions & 2 deletions map_gen/maps/diggy/feature/diggy_cave_collapse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ local function create_collapse_template(positions, surface)
end

local function create_collapse_alert(surface, position)
local target = surface.create_entity({position = position, name = 'rock-big'})
local target = surface.create_entity({position = position, name = 'big-rock'})
for _, player in pairs(game.connected_players) do
player.add_custom_alert(target, collapse_alert, {'diggy.cave_collapse'}, true)
end
Expand Down Expand Up @@ -215,7 +215,7 @@ local function on_collapse_triggered(event)

local x_t = new_tile_map[x]
if x_t and x_t[y] then
template_insert(surface, {}, {{position = position, name = 'rock-big'}})
template_insert(surface, {}, {{position = position, name = 'big-rock'}})
return
end
spawn_collapse_text(surface, position)
Expand Down
4 changes: 2 additions & 2 deletions map_gen/maps/diggy/feature/diggy_hole.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ local function update_robot_mining_damage()
robot_mining.damage = old_modifier + robot_mining.active_modifier
end

---Triggers a diggy diggy hole for a given big-rock, rock-big or huge-rock.
---Triggers a diggy diggy hole for a given big-rock, big-rock or huge-rock.
---@param entity LuaEntity
local function diggy_hole(entity)
local tiles = {}
Expand Down Expand Up @@ -115,7 +115,7 @@ local function diggy_hole(entity)
if predicted < 0.2 then
rocks[i] = {name = 'huge-rock', position = void_position}
elseif predicted < 0.6 then
rocks[i] = {name = 'rock-big', position = void_position}
rocks[i] = {name = 'big-rock', position = void_position}
else
rocks[i] = {name = 'big-rock', position = void_position}
end
Expand Down
6 changes: 3 additions & 3 deletions map_gen/maps/diggy/feature/experience.lua
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ local function on_player_mined_entity(event)
local exp = 0
if name == 'big-rock' then
exp = sand_rock_xp + floor(level / 5)
elseif name == 'rock-big' then
elseif name == 'big-rock' then
exp = rock_big_xp + floor(level / 5)
elseif name == 'huge-rock' then
exp = rock_huge_xp + floor(level / 5)
Expand Down Expand Up @@ -294,7 +294,7 @@ local function on_entity_died(event)
local level = get_force_data(force).current_level
if entity_name == 'big-rock' then
exp = floor((sand_rock_xp + level * 0.2) * 0.5)
elseif entity_name == 'rock-big' then
elseif entity_name == 'big-rock' then
exp = floor((rock_big_xp + level * 0.2) * 0.5)
elseif entity_name == 'huge-rock' then
exp = floor((rock_huge_xp + level * 0.2) * 0.5)
Expand Down Expand Up @@ -613,7 +613,7 @@ function Experience.register(cfg)

-- Prevents table lookup thousands of times
sand_rock_xp = config.XP['big-rock']
rock_big_xp = config.XP['rock-big']
rock_big_xp = config.XP['big-rock']
rock_huge_xp = config.XP['huge-rock']
end

Expand Down
2 changes: 1 addition & 1 deletion map_gen/maps/diggy/feature/starting_zone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function StartingZone.register(config)
end

if (distance > rock_range) then
insert(rocks, {name = 'rock-big', position = {x = x, y = y}})
insert(rocks, {name = 'big-rock', position = {x = x, y = y}})
end

-- hack to avoid starting area from collapsing
Expand Down
2 changes: 0 additions & 2 deletions map_gen/maps/diggy/presets/danger_ores.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ local config = {
['nuclear-reactor'] = 4,
['stone-wall'] = 3,
['big-rock'] = 2,
['rock-big'] = 2,
['huge-rock'] = 2.5,
['out-of-map'] = 1,
['stone-path'] = 0.03,
Expand Down Expand Up @@ -359,7 +358,6 @@ local config = {
mining_speed_productivity_multiplier = 5,
XP = {
['big-rock'] = 5,
['rock-big'] = 5,
['huge-rock'] = 10,
['rocket_launch'] = 0.05, -- XP reward in percentage of total experience when a rocket launches (Diggy default: 0.05 which equals 5%)
['rocket_launch_max'] = 500000, -- Max XP reward from rocket launches (Diggy default: 500000)
Expand Down
2 changes: 0 additions & 2 deletions map_gen/maps/diggy/presets/danger_ores_BnB.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ local config = {
['nuclear-reactor'] = 4,
['stone-wall'] = 3,
['big-rock'] = 2,
['rock-big'] = 2,
['huge-rock'] = 2.5,
['out-of-map'] = 1,
['stone-path'] = 0.03,
Expand Down Expand Up @@ -359,7 +358,6 @@ local config = {
mining_speed_productivity_multiplier = 5,
XP = {
['big-rock'] = 5,
['rock-big'] = 5,
['huge-rock'] = 10,
['rocket_launch'] = 0.05, -- XP reward in percentage of total experience when a rocket launches (Diggy default: 0.05 which equals 5%)
['rocket_launch_max'] = 500000, -- Max XP reward from rocket launches (Diggy default: 500000)
Expand Down
2 changes: 0 additions & 2 deletions map_gen/maps/diggy/presets/normal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ local config = {
['nuclear-reactor'] = 4,
['stone-wall'] = 3,
['big-rock'] = 2,
['rock-big'] = 2,
['huge-rock'] = 2.5,
['out-of-map'] = 1,
['stone-path'] = 0.03,
Expand Down Expand Up @@ -359,7 +358,6 @@ local config = {
mining_speed_productivity_multiplier = 5,
XP = {
['big-rock'] = 5,
['rock-big'] = 5,
['huge-rock'] = 10,
['rocket_launch'] = 0.05, -- XP reward in percentage of total experience when a rocket launches (Diggy default: 0.05 which equals 5%)
['rocket_launch_max'] = 500000, -- Max XP reward from rocket launches (Diggy default: 500000)
Expand Down
4 changes: 2 additions & 2 deletions map_gen/maps/diggy/template.lua
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,12 @@ function Template.resources(surface, resources)
end
end

Template.diggy_rocks = {'big-rock', 'rock-big', 'huge-rock'}
Template.diggy_rocks = {'big-rock', 'big-rock', 'huge-rock'}

---Returns true if the entity name is that of a diggy rock.
---@param entity_name string
function Template.is_diggy_rock(entity_name)
return entity_name == 'big-rock' or entity_name == 'rock-big' or entity_name == 'huge-rock'
return entity_name == 'big-rock' or entity_name == 'big-rock' or entity_name == 'huge-rock'
end

return Template
Loading

0 comments on commit 8645e4b

Please sign in to comment.