关于本项目
这是一个数据包,允许你在世界中创建扫雷游戏。它旨在在创造模式下游玩。
基本设置
我假设你已经知道如何安装数据包。请自行安装。
之后你需要创建一个游戏。
我建议使用以下命令获取一个“地块方块”:
/give @s command_block[block_entity_data={id:"command_block",auto:1b,Command:"function minesweeper:addfield"}]
无论你将此命令方块放置在哪里,它都会立即被替换为一个铁块。这意味着在该位置已为当前游戏添加了一个地块。
破坏铁块不会移除底层的地块。若要改变这一行为,请通过 /scoreboard players set .erasemode minesweeper_games 1 启用擦除模式。
玩法说明
首先确保擦除模式已禁用。
现在破坏其中一个铁块。你会注意到整个地块都被清除了。这是因为你没有生成任何炸弹。GG。
在你阅读了命令页面、重置游戏并生成炸弹后,你可以再次尝试。
此时你会看到一个(如果你的第一个地块已经与炸弹相邻)或多个带有数字的地块。这些数字表示相邻炸弹的数量(包括对角线方向)。你必须揭示所有地块,但包含炸弹的地块除外。如果你揭示了一个包含炸弹的地块,你会听到爆炸声。你可以将其视为失败。也可以不这么认为。我无法强迫你。
目前尚不支持标记炸弹,也没有自动胜利提示。
设置
你可以使用命令 /scoreboard players set .<在此处插入设置名称> minesweeper_games <在此处插入值> 来设置参数。
布尔值必须设置为 0(禁用)或 1(启用)。其他值会导致未定义的行为。
- current - 指定命令应操作的游戏 ID。默认值:0
- show - 布尔值:显示调试信息。默认值:0
- displayzero - 布尔值:对于周围没有相邻炸弹的地块,也显示其相邻炸弹数量。默认值:0
- erasemode - 布尔值:删除所有暴露在空气中的地块(已揭示的地块)。警告:若不小心使用可能导致意外删除。启用前请务必运行
/function minesweeper:reset。默认值:0
- autoreveal - 布尔值:自动揭示所有周围没有相邻炸弹的已揭示地块的相邻地块。默认值:1
命令
/function minesweeper:addfield 在当前位置向当前游戏添加一个地块。
/function minesweeper:newgame 将当前游戏的所有地块填充为铁块,并移除其中的炸弹。
/function minesweeper:reset 将当前游戏的所有地块填充为铁块。
/function minesweeper:addbomb {count:1} 向当前游戏添加一个炸弹。更改数字以添加更多。
/function minesweeper:recount 重新计算全服所有地块的相邻炸弹数量。
/function minesweeper:clean 移除全服重复的地块和计数器。
内部函数
这些函数是内部使用的,不应被调用。
- minesweeper:load
- minesweeper:tick
- minesweeper:count
- minesweeper:resettile
- minesweeper:explode
- minesweeper:raycast - 这个功能实际上未被使用,且没有任何作用。
About this project
This is a datapack that allows you to create minesweeper games in your world. It is intended to be played in creative mode.
Basic setup
I expect you to already know how to install a datapack. Do that.
After that you need to create a game.
I recommend getting yourself a "field block" with this command:
/give @s command_block[block_entity_data={id:"command_block",auto:1b,Command:"function minesweeper:addfield"}]
Wherever you place this commandblock you will see it immediatly replaced with an ironblock. That means that a field has been added to the current game at that location.
Destroying the iron block will not remove the underlying field. To change that enable erasemode with /scoreboard players set .erasemode minesweeper_games 1
How to play
First ensure that erasemode is disabled.
Now destroy one of the ironblocks. You will notice that the entire field has been cleared. That is because you didn't spawn in any bombs. GG.
Now that you have read the commands page, reset the game and spawned in bombs you can do that again.
Now you will see one (if your first field was already adjacent to a bomb) or multiple fields with numbers. The numbers indicate the amount of adjacent bombs (diagonals included). You must reveal all fields except those that contain bombs. If you reveal a field with a bomb you will hear an explosion. You can consider that your loss. Or not. I can't force you.
You can not currently flag bombs, nor get an automatic win indication.
Settings
You can set settings with the command /scoreboard players set .<INSERT_SETTING_HERE> minesweeper_games <INSERT_VALUE_HERE>
Booleans must be set either to 0 for disabled or 1 for enabled. Other values result in undefined behaviour.
- current - specifies the id of the game that commands should operate on. Default: 0
- show - Bool: Show debug info. Default: 0
- displayzero - Bool: Show number of adjacent bombs for fields without any adjacent bombs. Default: 0
- erasemode - Bool: Delete all fields that are exposed to air (revealed). WARNING: can cause accedental deletion when used without care. Always run
/function minesweeper:reset before enabling. Default: 0
- autoreveal - Bool: Automatically reveal all adjacent fields of revealed fields without any adjacent bombs. Default: 1
Commands
/function minesweeper:addfield Adds a field to the current game at the current position.
/function minesweeper:newgame Fills all fields of the current game with iron blocks and removes the bombs from them.
/function minesweeper:reset Fills all fields of the current game with iron blocks.
/function minesweeper:addbomb {count:1} Add one bomb to the current game. Change the number to add more.
/function minesweeper:recount Recounts the amount of adjacent bombs for all fields worldwide.
/function minesweeper:clean Removes duplicate fields and counters worldwide.
Internal functions
These functions are internal and should not be used.
- minesweeper:load
- minesweeper:tick
- minesweeper:count
- minesweeper:resettile
- minesweeper:explode
- minesweeper:raycast - This thing is actually unused and does nothing at all.
评论 0
登录后参与评分
还没有评论,来抢沙发吧