Compare commits

...

143 Commits

Author SHA1 Message Date
MrZ_26
da716ea5c5 版本推进 2022-11-05 23:07:54 +08:00
MrZ_26
c6f92a3030 略微降低客户端发言频率限制
发言id和文本之间加一个空格
框架跟进,修复textBox控件和listBox控件显示范围问题
2022-11-05 22:59:21 +08:00
MrZ_26
267e2dc544 修复其他玩家进房check是否已存在的时候因为访问不存在的玩家而报错 2022-11-05 22:59:21 +08:00
MrZ_26
cb7d3afdfb 删除服务端的playerManager.noPassword消息 2022-11-05 22:59:21 +08:00
MrZ_26
b57e863c28 联网游戏可以用键盘ctrl+0123456切换队伍 2022-11-05 22:59:21 +08:00
MrZ_26
7aed15fd4f 修正其他玩家的结束游戏消息处理太早导致录像没放完出问题 2022-11-05 22:59:21 +08:00
MrZ_26
6d71b26595 自定义游戏菜单微调 2022-11-05 22:59:21 +08:00
sakurw
1df5406cb3 Update lang_ja.lua (#768) 2022-11-05 15:47:36 +08:00
MrZ_26
a2b762dcbc 添加几个房间内命令
添加房间被解散的语言文本
把一处神秘写法改正常一点
2022-11-05 02:14:51 +08:00
MrZ_26
c2d29c3d6a 联网游戏界面添加选队伍按钮,加一个没卵用的退出房间命令 2022-11-04 17:15:36 +08:00
MrZ_26
da602eb693 两个输入验证码的地方添加粘贴按钮
整理代码
2022-11-04 16:45:51 +08:00
MrZ_26
9e442a3073 整理代码
版本推进
2022-11-04 00:26:38 +08:00
Richard969
bc8b7e733b FIX c4wtrain_n getrank wrong (#766) 2022-11-04 00:25:22 +08:00
MrZ_26
94aa84e380 修复ultra进去就蓝屏(之前bgm模块更新忘了改对应用法) 2022-11-04 00:07:25 +08:00
MrZ_26
c462c28640 收到重复id玩家进入房间的时候会先触发把老的退掉防止出现复制人引起一堆问题 2022-11-03 23:55:04 +08:00
MrZ_26
b5fbf9cade 修复网战多队伍结束条件错误 2022-11-03 23:16:42 +08:00
MrZ_26
e88957296f 修改队伍颜色,看起来不扎眼一些(大概 2022-11-03 23:08:39 +08:00
MrZ_26
9e61cb995a 缓冲槽内有过多垃圾行时满了就不会再继续绘制,减少极端情况下的卡顿 2022-11-03 22:46:46 +08:00
MrZ_26
89a5a718da 实现房间内排名(方法有点小神秘 不过应该能用 2022-11-03 22:45:46 +08:00
MrZ_26
43649c54a3 基本完成中途加入的观战
修复从联网游戏房间退出不会把GAME.playing置false
checkWarning的玩家改成输入而不是自动获取
整理代码
2022-11-03 18:06:28 +08:00
MrZ_26
b2b5c99425 修复节日日期写错
修正简洁模式场景栈搜索有未触发漏洞
整理代码
框架跟进
2022-11-03 15:11:12 +08:00
MrZ_26
9e882e6188 框架跟进
推进中途加入房间的观战相关
2022-11-03 12:23:29 +08:00
渣渣120
e688458cfd 在 README 提供更多下载方式 便于那些完全不懂github的小白用户( (#765)
* 在 README 提供更多下载方式 便于那些完全不懂github的小白用户(

Co-authored-by: ParticleG <particle_g@outlook.com>
Co-authored-by: C₂₉H₂₅N₃O₅ <a1228465111@163.com>
2022-11-01 10:54:45 +08:00
MrZ_26
b7c528f5ac 修改获取对局种子的api 2022-10-31 18:59:04 +08:00
MrZ_26
c743fdcffc 修复连连看小游戏背景区域范围错误 2022-10-31 02:19:54 +08:00
MrZ_26
56e19dd91e 修复房间列表界面密码栏存在时刷新计时器不动导致很奇怪,现在会走时间但到0不会刷新 2022-10-30 00:17:07 +08:00
MrZ_26
308512d36a 修复暂停界面第一帧有时候会闪烁 2022-10-29 17:18:30 +08:00
MrZ_26
749806e553 修复100攻击模式打到40就算成绩 2022-10-29 15:55:53 +08:00
MrZ_26
78223334ee 再整理quarks背景代码 2022-10-29 02:22:52 +08:00
MrZ_26
7f50161ca7 再整理quarks背景代码 2022-10-29 02:20:52 +08:00
MrZ_26
dd872a72b2 整理代码,return后面跟空格 2022-10-29 00:59:41 +08:00
MrZ_26
0df17cb4ee 给一些模式换刚加的两个新背景 2022-10-29 00:52:35 +08:00
MrZ_26
27244dae04 优化两个新背景代码 2022-10-29 00:33:34 +08:00
NOT_A_ROBOT
c472d6cbd7 Add new backgrounds (#764)
* Add quark background

* add galaxy background
2022-10-28 23:39:34 +08:00
MrZ_26
e4c786a5d4 更新头像的函数检测如果缺数据就跳过流程
框架跟进
2022-10-28 16:33:19 +08:00
MrZ_26
e291a070f3 优化联网游戏体验(统计数据结算、远程玩家死亡结算时机) 2022-10-28 16:33:19 +08:00
MrZ_26
6b16fcd5f5 添加一点注释,整理代码 2022-10-28 16:33:19 +08:00
MrZ_26
d79279d1cd 音乐室可以按住shift+字符反向快速跳转 2022-10-28 16:33:19 +08:00
ParticleG
03fbfaa577 - Update workflow 2022-10-28 10:00:50 +08:00
ParticleG
8231021426 - Update summary 2022-10-27 18:05:12 +08:00
ParticleG
784b2074f8 - Update summaries 2022-10-27 17:16:38 +08:00
ParticleG
93c9977c86 - Update summaries 2022-10-27 16:27:15 +08:00
ParticleG
ad1b129dfa - Update summaries 2022-10-27 16:08:45 +08:00
ParticleG
2d4856551b - Update summaries 2022-10-27 15:06:40 +08:00
ParticleG
4d0e72d61e - Try using step summaries 2022-10-27 14:11:47 +08:00
ParticleG
9b20ec6941 - Try fix windows output & notice 2022-10-27 13:52:20 +08:00
ParticleG
5a02265018 - Try fix multiline issue 2022-10-27 11:31:51 +08:00
ParticleG
0dd5c46fd1 - Try use new environment file again 2022-10-27 10:59:54 +08:00
ParticleG
55831339dd - Try using deprecated set-output for debugging 2022-10-27 10:50:12 +08:00
MrZ_26
e0ba04e579 修改更新历史,框架跟进 close #763 2022-10-27 02:14:22 +08:00
MrZ_26
d5f7a6ddd0 整理代码 2022-10-27 01:43:19 +08:00
MrZ_26
66a3354883 整理代码,texture模块的新画布函数的画布底色改成透明白色 2022-10-27 00:29:33 +08:00
MrZ_26
55218e4563 修复创房间的人“当前场景”状态有问题导致别人退房的时候操作不能正确执行 2022-10-27 00:24:27 +08:00
MrZ_26
081b769ac6 非房主玩家边框还是稍微粗一点吧 2022-10-27 00:23:50 +08:00
MrZ_26
8f767b3ab9 订正一处中文文本 2022-10-27 00:01:38 +08:00
MrZ_26
a2eb7e4a54 修复联网对战攻击校验变量用错 2022-10-27 00:01:29 +08:00
MrZ_26
2de663703b 修复单机模式没有sid导致部分情况读取sid报错(会用本地uid直接代替) 2022-10-27 00:01:14 +08:00
ParticleG
40a587dcc4 - Try use new release action 2022-10-26 22:23:23 +08:00
MrZ_26
f366a63c8f 修复录像菜单添加第一个录像/删除最后一个录像后按钮显示状态没变 close #736 2022-10-26 11:58:23 +08:00
MrZ_26
8c603fadee 添加反联网玩家使用非法块皮肤
检测到联网玩家攻击数量不同步后会直接主动放弃游戏 close #720
2022-10-26 11:47:52 +08:00
MrZ_26
5e9ef8d3ab 联网玩家皮肤调成炸弹块时会被本地强制改为灰色 2022-10-26 11:47:52 +08:00
ParticleG
2e9cef3ed8 - Bump actions' versions 2022-10-26 11:04:06 +08:00
MrZ_26
354d4f80bf 一堆场景同时允许回车键和小键盘回车键 2022-10-26 10:57:45 +08:00
MrZ_26
a578d537cd 粘贴场地高度最高能读到60行,允许一些极端的高空作业 2022-10-26 10:42:53 +08:00
MrZ_26
85ff1cd1c3 刚注册完跳转到设置密码界面的时候会自动填入注册用的验证码(因为服务端就这么设计的可以复用一次) 2022-10-26 10:35:01 +08:00
ParticleG
0d015de359 - Use file IO instead of echo 2022-10-26 10:23:11 +08:00
MrZ_26
5a0a473d4a 控制台theme命令会提示可以输halloween 2022-10-26 10:16:43 +08:00
MrZ_26
420ff9a556 修正日语语言文件少个逗号 2022-10-26 10:10:50 +08:00
sakurw
4f6e99daa2 Update lang_ja.lua (#761) 2022-10-26 10:06:32 +08:00
MrZ_26
10a57ecc18 修复音乐室暂停就报错(之前合并分支选错一边)
框架跟进(修复说明书界面报错)
2022-10-26 05:34:11 +08:00
MrZ_26
b101d74df5 版本推进 2022-10-26 04:59:38 +08:00
MrZ_26
97d4e58d47 添加halloween主题,包括一个bgm,一个按钮主题,主菜单打雷特效,带蜘蛛网的标题和一个南瓜
close #757
2022-10-26 04:42:00 +08:00
MrZ_26
b436645ab7 修正几处检测当前场景的代码之前更新场景模块忘了改 2022-10-26 03:48:05 +08:00
sakurw
af7c73f9f0 Update lang_ja.lua (#760) 2022-10-26 02:05:10 +08:00
MrZ_26
7d44396b03 新增队伍系统,攻击不会打给同队,剩一队时游戏就结束(目前允许0~6,0号为自由队,每个人分别算一队)
添加/group命令来选择队伍
2022-10-26 01:26:04 +08:00
MrZ_26
bd428f355a 添加房主和队伍状态的显示方式
添加转交房主提示
2022-10-25 20:53:00 +08:00
MrZ_26
2d6d897e2a 忽略部分服务器返回的错误消息
框架跟进
2022-10-25 19:48:00 +08:00
Particle_G
4913deb15f - Try fix windows product-name 2022-10-25 09:19:10 +00:00
Particle_G
0cb9d3990c - Use new action addresses 2022-10-25 06:55:15 +00:00
Particle_G
388e8e1fe1 - Fix deprecated set-output 2022-10-25 03:34:57 +00:00
MrZ_26
42168ddf16 修复一些联网相关场景切换关系问题
修复重设密码场景回车键自动识别功能条件错误
框架跟进
2022-10-25 02:17:07 +08:00
MrZ_26
134773765c 修创建房间场景在场景栈的位置 2022-10-24 23:29:19 +08:00
MrZ_26
74b099d58f 对战房间消息框可以用两个房间管理命令 2022-10-24 23:01:35 +08:00
MrZ_26
c1936441dd 调整踢出玩家的提示文本 2022-10-24 22:59:27 +08:00
MrZ_26
dc3b7c0825 有玩家退出房间的时候也会刷新房间allReady状态
限制催促准备音效频率
2022-10-24 22:30:49 +08:00
MrZ_26
86910f2956 修正进入房间成功的时候错误打断了一个等待,应当是创建成功时 2022-10-24 22:04:49 +08:00
MrZ_26
7b1df65e64 调整用户名显示相关,只有播放录像才会强制用户名,否则都用uid获取 2022-10-24 19:15:05 +08:00
MrZ_26
04559efaca 添加服务器返回的错误信息语言文本 2022-10-24 18:39:27 +08:00
MrZ_26
b668fa4750 修改观战状态检测
整理代码
2022-10-24 15:09:33 +08:00
MrZ_26
a4db061485 修游戏中有人退出房间有一处复制漏改
观战时会默认视角为sid最小的人
2022-10-24 15:05:01 +08:00
MrZ_26
d4d97f1e7f Merge branch 'ci_new_online' 2022-10-24 14:27:27 +08:00
MrZ_26
e682202b60 更多ws连接炸掉的时候自动返回主菜单 2022-10-24 14:15:42 +08:00
MrZ_26
2480987f10 正确更新房间allReady状态 2022-10-24 14:11:46 +08:00
MrZ_26
b0acdce294 修复不同设备对局sid不一致 2022-10-24 14:07:09 +08:00
MrZ_26
7953cf735b 实现键盘一键准备 2022-10-24 02:52:44 +08:00
MrZ_26
d074a85fbc NETPLY模块删掉一堆方法,先外部直接改数据,玩家会根据状态更换样式
游戏开始/结束时自主同步正确的服务端玩家状态
2022-10-24 02:37:45 +08:00
MrZ_26
543e85e94c 实现收发房内聊天消息,修改频发言率限制
实现消息框里的进出房间提醒
2022-10-24 00:43:11 +08:00
MrZ_26
23f43df737 实现玩家全部准备的时候顶部文字提醒 2022-10-24 00:26:52 +08:00
MrZ_26
43b6ff7697 修正创建房间页面在场景书上的位置 2022-10-24 00:20:29 +08:00
MrZ_26
6ecc80ac0f 修正玩家进出房间相关问题
修正获取玩家信息相关问题
实现操作录像传输
修改一些语言文本
2022-10-23 23:31:16 +08:00
MrZ_26
3ae0e80ce5 调整重设密码界面在场景树上的位置 2022-10-23 04:53:51 +08:00
MrZ_26
d12f8a27e7 减少密码哈希迭代次数防止把手机卡烂
原来的登录和注册界面改为密码登录和邮箱登录
邮箱登录界面不再分状态,设置密码独立出一个界面
自动登录不再检测本地用过密码登录,第一次邮箱登录不设置密码但存了token也可以
整理代码
2022-10-23 04:36:19 +08:00
MrZ_26
f9bbb8fce6 实现玩家准备状态相关 2022-10-23 01:43:56 +08:00
MrZ_26
80984cddf9 联网游戏结束后2.6秒返回玩家列表 2022-10-23 01:13:01 +08:00
MrZ_26
8fb0b2e600 实现根据统一种子随机生成每个玩家的sid 2022-10-22 02:08:36 +08:00
MrZ_26
9a4e8ab4ec 实现开始游戏信号与切换进游戏状态创建玩家 2022-10-21 00:16:15 +08:00
MrZ_26
dc1973e049 实现新api的进房和准备/观战
修复不会刷新在线人数
2022-10-19 23:29:45 +08:00
MrZ_26
ccb05230f2 实现自动请求没见过的用户信息和自动获取用户头像 2022-10-17 11:47:44 +08:00
MrZ_26
7ac6f45b9b 实现玩家设置同步到服务器
实现玩家离开房间(各种途径)
修改云存读档代码(还未实现)
移除sid,准备之后用uid本地排序序号代替(排序还未实现)
整理代码,框架跟进
2022-10-09 06:47:08 +08:00
MrZ_26
df7ab20636 继续实现一堆联网消息
语言文件加一条
框架跟进
2022-10-08 04:16:18 +08:00
MrZ_26
c06961c9c8 订正上一个提交漏改的东西
优化debug消息显示格式
调整网络断开提示文本用法
2022-10-07 02:36:18 +08:00
MrZ_26
37b76a1cb4 继续整联网,数字action填入一个大表方便统一管理 2022-10-06 22:34:22 +08:00
MrZ_26
01d02a916d 修复音乐室暂停就爆炸 2022-10-06 16:45:34 +08:00
MrZ_26
8e99565a9d 退出前会主动断开一下ws连接
WAIT放到网络相关TASK函数内部(会在第一帧触发,不影响)
可以从语言文件翻译服务器的错误消息并显示了
框架跟进
2022-10-06 03:16:18 +08:00
MrZ_26
f8d17b23b6 注释后加空格
联网稍微推进
2022-10-03 02:43:51 +08:00
MrZ_26
06f4bb4e1a 整 理 代 码
(应该没有改到字符串里面的东西吧…)起码不直接影响运行
2022-10-01 11:32:11 +08:00
MrZ_26
6e00ff96ec 服务器返回房间对象格式错误的时候不会直接爆炸 2022-09-30 07:23:39 +08:00
MrZ_26
468bbc8053 实现拉取房间列表
框架跟进
2022-09-29 20:29:45 +08:00
MrZ_26
f41999c019 调整登录流程里弹出的信息 2022-09-29 18:36:19 +08:00
MrZ_26
d259e05ca7 【不能用】继续改联网,更新ws相关,完善断开后的行为与提示
框架跟进
2022-09-29 10:07:39 +08:00
MrZ_26
2491a436c2 修复生存L难度显示maxspeed文本时机不正确 2022-09-29 08:42:28 +08:00
MrZ_26
7a55e447fc 整理代码 2022-09-29 08:15:03 +08:00
MrZ_26
f3face791f 【不能用】继续改联网,实现并替换一些发送ws请求的方法
框架跟进
2022-09-29 02:41:00 +08:00
MrZ_26
9ccc019bb9 【不能用】继续改联网,能登录了
框架跟进
2022-09-28 23:00:43 +08:00
MrZ_26
bc9f00d09f 整理代码
框架跟进
2022-09-28 19:36:10 +08:00
MrZ_26
33c470dd38 【不能用】继续改联网
框架跟进
2022-09-28 01:20:03 +08:00
MrZ_26
9e0e93de5d 修音乐室和一些bgm模块更新后的小错误
框架跟进a
2022-09-27 21:30:29 +08:00
MrZ_26
16553e13a2 【警告】联网不能用,不要随便试
联网重制ing,提交一下做个中继点
2022-09-27 21:30:29 +08:00
MrZ_26
d031dc3a82 注释掉cc落块信息输出,需要的时候自己开 2022-09-27 21:30:29 +08:00
MrZ_26
7297eb8ee8 框架跟进 2022-09-27 21:30:29 +08:00
C₂₉H₂₅N₃O₅
55bcdd426b Updated the link to TTT (Eng. Ver.) (#754)
* Updated the link to TTT (Eng. Ver.)
2022-09-27 19:21:56 +08:00
NOT_A_ROBOT
139e2e14c4 Add 15 death delay to TSD Challenge modes (#753)
* Add 15 death delay to tsd_e

* Add 15 death delay to tsd_h

* Add 15 death delay to tsd_u
2022-09-27 19:20:59 +08:00
MrZ_26
339b53115a 据作者要求暂时删除rin语音包
微调几个tip
修改版本号
2022-09-17 22:27:38 +08:00
MrZ_26
03515b4490 框架跟进,修复bgm音量为0时切换几次bgm会报错 2022-09-11 22:49:26 +08:00
MrZ_26
9690a345a3 微调TRS,T的2→R和2→L加一个下1 2022-09-11 18:15:23 +08:00
ParticleG
8324f72e90 - Fix outputs 2022-09-11 17:20:53 +08:00
ParticleG
15eefc0e9f - Fix rename 2022-09-11 12:02:28 +08:00
ParticleG
d504bd3d49 - Fix macOS-appstore package name 2022-09-11 11:27:03 +08:00
ParticleG
fd4b4f1882 - Use cp instead of mv 2022-09-11 11:22:58 +08:00
ParticleG
a176ef35a0 - Fix release notes
- Add platform name to release artifacts
2022-09-11 11:19:34 +08:00
MrZ_26
0fc7178589 shader里部分float变量改为highp float,保证丝滑
(需要同时配合apk配置更新的gles版本为3.0)
2022-09-11 06:58:01 +08:00
MrZ_26
76d985cc0f 删除readme“当前稳定版本”的文本 2022-09-10 22:59:14 +08:00
C₂₉H₂₅N₃O₅
aa05e8857b Update readme.md (#751) 2022-09-10 22:57:58 +08:00
369 changed files with 6692 additions and 5489 deletions

View File

@@ -19,10 +19,10 @@ runs:
using: "composite" using: "composite"
steps: steps:
- run: | - run: |
echo "::set-output name=tag::"$(if [ -z "${{ inputs.tag }}" ] echo "tag="$(if [ -z "${{ inputs.tag }}" ]
then curl -w '%{url_effective}' -I -L -s -S https://github.com/${{ inputs.repo }}/releases/latest -o /dev/null | grep -o '\<[^/]*$' then curl -w '%{url_effective}' -I -L -s -S https://github.com/${{ inputs.repo }}/releases/latest -o /dev/null | grep -o '\<[^/]*$'
else echo ${{ inputs.tag }} else echo ${{ inputs.tag }}
fi) fi) >> $GITHUB_OUTPUT
id: get-tag id: get-tag
shell: bash shell: bash
- uses: ./.github/actions/get-unzip - uses: ./.github/actions/get-unzip

View File

@@ -20,6 +20,8 @@ jobs:
version-name: ${{ steps.app-info.outputs.version-name }} version-name: ${{ steps.app-info.outputs.version-name }}
version-string: ${{ steps.app-info.outputs.version-string }} version-string: ${{ steps.app-info.outputs.version-string }}
version-code: ${{ steps.app-info.outputs.version-code }} version-code: ${{ steps.app-info.outputs.version-code }}
update-title: ${{ steps.app-info.outputs.update-title }}
update-note: ${{ steps.app-info.outputs.update-note }}
commit-hash: ${{ steps.git-info.outputs.commit-hash }} commit-hash: ${{ steps.git-info.outputs.commit-hash }}
base-name: ${{ steps.assemble-base-name.outputs.base-name }} base-name: ${{ steps.assemble-base-name.outputs.base-name }}
steps: steps:
@@ -32,28 +34,42 @@ jobs:
shell: lua {0} shell: lua {0}
run: | run: |
local version = require "version" local version = require "version"
print("::set-output name=app-name::Techmino") os.execute('echo "app-name=Techmino" >> $GITHUB_OUTPUT')
print("::set-output name=version-name::"..version.name) os.execute('echo "version-name=' .. version.name .. '" >> $GITHUB_OUTPUT')
print("::set-output name=version-string::"..version.string:gsub("%a", "")) os.execute('echo "version-string=' .. version.string:gsub("%a", "") .. '" >> $GITHUB_OUTPUT')
print(("::set-output name=version-code::%d"):format(version.code)) os.execute('echo "version-code=' .. tostring(version.code) .. '" >> $GITHUB_OUTPUT')
local note = require 'parts.updateLog'
local p1 = note:find("\n%d") + 1
local p2 = note:find("\n", p1) - 1
os.execute('echo "update-title=' .. note:sub(p1, p2) .. '" >> $GITHUB_OUTPUT')
local p3 = note:find("\n", note:find("\n%d") + 1) + 1
local p4 = note:find("\n%d", p3 + 1)
updateNote = note:sub(p3, p4 - 2)
:gsub(" ", "- ")
:gsub(" ", "# ")
os.execute('echo "update-note<<EOF" >> $GITHUB_OUTPUT')
os.execute('echo "' .. updateNote .. '" >> $GITHUB_OUTPUT')
os.execute('echo "EOF" >> $GITHUB_OUTPUT')
- name: Get git info - name: Get git info
id: git-info id: git-info
shell: bash shell: bash
run: | run: |
COMMIT_HASH=$(git rev-parse --short ${{ GITHUB.SHA }}) COMMIT_HASH=$(git rev-parse --short ${{ GITHUB.SHA }})
echo ::set-output name=commit-hash::$COMMIT_HASH echo "commit-hash=$COMMIT_HASH" >> $GITHUB_OUTPUT
- name: Assemble package base name - name: Assemble package base name
id: assemble-base-name id: assemble-base-name
shell: bash shell: bash
run: | run: |
BASE_NAME=Techmino_${{ steps.app-info.outputs.version-string }}_${{ steps.git-info.outputs.commit-hash }}_#${{ GITHUB.RUN_NUMBER }} BASE_NAME=Techmino_${{ steps.app-info.outputs.version-string }}_${{ steps.git-info.outputs.commit-hash }}_#${{ GITHUB.RUN_NUMBER }}
echo ::set-output name=base-name::$BASE_NAME echo "base-name=$BASE_NAME" >> $GITHUB_OUTPUT
build-core: build-core:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: get-info needs: get-info
env: env:
OUTPUT_FOLDER: ./build OUTPUT_FOLDER: ./build
RELEASE_FOLDER: ./release
outputs: outputs:
download-url: ${{ steps.transfer.outputs.download-url }} download-url: ${{ steps.transfer.outputs.download-url }}
steps: steps:
@@ -66,14 +82,15 @@ jobs:
run: | run: |
import os import os
import re import re
os.system("echo ::set-output name=product-name::" + re.sub(r"[^A-Za-z0-9]+", "_", "${{ needs.get-info.outputs.app-name }}")) with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
- uses: ./.github/actions/update-version - uses: ./.github/actions/update-version
if: ${{ !startsWith(github.ref, 'refs/tags/v') }} if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
with: with:
commit: ${{ needs.get-info.outputs.commit-hash }} commit: ${{ needs.get-info.outputs.commit-hash }}
type: snapshot type: snapshot
- name: Build core love package - name: Build core love package
uses: 26F-Studio/love-actions-core@v1 uses: love-actions/love-actions-core@v1
with: with:
build-list: ./media/ ./parts/ ./Zframework/ ./conf.lua ./main.lua ./version.lua build-list: ./media/ ./parts/ ./Zframework/ ./conf.lua ./main.lua ./version.lua
package-path: ${{ env.CORE_LOVE_PACKAGE_PATH }} package-path: ${{ env.CORE_LOVE_PACKAGE_PATH }}
@@ -91,23 +108,27 @@ jobs:
with: with:
name: ${{ needs.get-info.outputs.base-name }}_Core_love name: ${{ needs.get-info.outputs.base-name }}_Core_love
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.love path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.love
- name: Prepare for release
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
shell: bash
run: |
mkdir -p ${{ env.RELEASE_FOLDER }}
cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.love ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Bare.love
- name: Upload release - name: Upload release
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }} if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
uses: softprops/action-gh-release@v1 uses: ncipollo/release-action@v1
with: with:
body: ${{ github.event.head_commit.message }} allowUpdates: true
files: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.love artifacts: ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Bare.love
body: ${{ needs.get-info.outputs.update-note }}
name: ${{ needs.get-info.outputs.update-title }}
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }} prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}
- name: Upload to WeTransfer - name: Upload to WeTransfer
id: transfer id: transfer
run: | run: |
curl -sL https://git.io/file-transfer | sh curl -sL https://git.io/file-transfer | sh
./transfer wet -s -p 16 --no-progress ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.love 2>&1>./wetransfer.log ./transfer wet -s -p 16 --no-progress ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.love 2>&1>./wetransfer.log
echo "::set-output name=download-url::$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" echo "download-url=$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" >> $GITHUB_OUTPUT
- name: Show download link
shell: bash
run: |
echo "::notice title=Bare love package::${{ steps.transfer.outputs.download-url }}"
auto-test: auto-test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -117,7 +138,7 @@ jobs:
with: with:
submodules: recursive submodules: recursive
- name: Love actions for testing - name: Love actions for testing
uses: 26F-Studio/love-actions-test@v1 uses: love-actions/love-actions-test@v1
with: with:
font-path: ./parts/fonts/proportional.otf font-path: ./parts/fonts/proportional.otf
language-folder: ./parts/language language-folder: ./parts/language
@@ -127,6 +148,7 @@ jobs:
needs: [get-info, build-core, auto-test] needs: [get-info, build-core, auto-test]
env: env:
OUTPUT_FOLDER: ./build OUTPUT_FOLDER: ./build
RELEASE_FOLDER: ./release
outputs: outputs:
download-url: ${{ steps.transfer.outputs.download-url }} download-url: ${{ steps.transfer.outputs.download-url }}
steps: steps:
@@ -139,8 +161,13 @@ jobs:
run: | run: |
import os import os
import re import re
os.system("echo ::set-output name=bundle-id::org.f26_studio." + re.sub(r"[^A-Za-z0-9]+", "_", "${{ needs.get-info.outputs.app-name }}") + ".snapshot") with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
os.system("echo ::set-output name=product-name::" + re.sub(r"[^A-Za-z0-9]+", "_", "${{ needs.get-info.outputs.app-name }}") + "_Snapshot") if "${{ env.BUILD_TYPE }}" == "dev":
f.write('bundle-id=org.f26_studio.' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '.snapshot\n')
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '_Snapshot\n')
else:
f.write('bundle-id=org.f26_studio.' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
- name: Download core love package - name: Download core love package
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
@@ -159,7 +186,7 @@ jobs:
mv ./ColdClear/arm64-v8a/libCCloader.so ./libAndroid/arm64-v8a/ mv ./ColdClear/arm64-v8a/libCCloader.so ./libAndroid/arm64-v8a/
- name: Build Android packages - name: Build Android packages
id: build-packages id: build-packages
uses: 26F-Studio/love-actions-android@v1 uses: love-actions/love-actions-android@v1
with: with:
app-name: ${{ needs.get-info.outputs.app-name }} app-name: ${{ needs.get-info.outputs.app-name }}
bundle-id: ${{ steps.process-app-name.outputs.bundle-id }} bundle-id: ${{ steps.process-app-name.outputs.bundle-id }}
@@ -176,7 +203,7 @@ jobs:
version-string: ${{ needs.get-info.outputs.version-string }} version-string: ${{ needs.get-info.outputs.version-string }}
version-code: ${{ needs.get-info.outputs.version-code }} version-code: ${{ needs.get-info.outputs.version-code }}
output-folder: ${{ env.OUTPUT_FOLDER }} output-folder: ${{ env.OUTPUT_FOLDER }}
- name: Upload release artifact - name: Upload artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: ${{ needs.get-info.outputs.base-name }}_Android_release name: ${{ needs.get-info.outputs.base-name }}_Android_release
@@ -185,31 +212,31 @@ jobs:
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }} if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
shell: bash shell: bash
run: | run: |
mkdir -p release mkdir -p ${{ env.RELEASE_FOLDER }}
mv ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}-release.apk release/${{ steps.process-app-name.outputs.product-name }}.apk cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}-release.apk ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Android.apk
- name: Upload release - name: Upload release
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }} if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
uses: softprops/action-gh-release@v1 uses: ncipollo/release-action@v1
with: with:
body: ${{ github.event.head_commit.message }} allowUpdates: true
files: release/${{ steps.process-app-name.outputs.product-name }}.apk artifacts: ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Android.apk
body: ${{ needs.get-info.outputs.update-note }}
name: ${{ needs.get-info.outputs.update-title }}
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }} prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}
- name: Upload to WeTransfer - name: Upload to WeTransfer
id: transfer id: transfer
run: | run: |
curl -sL https://git.io/file-transfer | sh curl -sL https://git.io/file-transfer | sh
./transfer wet -s -p 16 --no-progress ${{ steps.build-packages.outputs.package-paths }} 2>&1>./wetransfer.log ./transfer wet -s -p 16 --no-progress ${{ steps.build-packages.outputs.package-paths }} 2>&1>./wetransfer.log
echo "::set-output name=download-url::$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" echo "download-url=$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" >> $GITHUB_OUTPUT
- name: Show download link
shell: bash
run: |
echo "::notice title=Android packages::${{ steps.transfer.outputs.download-url }}"
build-ios: build-ios:
runs-on: macos-latest runs-on: macos-latest
if: github.event_name != 'pull_request'
needs: [get-info, build-core, auto-test] needs: [get-info, build-core, auto-test]
env: env:
OUTPUT_FOLDER: ./build OUTPUT_FOLDER: ./build
RELEASE_FOLDER: ./release
outputs: outputs:
download-url: ${{ steps.transfer.outputs.download-url }} download-url: ${{ steps.transfer.outputs.download-url }}
steps: steps:
@@ -222,8 +249,9 @@ jobs:
run: | run: |
import os import os
import re import re
os.system("echo ::set-output name=bundle-id::org.26f-studio.techmino") with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
os.system("echo ::set-output name=product-name::" + re.sub(r"[^A-Za-z0-9]+", "_", "${{ needs.get-info.outputs.app-name }}")) f.write('bundle-id=org.26f-studio.techmino\n')
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
- name: Download core love package - name: Download core love package
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
@@ -235,7 +263,7 @@ jobs:
dir: ./ColdClear dir: ./ColdClear
- name: Build iOS packages - name: Build iOS packages
id: build-packages id: build-packages
uses: 26F-Studio/love-actions-ios@v1 uses: love-actions/love-actions-ios@v1
with: with:
app-name: ${{ needs.get-info.outputs.app-name }} app-name: ${{ needs.get-info.outputs.app-name }}
bundle-id: ${{ steps.process-app-name.outputs.bundle-id }} bundle-id: ${{ steps.process-app-name.outputs.bundle-id }}
@@ -269,29 +297,34 @@ jobs:
with: with:
name: ${{ needs.get-info.outputs.base-name }}_iOS_ipa name: ${{ needs.get-info.outputs.base-name }}_iOS_ipa
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.ipa path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.ipa
- name: Prepare for release
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
shell: bash
run: |
mkdir -p ${{ env.RELEASE_FOLDER }}
cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.ipa ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_iOS.ipa
- name: Upload release - name: Upload release
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }} if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
uses: softprops/action-gh-release@v1 uses: ncipollo/release-action@v1
with: with:
body: ${{ github.event.head_commit.message }} allowUpdates: true
files: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.ipa artifacts: ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_iOS.ipa
body: ${{ needs.get-info.outputs.update-note }}
name: ${{ needs.get-info.outputs.update-title }}
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }} prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}
- name: Upload to WeTransfer - name: Upload to WeTransfer
id: transfer id: transfer
run: | run: |
wget -qO- https://github.com/Mikubill/transfer/releases/download/v0.4.17/transfer_0.4.17_darwin_amd64.tar.gz | tar xvz wget -qO- https://github.com/Mikubill/transfer/releases/download/v0.4.17/transfer_0.4.17_darwin_amd64.tar.gz | tar xvz
./transfer wet -s -p 16 --no-progress ${{ steps.build-packages.outputs.package-paths }} 2>&1>./wetransfer.log ./transfer wet -s -p 16 --no-progress ${{ steps.build-packages.outputs.package-paths }} 2>&1>./wetransfer.log
echo "::set-output name=download-url::$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" echo "download-url=$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" >> $GITHUB_OUTPUT
- name: Show download link
shell: bash
run: |
echo "::notice title=iOS packages::${{ steps.transfer.outputs.download-url }}"
build-linux: build-linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [get-info, build-core, auto-test] needs: [get-info, build-core, auto-test]
env: env:
OUTPUT_FOLDER: ./build OUTPUT_FOLDER: ./build
RELEASE_FOLDER: ./release
outputs: outputs:
download-url: ${{ steps.transfer.outputs.download-url }} download-url: ${{ steps.transfer.outputs.download-url }}
steps: steps:
@@ -304,7 +337,8 @@ jobs:
run: | run: |
import os import os
import re import re
os.system("echo ::set-output name=product-name::" + re.sub(r"[^A-Za-z0-9]+", "_", "${{ needs.get-info.outputs.app-name }}")) with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
- name: Download core love package - name: Download core love package
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
@@ -324,7 +358,7 @@ jobs:
mv ./x64/CCloader.so ./shared mv ./x64/CCloader.so ./shared
- name: Build Linux packages - name: Build Linux packages
id: build-packages id: build-packages
uses: 26F-Studio/love-actions-linux@v1 uses: love-actions/love-actions-linux@v1
with: with:
desktop-file-path: ./.github/build/linux/${{ env.BUILD_TYPE }}/template.desktop desktop-file-path: ./.github/build/linux/${{ env.BUILD_TYPE }}/template.desktop
executable-name: app executable-name: app
@@ -339,29 +373,35 @@ jobs:
with: with:
name: ${{ needs.get-info.outputs.base-name }}_Linux_AppImage name: ${{ needs.get-info.outputs.base-name }}_Linux_AppImage
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.AppImage path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.AppImage
- name: Prepare for release
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
shell: bash
run: |
mkdir -p ${{ env.RELEASE_FOLDER }}
cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.AppImage ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Linux.AppImage
- name: Upload release - name: Upload release
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }} if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
uses: softprops/action-gh-release@v1 uses: ncipollo/release-action@v1
with: with:
body: ${{ github.event.head_commit.message }} allowUpdates: true
files: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.AppImage artifacts: ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Linux.AppImage
body: ${{ needs.get-info.outputs.update-note }}
name: ${{ needs.get-info.outputs.update-title }}
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }} prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}
- name: Upload to WeTransfer - name: Upload to WeTransfer
id: transfer id: transfer
run: | run: |
curl -sL https://git.io/file-transfer | sh curl -sL https://git.io/file-transfer | sh
./transfer wet -s -p 16 --no-progress ${{ steps.build-packages.outputs.package-paths }} 2>&1>./wetransfer.log ./transfer wet -s -p 16 --no-progress ${{ steps.build-packages.outputs.package-paths }} 2>&1>./wetransfer.log
echo "::set-output name=download-url::$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" echo "download-url=$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" >> $GITHUB_OUTPUT
- name: Show download link
shell: bash
run: |
echo "::notice title=Linux packages::${{ steps.transfer.outputs.download-url }}"
build-macos-appstore: build-macos-appstore:
runs-on: macos-latest runs-on: macos-latest
if: github.event_name != 'pull_request'
needs: [get-info, build-core, auto-test] needs: [get-info, build-core, auto-test]
env: env:
OUTPUT_FOLDER: ./build OUTPUT_FOLDER: ./build
RELEASE_FOLDER: ./release
outputs: outputs:
download-url: ${{ steps.transfer.outputs.download-url }} download-url: ${{ steps.transfer.outputs.download-url }}
steps: steps:
@@ -374,8 +414,9 @@ jobs:
run: | run: |
import os import os
import re import re
os.system("echo ::set-output name=bundle-id::org.26f-studio.techmino") with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
os.system("echo ::set-output name=product-name::" + re.sub(r"[^A-Za-z0-9]+", "_", "${{ needs.get-info.outputs.app-name }}")) f.write('bundle-id=org.26f-studio.techmino\n')
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
- name: Download core love package - name: Download core love package
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
@@ -391,7 +432,7 @@ jobs:
rm ./ColdClear/universal/libcold_clear.a rm ./ColdClear/universal/libcold_clear.a
- name: Build macOS packages - name: Build macOS packages
id: build-packages id: build-packages
uses: 26F-Studio/love-actions-macos-appstore@v1 uses: love-actions/love-actions-macos-appstore@v1
with: with:
app-name: ${{ needs.get-info.outputs.app-name }} app-name: ${{ needs.get-info.outputs.app-name }}
bundle-id: ${{ steps.process-app-name.outputs.bundle-id }} bundle-id: ${{ steps.process-app-name.outputs.bundle-id }}
@@ -424,29 +465,35 @@ jobs:
with: with:
name: ${{ needs.get-info.outputs.base-name }}_macOS_appstore_pkg name: ${{ needs.get-info.outputs.base-name }}_macOS_appstore_pkg
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.pkg path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.pkg
- name: Prepare for release
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
shell: bash
run: |
mkdir -p ${{ env.RELEASE_FOLDER }}
cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.pkg ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_macOS_appstore.pkg
- name: Upload release - name: Upload release
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }} if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
uses: softprops/action-gh-release@v1 uses: ncipollo/release-action@v1
with: with:
body: ${{ github.event.head_commit.message }} allowUpdates: true
files: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.pkg artifacts: ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_macOS_appstore.pkg
body: ${{ needs.get-info.outputs.update-note }}
name: ${{ needs.get-info.outputs.update-title }}
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }} prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}
- name: Upload to WeTransfer - name: Upload to WeTransfer
id: transfer id: transfer
run: | run: |
wget -qO- https://github.com/Mikubill/transfer/releases/download/v0.4.17/transfer_0.4.17_darwin_amd64.tar.gz | tar xvz wget -qO- https://github.com/Mikubill/transfer/releases/download/v0.4.17/transfer_0.4.17_darwin_amd64.tar.gz | tar xvz
./transfer wet -s -p 16 --no-progress ${{ steps.build-packages.outputs.package-paths }} 2>&1>./wetransfer.log ./transfer wet -s -p 16 --no-progress ${{ steps.build-packages.outputs.package-paths }} 2>&1>./wetransfer.log
echo "::set-output name=download-url::$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" echo "download-url=$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" >> $GITHUB_OUTPUT
- name: Show download link
shell: bash
run: |
echo "::notice title=macOS App Store packages::${{ steps.transfer.outputs.download-url }}"
build-macos-portable: build-macos-portable:
runs-on: macos-latest runs-on: macos-latest
if: github.event_name != 'pull_request'
needs: [get-info, build-core, auto-test] needs: [get-info, build-core, auto-test]
env: env:
OUTPUT_FOLDER: ./build OUTPUT_FOLDER: ./build
RELEASE_FOLDER: ./release
outputs: outputs:
download-url: ${{ steps.transfer.outputs.download-url }} download-url: ${{ steps.transfer.outputs.download-url }}
steps: steps:
@@ -459,8 +506,9 @@ jobs:
run: | run: |
import os import os
import re import re
os.system("echo ::set-output name=bundle-id::org.26f-studio.techmino") with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
os.system("echo ::set-output name=product-name::" + re.sub(r"[^A-Za-z0-9]+", "_", "${{ needs.get-info.outputs.app-name }}")) f.write('bundle-id=org.26f-studio.techmino\n')
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
- name: Download core love package - name: Download core love package
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
@@ -476,7 +524,7 @@ jobs:
rm ./ColdClear/universal/libcold_clear.a rm ./ColdClear/universal/libcold_clear.a
- name: Build macOS packages - name: Build macOS packages
id: build-packages id: build-packages
uses: 26F-Studio/love-actions-macos-portable@v1 uses: love-actions/love-actions-macos-portable@v1
with: with:
app-name: ${{ needs.get-info.outputs.app-name }} app-name: ${{ needs.get-info.outputs.app-name }}
bundle-id: ${{ steps.process-app-name.outputs.bundle-id }} bundle-id: ${{ steps.process-app-name.outputs.bundle-id }}
@@ -518,31 +566,35 @@ jobs:
with: with:
name: ${{ needs.get-info.outputs.base-name }}_macOS_portable_bare name: ${{ needs.get-info.outputs.base-name }}_macOS_portable_bare
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.zip path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.zip
- name: Prepare for release
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
shell: bash
run: |
mkdir -p ${{ env.RELEASE_FOLDER }}
cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.pkg ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_macOS_portable.pkg
cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.dmg ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_macOS_portable.dmg
- name: Upload release - name: Upload release
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }} if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
uses: softprops/action-gh-release@v1 uses: ncipollo/release-action@v1
with: with:
body: ${{ github.event.head_commit.message }} allowUpdates: true
files: | artifacts: ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_macOS_portable.pkg, ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_macOS_portable.dmg
${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.pkg body: ${{ needs.get-info.outputs.update-note }}
${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.dmg name: ${{ needs.get-info.outputs.update-title }}
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }} prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}
- name: Upload to WeTransfer - name: Upload to WeTransfer
id: transfer id: transfer
run: | run: |
wget -qO- https://github.com/Mikubill/transfer/releases/download/v0.4.17/transfer_0.4.17_darwin_amd64.tar.gz | tar xvz wget -qO- https://github.com/Mikubill/transfer/releases/download/v0.4.17/transfer_0.4.17_darwin_amd64.tar.gz | tar xvz
./transfer wet -s -p 16 --no-progress ${{ steps.build-packages.outputs.package-paths }} 2>&1>./wetransfer.log ./transfer wet -s -p 16 --no-progress ${{ steps.build-packages.outputs.package-paths }} 2>&1>./wetransfer.log
echo "::set-output name=download-url::$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" echo "download-url=$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" >> $GITHUB_OUTPUT
- name: Show download link
shell: bash
run: |
echo "::notice title=macOS portable packages::${{ steps.transfer.outputs.download-url }}"
build-windows: build-windows:
runs-on: windows-latest runs-on: windows-latest
needs: [get-info, build-core, auto-test] needs: [get-info, build-core, auto-test]
env: env:
OUTPUT_FOLDER: ./build OUTPUT_FOLDER: ./build
RELEASE_FOLDER: ./release
outputs: outputs:
download-url: ${{ steps.transfer.outputs.download-url }} download-url: ${{ steps.transfer.outputs.download-url }}
steps: steps:
@@ -555,7 +607,8 @@ jobs:
run: | run: |
import os import os
import re import re
os.system("echo ::set-output name=product-name::" + re.sub(r"[^A-Za-z0-9]+", "_", "${{ needs.get-info.outputs.app-name }}")) with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
- name: Download core love package - name: Download core love package
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
@@ -567,7 +620,7 @@ jobs:
dir: ./ColdClear dir: ./ColdClear
- name: Build Windows packages - name: Build Windows packages
id: build-packages id: build-packages
uses: 26F-Studio/love-actions-windows@v1 uses: love-actions/love-actions-windows@v1
with: with:
icon-path: ./.github/build/windows/${{ env.BUILD_TYPE }}/icon.ico icon-path: ./.github/build/windows/${{ env.BUILD_TYPE }}/icon.ico
rc-path: ./.github/build/windows/${{ env.BUILD_TYPE }}/template.rc rc-path: ./.github/build/windows/${{ env.BUILD_TYPE }}/template.rc
@@ -587,14 +640,21 @@ jobs:
with: with:
name: ${{ needs.get-info.outputs.base-name }}_Windows_x64 name: ${{ needs.get-info.outputs.base-name }}_Windows_x64
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_x64.zip path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_x64.zip
- name: Prepare for release
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
shell: bash
run: |
mkdir -p ${{ env.RELEASE_FOLDER }}
cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_x86.zip ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Windows_x86.zip
cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_x64.zip ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Windows_x64.zip
- name: Upload release - name: Upload release
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }} if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
uses: softprops/action-gh-release@v1 uses: ncipollo/release-action@v1
with: with:
body: ${{ github.event.head_commit.message }} allowUpdates: true
files: | artifacts: ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Windows_x86.zip, ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Windows_x64.zip
${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_x86.zip body: ${{ needs.get-info.outputs.update-note }}
${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_x64.zip name: ${{ needs.get-info.outputs.update-title }}
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }} prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}
- name: Get transfer - name: Get transfer
env: env:
@@ -606,13 +666,10 @@ jobs:
rm ${{ env.TEMP_PATH }} rm ${{ env.TEMP_PATH }}
- name: Upload to WeTransfer - name: Upload to WeTransfer
id: transfer id: transfer
shell: pwsh
run: | run: |
./transfer wet -s -p 16 --no-progress ${{ steps.build-packages.outputs.package-paths }} 2>&1>./wetransfer.log ./transfer.exe wet -s -p 16 --no-progress ${{ steps.build-packages.outputs.package-paths }} 2>&1>./wetransfer.log
echo "::set-output name=download-url::$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" "download-url=$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" >> $env:GITHUB_OUTPUT
- name: Show download link
shell: bash
run: |
echo "::notice title=Windows packages::${{ steps.transfer.outputs.download-url }}"
post-build: post-build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -634,11 +691,37 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cleanup - name: Cleanup
uses: geekyeggo/delete-artifact@v1 uses: geekyeggo/delete-artifact@v2
with: with:
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }} name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
- name: Display summary
shell: bash
run: |
echo "# Summary" >> $GITHUB_STEP_SUMMARY
echo "## Version: ${{ needs.get-info.outputs.version-string }}" >> $GITHUB_STEP_SUMMARY
echo "## Package Name: ${{ needs.get-info.outputs.base-name }}" >> $GITHUB_STEP_SUMMARY
echo "## Download links: " >> $GITHUB_STEP_SUMMARY
- name: Display download links
shell: python3 {0}
run: |
import os
with open(os.getenv('GITHUB_STEP_SUMMARY'), 'a') as f:
if "${{ needs.build-core.result }}" == "success":
f.write("- Bare love packages: [WeTransfer](${{ needs.build-core.outputs.download-url }})\n")
if "${{ needs.build-android.result }}" == "success":
f.write("- Android packages: [WeTransfer](${{ needs.build-android.outputs.download-url }})\n")
if "${{ needs.build-ios.result }}" == "success":
f.write("- iOS packages: [WeTransfer](${{ needs.build-ios.outputs.download-url }})\n")
if "${{ needs.build-linux.result }}" == "success":
f.write("- Linux packages: [WeTransfer](${{ needs.build-linux.outputs.download-url }})\n")
if "${{ needs.build-macos-appstore.result }}" == "success":
f.write("- macOS packages(App Store version): [WeTransfer](${{ needs.build-macos-appstore.outputs.download-url }})\n")
if "${{ needs.build-macos-portable.result }}" == "success":
f.write("- macOS packages(Portable version): [WeTransfer](${{ needs.build-macos-portable.outputs.download-url }})\n")
if "${{ needs.build-windows.result }}" == "success":
f.write("- Windows packages: [WeTransfer](${{ needs.build-windows.outputs.download-url }})\n")
- name: Send Discord message - name: Send Discord message
uses: Sniddl/discord-commits@v1.3 uses: Sniddl/discord-commits@v1.5
with: with:
webhook: ${{ secrets.DISCORD_WEBHOOK }} webhook: ${{ secrets.DISCORD_WEBHOOK }}
message: "Github Actions for **${{ github.repository }}**." message: "Github Actions for **${{ github.repository }}**."

View File

@@ -1,9 +1,9 @@
function love.conf(t) function love.conf(t)
t.identity='Techmino'--Saving folder t.identity='Techmino'-- Saving folder
t.version="11.1" t.version="11.1"
t.gammacorrect=false t.gammacorrect=false
t.appendidentity=true--Search files in source then in save directory t.appendidentity=true-- Search files in source then in save directory
t.accelerometerjoystick=false--Accelerometer=joystick on ios/android t.accelerometerjoystick=false-- Accelerometer=joystick on ios/android
if t.audio then if t.audio then
t.audio.mic=false t.audio.mic=false
t.audio.mixwithsystem=true t.audio.mixwithsystem=true
@@ -16,12 +16,12 @@ function love.conf(t)
W.borderless=false W.borderless=false
W.resizable=true W.resizable=true
W.fullscreen=false W.fullscreen=false
W.vsync=0--Unlimited FPS W.vsync=0-- Unlimited FPS
W.msaa=0--Multi-sampled antialiasing W.msaa=0-- Multi-sampled antialiasing
W.depth=0--Bits/samp of depth buffer W.depth=0-- Bits/samp of depth buffer
W.stencil=1--Bits/samp of stencil buffer W.stencil=1-- Bits/samp of stencil buffer
W.display=1--Monitor ID W.display=1-- Monitor ID
W.highdpi=true--High-dpi mode for the window on a Retina display W.highdpi=true-- High-dpi mode for the window on a Retina display
W.x,W.y=nil W.x,W.y=nil
local M=t.modules local M=t.modules

230
main.lua
View File

@@ -15,26 +15,24 @@
]]-- ]]--
--Var leak check -- Var leak check
-- setmetatable(_G,{__newindex=function(self,k,v)print('>>'..k)print(debug.traceback():match("\n.-\n\t(.-): "))rawset(self,k,v)end}) -- setmetatable(_G,{__newindex=function(self,k,v) print('>>'..k..string.rep(" ",26-#k),debug.traceback():match("\n.-\n\t(.-): "))rawset(self,k,v) end})
--System Global Vars Declaration -- System Global Vars Declaration
local fs=love.filesystem local fs=love.filesystem
VERSION=require"version" VERSION=require"version"
TIME=love.timer.getTime TIME=love.timer.getTime
YIELD=coroutine.yield SYSTEM=love.system.getOS() if SYSTEM=='OS X' then SYSTEM='macOS' end
SYSTEM=love.system.getOS()if SYSTEM=='OS X'then SYSTEM='macOS'end FNNS=SYSTEM:find'\79\83'-- What does FNSF stand for? IDK so don't ask me lol
FNNS=SYSTEM:find'\79\83'--What does FNSF stand for? IDK so don't ask me lol MOBILE=SYSTEM=='Android' or SYSTEM=='iOS'
MOBILE=SYSTEM=='Android'or SYSTEM=='iOS'
SAVEDIR=fs.getSaveDirectory()
--Global Vars & Settings -- Global Vars & Settings
SFXPACKS={'chiptune'} SFXPACKS={'chiptune'}
VOCPACKS={'miya','mono','xiaoya','miku','rin'} VOCPACKS={'miya','mono','xiaoya','miku'}
FIRSTLAUNCH=false FIRSTLAUNCH=false
DAILYLAUNCH=false DAILYLAUNCH=false
--System setting -- System setting
math.randomseed(os.time()*626) math.randomseed(os.time()*626)
love.setDeprecationOutput(false) love.setDeprecationOutput(false)
love.keyboard.setKeyRepeat(true) love.keyboard.setKeyRepeat(true)
@@ -48,7 +46,7 @@ end
local _LOADTIMELIST_={} local _LOADTIMELIST_={}
local _LOADTIME_=TIME() local _LOADTIME_=TIME()
--Load modules -- Load modules
Z=require'Zframework' Z=require'Zframework'
FONT.load{ FONT.load{
norm='parts/fonts/proportional.otf', norm='parts/fonts/proportional.otf',
@@ -57,19 +55,18 @@ FONT.load{
FONT.setDefault('norm') FONT.setDefault('norm')
FONT.setFallback('norm') FONT.setFallback('norm')
SCR.setSize(1280,720)--Initialize Screen size SCR.setSize(1280,720)-- Initialize Screen size
BGM.setMaxSources(5) BGM.setMaxSources(5)
BGM.setChange(function(name)MES.new('music',text.nowPlaying..name,5)end)
VOC.setDiversion(.62) VOC.setDiversion(.62)
WIDGET.setOnChange(function() WIDGET.setOnChange(function()
if SCN.cur~='custom_field'then if SCN.cur~='net_game' and SCN.cur~='custom_field' then
local colorList=THEME.getThemeColor() local colorList=THEME.getThemeColor()
if not colorList then return end if colorList then
local rnd=math.random for _,W in next,SCN.scenes[SCN.cur].widgetList do
for _,W in next,SCN.scenes[SCN.cur].widgetList do if W.color then
if W.color then W.color=colorList[math.random(#colorList)]
W.color=colorList[rnd(#colorList)] end
end end
end end
end end
@@ -77,7 +74,7 @@ end)
table.insert(_LOADTIMELIST_,("Load Zframework: %.3fs"):format(TIME()-_LOADTIME_)) table.insert(_LOADTIMELIST_,("Load Zframework: %.3fs"):format(TIME()-_LOADTIME_))
--Create shortcuts -- Create shortcuts
setFont=FONT.set setFont=FONT.set
getFont=FONT.get getFont=FONT.get
mText=GC.simpX mText=GC.simpX
@@ -87,15 +84,15 @@ string.repD=STRING.repD
string.sArg=STRING.sArg string.sArg=STRING.sArg
string.split=STRING.split string.split=STRING.split
--Delete all naked files (from ancient versions) -- Delete all naked files (from ancient versions)
FILE.clear('') FILE.clear('')
--Create directories -- Create directories
for _,v in next,{'conf','record','replay','cache','lib'}do for _,v in next,{'conf','record','replay','cache','lib'} do
local info=fs.getInfo(v) local info=fs.getInfo(v)
if not info then if not info then
fs.createDirectory(v) fs.createDirectory(v)
elseif info.type~='directory'then elseif info.type~='directory' then
fs.remove(v) fs.remove(v)
fs.createDirectory(v) fs.createDirectory(v)
end end
@@ -105,10 +102,10 @@ CHAR=require'parts.char'
require'parts.gameTables' require'parts.gameTables'
require'parts.gameFuncs' require'parts.gameFuncs'
--Load shader files from SOURCE ONLY -- Load shader files from SOURCE ONLY
SHADER={} SHADER={}
for _,v in next,fs.getDirectoryItems('parts/shaders')do for _,v in next,fs.getDirectoryItems('parts/shaders') do
if isSafeFile('parts/shaders/'..v)then if FILE.isSafe('parts/shaders/'..v) then
local name=v:sub(1,-6) local name=v:sub(1,-6)
SHADER[name]=love.graphics.newShader('parts/shaders/'..name..'.glsl') SHADER[name]=love.graphics.newShader('parts/shaders/'..name..'.glsl')
end end
@@ -137,8 +134,8 @@ end})
table.insert(_LOADTIMELIST_,("Load Parts: %.3fs"):format(TIME()-_LOADTIME_)) table.insert(_LOADTIMELIST_,("Load Parts: %.3fs"):format(TIME()-_LOADTIME_))
--Init Zframework -- Init Zframework
do--Z.setCursor do-- Z.setCursor
local normImg=GC.DO{16,16, local normImg=GC.DO{16,16,
{'fCirc',8,8,4}, {'fCirc',8,8,4},
{'setCL',1,1,1,.7}, {'setCL',1,1,1,.7},
@@ -149,6 +146,7 @@ do--Z.setCursor
{'dCirc',8,8,7}, {'dCirc',8,8,7},
{'fCirc',8,8,3}, {'fCirc',8,8,3},
} }
local _
Z.setCursor(function(time,x,y) Z.setCursor(function(time,x,y)
if not SETTING.sysCursor then if not SETTING.sysCursor then
local R=math.floor((time+1)/2)%7+1 local R=math.floor((time+1)/2)%7+1
@@ -157,14 +155,14 @@ do--Z.setCursor
_=DSCP[R][0] _=DSCP[R][0]
GC.draw(TEXTURE.miniBlock[R],x,y,time%math.pi*4,8,8,2*_[2]+1,2*(#BLOCKS[R][0]-_[1])-1) GC.draw(TEXTURE.miniBlock[R],x,y,time%math.pi*4,8,8,2*_[2]+1,2*(#BLOCKS[R][0]-_[1])-1)
GC.setColor(1,1,1) GC.setColor(1,1,1)
GC.draw(love.mouse.isDown(1)and holdImg or normImg,x,y,nil,nil,nil,8,8) GC.draw(love.mouse.isDown(1) and holdImg or normImg,x,y,nil,nil,nil,8,8)
end end
end) end)
end end
Z.setOnFnKeys({ Z.setOnFnKeys({
function()MES.new('check',PROFILE.switch()and"profile start!"or"profile report copied!")end, function() MES.new('check',PROFILE.switch() and "profile start!" or "profile report copied!") end,
function()MES.new('info',("System:%s[%s]\nluaVer:%s\njitVer:%s\njitVerNum:%s"):format(SYSTEM,jit.arch,_VERSION,jit.version,jit.version_num))end, function() MES.new('info',("System:%s[%s]\nluaVer:%s\njitVer:%s\njitVerNum:%s"):format(SYSTEM,jit.arch,_VERSION,jit.version,jit.version_num)) end,
function()MES.new('error',"挂了")end, function() MES.new('error',"挂了") end,
function() function()
if GAME.playing and not GAME.net then if GAME.playing and not GAME.net then
for _=1,8 do for _=1,8 do
@@ -176,17 +174,23 @@ Z.setOnFnKeys({
end end
end end
end, end,
function()print(BG.locked)end, function() print(BG.locked) end,
function()for k,v in next,_G do print(k,v)end end, function() for k,v in next,_G do print(k,v) end end,
function()if love['_openConsole']then love['_openConsole']()end end, function() if love['_openConsole'] then love['_openConsole']() end end,
}) })
Z.setOnGlobalKey('f11',function()
SETTING.fullscreen=not SETTING.fullscreen
applySettings()
saveSettings()
end)
Z.setVersionText(VERSION.string)
Z.setDebugInfo{ Z.setDebugInfo{
{"Cache",gcinfo}, {"Cache",gcinfo},
{"Tasks",TASK.getCount}, {"Tasks",TASK.getCount},
{"Voices",VOC.getQueueCount}, {"Voices",VOC.getQueueCount},
{"Audios",love.audio.getSourceCount}, {"Audios",love.audio.getSourceCount},
} }
do--Z.setOnFocus do-- Z.setOnFocus
local function task_autoSoundOff() local function task_autoSoundOff()
while true do while true do
coroutine.yield() coroutine.yield()
@@ -214,7 +218,7 @@ do--Z.setOnFocus
TASK.new(task_autoSoundOn) TASK.new(task_autoSoundOn)
end end
else else
if SCN.cur=='game'and SETTING.autoPause then if SCN.cur=='game' and SETTING.autoPause then
pauseGame() pauseGame()
end end
if SETTING.autoMute and SCN.cur~='music' then if SETTING.autoMute and SCN.cur~='music' then
@@ -224,23 +228,32 @@ do--Z.setOnFocus
end end
end) end)
end end
Z.setOnQuit(destroyPlayers) Z.setOnBeforeQuit(function()
NET.ws_close()
TASK.new(function()
TEST.yieldT(.26)
love.event.quit()
end)
end)
Z.setOnQuit(function()
destroyPlayers()
end)
--Load settings and statistics -- Load settings and statistics
if if
not( not (
pcall(TABLE.cover, loadFile('conf/user', '-json -canSkip')or loadFile('conf/user', '-luaon -canSkip')or{},USER) and pcall(TABLE.cover, loadFile('conf/user', '-json -canSkip') or loadFile('conf/user', '-luaon -canSkip') or{},USER) and
pcall(TABLE.cover, loadFile('conf/unlock', '-json -canSkip')or loadFile('conf/unlock', '-luaon -canSkip')or{},RANKS) and pcall(TABLE.cover, loadFile('conf/unlock', '-json -canSkip') or loadFile('conf/unlock', '-luaon -canSkip') or{},RANKS) and
pcall(TABLE.update,loadFile('conf/settings', '-json -canSkip')or loadFile('conf/settings', '-luaon -canSkip')or{},SETTING) and pcall(TABLE.update,loadFile('conf/settings', '-json -canSkip') or loadFile('conf/settings', '-luaon -canSkip') or{},SETTING) and
pcall(TABLE.coverR,loadFile('conf/data', '-json -canSkip')or loadFile('conf/data', '-luaon -canSkip')or{},STAT) and pcall(TABLE.coverR,loadFile('conf/data', '-json -canSkip') or loadFile('conf/data', '-luaon -canSkip') or{},STAT) and
pcall(TABLE.cover, loadFile('conf/key', '-json -canSkip')or loadFile('conf/key', '-luaon -canSkip')or{},KEY_MAP) and pcall(TABLE.cover, loadFile('conf/key', '-json -canSkip') or loadFile('conf/key', '-luaon -canSkip') or{},KEY_MAP) and
pcall(TABLE.cover, loadFile('conf/virtualkey','-json -canSkip')or loadFile('conf/virtualkey','-luaon -canSkip')or{},VK_ORG) pcall(TABLE.cover, loadFile('conf/virtualkey','-json -canSkip') or loadFile('conf/virtualkey','-luaon -canSkip') or{},VK_ORG)
) )
then then
MES.new('error',"An error occured during loading, and some data was lost.") MES.new('error',"An error occured during loading, and some data was lost.")
end end
--Initialize fields, sequence, missions, gameEnv for cutsom game -- Initialize fields, sequence, missions, gameEnv for cutsom game
local fieldData=loadFile('conf/customBoards','-string -canSkip') local fieldData=loadFile('conf/customBoards','-string -canSkip')
if fieldData then if fieldData then
fieldData=STRING.split(fieldData,"!") fieldData=STRING.split(fieldData,"!")
@@ -265,7 +278,7 @@ end
TABLE.complete(require"parts.customEnv0",CUSTOMENV) TABLE.complete(require"parts.customEnv0",CUSTOMENV)
--Initialize image libs -- Initialize image libs
IMG.init{ IMG.init{
lock='media/image/mess/lock.png', lock='media/image/mess/lock.png',
dialCircle='media/image/mess/dialCircle.png', dialCircle='media/image/mess/dialCircle.png',
@@ -344,20 +357,20 @@ SKIN.load{
{name="wtf",path='media/image/skin/wtf_mrz.png'}, {name="wtf",path='media/image/skin/wtf_mrz.png'},
} }
--Initialize sound libs -- Initialize sound libs
SFX.init((function()--[Warning] Not loading files here, just get the list of sound needed SFX.init((function()--[Warning] Not loading files here, just get the list of sound needed
local L={} local L={}
for _,v in next,fs.getDirectoryItems('media/effect/chiptune/')do for _,v in next,fs.getDirectoryItems('media/effect/chiptune/') do
if isSafeFile('media/effect/chiptune/'..v,"Dangerous file : %SAVE%/media/effect/chiptune/"..v)then if FILE.isSafe('media/effect/chiptune/'..v,"Dangerous file : %SAVE%/media/effect/chiptune/"..v) then
table.insert(L,v:sub(1,-5)) table.insert(L,v:sub(1,-5))
end end
end end
return L return L
end)()) end)())
BGM.load((function() BGM.init((function()
local L={} local L={}
for _,v in next,fs.getDirectoryItems('media/music')do for _,v in next,fs.getDirectoryItems('media/music') do
if isSafeFile('media/music/'..v,"Dangerous file : %SAVE%/media/music/"..v)then if FILE.isSafe('media/music/'..v,"Dangerous file : %SAVE%/media/music/"..v) then
L[v:sub(1,-5)]='media/music/'..v L[v:sub(1,-5)]='media/music/'..v
end end
end end
@@ -373,7 +386,7 @@ VOC.init{
'welcome', 'welcome',
} }
--Initialize language lib -- Initialize language lib
LANG.init('zh', LANG.init('zh',
{ {
zh=require'parts.language.lang_zh', zh=require'parts.language.lang_zh',
@@ -386,17 +399,17 @@ LANG.init('zh',
ja=require'parts.language.lang_ja', ja=require'parts.language.lang_ja',
symbol=require'parts.language.lang_symbol', symbol=require'parts.language.lang_symbol',
zh_code=require'parts.language.lang_zh_code', zh_code=require'parts.language.lang_zh_code',
--1. Add language file to LANG folder; -- 1. Add language file to LANG folder;
--2. Require it; -- 2. Require it;
--3. Add a button in parts/scenes/lang.lua; -- 3. Add a button in parts/scenes/lang.lua;
}, },
{ {
block=BLOCK_NAMES block=BLOCK_NAMES
}, },
(function() (function()
local tipMeta={__call=function(L)return L[math.random(#L)]end} local tipMeta={__call=function(L) return L[math.random(#L)] end}
return function(L) return function(L)
if type(rawget(L,'getTip'))=='table'then setmetatable(L.getTip,tipMeta)end if type(rawget(L,'getTip'))=='table' then setmetatable(L.getTip,tipMeta) end
setmetatable(L,{__index=function(self,k) setmetatable(L,{__index=function(self,k)
local mes="No Text ("..SETTING.locale.."): "..k local mes="No Text ("..SETTING.locale.."): "..k
LOG(mes) LOG(mes)
@@ -410,32 +423,32 @@ LANG.init('zh',
table.insert(_LOADTIMELIST_,("Initialize Parts: %.3fs"):format(TIME()-_LOADTIME_)) table.insert(_LOADTIMELIST_,("Initialize Parts: %.3fs"):format(TIME()-_LOADTIME_))
--Load background files from SOURCE ONLY -- Load background files from SOURCE ONLY
for _,v in next,fs.getDirectoryItems('parts/backgrounds')do for _,v in next,fs.getDirectoryItems('parts/backgrounds') do
if isSafeFile('parts/backgrounds/'..v)and v:sub(-3)=='lua'then if FILE.isSafe('parts/backgrounds/'..v) and v:sub(-3)=='lua' then
local name=v:sub(1,-5) local name=v:sub(1,-5)
BG.add(name,require('parts.backgrounds.'..name)) BG.add(name,require('parts.backgrounds.'..name))
end end
end end
BG.remList('none')BG.remList('gray')BG.remList('custom') BG.remList('none')BG.remList('gray')BG.remList('custom')
--Load scene files from SOURCE ONLY -- Load scene files from SOURCE ONLY
for _,v in next,fs.getDirectoryItems('parts/scenes')do for _,v in next,fs.getDirectoryItems('parts/scenes') do
if isSafeFile('parts/scenes/'..v)then if FILE.isSafe('parts/scenes/'..v) then
local sceneName=v:sub(1,-5) local sceneName=v:sub(1,-5)
SCN.add(sceneName,require('parts.scenes.'..sceneName)) SCN.add(sceneName,require('parts.scenes.'..sceneName))
LANG.addScene(sceneName) LANG.addScene(sceneName)
end end
end end
--Load mode files -- Load mode files
for i=1,#MODES do for i=1,#MODES do
local m=MODES[i]--Mode template local m=MODES[i]-- Mode template
if isSafeFile('parts/modes/'..m.name)then if FILE.isSafe('parts/modes/'..m.name) then
TABLE.complete(require('parts.modes.'..m.name),MODES[i]) TABLE.complete(require('parts.modes.'..m.name),MODES[i])
MODES[m.name],MODES[i]=MODES[i] MODES[m.name],MODES[i]=MODES[i]
end end
end end
for _,v in next,fs.getDirectoryItems('parts/modes')do for _,v in next,fs.getDirectoryItems('parts/modes') do
if isSafeFile('parts/modes/'..v)and not MODES[v:sub(1,-5)]then if FILE.isSafe('parts/modes/'..v) and not MODES[v:sub(1,-5)] then
local M={name=v:sub(1,-5)} local M={name=v:sub(1,-5)}
local modeData=require('parts.modes.'..M.name) local modeData=require('parts.modes.'..M.name)
if modeData.env then if modeData.env then
@@ -447,14 +460,14 @@ end
table.insert(_LOADTIMELIST_,("Load Files: %.3fs"):format(TIME()-_LOADTIME_)) table.insert(_LOADTIMELIST_,("Load Files: %.3fs"):format(TIME()-_LOADTIME_))
--Update data -- Update data
do do
local needSave local needSave
if not fs.getInfo('conf/data')then if not fs.getInfo('conf/data') then
needSave=true needSave=true
end end
if type(STAT.version)~='number'then if type(STAT.version)~='number' then
STAT.version=0 STAT.version=0
needSave=true needSave=true
end end
@@ -467,10 +480,10 @@ do
end end
if STAT.version==1506 then if STAT.version==1506 then
local temp1,temp2 local temp1,temp2
if fs.getInfo('record/master_l.rec')then if fs.getInfo('record/master_l.rec') then
temp1=fs.read('record/master_l.rec') temp1=fs.read('record/master_l.rec')
end end
if fs.getInfo('record/master_u.rec')then if fs.getInfo('record/master_u.rec') then
temp2=fs.read('record/master_u.rec') temp2=fs.read('record/master_u.rec')
end end
if temp1 then if temp1 then
@@ -530,16 +543,16 @@ do
end end
if STAT.version~=VERSION.code then if STAT.version~=VERSION.code then
for k,v in next,MODE_UPDATE_MAP do for k,v in next,MODE_UPDATE_MAP do
if RANKS[k]then if RANKS[k] then
RANKS[v]=RANKS[k] RANKS[v]=RANKS[k]
RANKS[k]=nil RANKS[k]=nil
end end
k='record/'..k k='record/'..k
if fs.getInfo(k..'.dat')then if fs.getInfo(k..'.dat') then
fs.write('record/'..v..'.rec',fs.read(k..'.dat')) fs.write('record/'..v..'.rec',fs.read(k..'.dat'))
fs.remove(k..'.dat') fs.remove(k..'.dat')
end end
if fs.getInfo(k..'.rec')then if fs.getInfo(k..'.rec') then
fs.write('record/'..v..'.rec',fs.read(k..'.rec')) fs.write('record/'..v..'.rec',fs.read(k..'.rec'))
fs.remove(k..'.rec') fs.remove(k..'.rec')
end end
@@ -547,18 +560,19 @@ do
STAT.version=VERSION.code STAT.version=VERSION.code
needSave=true needSave=true
end end
SETTING.appLock,SETTING.dataSaving,SETTING.swap=nil SETTING.appLock,SETTING.dataSaving,SETTING.swap,SETTING.autoLogin=nil
if not SETTING.VKSkin then SETTING.VKSkin=1 end if not SETTING.VKSkin then SETTING.VKSkin=1 end
for _,v in next,SETTING.skin do if v<1 or v>17 then v=17 end end for _,v in next,SETTING.skin do if v<1 or v>17 then v=17 end end
if not RSlist[SETTING.RS]then SETTING.RS='TRS'end if not RSlist[SETTING.RS] then SETTING.RS='TRS' end
if SETTING.ghostType=='greyCell'then SETTING.ghostType='grayCell'end if SETTING.ghostType=='greyCell' then SETTING.ghostType='grayCell' end
if type(SETTING.skinSet)=='number'then SETTING.skinSet='crystal_scf'end if type(SETTING.skinSet)=='number' then SETTING.skinSet='crystal_scf' end
if not TABLE.find({8,10,13,17,22,29,37,47,62,80,100},SETTING.frameMul)then SETTING.frameMul=100 end if not TABLE.find({8,10,13,17,22,29,37,47,62,80,100},SETTING.frameMul) then SETTING.frameMul=100 end
if SETTING.cv then SETTING.vocPack,SETTING.cv=SETTING.cv end if SETTING.cv then SETTING.vocPack,SETTING.cv=SETTING.cv end
if type(SETTING.bg)~='string'then SETTING.bg='on'end if type(SETTING.bg)~='string' then SETTING.bg='on' end
if SETTING.skin[18]==10 then SETTING.skin[18]=4 end if SETTING.skin[18]==10 then SETTING.skin[18]=4 end
if SETTING.reTime>3 or SETTING.reTime<.5 then SETTING.reTime=2 end if SETTING.reTime>3 or SETTING.reTime<.5 then SETTING.reTime=2 end
if SETTING.locale=='zh_full' then SETTING.locale='zh' end if SETTING.locale=='zh_full' then SETTING.locale='zh' end
if SETTING.vocPack=='rin' then SETTING.vocPack='miku' end
if RANKS.infinite then RANKS.infinite=0 end if RANKS.infinite then RANKS.infinite=0 end
if RANKS.infinite_dig then RANKS.infinite_dig=0 end if RANKS.infinite_dig then RANKS.infinite_dig=0 end
if not RANKS.sprint_10l then RANKS.sprint_10l=0 end if not RANKS.sprint_10l then RANKS.sprint_10l=0 end
@@ -566,26 +580,26 @@ do
if RANKS.master_u then RANKS.master_h,RANKS.master_u=RANKS.master_u needSave=true end if RANKS.master_u then RANKS.master_h,RANKS.master_u=RANKS.master_u needSave=true end
for _,v in next,VK_ORG do v.color=nil end for _,v in next,VK_ORG do v.color=nil end
for name,rank in next,RANKS do for name,rank in next,RANKS do
if type(name)=='number'or type(rank)~='number'then if type(name)=='number' or type(rank)~='number' then
RANKS[name]=nil RANKS[name]=nil
needSave=true needSave=true
else else
local M=MODES[name] local M=MODES[name]
if M and M.unlock and rank>0 then if M and M.unlock and rank>0 then
for _,unlockName in next,M.unlock do for _,unlockName in next,M.unlock do
if not RANKS[unlockName]then if not RANKS[unlockName] then
RANKS[unlockName]=0 RANKS[unlockName]=0
needSave=true needSave=true
end end
end end
end end
if not(M and M.x)then if not (M and M.x) then
RANKS[name]=nil RANKS[name]=nil
needSave=true needSave=true
end end
end end
end end
if not MODES[STAT.lastPlay]then if not MODES[STAT.lastPlay] then
STAT.lastPlay='sprint_10l' STAT.lastPlay='sprint_10l'
needSave=true needSave=true
end end
@@ -598,7 +612,7 @@ do
end end
end end
--First start -- First start
FIRSTLAUNCH=STAT.run==0 FIRSTLAUNCH=STAT.run==0
if FIRSTLAUNCH and MOBILE then if FIRSTLAUNCH and MOBILE then
SETTING.VKSwitch=true SETTING.VKSwitch=true
@@ -606,18 +620,18 @@ if FIRSTLAUNCH and MOBILE then
SETTING.cleanCanvas=true SETTING.cleanCanvas=true
end end
--Apply system setting -- Apply system setting
applySettings() applySettings()
--Load replays -- Load replays
for _,fileName in next,fs.getDirectoryItems('replay')do for _,fileName in next,fs.getDirectoryItems('replay') do
if fileName:sub(12,12):match("[a-zA-Z]")then if fileName:sub(12,12):match("[a-zA-Z]") then
local date,mode,version,player,seed,setting,mod local date,mode,version,player,seed,setting,mod
local fileData=fs.read('replay/'..fileName) local fileData=fs.read('replay/'..fileName)
date, fileData=STRING.readLine(fileData)date=date:gsub("[a-zA-Z]","") date, fileData=STRING.readLine(fileData)date=date:gsub("[a-zA-Z]","")
mode, fileData=STRING.readLine(fileData)mode=MODE_UPDATE_MAP[mode]or mode mode, fileData=STRING.readLine(fileData)mode=MODE_UPDATE_MAP[mode] or mode
version,fileData=STRING.readLine(fileData) version,fileData=STRING.readLine(fileData)
player, fileData=STRING.readLine(fileData)if player=="Local Player"then player="Stacker"end player, fileData=STRING.readLine(fileData) if player=="Local Player" then player="Stacker" end
local success local success
success,fileData=pcall(love.data.decompress,'string','zlib',fileData) success,fileData=pcall(love.data.decompress,'string','zlib',fileData)
if not success then goto BREAK_cannotParse end if not success then goto BREAK_cannotParse end
@@ -653,16 +667,16 @@ for _,fileName in next,fs.getDirectoryItems('replay')do
local rep=DATA.parseReplay('replay/'..fileName) local rep=DATA.parseReplay('replay/'..fileName)
table.insert(REPLAY,rep) table.insert(REPLAY,rep)
end end
table.sort(REPLAY,function(a,b)return a.fileName>b.fileName end) table.sort(REPLAY,function(a,b) return a.fileName>b.fileName end)
table.insert(_LOADTIMELIST_,("Initialize Data: %.3fs"):format(TIME()-_LOADTIME_)) table.insert(_LOADTIMELIST_,("Initialize Data: %.3fs"):format(TIME()-_LOADTIME_))
for i=1,#_LOADTIMELIST_ do LOG(_LOADTIMELIST_[i])end for i=1,#_LOADTIMELIST_ do LOG(_LOADTIMELIST_[i]) end
--Launch testing task if launch param received -- Launch testing task if launch param received
if TABLE.find(arg,'--test')then if TABLE.find(arg,'-- test') then
TASK.new(function() TASK.new(function()
while not LOADED do YIELD()end while not LOADED do coroutine.yield() end
LOG("\27[92m\27[1mAutomatic Test Started\27[0m") LOG("\27[92m\27[1mAutomatic Test Started\27[0m")
BGM.setVol(0)SFX.setVol(0) BGM.setVol(0)SFX.setVol(0)
@@ -670,7 +684,7 @@ if TABLE.find(arg,'--test')then
TEST.yieldUntilNextScene() TEST.yieldUntilNextScene()
for k,mode in next,MODES do for k,mode in next,MODES do
if k~='netBattle'then if k~='netBattle' then
LOG("Scanning mode: "..mode.name) LOG("Scanning mode: "..mode.name)
loadGame(mode.name,true) loadGame(mode.name,true)
TEST.yieldUntilNextScene() TEST.yieldUntilNextScene()
@@ -684,12 +698,14 @@ if TABLE.find(arg,'--test')then
end) end)
TASK.new(function() TASK.new(function()
while true do while true do
YIELD() coroutine.yield()
if Z.getErr(1)then break end if Z.getErr(1) then break end
end end
LOG("\27[91m\27[1mAutomatic Test Failed :(\27[0m\nThe error message is:\n"..table.concat(Z.getErr(1).mes,"\n").."\27[91m\nAborting\27[0m") LOG("\27[91m\27[1mAutomatic Test Failed :(\27[0m\nThe error message is:\n"..table.concat(Z.getErr(1).mes,"\n").."\27[91m\nAborting\27[0m")
TEST.yieldN(60) TEST.yieldN(60)
love.event.quit(1) love.event.quit(1)
end) end)
end end
WS.switchHost('101.43.110.22','10026','/tech/socket/v1') WS.switchHost('cafuuchino1.3322.org','10026','/techmino/ws/v1')
HTTP.setHost("cafuuchino1.3322.org:10026")
HTTP.setThreadCount(1)

BIN
media/music/antispace.ogg Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,43 +1,43 @@
local defaultCenterTex=GC.DO{1,1}--No texture local defaultCenterTex=GC.DO{1,1}-- No texture
local defaultCenterPos={--For SRS-like RSs local defaultCenterPos={-- For SRS-like RSs
--Tetromino -- Tetromino
{[0]={0,1},{1,0},{1,1},{1,1}},--Z {[0]={0,1},{1,0},{1,1},{1,1}},-- Z
{[0]={0,1},{1,0},{1,1},{1,1}},--S {[0]={0,1},{1,0},{1,1},{1,1}},-- S
{[0]={0,1},{1,0},{1,1},{1,1}},--J {[0]={0,1},{1,0},{1,1},{1,1}},-- J
{[0]={0,1},{1,0},{1,1},{1,1}},--L {[0]={0,1},{1,0},{1,1},{1,1}},-- L
{[0]={0,1},{1,0},{1,1},{1,1}},--T {[0]={0,1},{1,0},{1,1},{1,1}},-- T
{[0]={.5,.5},{.5,.5},{.5,.5},{.5,.5}},--O {[0]={.5,.5},{.5,.5},{.5,.5},{.5,.5}},-- O
{[0]={-.5,1.5},{1.5,-.5},{.5,1.5},{1.5,.5}},--I {[0]={-.5,1.5},{1.5,-.5},{.5,1.5},{1.5,.5}},-- I
--Pentomino -- Pentomino
{[0]={1,1},{1,1},{1,1},{1,1}},--Z5 {[0]={1,1},{1,1},{1,1},{1,1}},-- Z5
{[0]={1,1},{1,1},{1,1},{1,1}},--S5 {[0]={1,1},{1,1},{1,1},{1,1}},-- S5
{[0]={0,1},{1,0},{1,1},{1,1}},--P {[0]={0,1},{1,0},{1,1},{1,1}},-- P
{[0]={0,1},{1,0},{1,1},{1,1}},--Q {[0]={0,1},{1,0},{1,1},{1,1}},-- Q
{[0]={1,1},{1,1},{1,1},{1,1}},--F {[0]={1,1},{1,1},{1,1},{1,1}},-- F
{[0]={1,1},{1,1},{1,1},{1,1}},--E {[0]={1,1},{1,1},{1,1},{1,1}},-- E
{[0]={1,1},{1,1},{1,1},{1,1}},--T5 {[0]={1,1},{1,1},{1,1},{1,1}},-- T5
{[0]={0,1},{1,0},{1,1},{1,1}},--U {[0]={0,1},{1,0},{1,1},{1,1}},-- U
{[0]={.5,1.5},{.5,.5},{1.5,.5},{1.5,1.5}},--V {[0]={.5,1.5},{.5,.5},{1.5,.5},{1.5,1.5}},-- V
{[0]={1,1},{1,1},{1,1},{1,1}},--W {[0]={1,1},{1,1},{1,1},{1,1}},-- W
{[0]={1,1},{1,1},{1,1},{1,1}},--X {[0]={1,1},{1,1},{1,1},{1,1}},-- X
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},--J5 {[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},-- J5
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},--L5 {[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},-- L5
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},--R {[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},-- R
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},--Y {[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},-- Y
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},--N {[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},-- N
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},--H {[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},-- H
{[0]={0,2},{2,0},{0,2},{2,0}},--I5 {[0]={0,2},{2,0},{0,2},{2,0}},-- I5
--Trimino -- Trimino
{[0]={0,1},{1,0},{0,1},{1,0}},--I3 {[0]={0,1},{1,0},{0,1},{1,0}},-- I3
{[0]={.5,.5},{.5,.5},{.5,.5},{.5,.5}},--C {[0]={.5,.5},{.5,.5},{.5,.5},{.5,.5}},-- C
--Domino -- Domino
{[0]={-.5,.5},{.5,-.5},{.5,.5},{.5,.5}},--I2 {[0]={-.5,.5},{.5,-.5},{.5,.5},{.5,.5}},-- I2
--Dot -- Dot
{[0]={0,0},{0,0},{0,0},{0,0}},--O1 {[0]={0,0},{0,0},{0,0},{0,0}},-- O1
} }
local noKickSet,noKickSet_180 do local noKickSet,noKickSet_180 do
@@ -52,14 +52,14 @@ local function _strToVec(list)
return list return list
end end
--Use this if the block is centrosymmetry, *PTR!!! -- Use this if the block is centrosymmetry, *PTR!!!
local function _centroSymSet(L) local function _centroSymSet(L)
L[23]=L[01]L[32]=L[10] L[23]=L[01]L[32]=L[10]
L[21]=L[03]L[12]=L[30] L[21]=L[03]L[12]=L[30]
L[20]=L[02]L[31]=L[13] L[20]=L[02]L[31]=L[13]
end end
--Use this to copy a symmetry set -- Use this to copy a symmetry set
local function _flipList(O) local function _flipList(O)
if not O then if not O then
return return
@@ -72,7 +72,7 @@ local function _flipList(O)
end end
local function _reflect(a) local function _reflect(a)
return{ return {
[03]=_flipList(a[01]), [03]=_flipList(a[01]),
[01]=_flipList(a[03]), [01]=_flipList(a[03]),
[30]=_flipList(a[10]), [30]=_flipList(a[10]),
@@ -91,21 +91,21 @@ end
local TRS local TRS
do do
local OspinList={ local OspinList={
{111,5,2, 0,-1,0},{111,5,2,-1,-1,0},{111,5,0,-1, 0,0},--T {111,5,2, 0,-1,0},{111,5,2,-1,-1,0},{111,5,0,-1, 0,0},-- T
{333,5,2,-1,-1,0},{333,5,2, 0,-1,0},{333,5,0, 0, 0,0},--T {333,5,2,-1,-1,0},{333,5,2, 0,-1,0},{333,5,0, 0, 0,0},-- T
{313,1,2,-1, 0,0},{313,1,2, 0,-1,0},{313,1,2, 0, 0,0},--Z {313,1,2,-1, 0,0},{313,1,2, 0,-1,0},{313,1,2, 0, 0,0},-- Z
{131,2,2, 0, 0,0},{131,2,2,-1,-1,0},{131,2,2,-1, 0,0},--S {131,2,2, 0, 0,0},{131,2,2,-1,-1,0},{131,2,2,-1, 0,0},-- S
{131,1,2,-1, 0,0},{131,1,2, 0,-1,0},{131,1,2, 0, 0,0},--Z(misOrder) {131,1,2,-1, 0,0},{131,1,2, 0,-1,0},{131,1,2, 0, 0,0},-- Z(misOrder)
{313,2,2, 0, 0,0},{313,2,2,-1,-1,0},{313,2,2,-1, 0,0},--S(misOrder) {313,2,2, 0, 0,0},{313,2,2,-1,-1,0},{313,2,2,-1, 0,0},-- S(misOrder)
{331,3,2, 0,-1,0},--J(farDown) {331,3,2, 0,-1,0},-- J(farDown)
{113,4,2,-1,-1,0},--L(farDown) {113,4,2,-1,-1,0},-- L(farDown)
{113,3,2,-1,-1,0},{113,3,0, 0, 0,0},--J {113,3,2,-1,-1,0},{113,3,0, 0, 0,0},-- J
{331,4,2, 0,-1,0},{331,4,0,-1, 0,0},--L {331,4,2, 0,-1,0},{331,4,0,-1, 0,0},-- L
{222,7,0,-1, 1,1},{222,7,0,-2, 1,1},{222,7,0, 0, 1,1},--I(high) {222,7,0,-1, 1,1},{222,7,0,-2, 1,1},{222,7,0, 0, 1,1},-- I(high)
{222,7,2,-1, 0,2},{222,7,2,-2, 0,2},{222,7,2, 0, 0,2},--I(low) {222,7,2,-1, 0,2},{222,7,2,-2, 0,2},{222,7,2, 0, 0,2},-- I(low)
{121,6,0, 1,-1,2},{112,6,0, 2,-1,2},{122,6,0, 1,-2,2},--O {121,6,0, 1,-1,2},{112,6,0, 2,-1,2},{122,6,0, 1,-2,2},-- O
{323,6,0,-1,-1,2},{332,6,0,-2,-1,2},{322,6,0,-1,-2,2},--O {323,6,0,-1,-1,2},{332,6,0,-2,-1,2},{322,6,0,-1,-2,2},-- O
}--{keys, ID, dir, dx, dy, freeLevel (0=immovable, 1=U/D-immovable, 2=free)} }-- {keys, ID, dir, dx, dy, freeLevel (0=immovable, 1=U/D-immovable, 2=free)}
local XspinList={ local XspinList={
{{ 1,-1},{ 1, 0},{ 1, 1},{ 1,-2},{ 1, 2}}, {{ 1,-1},{ 1, 0},{ 1, 1},{ 1,-2},{ 1, 2}},
{{ 0,-1},{ 0,-2},{ 0, 1},{ 0,-2},{ 0, 2}}, {{ 0,-1},{ 0,-2},{ 0, 1},{ 0,-2},{ 0, 2}},
@@ -137,8 +137,8 @@ do
[20]={'+0+0','-1+0','+1+0','+0+1','+0-1'}, [20]={'+0+0','-1+0','+1+0','+0+1','+0-1'},
[13]={'+0+0','+0-1','+0+1','+0-2'}, [13]={'+0+0','+0-1','+0+1','+0-2'},
[31]={'+0+0','+0+1','+0-1','+0+2'}, [31]={'+0+0','+0+1','+0-1','+0+2'},
},--Z },-- Z
false,--S false,-- S
{ {
[01]={'+0+0','-1+0','-1+1','+0-2','+1+1','+0+1','+0-1'}, [01]={'+0+0','-1+0','-1+1','+0-2','+1+1','+0+1','+0-1'},
[10]={'+0+0','+1+0','+1-1','+0+2','-1-1','+0-1','+0+1'}, [10]={'+0+0','+1+0','+1-1','+0+2','-1-1','+0-1','+0+1'},
@@ -152,22 +152,22 @@ do
[20]={'+0+0','+1+0','-1+0','+0+1','+0-1'}, [20]={'+0+0','+1+0','-1+0','+0+1','+0-1'},
[13]={'+0+0','+0-1','+0+1','+1+0'}, [13]={'+0+0','+0-1','+0+1','+1+0'},
[31]={'+0+0','+0+1','+0-1','-1+0'}, [31]={'+0+0','+0+1','+0-1','-1+0'},
},--J },-- J
false,--L false,-- L
{ {
[01]={'+0+0','-1+0','-1+1','+0-2','-1-2','+0+1'}, [01]={'+0+0','-1+0','-1+1','+0-2','-1-2','+0+1'},
[10]={'+0+0','+1+0','+1-1','+0+2','+1+2','+0+1','+0-1'}, [10]={'+0+0','+1+0','+1-1','+0+2','+1+2','+0+1','+0-1'},
[03]={'+0+0','+1+0','+1+1','+0-2','+1-2','+0+1'}, [03]={'+0+0','+1+0','+1+1','+0-2','+1-2','+0+1'},
[30]={'+0+0','-1+0','-1-1','+0+2','-1+2','+0+1','+0-1'}, [30]={'+0+0','-1+0','-1-1','+0+2','-1+2','+0+1','+0-1'},
[12]={'+0+0','+1+0','+1-1','+0-1','-1-1','+0+2','+1+2','+1+1'}, [12]={'+0+0','+1+0','+1-1','+0-1','-1-1','+0+2','+1+2','+1+1'},
[21]={'+0+0','-1+0','+0-2','-1-2','-1-1','+1+1'}, [21]={'+0+0','-1+0','+0-2','-1-2','-1-1','+0-1','+1+1'},
[32]={'+0+0','-1+0','-1-1','+0-1','+1-1','+0+2','-1+2','-1+1'}, [32]={'+0+0','-1+0','-1-1','+0-1','+1-1','+0+2','-1+2','-1+1'},
[23]={'+0+0','+1+0','+0-2','+1-2','+1-1','-1+1'}, [23]={'+0+0','+1+0','+0-2','+1-2','+1-1','+0-1','-1+1'},
[02]={'+0+0','-1+0','+1+0','+0+1'}, [02]={'+0+0','-1+0','+1+0','+0+1'},
[20]={'+0+0','+1+0','-1+0','+0-1'}, [20]={'+0+0','+1+0','-1+0','+0-1'},
[13]={'+0+0','+0-1','+0+1','+1+0','+0-2','+0+2'}, [13]={'+0+0','+0-1','+0+1','+1+0','+0-2','+0+2'},
[31]={'+0+0','+0-1','+0+1','-1+0','+0-2','+0+2'}, [31]={'+0+0','+0-1','+0+1','-1+0','+0-2','+0+2'},
},--T },-- T
function(P,d) function(P,d)
if P.gameEnv.easyFresh then if P.gameEnv.easyFresh then
P:freshBlock('fresh') P:freshBlock('fresh')
@@ -175,7 +175,7 @@ do
if P.gameEnv.ospin then if P.gameEnv.ospin then
local x,y=P.curX,P.curY local x,y=P.curX,P.curY
local C=P.cur local C=P.cur
if y==P.ghoY and((P:solid(x-1,y)or P:solid(x-1,y+1)))and(P:solid(x+2,y)or P:solid(x+2,y+1))then if y==P.ghoY and ((P:solid(x-1,y) or P:solid(x-1,y+1))) and (P:solid(x+2,y) or P:solid(x+2,y+1)) then
if P.sound then if P.sound then
SFX.play('rotatekick',nil,P:getCenterX()*.15) SFX.play('rotatekick',nil,P:getCenterX()*.15)
end end
@@ -186,15 +186,15 @@ do
return end return end
for i=1,#OspinList do for i=1,#OspinList do
local L=OspinList[i] local L=OspinList[i]
if C.spinSeq==L[1]then if C.spinSeq==L[1] then
local id,dir=L[2],L[3] local id,dir=L[2],L[3]
local bk=BLOCKS[id][dir] local bk=BLOCKS[id][dir]
x,y=P.curX+L[4],P.curY+L[5] x,y=P.curX+L[4],P.curY+L[5]
if if
not P:ifoverlap(bk,x,y)and( not P:ifoverlap(bk,x,y) and (
L[6]>0 or(P:ifoverlap(bk,x-1,y)and P:ifoverlap(bk,x+1,y)) L[6]>0 or (P:ifoverlap(bk,x-1,y) and P:ifoverlap(bk,x+1,y))
)and( ) and (
L[6]==2 or(P:ifoverlap(bk,x,y-1)and P:ifoverlap(bk,x,y+1)) L[6]==2 or (P:ifoverlap(bk,x,y-1) and P:ifoverlap(bk,x,y+1))
) )
then then
C.id=id C.id=id
@@ -220,7 +220,7 @@ do
SFX.play('rotate',nil,P:getCenterX()*.15) SFX.play('rotate',nil,P:getCenterX()*.15)
end end
end end
end,--O end,-- O
{ {
[01]={'+0+0','+0+1','+1+0','-2+0','-2-1','+1+2'}, [01]={'+0+0','+0+1','+1+0','-2+0','-2-1','+1+2'},
[10]={'+0+0','+2+0','-1+0','-1-2','+2+1','+0+1'}, [10]={'+0+0','+2+0','-1+0','-1-2','+2+1','+0+1'},
@@ -234,14 +234,14 @@ do
[20]={'+0+0','+1+0','-1+0','+0+1','+0-1'}, [20]={'+0+0','+1+0','-1+0','+0+1','+0-1'},
[13]={'+0+0','+0-1','-1+0','+1+0','+0+1'}, [13]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
[31]={'+0+0','+0-1','+1+0','-1+0','+0+1'}, [31]={'+0+0','+0-1','+1+0','-1+0','+0+1'},
},--I },-- I
{ {
[01]={'+0+0','+0+1','+1+1','-1+0','+0-3','+0+2','+0-2','+0+3','-1+2'}, [01]={'+0+0','+0+1','+1+1','-1+0','+0-3','+0+2','+0-2','+0+3','-1+2'},
[10]={'+0+0','+0-1','-1-1','+1+0','+0-3','+0+2','+0-2','+0+3','+1-2'}, [10]={'+0+0','+0-1','-1-1','+1+0','+0-3','+0+2','+0-2','+0+3','+1-2'},
[03]={'+0+0','+1+0','+0-3','+0-1','+0+1','+0-2','+0+2','+0+3','+1+2'}, [03]={'+0+0','+1+0','+0-3','+0-1','+0+1','+0-2','+0+2','+0+3','+1+2'},
[30]={'+0+0','-1+0','+0-1','+0+1','+0-2','+0-3','+0+2','+0+3','-1-2'}, [30]={'+0+0','-1+0','+0-1','+0+1','+0-2','+0-3','+0+2','+0+3','-1-2'},
},--Z5 },-- Z5
false,--S5 false,-- S5
{ {
[01]={'+0+0','-1+0','-1+1','+0-2','-1-2','-1-1','+0+1'}, [01]={'+0+0','-1+0','-1+1','+0-2','-1-2','-1-1','+0+1'},
[10]={'+0+0','+1+0','+1-1','+0+2','+1+2','+0-1','+1+1'}, [10]={'+0+0','+1+0','+1-1','+0+2','+1+2','+0-1','+1+1'},
@@ -255,8 +255,8 @@ do
[20]={'+0+0','+1+0','+0+1','+0-1'}, [20]={'+0+0','+1+0','+0+1','+0-1'},
[13]={'+0+0','+1+0','+0+1','-1+0'}, [13]={'+0+0','+1+0','+0+1','-1+0'},
[31]={'+0+0','-1+0','+0-1','+1+0'}, [31]={'+0+0','-1+0','+0-1','+1+0'},
},--P },-- P
false,--Q false,-- Q
{ {
[01]={'+0+0','-1+0','+1+0','-1+1','+0-2','+0-3'}, [01]={'+0+0','-1+0','+1+0','-1+1','+0-2','+0-3'},
[10]={'+0+0','+1+0','+1-1','-1+0','+0+2','+0+3'}, [10]={'+0+0','+1+0','+1-1','-1+0','+0+2','+0+3'},
@@ -270,8 +270,8 @@ do
[20]={'+0+0','-1+0','+1+0','+1+1'}, [20]={'+0+0','-1+0','+1+0','+1+1'},
[13]={'+0+0','+0-1','-1+1','+0+1'}, [13]={'+0+0','+0-1','-1+1','+0+1'},
[31]={'+0+0','+0-1','+1-1','+0+1'}, [31]={'+0+0','+0-1','+1-1','+0+1'},
},--F },-- F
false,--E false,-- E
{ {
[01]={'+0+0','+0-1','-1-1','+1+0','+1+1','+0-3','-1+0','+0+2','-1+2'}, [01]={'+0+0','+0-1','-1-1','+1+0','+1+1','+0-3','-1+0','+0+2','-1+2'},
[10]={'+0+0','+1+0','+0-1','-1-1','+0-2','-1+1','+0-3','+1-2','+0+1'}, [10]={'+0+0','+1+0','+0-1','-1-1','+0-2','-1+1','+0-3','+1-2','+0+1'},
@@ -285,7 +285,7 @@ do
[20]={'+0+0','+0-1','+0+1','+0-2'}, [20]={'+0+0','+0-1','+0+1','+0-2'},
[13]={'+0+0','+1+0','-1+1','-2+0'}, [13]={'+0+0','+1+0','-1+1','-2+0'},
[31]={'+0+0','-1+0','+1+1','+2+0'}, [31]={'+0+0','-1+0','+1+1','+2+0'},
},--T5 },-- T5
{ {
[01]={'+0+0','-1+0','-1+1','+0-2','-1-2'}, [01]={'+0+0','-1+0','-1+1','+0-2','-1-2'},
[10]={'+0+0','+1+0','+1-1','+0+2','+1+2'}, [10]={'+0+0','+1+0','+1-1','+0+2','+1+2'},
@@ -299,7 +299,7 @@ do
[20]={'+0+0','+0-1'}, [20]={'+0+0','+0-1'},
[13]={'+0+0','+0-1','+0+1','+1+0'}, [13]={'+0+0','+0-1','+0+1','+1+0'},
[31]={'+0+0','+0-1','+0+1','-1+0'}, [31]={'+0+0','+0-1','+0+1','-1+0'},
},--U },-- U
{ {
[01]={'+0+0','+0+1','-1+0','+0-2','-1-2'}, [01]={'+0+0','+0+1','-1+0','+0-2','-1-2'},
[10]={'+0+0','+0+1','+1+0','+0-2','+1-2'}, [10]={'+0+0','+0+1','+1+0','+0-2','+1-2'},
@@ -313,7 +313,7 @@ do
[20]={'+0+0','+1-1','-1+1'}, [20]={'+0+0','+1-1','-1+1'},
[13]={'+0+0','+1+1','-1-1'}, [13]={'+0+0','+1+1','-1-1'},
[31]={'+0+0','-1-1','+1+1'}, [31]={'+0+0','-1-1','+1+1'},
},--V },-- V
{ {
[01]={'+0+0','+0-1','-1+0','+1+0','+1-1','+0+2'}, [01]={'+0+0','+0-1','-1+0','+1+0','+1-1','+0+2'},
[10]={'+0+0','+0-1','-1-1','+0+1','+0-2','+1-2','+0+2'}, [10]={'+0+0','+0-1','-1-1','+0+1','+0-2','+1-2','+0+2'},
@@ -327,15 +327,15 @@ do
[20]={'+0+0','+0+1','+1+0'}, [20]={'+0+0','+0+1','+1+0'},
[13]={'+0+0','+0+1','-1+0'}, [13]={'+0+0','+0+1','-1+0'},
[31]={'+0+0','+0-1','+1+0'}, [31]={'+0+0','+0-1','+1+0'},
},--W },-- W
function(P,d) function(P,d)
if P.type=='human'then if P.type=='human' then
SFX.play('rotate',nil,P:getCenterX()*.15) SFX.play('rotate',nil,P:getCenterX()*.15)
end end
local kickData=XspinList[d] local kickData=XspinList[d]
for test=1,#kickData do for test=1,#kickData do
local x,y=P.curX+kickData[test][1],P.curY+kickData[test][2] local x,y=P.curX+kickData[test][1],P.curY+kickData[test][2]
if not P:ifoverlap(P.cur.bk,x,y)then if not P:ifoverlap(P.cur.bk,x,y) then
P.curX,P.curY=x,y P.curX,P.curY=x,y
P.spinLast=1 P.spinLast=1
P:freshBlock('move') P:freshBlock('move')
@@ -344,7 +344,7 @@ do
end end
end end
P:freshBlock('fresh') P:freshBlock('fresh')
end,--X end,-- X
{ {
[01]={'+0+0','-1+0','-1+1','+0-3','-1+1','-1+2','+0+1'}, [01]={'+0+0','-1+0','-1+1','+0-3','-1+1','-1+2','+0+1'},
[10]={'+0+0','-1+0','+1-1','+0+3','+1-1','+1-2','+0+1'}, [10]={'+0+0','-1+0','+1-1','+0+3','+1-1','+1-2','+0+1'},
@@ -358,8 +358,8 @@ do
[20]={'+0+0','+0+1','+1+1','-1+1','+1+0','-2+1'}, [20]={'+0+0','+0+1','+1+1','-1+1','+1+0','-2+1'},
[13]={'+0+0','-1+0','-1-1','+0+1','-1-2'}, [13]={'+0+0','-1+0','-1-1','+0+1','-1-2'},
[31]={'+0+0','+1+0','+1+1','+0-1','+1+2'}, [31]={'+0+0','+1+0','+1+1','+0-1','+1+2'},
},--J5 },-- J5
false,--L5 false,-- L5
{ {
[01]={'+0+0','-1+0','-1+1','+1+0','-1+2','-1-1','+0-3','+0+1'}, [01]={'+0+0','-1+0','-1+1','+1+0','-1+2','-1-1','+0-3','+0+1'},
[10]={'+0+0','-1+0','+1+0','+1-1','+1-2','+1+1','+0+3','+0+1'}, [10]={'+0+0','-1+0','+1+0','+1-1','+1-2','+1+1','+0+3','+0+1'},
@@ -373,8 +373,8 @@ do
[20]={'+0+0','+0+1','-1+1','+1+0','-2+1','+0-1'}, [20]={'+0+0','+0+1','-1+1','+1+0','-2+1','+0-1'},
[13]={'+0+0','-1+0','-1-1','+0+1','-1-2'}, [13]={'+0+0','-1+0','-1-1','+0+1','-1-2'},
[31]={'+0+0','+1+0','+1+1','+0-1','+1+2'}, [31]={'+0+0','+1+0','+1+1','+0-1','+1+2'},
},--R },-- R
false,--Y false,-- Y
{ {
[01]={'+0+0','-1+0','-1+1','+0+1','+1+0','+1+1','-1+2','-2+0','+0-2'}, [01]={'+0+0','-1+0','-1+1','+0+1','+1+0','+1+1','-1+2','-2+0','+0-2'},
[10]={'+0+0','+1+0','-1+0','+0-1','-1-1','+1-1','+1-2','+2+0','+0+2'}, [10]={'+0+0','+1+0','-1+0','+0-1','-1-1','+1-1','+1-2','+2+0','+0+2'},
@@ -388,20 +388,20 @@ do
[20]={'+0+0','+1+0','+0-2','+0+1'}, [20]={'+0+0','+1+0','+0-2','+0+1'},
[13]={'+0+0','-1+0','-1-1','+0+1','+1+2'}, [13]={'+0+0','-1+0','-1-1','+0+1','+1+2'},
[31]={'+0+0','+1+0','+1+1','+0-1','-1-2'}, [31]={'+0+0','+1+0','+1+1','+0-1','-1-2'},
},--N },-- N
false,--H false,-- H
{ {
[01]={'+0+0','+1-1','+1+0','+1+1','+0+1','-1+1','-1+0','-1-1','+0-1','+0-2','-2-1','-2-2','+2+0','+2-1','+2-2','+1+2','+2+2','-1+2','-2+2'}, [01]={'+0+0','+1-1','+1+0','+1+1','+0+1','-1+1','-1+0','-1-1','+0-1','+0-2','-2-1','-2-2','+2+0','+2-1','+2-2','+1+2','+2+2','-1+2','-2+2'},
[10]={'+0+0','-1+0','-1-1','+0-1','+1-1','-2-2','-2-1','-2+0','-1-2','+0-2','+1-2','+2-2','-1+1','-2+1','-2+2','+1+0','+2+0','+2-1','+0+1','+1-1','+2-2'}, [10]={'+0+0','-1+0','-1-1','+0-1','+1-1','-2-2','-2-1','-2+0','-1-2','+0-2','+1-2','+2-2','-1+1','-2+1','-2+2','+1+0','+2+0','+2-1','+0+1','+1-1','+2-2'},
[03]={'+0+0','-1-1','-1+0','-1+1','-0+1','+1+1','+1+0','+1-1','-0-1','-0-2','+2-1','+2-2','-2+0','-2-1','-2-2','-1+2','-2+2','+1+2','+2+2'}, [03]={'+0+0','-1-1','-1+0','-1+1','+0+1','+1+1','+1+0','+1-1','+0-1','+0-2','+2-1','+2-2','-2+0','-2-1','-2-2','-1+2','-2+2','+1+2','+2+2'},
[30]={'+0+0','+1+0','+1-1','-0-1','-1-1','+2-2','+2-1','+2+0','+1-2','-0-2','-1-2','-2-2','+1+1','+2+1','+2+2','-1+0','-2+0','-2-1','+0+1','-1-1','-2-2'}, [30]={'+0+0','+1+0','+1-1','+0-1','-1-1','+2-2','+2-1','+2+0','+1-2','+0-2','-1-2','-2-2','+1+1','+2+1','+2+2','-1+0','-2+0','-2-1','+0+1','-1-1','-2-2'},
},--I5 },-- I5
{ {
[01]={'+0+0','-1+0','-1-1','+1+1','-1+1'}, [01]={'+0+0','-1+0','-1-1','+1+1','-1+1'},
[10]={'+0+0','-1+0','+1+0','-1-1','+1+1'}, [10]={'+0+0','-1+0','+1+0','-1-1','+1+1'},
[03]={'+0+0','+1+0','+1-1','-1+1','+1+1'}, [03]={'+0+0','+1+0','+1-1','-1+1','+1+1'},
[30]={'+0+0','+1+0','-1+0','+1-1','-1+1'}, [30]={'+0+0','+1+0','-1+0','+1-1','-1+1'},
},--I3 },-- I3
{ {
[01]={'+0+0','-1+0','+1+0'}, [01]={'+0+0','-1+0','+1+0'},
[10]={'+0+0','+1+0','-1+0'}, [10]={'+0+0','+1+0','-1+0'},
@@ -415,7 +415,7 @@ do
[20]={'+0+0','+0+1','-1+1','+1+1'}, [20]={'+0+0','+0+1','-1+1','+1+1'},
[13]={'+0+0','+0-1','-1-1','+1-1'}, [13]={'+0+0','+0-1','-1-1','+1-1'},
[31]={'+0+0','+0+1','+1+1','-1+1'}, [31]={'+0+0','+0+1','+1+1','-1+1'},
},--C },-- C
{ {
[01]={'+0+0','-1+0','+0+1'}, [01]={'+0+0','-1+0','+0+1'},
[10]={'+0+0','+1+0','+0+1'}, [10]={'+0+0','+1+0','+0+1'},
@@ -429,22 +429,22 @@ do
[20]={'+0+0','+0+1','+0-1'}, [20]={'+0+0','+0+1','+0-1'},
[13]={'+0+0','-1+0','+1+0'}, [13]={'+0+0','-1+0','+1+0'},
[31]={'+0+0','+1+0','-1+0'}, [31]={'+0+0','+1+0','-1+0'},
},--I2 },-- I2
nil,--O1 nil,-- O1
} }
} }
TRS.centerDisp[6]=false TRS.centerDisp[6]=false
TRS.centerDisp[18]=false TRS.centerDisp[18]=false
TRS.kickTable[2]= _reflect(TRS.kickTable[1])--SZ TRS.kickTable[2]= _reflect(TRS.kickTable[1])-- SZ
TRS.kickTable[4]= _reflect(TRS.kickTable[3])--LJ TRS.kickTable[4]= _reflect(TRS.kickTable[3])-- LJ
TRS.kickTable[9]= _reflect(TRS.kickTable[8])--S5Z5 TRS.kickTable[9]= _reflect(TRS.kickTable[8])-- S5Z5
TRS.kickTable[11]=_reflect(TRS.kickTable[10])--PQ TRS.kickTable[11]=_reflect(TRS.kickTable[10])-- PQ
TRS.kickTable[13]=_reflect(TRS.kickTable[12])--FE TRS.kickTable[13]=_reflect(TRS.kickTable[12])-- FE
TRS.kickTable[20]=_reflect(TRS.kickTable[19])--L5J5 TRS.kickTable[20]=_reflect(TRS.kickTable[19])-- L5J5
TRS.kickTable[22]=_reflect(TRS.kickTable[21])--RY TRS.kickTable[22]=_reflect(TRS.kickTable[21])-- RY
TRS.kickTable[24]=_reflect(TRS.kickTable[23])--NH TRS.kickTable[24]=_reflect(TRS.kickTable[23])-- NH
_centroSymSet(TRS.kickTable[8])_centroSymSet(TRS.kickTable[9])--S5Z5 _centroSymSet(TRS.kickTable[8])_centroSymSet(TRS.kickTable[9])-- S5Z5
_centroSymSet(TRS.kickTable[25])_centroSymSet(TRS.kickTable[26])--I5I3 _centroSymSet(TRS.kickTable[25])_centroSymSet(TRS.kickTable[26])-- I5I3
end end
local SRS local SRS
@@ -469,12 +469,12 @@ do
[32]={'+0+0','-1+0','-1-1','+0+2','-1+2'}, [32]={'+0+0','-1+0','-1-1','+0+2','-1+2'},
[23]={'+0+0','+1+0','+1+1','+0-2','+1-2'}, [23]={'+0+0','+1+0','+1+1','+0-2','+1-2'},
[02]={'+0+0'},[20]={'+0+0'},[13]={'+0+0'},[31]={'+0+0'}, [02]={'+0+0'},[20]={'+0+0'},[13]={'+0+0'},[31]={'+0+0'},
},--Z },-- Z
false,--S false,-- S
false,--J false,-- J
false,--L false,-- L
false,--T false,-- T
noKickSet,--O noKickSet,-- O
{ {
[01]={'+0+0','-2+0','+1+0','-2-1','+1+2'}, [01]={'+0+0','-2+0','+1+0','-2-1','+1+2'},
[10]={'+0+0','+2+0','-1+0','+2+1','-1-2'}, [10]={'+0+0','+2+0','-1+0','+2+1','-1-2'},
@@ -485,11 +485,11 @@ do
[30]={'+0+0','+1+0','-2+0','+1-2','-2+1'}, [30]={'+0+0','+1+0','-2+0','+1-2','-2+1'},
[03]={'+0+0','-1+0','+2+0','-1+2','+2-1'}, [03]={'+0+0','-1+0','+2+0','-1+2','+2-1'},
[02]={'+0+0'},[20]={'+0+0'},[13]={'+0+0'},[31]={'+0+0'}, [02]={'+0+0'},[20]={'+0+0'},[13]={'+0+0'},[31]={'+0+0'},
}--I }-- I
} }
} }
for i=2,5 do SRS.kickTable[i]=SRS.kickTable[1]end for i=2,5 do SRS.kickTable[i]=SRS.kickTable[1] end
for i=8,29 do SRS.kickTable[i]=SRS.kickTable[1]end for i=8,29 do SRS.kickTable[i]=SRS.kickTable[1] end
end end
local SRS_plus local SRS_plus
@@ -519,12 +519,12 @@ do
[20]={'+0+0','+1+0','-1+0','+0-1','+0+1'}, [20]={'+0+0','+1+0','-1+0','+0-1','+0+1'},
[13]={'+0+0','+0-1','-1+0','+1+0','+0+1'}, [13]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
[31]={'+0+0','+0-1','-1+0','+1+0','+0+1'}, [31]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
},--Z },-- Z
false,--S false,-- S
false,--J false,-- J
false,--L false,-- L
false,--T false,-- T
noKickSet,--O noKickSet,-- O
{ {
[01]={'+0+0','-2+0','+1+0','-2-1','+1+2'}, [01]={'+0+0','-2+0','+1+0','-2-1','+1+2'},
[10]={'+0+0','+2+0','-1+0','+2+1','-1-2'}, [10]={'+0+0','+2+0','-1+0','+2+1','-1-2'},
@@ -538,11 +538,11 @@ do
[20]={'+0+0','+1+0','-1+0','+0+1','+0-1'}, [20]={'+0+0','+1+0','-1+0','+0+1','+0-1'},
[13]={'+0+0','+0-1','-1+0','+1+0','+0+1'}, [13]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
[31]={'+0+0','+0-1','+1+0','-1+0','+0+1'}, [31]={'+0+0','+0-1','+1+0','-1+0','+0+1'},
}--I }-- I
} }
} }
for i=2,5 do SRS_plus.kickTable[i]=SRS_plus.kickTable[1]end for i=2,5 do SRS_plus.kickTable[i]=SRS_plus.kickTable[1] end
for i=8,29 do SRS_plus.kickTable[i]=SRS_plus.kickTable[1]end for i=8,29 do SRS_plus.kickTable[i]=SRS_plus.kickTable[1] end
end end
local SRS_X local SRS_X
@@ -570,19 +570,19 @@ do
[20]={'+0+0','+1+0','-1+0','+0-1','+0+1'}, [20]={'+0+0','+1+0','-1+0','+0-1','+0+1'},
[13]={'+0+0','+0-1','-1+0','+1+0','+0+1'}, [13]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
[31]={'+0+0','+0-1','-1+0','+1+0','+0+1'}, [31]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
},--Z },-- Z
false,--S false,-- S
false,--J false,-- J
false,--L false,-- L
false,--T false,-- T
noKickSet,--O noKickSet,-- O
false,--I false,-- I
} }
} }
for i=2,5 do SRS_X.kickTable[i]=SRS_X.kickTable[1]end for i=2,5 do SRS_X.kickTable[i]=SRS_X.kickTable[1] end
for i=7,29 do SRS_X.kickTable[i]=TRS.kickTable[i]end for i=7,29 do SRS_X.kickTable[i]=TRS.kickTable[i] end
SRS_X.kickTable[10]=SRS_X.kickTable[1]--P SRS_X.kickTable[10]=SRS_X.kickTable[1]-- P
SRS_X.kickTable[11]=SRS_X.kickTable[1]--Q SRS_X.kickTable[11]=SRS_X.kickTable[1]-- Q
end end
local BiRS local BiRS
@@ -591,45 +591,45 @@ do
local L=_strToVec{'+0+0','+1+0','+1-1','+0-1','+1+1','-1-1','-1+0','+0+1','-1+1','+0+2','+1+2','-1+2','+2+0','-2+0'} local L=_strToVec{'+0+0','+1+0','+1-1','+0-1','+1+1','-1-1','-1+0','+0+1','-1+1','+0+2','+1+2','-1+2','+2+0','-2+0'}
local F=_strToVec{'+0+0','+0-1','+0+1','+0+2'} local F=_strToVec{'+0+0','+0-1','+0+1','+0+2'}
local list={ local list={
{[02]=L,[20]=R,[13]=R,[31]=L},--Z {[02]=L,[20]=R,[13]=R,[31]=L},-- Z
{[02]=R,[20]=L,[13]=L,[31]=R},--S {[02]=R,[20]=L,[13]=L,[31]=R},-- S
{[02]=L,[20]=R,[13]=L,[31]=R},--J {[02]=L,[20]=R,[13]=L,[31]=R},-- J
{[02]=R,[20]=L,[13]=L,[31]=R},--L {[02]=R,[20]=L,[13]=L,[31]=R},-- L
{[02]=F,[20]=F,[13]=L,[31]=R},--T {[02]=F,[20]=F,[13]=L,[31]=R},-- T
{[02]=F,[20]=F,[13]=F,[31]=F},--O {[02]=F,[20]=F,[13]=F,[31]=F},-- O
{[02]=F,[20]=F,[13]=R,[31]=L},--I {[02]=F,[20]=F,[13]=R,[31]=L},-- I
{[02]=L,[20]=L,[13]=R,[31]=R},--Z5 {[02]=L,[20]=L,[13]=R,[31]=R},-- Z5
{[02]=R,[20]=R,[13]=L,[31]=L},--S5 {[02]=R,[20]=R,[13]=L,[31]=L},-- S5
{[02]=L,[20]=R,[13]=L,[31]=R},--P {[02]=L,[20]=R,[13]=L,[31]=R},-- P
{[02]=R,[20]=L,[13]=R,[31]=L},--Q {[02]=R,[20]=L,[13]=R,[31]=L},-- Q
{[02]=R,[20]=L,[13]=L,[31]=R},--F {[02]=R,[20]=L,[13]=L,[31]=R},-- F
{[02]=L,[20]=R,[13]=R,[31]=L},--E {[02]=L,[20]=R,[13]=R,[31]=L},-- E
{[02]=F,[20]=F,[13]=L,[31]=R},--T5 {[02]=F,[20]=F,[13]=L,[31]=R},-- T5
{[02]=F,[20]=F,[13]=L,[31]=R},--U {[02]=F,[20]=F,[13]=L,[31]=R},-- U
{[02]=R,[20]=L,[13]=L,[31]=R},--V {[02]=R,[20]=L,[13]=L,[31]=R},-- V
{[02]=R,[20]=L,[13]=L,[31]=R},--W {[02]=R,[20]=L,[13]=L,[31]=R},-- W
{[02]=F,[20]=F,[13]=F,[31]=F},--X {[02]=F,[20]=F,[13]=F,[31]=F},-- X
{[02]=L,[20]=R,[13]=R,[31]=L},--J5 {[02]=L,[20]=R,[13]=R,[31]=L},-- J5
{[02]=R,[20]=L,[13]=L,[31]=R},--L5 {[02]=R,[20]=L,[13]=L,[31]=R},-- L5
{[02]=L,[20]=R,[13]=R,[31]=L},--R {[02]=L,[20]=R,[13]=R,[31]=L},-- R
{[02]=R,[20]=L,[13]=L,[31]=R},--Y {[02]=R,[20]=L,[13]=L,[31]=R},-- Y
{[02]=L,[20]=R,[13]=R,[31]=L},--N {[02]=L,[20]=R,[13]=R,[31]=L},-- N
{[02]=R,[20]=L,[13]=L,[31]=R},--H {[02]=R,[20]=L,[13]=L,[31]=R},-- H
{[02]=F,[20]=F,[13]=F,[31]=F},--I5 {[02]=F,[20]=F,[13]=F,[31]=F},-- I5
{[02]=F,[20]=F,[13]=F,[31]=F},--I3 {[02]=F,[20]=F,[13]=F,[31]=F},-- I3
{[02]=R,[20]=L,[13]=L,[31]=R},--C {[02]=R,[20]=L,[13]=L,[31]=R},-- C
{[02]=F,[20]=F,[13]=R,[31]=L},--I2 {[02]=F,[20]=F,[13]=R,[31]=L},-- I2
{[02]=F,[20]=F,[13]=F,[31]=F},--O1 {[02]=F,[20]=F,[13]=F,[31]=F},-- O1
} }
for i=1,29 do for i=1,29 do
local a,b=R,L local a,b=R,L
if i==6 or i==18 then if i==6 or i==18 then
a,b=b,a a,b=b,a
end end
list[i][01]=a;list[i][10]=b;list[i][03]=b;list[i][30]=a list[i][01]=a; list[i][10]=b; list[i][03]=b; list[i][30]=a
list[i][12]=a;list[i][21]=b;list[i][32]=b;list[i][23]=a list[i][12]=a; list[i][21]=b; list[i][32]=b; list[i][23]=a
end end
BiRS={ BiRS={
centerTex=GC.DO{10,10, centerTex=GC.DO{10,10,
@@ -653,9 +653,9 @@ do
end end
local dx,dy=0,0 do local dx,dy=0,0 do
local pressing=P.keyPressing local pressing=P.keyPressing
if pressing[1]and P:ifoverlap(C.bk,P.curX-1,P.curY)then dx=dx-1 end if pressing[1] and P:ifoverlap(C.bk,P.curX-1,P.curY) then dx=dx-1 end
if pressing[2]and P:ifoverlap(C.bk,P.curX+1,P.curY)then dx=dx+1 end if pressing[2] and P:ifoverlap(C.bk,P.curX+1,P.curY) then dx=dx+1 end
if pressing[7]and P:ifoverlap(C.bk,P.curX,P.curY-1)then dy= -1 end if pressing[7] and P:ifoverlap(C.bk,P.curX,P.curY-1) then dy= -1 end
end end
while true do while true do
for test=1,#kickList do for test=1,#kickList do
@@ -666,7 +666,7 @@ do
(P.freshTime>0 or fdy<=0) (P.freshTime>0 or fdy<=0)
then then
local x,y=ix+fdx,iy+fdy local x,y=ix+fdx,iy+fdy
if not P:ifoverlap(icb,x,y)then if not P:ifoverlap(icb,x,y) then
if P.gameEnv.moveFX and P.gameEnv.block then if P.gameEnv.moveFX and P.gameEnv.block then
P:createMoveFX() P:createMoveFX()
end end
@@ -685,7 +685,7 @@ do
local sfx local sfx
if ifpre then if ifpre then
sfx='prerotate' sfx='prerotate'
elseif P:ifoverlap(icb,x,y+1)and P:ifoverlap(icb,x-1,y)and P:ifoverlap(icb,x+1,y)then elseif P:ifoverlap(icb,x,y+1) and P:ifoverlap(icb,x-1,y) and P:ifoverlap(icb,x+1,y) then
sfx='rotatekick' sfx='rotatekick'
P:_rotateField(d) P:_rotateField(d)
else else
@@ -700,7 +700,7 @@ do
end end
end end
--Try release left/right, then softdrop, failed to rotate otherwise -- Try release left/right, then softdrop, failed to rotate otherwise
if dx~=0 then if dx~=0 then
dx=0 dx=0
elseif dy~=0 then elseif dy~=0 then
@@ -728,24 +728,24 @@ do
[02]=upOnly,[20]=upOnly,[13]=upOnly,[31]=upOnly, [02]=upOnly,[20]=upOnly,[13]=upOnly,[31]=upOnly,
} }
local centerPos=TABLE.copy(defaultCenterPos) local centerPos=TABLE.copy(defaultCenterPos)
centerPos[1]={[0]={1,1},{1,0},{1,1},{1,0}}--Z centerPos[1]={[0]={1,1},{1,0},{1,1},{1,0}}-- Z
centerPos[2]={[0]={1,1},{1,1},{1,1},{1,1}}--S centerPos[2]={[0]={1,1},{1,1},{1,1},{1,1}}-- S
centerPos[3]={[0]={1,1},{1,0},{1,1},{1,1}}--L centerPos[3]={[0]={1,1},{1,0},{1,1},{1,1}}-- L
centerPos[4]={[0]={1,1},{1,0},{1,1},{1,1}}--J centerPos[4]={[0]={1,1},{1,0},{1,1},{1,1}}-- J
centerPos[5]={[0]={1,1},{1,0},{1,1},{1,1}}--T centerPos[5]={[0]={1,1},{1,0},{1,1},{1,1}}-- T
centerPos[7]={[0]={0,2},{2,0},{0,2},{2,0}}--I centerPos[7]={[0]={0,2},{2,0},{0,2},{2,0}}-- I
centerPos[10]={[0]={1,1},{1,0},{1,1},{1,0}}--P centerPos[10]={[0]={1,1},{1,0},{1,1},{1,0}}-- P
centerPos[11]={[0]={1,1},{1,1},{1,1},{1,1}}--Q centerPos[11]={[0]={1,1},{1,1},{1,1},{1,1}}-- Q
centerPos[15]={[0]={1,1},{1,0},{1,1},{1,1}}--U centerPos[15]={[0]={1,1},{1,0},{1,1},{1,1}}-- U
centerPos[16]={[0]={1,1},{1,1},{1,1},{1,1}}--V centerPos[16]={[0]={1,1},{1,1},{1,1},{1,1}}-- V
centerPos[19]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--J5 centerPos[19]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- J5
centerPos[20]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--L5 centerPos[20]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- L5
centerPos[21]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--R centerPos[21]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- R
centerPos[22]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--Y centerPos[22]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- Y
centerPos[23]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--N centerPos[23]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- N
centerPos[24]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--H centerPos[24]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- H
centerPos[26]={[0]={0,1},{0,0},{0,1},{0,0}}--I3 centerPos[26]={[0]={0,1},{0,0},{0,1},{0,0}}-- I3
centerPos[28]={[0]={0,1},{0,0},{0,1},{0,0}}--I2 centerPos[28]={[0]={0,1},{0,0},{0,1},{0,0}}-- I2
ARS_Z={ ARS_Z={
centerTex=GC.DO{10,10, centerTex=GC.DO{10,10,
@@ -765,24 +765,24 @@ end
local DRS_weak local DRS_weak
do do
local centerPos=TABLE.copy(defaultCenterPos) local centerPos=TABLE.copy(defaultCenterPos)
centerPos[1]={[0]={1,1},{1,0},{1,1},{1,1}}--Z centerPos[1]={[0]={1,1},{1,0},{1,1},{1,1}}-- Z
centerPos[2]={[0]={1,1},{1,0},{1,1},{1,1}}--S centerPos[2]={[0]={1,1},{1,0},{1,1},{1,1}}-- S
centerPos[3]={[0]={1,1},{1,0},{1,1},{1,1}}--L centerPos[3]={[0]={1,1},{1,0},{1,1},{1,1}}-- L
centerPos[4]={[0]={1,1},{1,0},{1,1},{1,1}}--J centerPos[4]={[0]={1,1},{1,0},{1,1},{1,1}}-- J
centerPos[5]={[0]={1,1},{1,0},{1,1},{1,1}}--T centerPos[5]={[0]={1,1},{1,0},{1,1},{1,1}}-- T
centerPos[7]={[0]={.5,1.5},{1.5,-.5},{.5,1.5},{1.5,.5}}--I centerPos[7]={[0]={.5,1.5},{1.5,-.5},{.5,1.5},{1.5,.5}}-- I
centerPos[10]={[0]={1,1},{1,0},{1,1},{1,0}}--P centerPos[10]={[0]={1,1},{1,0},{1,1},{1,0}}-- P
centerPos[11]={[0]={1,1},{1,1},{1,1},{1,1}}--Q centerPos[11]={[0]={1,1},{1,1},{1,1},{1,1}}-- Q
centerPos[15]={[0]={1,1},{1,0},{1,1},{1,1}}--U centerPos[15]={[0]={1,1},{1,0},{1,1},{1,1}}-- U
centerPos[16]={[0]={1,1},{1,1},{1,1},{1,1}}--V centerPos[16]={[0]={1,1},{1,1},{1,1},{1,1}}-- V
centerPos[19]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--J5 centerPos[19]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- J5
centerPos[20]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--L5 centerPos[20]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- L5
centerPos[21]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--R centerPos[21]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- R
centerPos[22]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--Y centerPos[22]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- Y
centerPos[23]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--N centerPos[23]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- N
centerPos[24]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--H centerPos[24]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- H
centerPos[26]={[0]={0,1},{0,0},{0,1},{0,0}}--I3 centerPos[26]={[0]={0,1},{0,0},{0,1},{0,0}}-- I3
centerPos[28]={[0]={0,1},{0,0},{0,1},{0,0}}--I2 centerPos[28]={[0]={0,1},{0,0},{0,1},{0,0}}-- I2
local L={'+0+0','-1+0','+1+0','+0-1','-1-1','+1-1'} local L={'+0+0','-1+0','+1+0','+0-1','-1-1','+1-1'}
local R={'+0+0','+1+0','-1+0','+0-1','+1-1','-1-1'} local R={'+0+0','+1+0','-1+0','+0-1','+1-1','-1-1'}
@@ -802,24 +802,24 @@ do
}, },
centerPos=centerPos, centerPos=centerPos,
kickTable={ kickTable={
Z,S,--Z,S Z,S,-- Z,S
Z,S,--J,L Z,S,-- J,L
Z,--T Z,-- T
noKickSet,--O noKickSet,-- O
Z,--I Z,-- I
Z,S,--Z5,S5 Z,S,-- Z5,S5
Z,S,--P,Q Z,S,-- P,Q
Z,S,--F,E Z,S,-- F,E
Z,Z,Z,Z,--T5,U,V,W Z,Z,Z,Z,-- T5,U,V,W
noKickSet,--X noKickSet,-- X
Z,S,--J5,L5 Z,S,-- J5,L5
Z,S,--R,Y Z,S,-- R,Y
Z,S,--N,H Z,S,-- N,H
Z,--I5 Z,-- I5
Z,Z,--I3,C Z,Z,-- I3,C
Z,Z,--I2,O1 Z,Z,-- I2,O1
} }
} }
end end
@@ -916,24 +916,24 @@ do
{'fRect',3,3,4,4}, {'fRect',3,3,4,4},
}, },
kickTable={ kickTable={
Z,S,--Z,S Z,S,-- Z,S
Z,S,--J,L Z,S,-- J,L
Z,--T Z,-- T
noKickSet,--O noKickSet,-- O
Z,--I Z,-- I
Z,S,--Z5,S5 Z,S,-- Z5,S5
Z,S,--P,Q Z,S,-- P,Q
Z,S,--F,E Z,S,-- F,E
Z,Z,Z,Z,--T5,U,V,W Z,Z,Z,Z,-- T5,U,V,W
noKickSet,--X noKickSet,-- X
Z,S,--J5,L5 Z,S,-- J5,L5
Z,S,--R,Y Z,S,-- R,Y
Z,S,--N,H Z,S,-- N,H
Z,--I5 Z,-- I5
Z,Z,--I3,C Z,Z,-- I3,C
Z,Z,--I2,O1 Z,Z,-- I2,O1
} }
} }
end end
@@ -1009,15 +1009,15 @@ local RSlist={
} }
for _,rs in next,RSlist do for _,rs in next,RSlist do
if not rs.centerDisp then rs.centerDisp=TABLE.new(true,29)end if not rs.centerDisp then rs.centerDisp=TABLE.new(true,29) end
if not rs.centerPos then rs.centerPos=defaultCenterPos end if not rs.centerPos then rs.centerPos=defaultCenterPos end
if not rs.centerTex then rs.centerTex=defaultCenterTex end if not rs.centerTex then rs.centerTex=defaultCenterTex end
--Make all string vec to the same table vec -- Make all string vec to the same table vec
for _,set in next,rs.kickTable do for _,set in next,rs.kickTable do
if type(set)=='table'then if type(set)=='table' then
for _,list in next,set do for _,list in next,set do
if type(list[1])=='string'then if type(list[1])=='string' then
_strToVec(list) _strToVec(list)
end end
end end

View File

@@ -1,14 +1,14 @@
--Cool liquid background -- Cool liquid background
local back={} local back={}
local shader=SHADER.aura local shader=SHADER.aura
local t local t
function back.init() function back.init()
t=math.random()*260 t=math.random()*2600
BG.resize(SCR.w,SCR.h) BG.resize(SCR.w,SCR.h)
end end
function back.update(dt) function back.update(dt)
t=(t+dt)%2600 t=(t+dt)%6200
end end
function back.draw() function back.draw()
GC.clear(.08,.08,.084) GC.clear(.08,.08,.084)

View File

@@ -1,13 +1,13 @@
--Horizonal red-blue gradient -- Horizonal red-blue gradient
local back={} local back={}
local shader=SHADER.grad1 local shader=SHADER.grad1
local t local t
function back.init() function back.init()
t=math.random()*260 t=math.random()*2600
end end
function back.update(dt) function back.update(dt)
t=(t+dt)%2600 t=(t+dt)%6200
end end
function back.draw() function back.draw()
GC.clear(.08,.08,.084) GC.clear(.08,.08,.084)

View File

@@ -1,14 +1,14 @@
--Vertical red-green gradient -- Vertical red-green gradient
local back={} local back={}
local shader=SHADER.grad2 local shader=SHADER.grad2
local t local t
function back.init() function back.init()
t=math.random()*260 t=math.random()*2600
BG.resize(nil,SCR.h) BG.resize(nil,SCR.h)
end end
function back.update(dt) function back.update(dt)
t=(t+dt)%2600 t=(t+dt)%6200
end end
function back.draw() function back.draw()
GC.clear(.08,.08,.084) GC.clear(.08,.08,.084)

View File

@@ -1,4 +1,4 @@
--Large falling tetrominoes -- Large falling tetrominoes
local gc=love.graphics local gc=love.graphics
local gc_clear=gc.clear local gc_clear=gc.clear
local gc_setColor,gc_draw=gc.setColor,gc.draw local gc_setColor,gc_draw=gc.setColor,gc.draw
@@ -43,8 +43,8 @@ function back.draw()
local M=mino[i] local M=mino[i]
local b=M.block local b=M.block
for y=1,#b do for y=1,#b do
for x=1,#b[1]do for x=1,#b[1] do
if b[y][x]then if b[y][x] then
gc_draw(M.texture,M.x+(x-1)*30*M.k,M.y-y*30*M.k,nil,M.k) gc_draw(M.texture,M.x+(x-1)*30*M.k,M.y-y*30*M.k,nil,M.k)
end end
end end

View File

@@ -1,4 +1,4 @@
--blockhole -- blockhole
local gc=love.graphics local gc=love.graphics
local gc_clear,gc_replaceTransform=gc.clear,gc.replaceTransform local gc_clear,gc_replaceTransform=gc.clear,gc.replaceTransform
local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth
@@ -44,14 +44,14 @@ function back.draw()
gc_clear(.1,.1,.1) gc_clear(.1,.1,.1)
gc_replaceTransform(SCR.xOy_m) gc_replaceTransform(SCR.xOy_m)
--Squares -- Squares
gc_setColor(1,1,1,.2) gc_setColor(1,1,1,.2)
for i=1,#squares do for i=1,#squares do
local S=squares[i] local S=squares[i]
gc_draw(S.texture,S.d*cos(S.ang),S.d*sin(S.ang),S.rotate,S.size*.026,nil,15,15) gc_draw(S.texture,S.d*cos(S.ang),S.d*sin(S.ang),S.rotate,S.size*.026,nil,15,15)
end end
--blockhole -- blockhole
gc_setColor(.07,.07,.07) gc_setColor(.07,.07,.07)
gc_circle('fill',0,0,157) gc_circle('fill',0,0,157)
gc_setLineWidth(6) gc_setLineWidth(6)

View File

@@ -1,4 +1,4 @@
--Block rain -- Block rain
local gc=love.graphics local gc=love.graphics
local rnd=math.random local rnd=math.random
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove

View File

@@ -1,4 +1,4 @@
--Space but tetrominoes -- Space but tetrominoes
local gc=love.graphics local gc=love.graphics
local gc_clear,gc_translate=gc.clear,gc.translate local gc_clear,gc_translate=gc.clear,gc.translate
local gc_setColor,gc_draw=gc.setColor,gc.draw local gc_setColor,gc_draw=gc.setColor,gc.draw

View File

@@ -1,4 +1,4 @@
--Flying cubes -- Flying cubes
local gc=love.graphics local gc=love.graphics
local gc_clear=gc.clear local gc_clear=gc.clear
local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth

View File

@@ -1,4 +1,4 @@
--Custom background -- Custom background
local gc_clear,gc_setColor=love.graphics.clear,love.graphics.setColor local gc_clear,gc_setColor=love.graphics.clear,love.graphics.setColor
local back={} local back={}

View File

@@ -1,4 +1,4 @@
--Yuyuko's fan -- Yuyuko's fan
local gc=love.graphics local gc=love.graphics
local gc_clear,gc_origin,gc_replaceTransform=gc.clear,gc.origin,gc.replaceTransform local gc_clear,gc_origin,gc_replaceTransform=gc.clear,gc.origin,gc.replaceTransform
local gc_translate=gc.translate local gc_translate=gc.translate
@@ -61,7 +61,7 @@ function back.draw()
gc_setLineWidth(6) gc_setLineWidth(6)
gc_setColor(.8,.9,1,.3) gc_setColor(.8,.9,1,.3)
for i=1,#SVG_TITLE_FAN do gc_polygon('line',SVG_TITLE_FAN[i])end for i=1,#SVG_TITLE_FAN do gc_polygon('line',SVG_TITLE_FAN[i]) end
gc_setLineWidth(2) gc_setLineWidth(2)
gc_setColor(1,.5,.7,.3) gc_setColor(1,.5,.7,.3)

View File

@@ -1,4 +1,4 @@
--Firework -- Firework
local gc=love.graphics local gc=love.graphics
local gc_clear=gc.clear local gc_clear=gc.clear
local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth
@@ -37,7 +37,7 @@ function back.update(dt)
local x,y,color=F.x,F.y,F.color local x,y,color=F.x,F.y,F.color
if F.big then if F.big then
SFX.play('fall',.5) SFX.play('fall',.5)
for _=1,rnd(62,126)do for _=1,rnd(62,126) do
ins(particle,{ ins(particle,{
x=x,y=y, x=x,y=y,
color=color, color=color,
@@ -48,7 +48,7 @@ function back.update(dt)
end end
else else
SFX.play('clear_1',.4) SFX.play('clear_1',.4)
for _=1,rnd(16,26)do for _=1,rnd(16,26) do
ins(particle,{ ins(particle,{
x=x,y=y, x=x,y=y,
color=color, color=color,

View File

@@ -1,4 +1,4 @@
--Customizable grey background -- Customizable grey background
local back={} local back={}
local r,g,b=.26,.26,.26 local r,g,b=.26,.26,.26
function back.draw() function back.draw()

View File

@@ -1,4 +1,4 @@
--Flash after random time -- Flash after random time
local back={} local back={}
local t local t

View File

@@ -0,0 +1,41 @@
--Space with stars
local gc=love.graphics
local circle,setColor,hsv=gc.circle,gc.setColor,COLOR.hsv
local sin,cos=math.sin,math.cos
local back={}
local sDist,sRev={},{} -- star data in SoA [distance from center, revolution progress, color]
function back.init()
if sDist[1]then return end
local max
for i=0,20 do
max=16*(i+1)
for j=1,max do
sDist[#sDist+1]=i+math.random()
sRev[#sRev+1]=MATH.tau*j/max+MATH.tau*math.random()/max
end
end
end
function back.update(dt)
for i=1,#sDist do
sRev[i]=(sRev[i]+dt/(sDist[i]+1))%MATH.tau
end
end
function back.draw()
gc.clear()
gc.translate(SCR.cx,SCR.cy)
gc.scale(SCR.k)
gc.rotate(1)
for i=1,#sDist do
local d,r=sDist[i],sRev[i]
if d<5 then
setColor(hsv(.088,(d-2)/7,1,.7))
else
setColor(hsv(.572,d/70+.1,(22-d)/12,.7))
end
circle('fill',8*d*cos(r),24*d*sin(r),3)
end
end
return back

View File

@@ -1,4 +1,4 @@
--Light-dark -- Light-dark
local sin=math.sin local sin=math.sin
local back={} local back={}

View File

@@ -1,4 +1,4 @@
--A lantern background which is full of festive atmosphere. Lantern image by ScF -- A lantern background which is full of festive atmosphere. Lantern image by ScF
local int,rnd=math.floor,math.random local int,rnd=math.floor,math.random
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local mDraw=mDraw local mDraw=mDraw

View File

@@ -1,4 +1,4 @@
--Space with stars -- Space with stars
local back={} local back={}
local upCover do local upCover do

View File

@@ -1,4 +1,4 @@
--Lightning -- Lightning
local back={} local back={}
local t local t

View File

@@ -1,4 +1,4 @@
--Fast lightning + spining tetromino -- Fast lightning + spining tetromino
local int,rnd=math.floor,math.random local int,rnd=math.floor,math.random
local back={} local back={}

View File

@@ -1,4 +1,4 @@
--Black-White grid -- Black-White grid
local gc=love.graphics local gc=love.graphics
local gc_clear,gc_scale=gc.clear,gc.scale local gc_clear,gc_scale=gc.clear,gc.scale
local gc_setColor=gc.setColor local gc_setColor=gc.setColor
@@ -9,7 +9,7 @@ local ceil=math.ceil
local back={} local back={}
local t local t
local matrixT={}for i=1,50 do matrixT[i]={}for j=1,50 do matrixT[i][j]=love.math.noise(i,j)+2 end end local matrixT={} for i=1,50 do matrixT[i]={} for j=1,50 do matrixT[i][j]=love.math.noise(i,j)+2 end end
function back.init() function back.init()
t=math.random()*2600 t=math.random()*2600
end end
@@ -21,7 +21,7 @@ function back.draw()
local k=SCR.k local k=SCR.k
gc_scale(k) gc_scale(k)
local Y=ceil(SCR.h/80/k) local Y=ceil(SCR.h/80/k)
for x=1,ceil(SCR.w/80/k)do for x=1,ceil(SCR.w/80/k) do
for y=1,Y do for y=1,Y do
gc_setColor(1,1,1,sin(x+matrixT[x][y]*t)*.04+.04) gc_setColor(1,1,1,sin(x+matrixT[x][y]*t)*.04+.04)
gc_rectangle('fill',80*x,80*y,-80,-80) gc_rectangle('fill',80*x,80*y,-80,-80)

View File

@@ -0,0 +1,145 @@
local gc=love.graphics
local hsv=COLOR.hsv
local circle,push,pop,rot,translate,setColor=gc.circle,gc.push,gc.pop,gc.rotate,gc.translate,gc.setColor
local rnd,sin,cos,log,ceil=math.random,math.sin,math.cos,math.log,math.ceil
local back={}
local qX,qY,qdX,qdY={},{},{},{} -- quark data in SoA [size, X, Y, dx, dy, color]
local ptcclr={{1,0,0},{0,1,0},{0,0,1}}
local apcclr={{0,1,1},{1,0,1},{1,1,0}}
local blasts={} -- data about annihilation blasts from particles and antiparticles colliding
local ptc={} -- particle-antiparticle data (antiparticle is a mirror of particle)
local nextpair
local W,H,size
local quarkCount=400
local function spawnQuarkRandom(i)
qX[i]=rnd(W)-10 -- X
qY[i]=rnd(H)-10 -- Y
local theta=rnd()*MATH.tau
qdX[i]=cos(theta)*300 -- dx
qdY[i]=sin(theta)*300 -- dy
end
local function spawnQuarkEdge(i)
local side=rnd(4)
if side==1 then -- Up edge of screen
qX[i]=rnd(SCR.x-10,SCR.ex+10)
qY[i]=SCR.y-10
elseif side==2 then -- Right edge of screen
qX[i]=SCR.ex+10
qY[i]=rnd(SCR.y-10,SCR.ey+10)
elseif side==3 then -- Down edge of screen
qX[i]=rnd(SCR.x-10,SCR.ex+10)
qY[i]=SCR.ey+10
elseif side==4 then -- Left edge of screen
qX[i]=SCR.x-10
qY[i]=rnd(SCR.y-10,SCR.ey+10)
end
local theta=rnd()*MATH.tau
qdX[i]=cos(theta)*300 -- dx
qdY[i]=sin(theta)*300 -- dy
end
local function spawnParticlePair()
ptc[#ptc+1]={
x=rnd(W)-10,
y=rnd(H)-10,
dist=0,
theta=rnd()*MATH.tau,
v=500,
c=rnd(3),
}
end
local function spawnBlast(_x,_y)
blasts[#blasts+1]={x=_x,y=_y,t=0}
end
function back.init()
qX,qY,qdX,qdY={},{},{},{}
blasts={}
ptc={}
nextpair=0
BG.resize(SCR.w,SCR.h)
end
function back.resize(w,h)
W,H=w+20,h+20
for i=1,quarkCount do spawnQuarkRandom(i) end
size=2.6*SCR.k
end
function back.update(dt)
-- Move far-away quarks
for i=1,quarkCount do
qX[i]=qX[i]+qdX[i]*dt
qY[i]=qY[i]+qdY[i]*dt
if qX[i]<SCR.x-26 or qX[i]>SCR.ex+26 or qY[i]<SCR.y-26 or qY[i]>SCR.ey+26 then
spawnQuarkEdge(i)
end
end
-- Particle pair attraction & destruction
for i=#ptc,1,-1 do
local p=ptc[i]
if p then
p.dist=p.dist+p.v*dt
p.v=p.v-p.dist^2*dt
-- Destroy colliding particle pairs
if p.dist<=10 and p.v<=0 then
spawnBlast(p.x,p.y)
table.remove(ptc,i)
end
end
end
-- Age blasts, delete old blasts
for i=#blasts,1,-1 do
if blasts[i] then
blasts[i].t=blasts[i].t+dt
if blasts[i].t>=1 then
table.remove(blasts,i)
end
end
end
-- Spawn particle pairs
nextpair=nextpair-dt
if nextpair<=0 then
spawnParticlePair()
nextpair=rnd()*4
end
end
function back.draw()
gc.clear(.08,.04,.01)
translate(-10,-10)
-- Draw quarks in R/G/B
setColor(1,0,0,.8) for i=1, math.floor(quarkCount/3) do circle('fill',qX[i],qY[i],size) end
setColor(0,1,0,.8) for i=math.floor(quarkCount/3)+1, math.floor(quarkCount*2/3) do circle('fill',qX[i],qY[i],size) end
setColor(0,0,1,.8) for i=math.floor(quarkCount*2/3)+1,quarkCount do circle('fill',qX[i],qY[i],size) end
for i=1,#ptc do
local p=ptc[i]
push()
translate(p.x,p.y)
rot(p.theta)
setColor(ptcclr[p.c])
circle('fill', p.dist,0,4*size)
setColor(apcclr[p.c])
circle('fill',-p.dist,0,4*size)
pop()
end
for i=1,#blasts do
local t=blasts[i].t
setColor(hsv(-80*t,1-1.7*log(5*t,10),1,1-t))
circle('fill',blasts[i].x,blasts[i].y,62*t^.3)
end
end
function back.discard()
qX,qY,qdX,qdY,qC=nil
ptc,blasts=nil
collectgarbage()
end
return back

View File

@@ -1,14 +1,14 @@
--Colorful RGB -- Colorful RGB
local back={} local back={}
local shader=SHADER.rgb1 local shader=SHADER.rgb1
local t local t
function back.init() function back.init()
t=math.random()*260 t=math.random()*2600
BG.resize(SCR.w,SCR.h) BG.resize(SCR.w,SCR.h)
end end
function back.update(dt) function back.update(dt)
t=(t+dt)%2600 t=(t+dt)%6200
end end
function back.draw() function back.draw()
GC.clear(.08,.08,.084) GC.clear(.08,.08,.084)

View File

@@ -1,14 +1,14 @@
--Blue RGB -- Blue RGB
local back={} local back={}
local shader=SHADER.rgb2 local shader=SHADER.rgb2
local t local t
function back.init() function back.init()
t=math.random()*260 t=math.random()*2600
BG.resize(SCR.w,SCR.h) BG.resize(SCR.w,SCR.h)
end end
function back.update(dt) function back.update(dt)
t=(t+dt)%2600 t=(t+dt)%6200
end end
function back.draw() function back.draw()
GC.clear(.08,.08,.084) GC.clear(.08,.08,.084)

View File

@@ -1,4 +1,4 @@
--Changing pure color -- Changing pure color
local sin=math.sin local sin=math.sin
local back={} local back={}

View File

@@ -1,4 +1,4 @@
--Snow -- Snow
local gc=love.graphics local gc=love.graphics
local ellipse=gc.ellipse local ellipse=gc.ellipse
local rnd=math.random local rnd=math.random

View File

@@ -1,4 +1,4 @@
--Space with stars -- Space with stars
local gc=love.graphics local gc=love.graphics
local rectangle=gc.rectangle local rectangle=gc.rectangle
local rnd=math.random local rnd=math.random
@@ -15,16 +15,16 @@ function back.resize(w,h)
local S=stars local S=stars
for i=1,1260,5 do for i=1,1260,5 do
local s=rnd(26,40)*.1 local s=rnd(26,40)*.1
S[i]=s*SCR.k --Size S[i]=s*SCR.k -- Size
S[i+1]=rnd(W)-10 --X S[i+1]=rnd(W)-10 -- X
S[i+2]=rnd(H)-10 --Y S[i+2]=rnd(H)-10 -- Y
S[i+3]=(rnd()-.5)*.01*s--Vx S[i+3]=(rnd()-.5)*.01*s-- Vx
S[i+4]=(rnd()-.5)*.01*s--Vy S[i+4]=(rnd()-.5)*.01*s-- Vy
end end
end end
function back.update(dt) function back.update(dt)
local S=stars local S=stars
--Star moving -- Star moving
for i=1,1260,5 do for i=1,1260,5 do
S[i+1]=(S[i+1]+S[i+3]*dt*60)%W S[i+1]=(S[i+1]+S[i+3]*dt*60)%W
S[i+2]=(S[i+2]+S[i+4]*dt*60)%H S[i+2]=(S[i+2]+S[i+4]*dt*60)%H
@@ -32,7 +32,7 @@ function back.update(dt)
end end
function back.draw() function back.draw()
gc.clear(.08,.08,.084) gc.clear(.08,.08,.084)
if not stars[1]then return end if not stars[1] then return end
gc.translate(-10,-10) gc.translate(-10,-10)
gc.setColor(1,1,1,.6) gc.setColor(1,1,1,.6)
for i=1,1260,5 do for i=1,1260,5 do

View File

@@ -1,4 +1,4 @@
--Cool Tunnel -- Cool Tunnel
local rnd=math.random local rnd=math.random
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local back={} local back={}

View File

@@ -1,4 +1,4 @@
--Welcome to Techmino -- Welcome to Techmino
local sin=math.sin local sin=math.sin
local back={} local back={}

View File

@@ -1,4 +1,4 @@
--Flandre's wing -- Flandre's wing
local back={} local back={}
local crystal_img,crystals local crystal_img,crystals
local wingColor={ local wingColor={

View File

@@ -38,8 +38,8 @@ local FCL={
local LclearScore={[0]=0,-200,-150,-100,200} local LclearScore={[0]=0,-200,-150,-100,200}
local HclearScore={[0]=0,100,140,200,500} local HclearScore={[0]=0,100,140,200,500}
local function _ifoverlapAI(f,bk,x,y) local function _ifoverlapAI(f,bk,x,y)
for i=1,#bk do for j=1,#bk[1]do for i=1,#bk do for j=1,#bk[1] do
if f[y+i-1]and bk[i][j]and f[y+i-1][x+j-1]>0 then if f[y+i-1] and bk[i][j] and f[y+i-1][x+j-1]>0 then
return true return true
end end
end end end end
@@ -74,7 +74,7 @@ local function _getScore(field,cb,cy)
clear=clear+1 clear=clear+1
::CONTINUE_notFull:: ::CONTINUE_notFull::
end end
if #field==0 then--PC if #field==0 then-- PC
return 1e99 return 1e99
end end
for x=1,10 do for x=1,10 do
@@ -116,10 +116,10 @@ local function _getScore(field,cb,cy)
-#field*30 -#field*30
-#cb*15 -#cb*15
+(#field>10 and +(#field>10 and
HclearScore[clear]--Clearing HclearScore[clear]-- Clearing
-hole*70--Hole -hole*70-- Hole
-cy*50--Height -cy*50-- Height
-sdh--Sum of DeltaH -sdh-- Sum of DeltaH
or or
LclearScore[clear] LclearScore[clear]
-hole*100 -hole*100
@@ -139,10 +139,10 @@ local bot_9s={}
function bot_9s.thread(bot) function bot_9s.thread(bot)
local P,data,keys=bot.P,bot.data,bot.keys local P,data,keys=bot.P,bot.data,bot.keys
while true do while true do
--Thinking -- Thinking
yield() yield()
local Tfield={}--Test field local Tfield={}-- Test field
local best={x=1,dir=0,hold=false,score=-1e99}--Best method local best={x=1,dir=0,hold=false,score=-1e99}-- Best method
local field_org=P.field local field_org=P.field
for i=1,#field_org do for i=1,#field_org do
Tfield[i]=getRow(0) Tfield[i]=getRow(0)
@@ -152,33 +152,33 @@ function bot_9s.thread(bot)
end end
for ifhold=0,data.hold and P.gameEnv.holdCount>0 and 1 or 0 do for ifhold=0,data.hold and P.gameEnv.holdCount>0 and 1 or 0 do
--Get block id -- Get block id
local bn local bn
if ifhold==0 then if ifhold==0 then
bn=P.cur and P.cur.id bn=P.cur and P.cur.id
else else
bn=P.holdQueue[1]and P.holdQueue[1].id or P.nextQueue[1]and P.nextQueue[1].id bn=P.holdQueue[1] and P.holdQueue[1].id or P.nextQueue[1] and P.nextQueue[1].id
end end
if bn then if bn then
for dir=0,dirCount[bn]do--Each dir for dir=0,dirCount[bn] do-- Each dir
local cb=BLOCKS[bn][dir] local cb=BLOCKS[bn][dir]
for cx=1,11-#cb[1]do--Each pos for cx=1,11-#cb[1] do-- Each pos
local cy=#Tfield+1 local cy=#Tfield+1
--Move to bottom -- Move to bottom
while cy>1 and not _ifoverlapAI(Tfield,cb,cx,cy-1)do while cy>1 and not _ifoverlapAI(Tfield,cb,cx,cy-1) do
cy=cy-1 cy=cy-1
end end
--Simulate lock -- Simulate lock
for i=1,#cb do for i=1,#cb do
local y=cy+i-1 local y=cy+i-1
if not Tfield[y]then if not Tfield[y] then
Tfield[y]=getRow(0) Tfield[y]=getRow(0)
end end
local L=Tfield[y] local L=Tfield[y]
for j=1,#cb[1]do for j=1,#cb[1] do
if cb[i][j]then if cb[i][j] then
L[cx+j-1]=1 L[cx+j-1]=1
end end
end end
@@ -194,7 +194,7 @@ function bot_9s.thread(bot)
end end
if not best.bn then return 1 end if not best.bn then return 1 end
--Release cache -- Release cache
while #Tfield>0 do while #Tfield>0 do
discardRow(rem(Tfield,1)) discardRow(rem(Tfield,1))
end end
@@ -207,7 +207,7 @@ function bot_9s.thread(bot)
end end
ins(keys,6) ins(keys,6)
--Check if time to change target -- Check if time to change target
yield() yield()
if P.aiRND:random()<.00126 then if P.aiRND:random()<.00126 then
P:changeAtkMode(P.aiRND:random()<.85 and 1 or #P.atker>3 and 4 or P.aiRND:random()<.3 and 2 or 3) P:changeAtkMode(P.aiRND:random()<.85 and 1 or #P.atker>3 and 4 or P.aiRND:random()<.3 and 2 or 3)

View File

@@ -11,9 +11,9 @@ function bot_cc:checkDest(b2b,atk,exblock,yomi)
local dest=self.P.destFX local dest=self.P.destFX
if not dest then return end if not dest then return end
if not (dest.b2b==b2b and dest.attack==atk and dest.extra==exblock) then if not (dest.b2b==b2b and dest.attack==atk and dest.extra==exblock) then
print(('hope: %s %s %s'):format(dest.b2b,dest.attack,dest.extra)) -- print(('hope: %s %s %s'):format(dest.b2b,dest.attack,dest.extra))
print(('real: %s %s %s'):format(b2b,atk,exblock)) -- print(('real: %s %s %s'):format(b2b,atk,exblock))
print(yomi) -- print(yomi)
self:lockWrongPlace() self:lockWrongPlace()
self.P.destFX=nil self.P.destFX=nil
return return
@@ -21,7 +21,7 @@ function bot_cc:checkDest(b2b,atk,exblock,yomi)
local CB=self.P.cur.bk local CB=self.P.cur.bk
for k=1,#dest,2 do for k=1,#dest,2 do
local r=CB[dest[k+1]-self.P.curY+2] local r=CB[dest[k+1]-self.P.curY+2]
if not r or not r[dest[k]-self.P.curX+2]then if not r or not r[dest[k]-self.P.curX+2] then
print('wrong place') print('wrong place')
self:lockWrongPlace() self:lockWrongPlace()
self.P.destFX=nil self.P.destFX=nil
@@ -50,11 +50,11 @@ function bot_cc:thread()
local P,keys=self.P,self.keys local P,keys=self.P,self.keys
local ccBot=self.ccBot local ccBot=self.ccBot
while true do while true do
--Start thinking -- Start thinking
yield() yield()
ccBot:think() ccBot:think()
--Poll keys -- Poll keys
local success,result,dest,hold,move,b2b,attack,extra,spawn local success,result,dest,hold,move,b2b,attack,extra,spawn
repeat repeat
yield() yield()
@@ -73,10 +73,10 @@ function bot_cc:thread()
dest.extra = extra dest.extra = extra
dest.spawn = spawn dest.spawn = spawn
P.destFX=dest P.destFX=dest
if hold then--Hold if hold then-- Hold
keys[1]=8 keys[1]=8
end end
while move[1]do while move[1] do
local m=rem(move,1) local m=rem(move,1)
if m<4 then if m<4 then
ins(keys,m+1) ins(keys,m+1)
@@ -89,7 +89,7 @@ function bot_cc:thread()
ins(keys,6) ins(keys,6)
end end
--Check if time to change target -- Check if time to change target
yield() yield()
if P.aiRND:random()<.00126 then if P.aiRND:random()<.00126 then
P:changeAtkMode(P.aiRND:random()<.85 and 1 or #P.atker>3 and 4 or P.aiRND:random()<.3 and 2 or 3) P:changeAtkMode(P.aiRND:random()<.85 and 1 or #P.atker>3 and 4 or P.aiRND:random()<.3 and 2 or 3)
@@ -105,7 +105,7 @@ function bot_cc:updateField()
end end end end
while i<=400 do F[i],i=false,i+1 end while i<=400 do F[i],i=false,i+1 end
local y = P:getNextSpawn()-1 local y = P:getNextSpawn()-1
if not pcall(self.ccBot.reset,self.ccBot,F,P.b2b,P.combo,P.stat.pc,P.stat.row,y)then if not pcall(self.ccBot.reset,self.ccBot,F,P.b2b,P.combo,P.stat.pc,P.stat.row,y) then
print("CC is dead ("..P.id..")","error") print("CC is dead ("..P.id..")","error")
for y=#F0,1,-1 do for y=#F0,1,-1 do
local s="" local s=""

View File

@@ -14,9 +14,9 @@ function baseBot.update(bot)
local keys=bot.keys local keys=bot.keys
if P.control and P.cur then if P.control and P.cur then
bot.delay=bot.delay-1 bot.delay=bot.delay-1
if not keys[1]then if not keys[1] then
if bot.runningThread then if bot.runningThread then
if not pcall(bot.runningThread)then if not pcall(bot.runningThread) then
bot.runningThread=false bot.runningThread=false
end end
else else
@@ -61,18 +61,18 @@ local AISpeed={60,50,42,34,27,21,16,12,9,6}
} }
]] ]]
function BOT.template(arg) function BOT.template(arg)
if arg.type=='CC'then if arg.type=='CC' then
return{ return {
type='CC', type='CC',
next=arg.next, next=arg.next,
hold=arg.hold, hold=arg.hold,
delay=AISpeed[arg.speedLV], delay=AISpeed[arg.speedLV],
node=arg.node, node=arg.node,
bag=(arg.randomizer or'bag')=='bag', bag=(arg.randomizer or 'bag')=='bag',
_20G=arg._20G, _20G=arg._20G,
} }
elseif arg.type=='9S'then elseif arg.type=='9S' then
return{ return {
type='9S', type='9S',
delay=math.floor(AISpeed[arg.speedLV]), delay=math.floor(AISpeed[arg.speedLV]),
hold=arg.hold, hold=arg.hold,
@@ -82,7 +82,7 @@ end
function BOT.new(P,data) function BOT.new(P,data)
local bot={P=P,data=data} local bot={P=P,data=data}
if data.type=="CC"then if data.type=="CC" then
P:setRS('TRS') P:setRS('TRS')
bot.keys={} bot.keys={}
bot.bufferedNexts={} bot.bufferedNexts={}
@@ -107,8 +107,8 @@ function BOT.new(P,data)
local cc_lua=require"parts.bot.bot_cc" local cc_lua=require"parts.bot.bot_cc"
setmetatable(bot,{__index=function(self,k) setmetatable(bot,{__index=function(self,k)
return return
self.ccBot[k]and function(_,...)self.ccBot[k](self.ccBot,...)end or self.ccBot[k] and function(_,...)self.ccBot[k](self.ccBot,...) end or
cc_lua[k]and function(_,...)cc_lua[k](self,...)end or cc_lua[k] and function(_,...)cc_lua[k](self,...) end or
assert(baseBot[k],"No CC action called "..k) assert(baseBot[k],"No CC action called "..k)
end}) end})
@@ -127,7 +127,7 @@ function BOT.new(P,data)
end end
bot.runningThread=coroutine.wrap(cc_lua.thread) bot.runningThread=coroutine.wrap(cc_lua.thread)
bot.runningThread(bot) bot.runningThread(bot)
else--if data.type=="9S"then--9s or else else-- if data.type=="9S" then-- 9s or else
TABLE.cover(baseBot,bot) TABLE.cover(baseBot,bot)
TABLE.cover(require"parts.bot.bot_9s",bot) TABLE.cover(require"parts.bot.bot_9s",bot)
P:setRS('TRS') P:setRS('TRS')

View File

@@ -1,5 +1,5 @@
local L={ local L={
zChan={--F0000~F003F zChan={-- F0000~F003F
none= 0xF0000, none= 0xF0000,
normal= 0xF0001, normal= 0xF0001,
full= 0xF0002, full= 0xF0002,
@@ -24,7 +24,7 @@ local L={
thinking= 0xF0015, thinking= 0xF0015,
spark= 0xF0016, spark= 0xF0016,
}, },
mino={--F0040~F007F mino={-- F0040~F007F
Z=0xF0040, Z=0xF0040,
S=0xF0041, S=0xF0041,
J=0xF0042, J=0xF0042,
@@ -57,7 +57,7 @@ local L={
I2=0xF005B, I2=0xF005B,
O1=0xF005C, O1=0xF005C,
}, },
icon={--F0080~F00FF icon={-- F0080~F00FF
menu= 0xF0080, menu= 0xF0080,
music= 0xF0081, music= 0xF0081,
language= 0xF0082, language= 0xF0082,
@@ -131,7 +131,7 @@ local L={
garbage= 0xF00C6, garbage= 0xF00C6,
copy= 0xF00C7, copy= 0xF00C7,
}, },
key={--F0100~F017F key={-- F0100~F017F
macCmd= 0xF0100, macCmd= 0xF0100,
macOpt= 0xF0101, macOpt= 0xF0101,
macCtrl= 0xF0102, macCtrl= 0xF0102,
@@ -172,7 +172,7 @@ local L={
macPgdnAlt= 0xF0125, macPgdnAlt= 0xF0125,
iecPower= 0xF0126, iecPower= 0xF0126,
}, },
controller={--F0180~F01FF controller={-- F0180~F01FF
xbox= 0xF0180, xbox= 0xF0180,
lt= 0xF0181, lt= 0xF0181,
rt= 0xF0182, rt= 0xF0182,
@@ -212,7 +212,7 @@ local L={
psCreate= 0xF01A4, psCreate= 0xF01A4,
psOption= 0xF01A5, psOption= 0xF01A5,
}, },
mahjong={--F0200~F027F mahjong={-- F0200~F027F
m1= 0xF0200, m1= 0xF0200,
m2= 0xF0201, m2= 0xF0201,
m3= 0xF0202, m3= 0xF0202,

View File

@@ -1,7 +1,7 @@
return{ return {
version=VERSION.code, version=VERSION.code,
--Basic -- Basic
drop=1e99, drop=1e99,
lock=1e99, lock=1e99,
wait=0, wait=0,
@@ -9,17 +9,17 @@ return{
hang=5, hang=5,
hurry=1e99, hurry=1e99,
--Control -- Control
nextCount=6, nextCount=6,
holdMode='hold', holdMode='hold',
holdCount=1, holdCount=1,
infHold=true, infHold=true,
phyHold=false, phyHold=false,
--Visual -- Visual
bone=false, bone=false,
--Rule -- Rule
sequence='bag', sequence='bag',
lockout=false, lockout=false,
fieldH=20, fieldH=20,
@@ -40,7 +40,7 @@ return{
garbageSpeed=1, garbageSpeed=1,
missionKill=false, missionKill=false,
--Else -- Else
bg='blockrain', bg='blockrain',
bgm='hang out', bgm='hang out',

View File

@@ -5,8 +5,8 @@ local ins=table.insert
local BAG,FIELD,MISSION,CUSTOMENV,GAME=BAG,FIELD,MISSION,CUSTOMENV,GAME local BAG,FIELD,MISSION,CUSTOMENV,GAME=BAG,FIELD,MISSION,CUSTOMENV,GAME
local DATA={} local DATA={}
--Sep symbol: 33 (!) -- Sep symbol: 33 (!)
--Safe char: 34~126 -- Safe char: 34~126
--[[ --[[
Count: 34~96 Count: 34~96
Block: 97~125 Block: 97~125
@@ -18,7 +18,7 @@ function DATA.copySequence()
local count=1 local count=1
for i=1,#BAG+1 do for i=1,#BAG+1 do
if BAG[i+1]~=BAG[i]or count==64 then if BAG[i+1]~=BAG[i] or count==64 then
str=str..char(96+BAG[i]) str=str..char(96+BAG[i])
if count>1 then if count>1 then
str=str..char(32+count) str=str..char(32+count)
@@ -66,14 +66,14 @@ local fieldMeta={__index=function(self,h)
end end
return self[h] return self[h]
end} end}
function DATA.newBoard(f)--Generate a new board function DATA.newBoard(f)-- Generate a new board
return setmetatable(f and TABLE.shift(f)or{},fieldMeta) return setmetatable(f and TABLE.shift(f) or{},fieldMeta)
end end
function DATA.copyBoard(page)--Copy the [page] board function DATA.copyBoard(page)-- Copy the [page] board
local F=FIELD[page or 1] local F=FIELD[page or 1]
local str="" local str=""
--Encode field -- Encode field
for y=1,#F do for y=1,#F do
local S="" local S=""
local L=F[y] local L=F[y]
@@ -91,25 +91,25 @@ function DATA.copyBoards()
end end
return table.concat(out,"!") return table.concat(out,"!")
end end
function DATA.pasteBoard(str,page)--Paste [str] data to [page] board function DATA.pasteBoard(str,page)-- Paste [str] data to [page] board
if not page then if not page then
page=1 page=1
end end
if not FIELD[page]then if not FIELD[page] then
FIELD[page]=DATA.newBoard() FIELD[page]=DATA.newBoard()
end end
local F=FIELD[page] local F=FIELD[page]
--Decode -- Decode
str=STRING.unpackBin(str) str=STRING.unpackBin(str)
if not str then return end if not str then return end
local fX,fY=1,1--*ptr for Field(r*10+(c-1)) local fX,fY=1,1-- *ptr for Field(r*10+(c-1))
local p=1 local p=1
while true do while true do
local b=byte(str,p)--1byte local b=byte(str,p)-- 1byte
--Str end -- Str end
if not b then if not b then
if fX~=1 then if fX~=1 then
return return
@@ -118,16 +118,16 @@ function DATA.pasteBoard(str,page)--Paste [str] data to [page] board
end end
end end
local id=b%32-1--Block id local id=b%32-1-- Block id
if id>26 then return end--Illegal blockid if id>26 then return end-- Illegal blockid
b=int(b/32)--Mode id b=int(b/32)-- Mode id
F[fY][fX]=id F[fY][fX]=id
if fX<10 then if fX<10 then
fX=fX+1 fX=fX+1
else else
fY=fY+1 fY=fY+1
if fY>20 then break end if fY>60 then break end
fX=1 fX=1
end end
p=p+1 p=p+1
@@ -158,7 +158,7 @@ function DATA.copyMission()
local count=1 local count=1
for i=1,#MISSION+1 do for i=1,#MISSION+1 do
if MISSION[i+1]~=MISSION[i]or count==13 then if MISSION[i+1]~=MISSION[i] or count==13 then
_=33+MISSION[i] _=33+MISSION[i]
str=str..char(_) str=str..char(_)
if count>1 then if count>1 then
@@ -186,7 +186,7 @@ function DATA.pasteMission(str)
end end
else else
if b>=34 and b<=114 then if b>=34 and b<=114 then
if ENUM_MISSION[reg]then if ENUM_MISSION[reg] then
ins(MISSION,reg) ins(MISSION,reg)
reg=b-33 reg=b-33
else else
@@ -211,8 +211,8 @@ function DATA.copyQuestArgs()
local ENV=CUSTOMENV local ENV=CUSTOMENV
local str="".. local str=""..
ENV.holdCount.. ENV.holdCount..
(ENV.ospin and"O"or"Z").. (ENV.ospin and "O" or "Z")..
(ENV.missionKill and"M"or"Z").. (ENV.missionKill and "M" or "Z")..
ENV.sequence ENV.sequence
return str return str
end end
@@ -252,15 +252,15 @@ function DATA.dumpRecording(list,ptr)
local out="" local out=""
local buffer,buffer2="" local buffer,buffer2=""
if not ptr then ptr=1 end if not ptr then ptr=1 end
local prevFrm=list[ptr-2]or 0 local prevFrm=list[ptr-2] or 0
while list[ptr]do while list[ptr] do
--Flush buffer -- Flush buffer
if #buffer>10 then if #buffer>10 then
out=out..buffer out=out..buffer
buffer="" buffer=""
end end
--Encode time -- Encode time
local t=list[ptr]-prevFrm local t=list[ptr]-prevFrm
prevFrm=list[ptr] prevFrm=list[ptr]
if t>=128 then if t>=128 then
@@ -275,7 +275,7 @@ function DATA.dumpRecording(list,ptr)
buffer=buffer..char(t) buffer=buffer..char(t)
end end
--Encode event -- Encode event
t=list[ptr+1] t=list[ptr+1]
if t>=128 then if t>=128 then
buffer2=char(t%128) buffer2=char(t%128)
@@ -289,7 +289,7 @@ function DATA.dumpRecording(list,ptr)
buffer=buffer..char(t) buffer=buffer..char(t)
end end
--Step -- Step
ptr=ptr+2 ptr=ptr+2
end end
return out..buffer,ptr return out..buffer,ptr
@@ -298,10 +298,10 @@ function DATA.pumpRecording(str,L)
local len=#str local len=#str
local p=1 local p=1
local curFrm=L[#L-1]or 0 local curFrm=L[#L-1] or 0
local code local code
while p<=len do while p<=len do
--Read delta time -- Read delta time
code=0 code=0
local b=byte(str,p) local b=byte(str,p)
while b>=128 do while b>=128 do
@@ -324,7 +324,7 @@ function DATA.pumpRecording(str,L)
p=p+1 p=p+1
end end
end end
do--function DATA.saveReplay() do-- function DATA.saveReplay()
local noRecList={"custom","solo","round","techmino"} local noRecList={"custom","solo","round","techmino"}
local function _getModList() local function _getModList()
local res={} local res={}
@@ -336,17 +336,17 @@ do--function DATA.saveReplay()
return res return res
end end
function DATA.saveReplay() function DATA.saveReplay()
--Filtering modes that cannot be saved -- Filtering modes that cannot be saved
for _,v in next,noRecList do for _,v in next,noRecList do
if GAME.curModeName:find(v)then if GAME.curModeName:find(v) then
MES.new('error',"Cannot save recording of this mode now!") MES.new('error',"Cannot save recording of this mode now!")
return return
end end
end end
--Write file -- Write file
local fileName=os.date("replay/%Y_%m_%d_%H%M%S.rep") local fileName=os.date("replay/%Y_%m_%d_%H%M%S.rep")
if not love.filesystem.getInfo(fileName)then if not love.filesystem.getInfo(fileName) then
love.filesystem.write(fileName, love.filesystem.write(fileName,
love.data.compress('string','zlib', love.data.compress('string','zlib',
JSON.encode{ JSON.encode{
@@ -371,29 +371,29 @@ do--function DATA.saveReplay()
end end
function DATA.parseReplay(fileName,ifFull) function DATA.parseReplay(fileName,ifFull)
local fileData local fileData
--Read file -- Read file
fileData=love.filesystem.read(fileName) fileData=love.filesystem.read(fileName)
return DATA.parseReplayData(fileName,fileData,ifFull) return DATA.parseReplayData(fileName,fileData,ifFull)
end end
function DATA.parseReplayData(fileName,fileData,ifFull) function DATA.parseReplayData(fileName,fileData,ifFull)
local success,metaData,rep local success,metaData,rep
if not(fileData and #fileData>0)then goto BREAK_cannotParse end if not (fileData and #fileData>0) then goto BREAK_cannotParse end
--Decompress file -- Decompress file
success,fileData=pcall(love.data.decompress,'string','zlib',fileData) success,fileData=pcall(love.data.decompress,'string','zlib',fileData)
if not success then goto BREAK_cannotParse end if not success then goto BREAK_cannotParse end
--Load metadata -- Load metadata
metaData,fileData=STRING.readLine(fileData) metaData,fileData=STRING.readLine(fileData)
metaData=JSON.decode(metaData) metaData=JSON.decode(metaData)
if not metaData then goto BREAK_cannotParse end if not metaData then goto BREAK_cannotParse end
--Convert ancient replays -- Convert ancient replays
metaData.mode=MODE_UPDATE_MAP[metaData.mode]or metaData.mode metaData.mode=MODE_UPDATE_MAP[metaData.mode] or metaData.mode
if not MODES[metaData.mode]then goto BREAK_cannotParse end if not MODES[metaData.mode] then goto BREAK_cannotParse end
--Create replay object -- Create replay object
rep={ rep={
fileName=fileName, fileName=fileName,
available=true, available=true,
@@ -411,9 +411,9 @@ function DATA.parseReplayData(fileName,fileData,ifFull)
if ifFull then rep.data=fileData end if ifFull then rep.data=fileData end
do return rep end do return rep end
--Create unavailable replay object -- Create unavailable replay object
::BREAK_cannotParse:: ::BREAK_cannotParse::
return{ return {
fileName=fileName, fileName=fileName,
available=false, available=false,
} }

View File

@@ -1,4 +1,4 @@
return{ return {
mesDisp=function(P) mesDisp=function(P)
setFont(55) setFont(55)
GC.mStr(P.modeData.wave,63,200) GC.mStr(P.modeData.wave,63,200)
@@ -8,18 +8,18 @@ return{
end, end,
task=function(P) task=function(P)
while true do while true do
YIELD() coroutine.yield()
if P.control and P.atkBufferSum==0 then if P.control and P.atkBufferSum==0 then
local D=P.modeData local D=P.modeData
if D.wave==50 then if D.wave==50 then
P:win('finish') P:win('finish')
else else
if D.wave<20 then if D.wave<20 then
local t=1500-30*D.wave--1500~900 local t=1500-30*D.wave-- 1500~900
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(4,7)),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=3}) table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(4,7)),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=3})
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(3,8)),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=4}) table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(3,8)),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=4})
else else
local t=900-10*(D.wave-20)--900~600 local t=900-10*(D.wave-20)-- 900~600
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(10)),amount=14,countdown=t,cd0=t,time=0,sent=false,lv=4}) table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(10)),amount=14,countdown=t,cd0=t,time=0,sent=false,lv=4})
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(4,7)),amount=8,countdown=t,cd0=t,time=0,sent=false,lv=5}) table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(4,7)),amount=8,countdown=t,cd0=t,time=0,sent=false,lv=5})
end end

View File

@@ -1,4 +1,4 @@
return{ return {
mesDisp=function(P) mesDisp=function(P)
setFont(55) setFont(55)
GC.mStr(P.modeData.wave,63,200) GC.mStr(P.modeData.wave,63,200)
@@ -8,14 +8,14 @@ return{
end, end,
task=function(P) task=function(P)
while true do while true do
YIELD() coroutine.yield()
if P.control and P.atkBufferSum<4 then if P.control and P.atkBufferSum<4 then
local D=P.modeData local D=P.modeData
if D.wave==50 then if D.wave==50 then
P:win('finish') P:win('finish')
else else
local s local s
local t=800-10*D.wave--800~700~600~500 local t=800-10*D.wave-- 800~700~600~500
if D.wave<10 then if D.wave<10 then
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(5,6)),amount=9,countdown=t,cd0=t,time=0,sent=false,lv=3}) table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(5,6)),amount=9,countdown=t,cd0=t,time=0,sent=false,lv=3})
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(4,7)),amount=11,countdown=t,cd0=t+62,time=0,sent=false,lv=4}) table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(4,7)),amount=11,countdown=t,cd0=t+62,time=0,sent=false,lv=4})

View File

@@ -1,4 +1,4 @@
return{ return {
hook_drop=function(P) hook_drop=function(P)
if P.lastPiece.atk>0 then if P.lastPiece.atk>0 then
P:receive(nil,P.lastPiece.atk,0,generateLine(P.holeRND:random(10))) P:receive(nil,P.lastPiece.atk,0,generateLine(P.holeRND:random(10)))

View File

@@ -1,4 +1,4 @@
return{ return {
hook_drop=function(P) hook_drop=function(P)
if P.lastPiece.atk>0 then if P.lastPiece.atk>0 then
P:receive(nil,P.lastPiece.atk,120,generateLine(P.holeRND:random(10))) P:receive(nil,P.lastPiece.atk,120,generateLine(P.holeRND:random(10)))

View File

@@ -1,4 +1,4 @@
return{ return {
hook_drop=function(P) hook_drop=function(P)
if P.lastPiece.atk>0 then if P.lastPiece.atk>0 then
P:receive(nil,P.lastPiece.atk,30,generateLine(P.holeRND:random(10))) P:receive(nil,P.lastPiece.atk,30,generateLine(P.holeRND:random(10)))

View File

@@ -1,4 +1,4 @@
return{ return {
hook_drop=function(P) hook_drop=function(P)
if P.lastPiece.atk>0 then if P.lastPiece.atk>0 then
P:receive(nil,P.lastPiece.atk,60,generateLine(P.holeRND:random(10))) P:receive(nil,P.lastPiece.atk,60,generateLine(P.holeRND:random(10)))

View File

@@ -1,4 +1,4 @@
return{ return {
hook_drop=function(P) hook_drop=function(P)
if P.lastPiece.row>0 then if P.lastPiece.row>0 then
for _=1,#P.clearedRow do for _=1,#P.clearedRow do

View File

@@ -1,4 +1,4 @@
return{ return {
mesDisp=function(P) mesDisp=function(P)
mText(TEXTOBJ.techrash,63,420) mText(TEXTOBJ.techrash,63,420)
setFont(75) setFont(75)

View File

@@ -1,6 +1,6 @@
local rem=table.remove local rem=table.remove
return{ return {
mesDisp=function(P) mesDisp=function(P)
setFont(45) setFont(45)
GC.mStr(P.combo,63,310) GC.mStr(P.combo,63,310)

View File

@@ -1,4 +1,4 @@
return{ return {
hook_drop=function(P) hook_drop=function(P)
if P.lastPiece.row>0 then if P.lastPiece.row>0 then
for _=1,#P.clearedRow do for _=1,#P.clearedRow do

View File

@@ -1,4 +1,4 @@
return{ return {
hook_drop=function(P) hook_drop=function(P)
if P.lastPiece.row==0 then if P.lastPiece.row==0 then
P:lose() P:lose()

View File

@@ -1,4 +1,4 @@
return{ return {
mesDisp=function(P) mesDisp=function(P)
setFont(45) setFont(45)
GC.mStr(("%.1f"):format(P.stat.atk),63,190) GC.mStr(("%.1f"):format(P.stat.atk),63,190)

View File

@@ -1,9 +1,9 @@
return{ return {
hook_drop=function(P) hook_drop=function(P)
if P.garbageBeneath==0 then if P.garbageBeneath==0 then
local D=P.modeData local D=P.modeData
D.finished=D.finished+1 D.finished=D.finished+1
if FIELD[D.finished+1]then if FIELD[D.finished+1] then
P.waiting=26 P.waiting=26
for i=#P.field,1,-1 do for i=#P.field,1,-1 do
P.field[i],P.visTime[i]=nil P.field[i],P.visTime[i]=nil

View File

@@ -1,4 +1,4 @@
return{ return {
mesDisp=function(P) mesDisp=function(P)
setFont(55) setFont(55)
local r=10-P.stat.row local r=10-P.stat.row

View File

@@ -1,4 +1,4 @@
return{ return {
mesDisp=function(P) mesDisp=function(P)
setFont(55) setFont(55)
local r=100-P.stat.row local r=100-P.stat.row

View File

@@ -1,4 +1,4 @@
return{ return {
mesDisp=function(P) mesDisp=function(P)
setFont(55) setFont(55)
local r=1000-P.stat.row local r=1000-P.stat.row

View File

@@ -1,4 +1,4 @@
return{ return {
mesDisp=function(P) mesDisp=function(P)
setFont(55) setFont(55)
local r=20-P.stat.row local r=20-P.stat.row

View File

@@ -1,4 +1,4 @@
return{ return {
mesDisp=function(P) mesDisp=function(P)
setFont(55) setFont(55)
local r=200-P.stat.row local r=200-P.stat.row

View File

@@ -1,4 +1,4 @@
return{ return {
mesDisp=function(P) mesDisp=function(P)
setFont(55) setFont(55)
local r=40-P.stat.row local r=40-P.stat.row

View File

@@ -1,4 +1,4 @@
return{ return {
mesDisp=function(P) mesDisp=function(P)
setFont(55) setFont(55)
local r=400-P.stat.row local r=400-P.stat.row

View File

@@ -1,4 +1,4 @@
return{ return {
hook_drop=function(P) hook_drop=function(P)
if #PLY_ALIVE>1 then if #PLY_ALIVE>1 then
P.control=false P.control=false
@@ -13,7 +13,7 @@ return{
end end
end end
for i=1,#PLY_ALIVE do for i=1,#PLY_ALIVE do
if PLY_ALIVE[i].sid==(minMaxID==1e99 and minID or minMaxID)then if PLY_ALIVE[i].sid==(minMaxID==1e99 and minID or minMaxID) then
PLY_ALIVE[i].control=true PLY_ALIVE[i].control=true
return return
end end

View File

@@ -1,4 +1,4 @@
return{ return {
hook_drop=function(P) hook_drop=function(P)
if P.stat.piece%7==0 and #PLY_ALIVE>1 then if P.stat.piece%7==0 and #PLY_ALIVE>1 then
P.control=false P.control=false
@@ -13,7 +13,7 @@ return{
end end
end end
for i=1,#PLY_ALIVE do for i=1,#PLY_ALIVE do
if PLY_ALIVE[i].sid==(minMaxID==1e99 and minID or minMaxID)then if PLY_ALIVE[i].sid==(minMaxID==1e99 and minID or minMaxID) then
PLY_ALIVE[i].control=true PLY_ALIVE[i].control=true
return return
end end

View File

@@ -23,7 +23,7 @@ local function GetGravity(lvl)
lvl<29 and 2 or lvl<29 and 2 or
1 1
end end
return{ return {
das=16,arr=6, das=16,arr=6,
sddas=6,sdarr=6, sddas=6,sdarr=6,
irs=false,ims=false, irs=false,ims=false,

View File

@@ -23,7 +23,7 @@ local function GetGravity(lvl)
lvl<29 and 2 or lvl<29 and 2 or
1 1
end end
return{ return {
das=16,arr=6, das=16,arr=6,
sddas=3,sdarr=3, sddas=3,sdarr=3,
irs=false,ims=false, irs=false,ims=false,

View File

@@ -23,7 +23,7 @@ local function GetGravity(lvl)
lvl<29 and 2 or lvl<29 and 2 or
1 1
end end
return{ return {
das=16,arr=6, das=16,arr=6,
sddas=2,sdarr=2, sddas=2,sdarr=2,
irs=false,ims=false, irs=false,ims=false,
@@ -62,9 +62,9 @@ return{
local D=P.modeData local D=P.modeData
D.drought=P.lastPiece.id==7 and 0 or D.drought+1 D.drought=P.lastPiece.id==7 and 0 or D.drought+1
if P.stat.row>=D.target then if P.stat.row>=D.target then
--if D.target>=200 then -- if D.target>=200 then
D.lvl=D.lvl+1 D.lvl=D.lvl+1
--end -- end
local dropSpd=GetGravity(D.lvl) local dropSpd=GetGravity(D.lvl)
if dropSpd~=P.gameEnv.drop then if dropSpd~=P.gameEnv.drop then
P.gameEnv.drop,P.gameEnv.lock=dropSpd,dropSpd P.gameEnv.drop,P.gameEnv.lock=dropSpd,dropSpd

Some files were not shown because too many files have changed in this diff Show More