Skip to content

Commit fb5c43d

Browse files
authored
Add minesweeper map (#1531)
1 parent e00405e commit fb5c43d

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

description.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"order": "a",
3+
"multiplayer-compatible": true,
4+
"is-main-game": true
5+
}

map_gen/maps/minesweeper.lua

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
local Event = require 'utils.event'
2+
local Popup = require 'features.gui.popup'
3+
local ScenarioInfo = require 'features.gui.info'
4+
5+
ScenarioInfo.set_map_name('Minesweeper')
6+
ScenarioInfo.set_map_description('Minesweeper - in Factorio!')
7+
ScenarioInfo.set_map_extra_info([[
8+
Use [color=128,206,240][font=default-semibold]SHIFT + M[/font][/color] to use the Minesweeper tools!
9+
10+
Unlimited lives, but stepping on a hidden mine triggers a nuclear explosion — walk carefully!
11+
Un-flagging incorrectly flagged empty tiles will reveal a small biter nest surprise.
12+
Correctly marking mine tiles (flagging real mines) rewards the player by spawning resources.
13+
14+
Good luck, and may your wits guide you through the minefield!
15+
The [color=red]RedMew[/color] team
16+
]])
17+
ScenarioInfo.set_new_info([[
18+
2026-01-22
19+
Updated scenario to mod
20+
]])
21+
22+
local Config = require 'config'
23+
Config.market.enabled = false
24+
Config.redmew_surface.enabled = false
25+
Config.player_rewards.enabled = false
26+
Config.player_shortcuts.enabled = true
27+
Config.player_create.starting_items = {
28+
{ count = 4, name = 'burner-inserter' },
29+
{ count = 4, name = 'burner-mining-drill' },
30+
{ count = 2, name = 'stone-furnace' },
31+
{ count = 20, name = 'coal' },
32+
{ count = 1, name = 'pistol' },
33+
{ count = 32, name = 'firearm-magazine' },
34+
{ count = 20, name = 'wood' },
35+
}
36+
37+
local INFO = {
38+
mod_name = 'mine-sweeper',
39+
popup_name = 'minesweeper-mod-required',
40+
title = 'Scenario mod mismatch',
41+
message = [[
42+
This scenario needs Minesweeper mod in order to work correctly.
43+
You can download it from the mod portal: https://mods.factorio.com/mod/mine-sweeper
44+
]],
45+
sprite_path = 'virtual-signal.signal-alert'
46+
}
47+
48+
if not script.active_mods[INFO.mod_name] then
49+
Event.add(defines.events.on_player_joined_game, function(event)
50+
Popup.player(
51+
game.get_player(event.player_index),
52+
INFO.message,
53+
INFO.title,
54+
INFO.sprite_path,
55+
INFO.mod_name
56+
)
57+
end)
58+
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
return require 'map_gen.maps.minesweeper'

0 commit comments

Comments
 (0)