From 10ed702c2e67336ca45c72023ad2b02943c0b3b7 Mon Sep 17 00:00:00 2001
From: C29H25N3O5 <87485746+C29H25N3O5@users.noreply.github.com>
Date: Wed, 20 Oct 2021 00:09:48 -0500
Subject: [PATCH] Changed the other two documents to markdown format (#396)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* 剩余两个文档也都改成 Markdown 格式
---
document/{legals.txt => legals.md} | 28 +++-
document/mode.md | 198 +++++++++++++++++++++++++++++
document/mode.txt | 149 ----------------------
3 files changed, 225 insertions(+), 150 deletions(-)
rename document/{legals.txt => legals.md} (95%)
create mode 100644 document/mode.md
delete mode 100644 document/mode.txt
diff --git a/document/legals.txt b/document/legals.md
similarity index 95%
rename from document/legals.txt
rename to document/legals.md
index 68e9c845..e75ebdf9 100644
--- a/document/legals.txt
+++ b/document/legals.md
@@ -1,29 +1,55 @@
-TECHMINO © 2019-2021 26F Studio. Some rights reserved.
+**TECHMINO © 2019-2021 26F Studio. Some rights reserved.**
TECHMINO and "26F Studio" are trademarks of 26F Studio.
The TECHMINO game and source code are under a GNU Lesser General Public License Version 3.
+
+
TECHMINO is not a fan game. TECHMINO and 26F Studio are not affiliated with Tetris Holding, LLC or The Tetris Company, Inc. in any way.
+
+
"Tetris" is the registered trademark of The Tetris Holding, LLC, licensed to The Tetris Company, Inc.
+
+
Powered by LÖVE, © 2006-2021 LÖVE Development Team.
+
+
Lua is free software distributed under the terms of the MIT license. Copyright © 1994~2021 by Lua.org, PUC-Rio.
+
+
The Apple logo, "Apple Inc.," iOS, iPadOS, macOS, iPhone, and Mac are registered trademarks of Apple Inc. in the United States of America and other countries or regions.
+
+
"Windows", the Windows logo, "Xbox", Xbox logo, and "Microsoft" are registered trademarks of Microsoft Corporation in the United States of America and other countries or regions.
+
+
Alibaba Sans is copyrighted by Alibaba Group Holding Limited. Alibaba is a trademark of Alibaba Group Holding Limited in the People’s Republic of China and other countries or regions.
+
+
JetBrains Mono is copyrighted by the JetBrains Mono Project authors. JetBrains Mono is a trademark of JetBrains s.r.o. JetBrains Mono is licensed under the SIL Open Font License, Version 1.1.
+
+
"PlayStation", "PS", "PlayStation Family Mark", "PS logo", "DualSense" and "Play Has No Limits" are registered trademarks or trademarks of Sony Interactive Entertainment Inc. "SONY" is a registered trademark of Sony Corporation. © 2021 Sony Interactive Entertainment LLC.
+
+
GoldWave is a registered trademark of GoldWave, Inc.
+
+
Linux is a registered trademark of Linus Torvalds.
+
+
Touhou Project © Team Shanghai Alice 2002-2021.
+
+
All other trademarks are the property of their respective owners.
\ No newline at end of file
diff --git a/document/mode.md b/document/mode.md
new file mode 100644
index 00000000..fe73073c
--- /dev/null
+++ b/document/mode.md
@@ -0,0 +1,198 @@
+# 模式文件说明
+
+
+
+## 1. 参数
+
+模式文件应当是一个合乎(语)法的 Lua 程序文件, 其必须返回一个 `table`, 其中的内容包括:
+
+
+
+### 1.1. `color`
+
+**必选**, 模式的颜色, 用于点击地图图标后显示的提示文本.
+
+------
+
+
+
+### 1.2. `env`
+
+**必选**, 模式环境变量,决定了关卡的各项属性.
+
+具体各项参数见下表:
+
+| 属性名 | 默认值 | **说明** |
+| ------------------ | ----------------- | ------------------------------------------------------------ |
+| **`drop`** | `60` | 下落延迟(帧, 支持正整数, `2^(-n)`, 和 `0` \[20G\]) |
+| **`lock`** | `60` | 锁定延迟(帧) |
+| **`wait`** | `0` | 出块延迟(帧) |
+| **`fall`** | `0` | 消行延迟(帧) |
+| **`bone`** | `false` | 是否开启骨块模式 |
+| **`fieldH`** | `20` | 场地高度 |
+| **`heightLimit`** | `1e99` | 允许的最大场地高度 |
+| **`nextCount`** | `6` | 显示 Next 个数 |
+| **`nextStartPos`** | `1` | Next 从第几个开始显示 |
+| **`holdCount`** | `1` | Hold 个数 |
+| **`infHold`** | `false` | 是否能无限 Hold |
+| **`phyHold`** | `false` | 是否开启物理 Hold |
+| **`ospin`** | `true` | 是否能 O-Spin |
+| **`deepDrop`** | `false` | 是否开启深降 |
+| **`RS`** | `'TRS'` | 旋转系统名 |
+| | | |
+| **`das`** | `10` | DAS |
+| **`arr`** | `2` | ARR |
+| **`sddas`** | `2` | 软降 DAS |
+| **`sdarr`** | `2` | 软降 ARR |
+| **`mindas`** | `0` | 允许的最小 DAS |
+| **`minarr`** | `0` | 允许的最小 ARR |
+| **`minsdarr`** | `0` | 允许的最小软降 ARR |
+| **`ihs`** | `true` | 提前 Hold |
+| **`irs`** | `true` | 提前旋转 |
+| **`ims`** | `true` | 提前移动 |
+| | | |
+| **`skinSet`** | `[设置]` | 方块贴图, 只能填写内置皮肤的名字 |
+| **`skin`** | `[设置]` | 方块颜色, 包含 25 个整数 (`1`~`16`) 的 `table` |
+| **`face`** | `[设置]` | 方块朝向, 包含 25 个整数 (`0`~`3`) 的 `table` |
+| | | |
+| **`block`** | `true` | 是否显示方块 |
+| **`ghost`** | `0.3` | 影子透明度(`0`~`1`) |
+| **`center`** | `1` | 旋转中心透明度(`0`~`1`) |
+| **`smooth`** | `false` | 是否平滑下落 |
+| **`grid`** | `0.16` | 网格透明度(`0`~`1`) |
+| **`bagLine`** | `true` | 是否显示包分界线(如果存在) |
+| **`lockFX`** | `2` | 锁定特效等级(`0`~`5`整数) |
+| **`dropFX`** | `2` | 瞬间下落特效等级(`0`~`5`整数) |
+| **`moveFX`** | `2` | 移动特效等级(`0`~`5`整数) |
+| **`clearFX`** | `2` | 消除特效等级(`0`~`5`整数) |
+| **`splashFX`** | `2` | 溅射特效等级(`0`~`5`整数) |
+| **`shakeFX`** | `2` | 晃动特效等级(`0`~`5`整数) |
+| **`atkFX`** | `2` | 攻击特效等级(`0`~`5`整数) |
+| | | |
+| **`text`** | `true` | 是否显示消行文本 |
+| **`score`** | `true` | 是否显示落块分数 |
+| **`highCam`** | `false` | 是否开启超屏视野 |
+| **`nextPos`** | `false` | 是否开启生成预览 |
+| **`showSpike`** | `false` | 是否开启spike计数器 |
+| | | |
+| **`hideBoard`** | `false` | 场地隐藏模式(“`down`"|"`up`"|"`all`") |
+| **`flipBoard`** | `false` | 场地翻转模式(“`U-D`"|"`L-R`"|"`180`") |
+| | | |
+| **`sequence`** | `bag` | 序列模式, 是放一块后对 `next` 序列的刷新函数, 可以使用默认的几个函数用字符串表示,
也可以自己写一个. 注意: 使用协程技术 |
+| **`seqData`** | `{1,2,3,4,5,6,7}` | 序列模式使用的”包”数据 (本质是生成序列用的数据,会作为参数传进上面那个
叫 `sequence` 的序列生成函数,不一定是包) |
+| **`mission`** | `false` | 包含任务的 `table`, 说明暂时略 |
+| | | |
+| **`life`** | `0` | 生命数(复活次数) |
+| **`garbageSpeed`** | `1` | 垃圾行释放速度 |
+| **`pushSpeed`** | `3` | 垃圾行上涨速度 |
+| **`noTele`** | `false` | 是否禁止10个高级按键 |
+| **`visible`** | `'show'` | 方块可见性, 填写固定的几个字符串 |
+| **`freshLimit`** | `1e99` | 锁延刷新次数限制 |
+| **`easyFresh`** | `true` | 是否使用简单锁延刷新规则 |
+| **`bufferLimit`** | `1e99` | 攻击缓冲行数上限 |
+| | | |
+| **`fkey1`** | `false` | 按下功能键1后执行的函数 |
+| **`fkey2`** | `false` | 按下功能键2后执行的函数 |
+| **`keyCancel`** | `{}` | 包含禁止使用的按键的 ID, 例如 `{1,2}` 就是禁止左移和右移 |
+| **`fine`** | `[设置]` | 是否开启非极简提示音 |
+| **`fineKill`** | `false` | 是否开启非极简即死 |
+| **`b2bKill`** | `false` | 是否开启断 B2B 即死 |
+| **`missionKill`** | `false` | 是否开启强制任务 |
+| **`noInitSZO`** | `false` | 是否禁止 SZO 块开局, 如果禁止, 开局序列会自动跳过最多连续五个SZO |
+| | | |
+| **`mesDisp`** | `NULL` | 需要在玩家侧边栏显示的信息(或函数列表,依次执行,可以显示在外面但是强烈不建议), 输入玩家对象 |
+| **`dropPiece`** | `NULL` | 放一块后要执行的函数(或函数列表,依次执行), 输入玩家对象 |
+| **`task`** | `NULL` | 每帧会**继续执行**的函数(或函数列表,依次执行,返回`true`会把自身从队列里清除) (初始化时会执行一次, 可以用来设置场地等), 输入玩家对象, 注意:使用协程技术 |
+| **`eventSet`** | `false` | 使用预设事件套件名称(字符串), 和上面三个套件会叠加, 使用时请小心, 尽量不要同时指定太多组件 |
+| | | |
+| **`bg`** | `'none'` | 背景, 只能填写内置背景的名字 |
+| **`bgm`** | `’race'` | 背景音乐名(或者列表随机, 例如{‘`race`','`push`'}), 只能用内置音乐库的音乐名 |
+| **`allowMod`** | `true | 是否允许mod |
+
+------
+
+
+
+### 1.3. `load`
+
+**必选**, 模式初始化函数, 一般创建一个玩家即可, 无输入, 无输出.
+
+------
+
+
+
+### 1.4. `score`
+
+可选(不填就没有分数保存和计算), 一局打完后要存储的数据.
+
+输入玩家对象, 输出游戏结束瞬间返回一个包含直接决定该模式成绩的数据 table (会被强制加上`date`标签).
+
+------
+
+
+
+### 1.5. `scoreDisp`
+
+可选(模式不出现在地图上的时候不用写), 是把`score()`存起来的table转换为字符串显示出来的函数. 输入一个成绩 table, 输出一个字符串.
+
+------
+
+
+
+### 1.6. `comp`
+
+可选(没有`score`函数的时候不用写), 是成绩 table 之间对比并排序的规则.
+
+输入两个成绩table, 输出[第一个是不是排在第二个前面]的布尔值(可以类比”小于"运算)
+
+------
+
+
+
+### 1.7. `getRank`
+
+可选, 模式评级函数, 是用于评价玩家表现的函数.
+
+输入玩家对象, 输出 `0`~`5`, `0`表示除了记录到排行榜外什么都不做;
+
+1/2/3/4/5 表示 B/A/S/U/X 级, 能解锁连接的模式, 还会让模式图标在地图上显示不同的颜色.
+
+------
+
+
+
+
+
+## 2. 示例
+
+以下是40行的模式文件内容:
+
+```lua
+--sprint_40l.lua
+return{ --返回一个table, 你也可以在之前定义一些常量或者函数什么
+ color=COLOR.green, --颜色
+ env={ --模式环境变量
+ drop=60,lock=60,
+ eventSet='checkLine_40', --这个预设eventSet包含了dropPiece和mesDisp, 就是40行需要的东西
+ bg='bg2',bgm='race',
+ },
+ load=function() --模式加载函数, 这里只生成了一个玩家, 常用的单人模式可以不写, 默认使用这个函数
+ PLY.newPlayer(1) --1是玩家编号, 默认用户控制1号玩家
+ end,
+ score=function(P)return{P.stat.time,P.stat.piece}end, --游戏结束时需要保存的本局关键信息
+ scoreDisp=function(D)return STRING.time(D[1]).." "..D[2].." Pieces"end, --把score返回的数据显示出来的方法
+ comp=function(a,b)return a[1]