1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2024-12-28 23:06:38 +02:00

Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Gerkiz 2023-09-19 08:47:32 +02:00
commit 4bd0075723
5 changed files with 1583 additions and 992 deletions

View File

@ -1,4 +1,26 @@
[journey]
map_info_main_caption=The Journey
map_info_sub_caption=v 1.8
map_info_text=The selectors in the mothership, allow you to choose a destination.\nWorlds can be rerolled by spending a satellite at the top selector.\nOnce enough players are on a selector, mothership will start traveling.\n\nA teleporter will be deployed, after reaching the target.\nIt is however, only capable of transfering the subjects body.\n\nWorlds will get more difficult with each jump, stacking the chosen modifiers.\nLaunch uranium fuel cells via rocket cargo, to advance to the next world.\nThe tooltips on the top buttons yield informations about the current world.\nIf the journey ends, an admin can fully reset the map via command "/reset-journey".\n\nHow far will the journey lead?
map_info_sub_caption=v 1.9
map_info_text=The selectors in the mothership, allow you to choose a destination.\nWorlds can be rerolled by spending a satellite at the top selector.\nOnce enough players are on a selector, mothership will start traveling.\n\nA teleporter will be deployed, after reaching the target.\nIt is however, only capable of transfering the subjects body.\n\nWorlds will get more difficult with each jump, stacking the chosen modifiers.\nLaunch uranium fuel cells via rocket cargo, to advance to the next world.\nThe tooltips on the top buttons yield informations about the current world.\nIf the journey ends, an admin can fully reset the map via command "/journey-reset".\n\nHow far will the journey lead?
tooltip_satellite=Satellites stored: __1__ / __2__\nSatellites are used by Mothership to scout for alternative destinations.
tooltip_nuclear_fuel=Emergency Reactors working: __1__ / __2__\n30 Emergency Reactors are usually damaged by Mothership if the current colony is determined to be lost and Mothership has to leave in a hurry.\nIf teleporter is lost and there is no emergency power, the game is over and run resets.
tooltip_fuel=Fuel requirement to advance to next world:\n__1__\n\nNuclear Fuel Cells in Mothership Cargo:\n__2__
tooltip_delivery=Orbital Station Delivery: __1__ / __2__\nStation pays with one random starting item roll per time threshold.\nTimes: 120min, 240min, 480min, 960min, 1920min, 3840min\nCurrent time: __3__ minutes.
beacon_hp=HP: __1__/10000
teleporter=Personal Teleporter
chunks_delete=Deleting chunks.. __1__
mothership_format=[font=heading-1][color=255,155,155]<Mothership> [/color][/font][font=default-game][color=200,200,200]__1__[/color][/font]
world=World __1__ | __2__
world_tooltip=__1__\n\n__2__\nCapsules:\n__3__
tooltip_modifier=__1__ - __2__%\n
tooltip_capsule= __1__x [item=__2__]
tooltip_capsule2= __1__x [item=__2__]\n
message_rocket_launched=Launching a rocket with __1__x [item=__2__] at [gps=__3__,__4__,nauvis].
message_min_players=The minimal amount of players to vote for new world is set to __1__.
message_delivery_done=[img=item/__1__] Orbital Station delivery completed in __2__ minutes, granting __3__ loot rolls!
message_delivered=Delivered from Orbital Station: __2__x [img=item/__1__] added to capsule storage.
cmd_server_restarting=Server is restarting to apply updates to the scenario...Please reconnect in a minute.

View File

@ -1,8 +1,8 @@
--luacheck: ignore
local Public = {}
Public.mothership_teleporter_position = {x = 0, y = 12}
Public.teleporter_tile = "lab-dark-2"
Public.teleporter_tile = 'lab-dark-2'
Public.mothership_radius = 48
@ -13,7 +13,7 @@ for x = Public.mothership_radius * -1 - 32, Public.mothership_radius + 32, 1 do
local distance = math.sqrt(position.x ^ 2 + position.y ^ 2)
if distance > Public.mothership_radius then
table.insert(Public.particle_spawn_vectors, {position.x, position.y})
end
end
end
end
Public.size_of_particle_spawn_vectors = #Public.particle_spawn_vectors
@ -23,8 +23,8 @@ Public.world_selector_height = 8
Public.max_satellites = 3
local area = {
left_top = {x = -3, y = math.floor(Public.mothership_radius * 0.5) * -1},
right_bottom = {x = 3, y = math.floor(Public.mothership_radius * 0.5) * -1 + Public.world_selector_height},
left_top = {x = -3, y = 4 + math.floor(Public.mothership_radius * 0.5) * -1},
right_bottom = {x = 3, y = 4 + math.floor(Public.mothership_radius * 0.5) * -1 + Public.world_selector_height},
}
Public.world_selector_areas = {
@ -53,149 +53,311 @@ Public.reroll_selector_area = {
Public.mothership_messages = {
waiting = {
"Return to me, so we can continue the journey!",
"Don't leave me waiting for so long. Let's continue our journey.",
"Please return to me.",
"Board me, so we can continue this adventure!",
'Return to me, so we can continue the journey!',
'Don\'t leave me waiting for so long. Let\'s continue our journey.',
'Please return to me.',
'Board me, so we can continue this adventure!',
},
answers = {
"Yes, great idea.",
"Yes, wonderful.",
"Yes, definitely.",
"Yes, i love it!",
"The calculations say yes.",
"I don't know how to feel about this.",
"Ask again later, my processors are very busy.",
"No, this is certainly wrong.",
"No, i don't think so.",
"No, you are wrong.",
"No, that would be weird.",
"The calculations say no.",
'Yes, great idea.',
'Yes, wonderful.',
'Yes, definitely.',
'Yes, i love it!',
'The calculations say yes.',
'I don\'t know how to feel about this.',
'Ask again later, my processors are very busy.',
'No, this is certainly wrong.',
'No, i don\'t think so.',
'No, you are wrong.',
'No, that would be weird.',
'The calculations say no.',
},
}
Public.mothership_gen_settings = {
["water"] = 0,
["starting_area"] = 1,
["cliff_settings"] = {cliff_elevation_interval = 0, cliff_elevation_0 = 0},
["default_enable_all_autoplace_controls"] = false,
["autoplace_settings"] = {
["entity"] = {treat_missing_as_default = false},
["tile"] = {treat_missing_as_default = false},
["decorative"] = {treat_missing_as_default = false},
['water'] = 0,
['starting_area'] = 1,
['cliff_settings'] = {cliff_elevation_interval = 0, cliff_elevation_0 = 0},
['default_enable_all_autoplace_controls'] = false,
['autoplace_settings'] = {
['entity'] = {treat_missing_as_default = false},
['tile'] = {treat_missing_as_default = false},
['decorative'] = {treat_missing_as_default = false},
},
autoplace_controls = {
["coal"] = {frequency = 0, size = 0, richness = 0},
["stone"] = {frequency = 0, size = 0, richness = 0},
["copper-ore"] = {frequency = 0, size = 0, richness = 0},
["iron-ore"] = {frequency = 0, size = 0, richness = 0},
["uranium-ore"] = {frequency = 0, size = 0, richness = 0},
["crude-oil"] = {frequency = 0, size = 0, richness = 0},
["trees"] = {frequency = 0, size = 0, richness = 0},
["enemy-base"] = {frequency = 0, size = 0, richness = 0}
['coal'] = {frequency = 0, size = 0, richness = 0},
['stone'] = {frequency = 0, size = 0, richness = 0},
['copper-ore'] = {frequency = 0, size = 0, richness = 0},
['iron-ore'] = {frequency = 0, size = 0, richness = 0},
['uranium-ore'] = {frequency = 0, size = 0, richness = 0},
['crude-oil'] = {frequency = 0, size = 0, richness = 0},
['trees'] = {frequency = 0, size = 0, richness = 0},
['enemy-base'] = {frequency = 0, size = 0, richness = 0}
},
}
Public.modifiers = {
["trees"] = {-20, -10, "Trees"},
["tree_durability"] = {-30, -15, "Tree Durability"},
["cliff_settings"] = {20, 40, "Cliffs"},
["water"] = {-20, -10, "Water"},
["coal"] = {-20, -10, "Coal"},
["stone"] = {-20, -10, "Stone"},
["iron-ore"] = {-20, -10, "Iron Ore"},
["copper-ore"] = {-20, -10, "Copper Ore"},
["crude-oil"] = {-20, -10, "Oil"},
["uranium-ore"] = {-20, -10, "Uranium Ore"},
["mixed_ore"] = {-20, -10, "Mixed Ore"},
["enemy-base"] = {10, 20, "Nests"},
["expansion_cooldown"] = {-30, -15, "Nest Expansion Cooldown"},
["enemy_attack_pollution_consumption_modifier"] = {-20, -10, "Nest Pollution Consumption"},
["max_unit_group_size"] = {15, 30, "Biter Group Size Maximum"},
["time_factor"] = {15, 30, "Evolution Time Factor"},
["destroy_factor"] = {15, 30, "Evolution Destroy Factor"},
["pollution_factor"] = {15, 30, "Evolution Pollution Factor"},
["ageing"] = {-20, -10, "Terrain Pollution Consumption"},
["diffusion_ratio"] = {10, 20, "Pollution Diffusion"},
["technology_price_multiplier"] = {10, 20, "Technology Price"},
Public.modifiers = {
['trees_size'] = {min = 0.01, max = 10, base = 1, dmin = -40, dmax = -20, name = 'Forest Sizes'},
['trees_richness'] = {min = 0.01, max = 10, base = 1, dmin = -40, dmax = -20, name = 'Amounts Of Trees'},
['trees_frequency'] = {min = 0.01, max = 10, base = 1, dmin = -40, dmax = -20, name = 'Forest Frequency'},
['tree_durability'] = {min = 0.1, max = 50, base = 30, dmin = -30, dmax =-15, name = 'Tree Durability'},
['ore_size'] = {min = 0.8, max = 10, base = 2, dmin = -10, dmax = -5, name = 'Ore Field Size'},
['ore_frequency'] = {min = 1, max = 1, base = 1, dmin = 0, dmax = 0, name = 'Ore Frequency', static = true},
['cliff_continuity'] = {min = 1, max = 10, base = 8, dmin = -30, dmax = -15, name = 'Cliff Continuity'},
['cliff_frequency'] = {min = 5, max = 80, base = 60, dmin = -30, dmax = -15, name = 'Cliff Frequency'},
['water'] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = 'Water'},
['coal'] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = 'Coal'},
['stone'] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = 'Stone'},
['iron-ore'] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = 'Iron Ore'},
['copper-ore'] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = 'Copper Ore'},
['crude-oil'] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = 'Oil'},
['uranium-ore'] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = 'Uranium Ore'},
['mixed_ore'] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = 'Mixed Ore'},
['enemy_base_size'] = {min = 0.01, max = 10, base = 1, dmin = 20, dmax = 40, name = 'Nest Sizes'},
['enemy_base_richness'] = {min = 0.01, max = 10, base = 1, dmin = 20, dmax = 40, name = 'Nest Amounts'},
['enemy_base_frequency'] = {min = 0.01, max = 10, base = 1, dmin = 20, dmax = 40, name = 'Nest Frequency'},
['expansion_cooldown'] = {min = 3600, max = 28800, base = 14400, dmin = -20, dmax = -10, name = 'Nest Expansion Cooldown'},
['enemy_attack_pollution_consumption_modifier'] = {min = 0.25, max = 4, base = 1, dmin = -5, dmax = -2.5, name = 'Nest Pollution Consumption'},
['max_unit_group_size'] = {min = 10, max = 500, base = 100, dmin = 10, dmax = 20, name = 'Biter Group Size Maximum'},
['time_factor'] = {min = 0.000001, max = 0.0001, base = 0.000004, dmin = 15, dmax = 30, name = 'Evolution Time Factor'},
['destroy_factor'] = {min = 0.0002, max = 0.2, base = 0.002, dmin = 15, dmax = 30, name = 'Evolution Destroy Factor'},
['pollution_factor'] = {min = 0.00000009, max = 0.00009, base = 0.0000009, dmin = 15, dmax = 30, name = 'Evolution Pollution Factor'},
['ageing'] = {min = 0.01, max = 4, base = 1, dmin = -20, dmax = -10, name = 'Terrain Pollution Consumption'},
['diffusion_ratio'] = {min = 0.005, max = 0.05, base = 0.02, dmin = 10, dmax = 20, name = 'Pollution Diffusion'},
['technology_price_multiplier'] = {min = 0.05, max = 5, base = 0.5, dmin = 10, dmax = 20, name = 'Technology Price'},
['beacon_irritation'] = {min = 100, max = 1200, base = 900, dmin = -20, dmax = -10, name = 'Biter Attack Cooldown', static = true},
['starting_area'] = {min = 1, max = 1, base = 1, dmin = 0, dmax = 0, name = 'Starting Area Size', static = true}
}
Public.starter_goods_pool = {
{"accumulator", 8, 16},
{"big-electric-pole", 8, 16},
{"burner-inserter", 64, 128},
{"burner-mining-drill", 8, 16},
{"car", 2, 4},
{"copper-cable", 128, 256},
{"copper-plate", 64, 128},
{"electric-furnace", 4, 8},
{"electric-mining-drill", 4, 8},
{"firearm-magazine", 64, 128},
{"grenade", 8, 16},
{"gun-turret", 4, 8},
{"inserter", 32, 64},
{"iron-gear-wheel", 64, 128},
{"iron-plate", 64, 128},
{"lab", 2, 4},
{"long-handed-inserter", 32, 64},
{"medium-electric-pole", 16, 32},
{"pipe", 128, 256},
{"radar", 4, 8},
{"small-lamp", 64, 128},
{"solar-panel", 8, 16},
{"solid-fuel", 256, 512},
{"stack-inserter", 16, 32},
{"stack-filter-inserter", 16, 32},
{"steam-turbine", 4, 8},
{"steel-chest", 16, 32},
{"steel-furnace", 8, 16},
{"steel-plate", 32, 64},
{"stone-wall", 128, 256},
{"substation", 4, 8},
{"green-wire", 256, 512},
{"red-wire", 256, 512},
['basic'] = {
{'copper-cable', 128, 256},
{'copper-plate', 64, 128},
{'iron-gear-wheel', 64, 128},
{'iron-plate', 64, 128},
{'petroleum-gas-barrel', 20, 40},
{'solid-fuel', 256, 512},
{'steel-plate', 32, 64},
{'electronic-circuit', 32, 64},
},
['low'] = {
{'burner-inserter', 64, 128},
{'burner-mining-drill', 8, 16},
{'lab', 2, 4},
{'steel-furnace', 8, 16},
{'boiler', 2, 4},
{'steam-engine', 4, 8},
},
['mil'] = {
{'cliff-explosives', 10, 20},
{'firearm-magazine', 64, 128},
{'grenade', 8, 16},
{'gun-turret', 4, 8},
{'radar', 4, 8},
{'stone-wall', 128, 256},
{'gate', 32, 64},
{'heavy-armor', 1, 1},
{'modular-armor', 1, 1},
{'shotgun-shell', 64, 128},
{'defender-capsule', 12, 24},
{'flamethrower-ammo', 20, 40},
{'slowdown-capsule', 10, 20},
},
['inter'] = {
{'big-electric-pole', 8, 16},
{'car', 2, 4},
{'electric-mining-drill', 4, 8},
{'inserter', 32, 64},
{'lab', 2, 4},
{'long-handed-inserter', 32, 64},
{'medium-electric-pole', 16, 32},
{'pipe', 128, 256},
{'small-lamp', 64, 128},
{'steel-chest', 16, 32},
{'transport-belt', 32, 64},
{'pumpjack', 2, 4},
},
['adv'] = {
{'accumulator', 8, 16},
{'electric-furnace', 4, 8},
{'solar-panel', 8, 16},
{'stack-inserter', 16, 32},
{'stack-filter-inserter', 16, 32},
{'steam-turbine', 4, 8},
{'substation', 4, 8},
{'chemical-plant', 3, 6},
{'oil-refinery', 1, 2},
},
['rare'] = {
{'green-wire', 256, 512},
{'red-wire', 256, 512},
{'heat-exchanger', 1, 2},
{'heat-pipe', 10, 20},
{'nuclear-fuel', 4, 8},
{'nuclear-reactor', 1, 1},
{'advanced-circuit', 16, 32},
{'construction-robot', 16, 32},
{'personal-roboport-equipment', 1, 1},
{'solar-panel-equipment', 2, 4},
{'effectivity-module', 5, 10},
},
}
Public.build_type_whitelist = {
["arithmetic-combinator"] = true,
["constant-combinator"] = true,
["decider-combinator"] = true,
["electric-energy-interface"] = true,
["electric-pole"] = true,
["gate"] = true,
["heat-pipe"] = true,
["lamp"] = true,
["pipe"] = true,
["pipe-to-ground"] = true,
["programmable-speaker"] = true,
["transport-belt"] = true,
["wall"] = true,
['arithmetic-combinator'] = true,
['constant-combinator'] = true,
['decider-combinator'] = true,
['electric-energy-interface'] = true,
['electric-pole'] = true,
['gate'] = true,
['heat-pipe'] = true,
['lamp'] = true,
['pipe'] = true,
['pipe-to-ground'] = true,
['programmable-speaker'] = true,
['transport-belt'] = true,
['wall'] = true,
}
Public.unique_world_traits = {
["lush"] = {"Lush", "Pure Vanilla."},
["abandoned_library"] = {"Abandoned Library", "No blueprints to be found."},
["lazy_bastard"] = {"Lazy Bastard", "The machine does the job."},
["oceanic"] = {"Oceanic", "Arrrr, the flame turrets seem to malfunction in this climate."},
["ribbon"] = {"Ribbon", "Go right. (or left)"},
["wasteland"] = {"Wasteland", "Rusty treasures."},
["infested"] = {"Infested", "They lurk inside."},
["pitch_black"] = {"Pitch Black", "No light may reach this realm."},
["volcanic"] = {"Volcanic", "The floor is (almost) lava."},
["matter_anomaly"] = {"Matter Anomaly", "Why can't i hold all these ores.\nThe laser turret structures seem to malfunction."},
["mountainous"] = {"Mountainous", "Diggy diggy hole!"},
["eternal_night"] = {"Eternal Night", "This world seems to be missing a sun."},
["dense_atmosphere"] = {"Dense Atmosphere", "Your roboport structures seem to malfunction."},
["undead_plague"] = {"Undead Plague", "The dead are restless."},
["swamps"] = {"Swamps", "No deep water to be found in this world."},
["chaotic_resources"] = {"Chaotic Resources", "Something to sort out."},
["low_mass"] = {"Low Mass", "You feel light footed and the robots are buzzing."},
["eternal_day"] = {"Eternal Day", "The sun never moves."},
["quantum_anomaly"] = {"Quantum Anomaly", "Research complete."},
["replicant_fauna"] = {"Replicant Fauna", "The biters feed on your structures."},
["tarball"] = {"Tarball", "Door stuck, Door stuck..."},
--[[
]]
Public.unique_world_traits = {
['lush'] = {
name = 'Lush',
desc = 'Pure Vanilla.',
mods = 1,
loot = {basic = {1, 1}, low = {1, 1}, mil = {0, 1}, inter = {0, 1}, adv = {0, 0}, rare = {0, 0}}
},
['abandoned_library'] = {
name = 'Abandoned Library',
desc = 'No blueprints to be found.',
mods = 3,
loot = {basic = {0, 1}, low = {0, 1}, mil = {0, 1}, inter = {0, 1}, adv = {1, 1}, rare = {1, 1}}
},
['lazy_bastard'] = {
name = 'Lazy Bastard',
desc = 'The machine does the job.',
mods = 4,
loot = {basic = {0, 0}, low = {0, 0}, mil = {0, 1}, inter = {0, 2}, adv = {0, 1}, rare = {1, 1}}
},
['oceanic'] = {
name = 'Oceanic',
desc = 'Arrrr, the flame turrets seem to malfunction in this climate.',
mods = 2,
loot = {basic = {1, 1}, low = {0, 0}, mil = {0, 2}, inter = {0, 1}, adv = {0, 1}, rare = {0, 1}}
},
['ribbon'] = {
name = 'Ribbon',
desc = 'Go right. (or left)',
mods = 4,
loot = {basic = {0, 0}, low = {0, 0}, mil = {0, 1}, inter = {0, 2}, adv = {0, 1}, rare = {1, 1}}
},
['wasteland'] = {
name = 'Wasteland',
desc = 'Rusty treasures.',
mods = 2,
loot = {basic = {0, 1}, low = {0, 1}, mil = {1, 1}, inter = {0, 1}, adv = {0, 1}, rare = {0, 1}}
},
['infested'] = {
name = 'Infested',
desc = 'They lurk inside.',
mods = 4,
loot = {basic = {0, 1}, low = {0, 0}, mil = {1, 1}, inter = {0, 2}, adv = {0, 2}, rare = {1, 1}}
},
['pitch_black'] = {
name = 'Pitch Black',
desc = 'No light may reach this realm.',
mods = 2,
loot = {basic = {1, 1}, low = {0, 1}, mil = {0, 1}, inter = {0, 1}, adv = {0, 1}, rare = {0, 1}}
},
['volcanic'] = {
name = 'Volcanic',
desc = 'The floor is (almost) lava.',
mods = 4,
loot = {basic = {0, 0}, low = {0, 0}, mil = {1, 1}, inter = {0, 2}, adv = {0, 2}, rare = {1, 1}}
},
['matter_anomaly'] = {
name = 'Matter Anomaly',
desc = 'Why can\'t I hold all these ores.\nThe laser turret structures seem to malfunction.',
mods = 2,
loot = {basic = {1, 1}, low = {0, 1}, mil = {1, 1}, inter = {0, 1}, adv = {0, 1}, rare = {0, 1}}
},
['mountainous'] = {
name = 'Mountainous',
desc = 'Diggy diggy hole!',
mods = 2,
loot = {basic = {1, 1}, low = {0, 1}, mil = {0, 1}, inter = {0, 1}, adv = {0, 1}, rare = {0, 1}}
},
['eternal_night'] = {
name = 'Eternal Night',
desc = 'This world seems to be missing a sun.',
mods = 2,
loot = {basic = {1, 1}, low = {0, 1}, mil = {0, 1}, inter = {0, 1}, adv = {0, 1}, rare = {0, 1}}
},
['dense_atmosphere'] = {
name = 'Dense Atmosphere',
desc = 'Your roboport structures seem to malfunction.',
mods = 3,
loot = {basic = {0, 1}, low = {0, 0}, mil = {0, 1}, inter = {1, 1}, adv = {0, 1}, rare = {1, 1}}
},
['undead_plague'] = {
name = 'Undead Plague',
desc = 'The dead are restless.',
mods = 4,
loot = {basic = {0, 0}, low = {0, 0}, mil = {1, 1}, inter = {0, 2}, adv = {0, 2}, rare = {1, 1}}
},
['swamps'] = {
name = 'Swamps',
desc = 'No deep water to be found in this world.',
mods = 3,
loot = {basic = {0, 1}, low = {0, 0}, mil = {0, 1}, inter = {0, 1}, adv = {0, 1}, rare = {0, 1}}
},
['chaotic_resources'] = {
name = 'Chaotic Resources',
desc = 'Something to sort out.',
mods = 2,
loot = {basic = {0, 1}, low = {0, 1}, mil = {0, 1}, inter = {0, 1}, adv = {0, 1}, rare = {0, 1}}
},
['low_mass'] = {
name = 'Low Mass',
desc = 'You feel light footed and the robots are buzzing.',
mods = 2,
loot = {basic = {0, 1}, low = {0, 1}, mil = {0, 0}, inter = {0, 2}, adv = {0, 1}, rare = {0, 1}}
},
['eternal_day'] = {
name = 'Eternal Day',
desc = 'The sun never moves.',
mods = 1,
loot = {basic = {1, 1}, low = {0, 1}, mil = {0, 0}, inter = {0, 1}, adv = {0, 1}, rare = {0, 1}}
},
['quantum_anomaly'] = {
name = 'Quantum Anomaly',
desc = 'Research complete.',
mods = 2,
loot = {basic = {0, 0}, low = {0, 0}, mil = {0, 1}, inter = {1, 1}, adv = {0, 1}, rare = {0, 1}}
},
['replicant_fauna'] = {
name = 'Replicant Fauna',
desc = 'The biters feed on your structures.',
mods = 4,
loot = {basic = {0, 0}, low = {0, 0}, mil = {1, 1}, inter = {0, 1}, adv = {0, 1}, rare = {1, 1}}
},
['tarball'] = {
name = 'Tarball',
desc = 'Door stuck, Door stuck...',
mods = 4,
loot = {basic = {0, 0}, low = {0, 0}, mil = {0, 1}, inter = {0, 2}, adv = {0, 2}, rare = {1, 1}}
},
['railworld'] = {
name = 'Railworld',
desc = 'Long distances better travelled by train...',
mods = 3,
loot = {basic = {0, 1}, low = {0, 0}, mil = {0, 1}, inter = {0, 1}, adv = {0, 1}, rare = {0, 1}}
},
['resupply_station'] = {
name = 'Resupply Station',
desc = 'Local Orbital Station requires immediate resupply.\n Faster the delivery, more they pay.',
mods = 2,
loot = {basic = {0, 0}, low = {0, 0}, mil = {0, 1}, inter = {0, 2}, adv = {0, 2}, rare = {1, 1}}
},
}
return Public
return Public

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,3 @@
--luacheck: ignore
--[[
Journey, launch a rocket in increasingly harder getting worlds. - MewMew
]]--
@ -11,11 +10,18 @@ local Functions = require 'maps.journey.functions'
local Unique_modifiers = require 'maps.journey.unique_modifiers'
local Map = require 'modules.map_info'
local Global = require 'utils.global'
local Token = require 'utils.token'
local Event = require 'utils.event'
local Vacants = require 'modules.clear_vacant_players'
local journey = {
announce_capsules = true
}
local events = {
import = Event.generate_event_name('import'),
}
Global.register(
journey,
function(tbl)
@ -23,6 +29,15 @@ Global.register(
end
)
journey.import = Token.register(
function(data)
if not data then
return
end
script.raise_event(events.import, data)
end
)
local function on_chunk_generated(event)
local surface = event.surface
@ -33,40 +48,40 @@ local function on_chunk_generated(event)
return
end
if surface.name ~= "mothership" then return end
if surface.name ~= 'mothership' then return end
Functions.on_mothership_chunk_generated(event)
end
local function on_console_chat(event)
if not event.player_index then return end
local player = game.players[event.player_index]
local message = event.message
message = string.lower(message)
local a, b = string.find(message, "?", 1, true)
if not a then return end
local a, b = string.find(message, "mother", 1, true)
local a = string.find(message, '?', 1, true)
if not a then return end
local b = string.find(message, 'mother', 1, true)
if not b then return end
local answer = Constants.mothership_messages.answers[math.random(1, #Constants.mothership_messages.answers)]
if math.random(1, 4) == 1 then
for _ = 1, math.random(2, 5), 1 do table.insert(journey.mothership_messages, "") end
table.insert(journey.mothership_messages, "...")
for _ = 1, math.random(2, 5), 1 do table.insert(journey.mothership_messages, '') end
table.insert(journey.mothership_messages, '...')
end
for _ = 1, math.random(15, 30), 1 do table.insert(journey.mothership_messages, "") end
for _ = 1, math.random(15, 30), 1 do table.insert(journey.mothership_messages, '') end
table.insert(journey.mothership_messages, answer)
end
local function on_player_joined_game(event)
local player = game.players[event.player_index]
Functions.draw_gui(journey)
Functions.set_minimum_to_vote(journey)
if player.surface.name == "mothership" then
if player.surface.name == 'mothership' then
journey.characters_in_mothership = journey.characters_in_mothership + 1
end
if player.force.name == "enemy" then
if player.force.name == 'enemy' then
Functions.clear_player(player)
player.force = game.forces.player
local position = game.surfaces.nauvis.find_non_colliding_position("character", {0,0}, 32, 0.5)
local position = game.surfaces.nauvis.find_non_colliding_position('character', {0,0}, 32, 0.5)
if position then
player.teleport(position, game.surfaces.nauvis)
else
@ -79,8 +94,9 @@ local function on_player_left_game(event)
local player = game.players[event.player_index]
Functions.draw_gui(journey)
if player.surface.name == "mothership" then
if player.surface.name == 'mothership' then
journey.characters_in_mothership = journey.characters_in_mothership - 1
player.clear_items_inside()
end
end
@ -115,6 +131,16 @@ local function on_robot_mined_entity(event)
if unique_modifier.on_robot_mined_entity then unique_modifier.on_robot_mined_entity(event, journey) end
end
local function on_entity_damaged(event)
local entity = event.entity
if not entity or not entity.valid then return end
if entity ~= journey.beacon_objective then return end
if event.force and event.force.name == 'enemy' then
Functions.deal_damage_to_beacon(journey, event.final_damage_amount)
end
entity.health = 200
end
local function on_entity_died(event)
local unique_modifier = Unique_modifiers[journey.world_trait]
if unique_modifier.on_entity_died then unique_modifier.on_entity_died(event, journey) end
@ -133,17 +159,48 @@ local function on_rocket_launched(event)
if journey.mothership_cargo[slot.name] > journey.mothership_cargo_space[slot.name] then
journey.mothership_cargo[slot.name] = journey.mothership_cargo_space[slot.name]
end
if slot.name == "uranium-fuel-cell" then
Server.to_discord_embed("Refueling progress: " .. journey.mothership_cargo[slot.name] .. "/" .. journey.mothership_cargo_space[slot.name])
end
if slot.name == 'uranium-fuel-cell' or slot.name == 'nuclear-reactor' then
Server.to_discord_embed('Refueling progress: ' .. slot.name .. ': ' .. journey.mothership_cargo[slot.name] .. '/' .. journey.mothership_cargo_space[slot.name])
elseif journey.speedrun.enabled and slot.name == journey.speedrun.item then
Server.to_discord_embed('Orbital Station delivery: ' .. slot.name .. ': ' .. journey.mothership_cargo[slot.name] .. '/' .. journey.mothership_cargo_space[slot.name])
end
end
end
Functions.draw_gui(journey)
end
local function make_import(data)
if not data then
return
end
if data.key ~= 'journey_data' then
return
end
local old_selectors = journey.world_selectors
for key, value in pairs(data.value) do
journey[key] = value
end
for k, selector in pairs(old_selectors) do
journey.world_selectors[k].border = selector.border
journey.world_selectors[k].texts = selector.texts
journey.world_selectors[k].rectangles = selector.rectangles
end
journey.importing = true
game.print('Journey data imported.')
journey.game_state = 'importing_world'
end
local function on_nth_tick()
Functions[journey.game_state](journey)
Functions.mothership_message_queue(journey)
local tick = game.tick
if tick % 3600 == 0 then
Functions.lure_far_biters(journey)
elseif tick % 600 == 0 then
Functions.lure_biters(journey)
end
end
local function on_init()
@ -153,45 +210,86 @@ local function on_init()
T.sub_caption_color = {r = 100, g = 100, b = 100}
game.permissions.get_group('Default').set_allows_action(defines.input_action.set_auto_launch_rocket, false)
Vacants.init(1, true)
Functions.hard_reset(journey)
end
local function cmd_handler()
local player = game.player
local p
if not (player and player.valid) then
p = log
else
p = player.print
end
if player and not player.admin then
p('You are not an admin!')
return false
end
return true, player or {name = 'Server'}, p
end
commands.add_command(
'reset-journey',
'journey-reset',
'Fully resets the journey map.',
function()
local player = game.player
if not (player and player.valid) then
return
end
if not player.admin then
player.print("You are not an admin!")
return
end
Functions.hard_reset(journey)
game.print(player.name .. " has reset the map.")
local s, player = cmd_handler()
if s then
Functions.hard_reset(journey)
game.print(player.name .. ' has reset the map.')
end
end
)
commands.add_command(
'skip-world',
'journey-skip-world',
'Instantly wins and skips the current world.',
function()
local player = game.player
if not (player and player.valid) then
return
end
if not player.admin then
player.print("You are not an admin!")
return
end
if journey.game_state ~= "dispatch_goods" and journey.game_state ~= "world" then return end
journey.game_state = "set_world_selectors"
local s, _, p = cmd_handler()
if s then
if journey.game_state ~= 'dispatch_goods' and journey.game_state ~= 'world' then return end
journey.game_state = 'set_world_selectors'
p('The current world was skipped...')
end
end
)
commands.add_command(
'journey-update',
'Restarts the server with newest version of Journey scenario code during next map reset',
function()
local s, _, p = cmd_handler()
if s then
journey.restart_from_scenario = not journey.restart_from_scenario
p('Journey marking for full restart with updates on next reset was switched to ' .. tostring(journey.restart_from_scenario))
end
end
)
commands.add_command(
'journey-import',
'Sets the journey gamestate to the last exported one.',
function()
local s, _, p = cmd_handler()
if s then
Functions.import_journey(journey)
p('Journey world settings importing...')
end
end
)
commands.add_command(
'journey-export',
'Exports the journey gamestate to the server',
function()
local s, _, p = cmd_handler()
if s then
Functions.export_journey(journey)
p('Journey world settings exporting...')
end
end
)
local Event = require 'utils.event'
Event.on_init(on_init)
Event.on_nth_tick(10, on_nth_tick)
Event.add(defines.events.on_chunk_generated, on_chunk_generated)
@ -204,4 +302,6 @@ Event.add(defines.events.on_built_entity, on_built_entity)
Event.add(defines.events.on_robot_mined_entity, on_robot_mined_entity)
Event.add(defines.events.on_player_mined_entity, on_player_mined_entity)
Event.add(defines.events.on_entity_died, on_entity_died)
Event.add(defines.events.on_entity_damaged, on_entity_damaged)
Event.add(defines.events.on_console_chat, on_console_chat)
Event.add(events['import'], make_import)

View File

@ -1,4 +1,4 @@
--luacheck: ignore
--luacheck: ignore 212/journey
local Get_noise = require 'utils.get_noise'
local BiterRaffle = require 'functions.biter_raffle'
local LootRaffle = require 'functions.loot_raffle'
@ -32,8 +32,8 @@ local solid_tiles = {
['refined-hazard-concrete-left'] = true,
['refined-hazard-concrete-right'] = true,
['stone-path'] = true,
["lab-dark-1"] = true,
["lab-dark-2"] = true,
['lab-dark-1'] = true,
['lab-dark-2'] = true,
}
local wrecks = {
'crash-site-spaceship-wreck-big-1',
@ -49,455 +49,529 @@ local Public = {}
Public.lush = {}
Public.eternal_day = {
on_world_start = function(journey)
game.surfaces.nauvis.daytime = 0
game.surfaces.nauvis.freeze_daytime = true
end,
clear = function(journey)
local surface = game.surfaces.nauvis
surface.freeze_daytime = false
end,
on_world_start = function(journey)
game.surfaces.nauvis.daytime = 0
game.surfaces.nauvis.freeze_daytime = true
end,
clear = function(journey)
local surface = game.surfaces.nauvis
surface.freeze_daytime = false
end,
}
Public.eternal_night = {
on_world_start = function(journey)
local surface = game.surfaces.nauvis
surface.daytime = 0.44
surface.freeze_daytime = true
surface.solar_power_multiplier = 5
end,
clear = function(journey)
local surface = game.surfaces.nauvis
surface.freeze_daytime = false
surface.solar_power_multiplier = 1
end,
on_world_start = function(journey)
local surface = game.surfaces.nauvis
surface.daytime = 0.44
surface.freeze_daytime = true
surface.solar_power_multiplier = 5
end,
clear = function(journey)
local surface = game.surfaces.nauvis
surface.freeze_daytime = false
surface.solar_power_multiplier = 1
end,
}
Public.pitch_black = {
on_world_start = function(journey)
local surface = game.surfaces.nauvis
surface.daytime = 0.44
surface.freeze_daytime = true
surface.solar_power_multiplier = 3
surface.min_brightness = 0
surface.brightness_visual_weights = {0.8, 0.8, 0.8, 1}
end,
clear = function(journey)
local surface = game.surfaces.nauvis
surface.freeze_daytime = false
surface.solar_power_multiplier = 1
surface.min_brightness = 0.15
surface.brightness_visual_weights = {0, 0, 0, 1}
end,
on_world_start = function(journey)
local surface = game.surfaces.nauvis
surface.daytime = 0.44
surface.freeze_daytime = true
surface.solar_power_multiplier = 3
surface.min_brightness = 0
surface.brightness_visual_weights = {0.8, 0.8, 0.8, 1}
end,
clear = function(journey)
local surface = game.surfaces.nauvis
surface.freeze_daytime = false
surface.solar_power_multiplier = 1
surface.min_brightness = 0.15
surface.brightness_visual_weights = {0, 0, 0, 1}
end,
}
Public.matter_anomaly = {
on_world_start = function(journey)
local force = game.forces.player
for i = 1, 4, 1 do force.technologies['mining-productivity-' .. i].researched = true end
for i = 1, 6, 1 do force.technologies['mining-productivity-4'].researched = true end
end,
on_robot_built_entity = function(event)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == "electric-turret" then entity.die() end
end,
on_built_entity = function(event)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == "electric-turret" then entity.die() end
end,
on_world_start = function(journey)
local force = game.forces.player
for i = 1, 4, 1 do force.technologies['mining-productivity-' .. i].researched = true end
for i = 1, 6, 1 do force.technologies['mining-productivity-4'].researched = true end
end,
on_robot_built_entity = function(event)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == 'electric-turret' then entity.die() end
end,
on_built_entity = function(event)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == 'electric-turret' then entity.die() end
end,
}
Public.quantum_anomaly = {
on_world_start = function(journey)
local force = game.forces.player
for i = 1, 6, 1 do force.technologies['research-speed-' .. i].researched = true end
game.difficulty_settings.technology_price_multiplier = game.difficulty_settings.technology_price_multiplier * 0.5
end,
clear = function(journey)
game.difficulty_settings.technology_price_multiplier = game.difficulty_settings.technology_price_multiplier * 2
end,
on_world_start = function(journey)
local force = game.forces.player
for i = 1, 6, 1 do force.technologies['research-speed-' .. i].researched = true end
journey.world_specials['technology_price_multiplier'] = 0.5
end,
}
Public.mountainous = {
on_player_mined_entity = function(event)
local entity = event.entity
if not entity.valid then return end
if not rock_yield[entity.name] then return end
local surface = entity.surface
event.buffer.clear()
local ore = ore_raffle[math_random(1, size_of_ore_raffle)]
local count = math_floor(math_sqrt(entity.position.x ^ 2 + entity.position.y ^ 2) * 0.05) + math_random(25, 75)
local ore_amount = math_floor(count * 0.85)
local stone_amount = math_floor(count * 0.15)
surface.spill_item_stack(entity.position, {name = ore, count = ore_amount}, true)
surface.spill_item_stack(entity.position, {name = 'stone', count = stone_amount}, true)
end,
on_chunk_generated = function(event, journey)
local surface = event.surface
local seed = surface.map_gen_settings.seed
local left_top_x = event.area.left_top.x
local left_top_y = event.area.left_top.y
local get_tile = surface.get_tile
local position
local noise
for x = 0, 31, 1 do
for y = 0, 31, 1 do
if math_random(1, 3) ~= 1 then
position = {x = left_top_x + x, y = left_top_y + y}
if surface.can_place_entity({name = "coal", position = position}) then
noise = math_abs(Get_noise('scrapyard', position, seed))
if noise < 0.025 or noise > 0.50 then
surface.create_entity({name = rock_raffle[math_random(1, size_of_rock_raffle)], position = position})
end
end
end
end
end
end,
on_player_mined_entity = function(event)
local entity = event.entity
if not entity.valid then return end
if not rock_yield[entity.name] then return end
local surface = entity.surface
event.buffer.clear()
local ore = ore_raffle[math_random(1, size_of_ore_raffle)]
local count = math_floor(math_sqrt(entity.position.x ^ 2 + entity.position.y ^ 2) * 0.05) + math_random(25, 75)
local ore_amount = math_floor(count * 0.85)
local stone_amount = math_floor(count * 0.15)
surface.spill_item_stack(entity.position, {name = ore, count = ore_amount}, true)
surface.spill_item_stack(entity.position, {name = 'stone', count = stone_amount}, true)
end,
on_chunk_generated = function(event, journey)
local surface = event.surface
local seed = surface.map_gen_settings.seed
local left_top_x = event.area.left_top.x
local left_top_y = event.area.left_top.y
local position
local noise
for x = 0, 31, 1 do
for y = 0, 31, 1 do
if math_random(1, 3) ~= 1 then
position = {x = left_top_x + x, y = left_top_y + y}
if surface.can_place_entity({name = 'coal', position = position}) then
noise = math_abs(Get_noise('scrapyard', position, seed))
if noise < 0.025 or noise > 0.50 then
surface.create_entity({name = rock_raffle[math_random(1, size_of_rock_raffle)], position = position})
end
end
end
end
end
end,
}
Public.replicant_fauna = {
on_entity_died = function(event)
local entity = event.entity
if not entity.valid then return end
local cause = event.cause
if not cause then return end
if not cause.valid then return end
if cause.force.index == 2 then cause.surface.create_entity({name = BiterRaffle.roll('mixed', game.forces.enemy.evolution_factor), position = entity.position, force = "enemy"}) end
end,
on_entity_died = function(event)
local entity = event.entity
if not entity.valid then return end
local cause = event.cause
if not cause then return end
if not cause.valid then return end
if cause.force.index == 2 then cause.surface.create_entity({name = BiterRaffle.roll('mixed', game.forces.enemy.evolution_factor), position = entity.position, force = 'enemy'}) end
end,
}
Public.tarball = {
on_robot_built_entity = function(event)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == "entity-ghost" or entity.type == "tile-ghost" or entity.type == "container" or entity.type == "wall" or entity.type == "pipe" then return end
entity.minable = false
end,
on_built_entity = function(event)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == "entity-ghost" or entity.type == "tile-ghost" or entity.type == "container" or entity.type == "wall" or entity.type == "pipe" then return end
entity.minable = false
end,
on_chunk_generated = function(event, journey)
table.insert(journey.world_color_filters, rendering.draw_sprite(
{
sprite = 'tile/lab-dark-1',
x_scale = 32,
y_scale = 32,
target = event.area.left_top,
surface = event.surface,
tint = {r = 0.0, g = 0.0, b = 0.0, a = 0.45},
render_layer = 'ground'
}
))
end,
clear = function(journey)
for _, id in pairs(journey.world_color_filters) do rendering.destroy(id) end
journey.world_color_filters = {}
end,
Public.tarball = {
on_robot_built_entity = function(event)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == 'entity-ghost' or entity.type == 'tile-ghost' or entity.type == 'container' or entity.type == 'wall' or entity.type == 'pipe' then return end
entity.minable = false
end,
on_built_entity = function(event)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == 'entity-ghost' or entity.type == 'tile-ghost' or entity.type == 'container' or entity.type == 'wall' or entity.type == 'pipe' then return end
entity.minable = false
end,
on_chunk_generated = function(event, journey)
table.insert(journey.world_color_filters, rendering.draw_sprite(
{
sprite = 'tile/lab-dark-1',
x_scale = 32,
y_scale = 32,
target = event.area.left_top,
surface = event.surface,
tint = {r = 0.0, g = 0.0, b = 0.0, a = 0.45},
render_layer = 'ground'
}
))
end,
clear = function(journey)
for _, id in pairs(journey.world_color_filters) do rendering.destroy(id) end
journey.world_color_filters = {}
end,
}
Public.swamps = {
on_chunk_generated = function(event, journey)
local surface = event.surface
local seed = surface.map_gen_settings.seed
local left_top_x = event.area.left_top.x
local left_top_y = event.area.left_top.y
local tiles = {}
for _, tile in pairs(surface.find_tiles_filtered({name = {"water", "deepwater"}, area = event.area})) do
table.insert(tiles, {name = "water-shallow", position = tile.position})
end
surface.set_tiles(tiles, true, false, false, false)
local tiles = {}
for x = 0, 31, 1 do
for y = 0, 31, 1 do
local position = {x = left_top_x + x, y = left_top_y + y}
local noise = Get_noise('journey_swamps', position, seed)
if noise > 0.45 or noise < -0.65 then table.insert(tiles, {name = "water-shallow", position = {x = position.x, y = position.y}}) end
end
end
surface.set_tiles(tiles, true, false, false, false)
for _, tile in pairs(tiles) do
if math_random(1, 32) == 1 then
surface.create_entity({name = "fish", position = tile.position})
end
end
end,
on_world_start = function(journey)
journey.world_specials['water'] = 2
end,
on_chunk_generated = function(event, journey)
local surface = event.surface
local seed = surface.map_gen_settings.seed
local left_top_x = event.area.left_top.x
local left_top_y = event.area.left_top.y
local tiles = {}
for _, tile in pairs(surface.find_tiles_filtered({name = {'water', 'deepwater'}, area = event.area})) do
table.insert(tiles, {name = 'water-shallow', position = tile.position})
end
for x = 0, 31, 1 do
for y = 0, 31, 1 do
local position = {x = left_top_x + x, y = left_top_y + y}
local noise = Get_noise('journey_swamps', position, seed)
if noise > 0.45 or noise < -0.65 then table.insert(tiles, {name = 'water-shallow', position = {x = position.x, y = position.y}}) end
end
end
surface.set_tiles(tiles, true, false, false, false)
for _, tile in pairs(tiles) do
if math_random(1, 32) == 1 then
surface.create_entity({name = 'fish', position = tile.position})
end
end
end,
}
Public.wasteland = {
on_chunk_generated = function(event, journey)
local surface = event.surface
local seed = surface.map_gen_settings.seed
local left_top_x = event.area.left_top.x
local left_top_y = event.area.left_top.y
local tiles = {}
for _, tile in pairs(surface.find_tiles_filtered({name = {"water"}, area = event.area})) do
table.insert(tiles, {name = "water-green", position = tile.position})
end
for _, tile in pairs(surface.find_tiles_filtered({name = {"deepwater"}, area = event.area})) do
table.insert(tiles, {name = "deepwater-green", position = tile.position})
end
surface.set_tiles(tiles, true, false, false, false)
if math_random(1, 3) ~= 1 then return end
for _ = 1, math_random(0, 5), 1 do
local name = wrecks[math_random(1, size_of_wrecks)]
position = surface.find_non_colliding_position(name, {left_top_x + math_random(0, 31), left_top_y + math_random(0, 31)}, 16, 1)
if position then
local e = surface.create_entity({name = name, position = position, force = 'neutral'})
if math_random(1, 4) == 1 then
local slots = game.entity_prototypes[e.name].get_inventory_size(defines.inventory.chest)
local blacklist = LootRaffle.get_tech_blacklist(0.2)
local item_stacks = LootRaffle.roll(math_random(16, 64), slots, blacklist)
for _, item_stack in pairs(item_stacks) do e.insert(item_stack) end
end
end
end
end,
on_world_start = function(journey)
local surface = game.surfaces.nauvis
local mgs = surface.map_gen_settings
mgs.terrain_segmentation = 2.7
mgs.water = mgs.water + 1
surface.map_gen_settings = mgs
surface.clear(true)
end,
clear = function(journey)
local surface = game.surfaces.nauvis
local mgs = surface.map_gen_settings
mgs.water = mgs.water - 1
surface.map_gen_settings = mgs
end,
on_chunk_generated = function(event, journey)
local surface = event.surface
local left_top_x = event.area.left_top.x
local left_top_y = event.area.left_top.y
local tiles = {}
for _, tile in pairs(surface.find_tiles_filtered({name = {'water'}, area = event.area})) do
table.insert(tiles, {name = 'water-green', position = tile.position})
end
for _, tile in pairs(surface.find_tiles_filtered({name = {'deepwater'}, area = event.area})) do
table.insert(tiles, {name = 'deepwater-green', position = tile.position})
end
surface.set_tiles(tiles, true, false, false, false)
if math_random(1, 3) ~= 1 then return end
for _ = 1, math_random(0, 5), 1 do
local name = wrecks[math_random(1, size_of_wrecks)]
local position = surface.find_non_colliding_position(name, {left_top_x + math_random(0, 31), left_top_y + math_random(0, 31)}, 16, 1)
if position then
local e = surface.create_entity({name = name, position = position, force = 'neutral'})
if math_random(1, 4) == 1 then
local slots = game.entity_prototypes[e.name].get_inventory_size(defines.inventory.chest)
local blacklist = LootRaffle.get_tech_blacklist(0.2)
local item_stacks = LootRaffle.roll(math_random(16, 64), slots, blacklist)
for _, item_stack in pairs(item_stacks) do e.insert(item_stack) end
end
end
end
end,
on_world_start = function(journey)
local surface = game.surfaces.nauvis
local mgs = surface.map_gen_settings
mgs.terrain_segmentation = 2.7
mgs.water = mgs.water + 1
surface.map_gen_settings = mgs
surface.clear(true)
end,
clear = function(journey)
local surface = game.surfaces.nauvis
local mgs = surface.map_gen_settings
mgs.water = mgs.water - 1
surface.map_gen_settings = mgs
end,
}
Public.oceanic = {
on_world_start = function(journey)
local surface = game.surfaces.nauvis
local mgs = surface.map_gen_settings
mgs.terrain_segmentation = 0.5
mgs.water = mgs.water + 4
surface.map_gen_settings = mgs
surface.clear(true)
end,
on_robot_built_entity = function(event)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == "fluid-turret" then entity.die() end
end,
on_built_entity = function(event)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == "fluid-turret" then entity.die() end
end,
clear = function(journey)
local surface = game.surfaces.nauvis
local mgs = surface.map_gen_settings
mgs.water = mgs.water - 4
surface.map_gen_settings = mgs
end,
on_world_start = function(journey)
local surface = game.surfaces.nauvis
local mgs = surface.map_gen_settings
mgs.terrain_segmentation = 0.5
mgs.water = mgs.water + 6
surface.map_gen_settings = mgs
surface.clear(true)
end,
on_robot_built_entity = function(event)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == 'fluid-turret' then entity.die() end
end,
on_built_entity = function(event)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == 'fluid-turret' then entity.die() end
end,
clear = function(journey)
local surface = game.surfaces.nauvis
local mgs = surface.map_gen_settings
mgs.water = mgs.water - 6
surface.map_gen_settings = mgs
end,
}
Public.volcanic = {
on_chunk_generated = function(event, journey)
table.insert(journey.world_color_filters, rendering.draw_sprite({
sprite = 'tile/lab-dark-2',
x_scale = 32,
y_scale = 32,
target = event.area.left_top,
surface = event.surface,
tint = {r = 0.55, g = 0.0, b = 0.0, a = 0.25},
render_layer = 'ground'
}))
end,
on_player_changed_position = function(event)
local player = game.players[event.player_index]
if player.driving then return end
local surface = player.surface
if surface.index ~= 1 then return end
if solid_tiles[surface.get_tile(player.position).name] then return end
surface.create_entity({name = "fire-flame", position = player.position})
end,
on_world_start = function(journey)
local surface = game.surfaces.nauvis
surface.request_to_generate_chunks({x = 0, y = 0}, 3)
surface.force_generate_chunk_requests()
surface.spill_item_stack({0, 0}, {name = "stone-brick", count = 4096}, true)
for x = -24, 24, 1 do
for y = -24, 24, 1 do
if math.sqrt(x ^ 2 + y ^ 2) < 24 then
surface.set_tiles({{name = "stone-path", position = {x, y}}}, true)
end
end
end
end,
clear = function(journey)
for _, id in pairs(journey.world_color_filters) do rendering.destroy(id) end
journey.world_color_filters = {}
end,
on_chunk_generated = function(event, journey)
table.insert(journey.world_color_filters, rendering.draw_sprite({
sprite = 'tile/lab-dark-2',
x_scale = 32,
y_scale = 32,
target = event.area.left_top,
surface = event.surface,
tint = {r = 0.55, g = 0.0, b = 0.0, a = 0.25},
render_layer = 'ground'
}))
end,
on_player_changed_position = function(event)
local player = game.players[event.player_index]
if player.driving then return end
local surface = player.surface
if surface.index ~= 1 then return end
if solid_tiles[surface.get_tile(player.position).name] then return end
surface.create_entity({name = 'fire-flame', position = player.position})
end,
on_world_start = function(journey)
local surface = game.surfaces.nauvis
surface.request_to_generate_chunks({x = 0, y = 0}, 3)
surface.force_generate_chunk_requests()
surface.spill_item_stack({0, 0}, {name = 'stone-brick', count = 4096}, true)
for x = -24, 24, 1 do
for y = -24, 24, 1 do
if math.sqrt(x ^ 2 + y ^ 2) < 24 then
surface.set_tiles({{name = 'stone-path', position = {x, y}}}, true)
end
end
end
end,
clear = function(journey)
for _, id in pairs(journey.world_color_filters) do rendering.destroy(id) end
journey.world_color_filters = {}
end,
}
Public.chaotic_resources = {
on_chunk_generated = function(event, journey)
local surface = event.surface
for _, ore in pairs(surface.find_entities_filtered({area = event.area, name = {'iron-ore', 'copper-ore', 'coal', 'stone'}})) do
surface.create_entity({name = ore_raffle_2[math_random(1, size_of_ore_raffle_2)], position = ore.position, amount = ore.amount})
ore.destroy()
end
end,
on_chunk_generated = function(event, journey)
local surface = event.surface
for _, ore in pairs(surface.find_entities_filtered({area = event.area, name = {'iron-ore', 'copper-ore', 'coal', 'stone'}})) do
surface.create_entity({name = ore_raffle_2[math_random(1, size_of_ore_raffle_2)], position = ore.position, amount = ore.amount})
ore.destroy()
end
end,
}
Public.infested = {
on_entity_died = function(event)
local entity = event.entity
if not entity.valid then return end
if entity.force.index ~= 3 then return end
if entity.type ~= "simple-entity" and entity.type ~= "tree" then return end
entity.surface.create_entity({name = BiterRaffle.roll('mixed', game.forces.enemy.evolution_factor + 0.1), position = entity.position, force = 'enemy'})
end,
on_player_mined_entity = function(event)
local entity = event.entity
if not entity.valid then return end
if entity.force.index ~= 3 then return end
if entity.type ~= "simple-entity" and entity.type ~= "tree" then return end
entity.surface.create_entity({name = BiterRaffle.roll('mixed', game.forces.enemy.evolution_factor + 0.1), position = entity.position, force = 'enemy'})
end,
on_robot_mined_entity = function(event)
local entity = event.entity
if not entity.valid then return end
if entity.force.index ~= 3 then return end
if entity.type ~= "simple-entity" and entity.type ~= "tree" then return end
entity.surface.create_entity({name = BiterRaffle.roll('mixed', game.forces.enemy.evolution_factor + 0.1), position = entity.position, force = 'enemy'})
end,
on_chunk_generated = function(event, journey)
table.insert(journey.world_color_filters, rendering.draw_sprite({
sprite = 'tile/lab-dark-2',
x_scale = 32,
y_scale = 32,
target = event.area.left_top,
surface = event.surface,
tint = {r = 0.8, g = 0.0, b = 0.8, a = 0.25},
render_layer = 'ground'
}))
end,
on_world_start = function(journey)
journey.world_specials['trees_size'] = 4
journey.world_specials['trees_richness'] = 2
journey.world_specials['trees_frequency'] = 2
end,
clear = function(journey)
for _, id in pairs(journey.world_color_filters) do rendering.destroy(id) end
journey.world_color_filters = {}
end,
on_entity_died = function(event)
local entity = event.entity
if not entity.valid then return end
if entity.force.index ~= 3 then return end
if entity.type ~= 'simple-entity' and entity.type ~= 'tree' then return end
entity.surface.create_entity({name = BiterRaffle.roll('mixed', game.forces.enemy.evolution_factor + 0.1), position = entity.position, force = 'enemy'})
end,
on_player_mined_entity = function(event)
if math_random(1,2) == 1 then return end
local entity = event.entity
if not entity.valid then return end
if entity.force.index ~= 3 then return end
if entity.type ~= 'simple-entity' and entity.type ~= 'tree' then return end
entity.surface.create_entity({name = BiterRaffle.roll('mixed', game.forces.enemy.evolution_factor + 0.1), position = entity.position, force = 'enemy'})
end,
on_robot_mined_entity = function(event)
local entity = event.entity
if not entity.valid then return end
if entity.force.index ~= 3 then return end
if entity.type ~= 'simple-entity' and entity.type ~= 'tree' then return end
entity.surface.create_entity({name = BiterRaffle.roll('mixed', game.forces.enemy.evolution_factor + 0.1), position = entity.position, force = 'enemy'})
end,
}
Public.undead_plague = {
on_entity_died = function(event)
local entity = event.entity
if not entity.valid then return end
if entity.force.index ~= 2 then return end
if math_random(1,2) == 1 then return end
if entity.type ~= "unit" then return end
entity.surface.create_entity({name = entity.name, position = entity.position, force = 'enemy'})
end,
on_entity_died = function(event)
local entity = event.entity
if not entity.valid then return end
if entity.force.index ~= 2 then return end
if math_random(1,2) == 1 then return end
if entity.type ~= 'unit' then return end
entity.surface.create_entity({name = entity.name, position = entity.position, force = 'enemy'})
end,
}
Public.low_mass = {
on_world_start = function(journey)
local force = game.forces.player
force.character_running_speed_modifier = 0.5
for i = 1, 6, 1 do force.technologies['worker-robots-speed-' .. i].researched = true end
end,
on_world_start = function(journey)
local force = game.forces.player
force.character_running_speed_modifier = 0.5
for i = 1, 6, 1 do force.technologies['worker-robots-speed-' .. i].researched = true end
end,
}
Public.dense_atmosphere = {
on_robot_built_entity = function(event)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == "roboport" then entity.die() end
end,
on_built_entity = function(event)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == "roboport" then entity.die() end
end,
on_robot_built_entity = function(event)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == 'roboport' then entity.die() end
end,
on_built_entity = function(event)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == 'roboport' then entity.die() end
end,
}
local function update_lazy_bastard(journey, count)
journey.lazy_bastard_machines = journey.lazy_bastard_machines + count
local speed = journey.lazy_bastard_machines * -0.1
if speed < -1 then speed = -1 end
game.forces.player.manual_crafting_speed_modifier = speed
journey.lazy_bastard_machines = journey.lazy_bastard_machines + count
local speed = journey.lazy_bastard_machines * -0.1
if speed < -1 then speed = -1 end
game.forces.player.manual_crafting_speed_modifier = speed
end
Public.lazy_bastard = {
on_robot_built_entity = function(event, journey)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == "assembling-machine" then
update_lazy_bastard(journey, 1)
end
end,
on_built_entity = function(event, journey)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == "assembling-machine" then
update_lazy_bastard(journey, 1)
end
end,
on_entity_died = function(event, journey)
local entity = event.entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == "assembling-machine" then
update_lazy_bastard(journey, -1)
end
end,
on_player_mined_entity = function(event, journey)
local entity = event.entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == "assembling-machine" then
update_lazy_bastard(journey, -1)
end
end,
on_robot_mined_entity = function(event, journey)
local entity = event.entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == "assembling-machine" then
update_lazy_bastard(journey, -1)
end
end,
on_world_start = function(journey)
journey.lazy_bastard_machines = 0
end,
clear = function(journey)
game.forces.player.manual_crafting_speed_modifier = 0
end,
on_robot_built_entity = function(event, journey)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == 'assembling-machine' then
update_lazy_bastard(journey, 1)
end
end,
on_built_entity = function(event, journey)
local entity = event.created_entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == 'assembling-machine' then
update_lazy_bastard(journey, 1)
end
end,
on_entity_died = function(event, journey)
local entity = event.entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == 'assembling-machine' then
update_lazy_bastard(journey, -1)
end
end,
on_player_mined_entity = function(event, journey)
local entity = event.entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == 'assembling-machine' then
update_lazy_bastard(journey, -1)
end
end,
on_robot_mined_entity = function(event, journey)
local entity = event.entity
if not entity.valid then return end
if entity.surface.index ~= 1 then return end
if entity.type == 'assembling-machine' then
update_lazy_bastard(journey, -1)
end
end,
on_world_start = function(journey)
journey.lazy_bastard_machines = 0
end,
clear = function(journey)
game.forces.player.manual_crafting_speed_modifier = 0
end,
}
Public.ribbon = {
on_world_start = function(journey)
local surface = game.surfaces.nauvis
local mgs = surface.map_gen_settings
mgs.height = 256
surface.map_gen_settings = mgs
surface.clear(true)
end,
clear = function(journey)
local surface = game.surfaces.nauvis
local mgs = surface.map_gen_settings
mgs.height = nil
surface.map_gen_settings = mgs
end,
on_chunk_generated = function(event, journey)
local surface = event.surface
local left_top_x = event.area.left_top.x
local left_top_y = event.area.left_top.y
if (left_top_x + left_top_y)^2 <= 256 then
local oils = surface.count_entities_filtered{name = 'crude-oil', position = {x = 0,y =0}, radius = 256}
if math.random(1, 10 + oils * 10) == 1 then
local pos = surface.find_non_colliding_position_in_box('oil-refinery', event.area, 0.1, true)
if pos then
surface.create_entity({name = 'crude-oil', position = pos, amount = 60000})
end
end
end
end,
on_world_start = function(journey)
local surface = game.surfaces.nauvis
local mgs = surface.map_gen_settings
mgs.height = 256
surface.map_gen_settings = mgs
surface.clear(true)
end,
clear = function(journey)
local surface = game.surfaces.nauvis
local mgs = surface.map_gen_settings
mgs.height = nil
surface.map_gen_settings = mgs
end,
}
Public.abandoned_library = {
on_world_start = function(journey)
game.permissions.get_group('Default').set_allows_action(defines.input_action.open_blueprint_library_gui, false)
game.permissions.get_group('Default').set_allows_action(defines.input_action.import_blueprint_string, false)
end,
clear = function(journey)
game.permissions.get_group('Default').set_allows_action(defines.input_action.open_blueprint_library_gui, true)
game.permissions.get_group('Default').set_allows_action(defines.input_action.import_blueprint_string, true)
end,
on_world_start = function(journey)
game.permissions.get_group('Default').set_allows_action(defines.input_action.open_blueprint_library_gui, false)
game.permissions.get_group('Default').set_allows_action(defines.input_action.import_blueprint_string, false)
end,
clear = function(journey)
game.permissions.get_group('Default').set_allows_action(defines.input_action.open_blueprint_library_gui, true)
game.permissions.get_group('Default').set_allows_action(defines.input_action.import_blueprint_string, true)
end,
}
return Public
Public.railworld = {
on_world_start = function(journey)
journey.world_specials['ore_size'] = 4
journey.world_specials['ore_frequency'] = 0.25
journey.world_specials['coal'] = 4
journey.world_specials['stone'] = 4
journey.world_specials['copper-ore'] = 4
journey.world_specials['iron-ore'] = 4
journey.world_specials['uranium-ore'] = 4
journey.world_specials['crude-oil'] = 4
journey.world_specials['enemy_base_frequency'] = 0.25
journey.world_specials['enemy_base_size'] = 2
journey.world_specials['enemy_base_richness'] = 2
journey.world_specials['water'] = 1.5
journey.world_specials['starting_area'] = 3
end,
}
local delivery_options = {
'solar-panel',
'rocket-part',
'beacon',
'assembling-machine-3',
'low-density-structure',
'heat-pipe',
'express-transport-belt',
'logistic-robot',
'power-armor'
}
Public.resupply_station = {
on_world_start = function(journey)
local pick = delivery_options[math.random(1, #delivery_options)]
journey.speedrun = {enabled = true, time = 0, item = pick}
journey.mothership_cargo_space[pick] = game.item_prototypes[pick].stack_size
end,
clear = function(journey)
journey.mothership_cargo_space[journey.speedrun.item] = nil
journey.mothership_cargo[journey.speedrun.item] = 0
journey.speedrun.enabled = false
end,
}
return Public