Compare commits
256 Commits
pre0.16.4-
...
pre0.17.0-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8b12fc55d | ||
|
|
6d11367ea4 | ||
|
|
eb9e741b4f | ||
|
|
c47546d501 | ||
|
|
11aa178fc1 | ||
|
|
f3a88ef269 | ||
|
|
720dc2131f | ||
|
|
701ef17ae1 | ||
|
|
1a689a5f07 | ||
|
|
ef12ab0cee | ||
|
|
3d26db7a01 | ||
|
|
dd3df9981b | ||
|
|
5d04e83529 | ||
|
|
7ed4626d71 | ||
|
|
ecf5a29a71 | ||
|
|
1a24b346a0 | ||
|
|
72d06c7a02 | ||
|
|
26fde8c694 | ||
|
|
8adeb99be7 | ||
|
|
c92f15156b | ||
|
|
63f69d712b | ||
|
|
55a1bd06f3 | ||
|
|
6a29abf7f0 | ||
|
|
83bdd9f2c4 | ||
|
|
95879827c8 | ||
|
|
2ade518207 | ||
|
|
36c8449e4d | ||
|
|
3c04df69f3 | ||
|
|
1224ee9a67 | ||
|
|
fdd1d4463a | ||
|
|
940ac3736c | ||
|
|
d38897b54d | ||
|
|
90848c6654 | ||
|
|
0220d5aefc | ||
|
|
f42032df07 | ||
|
|
05d7eb60bc | ||
|
|
942416317c | ||
|
|
576de945fb | ||
|
|
8b02084428 | ||
|
|
9f666d69db | ||
|
|
a4c52d9162 | ||
|
|
592b11366e | ||
|
|
07f50b9243 | ||
|
|
ec74d55686 | ||
|
|
4518513e87 | ||
|
|
7df4e2144f | ||
|
|
7f9c9248ce | ||
|
|
9c1db48804 | ||
|
|
0628830f0c | ||
|
|
9436f2f5fb | ||
|
|
c5e1b5617f | ||
|
|
298c417aa3 | ||
|
|
fc74831700 | ||
|
|
d9db55de44 | ||
|
|
3fd205e8c2 | ||
|
|
5cb828fb92 | ||
|
|
5f7a3fd53f | ||
|
|
8e3e598753 | ||
|
|
2a0a0f60f8 | ||
|
|
6b7d1fdf9f | ||
|
|
65199a40f7 | ||
|
|
f9082a8800 | ||
|
|
1670c6e7d6 | ||
|
|
ff2073ed4d | ||
|
|
f14aaac635 | ||
|
|
c709fa622f | ||
|
|
c752556bf3 | ||
|
|
e7d9703fcc | ||
|
|
1ed52a84b0 | ||
|
|
4fdb278751 | ||
|
|
8318803923 | ||
|
|
42de7e3676 | ||
|
|
3efa646ee3 | ||
|
|
b414c2ab42 | ||
|
|
205dea3db7 | ||
|
|
6cac688555 | ||
|
|
09b1b08c1e | ||
|
|
b61a1270e9 | ||
|
|
b85cee7e1f | ||
|
|
8e674e3e29 | ||
|
|
aa2812c874 | ||
|
|
6f282431c4 | ||
|
|
470e54cdd0 | ||
|
|
da3ef1c2a6 | ||
|
|
9efe0e62d5 | ||
|
|
7038f81b46 | ||
|
|
de972a60df | ||
|
|
6a87787d6f | ||
|
|
6dc9a4b507 | ||
|
|
5b7c888d57 | ||
|
|
a1f761b83e | ||
|
|
c40a6bfaa0 | ||
|
|
441c6f7667 | ||
|
|
a07d57cf71 | ||
|
|
a467f972f9 | ||
|
|
3f455ee360 | ||
|
|
7a0b913768 | ||
|
|
a7b240ade8 | ||
|
|
bb64404821 | ||
|
|
caf92eb3c8 | ||
|
|
6a117a0fab | ||
|
|
26682509f7 | ||
|
|
d85d92fb43 | ||
|
|
c412003cb3 | ||
|
|
e39b5dbd51 | ||
|
|
db162ea66f | ||
|
|
f9f9fde368 | ||
|
|
4b221c2eb5 | ||
|
|
ed45bebfa0 | ||
|
|
fa0bc3805f | ||
|
|
7710f0b70f | ||
|
|
0277ddadb5 | ||
|
|
88e23e32f5 | ||
|
|
8ab5b4a17a | ||
|
|
503dfd69ef | ||
|
|
ae61ec26c0 | ||
|
|
00bc24bd50 | ||
|
|
abd15d6307 | ||
|
|
c01ac546d1 | ||
|
|
af77221ba2 | ||
|
|
204f0938d3 | ||
|
|
ad39d1408c | ||
|
|
ed011173f6 | ||
|
|
491fcb5860 | ||
|
|
c2d5537d8d | ||
|
|
7d5037ae87 | ||
|
|
07d7714317 | ||
|
|
2cab97f37d | ||
|
|
d184778c9a | ||
|
|
9fd3b3008d | ||
|
|
71aa35b214 | ||
|
|
4443dc9d3e | ||
|
|
839e357301 | ||
|
|
ac56c5a415 | ||
|
|
36e3343341 | ||
|
|
510f7d7513 | ||
|
|
3128eb38c0 | ||
|
|
14ef654612 | ||
|
|
bc5193f95e | ||
|
|
8cbb4a38bc | ||
|
|
fce08c83ef | ||
|
|
018e99f9e6 | ||
|
|
7fe390b34b | ||
|
|
8c7202c569 | ||
|
|
ab386bb53c | ||
|
|
87c791b8c7 | ||
|
|
00e3e2d19d | ||
|
|
8d7d5c7b04 | ||
|
|
849a18e159 | ||
|
|
a4357d0843 | ||
|
|
e2b4a78b59 | ||
|
|
01387b5488 | ||
|
|
168e2f80b8 | ||
|
|
4f79ef8708 | ||
|
|
16497833df | ||
|
|
cd6a50d5a0 | ||
|
|
4c5a61f2d8 | ||
|
|
1fd8d39970 | ||
|
|
d133d64890 | ||
|
|
b27aa8b60d | ||
|
|
230d67492e | ||
|
|
4f9d5b282c | ||
|
|
a2955e8722 | ||
|
|
df892671d5 | ||
|
|
7fa96eee1a | ||
|
|
a1030906c7 | ||
|
|
e6a9a4f4be | ||
|
|
efa1247596 | ||
|
|
069fcee721 | ||
|
|
66621404f1 | ||
|
|
e09609ea21 | ||
|
|
d02ae67bc0 | ||
|
|
27327d57c4 | ||
|
|
cce93b6df9 | ||
|
|
546104ba5b | ||
|
|
ca5816ba14 | ||
|
|
e5bd16476e | ||
|
|
94431d4c2e | ||
|
|
f98d6892f1 | ||
|
|
1fe436cbe3 | ||
|
|
c5a37a9920 | ||
|
|
eed7e96096 | ||
|
|
a7f36a4162 | ||
|
|
8ba872d45d | ||
|
|
7a55451faa | ||
|
|
372571bd80 | ||
|
|
77120c0b90 | ||
|
|
01d1e44644 | ||
|
|
0ad8cddefe | ||
|
|
ce67253502 | ||
|
|
cb9f2c0617 | ||
|
|
635d9407ed | ||
|
|
0f9f6565f1 | ||
|
|
a45b6ad57e | ||
|
|
a5de06dedb | ||
|
|
fbfbd1ed98 | ||
|
|
8f06b3bd1a | ||
|
|
7e0dbceefc | ||
|
|
7e3db1de17 | ||
|
|
111790fdab | ||
|
|
bec03de7b8 | ||
|
|
f5dfae3a6c | ||
|
|
d3dec2b5f1 | ||
|
|
f083136998 | ||
|
|
cd3d0b370c | ||
|
|
f4c6632941 | ||
|
|
750cb9a669 | ||
|
|
62a198a017 | ||
|
|
5780ba0f3e | ||
|
|
86edeb1e0c | ||
|
|
53b1852f28 | ||
|
|
e3c385693b | ||
|
|
572c0fbfa1 | ||
|
|
bbdf71167a | ||
|
|
2136ccd9a2 | ||
|
|
2131aea575 | ||
|
|
32b21c7d29 | ||
|
|
8f6f6f316f | ||
|
|
66f9ac2791 | ||
|
|
ac0ba90438 | ||
|
|
990659ce91 | ||
|
|
00c602c844 | ||
|
|
9db62ffc39 | ||
|
|
e7c777e502 | ||
|
|
4991e8cea2 | ||
|
|
111d4e991f | ||
|
|
bedfa74a32 | ||
|
|
f6944dc223 | ||
|
|
a34a3051a3 | ||
|
|
0e13883faf | ||
|
|
e8860eda1b | ||
|
|
33ba4820b3 | ||
|
|
5ed0dda8ab | ||
|
|
bd260b2c6f | ||
|
|
aa01ab07f7 | ||
|
|
c009893377 | ||
|
|
3ae128d4c3 | ||
|
|
cb2164c21d | ||
|
|
951b7407fc | ||
|
|
5a1fd0ca4d | ||
|
|
f4b85e0dbb | ||
|
|
c38bceb87e | ||
|
|
2569e8844e | ||
|
|
e42fa8351e | ||
|
|
9582a625ff | ||
|
|
81abb06f7b | ||
|
|
7cfea0eebe | ||
|
|
01c2bfe955 | ||
|
|
70242e6a07 | ||
|
|
c1edba974f | ||
|
|
546b3f230d | ||
|
|
14593eb487 | ||
|
|
838621a3ae | ||
|
|
283d4a5fce | ||
|
|
490cf44132 | ||
|
|
9dcbd86fc3 |
7
.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE_1.md
vendored
7
.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE_1.md
vendored
@@ -2,8 +2,7 @@
|
|||||||
name: Bug report (bluescreen crash) Bug报告 (蓝屏报错)
|
name: Bug report (bluescreen crash) Bug报告 (蓝屏报错)
|
||||||
about: Create a report of problems which made the crash with a bluescreen
|
about: Create a report of problems which made the crash with a bluescreen
|
||||||
---
|
---
|
||||||
Screenshot with crash information: (delete this line before submitting)
|
Screenshot with crash information (*Image(s) Here*):
|
||||||
*Image Here*
|
|
||||||
|
|
||||||
If you can reproduce it, write the steps here. If you can't, try to describe the exactly time the game crash, like pressing which key or which button: (delete this line before submitting)
|
|
||||||
*Details Here*
|
If you can reproduce it, write the steps here. If you can't, try to describe the exactly time the game crash, like pressing which key or which button (*Details Here*)
|
||||||
7
.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE_2.md
vendored
7
.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE_2.md
vendored
@@ -2,8 +2,7 @@
|
|||||||
name: Bug report (unintended behaviors) Bug报告 (奇怪的现象)
|
name: Bug report (unintended behaviors) Bug报告 (奇怪的现象)
|
||||||
about: Create a report of unintended behaviors
|
about: Create a report of unintended behaviors
|
||||||
---
|
---
|
||||||
Screenshot with unintended behaviors: (delete this line before submitting)
|
Screenshot with unintended behaviors (*Image(s) Here*):
|
||||||
*Image(s) Here*
|
|
||||||
|
|
||||||
If you can reproduce it, write the steps here. If you can't, try to describe the exactly time the game crash, like pressing which key or which button: (delete this line before submitting)
|
|
||||||
*Details Here*
|
If you can reproduce it, write the steps here. If you can't, try to describe the exactly time the game crash, like pressing which key or which button (*Details Here*):
|
||||||
|
|||||||
24
.github/actions/automatic-test/action.yml
vendored
Normal file
24
.github/actions/automatic-test/action.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
name: 'Automatic Test'
|
||||||
|
description: 'Check for obvious errors.'
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/actions/build-love
|
||||||
|
with:
|
||||||
|
file-path: Techmino.love
|
||||||
|
- name: Download love
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
curl -L https://github.com/love2d/love/releases/download/11.3/love-11.3-linux-x86_64.tar.gz | tar xz
|
||||||
|
- name: Prepare PulseAudio
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install pulseaudio pulseaudio-utils pavucontrol alsa-oss alsa-utils -y
|
||||||
|
- name: Run automated test
|
||||||
|
uses: GabrielBB/xvfb-action@v1
|
||||||
|
with:
|
||||||
|
run: |
|
||||||
|
./dest/love Techmino.love --test
|
||||||
2
.github/actions/build-linux/action.yml
vendored
2
.github/actions/build-linux/action.yml
vendored
@@ -33,7 +33,7 @@ runs:
|
|||||||
cp squashfs-root/icon.png squashfs-root/.DirIcon
|
cp squashfs-root/icon.png squashfs-root/.DirIcon
|
||||||
chmod 777 squashfs-root/love
|
chmod 777 squashfs-root/love
|
||||||
mkdir -p squashfs-root/usr/share/Techmino
|
mkdir -p squashfs-root/usr/share/Techmino
|
||||||
mv media parts Zframework conf.lua main.lua version.lua squashfs-root/usr/share/Techmino
|
mv media parts Zframework conf.lua main.lua version.lua legals.md license.txt squashfs-root/usr/share/Techmino
|
||||||
mv CCloader.so squashfs-root/usr/share/Techmino
|
mv CCloader.so squashfs-root/usr/share/Techmino
|
||||||
mv libcold_clear.so squashfs-root/usr/lib
|
mv libcold_clear.so squashfs-root/usr/lib
|
||||||
chmod 777 appimagetool-x86_64.AppImage
|
chmod 777 appimagetool-x86_64.AppImage
|
||||||
|
|||||||
2
.github/actions/build-love/action.yml
vendored
2
.github/actions/build-love/action.yml
vendored
@@ -7,5 +7,5 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- run: 7z a -tzip ${{ inputs.file-path }} media parts Zframework conf.lua main.lua version.lua
|
- run: 7z a -tzip ${{ inputs.file-path }} media parts Zframework conf.lua main.lua version.lua legals.md license.txt
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
BIN
.github/build/macOS/backgroundImage.tiff
vendored
BIN
.github/build/macOS/backgroundImage.tiff
vendored
Binary file not shown.
52
.github/workflows/dev.yml
vendored
52
.github/workflows/dev.yml
vendored
@@ -27,6 +27,12 @@ jobs:
|
|||||||
echo "::set-output name=code::$(lua .github/workflows/getVersion.lua -code)"
|
echo "::set-output name=code::$(lua .github/workflows/getVersion.lua -code)"
|
||||||
echo "::set-output name=commit::$(git rev-parse --short ${{ GITHUB.SHA }})"
|
echo "::set-output name=commit::$(git rev-parse --short ${{ GITHUB.SHA }})"
|
||||||
|
|
||||||
|
automatic-test:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/actions/automatic-test
|
||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
needs: get-info
|
needs: get-info
|
||||||
@@ -91,6 +97,34 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: Techmino_${{ needs.get-info.outputs.name }}_${{ GITHUB.RUN_NUMBER }}_${{ needs.get-info.outputs.commit }}_Android
|
name: Techmino_${{ needs.get-info.outputs.name }}_${{ GITHUB.RUN_NUMBER }}_${{ needs.get-info.outputs.commit }}_Android
|
||||||
path: Techmino_Snapshot.apk
|
path: Techmino_Snapshot.apk
|
||||||
|
|
||||||
|
build-android-mini:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
needs: get-info
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/actions/update-version
|
||||||
|
with:
|
||||||
|
commit: ${{ needs.get-info.outputs.commit }}
|
||||||
|
type: snapshot
|
||||||
|
- name: remove media
|
||||||
|
run: |
|
||||||
|
rm -rf media/music media/effect media/vocal
|
||||||
|
- uses: ./.github/actions/build-android
|
||||||
|
with:
|
||||||
|
type: Snapshot
|
||||||
|
apkCode: ${{ needs.get-info.outputs.apkCode }}
|
||||||
|
name: ${{ needs.get-info.outputs.name }}
|
||||||
|
file-path: Techmino_Snapshot_Mini.apk
|
||||||
|
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
|
||||||
|
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
|
||||||
|
ALIAS: ${{ secrets.ALIAS }}
|
||||||
|
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
||||||
|
- name: Upload
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: Techmino_${{ needs.get-info.outputs.name }}_${{ GITHUB.RUN_NUMBER }}_${{ needs.get-info.outputs.commit }}_Android_Mini
|
||||||
|
path: Techmino_Snapshot_Mini.apk
|
||||||
|
|
||||||
build-macOS:
|
build-macOS:
|
||||||
runs-on: macos-10.15
|
runs-on: macos-10.15
|
||||||
@@ -121,6 +155,7 @@ jobs:
|
|||||||
|
|
||||||
build-iOS:
|
build-iOS:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
if: (!startsWith( github.ref , 'refs/heads/ci-')) || startsWith( github.ref , 'refs/heads/ci-ios-')
|
||||||
needs: get-info
|
needs: get-info
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@@ -150,4 +185,19 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: Techmino_${{ needs.get-info.outputs.name }}_${{ GITHUB.RUN_NUMBER }}_${{ needs.get-info.outputs.commit }}_iOS
|
name: Techmino_${{ needs.get-info.outputs.name }}_${{ GITHUB.RUN_NUMBER }}_${{ needs.get-info.outputs.commit }}_iOS
|
||||||
path: "Techmino.ipa"
|
path: Techmino.ipa
|
||||||
|
|
||||||
|
build-love:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
needs: get-info
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/actions/update-version
|
||||||
|
- uses: ./.github/actions/build-love
|
||||||
|
with:
|
||||||
|
file-path: Techmino.love
|
||||||
|
- name: Upload
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: Techmino_${{ needs.get-info.outputs.name }}_${{ GITHUB.RUN_NUMBER }}_${{ needs.get-info.outputs.commit }}_Love
|
||||||
|
path: Techmino.love
|
||||||
|
|||||||
13
.github/workflows/getVersion.lua
vendored
13
.github/workflows/getVersion.lua
vendored
@@ -1,22 +1,23 @@
|
|||||||
if arg[1]=="-apkCode"then
|
local arg=arg[1]
|
||||||
|
if arg=="-apkCode"then
|
||||||
local code=require"version".apkCode
|
local code=require"version".apkCode
|
||||||
print(code)
|
print(code)
|
||||||
elseif arg[1]=="-code"then
|
elseif arg=="-code"then
|
||||||
local str=require"version".code
|
local str=require"version".code
|
||||||
print(str)
|
print(str)
|
||||||
elseif arg[1]=="-name"then
|
elseif arg=="-name"then
|
||||||
local str=require"version".string
|
local str=require"version".string
|
||||||
print(str)
|
print(str)
|
||||||
elseif arg[1]=="-release"then
|
elseif arg=="-release"then
|
||||||
local str=require"version".string:gsub("V","",1)
|
local str=require"version".string:gsub("V","",1)
|
||||||
print(str)
|
print(str)
|
||||||
elseif arg[1]=="-updateTitle"then
|
elseif arg=="-updateTitle"then
|
||||||
local note=require"parts.updateLog"
|
local note=require"parts.updateLog"
|
||||||
local p1=note:find("\n%d")+1
|
local p1=note:find("\n%d")+1
|
||||||
local p2=note:find("\n",p1)-1
|
local p2=note:find("\n",p1)-1
|
||||||
note=note:sub(p1,p2)
|
note=note:sub(p1,p2)
|
||||||
print(note)
|
print(note)
|
||||||
elseif arg[1]=="-updateNote"then
|
elseif arg=="-updateNote"then
|
||||||
local note=require"parts.updateLog"
|
local note=require"parts.updateLog"
|
||||||
local p1=note:find("\n",note:find("\n%d")+1)+1
|
local p1=note:find("\n",note:find("\n%d")+1)+1
|
||||||
local p2=note:find("\n%d",p1+1)
|
local p2=note:find("\n%d",p1+1)
|
||||||
|
|||||||
316
.github/workflows/release.yml
vendored
316
.github/workflows/release.yml
vendored
@@ -3,7 +3,7 @@ name: Techmino Release CI
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- "v*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
get-info:
|
get-info:
|
||||||
@@ -14,218 +14,176 @@ jobs:
|
|||||||
code: ${{ steps.actual-get-info.outputs.code }}
|
code: ${{ steps.actual-get-info.outputs.code }}
|
||||||
release: ${{ steps.actual-get-info.outputs.release }}
|
release: ${{ steps.actual-get-info.outputs.release }}
|
||||||
updateTitle: ${{ steps.actual-get-info.outputs.updateTitle }}
|
updateTitle: ${{ steps.actual-get-info.outputs.updateTitle }}
|
||||||
|
updateNote: ${{ steps.actual-get-info.outputs.updateNote }}
|
||||||
commit: ${{ steps.actual-get-info.outputs.commit }}
|
commit: ${{ steps.actual-get-info.outputs.commit }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Install lua
|
- name: Install lua
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install lua5.3 -y
|
sudo apt-get install lua5.3 -y
|
||||||
- name: Get Version
|
- name: Get Version
|
||||||
id: actual-get-info
|
id: actual-get-info
|
||||||
run: |
|
run: |
|
||||||
echo "::set-output name=name::$(lua .github/workflows/getVersion.lua -name)"
|
UPDATE_NOTE=$(lua .github/workflows/getVersion.lua -updateNote)
|
||||||
echo "::set-output name=apkCode::$(lua .github/workflows/getVersion.lua -apkCode)"
|
UPDATE_NOTE="${UPDATE_NOTE//'%'/'%25'}"
|
||||||
echo "::set-output name=code::$(lua .github/workflows/getVersion.lua -code)"
|
UPDATE_NOTE="${UPDATE_NOTE//$'\n'/'%0A'}"
|
||||||
echo "::set-output name=release::$(lua .github/workflows/getVersion.lua -release)"
|
UPDATE_NOTE="${UPDATE_NOTE//$'\r'/'%0D'}"
|
||||||
echo "::set-output name=updateTitle::$(lua .github/workflows/getVersion.lua -updateTitle)"
|
echo "::set-output name=name::$(lua .github/workflows/getVersion.lua -name)"
|
||||||
echo "::set-output name=commit::$(git rev-parse --short ${{ GITHUB.SHA }})"
|
echo "::set-output name=apkCode::$(lua .github/workflows/getVersion.lua -apkCode)"
|
||||||
|
echo "::set-output name=code::$(lua .github/workflows/getVersion.lua -code)"
|
||||||
|
echo "::set-output name=release::$(lua .github/workflows/getVersion.lua -release)"
|
||||||
|
echo "::set-output name=updateTitle::$(lua .github/workflows/getVersion.lua -updateTitle)"
|
||||||
|
echo "::set-output name=updateNote::$UPDATE_NOTE"
|
||||||
|
echo "::set-output name=commit::$(git rev-parse --short ${{ GITHUB.SHA }})"
|
||||||
|
|
||||||
build-windows-x64:
|
build-windows-x64:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
needs: get-info
|
needs: get-info
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: ./.github/actions/update-version
|
- uses: ./.github/actions/update-version
|
||||||
- uses: ./.github/actions/build-windows
|
- uses: ./.github/actions/build-windows
|
||||||
with:
|
with:
|
||||||
love-url: https://github.com/love2d/love/releases/download/11.3/love-11.3-win64.zip
|
love-url: https://github.com/love2d/love/releases/download/11.3/love-11.3-win64.zip
|
||||||
love-dir: love-11.3-win64
|
love-dir: love-11.3-win64
|
||||||
arch: win64
|
arch: win64
|
||||||
version: ${{ needs.get-info.outputs.release }}
|
version: ${{ needs.get-info.outputs.release }}
|
||||||
icon: .\.github\build\Windows\icon.ico
|
icon: .\.github\build\Windows\icon.ico
|
||||||
- name: Pack Techmino
|
- name: Pack Techmino
|
||||||
run: 7z a -tzip .\Techmino.a${{ needs.get-info.outputs.release }}.Win64.zip .\love
|
run: 7z a -tzip .\Techmino_a${{ needs.get-info.outputs.release }}_Win64.zip .\love
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
name: ${{ needs.get-info.outputs.updateTitle }}
|
name: ${{ needs.get-info.outputs.updateTitle }}
|
||||||
files: Techmino.a${{ needs.get-info.outputs.release }}.Win64.zip
|
files: Techmino_a${{ needs.get-info.outputs.release }}_Win64.zip
|
||||||
|
|
||||||
build-windows-x86:
|
build-windows-x86:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
needs: get-info
|
needs: get-info
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: ./.github/actions/update-version
|
- uses: ./.github/actions/update-version
|
||||||
- uses: ./.github/actions/build-windows
|
- uses: ./.github/actions/build-windows
|
||||||
with:
|
with:
|
||||||
love-url: https://github.com/love2d/love/releases/download/11.3/love-11.3-win32.zip
|
love-url: https://github.com/love2d/love/releases/download/11.3/love-11.3-win32.zip
|
||||||
love-dir: love-11.3-win32
|
love-dir: love-11.3-win32
|
||||||
arch: win32
|
arch: win32
|
||||||
version: ${{ needs.get-info.outputs.release }}
|
version: ${{ needs.get-info.outputs.release }}
|
||||||
icon: .\.github\build\Windows\icon.ico
|
icon: .\.github\build\Windows\icon.ico
|
||||||
- name: Pack Techmino
|
- name: Pack Techmino
|
||||||
run: 7z a -tzip .\Techmino.a${{ needs.get-info.outputs.release }}.Win32.zip .\love
|
run: 7z a -tzip .\Techmino_a${{ needs.get-info.outputs.release }}_Win32.zip .\love
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
name: ${{ needs.get-info.outputs.updateTitle }}
|
name: ${{ needs.get-info.outputs.updateTitle }}
|
||||||
files: Techmino.a${{ needs.get-info.outputs.release }}.Win32.zip
|
files: Techmino_a${{ needs.get-info.outputs.release }}_Win32.zip
|
||||||
|
|
||||||
build-linux:
|
build-linux:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
needs: get-info
|
needs: get-info
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: ./.github/actions/update-version
|
- uses: ./.github/actions/update-version
|
||||||
- uses: ./.github/actions/build-linux
|
- uses: ./.github/actions/build-linux
|
||||||
with:
|
with:
|
||||||
file-path: Techmino.a${{ needs.get-info.outputs.release }}.AppImage
|
file-path: Techmino_a${{ needs.get-info.outputs.release }}_Linux.AppImage
|
||||||
icon: .github/build/Linux/icon.png
|
icon: .github/build/Linux/icon.png
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
name: ${{ needs.get-info.outputs.updateTitle }}
|
name: ${{ needs.get-info.outputs.updateTitle }}
|
||||||
files: Techmino.a${{ needs.get-info.outputs.release }}.AppImage
|
files: Techmino_a${{ needs.get-info.outputs.release }}_Linux.AppImage
|
||||||
|
|
||||||
build-android:
|
build-android:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
needs: get-info
|
needs: get-info
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: ./.github/actions/update-version
|
- uses: ./.github/actions/update-version
|
||||||
- uses: ./.github/actions/build-android
|
- uses: ./.github/actions/build-android
|
||||||
with:
|
with:
|
||||||
type: Release
|
type: Release
|
||||||
apkCode: ${{ needs.get-info.outputs.apkCode }}
|
apkCode: ${{ needs.get-info.outputs.apkCode }}
|
||||||
name: ${{ needs.get-info.outputs.name }}
|
name: ${{ needs.get-info.outputs.name }}
|
||||||
file-path: Techmino.a${{ needs.get-info.outputs.release }}.apk
|
file-path: Techmino_a${{ needs.get-info.outputs.release }}_Android.apk
|
||||||
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
|
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
|
||||||
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
|
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
|
||||||
ALIAS: ${{ secrets.ALIAS }}
|
ALIAS: ${{ secrets.ALIAS }}
|
||||||
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
name: ${{ needs.get-info.outputs.updateTitle }}
|
name: ${{ needs.get-info.outputs.updateTitle }}
|
||||||
files: Techmino.a${{ needs.get-info.outputs.release }}.apk
|
files: Techmino_a${{ needs.get-info.outputs.release }}_Android.apk
|
||||||
|
|
||||||
build-android-mini:
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
needs: get-info
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: ./.github/actions/update-version
|
|
||||||
- name: remove media
|
|
||||||
run: |
|
|
||||||
rm -rf media/music media/effect media/vocal
|
|
||||||
- uses: ./.github/actions/build-android
|
|
||||||
with:
|
|
||||||
type: Release
|
|
||||||
apkCode: ${{ needs.get-info.outputs.apkCode }}
|
|
||||||
name: ${{ needs.get-info.outputs.name }}
|
|
||||||
file-path: Techmino.a${{ needs.get-info.outputs.release }}.mini.apk
|
|
||||||
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
|
|
||||||
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
|
|
||||||
ALIAS: ${{ secrets.ALIAS }}
|
|
||||||
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
|
||||||
- name: Release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
name: ${{ needs.get-info.outputs.updateTitle }}
|
|
||||||
files: Techmino.a${{ needs.get-info.outputs.release }}.mini.apk
|
|
||||||
|
|
||||||
build-macOS:
|
build-macOS:
|
||||||
runs-on: macos-10.15
|
runs-on: macos-10.15
|
||||||
needs: get-info
|
needs: get-info
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: ./.github/actions/update-version
|
- uses: ./.github/actions/update-version
|
||||||
- uses: ./.github/actions/build-macos
|
- uses: ./.github/actions/build-macos
|
||||||
with:
|
with:
|
||||||
name: ${{ needs.get-info.outputs.name }}
|
name: ${{ needs.get-info.outputs.name }}
|
||||||
icon: .github/build/macOS/icon.icns
|
icon: .github/build/macOS/icon.icns
|
||||||
APPLE_API_ID: '${{ secrets.APPLE_API_ID }}'
|
APPLE_API_ID: "${{ secrets.APPLE_API_ID }}"
|
||||||
APPLE_API_ISSUER: '${{ secrets.APPLE_API_ISSUER }}'
|
APPLE_API_ISSUER: "${{ secrets.APPLE_API_ISSUER }}"
|
||||||
APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}'
|
APPLE_API_KEY: "${{ secrets.APPLE_API_KEY }}"
|
||||||
APPLE_APP_IDENTIFIER: '${{ secrets.APPLE_APP_IDENTIFIER }}'
|
APPLE_APP_IDENTIFIER: "${{ secrets.APPLE_APP_IDENTIFIER }}"
|
||||||
APPLE_KEYCHAIN_NAME: '${{ secrets.APPLE_KEYCHAIN_NAME }}'
|
APPLE_KEYCHAIN_NAME: "${{ secrets.APPLE_KEYCHAIN_NAME }}"
|
||||||
APPLE_KEYCHAIN_PWD: '${{ secrets.APPLE_KEYCHAIN_PWD }}'
|
APPLE_KEYCHAIN_PWD: "${{ secrets.APPLE_KEYCHAIN_PWD }}"
|
||||||
FASTLANE_MATCH_PWD: '${{ secrets.FASTLANE_MATCH_PWD }}'
|
FASTLANE_MATCH_PWD: "${{ secrets.FASTLANE_MATCH_PWD }}"
|
||||||
FASTLANE_MATCH_TOKEN: '${{ secrets.FASTLANE_MATCH_TOKEN }}'
|
FASTLANE_MATCH_TOKEN: "${{ secrets.FASTLANE_MATCH_TOKEN }}"
|
||||||
- name: Pack Techmino
|
- name: Pack Techmino
|
||||||
run: |
|
run: |
|
||||||
mv Techmino.dmg Techmino.a${{ needs.get-info.outputs.release }}.macOS.dmg
|
mv Techmino.dmg Techmino_a${{ needs.get-info.outputs.release }}_MacOS.dmg
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
name: ${{ needs.get-info.outputs.updateTitle }}
|
name: ${{ needs.get-info.outputs.updateTitle }}
|
||||||
files: Techmino.a${{ needs.get-info.outputs.release }}.macOS.zip
|
files: Techmino_a${{ needs.get-info.outputs.release }}_MacOS.dmg
|
||||||
|
|
||||||
build-iOS:
|
build-iOS:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
needs: get-info
|
needs: get-info
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: ./.github/actions/update-version
|
- uses: ./.github/actions/update-version
|
||||||
- uses: ./.github/actions/build-ios
|
- uses: ./.github/actions/build-ios
|
||||||
with:
|
with:
|
||||||
name: ${{ needs.get-info.outputs.name }}
|
name: ${{ needs.get-info.outputs.name }}
|
||||||
type: 'release'
|
type: "release"
|
||||||
APPLE_API_ID: '${{ secrets.APPLE_API_ID }}'
|
APPLE_API_ID: "${{ secrets.APPLE_API_ID }}"
|
||||||
APPLE_API_ISSUER: '${{ secrets.APPLE_API_ISSUER }}'
|
APPLE_API_ISSUER: "${{ secrets.APPLE_API_ISSUER }}"
|
||||||
APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}'
|
APPLE_API_KEY: "${{ secrets.APPLE_API_KEY }}"
|
||||||
APPLE_APP_BUILD: '${{ needs.get-info.outputs.code }}.0.${{ github.run_number }}.${{ github.run_attempt }}'
|
APPLE_APP_BUILD: "${{ needs.get-info.outputs.code }}.0.${{ github.run_number }}.${{ github.run_attempt }}"
|
||||||
APPLE_APP_CHANGELOG: '${{ github.event.commits[0].message }}'
|
APPLE_APP_CHANGELOG: "${{ needs.get-info.outputs.updateNote }}"
|
||||||
APPLE_APP_ID: '${{ secrets.APPLE_APP_ID }}'
|
APPLE_APP_ID: "${{ secrets.APPLE_APP_ID }}"
|
||||||
APPLE_APP_IDENTIFIER: '${{ secrets.APPLE_APP_IDENTIFIER }}'
|
APPLE_APP_IDENTIFIER: "${{ secrets.APPLE_APP_IDENTIFIER }}"
|
||||||
APPLE_APP_PROFILE: '${{ secrets.APPLE_APP_PROFILE }}'
|
APPLE_APP_PROFILE: "${{ secrets.APPLE_APP_PROFILE }}"
|
||||||
APPLE_KEYCHAIN_NAME: '${{ secrets.APPLE_KEYCHAIN_NAME }}'
|
APPLE_KEYCHAIN_NAME: "${{ secrets.APPLE_KEYCHAIN_NAME }}"
|
||||||
APPLE_KEYCHAIN_PWD: '${{ secrets.APPLE_KEYCHAIN_PWD }}'
|
APPLE_KEYCHAIN_PWD: "${{ secrets.APPLE_KEYCHAIN_PWD }}"
|
||||||
FASTLANE_ACTION_ID: '${{ github.run_id }}'
|
FASTLANE_ACTION_ID: "${{ github.run_id }}"
|
||||||
FASTLANE_DISCORD_WEBHOOK: '${{ secrets.FASTLANE_DISCORD_WEBHOOK }}'
|
FASTLANE_DISCORD_WEBHOOK: "${{ secrets.FASTLANE_DISCORD_WEBHOOK }}"
|
||||||
FASTLANE_MATCH_PWD: '${{ secrets.FASTLANE_MATCH_PWD }}'
|
FASTLANE_MATCH_PWD: "${{ secrets.FASTLANE_MATCH_PWD }}"
|
||||||
FASTLANE_MATCH_TOKEN: '${{ secrets.FASTLANE_MATCH_TOKEN }}'
|
FASTLANE_MATCH_TOKEN: "${{ secrets.FASTLANE_MATCH_TOKEN }}"
|
||||||
- name: Rename ipa
|
- name: Rename ipa
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mv Techmino.ipa Techmino.a${{ needs.get-info.outputs.release }}.ipa
|
mv Techmino.ipa Techmino_a${{ needs.get-info.outputs.release }}_iOS.ipa
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
name: ${{ needs.get-info.outputs.updateTitle }}
|
name: ${{ needs.get-info.outputs.updateTitle }}
|
||||||
files: Techmino.a${{ needs.get-info.outputs.release }}.ipa
|
files: Techmino_a${{ needs.get-info.outputs.release }}_iOS.ipa
|
||||||
|
|
||||||
build-love:
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
needs: get-info
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: ./.github/actions/update-version
|
|
||||||
- uses: ./.github/actions/build-love
|
|
||||||
with:
|
|
||||||
file-path: Techmino.a${{ needs.get-info.outputs.release }}.love
|
|
||||||
- name: Release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
name: ${{ needs.get-info.outputs.updateTitle }}
|
|
||||||
files: Techmino.a${{ needs.get-info.outputs.release }}.love
|
|
||||||
|
|
||||||
Add-Release-note:
|
Add-Release-note:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
needs: get-info
|
needs: get-info
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Install lua
|
- name: Release
|
||||||
run: |
|
uses: softprops/action-gh-release@v1
|
||||||
sudo apt-get update -y
|
with:
|
||||||
sudo apt-get upgrade -y
|
name: ${{ needs.get-info.outputs.updateTitle }}
|
||||||
sudo apt-get install lua5.3 -y
|
body: ${{ needs.get-info.outputs.updateNote }}
|
||||||
- name: Get ReleaseNote
|
|
||||||
run: |
|
|
||||||
lua .github/workflows/getVersion.lua -updateNote > updateNote.txt
|
|
||||||
- name: Release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
name: ${{ needs.get-info.outputs.updateTitle }}
|
|
||||||
body_path: updateNote.txt
|
|
||||||
|
|||||||
14
.github/workflows/test.yml
vendored
14
.github/workflows/test.yml
vendored
@@ -47,9 +47,9 @@ jobs:
|
|||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: Techmino.pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}.Windows
|
name: Techmino_pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}_Windows
|
||||||
path: love
|
path: love
|
||||||
|
|
||||||
build-linux:
|
build-linux:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
needs: get-info
|
needs: get-info
|
||||||
@@ -65,7 +65,7 @@ jobs:
|
|||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: Techmino.pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}.Linux
|
name: Techmino_pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}_Linux
|
||||||
path: Techmino.AppImage
|
path: Techmino.AppImage
|
||||||
|
|
||||||
build-android:
|
build-android:
|
||||||
@@ -90,7 +90,7 @@ jobs:
|
|||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: Techmino.pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}.Android
|
name: Techmino_pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}_Android
|
||||||
path: Techmino_Snapshot.apk
|
path: Techmino_Snapshot.apk
|
||||||
|
|
||||||
build-macOS:
|
build-macOS:
|
||||||
@@ -117,7 +117,7 @@ jobs:
|
|||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: Techmino.pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}.macOS
|
name: Techmino_pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}_MacOS
|
||||||
path: Techmino.dmg
|
path: Techmino.dmg
|
||||||
|
|
||||||
build-iOS:
|
build-iOS:
|
||||||
@@ -150,5 +150,5 @@ jobs:
|
|||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: Techmino.pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}.iOS
|
name: Techmino_pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}_iOS
|
||||||
path: "Techmino.ipa"
|
path: Techmino.ipa
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
local Sources={}
|
local lastLoaded={}
|
||||||
|
local maxLoadedCount=3
|
||||||
|
local SourceObjList={}
|
||||||
local volume=1
|
local volume=1
|
||||||
|
|
||||||
local BGM={
|
local BGM={
|
||||||
@@ -37,15 +39,41 @@ end
|
|||||||
local function check_curFadeOut(task,code,src)
|
local function check_curFadeOut(task,code,src)
|
||||||
return task.code==code and task.args[1]==src
|
return task.code==code and task.args[1]==src
|
||||||
end
|
end
|
||||||
|
local function _tryReleaseSources()
|
||||||
|
local n=#lastLoaded
|
||||||
|
while #lastLoaded>maxLoadedCount do
|
||||||
|
local name=lastLoaded[n]
|
||||||
|
if SourceObjList[name].source:isPlaying()then
|
||||||
|
n=n-1
|
||||||
|
if n<=0 then return end
|
||||||
|
else
|
||||||
|
SourceObjList[name].source=SourceObjList[name].source:release()and nil
|
||||||
|
table.remove(lastLoaded,n)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
function BGM.setDefault(bgm)
|
function BGM.setDefault(bgm)
|
||||||
BGM.default=bgm
|
BGM.default=bgm
|
||||||
end
|
end
|
||||||
|
function BGM.setMaxSources(count)
|
||||||
|
maxLoadedCount=count
|
||||||
|
_tryReleaseSources()
|
||||||
|
end
|
||||||
function BGM.setChange(func)
|
function BGM.setChange(func)
|
||||||
BGM.onChange=func
|
BGM.onChange=func
|
||||||
end
|
end
|
||||||
function BGM.setVol(v)
|
function BGM.setVol(v)
|
||||||
assert(type(v)=='number'and v>=0 and v<=1)
|
assert(type(v)=='number'and v>=0 and v<=1,'Wrong volume')
|
||||||
volume=v
|
volume=v
|
||||||
|
if BGM.playing then
|
||||||
|
if volume>0 then
|
||||||
|
BGM.playing:setVolume(volume)
|
||||||
|
BGM.playing:play()
|
||||||
|
elseif BGM.nowPlay then
|
||||||
|
BGM.playing:pause()
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
function BGM.init(list)
|
function BGM.init(list)
|
||||||
BGM.init=nil
|
BGM.init=nil
|
||||||
@@ -53,7 +81,7 @@ function BGM.init(list)
|
|||||||
local simpList={}
|
local simpList={}
|
||||||
for _,v in next,list do
|
for _,v in next,list do
|
||||||
table.insert(simpList,v.name)
|
table.insert(simpList,v.name)
|
||||||
Sources[v.name]=v.path
|
SourceObjList[v.name]={path=v.path,source=false}
|
||||||
end
|
end
|
||||||
table.sort(simpList)
|
table.sort(simpList)
|
||||||
function BGM.getList()return simpList end
|
function BGM.getList()return simpList end
|
||||||
@@ -61,58 +89,43 @@ function BGM.init(list)
|
|||||||
LOG(count.." BGM files added")
|
LOG(count.." BGM files added")
|
||||||
function BGM.getCount()return count end
|
function BGM.getCount()return count end
|
||||||
|
|
||||||
local function _load(name)
|
local function _tryLoad(name)
|
||||||
if type(Sources[name])=='string'then
|
if SourceObjList[name]then
|
||||||
if love.filesystem.getInfo(Sources[name])then
|
if SourceObjList[name].source then
|
||||||
Sources[name]=love.audio.newSource(Sources[name],'stream')
|
return true
|
||||||
Sources[name]:setLooping(true)
|
elseif love.filesystem.getInfo(SourceObjList[name].path)then
|
||||||
Sources[name]:setVolume(0)
|
SourceObjList[name].source=love.audio.newSource(SourceObjList[name].path,'stream')
|
||||||
|
SourceObjList[name].source:setLooping(true)
|
||||||
|
SourceObjList[name].source:setVolume(0)
|
||||||
|
table.insert(lastLoaded,1,name)
|
||||||
|
_tryReleaseSources()
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
LOG("No BGM: "..Sources[name],5)
|
LOG("No BGM: "..SourceObjList[name],5)
|
||||||
end
|
end
|
||||||
elseif Sources[name]then
|
|
||||||
return true
|
|
||||||
elseif name then
|
elseif name then
|
||||||
LOG("No BGM: "..name,5)
|
LOG("No BGM: "..name,5)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function BGM.setVol(v)
|
|
||||||
assert(type(v)=='number'and v>=0 and v<=1)
|
|
||||||
volume=v
|
|
||||||
if BGM.playing then
|
|
||||||
if volume>0 then
|
|
||||||
BGM.playing:setVolume(volume)
|
|
||||||
BGM.playing:play()
|
|
||||||
elseif BGM.nowPlay then
|
|
||||||
BGM.playing:pause()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
function BGM.loadAll()--Not neccessary, unless you want avoid the lag when playing something for the first time
|
|
||||||
for name in next,Sources do
|
|
||||||
_load(name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
function BGM.play(name)
|
function BGM.play(name)
|
||||||
name=name or BGM.default
|
name=name or BGM.default
|
||||||
if not _load(name)then return end
|
if not _tryLoad(name)then return end
|
||||||
if volume==0 then
|
if volume==0 then
|
||||||
BGM.nowPlay=name
|
BGM.nowPlay=name
|
||||||
BGM.playing=Sources[name]
|
BGM.playing=SourceObjList[name].source
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
if name and Sources[name]then
|
if name and SourceObjList[name].source then
|
||||||
if BGM.nowPlay~=name then
|
if BGM.nowPlay~=name then
|
||||||
if BGM.nowPlay then
|
if BGM.nowPlay then
|
||||||
TASK.new(task_fadeOut,BGM.playing)
|
TASK.new(task_fadeOut,BGM.playing)
|
||||||
end
|
end
|
||||||
TASK.removeTask_iterate(check_curFadeOut,task_fadeOut,Sources[name])
|
TASK.removeTask_iterate(check_curFadeOut,task_fadeOut,SourceObjList[name].source)
|
||||||
TASK.removeTask_code(task_fadeIn)
|
TASK.removeTask_code(task_fadeIn)
|
||||||
|
|
||||||
TASK.new(task_fadeIn,Sources[name])
|
TASK.new(task_fadeIn,SourceObjList[name].source)
|
||||||
BGM.nowPlay=name
|
BGM.nowPlay=name
|
||||||
BGM.playing=Sources[name]
|
BGM.playing=SourceObjList[name].source
|
||||||
BGM.lastPlayed=BGM.nowPlay
|
BGM.lastPlayed=BGM.nowPlay
|
||||||
BGM.playing:seek(0)
|
BGM.playing:seek(0)
|
||||||
BGM.playing:play()
|
BGM.playing:play()
|
||||||
@@ -128,8 +141,8 @@ function BGM.init(list)
|
|||||||
end
|
end
|
||||||
function BGM.continue()
|
function BGM.continue()
|
||||||
if BGM.lastPlayed then
|
if BGM.lastPlayed then
|
||||||
BGM.nowPlay,BGM.playing=BGM.lastPlayed,Sources[BGM.lastPlayed]
|
BGM.nowPlay,BGM.playing=BGM.lastPlayed,SourceObjList[BGM.lastPlayed].source
|
||||||
TASK.removeTask_iterate(check_curFadeOut,task_fadeOut,Sources[BGM.nowPlay])
|
TASK.removeTask_iterate(check_curFadeOut,task_fadeOut,SourceObjList[BGM.nowPlay].source)
|
||||||
TASK.removeTask_code(task_fadeIn)
|
TASK.removeTask_code(task_fadeIn)
|
||||||
TASK.new(task_fadeIn,BGM.playing)
|
TASK.new(task_fadeIn,BGM.playing)
|
||||||
BGM.playing:play()
|
BGM.playing:play()
|
||||||
|
|||||||
@@ -1,63 +1,80 @@
|
|||||||
|
local abs=math.abs
|
||||||
|
local function hsv(h,s,v,a)
|
||||||
|
if s<=0 then return v,v,v,a end
|
||||||
|
h=h*6
|
||||||
|
local c=v*s
|
||||||
|
local x=abs((h-1)%2-1)*c
|
||||||
|
if h<1 then return v,x+v-c,v-c,a
|
||||||
|
elseif h<2 then return x+v-c,v,v-c,a
|
||||||
|
elseif h<3 then return v-c,v,x+v-c,a
|
||||||
|
elseif h<4 then return v-c,x+v-c,v,a
|
||||||
|
elseif h<5 then return x+v-c,v-c,v,a
|
||||||
|
else return v,v-c,x+v-c,a
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local COLOR={
|
local COLOR={
|
||||||
red= {.92, .12, .12},
|
hsv=hsv,
|
||||||
fire= {.92, 0.4, .12},
|
|
||||||
orange= {.92, 0.6, .12},
|
|
||||||
yellow= {.92, .92, .12},
|
|
||||||
lime= {0.7, .92, .12},
|
|
||||||
jade= {0.5, .92, .12},
|
|
||||||
green= {.12, .92, .12},
|
|
||||||
aqua= {.12, .92, 0.6},
|
|
||||||
cyan= {.12, .92, .92},
|
|
||||||
navy= {.12, 0.7, .92},
|
|
||||||
sea= {.12, 0.4, .92},
|
|
||||||
blue= {0.2, 0.2, .92},
|
|
||||||
violet= {0.4, .12, .92},
|
|
||||||
purple= {0.7, .12, .92},
|
|
||||||
magenta= {.92, .12, .92},
|
|
||||||
wine= {.92, .12, 0.5},
|
|
||||||
|
|
||||||
lRed= {.95, 0.5, 0.5},
|
red= {hsv(0.00, 0.89, 0.91)},
|
||||||
lFire= {.95, 0.7, 0.5},
|
fire= {hsv(0.04, 0.93, 0.94)},
|
||||||
lOrange= {.95, 0.8, 0.3},
|
orange= {hsv(0.09, 0.99, 0.96)},
|
||||||
lYellow= {.95, .95, 0.5},
|
yellow= {hsv(0.16, 0.82, 0.90)},
|
||||||
lLime= {0.8, .95, 0.4},
|
lime= {hsv(0.18, 0.89, 0.88)},
|
||||||
lJade= {0.6, .95, 0.4},
|
jade= {hsv(0.23, 1.00, 0.82)},
|
||||||
lGreen= {0.5, .95, 0.5},
|
green= {hsv(0.33, 1.00, 0.81)},
|
||||||
lAqua= {0.4, .95, 0.7},
|
aqua= {hsv(0.48, 1.00, 0.74)},
|
||||||
lCyan= {0.5, .95, .95},
|
cyan= {hsv(0.53, 1.00, 0.88)},
|
||||||
lNavy= {0.4, .85, .95},
|
navy= {hsv(0.56, 1.00, 1.00)},
|
||||||
lSea= {0.5, 0.7, .95},
|
sea= {hsv(0.61, 1.00, 1.00)},
|
||||||
lBlue= {0.7, 0.7, .95},
|
blue= {hsv(0.64, 1.00, 0.95)},
|
||||||
lViolet= {0.7, 0.4, .95},
|
violet= {hsv(0.73, 1.00, 0.91)},
|
||||||
lPurple= {0.8, 0.4, .95},
|
purple= {hsv(0.80, 1.00, 0.81)},
|
||||||
lMagenta={.95, 0.5, .95},
|
magenta= {hsv(0.86, 1.00, 0.78)},
|
||||||
lWine= {.95, 0.4, 0.7},
|
wine= {hsv(0.94, 0.96, 0.91)},
|
||||||
|
|
||||||
dRed= {0.6, .08, .08},
|
lRed= {hsv(0.00, 0.38, 0.93)},
|
||||||
dFire= {0.6, 0.3, .08},
|
lFire= {hsv(0.04, 0.45, 0.91)},
|
||||||
dOrange= {0.6, 0.4, .08},
|
lOrange= {hsv(0.10, 0.53, 0.92)},
|
||||||
dYellow= {0.6, 0.6, .08},
|
lYellow= {hsv(0.15, 0.61, 0.95)},
|
||||||
dLime= {0.5, 0.6, .08},
|
lLime= {hsv(0.19, 0.66, 0.92)},
|
||||||
dJade= {0.3, 0.6, .08},
|
lJade= {hsv(0.24, 0.56, 0.90)},
|
||||||
dGreen= {.08, 0.6, .08},
|
lGreen= {hsv(0.34, 0.49, 0.89)},
|
||||||
dAqua= {.08, 0.6, 0.4},
|
lAqua= {hsv(0.49, 0.59, 0.85)},
|
||||||
dCyan= {.08, 0.6, 0.6},
|
lCyan= {hsv(0.51, 0.77, 0.88)},
|
||||||
dNavy= {.08, 0.4, 0.6},
|
lNavy= {hsv(0.54, 0.80, 0.95)},
|
||||||
dSea= {.08, 0.2, 0.6},
|
lSea= {hsv(0.56, 0.72, 0.97)},
|
||||||
dBlue= {0.1, 0.1, 0.6},
|
lBlue= {hsv(0.64, 0.44, 0.96)},
|
||||||
dViolet= {0.2, .08, 0.6},
|
lViolet= {hsv(0.73, 0.47, 0.95)},
|
||||||
dPurple= {0.4, .08, 0.6},
|
lPurple= {hsv(0.80, 0.62, 0.89)},
|
||||||
dMagenta={0.6, .08, 0.6},
|
lMagenta= {hsv(0.86, 0.61, 0.89)},
|
||||||
dWine= {0.6, .08, 0.3},
|
lWine= {hsv(0.93, 0.57, 0.92)},
|
||||||
|
|
||||||
black= {.05, .05, .05},
|
dRed= {hsv(0.00, 0.80, 0.48)},
|
||||||
dGray= {0.3, 0.3, 0.3},
|
dFire= {hsv(0.04, 0.80, 0.34)},
|
||||||
gray= {0.6, 0.6, 0.6},
|
dOrange= {hsv(0.07, 0.80, 0.39)},
|
||||||
lGray= {0.8, 0.8, 0.8},
|
dYellow= {hsv(0.11, 0.80, 0.37)},
|
||||||
white= {.97, .97, .97},
|
dLime= {hsv(0.17, 0.80, 0.26)},
|
||||||
|
dJade= {hsv(0.31, 0.80, 0.27)},
|
||||||
|
dGreen= {hsv(0.33, 0.80, 0.26)},
|
||||||
|
dAqua= {hsv(0.47, 0.80, 0.23)},
|
||||||
|
dCyan= {hsv(0.50, 0.80, 0.30)},
|
||||||
|
dNavy= {hsv(0.59, 0.80, 0.42)},
|
||||||
|
dSea= {hsv(0.64, 0.80, 0.40)},
|
||||||
|
dBlue= {hsv(0.67, 0.80, 0.34)},
|
||||||
|
dViolet= {hsv(0.71, 0.80, 0.35)},
|
||||||
|
dPurple= {hsv(0.76, 0.80, 0.32)},
|
||||||
|
dMagenta= {hsv(0.87, 0.80, 0.28)},
|
||||||
|
dWine= {hsv(0.92, 0.80, 0.28)},
|
||||||
|
|
||||||
|
black= {hsv(0.04, 0.04, 0.14)},
|
||||||
|
dGray= {hsv(0.02, 0.05, 0.44)},
|
||||||
|
gray= {hsv(0.02, 0.05, 0.65)},
|
||||||
|
lGray= {hsv(0.02, 0.06, 0.86)},
|
||||||
|
white= {hsv(0.01, 0.02, 0.99)},
|
||||||
}
|
}
|
||||||
for k,v in next,{
|
for k,v in next,{
|
||||||
R='red', F='fire', O='orange', Y='yellow', L='lime', J='jade', G='green', A='aqua', C='cyan', N='navy', S='sea', B='blue', V='violet', P='purple', M='magenta', W='wine',
|
R='red', F='fire', O='orange', Y='yellow', L='lime', J='jade', G='green', A='aqua', C='cyan', N='navy', S='sea', B='blue', V='violet', P='purple', M='magenta', W='wine',
|
||||||
lR='lRed',lF='lFire',lO='lOrange',lY='lYellow',lL='lLime',lJ='lJade',lG='lGreen',lA='lAqua',lC='lCyan',lN='lNavy',lS='lSea',lB='lBlue',lV='lViolet',lP='lPurple',lM='lMagenta',lW='lWine',
|
lR='lRed',lF='lFire',lO='lOrange',lY='lYellow',lL='lLime',lJ='lJade',lG='lGreen',lA='lAqua',lC='lCyan',lN='lNavy',lS='lSea',lB='lBlue',lV='lViolet',lP='lPurple',lM='lMagenta',lW='lWine',
|
||||||
dR='dRed',dF='dFire',dO='dOrange',dY='dYellow',dL='dLime',dJ='dJade',dG='dGreen',dA='dAqua',dC='dCyan',dN='dNavy',dS='dSea',dB='dBlue',dV='dViolet',dP='dPurple',dM='dMagenta',dW='dWine',
|
dR='dRed',dF='dFire',dO='dOrange',dY='dYellow',dL='dLime',dJ='dJade',dG='dGreen',dA='dAqua',dC='dCyan',dN='dNavy',dS='dSea',dB='dBlue',dV='dViolet',dP='dPurple',dM='dMagenta',dW='dWine',
|
||||||
D='black',dH='dGray',H='gray',lH='lGray',Z='white',
|
D='black',dH='dGray',H='gray',lH='lGray',Z='white',
|
||||||
|
|||||||
@@ -1,66 +1,60 @@
|
|||||||
local fs=love.filesystem
|
local fs=love.filesystem
|
||||||
local FILE={}
|
local FILE={}
|
||||||
function FILE.load(name,mode)
|
function FILE.load(name,args)
|
||||||
|
if not args then args=''end
|
||||||
if fs.getInfo(name)then
|
if fs.getInfo(name)then
|
||||||
local F=fs.newFile(name)
|
local F=fs.newFile(name)
|
||||||
if F:open'r'then
|
assert(F:open'r','open error')
|
||||||
local s=F:read()
|
local s=F:read()F:close()
|
||||||
F:close()
|
if args:sArg'-luaon'or args==''and s:sub(1,6)=='return{'then
|
||||||
if mode=='luaon'or not mode and s:sub(1,6)=="return{"then
|
local func=loadstring(s)
|
||||||
s=loadstring(s)
|
if func then
|
||||||
if s then
|
setfenv(func,{})
|
||||||
setfenv(s,{})
|
local res=func()
|
||||||
return s()
|
return assert(res,'decode error')
|
||||||
end
|
|
||||||
elseif mode=='json'or not mode and s:sub(1,1)=="["and s:sub(-1)=="]"or s:sub(1,1)=="{"and s:sub(-1)=="}"then
|
|
||||||
local res=JSON.decode(s)
|
|
||||||
if res then
|
|
||||||
return res
|
|
||||||
end
|
|
||||||
elseif mode=='string'or not mode then
|
|
||||||
return s
|
|
||||||
else
|
else
|
||||||
MES.new("No file loading mode called "..tostring(mode))
|
error('decode error')
|
||||||
end
|
end
|
||||||
|
elseif args:sArg'-json'or args==''and s:sub(1,1)=='['and s:sub(-1)==']'or s:sub(1,1)=='{'and s:sub(-1)=='}'then
|
||||||
|
local res=JSON.decode(s)
|
||||||
|
if res then
|
||||||
|
return res
|
||||||
|
end
|
||||||
|
error('decode error')
|
||||||
|
elseif args:sArg'-string'or args==''then
|
||||||
|
return s
|
||||||
else
|
else
|
||||||
MES.new('error',name.." "..text.loadError)
|
error('unknown mode')
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
error('no file')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function FILE.save(data,name,mode)
|
function FILE.save(data,name,args)
|
||||||
if not mode then mode=""end
|
if not args then args=''end
|
||||||
|
if args:sArg'-d'and fs.getInfo(name)then
|
||||||
|
error('duplicate')
|
||||||
|
end
|
||||||
|
|
||||||
if type(data)=='table'then
|
if type(data)=='table'then
|
||||||
if mode:find'l'then
|
if args:sArg'-luaon'then
|
||||||
data=TABLE.dump(data)
|
data=TABLE.dump(data)
|
||||||
if not data then
|
if not data then
|
||||||
MES.new('error',name.." "..text.saveError.."dump error")
|
error('encode error')
|
||||||
return
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
data=JSON.encode(data)
|
data=JSON.encode(data)
|
||||||
if not data then
|
if not data then
|
||||||
MES.new('error',name.." "..text.saveError.."json error")
|
error('encode error')
|
||||||
return
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
data=tostring(data)
|
data=tostring(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
if mode:find'd'and fs.getInfo(name)then
|
|
||||||
MES.new('error',text.saveError_duplicate)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local F=fs.newFile(name)
|
local F=fs.newFile(name)
|
||||||
F:open'w'
|
assert(F:open('w'),'open error')
|
||||||
local success,mes=F:write(data)
|
F:write(data)F:flush()F:close()
|
||||||
F:flush()F:close()
|
|
||||||
if success then
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
MES.new('error',text.saveError..(mes or"unknown error"))
|
|
||||||
MES.traceback()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
function FILE.clear(path)
|
function FILE.clear(path)
|
||||||
if fs.getRealDirectory(path)==SAVEDIR and fs.getInfo(path).type=='directory'then
|
if fs.getRealDirectory(path)==SAVEDIR and fs.getInfo(path).type=='directory'then
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
NONE={}function NULL()end
|
NONE={}function NULL()end
|
||||||
EDITING=""
|
EDITING=""
|
||||||
LOADED=false
|
LOADED=false
|
||||||
ERRDATA={}
|
|
||||||
|
|
||||||
--Pure lua modules (basic)
|
--Pure lua modules (basic)
|
||||||
|
MATH= require'Zframework.mathExtend'
|
||||||
COLOR= require'Zframework.color'
|
COLOR= require'Zframework.color'
|
||||||
TABLE= require'Zframework.tableExtend'
|
TABLE= require'Zframework.tableExtend'
|
||||||
STRING= require'Zframework.stringExtend'
|
STRING= require'Zframework.stringExtend'
|
||||||
PROFILE= require'Zframework.profile'
|
PROFILE= require'Zframework.profile'
|
||||||
JSON= require'Zframework.json'
|
JSON= require'Zframework.json'
|
||||||
|
TEST= require'Zframework.test'
|
||||||
|
|
||||||
do--Add pcall & MES for JSON lib
|
do--Add pcall & MES for JSON lib
|
||||||
local encode,decode=JSON.encode,JSON.decode
|
local encode,decode=JSON.encode,JSON.decode
|
||||||
JSON.encode=function(val)
|
JSON.encode=function(val)
|
||||||
@@ -71,7 +73,8 @@ local xOy=SCR.xOy
|
|||||||
local ITP=xOy.inverseTransformPoint
|
local ITP=xOy.inverseTransformPoint
|
||||||
|
|
||||||
local mx,my,mouseShow=-20,-20,false
|
local mx,my,mouseShow=-20,-20,false
|
||||||
joysticks={}
|
local jsState={}--map, joystickID->axisStates: {axisName->axisVal}
|
||||||
|
local errData={}--list, each error create {mes={errMes strings},scene=sceneNameStr}
|
||||||
|
|
||||||
local devMode
|
local devMode
|
||||||
|
|
||||||
@@ -285,18 +288,18 @@ function love.textinput(texts)
|
|||||||
WIDGET.textinput(texts)
|
WIDGET.textinput(texts)
|
||||||
end
|
end
|
||||||
|
|
||||||
function love.joystickadded(JS)
|
--analog sticks: -1, 0, 1 for neg, neutral, pos
|
||||||
table.insert(joysticks,JS)
|
--triggers: 0 for released, 1 for pressed
|
||||||
MES.new('info',"Joystick added")
|
local jsAxisEventName={
|
||||||
end
|
leftx={'leftstick_left','leftstick_right'},
|
||||||
function love.joystickremoved(JS)
|
lefty={'leftstick_up','leftstick_down'},
|
||||||
local i=TABLE.find(joysticks,JS)
|
rightx={'rightstick_left','rightstick_right'},
|
||||||
if i then
|
righty={'rightstick_up','rightstick_down'},
|
||||||
table.remove(joysticks,i)
|
triggerleft='triggerleft',
|
||||||
MES.new('info',"Joystick removed")
|
triggerright='triggerright'
|
||||||
end
|
}
|
||||||
end
|
local gamePadKeys={'a','b','x','y','back','guide','start','leftstick','rightstick','leftshoulder','rightshoulder','dpup','dpdown','dpleft','dpright'}
|
||||||
local keyMirror={
|
local dPadToKey={
|
||||||
dpup='up',
|
dpup='up',
|
||||||
dpdown='down',
|
dpdown='down',
|
||||||
dpleft='left',
|
dpleft='left',
|
||||||
@@ -304,54 +307,92 @@ local keyMirror={
|
|||||||
start='return',
|
start='return',
|
||||||
back='escape',
|
back='escape',
|
||||||
}
|
}
|
||||||
|
function love.joystickadded(JS)
|
||||||
|
jsState[JS:getID()]={
|
||||||
|
_loveJSObj=JS,
|
||||||
|
leftx=0,lefty=0,
|
||||||
|
rightx=0,righty=0,
|
||||||
|
triggerleft=0,triggerright=0
|
||||||
|
}
|
||||||
|
MES.new('info',"Joystick added")
|
||||||
|
end
|
||||||
|
function love.joystickremoved(JS)
|
||||||
|
local js=jsState[JS:getID()]
|
||||||
|
if js then
|
||||||
|
for i=1,#gamePadKeys do
|
||||||
|
if JS:isGamepadDown(gamePadKeys[i])then
|
||||||
|
love.gamepadreleased(JS,gamePadKeys[i])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
love.gamepadaxis(JS,'leftx',0)
|
||||||
|
love.gamepadaxis(JS,'lefty',0)
|
||||||
|
love.gamepadaxis(JS,'rightx',0)
|
||||||
|
love.gamepadaxis(JS,'righty',0)
|
||||||
|
love.gamepadaxis(JS,'triggerleft',-1)
|
||||||
|
love.gamepadaxis(JS,'triggerright',-1)
|
||||||
|
jsState[JS:getID()]=nil
|
||||||
|
MES.new('info',"Joystick removed")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
function love.gamepadaxis(JS,axis,val)
|
||||||
|
local js=jsState[JS:getID()]
|
||||||
|
if js then
|
||||||
|
if axis=='leftx'or axis=='lefty'or axis=='rightx'or axis=='righty'then
|
||||||
|
local newVal=--range: [0,1]
|
||||||
|
val>.4 and 1 or
|
||||||
|
val<-.4 and -1 or
|
||||||
|
0
|
||||||
|
if newVal~=js[axis]then
|
||||||
|
if js[axis]==-1 then
|
||||||
|
love.gamepadreleased(JS,jsAxisEventName[axis][1])
|
||||||
|
elseif js[axis]~=0 then
|
||||||
|
love.gamepadreleased(JS,jsAxisEventName[axis][2])
|
||||||
|
end
|
||||||
|
if newVal==-1 then
|
||||||
|
love.gamepadpressed(JS,jsAxisEventName[axis][1])
|
||||||
|
elseif newVal==1 then
|
||||||
|
love.gamepadpressed(JS,jsAxisEventName[axis][2])
|
||||||
|
end
|
||||||
|
js[axis]=newVal
|
||||||
|
end
|
||||||
|
elseif axis=='triggerleft'or axis=='triggerright'then
|
||||||
|
local newVal=val>-.3 and 1 or 0--range: [-1,1]
|
||||||
|
if newVal~=js[axis]then
|
||||||
|
if newVal==1 then
|
||||||
|
love.gamepadpressed(JS,jsAxisEventName[axis])
|
||||||
|
else
|
||||||
|
love.gamepadreleased(JS,jsAxisEventName[axis])
|
||||||
|
end
|
||||||
|
js[axis]=newVal
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
function love.gamepadpressed(_,i)
|
function love.gamepadpressed(_,i)
|
||||||
mouseShow=false
|
mouseShow=false
|
||||||
if SCN.swapping then return end
|
if SCN.swapping then return end
|
||||||
if SCN.gamepadDown then SCN.gamepadDown(i)
|
if SCN.gamepadDown then SCN.gamepadDown(i)
|
||||||
elseif SCN.keyDown then SCN.keyDown(keyMirror[i]or i)
|
elseif SCN.keyDown then SCN.keyDown(dPadToKey[i]or i)
|
||||||
elseif i=="back"then SCN.back()
|
elseif i=="back"then SCN.back()
|
||||||
else WIDGET.gamepadPressed(keyMirror[i]or i)
|
else WIDGET.gamepadPressed(dPadToKey[i]or i)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function love.gamepadreleased(_,i)
|
function love.gamepadreleased(_,i)
|
||||||
if SCN.swapping then return end
|
if SCN.swapping then return end
|
||||||
if SCN.gamepadUp then SCN.gamepadUp(i)end
|
if SCN.gamepadUp then SCN.gamepadUp(i)end
|
||||||
end
|
end
|
||||||
--[[
|
|
||||||
function love.joystickpressed(JS,k)
|
|
||||||
mouseShow=false
|
|
||||||
if SCN.swapping then return end
|
|
||||||
if SCN.gamepadDown then SCN.gamepadDown(i)
|
|
||||||
elseif SCN.keyDown then SCN.keyDown(keyMirror[i]or i)
|
|
||||||
elseif i=="back"then SCN.back()
|
|
||||||
else WIDGET.gamepadPressed(i)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
function love.joystickreleased(JS,k)
|
|
||||||
if SCN.swapping then return end
|
|
||||||
if SCN.gamepadUp then SCN.gamepadUp(i)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
function love.joystickaxis(JS,axis,val)
|
|
||||||
|
|
||||||
end
|
|
||||||
function love.joystickhat(JS,hat,dir)
|
|
||||||
|
|
||||||
end
|
|
||||||
function love.sendData(data)end
|
|
||||||
function love.receiveData(id,data)end
|
|
||||||
]]
|
|
||||||
function love.filedropped(file)
|
function love.filedropped(file)
|
||||||
if SCN.fileDropped then SCN.fileDropped(file)end
|
if SCN.fileDropped then SCN.fileDropped(file)end
|
||||||
end
|
end
|
||||||
function love.directorydropped(dir)
|
function love.directorydropped(dir)
|
||||||
if SCN.directoryDropped then SCN.directoryDropped(dir)end
|
if SCN.directoryDropped then SCN.directoryDropped(dir)end
|
||||||
end
|
end
|
||||||
local lastGCtime=0
|
local autoGCcount=0
|
||||||
function love.lowmemory()
|
function love.lowmemory()
|
||||||
if love.timer.getTime()-lastGCtime>6.26 then
|
collectgarbage()
|
||||||
collectgarbage()
|
if autoGCcount<3 then
|
||||||
lastGCtime=love.timer.getTime()
|
autoGCcount=autoGCcount+1
|
||||||
MES.new('check',"[auto GC] low MEM 设备内存过低")
|
MES.new('check',"[auto GC] low MEM 设备内存过低")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -376,7 +417,7 @@ end
|
|||||||
function love.errorhandler(msg)
|
function love.errorhandler(msg)
|
||||||
if type(msg)~='string'then
|
if type(msg)~='string'then
|
||||||
msg="Unknown error"
|
msg="Unknown error"
|
||||||
elseif msg:find("Invaild UTF-8")and text then
|
elseif msg:find("Invalid UTF-8")and text then
|
||||||
msg=text.tryAnotherBuild
|
msg=text.tryAnotherBuild
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -400,20 +441,20 @@ function love.errorhandler(msg)
|
|||||||
love.audio.stop()
|
love.audio.stop()
|
||||||
gc.reset()
|
gc.reset()
|
||||||
|
|
||||||
if LOADED and #ERRDATA<3 then
|
if LOADED and #errData<3 then
|
||||||
BG.set('none')
|
BG.set('none')
|
||||||
local scn=SCN and SCN.cur or"NULL"
|
local scn=SCN and SCN.cur or"NULL"
|
||||||
table.insert(ERRDATA,{mes=err,scene=scn})
|
table.insert(errData,{mes=err,scene=scn})
|
||||||
|
|
||||||
--Write messages to log file
|
--Write messages to log file
|
||||||
love.filesystem.append('conf/error.log',
|
love.filesystem.append('conf/error.log',
|
||||||
os.date("%Y/%m/%d %A %H:%M:%S\n")..
|
os.date("%Y/%m/%d %A %H:%M:%S\n")..
|
||||||
#ERRDATA.." crash(es) "..love.system.getOS().."-"..VERSION.string.." scene: "..scn.."\n"..
|
#errData.." crash(es) "..love.system.getOS().."-"..VERSION.string.." scene: "..scn.."\n"..
|
||||||
table.concat(err,"\n",1,c-2).."\n\n"
|
table.concat(err,"\n",1,c-2).."\n\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
--Get screencapture
|
--Get screencapture
|
||||||
gc.captureScreenshot(function(_)ERRDATA[#ERRDATA].shot=gc.newImage(_)end)
|
gc.captureScreenshot(function(_)errData[#errData].shot=gc.newImage(_)end)
|
||||||
gc.present()
|
gc.present()
|
||||||
|
|
||||||
--Create a new mainLoop thread to keep game alive
|
--Create a new mainLoop thread to keep game alive
|
||||||
@@ -536,7 +577,7 @@ function love.run()
|
|||||||
--Scene Launch
|
--Scene Launch
|
||||||
while #SCN.stack>0 do SCN.pop()end
|
while #SCN.stack>0 do SCN.pop()end
|
||||||
SCN.push('quit','slowFade')
|
SCN.push('quit','slowFade')
|
||||||
SCN.init(#ERRDATA==0 and'load'or'error')
|
SCN.init(#errData==0 and'load'or'error')
|
||||||
|
|
||||||
return function()
|
return function()
|
||||||
local _
|
local _
|
||||||
@@ -620,9 +661,8 @@ function love.run()
|
|||||||
--Left-down infos
|
--Left-down infos
|
||||||
gc_setColor(devColor[devMode])
|
gc_setColor(devColor[devMode])
|
||||||
gc_print("MEM "..gcinfo(),safeX+5,-40)
|
gc_print("MEM "..gcinfo(),safeX+5,-40)
|
||||||
gc_print("Lines "..FREEROW.getCount(),safeX+5,-60)
|
gc_print("Tasks "..TASK.getCount(),safeX+5,-60)
|
||||||
gc_print("Tasks "..TASK.getCount(),safeX+5,-80)
|
gc_print("Voices "..VOC.getQueueCount(),safeX+5,-80)
|
||||||
gc_print("Voices "..VOC.getQueueCount(),safeX+5,-100)
|
|
||||||
|
|
||||||
--Update & draw frame time
|
--Update & draw frame time
|
||||||
table.insert(frameTimeList,1,dt)table.remove(frameTimeList,126)
|
table.insert(frameTimeList,1,dt)table.remove(frameTimeList,126)
|
||||||
@@ -701,6 +741,9 @@ end
|
|||||||
|
|
||||||
local Z={}
|
local Z={}
|
||||||
|
|
||||||
|
Z.js=jsState
|
||||||
|
Z.errData=errData
|
||||||
|
|
||||||
function Z.setIfPowerInfo(func)showPowerInfo=func end
|
function Z.setIfPowerInfo(func)showPowerInfo=func end
|
||||||
|
|
||||||
--[Warning] Color and line width is uncertain value, set it in the function.
|
--[Warning] Color and line width is uncertain value, set it in the function.
|
||||||
|
|||||||
23
Zframework/mathExtend.lua
Normal file
23
Zframework/mathExtend.lua
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
local MATH={}for k,v in next,math do MATH[k]=v end
|
||||||
|
|
||||||
|
local rnd=math.random
|
||||||
|
|
||||||
|
MATH.tau=2*math.pi
|
||||||
|
|
||||||
|
function MATH.sign(a)
|
||||||
|
return a>0 and 1 or a<0 and -1 or 0
|
||||||
|
end
|
||||||
|
|
||||||
|
function MATH.roll(chance)
|
||||||
|
return rnd()<(chance or .5)
|
||||||
|
end
|
||||||
|
|
||||||
|
function MATH.coin(a,b)
|
||||||
|
if rnd()<.5 then
|
||||||
|
return a
|
||||||
|
else
|
||||||
|
return b
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return MATH
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
local type,rem=type,table.remove
|
local type,rem=type,table.remove
|
||||||
|
local int,rnd=math.floor,math.random
|
||||||
|
|
||||||
local sfxList={}
|
local sfxList={}
|
||||||
local packSetting={}
|
local packSetting={}
|
||||||
@@ -6,7 +7,7 @@ local Sources={}
|
|||||||
local volume=1
|
local volume=1
|
||||||
local stereo=1
|
local stereo=1
|
||||||
|
|
||||||
local noteName={
|
local noteVal={
|
||||||
C=1,c=1,
|
C=1,c=1,
|
||||||
D=3,d=3,
|
D=3,d=3,
|
||||||
E=5,e=5,
|
E=5,e=5,
|
||||||
@@ -15,10 +16,11 @@ local noteName={
|
|||||||
A=10,a=10,
|
A=10,a=10,
|
||||||
B=12,b=12,
|
B=12,b=12,
|
||||||
}
|
}
|
||||||
|
local noteName={'C','C#','D','D#','E','F','F#','G','G#','A','A#','B'}
|
||||||
local function _getTuneHeight(tune)
|
local function _getTuneHeight(tune)
|
||||||
local octave=tonumber(tune:sub(-1,-1))
|
local octave=tonumber(tune:sub(-1,-1))
|
||||||
if octave then
|
if octave then
|
||||||
local tuneHeight=noteName[tune:sub(1,1)]
|
local tuneHeight=noteVal[tune:sub(1,1)]
|
||||||
if tuneHeight then
|
if tuneHeight then
|
||||||
tuneHeight=tuneHeight+(octave-1)*12
|
tuneHeight=tuneHeight+(octave-1)*12
|
||||||
local s=tune:sub(2,2)
|
local s=tune:sub(2,2)
|
||||||
@@ -55,14 +57,14 @@ function SFX.loadSample(pack)
|
|||||||
assert(type(pack)=='table',"Usage: SFX.loadsample([table])")
|
assert(type(pack)=='table',"Usage: SFX.loadsample([table])")
|
||||||
assert(pack.name,"No field: name")
|
assert(pack.name,"No field: name")
|
||||||
assert(pack.path,"No field: path")
|
assert(pack.path,"No field: path")
|
||||||
packSetting[pack.name]={
|
|
||||||
base=(_getTuneHeight(pack.base)or 37)-1,
|
|
||||||
}
|
|
||||||
local num=1
|
local num=1
|
||||||
while love.filesystem.getInfo(pack.path..'/'..num..'.ogg')do
|
while love.filesystem.getInfo(pack.path..'/'..num..'.ogg')do
|
||||||
Sources[pack.name..num]={love.audio.newSource(pack.path..'/'..num..'.ogg','static')}
|
Sources[pack.name..num]={love.audio.newSource(pack.path..'/'..num..'.ogg','static')}
|
||||||
num=num+1
|
num=num+1
|
||||||
end
|
end
|
||||||
|
local base=(_getTuneHeight(pack.base)or 37)-1
|
||||||
|
local top=base+num-1
|
||||||
|
packSetting[pack.name]={base=base,top=top}
|
||||||
LOG((num-1).." "..pack.name.." samples loaded")
|
LOG((num-1).." "..pack.name.." samples loaded")
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -70,31 +72,47 @@ function SFX.getCount()
|
|||||||
return #sfxList
|
return #sfxList
|
||||||
end
|
end
|
||||||
function SFX.setVol(v)
|
function SFX.setVol(v)
|
||||||
assert(type(v)=='number'and v>=0 and v<=1)
|
assert(type(v)=='number'and v>=0 and v<=1,'Wrong volume')
|
||||||
volume=v
|
volume=v
|
||||||
end
|
end
|
||||||
function SFX.setStereo(v)
|
function SFX.setStereo(v)
|
||||||
assert(type(v)=='number'and v>=0 and v<=1)
|
assert(type(v)=='number'and v>=0 and v<=1,'Wrong stereo')
|
||||||
stereo=v
|
stereo=v
|
||||||
end
|
end
|
||||||
|
|
||||||
function SFX.playSample(pack,...)--vol-2, sampSet1, vol-3, sampSet2, vol-1
|
function SFX.getNoteName(note)
|
||||||
|
if note<1 then
|
||||||
|
return'---'
|
||||||
|
else
|
||||||
|
note=note-1
|
||||||
|
local octave=int(note/12)+1
|
||||||
|
return noteName[note%12+1]..octave
|
||||||
|
end
|
||||||
|
end
|
||||||
|
function SFX.playSample(pack,...)--vol-1, sampSet1, vol-2, sampSet2
|
||||||
if ... then
|
if ... then
|
||||||
local arg={...}
|
local arg={...}
|
||||||
local vol
|
local vol
|
||||||
if type(arg[#arg])=='number'then vol=rem(arg)end
|
|
||||||
for i=1,#arg do
|
for i=1,#arg do
|
||||||
if type(arg[i])=='number'then
|
local a=arg[i]
|
||||||
vol=arg[i]
|
if type(a)=='number'and a<=1 then
|
||||||
|
vol=a
|
||||||
else
|
else
|
||||||
local tune=arg[i]
|
local base=packSetting[pack].base
|
||||||
tune=_getTuneHeight(tune)-packSetting[pack].base
|
local top=packSetting[pack].top
|
||||||
SFX.play(pack..tune,vol)
|
local tune=type(a)=='string'and _getTuneHeight(a)or a--Absolute tune in number
|
||||||
|
local playTune=tune+rnd(-2,2)
|
||||||
|
if playTune<=base then--Too low notes
|
||||||
|
playTune=base+1
|
||||||
|
elseif playTune>top then--Too high notes
|
||||||
|
playTune=top
|
||||||
|
end
|
||||||
|
SFX.play(pack..playTune-base,vol,nil,tune-playTune)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function SFX.play(name,vol,pos)
|
local function _play(name,vol,pos,pitch)
|
||||||
if volume==0 or vol==0 then return end
|
if volume==0 or vol==0 then return end
|
||||||
local S=Sources[name]--Source list
|
local S=Sources[name]--Source list
|
||||||
if not S then return end
|
if not S then return end
|
||||||
@@ -116,32 +134,13 @@ function SFX.play(name,vol,pos)
|
|||||||
S:setPosition(0,0,0)
|
S:setPosition(0,0,0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
S:setVolume(((vol or 1)*volume)^1.626)
|
S:setVolume(vol^1.626)
|
||||||
|
S:setPitch(pitch and 1.0594630943592953^pitch or 1)
|
||||||
S:play()
|
S:play()
|
||||||
end
|
end
|
||||||
function SFX.fplay(name,vol,pos)
|
SFX.fplay=_play--Play sounds without apply module's volume setting
|
||||||
local S=Sources[name]--Source list
|
function SFX.play(name,vol,pos,pitch)
|
||||||
if not S then return end
|
_play(name,(vol or 1)*volume,pos,pitch)
|
||||||
local n=1
|
|
||||||
while S[n]:isPlaying()do
|
|
||||||
n=n+1
|
|
||||||
if not S[n]then
|
|
||||||
S[n]=S[1]:clone()
|
|
||||||
S[n]:seek(0)
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
S=S[n]--AU_SRC
|
|
||||||
if S:getChannelCount()==1 then
|
|
||||||
if pos then
|
|
||||||
pos=pos*stereo
|
|
||||||
S:setPosition(pos,1-pos^2,0)
|
|
||||||
else
|
|
||||||
S:setPosition(0,0,0)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
S:setVolume(vol^1.626)
|
|
||||||
S:play()
|
|
||||||
end
|
end
|
||||||
function SFX.reset()
|
function SFX.reset()
|
||||||
for _,L in next,Sources do
|
for _,L in next,Sources do
|
||||||
|
|||||||
@@ -2,9 +2,25 @@ local data=love.data
|
|||||||
local STRING={}
|
local STRING={}
|
||||||
local assert,tostring,tonumber=assert,tostring,tonumber
|
local assert,tostring,tonumber=assert,tostring,tonumber
|
||||||
local int,format=math.floor,string.format
|
local int,format=math.floor,string.format
|
||||||
local find,sub,upper=string.find,string.sub,string.upper
|
local find,sub,gsub,upper=string.find,string.sub,string.gsub,string.upper
|
||||||
local char,byte=string.char,string.byte
|
local char,byte=string.char,string.byte
|
||||||
|
|
||||||
|
--"Replace dollars", replace all $n with ...
|
||||||
|
function string.repD(str,...)
|
||||||
|
local l={...}
|
||||||
|
for i=#l,1,-1 do
|
||||||
|
str=gsub(str,'$'..i,l[i])
|
||||||
|
end
|
||||||
|
return str
|
||||||
|
end
|
||||||
|
|
||||||
|
--"Scan arg", scan if str has the arg (format of str is like "-json -q", arg is like "-q")
|
||||||
|
function string.sArg(str,switch)
|
||||||
|
if find(str.." ",switch.." ")then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
do--function STRING.shiftChar(c)
|
do--function STRING.shiftChar(c)
|
||||||
local shiftMap={
|
local shiftMap={
|
||||||
['1']='!',['2']='@',['3']='#',['4']='$',['5']='%',
|
['1']='!',['2']='@',['3']='#',['4']='$',['5']='%',
|
||||||
@@ -63,9 +79,9 @@ function STRING.time(t)
|
|||||||
if t<60 then
|
if t<60 then
|
||||||
return format("%.3f\"",t)
|
return format("%.3f\"",t)
|
||||||
elseif t<3600 then
|
elseif t<3600 then
|
||||||
return format("%d'%05.2f\"",int(t/60),t%60)
|
return format("%d'%05.2f\"",int(t/60),int(t%60*100)/100)
|
||||||
else
|
else
|
||||||
return format("%d:%.2d'%05.2f\"",int(t/3600),int(t/60%60),t%60)
|
return format("%d:%.2d'%05.2f\"",int(t/3600),int(t/60%60),int(t%60*100)/100)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
local find=string.find
|
local find=string.find
|
||||||
|
local rem=table.remove
|
||||||
local next,type=next,type
|
local next,type=next,type
|
||||||
local TABLE={}
|
local TABLE={}
|
||||||
|
|
||||||
@@ -46,6 +47,18 @@ function TABLE.cover(new,old)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--For all things in new, push to old
|
||||||
|
function TABLE.coverR(new,old)
|
||||||
|
for k,v in next,new do
|
||||||
|
if type(v)=='table'and type(old[k])=='table'then
|
||||||
|
TABLE.coverR(v,old[k])
|
||||||
|
else
|
||||||
|
old[k]=v
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--For all things in new if same type in old, push to old
|
--For all things in new if same type in old, push to old
|
||||||
function TABLE.update(new,old)
|
function TABLE.update(new,old)
|
||||||
for k,v in next,new do
|
for k,v in next,new do
|
||||||
@@ -71,7 +84,7 @@ function TABLE.complete(new,old)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Remove positive integer index of table
|
--Remove [1~#] of table
|
||||||
function TABLE.cut(G)
|
function TABLE.cut(G)
|
||||||
for i=1,#G do
|
for i=1,#G do
|
||||||
G[i]=nil
|
G[i]=nil
|
||||||
@@ -85,11 +98,53 @@ function TABLE.clear(G)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--Remove duplicated value of [1~#]
|
||||||
|
function TABLE.trimDuplicate(org)
|
||||||
|
local cache={}
|
||||||
|
for i=1,#org,-1 do
|
||||||
|
if cache[org[i]]then
|
||||||
|
rem(org,i)
|
||||||
|
else
|
||||||
|
cache[org[i]]=true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--Discard duplicated value
|
||||||
|
function TABLE.remDuplicate(org)
|
||||||
|
local cache={}
|
||||||
|
for k,v in next,org do
|
||||||
|
if cache[v]then
|
||||||
|
org[k]=nil
|
||||||
|
else
|
||||||
|
cache[v]=true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--Reverse [1~#]
|
||||||
|
function TABLE.reverse(org)
|
||||||
|
local l=#org
|
||||||
|
for i=1,math.floor(l/2)do
|
||||||
|
org[i],org[l+1-i]=org[l+1-i],org[i]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--------------------------
|
||||||
|
|
||||||
--Find value in [1~#]
|
--Find value in [1~#]
|
||||||
function TABLE.find(t,val)
|
function TABLE.find(t,val)
|
||||||
for i=1,#t do if t[i]==val then return i end end
|
for i=1,#t do if t[i]==val then return i end end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--Return next value of [1~#] (by value)
|
||||||
|
function TABLE.next(t,val)
|
||||||
|
for i=1,#t do if t[i]==val then return t[i%#t+1]end end
|
||||||
|
end
|
||||||
|
|
||||||
|
--------------------------
|
||||||
|
|
||||||
--Find value in whole table
|
--Find value in whole table
|
||||||
function TABLE.search(t,val)
|
function TABLE.search(t,val)
|
||||||
for k,v in next,t do if v==val then return k end end
|
for k,v in next,t do if v==val then return k end end
|
||||||
@@ -104,6 +159,8 @@ function TABLE.reIndex(org)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--------------------------
|
||||||
|
|
||||||
--Dump a simple lua table
|
--Dump a simple lua table
|
||||||
do--function TABLE.dump(L,t)
|
do--function TABLE.dump(L,t)
|
||||||
local tabs={
|
local tabs={
|
||||||
|
|||||||
12
Zframework/test.lua
Normal file
12
Zframework/test.lua
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
local TEST={}
|
||||||
|
|
||||||
|
--Wait for the scene swapping animation to finish
|
||||||
|
function TEST.yieldUntilNextScene()
|
||||||
|
while SCN.swapping do YIELD()end
|
||||||
|
end
|
||||||
|
|
||||||
|
function TEST.yieldN(frames)
|
||||||
|
for _=1,frames do YIELD()end
|
||||||
|
end
|
||||||
|
|
||||||
|
return TEST
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
|
local rnd=math.random
|
||||||
|
local volume=1
|
||||||
|
local diversion=0
|
||||||
local VOC={
|
local VOC={
|
||||||
vol=1,
|
|
||||||
getCount=function()return 0 end,
|
getCount=function()return 0 end,
|
||||||
getQueueCount=function()return 0 end,
|
getQueueCount=function()return 0 end,
|
||||||
load=function()error("Cannot load before init!")end,
|
load=function()error("Cannot load before init!")end,
|
||||||
@@ -7,13 +9,16 @@ local VOC={
|
|||||||
play=NULL,
|
play=NULL,
|
||||||
update=NULL,
|
update=NULL,
|
||||||
}
|
}
|
||||||
|
function VOC.setDiversion(n)
|
||||||
|
assert(type(n)=='number'and n>0 and n<12,'Wrong div')
|
||||||
|
diversion=n
|
||||||
|
end
|
||||||
function VOC.setVol(v)
|
function VOC.setVol(v)
|
||||||
assert(type(v)=='number'and v>=0 and v<=1)
|
assert(type(v)=='number'and v>=0 and v<=1,'Wrong volume')
|
||||||
VOC.vol=v
|
volume=v
|
||||||
end
|
end
|
||||||
function VOC.init(list)
|
function VOC.init(list)
|
||||||
VOC.init=nil
|
VOC.init=nil
|
||||||
local rnd=math.random
|
|
||||||
local rem=table.remove
|
local rem=table.remove
|
||||||
local voiceQueue={free=0}
|
local voiceQueue={free=0}
|
||||||
local bank={}--{vocName1={SRC1s},vocName2={SRC2s},...}
|
local bank={}--{vocName1={SRC1s},vocName2={SRC2s},...}
|
||||||
@@ -72,7 +77,7 @@ function VOC.init(list)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function VOC.play(s,chn)
|
function VOC.play(s,chn)
|
||||||
if VOC.vol>0 then
|
if volume>0 then
|
||||||
local _=Source[s]
|
local _=Source[s]
|
||||||
if not _ then return end
|
if not _ then return end
|
||||||
if chn then
|
if chn then
|
||||||
@@ -95,13 +100,15 @@ function VOC.init(list)
|
|||||||
end
|
end
|
||||||
elseif Q.s==1 then--Waiting load source
|
elseif Q.s==1 then--Waiting load source
|
||||||
Q[1]=_getVoice(Q[1])
|
Q[1]=_getVoice(Q[1])
|
||||||
Q[1]:setVolume(VOC.vol)
|
Q[1]:setVolume(volume)
|
||||||
|
Q[1]:setPitch(1.0594630943592953^(diversion*(rnd()*2-1)))
|
||||||
Q[1]:play()
|
Q[1]:play()
|
||||||
Q.s=Q[2]and 2 or 4
|
Q.s=Q[2]and 2 or 4
|
||||||
elseif Q.s==2 then--Playing 1,ready 2
|
elseif Q.s==2 then--Playing 1,ready 2
|
||||||
if Q[1]:getDuration()-Q[1]:tell()<.08 then
|
if Q[1]:getDuration()-Q[1]:tell()<.08 then
|
||||||
Q[2]=_getVoice(Q[2])
|
Q[2]=_getVoice(Q[2])
|
||||||
Q[2]:setVolume(VOC.vol)
|
Q[2]:setVolume(volume)
|
||||||
|
Q[1]:setPitch(1.0594630943592953^(diversion*(rnd()*2-1)))
|
||||||
Q[2]:play()
|
Q[2]:play()
|
||||||
Q.s=3
|
Q.s=3
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -435,7 +435,7 @@ end
|
|||||||
function switch:press()
|
function switch:press()
|
||||||
self.code()
|
self.code()
|
||||||
if self.sound then
|
if self.sound then
|
||||||
SFX.play('move')
|
SFX.play('touch')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function WIDGET.newSwitch(D)--name,x,y[,lim][,fText][,color][,font=30][,sound=true][,disp],code[,hideF][,hide]
|
function WIDGET.newSwitch(D)--name,x,y[,lim][,fText][,color][,font=30][,sound=true][,disp],code[,hideF][,hide]
|
||||||
@@ -1431,7 +1431,7 @@ function WIDGET.textinput(texts)
|
|||||||
if W and W.type=='inputBox'then
|
if W and W.type=='inputBox'then
|
||||||
if(not W.regex or texts:match(W.regex))and(not W.limit or #(WIDGET.sel.value..texts)<=W.limit)then
|
if(not W.regex or texts:match(W.regex))and(not W.limit or #(WIDGET.sel.value..texts)<=W.limit)then
|
||||||
WIDGET.sel.value=WIDGET.sel.value..texts
|
WIDGET.sel.value=WIDGET.sel.value..texts
|
||||||
SFX.play('move')
|
SFX.play('touch')
|
||||||
else
|
else
|
||||||
SFX.play('finesseError',.3)
|
SFX.play('finesseError',.3)
|
||||||
end
|
end
|
||||||
|
|||||||
44
legals.md
44
legals.md
@@ -1,27 +1,23 @@
|
|||||||
**TECHMINO © 2019-2021 26F Studio. Some rights reserved.**
|
TECHMINO © 2019-2021 26F Studio. Some rights reserved.
|
||||||
TECHMINO and "26F Studio" are trademarks of 26F Studio.
|
|
||||||
The TECHMINO game and source code are under a GNU Lesser General Public License Version 3.
|
TECHMINO and "26F Studio" are trademarks of 26F Studio. The TECHMINO game and source code are under a GNU Lesser General Public License Version 3.
|
||||||
|
|
||||||
|
|
||||||
TECHMINO is not a fan game of Tetris. TECHMINO and 26F Studio are not affiliated with Tetris Holding, LLC or The Tetris Company, Inc. in any way.
|
"Tetris" is the registered trademark of The Tetris Holding, LLC, licensed to The Tetris Company, Inc. TECHMINO is not a fan game of Tetris. TECHMINO and 26F Studio are not affiliated with Tetris Holding, LLC or The Tetris Company, Inc. in any way.
|
||||||
|
|
||||||
|
|
||||||
"Tetris" is the registered trademark of The Tetris Holding, LLC, licensed to The Tetris Company, Inc.
|
|
||||||
|
|
||||||
|
|
||||||
Powered by LÖVE, © 2006-2021 LÖVE Development Team.
|
Powered by LÖVE, © 2006-2021 LÖVE Development Team.
|
||||||
|
|
||||||
|
Lua is free software distributed under the terms of the MIT license. Copyright © 1994-2021 by Lua.org, PUC-Rio.
|
||||||
|
|
||||||
Lua is free software distributed under the terms of the MIT license. Copyright © 1994~2021 by Lua.org, PUC-Rio.
|
SIMPLE LOVE LIGHTS is under a MIT License. Created by Dylan Hunn.
|
||||||
|
|
||||||
|
json.lua is copyrighted by rxi. © 2021 rxi.
|
||||||
|
|
||||||
|
IBM Plex is copyrighted by the International Business Machines Corporation. IBM and IBM Plex are trademarks of IBM Corp, registered in many jurisdictions worldwide. IBM Plex is licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
|
||||||
|
|
||||||
The Apple logo, "Apple Inc.," iOS, iPadOS, macOS, iPhone, and Mac are registered trademarks of Apple Inc. in the United States of America and other countries or regions.
|
Source Han Sans is copyrighted by Adobe Inc. Source Han Sans and Adobe are registered trademarks of Adobe Inc. in United States and other countries or regions. Source Han Sans is licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
|
||||||
|
|
||||||
"Windows", the Windows logo, "Xbox", Xbox logo, and "Microsoft" are registered trademarks of Microsoft Corporation in the United States of America and other countries or regions.
|
|
||||||
|
|
||||||
|
|
||||||
Alibaba Sans is copyrighted by Alibaba Group Holding Limited. Alibaba is a trademark of Alibaba Group Holding Limited in the People’s Republic of China and other countries or regions.
|
|
||||||
|
|
||||||
|
|
||||||
JetBrains Mono is copyrighted by the JetBrains Mono Project authors. JetBrains Mono is a trademark of JetBrains s.r.o. JetBrains Mono is licensed under the SIL Open Font License, Version 1.1.
|
JetBrains Mono is copyrighted by the JetBrains Mono Project authors. JetBrains Mono is a trademark of JetBrains s.r.o. JetBrains Mono is licensed under the SIL Open Font License, Version 1.1.
|
||||||
@@ -30,22 +26,26 @@ JetBrains Mono is copyrighted by the JetBrains Mono Project authors. JetBrains M
|
|||||||
"PlayStation", "PS", "PlayStation Family Mark", "PS logo", "DualSense" and "Play Has No Limits" are registered trademarks or trademarks of Sony Interactive Entertainment Inc. "SONY" is a registered trademark of Sony Corporation. © 2021 Sony Interactive Entertainment LLC.
|
"PlayStation", "PS", "PlayStation Family Mark", "PS logo", "DualSense" and "Play Has No Limits" are registered trademarks or trademarks of Sony Interactive Entertainment Inc. "SONY" is a registered trademark of Sony Corporation. © 2021 Sony Interactive Entertainment LLC.
|
||||||
|
|
||||||
|
|
||||||
N3TWORK is a registered trademark of N3TWORK Inc. © 2021 N3TWORK Inc.
|
"Windows", the Windows logo, "Xbox", Xbox logo, and "Microsoft" are registered trademarks of Microsoft Corporation in the United States of America and other countries or regions.
|
||||||
|
|
||||||
|
|
||||||
|
The Apple logo, "Apple Inc.," iOS, iPadOS, macOS, iPhone, and Mac are registered trademarks of Apple Inc. in the United States of America and other countries or regions.
|
||||||
|
|
||||||
|
|
||||||
"EA" and "Electronic Arts" are registered trademarks of Electronic Arts Inc. © 2021 Electronic Arts Inc.
|
"EA" and "Electronic Arts" are registered trademarks of Electronic Arts Inc. © 2021 Electronic Arts Inc.
|
||||||
|
|
||||||
|
SEGA and the SEGA logo are registered trademarks of Sega Corporation. © 2021 Sega Corporation.
|
||||||
|
|
||||||
Oculus Quest is a registered trademark of Facebook Technologies, LLC. © Facebook, Inc.
|
Oculus Quest is a registered trademark of Facebook Technologies, LLC. © Meta Platforms, Inc.
|
||||||
|
|
||||||
|
"Nintendo" is a registered trademarks of Nintendo Co., Ltd. © 2021 Nintendo Co., Ltd.
|
||||||
|
|
||||||
|
N3TWORK is a registered trademark of N3TWORK Inc. © 2021 N3TWORK Inc.
|
||||||
|
|
||||||
GoldWave is a registered trademark of GoldWave, Inc.
|
GoldWave is a registered trademark of GoldWave, Inc.
|
||||||
|
|
||||||
|
Linux is a registered trademark of Linus Torvalds.
|
||||||
Linux is a registered trademark of Linus Torvalds.
|
|
||||||
|
|
||||||
|
|
||||||
Touhou Project © Team Shanghai Alice 2002-2021.
|
Touhou Project © Team Shanghai Alice 2002-2021.
|
||||||
|
|
||||||
|
All other trademarks, logos, and copyrights are the properties of their respective owners.
|
||||||
All other trademarks are the properties of their respective owners.
|
|
||||||
|
|||||||
118
main.lua
118
main.lua
@@ -24,6 +24,7 @@ VERSION=require"version"
|
|||||||
TIME=love.timer.getTime
|
TIME=love.timer.getTime
|
||||||
YIELD=coroutine.yield
|
YIELD=coroutine.yield
|
||||||
SYSTEM=love.system.getOS()
|
SYSTEM=love.system.getOS()
|
||||||
|
FNSF=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()
|
SAVEDIR=fs.getSaveDirectory()
|
||||||
|
|
||||||
@@ -51,7 +52,9 @@ local _LOADTIME_=TIME()
|
|||||||
Z=require'Zframework'
|
Z=require'Zframework'
|
||||||
FONT.load('parts/fonts/proportional.ttf')
|
FONT.load('parts/fonts/proportional.ttf')
|
||||||
SCR.setSize(1280,720)--Initialize Screen size
|
SCR.setSize(1280,720)--Initialize Screen size
|
||||||
|
BGM.setMaxSources(5)
|
||||||
BGM.setChange(function(name)MES.new('music',text.nowPlaying..name,5)end)
|
BGM.setChange(function(name)MES.new('music',text.nowPlaying..name,5)end)
|
||||||
|
VOC.setDiversion(1)
|
||||||
|
|
||||||
table.insert(_LOADTIMELIST_,("Load Zframework: %.3fs"):format(TIME()-_LOADTIME_))
|
table.insert(_LOADTIMELIST_,("Load Zframework: %.3fs"):format(TIME()-_LOADTIME_))
|
||||||
|
|
||||||
@@ -90,7 +93,7 @@ for _,v in next,fs.getDirectoryItems('parts/shaders')do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
FREEROW= require'parts.freeRow'
|
LINE= require'parts.line'
|
||||||
DATA= require'parts.data'
|
DATA= require'parts.data'
|
||||||
|
|
||||||
TEXTURE= require'parts.texture'
|
TEXTURE= require'parts.texture'
|
||||||
@@ -104,6 +107,12 @@ PLY= require'parts.player'
|
|||||||
NETPLY= require'parts.netPlayer'
|
NETPLY= require'parts.netPlayer'
|
||||||
MODES= require'parts.modes'
|
MODES= require'parts.modes'
|
||||||
|
|
||||||
|
setmetatable(TEXTURE,{__index=function(self,k)
|
||||||
|
MES.new('warn',"No texture called: "..k)
|
||||||
|
self[k]=love.graphics.newCanvas(1,1)
|
||||||
|
return self[k]
|
||||||
|
end})
|
||||||
|
|
||||||
table.insert(_LOADTIMELIST_,("Load Parts: %.3fs"):format(TIME()-_LOADTIME_))
|
table.insert(_LOADTIMELIST_,("Load Parts: %.3fs"):format(TIME()-_LOADTIME_))
|
||||||
|
|
||||||
--Init Zframework
|
--Init Zframework
|
||||||
@@ -143,8 +152,8 @@ Z.setOnFnKeys({
|
|||||||
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
|
||||||
local P=PLY_ALIVE[math.random(#PLY_ALIVE)]
|
if #PLY_ALIVE>1 then
|
||||||
if P and P~=PLAYERS[1]then
|
local P=PLY_ALIVE[math.random(2,#PLY_ALIVE)]
|
||||||
P.lastRecv=PLAYERS[1]
|
P.lastRecv=PLAYERS[1]
|
||||||
P:lose()
|
P:lose()
|
||||||
end
|
end
|
||||||
@@ -153,7 +162,7 @@ Z.setOnFnKeys({
|
|||||||
end,
|
end,
|
||||||
function()print(WIDGET.getSelected()or"no widget selected")end,
|
function()print(WIDGET.getSelected()or"no widget selected")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,
|
||||||
})
|
})
|
||||||
do--Z.setOnFocus
|
do--Z.setOnFocus
|
||||||
local function task_autoSoundOff()
|
local function task_autoSoundOff()
|
||||||
@@ -196,15 +205,15 @@ end
|
|||||||
Z.setOnQuit(destroyPlayers)
|
Z.setOnQuit(destroyPlayers)
|
||||||
|
|
||||||
--Load settings and statistics
|
--Load settings and statistics
|
||||||
TABLE.cover (FILE.load('conf/user')or{},USER)
|
TABLE.cover (loadFile('conf/user')or{},USER)
|
||||||
TABLE.cover (FILE.load('conf/unlock')or{},RANKS)
|
TABLE.cover (loadFile('conf/unlock')or{},RANKS)
|
||||||
TABLE.update(FILE.load('conf/settings')or{},SETTING)
|
TABLE.update(loadFile('conf/settings')or{},SETTING)
|
||||||
TABLE.update(FILE.load('conf/data')or{},STAT)
|
TABLE.coverR(loadFile('conf/data')or{},STAT)
|
||||||
TABLE.cover (FILE.load('conf/key')or{},KEY_MAP)
|
TABLE.cover (loadFile('conf/key')or{},KEY_MAP)
|
||||||
TABLE.cover (FILE.load('conf/virtualkey')or{},VK_ORG)
|
TABLE.cover (loadFile('conf/virtualkey')or{},VK_ORG)
|
||||||
|
|
||||||
--Initialize fields, sequence, missions, gameEnv for cutsom game
|
--Initialize fields, sequence, missions, gameEnv for cutsom game
|
||||||
local fieldData=FILE.load('conf/customBoards','string')
|
local fieldData=loadFile('conf/customBoards','-string')
|
||||||
if fieldData then
|
if fieldData then
|
||||||
fieldData=STRING.split(fieldData,"!")
|
fieldData=STRING.split(fieldData,"!")
|
||||||
for i=1,#fieldData do
|
for i=1,#fieldData do
|
||||||
@@ -213,16 +222,16 @@ if fieldData then
|
|||||||
else
|
else
|
||||||
FIELD[1]=DATA.newBoard()
|
FIELD[1]=DATA.newBoard()
|
||||||
end
|
end
|
||||||
local sequenceData=FILE.load('conf/customSequence','string')
|
local sequenceData=loadFile('conf/customSequence','-string')
|
||||||
if sequenceData then
|
if sequenceData then
|
||||||
DATA.pasteSequence(sequenceData)
|
DATA.pasteSequence(sequenceData)
|
||||||
end
|
end
|
||||||
local missionData=FILE.load('conf/customMissions','string')
|
local missionData=loadFile('conf/customMissions','-string')
|
||||||
if missionData then
|
if missionData then
|
||||||
DATA.pasteMission(missionData)
|
DATA.pasteMission(missionData)
|
||||||
end
|
end
|
||||||
local customData=FILE.load('conf/customEnv')
|
local customData=loadFile('conf/customEnv')
|
||||||
if customData and customData.version==VERSION.code then
|
if customData and customData['version']==VERSION.code then
|
||||||
TABLE.complete(customData,CUSTOMENV)
|
TABLE.complete(customData,CUSTOMENV)
|
||||||
end
|
end
|
||||||
TABLE.complete(require"parts.customEnv0",CUSTOMENV)
|
TABLE.complete(require"parts.customEnv0",CUSTOMENV)
|
||||||
@@ -325,6 +334,7 @@ LANG.init('zh',
|
|||||||
{
|
{
|
||||||
zh=require'parts.language.lang_zh',
|
zh=require'parts.language.lang_zh',
|
||||||
zh_full=require'parts.language.lang_zh_full',
|
zh_full=require'parts.language.lang_zh_full',
|
||||||
|
zh_trad=require'parts.language.lang_zh_trad',
|
||||||
en=require'parts.language.lang_en',
|
en=require'parts.language.lang_en',
|
||||||
fr=require'parts.language.lang_fr',
|
fr=require'parts.language.lang_fr',
|
||||||
es=require'parts.language.lang_es',
|
es=require'parts.language.lang_es',
|
||||||
@@ -334,7 +344,7 @@ LANG.init('zh',
|
|||||||
symbol=require'parts.language.lang_symbol',
|
symbol=require'parts.language.lang_symbol',
|
||||||
--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/setting_lang.lua;
|
--3. Add a button in parts/scenes/lang.lua;
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
block=BLOCK_NAMES
|
block=BLOCK_NAMES
|
||||||
@@ -443,7 +453,7 @@ do
|
|||||||
fs.remove('record/round_l.rec')
|
fs.remove('record/round_l.rec')
|
||||||
fs.remove('record/round_u.rec')
|
fs.remove('record/round_u.rec')
|
||||||
end
|
end
|
||||||
if STAT.version<1604 then
|
if RANKS.stack_e then
|
||||||
RANKS.stack_e=nil
|
RANKS.stack_e=nil
|
||||||
RANKS.stack_h=nil
|
RANKS.stack_h=nil
|
||||||
RANKS.stack_u=nil
|
RANKS.stack_u=nil
|
||||||
@@ -459,17 +469,41 @@ do
|
|||||||
fs.remove('record/stack_40l.rec')
|
fs.remove('record/stack_40l.rec')
|
||||||
fs.remove('record/stack_100l.rec')
|
fs.remove('record/stack_100l.rec')
|
||||||
end
|
end
|
||||||
|
if RANKS.rhythm_e then
|
||||||
|
RANKS.rhythm_e=nil
|
||||||
|
RANKS.rhythm_h=nil
|
||||||
|
RANKS.rhythm_u=nil
|
||||||
|
fs.remove('record/rhythm_e.rec')
|
||||||
|
fs.remove('record/rhythm_h.rec')
|
||||||
|
fs.remove('record/rhythm_u.rec')
|
||||||
|
end
|
||||||
|
if RANKS.bigbang then
|
||||||
|
RANKS.clearRush,RANKS.bigbang=RANKS.bigbang
|
||||||
|
fs.remove('record/bigbang.rec')
|
||||||
|
end
|
||||||
if STAT.version~=VERSION.code then
|
if STAT.version~=VERSION.code then
|
||||||
|
for k,v in next,MODE_UPDATE_MAP do
|
||||||
|
if RANKS[k]then
|
||||||
|
RANKS[v]=RANKS[k]
|
||||||
|
RANKS[k]=nil
|
||||||
|
end
|
||||||
|
k='record/'..k
|
||||||
|
if fs.getInfo(k..'.dat')then
|
||||||
|
fs.write('record/'..v..'.rec',fs.read(k..'.dat'))
|
||||||
|
fs.remove(k..'.dat')
|
||||||
|
end
|
||||||
|
if fs.getInfo(k..'.rec')then
|
||||||
|
fs.write('record/'..v..'.rec',fs.read(k..'.rec'))
|
||||||
|
fs.remove(k..'.rec')
|
||||||
|
end
|
||||||
|
end
|
||||||
STAT.version=VERSION.code
|
STAT.version=VERSION.code
|
||||||
needSave=true
|
needSave=true
|
||||||
love.event.quit('restart')
|
|
||||||
end
|
end
|
||||||
SETTING.appLock=nil
|
SETTING.appLock,SETTING.dataSaving,SETTING.swap=nil
|
||||||
SETTING.dataSaving=nil
|
|
||||||
SETTING.swap=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 SETTING.RS=='ZRS'or SETTING.RS=='BRS'or SETTING.RS=='ASCplus'or SETTING.RS=='C2sym'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
|
||||||
@@ -505,26 +539,11 @@ do
|
|||||||
needSave=true
|
needSave=true
|
||||||
end
|
end
|
||||||
|
|
||||||
for k,v in next,MODE_UPDATE_MAP do
|
|
||||||
if RANKS[k]then
|
|
||||||
RANKS[v]=RANKS[k]
|
|
||||||
RANKS[k]=nil
|
|
||||||
end
|
|
||||||
k='record/'..k
|
|
||||||
if fs.getInfo(k..'.dat')then
|
|
||||||
fs.write('record/'..v..'.rec',fs.read(k..'.dat'))
|
|
||||||
fs.remove(k..'.dat')
|
|
||||||
end
|
|
||||||
if fs.getInfo(k..'.rec')then
|
|
||||||
fs.write('record/'..v..'.rec',fs.read(k..'.rec'))
|
|
||||||
fs.remove(k..'.rec')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if needSave then
|
if needSave then
|
||||||
saveStats()
|
saveStats()
|
||||||
saveProgress()
|
saveProgress()
|
||||||
saveSettings()
|
saveSettings()
|
||||||
|
love.event.quit('restart')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -588,35 +607,36 @@ 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
|
||||||
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 YIELD()end
|
||||||
|
|
||||||
print("\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)
|
||||||
love.keypressed('space')
|
love.keypressed('space')
|
||||||
while SCN.swapping do YIELD()end
|
TEST.yieldUntilNextScene()
|
||||||
|
|
||||||
for k,mode in next,MODES do
|
for k,mode in next,MODES do
|
||||||
if k~='netBattle'then
|
if k~='netBattle'then
|
||||||
print("Scanning mode: "..mode.name)
|
LOG("Scanning mode: "..mode.name)
|
||||||
loadGame(mode.name.."a",true)
|
loadGame(mode.name,true)
|
||||||
while SCN.swapping do YIELD()end
|
TEST.yieldUntilNextScene()
|
||||||
SCN.back()
|
SCN.back()
|
||||||
while SCN.swapping do YIELD()end
|
TEST.yieldUntilNextScene()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
print("\27[92m\27[1mAutomatic Test Passed :)\27[0m")
|
LOG("\27[92m\27[1mAutomatic Test Passed :)\27[0m")
|
||||||
for _=1,60 do YIELD()end
|
TEST.yieldN(60)
|
||||||
love.event.quit(0)
|
love.event.quit(0)
|
||||||
end)
|
end)
|
||||||
TASK.new(function()
|
TASK.new(function()
|
||||||
while true do
|
while true do
|
||||||
YIELD()
|
YIELD()
|
||||||
if ERRDATA[1]then break end
|
if Z.errData[1]then break end
|
||||||
end
|
end
|
||||||
print("\27[91m\27[1mAutomatic Test Failed :(\27[0m\nThe error message is:\n"..table.concat(ERRDATA[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.errData[1].mes,"\n").."\27[91m\nAborting\27[0m")
|
||||||
for _=1,60 do YIELD()end
|
TEST.yieldN(60)
|
||||||
love.event.quit(1)
|
love.event.quit(1)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|||||||
BIN
media/music/1980s.ogg
Normal file
BIN
media/music/1980s.ogg
Normal file
Binary file not shown.
BIN
media/music/malate.ogg
Normal file
BIN
media/music/malate.ogg
Normal file
Binary file not shown.
BIN
media/music/peak.ogg
Normal file
BIN
media/music/peak.ogg
Normal file
Binary file not shown.
@@ -129,10 +129,10 @@ do
|
|||||||
[10]={'+0+0','+1+0','+1-1','+0+2','+1-2','+1-2'},
|
[10]={'+0+0','+1+0','+1-1','+0+2','+1-2','+1-2'},
|
||||||
[03]={'+0+0','+1+0','+1+1','+0-2','+1-1','+1-2'},
|
[03]={'+0+0','+1+0','+1+1','+0-2','+1-1','+1-2'},
|
||||||
[30]={'+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'},
|
||||||
[12]={'+0+0','+1+0','+1-1','+0+2','+1+2'},
|
[12]={'+0+0','+1+0','+1-1','+0+2','+1+2','+1+1'},
|
||||||
[21]={'+0+0','-1+0','-1+1','+0-2','-1-2'},
|
[21]={'+0+0','-1+0','-1+1','+0-2','-1-2','-1-1'},
|
||||||
[32]={'+0+0','-1+0','-1-1','+0+2','-1+2'},
|
[32]={'+0+0','-1+0','-1-1','+0+2','-1+2','+0-1'},
|
||||||
[23]={'+0+0','+1+0','+1+1','+0-2','+1-2'},
|
[23]={'+0+0','+1+0','+1+1','+0-2','+1-2','+0+1'},
|
||||||
[02]={'+0+0','+1+0','-1+0','+0-1','+0+1'},
|
[02]={'+0+0','+1+0','-1+0','+0-1','+0+1'},
|
||||||
[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'},
|
||||||
@@ -140,8 +140,8 @@ do
|
|||||||
},--Z
|
},--Z
|
||||||
false,--S
|
false,--S
|
||||||
{
|
{
|
||||||
[01]={'+0+0','-1+0','-1+1','+0-2','+1+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'},
|
[10]={'+0+0','+1+0','+1-1','+0+2','-1-1','+0-1','+0+1'},
|
||||||
[03]={'+0+0','+1+0','+1+1','+0-2','+1-2','+1-1','+0+1'},
|
[03]={'+0+0','+1+0','+1+1','+0-2','+1-2','+1-1','+0+1'},
|
||||||
[30]={'+0+0','-1+0','-1-1','+0+2','-1+2','+0-1','-1+1'},
|
[30]={'+0+0','-1+0','-1-1','+0+2','-1+2','+0-1','-1+1'},
|
||||||
[12]={'+0+0','+1+0','+1-1','+1+1','-1+0','+0-1','+0+2','+1+2'},
|
[12]={'+0+0','+1+0','+1-1','+1+1','-1+0','+0-1','+0+2','+1+2'},
|
||||||
@@ -353,8 +353,8 @@ do
|
|||||||
[21]={'+0+0','-1+0','-1+1','+0+1','-1+2','+0+2','-1-1','+1+0','+0-2','-1-2'},
|
[21]={'+0+0','-1+0','-1+1','+0+1','-1+2','+0+2','-1-1','+1+0','+0-2','-1-2'},
|
||||||
[32]={'+0+0','-1+0','-1+1','-1-1','+1+0','+0+2','-1+2','+0-2'},
|
[32]={'+0+0','-1+0','-1+1','-1-1','+1+0','+0+2','-1+2','+0-2'},
|
||||||
[23]={'+0+0','+1+0','+1-1','+1+1','-1+0','+0-2','+1-2','+0+2'},
|
[23]={'+0+0','+1+0','+1-1','+1+1','-1+0','+0-2','+1-2','+0+2'},
|
||||||
[02]={'+0+0','+0-1','+1-1','-1+0','+2-1'},
|
[02]={'+0+0','+0-1','-1-1','+1-1','-1+0','+2-1'},
|
||||||
[20]={'+0+0','+0+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
|
||||||
@@ -686,13 +686,7 @@ do
|
|||||||
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'
|
||||||
if P.gameEnv.shakeFX then
|
P:_rotateField(d)
|
||||||
if d==1 or d==3 then
|
|
||||||
P.fieldOff.va=P.fieldOff.va+(2-d)*6e-3
|
|
||||||
else
|
|
||||||
P.fieldOff.va=P.fieldOff.va+P:getCenterX()*3e-3
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
sfx='rotate'
|
sfx='rotate'
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Blackhole
|
--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
|
||||||
@@ -51,7 +51,7 @@ function back.draw()
|
|||||||
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
|
||||||
|
|
||||||
--Blackhole
|
--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)
|
||||||
@@ -12,10 +12,9 @@ local ins,rem=table.insert,table.remove
|
|||||||
local back={}
|
local back={}
|
||||||
|
|
||||||
local t
|
local t
|
||||||
local fan,petal
|
local petal
|
||||||
function back.init()
|
function back.init()
|
||||||
t=0
|
t=0
|
||||||
fan=SVG_TITLE_FAN
|
|
||||||
petal={}
|
petal={}
|
||||||
end
|
end
|
||||||
function back.update()
|
function back.update()
|
||||||
@@ -62,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,8 do gc_polygon('line',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)
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ function back.draw()
|
|||||||
gc.setColor(wingColor[i])
|
gc.setColor(wingColor[i])
|
||||||
local B=crystals[i]
|
local B=crystals[i]
|
||||||
gc.draw(crystal_img,B.x,B.y,B.a,k,k,21,0)
|
gc.draw(crystal_img,B.x,B.y,B.a,k,k,21,0)
|
||||||
B=crystals[17-i]
|
B=crystals[8+i]
|
||||||
gc.draw(crystal_img,B.x,B.y,B.a,-k,k,21,0)
|
gc.draw(crystal_img,B.x,B.y,B.a,-k,k,21,0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -44,8 +44,7 @@ local function _ifoverlapAI(f,bk,x,y)
|
|||||||
end
|
end
|
||||||
end end
|
end end
|
||||||
end
|
end
|
||||||
local discardRow=FREEROW.discard
|
local getRow,discardRow=LINE.new,LINE.discard
|
||||||
local getRow=FREEROW.get
|
|
||||||
local function _resetField(f0,f,start)
|
local function _resetField(f0,f,start)
|
||||||
for _=#f,start,-1 do
|
for _=#f,start,-1 do
|
||||||
discardRow(f[_])
|
discardRow(f[_])
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ local baseBot={
|
|||||||
function baseBot.update(bot)
|
function baseBot.update(bot)
|
||||||
local P=bot.P
|
local P=bot.P
|
||||||
local keys=bot.keys
|
local keys=bot.keys
|
||||||
if P.control and P.waiting==-1 then
|
if P.control and P.waiting==0 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
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ return{
|
|||||||
lock=1e99,
|
lock=1e99,
|
||||||
wait=0,
|
wait=0,
|
||||||
fall=0,
|
fall=0,
|
||||||
|
hang=5,
|
||||||
|
hurry=1e99,
|
||||||
|
|
||||||
--Control
|
--Control
|
||||||
nextCount=6,
|
nextCount=6,
|
||||||
@@ -19,6 +21,7 @@ return{
|
|||||||
|
|
||||||
--Rule
|
--Rule
|
||||||
sequence='bag',
|
sequence='bag',
|
||||||
|
lockout=false,
|
||||||
fieldH=20,
|
fieldH=20,
|
||||||
heightLimit=1e99,
|
heightLimit=1e99,
|
||||||
bufferLimit=1e99,
|
bufferLimit=1e99,
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ return{
|
|||||||
P:_showText(text.maxspeed,0,-140,100,'appear',.6)
|
P:_showText(text.maxspeed,0,-140,100,'appear',.6)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
P:shakeField(9)
|
||||||
D.wave=D.wave+1
|
D.wave=D.wave+1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ return{
|
|||||||
P:_showText(text.maxspeed,0,-140,100,'appear',.6)
|
P:_showText(text.maxspeed,0,-140,100,'appear',.6)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
P:shakeField(10)
|
||||||
D.wave=D.wave+1
|
D.wave=D.wave+1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
return{
|
return{
|
||||||
dropPiece=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)))
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
return{
|
return{
|
||||||
dropPiece=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)))
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
return{
|
return{
|
||||||
dropPiece=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)))
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
return{
|
return{
|
||||||
dropPiece=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)))
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ return{
|
|||||||
task=function(P)
|
task=function(P)
|
||||||
local F=P.field
|
local F=P.field
|
||||||
for i=1,24 do
|
for i=1,24 do
|
||||||
F[i]=FREEROW.get(20)
|
F[i]=LINE.new(20)
|
||||||
P.visTime[i]=FREEROW.get(20)
|
P.visTime[i]=LINE.new(20)
|
||||||
for x=4,7 do F[i][x]=0 end
|
for x=4,7 do F[i][x]=0 end
|
||||||
end
|
end
|
||||||
if P.holeRND:random()<.6 then
|
if P.holeRND:random()<.6 then
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
return{
|
return{
|
||||||
dropPiece=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
|
||||||
local h=#P.field
|
local h=#P.field
|
||||||
P.field[h+1]=FREEROW.get(20)
|
P.field[h+1]=LINE.new(20)
|
||||||
P.visTime[h+1]=FREEROW.get(20)
|
P.visTime[h+1]=LINE.new(20)
|
||||||
for i=4,7 do P.field[h+1][i]=0 end
|
for i=4,7 do P.field[h+1][i]=0 end
|
||||||
end
|
end
|
||||||
if P.combo>P.modeData.maxCombo then
|
if P.combo>P.modeData.maxCombo then
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
return{
|
return{
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
if P.lastPiece.row==0 then
|
if P.lastPiece.row==0 then
|
||||||
P:lose()
|
P:lose()
|
||||||
else
|
else
|
||||||
for _=1,P.lastPiece.row do
|
for _=1,P.lastPiece.row do
|
||||||
local h=#P.field
|
local h=#P.field
|
||||||
P.field[h+1]=FREEROW.get(20)
|
P.field[h+1]=LINE.new(20)
|
||||||
P.visTime[h+1]=FREEROW.get(20)
|
P.visTime[h+1]=LINE.new(20)
|
||||||
for i=4,7 do P.field[h+1][i]=0 end
|
for i=4,7 do P.field[h+1][i]=0 end
|
||||||
end
|
end
|
||||||
if P.combo>P.modeData.maxCombo then
|
if P.combo>P.modeData.maxCombo then
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ return{
|
|||||||
mText(TEXTOBJ.atk,63,243)
|
mText(TEXTOBJ.atk,63,243)
|
||||||
mText(TEXTOBJ.eff,63,363)
|
mText(TEXTOBJ.eff,63,363)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
if P.stat.atk>=100 then
|
if P.stat.atk>=100 then
|
||||||
P:win('finish')
|
P:win('finish')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
return{
|
return{
|
||||||
dropPiece=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
|
||||||
FREEROW.discard(P.field[i])
|
|
||||||
FREEROW.discard(P.visTime[i])
|
|
||||||
P.field[i],P.visTime[i]=nil
|
P.field[i],P.visTime[i]=nil
|
||||||
end
|
end
|
||||||
setField(P,D.finished+1)
|
setField(P,D.finished+1)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ return{
|
|||||||
mStr(r,63,265)
|
mStr(r,63,265)
|
||||||
PLY.draw.drawTargetLine(P,r)
|
PLY.draw.drawTargetLine(P,r)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
if P.stat.row>=10 then
|
if P.stat.row>=10 then
|
||||||
P:win('finish')
|
P:win('finish')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ return{
|
|||||||
mStr(r,63,265)
|
mStr(r,63,265)
|
||||||
PLY.draw.drawTargetLine(P,r)
|
PLY.draw.drawTargetLine(P,r)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
if P.stat.row>=100 then
|
if P.stat.row>=100 then
|
||||||
P:win('finish')
|
P:win('finish')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ return{
|
|||||||
mStr(r,63,265)
|
mStr(r,63,265)
|
||||||
PLY.draw.drawTargetLine(P,r)
|
PLY.draw.drawTargetLine(P,r)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
if P.stat.row>=1000 then
|
if P.stat.row>=1000 then
|
||||||
P:win('finish')
|
P:win('finish')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ return{
|
|||||||
mStr(r,63,265)
|
mStr(r,63,265)
|
||||||
PLY.draw.drawTargetLine(P,r)
|
PLY.draw.drawTargetLine(P,r)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
if P.stat.row>=20 then
|
if P.stat.row>=20 then
|
||||||
P:win('finish')
|
P:win('finish')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ return{
|
|||||||
mStr(r,63,265)
|
mStr(r,63,265)
|
||||||
PLY.draw.drawTargetLine(P,r)
|
PLY.draw.drawTargetLine(P,r)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
if P.stat.row>=200 then
|
if P.stat.row>=200 then
|
||||||
P:win('finish')
|
P:win('finish')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ return{
|
|||||||
mStr(r,63,265)
|
mStr(r,63,265)
|
||||||
PLY.draw.drawTargetLine(P,r)
|
PLY.draw.drawTargetLine(P,r)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
if P.stat.row>=40 then
|
if P.stat.row>=40 then
|
||||||
P:win('finish')
|
P:win('finish')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ return{
|
|||||||
mStr(r,63,265)
|
mStr(r,63,265)
|
||||||
PLY.draw.drawTargetLine(P,r)
|
PLY.draw.drawTargetLine(P,r)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
if P.stat.row>=400 then
|
if P.stat.row>=400 then
|
||||||
P:win('finish')
|
P:win('finish')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
return{
|
return{
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
if #PLY_ALIVE>1 then
|
if #PLY_ALIVE>1 then
|
||||||
P.control=false
|
P.control=false
|
||||||
local id1=P.sid
|
local id1=P.sid
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
return{
|
return{
|
||||||
dropPiece=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
|
||||||
local id1=P.sid
|
local id1=P.sid
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
local gc_setColor=love.graphics.setColor
|
||||||
return{
|
return{
|
||||||
das=16,arr=6,
|
das=16,arr=6,
|
||||||
sddas=6,sdarr=6,
|
sddas=6,sdarr=6,
|
||||||
@@ -18,12 +19,24 @@ return{
|
|||||||
mStr(r<10 and 9 or r<30 and r or("%02x"):format(r*10-300),63,210)
|
mStr(r<10 and 9 or r<30 and r or("%02x"):format(r*10-300),63,210)
|
||||||
mText(TEXTOBJ.speedLV,63,290)
|
mText(TEXTOBJ.speedLV,63,290)
|
||||||
PLY.draw.drawProgress(P.stat.row,P.modeData.target)
|
PLY.draw.drawProgress(P.stat.row,P.modeData.target)
|
||||||
|
if P.modeData.drought>7 then
|
||||||
|
if P.modeData.drought<=14 then
|
||||||
|
gc_setColor(1,1,1,P.modeData.drought/7-1)
|
||||||
|
else
|
||||||
|
local gb=P.modeData.drought<=21 and 2-P.modeData.drought/14 or .5
|
||||||
|
gc_setColor(1,gb,gb)
|
||||||
|
end
|
||||||
|
setFont(50)
|
||||||
|
mStr(P.modeData.drought,63,130)
|
||||||
|
mDraw(MODES.drought_l.icon,63,200,nil,.5)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
task=function(P)
|
task=function(P)
|
||||||
P.modeData.target=10
|
P.modeData.target=10
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
local D=P.modeData
|
local D=P.modeData
|
||||||
|
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==110 then
|
if D.target==110 then
|
||||||
P.gameEnv.drop,P.gameEnv.lock=5,5
|
P.gameEnv.drop,P.gameEnv.lock=5,5
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
local gc_setColor=love.graphics.setColor
|
||||||
return{
|
return{
|
||||||
das=16,arr=6,
|
das=16,arr=6,
|
||||||
sddas=3,sdarr=3,
|
sddas=3,sdarr=3,
|
||||||
@@ -18,11 +19,22 @@ return{
|
|||||||
mStr(r<11 and 18 or r<22 and r+8 or("%02x"):format(r*10-220),63,210)
|
mStr(r<11 and 18 or r<22 and r+8 or("%02x"):format(r*10-220),63,210)
|
||||||
mText(TEXTOBJ.speedLV,63,290)
|
mText(TEXTOBJ.speedLV,63,290)
|
||||||
PLY.draw.drawProgress(P.stat.row,P.modeData.target)
|
PLY.draw.drawProgress(P.stat.row,P.modeData.target)
|
||||||
|
if P.modeData.drought>7 then
|
||||||
|
if P.modeData.drought<=14 then
|
||||||
|
gc_setColor(1,1,1,P.modeData.drought/7-1)
|
||||||
|
else
|
||||||
|
local gb=P.modeData.drought<=21 and 2-P.modeData.drought/14 or .5
|
||||||
|
gc_setColor(1,gb,gb)
|
||||||
|
end
|
||||||
|
setFont(50)
|
||||||
|
mStr(P.modeData.drought,63,130)
|
||||||
|
mDraw(MODES.drought_l.icon,63,200,nil,.5)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
task=function(P)
|
task=function(P)
|
||||||
P.modeData.target=10
|
P.modeData.target=10
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
local D=P.modeData
|
local D=P.modeData
|
||||||
if P.stat.row>=D.target then
|
if P.stat.row>=D.target then
|
||||||
if D.target==110 then
|
if D.target==110 then
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
local gc_setColor=love.graphics.setColor
|
||||||
return{
|
return{
|
||||||
das=16,arr=6,
|
das=16,arr=6,
|
||||||
sddas=1,sdarr=1,
|
sddas=1,sdarr=1,
|
||||||
@@ -18,11 +19,22 @@ return{
|
|||||||
mStr(r==1 and 29 or("%02x"):format(r*10-20),63,210)
|
mStr(r==1 and 29 or("%02x"):format(r*10-20),63,210)
|
||||||
mText(TEXTOBJ.speedLV,63,290)
|
mText(TEXTOBJ.speedLV,63,290)
|
||||||
PLY.draw.drawProgress(P.stat.row,P.modeData.target)
|
PLY.draw.drawProgress(P.stat.row,P.modeData.target)
|
||||||
|
if P.modeData.drought>7 then
|
||||||
|
if P.modeData.drought<=14 then
|
||||||
|
gc_setColor(1,1,1,P.modeData.drought/7-1)
|
||||||
|
else
|
||||||
|
local gb=P.modeData.drought<=21 and 2-P.modeData.drought/14 or .5
|
||||||
|
gc_setColor(1,gb,gb)
|
||||||
|
end
|
||||||
|
setFont(50)
|
||||||
|
mStr(P.modeData.drought,63,130)
|
||||||
|
mDraw(MODES.drought_l.icon,63,200,nil,.5)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
task=function(P)
|
task=function(P)
|
||||||
P.modeData.target=10
|
P.modeData.target=10
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
local D=P.modeData
|
local D=P.modeData
|
||||||
if P.stat.row>=D.target then
|
if P.stat.row>=D.target then
|
||||||
if D.target==100 then
|
if D.target==100 then
|
||||||
|
|||||||
36
parts/eventsets/clearRush.lua
Normal file
36
parts/eventsets/clearRush.lua
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
local function task_newBoard(P,init)
|
||||||
|
local targetLine
|
||||||
|
local F,L={},{1}
|
||||||
|
--TODO
|
||||||
|
P:pushNextList(L)
|
||||||
|
|
||||||
|
P.control=false
|
||||||
|
if not init then for _=1,26 do YIELD()end end
|
||||||
|
P.control=true
|
||||||
|
|
||||||
|
P.gameEnv.heightLimit=targetLine or #F
|
||||||
|
P:pushLineList(F)
|
||||||
|
end
|
||||||
|
local function _check(P)
|
||||||
|
P.gameEnv.heightLimit=P.gameEnv.heightLimit-P.lastPiece.row
|
||||||
|
if P.gameEnv.heightLimit==0 then
|
||||||
|
P.modeData.stage=P.modeData.stage+1
|
||||||
|
if P.modeData.stage>=100 then
|
||||||
|
P:win('finish')
|
||||||
|
else
|
||||||
|
P:newTask(task_newBoard)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return{
|
||||||
|
sequence='none',
|
||||||
|
RS="TRS",
|
||||||
|
pushSpeed=5,
|
||||||
|
mesDisp=function(P)
|
||||||
|
setFont(60)
|
||||||
|
mStr(P.modeData.stage,63,280)
|
||||||
|
mText(TEXTOBJ.wave,63,350)
|
||||||
|
end,
|
||||||
|
hook_drop=_check,
|
||||||
|
task=function(P)task_newBoard(P,true)P.fieldBeneath=0 end,--Just run one time at first to start first level
|
||||||
|
}
|
||||||
@@ -40,6 +40,7 @@ return{
|
|||||||
P:_showText(text.maxspeed,0,-140,100,'appear',.6)
|
P:_showText(text.maxspeed,0,-140,100,'appear',.6)
|
||||||
P.dropDelay,P.gameEnv.drop=2,2
|
P.dropDelay,P.gameEnv.drop=2,2
|
||||||
end
|
end
|
||||||
|
P:shakeField(3)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ return{
|
|||||||
P.dropDelay,P.gameEnv.drop=5,5
|
P.dropDelay,P.gameEnv.drop=5,5
|
||||||
P:_showText(text.maxspeed,0,-140,100,'appear',.6)
|
P:_showText(text.maxspeed,0,-140,100,'appear',.6)
|
||||||
end
|
end
|
||||||
|
P:shakeField(3)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ return{
|
|||||||
setFont(55)
|
setFont(55)
|
||||||
mStr(100-P.stat.dig,63,265)
|
mStr(100-P.stat.dig,63,265)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
for _=1,math.min(10,100-P.stat.dig)-P.garbageBeneath do
|
for _=1,math.min(10,100-P.stat.dig)-P.garbageBeneath do
|
||||||
P:garbageRise(21,1,P:getHolePos())
|
P:garbageRise(21,1,P:getHolePos())
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ return{
|
|||||||
setFont(55)
|
setFont(55)
|
||||||
mStr(10-P.stat.dig,63,265)
|
mStr(10-P.stat.dig,63,265)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
if P.stat.dig==10 then
|
if P.stat.dig==10 then
|
||||||
P:win('finish')
|
P:win('finish')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ return{
|
|||||||
setFont(55)
|
setFont(55)
|
||||||
mStr(400-P.stat.dig,63,265)
|
mStr(400-P.stat.dig,63,265)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
for _=1,math.min(10,400-P.stat.dig)-P.garbageBeneath do
|
for _=1,math.min(10,400-P.stat.dig)-P.garbageBeneath do
|
||||||
P:garbageRise(21,1,P:getHolePos())
|
P:garbageRise(21,1,P:getHolePos())
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ return{
|
|||||||
setFont(55)
|
setFont(55)
|
||||||
mStr(40-P.stat.dig,63,265)
|
mStr(40-P.stat.dig,63,265)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
for _=1,math.min(10,40-P.stat.dig)-P.garbageBeneath do
|
for _=1,math.min(10,40-P.stat.dig)-P.garbageBeneath do
|
||||||
P:garbageRise(21,1,P:getHolePos())
|
P:garbageRise(21,1,P:getHolePos())
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ return{
|
|||||||
task=function(P)
|
task=function(P)
|
||||||
P.modeData.target=10
|
P.modeData.target=10
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
local flag
|
local flag
|
||||||
local l=P.lastPiece
|
local l=P.lastPiece
|
||||||
if P.combo>1 then flag=true;P:showText("2x",0,-220,40,'flicker',.3)end
|
if P.combo>1 then flag=true;P:showText("2x",0,-220,40,'flicker',.3)end
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ return
|
|||||||
task=function(P)
|
task=function(P)
|
||||||
P.modeData.target=50
|
P.modeData.target=50
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
if P.stat.row>=P.modeData.target then
|
if P.stat.row>=P.modeData.target then
|
||||||
if P.modeData.target==50 then
|
if P.modeData.target==50 then
|
||||||
P.gameEnv.drop=.25
|
P.gameEnv.drop=.25
|
||||||
|
|||||||
56
parts/eventsets/marathon_inf.lua
Normal file
56
parts/eventsets/marathon_inf.lua
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
local dropSpeed={
|
||||||
|
50,42,35,30,25,20,16,13,11,10,
|
||||||
|
9,8,7,6,5,5,4,4,3,3,
|
||||||
|
3,2,2,2,2,1,1,1,1,1,
|
||||||
|
.5,.5,.5,.5,.25,.25,.25,.125,.125,--Total 39 numbers, switch to 20G when reach 400 lines
|
||||||
|
}
|
||||||
|
local lockDelay={
|
||||||
|
57,54,51,48,46,44,42,40,38,36,
|
||||||
|
34,32,30,28,26,25,24,23,22,21,
|
||||||
|
20,20,19,19,18,18,17,17,16,16,
|
||||||
|
15,15,14,14,13,13,13,12,12,12,
|
||||||
|
11,11,11,11,11,10,10,10,10,10,
|
||||||
|
9,9,9,9,9,9,8,8,8,8,
|
||||||
|
8,8,8,8,7,7,7,7,7,7,
|
||||||
|
7,7,6,6,6,6,6,6,6,6,
|
||||||
|
5,5,5,5,5,5,5,5,5,5,
|
||||||
|
4,4,4,4,4,4,4,4,4,4,
|
||||||
|
3,3,3,3,3,3,3,3,3,3,
|
||||||
|
2,2,2,2,2,2,2,2,2,2,
|
||||||
|
1,1,1,1,1,1,1,1,1,--Finish at 1700
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
{
|
||||||
|
drop=60,lock=60,
|
||||||
|
wait=8,fall=20,
|
||||||
|
mesDisp=function(P)
|
||||||
|
PLY.draw.drawProgress(P.stat.row,P.modeData.target)
|
||||||
|
end,
|
||||||
|
task=function(P)
|
||||||
|
P.modeData.target=10
|
||||||
|
end,
|
||||||
|
hook_drop=function(P)
|
||||||
|
if P.stat.row>=P.modeData.target then
|
||||||
|
if P.modeData.target%300==0 then
|
||||||
|
P.gameEnv.wait=P.gameEnv.wait-1
|
||||||
|
end
|
||||||
|
if P.modeData.target%100==0 then
|
||||||
|
P.gameEnv.fall=P.gameEnv.fall-1
|
||||||
|
end
|
||||||
|
if P.modeData.target<400 then
|
||||||
|
P.gameEnv.drop=dropSpeed[P.modeData.target/10]
|
||||||
|
elseif P.modeData.target==400 then
|
||||||
|
P:set20G(true)
|
||||||
|
elseif P.modeData.target<1700 then
|
||||||
|
P.gameEnv.lock=lockDelay[(P.modeData.target-400)/10]
|
||||||
|
else
|
||||||
|
P.stat.row=1700
|
||||||
|
P:win('finish')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
P.modeData.target=P.modeData.target+10
|
||||||
|
SFX.play('reach')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
@@ -12,7 +12,7 @@ return
|
|||||||
task=function(P)
|
task=function(P)
|
||||||
P.modeData.target=10
|
P.modeData.target=10
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
if P.stat.row>=P.modeData.target then
|
if P.stat.row>=P.modeData.target then
|
||||||
if P.modeData.target==200 then
|
if P.modeData.target==200 then
|
||||||
P:win('finish')
|
P:win('finish')
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ return{
|
|||||||
mStr(P.stat.row,63,230)
|
mStr(P.stat.row,63,230)
|
||||||
mStr(P.stat.clears[4],63,340)
|
mStr(P.stat.clears[4],63,340)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
if P.modeData.rankPoint<140-passPoint then--If Less then X
|
if P.modeData.rankPoint<140-passPoint then--If Less then X
|
||||||
local R=#P.clearedRow
|
local R=#P.clearedRow
|
||||||
if R>0 then
|
if R>0 then
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ return{
|
|||||||
mesDisp=function(P)
|
mesDisp=function(P)
|
||||||
PLY.draw.drawProgress(P.modeData.pt,P.modeData.target)
|
PLY.draw.drawProgress(P.modeData.pt,P.modeData.target)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
local D=P.modeData
|
local D=P.modeData
|
||||||
|
|
||||||
local c=#P.clearedRow
|
local c=#P.clearedRow
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ return{
|
|||||||
mesDisp=function(P)
|
mesDisp=function(P)
|
||||||
PLY.draw.drawProgress(P.modeData.pt,P.modeData.target)
|
PLY.draw.drawProgress(P.modeData.pt,P.modeData.target)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
local D=P.modeData
|
local D=P.modeData
|
||||||
|
|
||||||
local c=#P.clearedRow
|
local c=#P.clearedRow
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ return
|
|||||||
task=function(P)
|
task=function(P)
|
||||||
P.modeData.target=10
|
P.modeData.target=10
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
if P.stat.row>=P.modeData.target then
|
if P.stat.row>=P.modeData.target then
|
||||||
if P.modeData.target==200 then
|
if P.modeData.target==200 then
|
||||||
P:win('finish')
|
P:win('finish')
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ return{
|
|||||||
mesDisp=function(P)
|
mesDisp=function(P)
|
||||||
PLY.draw.drawProgress(P.modeData.pt,P.modeData.target)
|
PLY.draw.drawProgress(P.modeData.pt,P.modeData.target)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
local D=P.modeData
|
local D=P.modeData
|
||||||
|
|
||||||
local c=#P.clearedRow
|
local c=#P.clearedRow
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ return
|
|||||||
mesDisp=function(P)
|
mesDisp=function(P)
|
||||||
PLY.draw.drawProgress(P.modeData.pt,P.modeData.target)
|
PLY.draw.drawProgress(P.modeData.pt,P.modeData.target)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
local p=P.modeData.pt+P.lastPiece.row
|
local p=P.modeData.pt+P.lastPiece.row
|
||||||
if p>=P.modeData.target then
|
if p>=P.modeData.target then
|
||||||
local ENV=P.gameEnv
|
local ENV=P.gameEnv
|
||||||
@@ -55,8 +55,8 @@ return
|
|||||||
P.field[i][P.holeRND:random(10)]=0
|
P.field[i][P.holeRND:random(10)]=0
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
P.field[i]=FREEROW.get(0)
|
P.field[i]=LINE.new(0)
|
||||||
P.visTime[i]=FREEROW.get(30)
|
P.visTime[i]=LINE.new(30)
|
||||||
for j=1,10 do
|
for j=1,10 do
|
||||||
if P.holeRND:random()>.9 then
|
if P.holeRND:random()>.9 then
|
||||||
P.field[i][j]=P.holeRND:random(16)
|
P.field[i][j]=P.holeRND:random(16)
|
||||||
@@ -89,6 +89,7 @@ return
|
|||||||
ENV.bone=true
|
ENV.bone=true
|
||||||
|
|
||||||
P.modeData.target=62
|
P.modeData.target=62
|
||||||
|
SFX.play('reach')
|
||||||
else
|
else
|
||||||
p=41
|
p=41
|
||||||
end
|
end
|
||||||
@@ -112,6 +113,7 @@ return
|
|||||||
ENV.fall=4
|
ENV.fall=4
|
||||||
|
|
||||||
P.modeData.target=162
|
P.modeData.target=162
|
||||||
|
SFX.play('reach')
|
||||||
elseif T==162 then--Stage 7: speed up+++
|
elseif T==162 then--Stage 7: speed up+++
|
||||||
P:stageComplete(7)
|
P:stageComplete(7)
|
||||||
P.life=P.life+1
|
P.life=P.life+1
|
||||||
@@ -146,6 +148,7 @@ return
|
|||||||
P.modeData.target=260
|
P.modeData.target=260
|
||||||
p=260
|
p=260
|
||||||
SFX.play('blip_2')
|
SFX.play('blip_2')
|
||||||
|
SFX.play('reach')
|
||||||
else
|
else
|
||||||
p=260
|
p=260
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ return{
|
|||||||
mStr(P.stat.pc,63,340)
|
mStr(P.stat.pc,63,340)
|
||||||
mText(TEXTOBJ.pc,63,410)
|
mText(TEXTOBJ.pc,63,410)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
if P.lastPiece.pc and P.stat.row%4==0 then
|
if P.lastPiece.pc and P.stat.row%4==0 then
|
||||||
P.gameEnv.heightLimit=4
|
P.gameEnv.heightLimit=4
|
||||||
if P.stat.pc%5==0 then
|
if P.stat.pc%5==0 then
|
||||||
|
|||||||
@@ -1,51 +1,54 @@
|
|||||||
local pc_drop={50,45,40,35,30,26,22,18,15,12}
|
local pc_drop={50,45,40,35,30,26,22,18,15,12}
|
||||||
local pc_lock={55,50,46,42,39,36,33,31,29,27}
|
local pc_lock={55,50,46,42,40,38,36,34,32,30}
|
||||||
local pc_fall={18,16,14,12,10,9,8,7,6,5}
|
local pc_fall={18,16,14,12,10,9,8,7,6,5}
|
||||||
local PCbase=require"parts.modes.PCbase"
|
local PCbase=require"parts.modes.PCbase"
|
||||||
local PClist=require"parts.modes.PClist"
|
local PClist=require"parts.modes.PClist"
|
||||||
|
|
||||||
local function task_PC(P)
|
local function task_PC(P)
|
||||||
if P.frameRun>180 then
|
local difficulty=P.stat.pc<10 and 4 or 5
|
||||||
P.control=false
|
local L=PClist[difficulty][P.holeRND:random(#PClist[difficulty])]
|
||||||
for _=1,26 do YIELD()end
|
local symmetry=P.holeRND:random()>.5
|
||||||
P.control=true
|
P:pushNextList(L,symmetry)
|
||||||
end
|
|
||||||
local base=PCbase[P.modeData.type]
|
P.control=false
|
||||||
P:pushLineList(base[P.holeRND:random(#base)],P.modeData.symmetry)
|
if P.frameRun>180 then for _=1,26 do YIELD()end end
|
||||||
|
P.control=true
|
||||||
|
|
||||||
|
local base=PCbase[difficulty]
|
||||||
|
P:pushLineList(base[P.holeRND:random(#base)],symmetry)
|
||||||
end
|
end
|
||||||
local function check(P)
|
local function _check(P)
|
||||||
local f=P.field
|
if #P.field>0 then
|
||||||
if #f>0 then
|
if #P.field+P.stat.row%4>4 then
|
||||||
if #f+P.stat.row%4>4 then
|
|
||||||
P:lose()
|
P:lose()
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
local type=P.stat.pc<10 and 4 or 5
|
if P.stat.pc>=100 then
|
||||||
local L=PClist[type][P.holeRND:random(#PClist[type])]
|
P:win('finish')
|
||||||
local symmetry=P.holeRND:random()>.5
|
else
|
||||||
P.modeData.type=type
|
P:newTask(task_PC)
|
||||||
P.modeData.symmetry=symmetry
|
if P.frameRun<180 then P.fieldBeneath=0 end
|
||||||
P:pushNextList(L,symmetry)
|
|
||||||
P.modeData.counter=P.stat.piece==0 and 20 or 0
|
|
||||||
P:newTask(task_PC)
|
|
||||||
|
|
||||||
local s=P.stat.pc*.25
|
if P.stat.pc%4==0 and P.stat.pc>0 and P.stat.pc<=40 then
|
||||||
if math.floor(s)==s and s>0 then
|
local s=P.stat.pc/4
|
||||||
P.gameEnv.drop=pc_drop[s]or 10
|
P.gameEnv.drop=pc_drop[s]or 10
|
||||||
P.gameEnv.lock=pc_lock[s]or 25
|
P.gameEnv.lock=pc_lock[s]or 25
|
||||||
P.gameEnv.fall=pc_fall[s]or 4
|
P.gameEnv.fall=pc_fall[s]or 4
|
||||||
if s==10 then
|
if s==10 then
|
||||||
P:_showText(text.maxspeed,0,-140,100,'appear',.6)
|
P:_showText(text.maxspeed,0,-140,100,'appear',.6)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return{
|
return{
|
||||||
|
sequence='none',
|
||||||
|
RS="SRS",
|
||||||
mesDisp=function(P)
|
mesDisp=function(P)
|
||||||
setFont(60)
|
setFont(60)
|
||||||
mStr(P.stat.pc,63,340)
|
mStr(P.stat.pc,63,260)
|
||||||
mText(TEXTOBJ.pc,63,410)
|
mText(TEXTOBJ.pc,63,330)
|
||||||
end,
|
end,
|
||||||
dropPiece=check,
|
hook_drop=_check,
|
||||||
task=check,
|
task=_check,--Just run one time at first to start first level
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,35 +8,40 @@ local PCtype={
|
|||||||
1,2,3,
|
1,2,3,
|
||||||
}
|
}
|
||||||
local function task_PC(P)
|
local function task_PC(P)
|
||||||
|
local difficulty=PCtype[P.stat.pc+1]or 3
|
||||||
|
local L=PClist[difficulty][P.holeRND:random(#PClist[difficulty])]
|
||||||
|
local symmetry=P.holeRND:random()>.5
|
||||||
|
P:pushNextList(L,symmetry)
|
||||||
|
|
||||||
P.control=false
|
P.control=false
|
||||||
for _=1,26 do YIELD()end
|
if P.frameRun>180 then for _=1,26 do YIELD()end end
|
||||||
P.control=true
|
P.control=true
|
||||||
local base=PCbase[P.modeData.type]
|
|
||||||
P:pushLineList(base[P.holeRND:random(#base)],P.modeData.symmetry)
|
local base=PCbase[difficulty]
|
||||||
|
P:pushLineList(base[P.holeRND:random(#base)],symmetry)
|
||||||
end
|
end
|
||||||
local function check(P)
|
local function _check(P)
|
||||||
local r=P.field
|
if #P.field>0 then
|
||||||
if #r>0 then
|
if #P.field+P.stat.row%4>4 then
|
||||||
if #r+P.stat.row%4>4 then
|
|
||||||
P:lose()
|
P:lose()
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
local type=PCtype[P.stat.pc+1]or 3
|
if P.stat.pc>=60 then
|
||||||
local L=PClist[type][P.holeRND:random(#PClist[type])]
|
P:win('finish')
|
||||||
local symmetry=P.holeRND:random()>.5
|
else
|
||||||
P.modeData.type=type
|
P:newTask(task_PC)
|
||||||
P.modeData.symmetry=symmetry
|
if P.frameRun<180 then P.fieldBeneath=0 end
|
||||||
P:pushNextList(L,symmetry)
|
end
|
||||||
P.modeData.counter=P.stat.piece==0 and 20 or 0
|
|
||||||
P:newTask(task_PC)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return{
|
return{
|
||||||
|
sequence='none',
|
||||||
|
RS="SRS",
|
||||||
mesDisp=function(P)
|
mesDisp=function(P)
|
||||||
setFont(60)
|
setFont(60)
|
||||||
mStr(P.stat.pc,63,340)
|
mStr(P.stat.pc,63,260)
|
||||||
mText(TEXTOBJ.pc,63,410)
|
mText(TEXTOBJ.pc,63,330)
|
||||||
end,
|
end,
|
||||||
dropPiece=check,
|
hook_drop=_check,
|
||||||
task=check,
|
task=_check,--Just run one time at first to start first level
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
local gc=love.graphics
|
|
||||||
local dropSpeed={[0]=40,33,27,20,16,12,11,10,9,8,7,6,5,4,3,3,2,2,1,1}
|
|
||||||
|
|
||||||
return{
|
|
||||||
drop=40,
|
|
||||||
lock=1e99,
|
|
||||||
wait=20,
|
|
||||||
fall=90,
|
|
||||||
mesDisp=function(P)
|
|
||||||
PLY.draw.drawProgress(P.stat.row,P.modeData.target)
|
|
||||||
|
|
||||||
setFont(30)
|
|
||||||
mStr(P.modeData.bpm,63,178)
|
|
||||||
|
|
||||||
gc.setLineWidth(4)
|
|
||||||
gc.circle('line',63,200,30)
|
|
||||||
|
|
||||||
local beat=P.modeData.counter/P.modeData.beatFrame
|
|
||||||
gc.setColor(1,1,1,1-beat)
|
|
||||||
gc.setLineWidth(3)
|
|
||||||
gc.circle('line',63,200,30+45*beat)
|
|
||||||
end,
|
|
||||||
dropPiece=function(P)
|
|
||||||
if P.stat.row>=P.modeData.target then
|
|
||||||
if P.modeData.target==200 then
|
|
||||||
P:win('finish')
|
|
||||||
else
|
|
||||||
P.modeData.bpm=40+2*P.modeData.target/10
|
|
||||||
P.modeData.beatFrame=math.floor(3600/P.modeData.bpm)
|
|
||||||
P.gameEnv.fall=P.modeData.beatFrame
|
|
||||||
P.gameEnv.wait=math.max(P.gameEnv.wait-2,0)
|
|
||||||
P.gameEnv.drop=dropSpeed[P.modeData.target/10]
|
|
||||||
P.modeData.target=P.modeData.target+10
|
|
||||||
SFX.play('reach')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
task=function(P)
|
|
||||||
P.modeData.target=10
|
|
||||||
P.modeData.bpm=40
|
|
||||||
P.modeData.beatFrame=90
|
|
||||||
P.modeData.counter=90
|
|
||||||
while true do
|
|
||||||
YIELD()
|
|
||||||
P.modeData.counter=P.modeData.counter-1
|
|
||||||
if P.modeData.counter==0 then
|
|
||||||
P.modeData.counter=P.modeData.beatFrame
|
|
||||||
SFX.play('click',.3)
|
|
||||||
P:act_hardDrop()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
local gc=love.graphics
|
|
||||||
local dropSpeed={[0]=30,26,23,20,17,14,12,10,8,6,5,4,3,2,1,1,.5,.5,.25,.25}
|
|
||||||
|
|
||||||
return{
|
|
||||||
drop=30,
|
|
||||||
lock=1e99,
|
|
||||||
wait=10,
|
|
||||||
fall=60,
|
|
||||||
mesDisp=function(P)
|
|
||||||
PLY.draw.drawProgress(P.stat.row,P.modeData.target)
|
|
||||||
|
|
||||||
setFont(30)
|
|
||||||
mStr(P.modeData.bpm,63,178)
|
|
||||||
|
|
||||||
gc.setLineWidth(4)
|
|
||||||
gc.circle('line',63,200,30)
|
|
||||||
|
|
||||||
local beat=P.modeData.counter/P.modeData.beatFrame
|
|
||||||
gc.setColor(1,1,1,1-beat)
|
|
||||||
gc.setLineWidth(3)
|
|
||||||
gc.circle('line',63,200,30+45*beat)
|
|
||||||
end,
|
|
||||||
dropPiece=function(P)
|
|
||||||
if P.stat.row>=P.modeData.target then
|
|
||||||
if P.modeData.target==200 then
|
|
||||||
P:win('finish')
|
|
||||||
else
|
|
||||||
P.modeData.bpm=60+3*P.modeData.target/10
|
|
||||||
P.modeData.beatFrame=math.floor(3600/P.modeData.bpm)
|
|
||||||
P.gameEnv.fall=P.modeData.beatFrame
|
|
||||||
P.gameEnv.wait=math.max(P.gameEnv.wait-1,0)
|
|
||||||
P.gameEnv.drop=dropSpeed[P.modeData.target/10]
|
|
||||||
P.modeData.target=P.modeData.target+10
|
|
||||||
SFX.play('reach')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
task=function(P)
|
|
||||||
P.modeData.target=10
|
|
||||||
P.modeData.bpm=60
|
|
||||||
P.modeData.beatFrame=60
|
|
||||||
P.modeData.counter=60
|
|
||||||
while true do
|
|
||||||
YIELD()
|
|
||||||
P.modeData.counter=P.modeData.counter-1
|
|
||||||
if P.modeData.counter==0 then
|
|
||||||
P.modeData.counter=P.modeData.beatFrame
|
|
||||||
SFX.play('click',.3)
|
|
||||||
P:act_hardDrop()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
local gc=love.graphics
|
|
||||||
|
|
||||||
return{
|
|
||||||
drop=.5,
|
|
||||||
lock=1e99,
|
|
||||||
wait=5,
|
|
||||||
fall=30,
|
|
||||||
mesDisp=function(P)
|
|
||||||
PLY.draw.drawProgress(P.stat.row,P.modeData.target)
|
|
||||||
|
|
||||||
setFont(30)
|
|
||||||
mStr(P.modeData.bpm,63,178)
|
|
||||||
|
|
||||||
gc.setLineWidth(4)
|
|
||||||
gc.circle('line',63,200,30)
|
|
||||||
|
|
||||||
local beat=P.modeData.counter/P.modeData.beatFrame
|
|
||||||
gc.setColor(1,1,1,1-beat)
|
|
||||||
gc.setLineWidth(3)
|
|
||||||
gc.circle('line',63,200,30+45*beat)
|
|
||||||
end,
|
|
||||||
dropPiece=function(P)
|
|
||||||
if P.stat.row>=P.modeData.target then
|
|
||||||
if P.modeData.target==200 then
|
|
||||||
P:win('finish')
|
|
||||||
else
|
|
||||||
P.modeData.bpm=120+2*P.modeData.target/10
|
|
||||||
P.modeData.beatFrame=math.floor(3600/P.modeData.bpm)
|
|
||||||
P.gameEnv.fall=P.modeData.beatFrame
|
|
||||||
P.gameEnv.wait=math.max(P.gameEnv.wait-1,0)
|
|
||||||
if P.modeData.target==50 then
|
|
||||||
P.gameEnv.das=5
|
|
||||||
P.gameEnv.drop=.25
|
|
||||||
elseif P.modeData.target==100 then
|
|
||||||
P.gameEnv.das=4
|
|
||||||
P:set20G(true)
|
|
||||||
end
|
|
||||||
P.modeData.target=P.modeData.target+10
|
|
||||||
SFX.play('reach')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
task=function(P)
|
|
||||||
P.modeData.target=10
|
|
||||||
P.modeData.bpm=120
|
|
||||||
P.modeData.beatFrame=30
|
|
||||||
P.modeData.counter=30
|
|
||||||
while true do
|
|
||||||
YIELD()
|
|
||||||
P.modeData.counter=P.modeData.counter-1
|
|
||||||
if P.modeData.counter==0 then
|
|
||||||
P.modeData.counter=P.modeData.beatFrame
|
|
||||||
SFX.play('click',.3)
|
|
||||||
P:act_hardDrop()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,24 @@
|
|||||||
|
local gc=love.graphics
|
||||||
|
local gc_draw,gc_print,gc_setColor=gc.draw,gc.print,gc.setColor
|
||||||
|
local setFont=setFont
|
||||||
|
|
||||||
|
local PLAYERS,PLY_ALIVE=PLAYERS,PLY_ALIVE
|
||||||
|
|
||||||
return{
|
return{
|
||||||
mesDisp=function(P)
|
mesDisp=function(P)
|
||||||
PLY.draw.drawRoyaleInfo(P)
|
setFont(35)
|
||||||
|
mStr(#PLY_ALIVE.."/"..#PLAYERS,63,175)
|
||||||
|
mStr(P.modeData.ko,80,215)
|
||||||
|
gc_draw(TEXTOBJ.ko,60-TEXTOBJ.ko:getWidth(),222)
|
||||||
|
setFont(20)
|
||||||
|
gc_setColor(1,.5,0,.6)
|
||||||
|
gc_print(P.badge,103,227)
|
||||||
|
gc_setColor(.97,.97,.97)
|
||||||
|
setFont(25)
|
||||||
|
mStr(text.powerUp[P.strength],63,290)
|
||||||
|
gc_setColor(1,1,1)
|
||||||
|
for i=1,P.strength do
|
||||||
|
gc_draw(IMG.badgeIcon,16*i+6,260)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
20
parts/eventsets/sprintEff_40.lua
Normal file
20
parts/eventsets/sprintEff_40.lua
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
return{
|
||||||
|
mesDisp=function(P)
|
||||||
|
setFont(45)
|
||||||
|
mStr(("%.1f"):format(P.stat.atk),63,270)
|
||||||
|
mText(TEXTOBJ.atk,63,323)
|
||||||
|
mStr(("%.2f"):format(P.stat.atk/P.stat.row),63,370)
|
||||||
|
mText(TEXTOBJ.eff,63,423)
|
||||||
|
|
||||||
|
setFont(55)
|
||||||
|
local r=40-P.stat.row
|
||||||
|
if r<0 then r=0 end
|
||||||
|
mStr(r,63,170)
|
||||||
|
PLY.draw.drawTargetLine(P,r)
|
||||||
|
end,
|
||||||
|
hook_drop=function(P)
|
||||||
|
if P.stat.row>=40 then
|
||||||
|
P:win('finish')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
@@ -36,7 +36,7 @@ return{
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
if P.stat.row>=40 then
|
if P.stat.row>=40 then
|
||||||
P:win('finish')
|
P:win('finish')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ return{
|
|||||||
mStr(r,63,265)
|
mStr(r,63,265)
|
||||||
PLY.draw.drawTargetLine(P,r)
|
PLY.draw.drawTargetLine(P,r)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
local F=P.field
|
local F=P.field
|
||||||
for y=1,#F do
|
for y=1,#F do
|
||||||
local l=F[y]
|
local l=F[y]
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
return{
|
|
||||||
fillClear=false,
|
|
||||||
dropPiece=function(P)
|
|
||||||
if #P.field>P.gameEnv.fieldH then
|
|
||||||
local cc=P:checkClear(P.field,P.garbageBeneath+1,#P.field-P.garbageBeneath)
|
|
||||||
if cc>0 then
|
|
||||||
SFX.play('clear_'..math.min(cc,6))
|
|
||||||
P:showText(text.clear[cc]or cc.."-crash",0,0,60,'beat',.4)
|
|
||||||
P:removeClearedLines()
|
|
||||||
P.falling=P.gameEnv.fall
|
|
||||||
P.stat.row=P.stat.row+cc
|
|
||||||
end
|
|
||||||
if P.gameEnv.fieldH-cc-P.garbageBeneath>0 then
|
|
||||||
P:garbageRise(21,P.gameEnv.fieldH-cc-P.garbageBeneath,2e10-1)
|
|
||||||
if P.garbageBeneath>=P.gameEnv.fieldH then
|
|
||||||
P:lose()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
return{
|
|
||||||
fillClear=false,
|
|
||||||
dropPiece=function(P)
|
|
||||||
if #P.field>P.gameEnv.fieldH then
|
|
||||||
local cc=P:checkClear(P.field,P.garbageBeneath+1,#P.field-P.garbageBeneath)
|
|
||||||
if cc>0 then
|
|
||||||
SFX.play('clear_'..math.min(cc,6))
|
|
||||||
P:showText(text.clear[cc]or cc.."-crash",0,0,60,'beat',.4)
|
|
||||||
P:removeClearedLines()
|
|
||||||
P.falling=P.gameEnv.fall
|
|
||||||
P.stat.row=P.stat.row+cc
|
|
||||||
end
|
|
||||||
local h=math.ceil((P.gameEnv.fieldH-cc-P.garbageBeneath)/2)
|
|
||||||
if h>0 then
|
|
||||||
P:garbageRise(21,h,2e10-1)
|
|
||||||
if P.garbageBeneath>=P.gameEnv.fieldH then
|
|
||||||
P:lose()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
22
parts/eventsets/stack_e.lua
Normal file
22
parts/eventsets/stack_e.lua
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
return{
|
||||||
|
fieldH=20,
|
||||||
|
fillClear=false,
|
||||||
|
mesDisp=function(P)
|
||||||
|
setFont(60)
|
||||||
|
mStr(P.stat.row,63,280)
|
||||||
|
mText(TEXTOBJ.line,63,350)
|
||||||
|
PLY.draw.drawMarkLine(P,20,.3,1,1,TIME()%.42<.21 and .95 or .6)
|
||||||
|
end,
|
||||||
|
hook_die=function(P)
|
||||||
|
local cc=P:clearFilledLines(P.garbageBeneath+1,#P.field-P.garbageBeneath)
|
||||||
|
if cc>0 then
|
||||||
|
local h=20-cc-P.garbageBeneath
|
||||||
|
if h>0 then
|
||||||
|
P:garbageRise(21,h,2e10-1)
|
||||||
|
if P.garbageBeneath>=20 then
|
||||||
|
P:lose()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
}
|
||||||
22
parts/eventsets/stack_u.lua
Normal file
22
parts/eventsets/stack_u.lua
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
return{
|
||||||
|
fieldH=21,
|
||||||
|
fillClear=false,
|
||||||
|
mesDisp=function(P)
|
||||||
|
setFont(60)
|
||||||
|
mStr(P.stat.row,63,280)
|
||||||
|
mText(TEXTOBJ.line,63,350)
|
||||||
|
PLY.draw.drawMarkLine(P,17,.3,1,1,TIME()%.42<.21 and .95 or .6)
|
||||||
|
end,
|
||||||
|
hook_die=function(P)
|
||||||
|
local cc=P:clearFilledLines(P.garbageBeneath+1,#P.field-P.garbageBeneath)
|
||||||
|
if cc>0 then
|
||||||
|
local h=20-cc-P.garbageBeneath-3
|
||||||
|
if h>0 then
|
||||||
|
P:garbageRise(21,h,2e10-1)
|
||||||
|
if P.garbageBeneath>=20 then
|
||||||
|
P:lose()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
}
|
||||||
30
parts/eventsets/strategy_e.lua
Normal file
30
parts/eventsets/strategy_e.lua
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
local waitSpeed={60,59,58,57,56,55,54,52,50,48,46,44,42,40,38,36,34,32,30}
|
||||||
|
|
||||||
|
return
|
||||||
|
{
|
||||||
|
das=5,arr=1,
|
||||||
|
drop=0,lock=7,
|
||||||
|
wait=60,fall=0,
|
||||||
|
freshLimit=12,
|
||||||
|
mesDisp=function(P)
|
||||||
|
PLY.draw.drawProgress(P.stat.row,P.modeData.target)
|
||||||
|
PLY.draw.drawTargetLine(P,200-P.stat.row)
|
||||||
|
end,
|
||||||
|
task=function(P)
|
||||||
|
P.modeData.target=10
|
||||||
|
end,
|
||||||
|
hook_drop=function(P)
|
||||||
|
if P.stat.row>=P.modeData.target then
|
||||||
|
if P.modeData.target==200 then
|
||||||
|
P:win('finish')
|
||||||
|
else
|
||||||
|
if P.modeData.target==100 then
|
||||||
|
P.modeData.lock=6
|
||||||
|
end
|
||||||
|
P.gameEnv.wait=waitSpeed[P.modeData.target/10]
|
||||||
|
P.modeData.target=P.modeData.target+10
|
||||||
|
SFX.play('reach')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
30
parts/eventsets/strategy_h.lua
Normal file
30
parts/eventsets/strategy_h.lua
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
local waitSpeed={30,29,28,27,26,25,24,23,22,21,20,19,18,18,17,17,16,16,15}
|
||||||
|
|
||||||
|
return
|
||||||
|
{
|
||||||
|
das=4,arr=1,
|
||||||
|
drop=0,lock=6,
|
||||||
|
wait=30,fall=0,
|
||||||
|
freshLimit=12,
|
||||||
|
mesDisp=function(P)
|
||||||
|
PLY.draw.drawProgress(P.stat.row,P.modeData.target)
|
||||||
|
PLY.draw.drawTargetLine(P,200-P.stat.row)
|
||||||
|
end,
|
||||||
|
task=function(P)
|
||||||
|
P.modeData.target=10
|
||||||
|
end,
|
||||||
|
hook_drop=function(P)
|
||||||
|
if P.stat.row>=P.modeData.target then
|
||||||
|
if P.modeData.target==200 then
|
||||||
|
P:win('finish')
|
||||||
|
else
|
||||||
|
if P.modeData.target==100 then
|
||||||
|
P.modeData.lock=5
|
||||||
|
end
|
||||||
|
P.gameEnv.wait=waitSpeed[P.modeData.target/10]
|
||||||
|
P.modeData.target=P.modeData.target+10
|
||||||
|
SFX.play('reach')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
30
parts/eventsets/strategy_u.lua
Normal file
30
parts/eventsets/strategy_u.lua
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
local waitSpeed={15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,7}
|
||||||
|
|
||||||
|
return
|
||||||
|
{
|
||||||
|
das=3,arr=1,
|
||||||
|
drop=0,lock=5,
|
||||||
|
wait=15,fall=0,
|
||||||
|
freshLimit=12,
|
||||||
|
mesDisp=function(P)
|
||||||
|
PLY.draw.drawProgress(P.stat.row,P.modeData.target)
|
||||||
|
PLY.draw.drawTargetLine(P,200-P.stat.row)
|
||||||
|
end,
|
||||||
|
task=function(P)
|
||||||
|
P.modeData.target=10
|
||||||
|
end,
|
||||||
|
hook_drop=function(P)
|
||||||
|
if P.stat.row>=P.modeData.target then
|
||||||
|
if P.modeData.target==200 then
|
||||||
|
P:win('finish')
|
||||||
|
else
|
||||||
|
if P.modeData.target==100 then
|
||||||
|
P.modeData.lock=4
|
||||||
|
end
|
||||||
|
P.gameEnv.wait=waitSpeed[P.modeData.target/10]
|
||||||
|
P.modeData.target=P.modeData.target+10
|
||||||
|
SFX.play('reach')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
@@ -21,6 +21,7 @@ return{
|
|||||||
if D.wave==60 then
|
if D.wave==60 then
|
||||||
P:_showText(text.maxspeed,0,-140,100,'appear',.6)
|
P:_showText(text.maxspeed,0,-140,100,'appear',.6)
|
||||||
end
|
end
|
||||||
|
P:shakeField(3)
|
||||||
D.timer=0
|
D.timer=0
|
||||||
D.wave=D.wave+1
|
D.wave=D.wave+1
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ return{
|
|||||||
if D.wave==30 then
|
if D.wave==30 then
|
||||||
P:_showText(text.maxspeed,0,-140,100,'appear',.6)
|
P:_showText(text.maxspeed,0,-140,100,'appear',.6)
|
||||||
end
|
end
|
||||||
|
P:shakeField(9)
|
||||||
D.timer=0
|
D.timer=0
|
||||||
D.wave=D.wave+1
|
D.wave=D.wave+1
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ return{
|
|||||||
mStr(P.stat.clear[7][4],63,250)
|
mStr(P.stat.clear[7][4],63,250)
|
||||||
mText(TEXTOBJ.techrash,63,315)
|
mText(TEXTOBJ.techrash,63,315)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
if P.lastPiece.row>0 and P.lastPiece.row<4 then
|
if P.lastPiece.row>0 and P.lastPiece.row<4 then
|
||||||
P:lose()
|
P:lose()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ return{
|
|||||||
PLY.draw.applyField(P)
|
PLY.draw.applyField(P)
|
||||||
local L=P.modeData.history
|
local L=P.modeData.history
|
||||||
for i=1,#L do
|
for i=1,#L do
|
||||||
gc.setColor(1,.3,.3,.45-i*.04)
|
gc.setColor(1,.3,.3,.5-i*.04)
|
||||||
gc.rectangle('fill',30*L[i]-30,0,30,600)
|
gc.rectangle('fill',30*L[i]-30,0,30,600)
|
||||||
end
|
end
|
||||||
PLY.draw.cancelField(P)
|
PLY.draw.cancelField(P)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
local C=P.lastPiece
|
local C=P.lastPiece
|
||||||
if C.row>0 then
|
if C.row>0 then
|
||||||
if C.row==4 then
|
if C.row==4 then
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ return{
|
|||||||
mStr(P.modeData.tsd,63,250)
|
mStr(P.modeData.tsd,63,250)
|
||||||
mText(TEXTOBJ.tsd,63,315)
|
mText(TEXTOBJ.tsd,63,315)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
local C=P.lastPiece
|
local C=P.lastPiece
|
||||||
if C.row>0 then
|
if C.row>0 then
|
||||||
if C.id==5 and C.row==2 and C.spin then
|
if C.id==5 and C.row==2 and C.spin then
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ return{
|
|||||||
PLY.draw.cancelField(P)
|
PLY.draw.cancelField(P)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
local C=P.lastPiece
|
local C=P.lastPiece
|
||||||
if C.row>0 then
|
if C.row>0 then
|
||||||
if C.id==5 and C.row==2 and C.spin then
|
if C.id==5 and C.row==2 and C.spin then
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ return{
|
|||||||
PLY.draw.applyField(P)
|
PLY.draw.applyField(P)
|
||||||
local L=P.modeData.history
|
local L=P.modeData.history
|
||||||
for i=1,#L do
|
for i=1,#L do
|
||||||
gc.setColor(1,.3,.3,.3-i*.05)
|
gc.setColor(1,.3,.3,.4-i*.05)
|
||||||
gc.rectangle('fill',30*L[i]-30,0,30,600)
|
gc.rectangle('fill',30*L[i]-30,0,30,600)
|
||||||
end
|
end
|
||||||
PLY.draw.cancelField(P)
|
PLY.draw.cancelField(P)
|
||||||
end,
|
end,
|
||||||
dropPiece=function(P)
|
hook_drop=function(P)
|
||||||
local C=P.lastPiece
|
local C=P.lastPiece
|
||||||
if C.row>0 then
|
if C.row>0 then
|
||||||
if C.id==5 and C.row==2 and C.spin then
|
if C.id==5 and C.row==2 and C.spin then
|
||||||
|
|||||||
@@ -1,24 +1,33 @@
|
|||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
local warnTime={60,90,105,115,116,117,118,119,120}
|
local warnTime={60,90,105,115,116,117,118,119,120}
|
||||||
|
for i=1,#warnTime do warnTime[i]=warnTime[i]*60 end
|
||||||
|
|
||||||
return{
|
return{
|
||||||
mesDisp=function(P)
|
mesDisp=function(P)
|
||||||
gc.setLineWidth(2)
|
gc.setLineWidth(2)
|
||||||
gc.rectangle('line',55,110,32,402)
|
gc.setColor(.98,.98,.98,.8)
|
||||||
local T=P.stat.frame/60/120
|
gc.rectangle('line',0,260,126,80,4)
|
||||||
gc.setColor(2*T,2-2*T,.2)
|
gc.setColor(.98,.98,.98,.4)
|
||||||
gc.rectangle('fill',56,511,30,(T-1)*400)
|
gc.rectangle('fill',0+2,260+2,126-4,80-4,2)
|
||||||
|
setFont(45)
|
||||||
|
local t=P.stat.frame/60
|
||||||
|
local T=("%.1f"):format(120-t)
|
||||||
|
gc.setColor(COLOR.dH)
|
||||||
|
mStr(T,65,270)
|
||||||
|
t=t/120
|
||||||
|
gc.setColor(1.7*t,2.3-2*t,.3)
|
||||||
|
mStr(T,63,268)
|
||||||
end,
|
end,
|
||||||
task=function(P)
|
task=function(P)
|
||||||
P.modeData.stage=1
|
P.modeData.section=1
|
||||||
while true do
|
while true do
|
||||||
YIELD()
|
YIELD()
|
||||||
if P.stat.frame/60>=warnTime[P.modeData.stage]then
|
while P.stat.frame>=warnTime[P.modeData.section]do
|
||||||
if P.modeData.stage<9 then
|
if P.modeData.section<9 then
|
||||||
P.modeData.stage=P.modeData.stage+1
|
P.modeData.section=P.modeData.section+1
|
||||||
SFX.play('ready',.7+P.modeData.stage*.03)
|
playReadySFX(3,.7+P.modeData.section*.03)
|
||||||
else
|
else
|
||||||
SFX.play('start')
|
playReadySFX(0,.7+P.modeData.section*.03)
|
||||||
P:win('finish')
|
P:win('finish')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user