Compare commits
143 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da716ea5c5 | ||
|
|
c6f92a3030 | ||
|
|
267e2dc544 | ||
|
|
cb7d3afdfb | ||
|
|
b57e863c28 | ||
|
|
7aed15fd4f | ||
|
|
6d71b26595 | ||
|
|
1df5406cb3 | ||
|
|
a2b762dcbc | ||
|
|
c2d29c3d6a | ||
|
|
da602eb693 | ||
|
|
9e442a3073 | ||
|
|
bc8b7e733b | ||
|
|
94aa84e380 | ||
|
|
c462c28640 | ||
|
|
b5fbf9cade | ||
|
|
e88957296f | ||
|
|
9e61cb995a | ||
|
|
89a5a718da | ||
|
|
43649c54a3 | ||
|
|
b2b5c99425 | ||
|
|
9e882e6188 | ||
|
|
e688458cfd | ||
|
|
b7c528f5ac | ||
|
|
c743fdcffc | ||
|
|
56e19dd91e | ||
|
|
308512d36a | ||
|
|
749806e553 | ||
|
|
78223334ee | ||
|
|
7f50161ca7 | ||
|
|
dd872a72b2 | ||
|
|
0df17cb4ee | ||
|
|
27244dae04 | ||
|
|
c472d6cbd7 | ||
|
|
e4c786a5d4 | ||
|
|
e291a070f3 | ||
|
|
6b16fcd5f5 | ||
|
|
d79279d1cd | ||
|
|
03fbfaa577 | ||
|
|
8231021426 | ||
|
|
784b2074f8 | ||
|
|
93c9977c86 | ||
|
|
ad1b129dfa | ||
|
|
2d4856551b | ||
|
|
4d0e72d61e | ||
|
|
9b20ec6941 | ||
|
|
5a02265018 | ||
|
|
0dd5c46fd1 | ||
|
|
55831339dd | ||
|
|
e0ba04e579 | ||
|
|
d5f7a6ddd0 | ||
|
|
66a3354883 | ||
|
|
55218e4563 | ||
|
|
081b769ac6 | ||
|
|
8f767b3ab9 | ||
|
|
a2eb7e4a54 | ||
|
|
2de663703b | ||
|
|
40a587dcc4 | ||
|
|
f366a63c8f | ||
|
|
8c603fadee | ||
|
|
5e9ef8d3ab | ||
|
|
2e9cef3ed8 | ||
|
|
354d4f80bf | ||
|
|
a578d537cd | ||
|
|
85ff1cd1c3 | ||
|
|
0d015de359 | ||
|
|
5a0a473d4a | ||
|
|
420ff9a556 | ||
|
|
4f6e99daa2 | ||
|
|
10a57ecc18 | ||
|
|
b101d74df5 | ||
|
|
97d4e58d47 | ||
|
|
b436645ab7 | ||
|
|
af7c73f9f0 | ||
|
|
7d44396b03 | ||
|
|
bd428f355a | ||
|
|
2d6d897e2a | ||
|
|
4913deb15f | ||
|
|
0cb9d3990c | ||
|
|
388e8e1fe1 | ||
|
|
42168ddf16 | ||
|
|
134773765c | ||
|
|
74b099d58f | ||
|
|
c1936441dd | ||
|
|
dc3b7c0825 | ||
|
|
86910f2956 | ||
|
|
7b1df65e64 | ||
|
|
04559efaca | ||
|
|
b668fa4750 | ||
|
|
a4db061485 | ||
|
|
d4d97f1e7f | ||
|
|
e682202b60 | ||
|
|
2480987f10 | ||
|
|
b0acdce294 | ||
|
|
7953cf735b | ||
|
|
d074a85fbc | ||
|
|
543e85e94c | ||
|
|
23f43df737 | ||
|
|
43b6ff7697 | ||
|
|
6ecc80ac0f | ||
|
|
3ae0e80ce5 | ||
|
|
d12f8a27e7 | ||
|
|
f9bbb8fce6 | ||
|
|
80984cddf9 | ||
|
|
8fb0b2e600 | ||
|
|
9a4e8ab4ec | ||
|
|
dc1973e049 | ||
|
|
ccb05230f2 | ||
|
|
7ac6f45b9b | ||
|
|
df7ab20636 | ||
|
|
c06961c9c8 | ||
|
|
37b76a1cb4 | ||
|
|
01d02a916d | ||
|
|
8e99565a9d | ||
|
|
f8d17b23b6 | ||
|
|
06f4bb4e1a | ||
|
|
6e00ff96ec | ||
|
|
468bbc8053 | ||
|
|
f41999c019 | ||
|
|
d259e05ca7 | ||
|
|
2491a436c2 | ||
|
|
7a55e447fc | ||
|
|
f3face791f | ||
|
|
9ccc019bb9 | ||
|
|
bc9f00d09f | ||
|
|
33c470dd38 | ||
|
|
9e0e93de5d | ||
|
|
16553e13a2 | ||
|
|
d031dc3a82 | ||
|
|
7297eb8ee8 | ||
|
|
55bcdd426b | ||
|
|
139e2e14c4 | ||
|
|
339b53115a | ||
|
|
03515b4490 | ||
|
|
9690a345a3 | ||
|
|
8324f72e90 | ||
|
|
15eefc0e9f | ||
|
|
d504bd3d49 | ||
|
|
fd4b4f1882 | ||
|
|
a176ef35a0 | ||
|
|
0fc7178589 | ||
|
|
76d985cc0f | ||
|
|
aa05e8857b |
4
.github/actions/get-cc/action.yml
vendored
4
.github/actions/get-cc/action.yml
vendored
@@ -19,10 +19,10 @@ runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- run: |
|
||||
echo "::set-output name=tag::"$(if [ -z "${{ inputs.tag }}" ]
|
||||
echo "tag="$(if [ -z "${{ inputs.tag }}" ]
|
||||
then curl -w '%{url_effective}' -I -L -s -S https://github.com/${{ inputs.repo }}/releases/latest -o /dev/null | grep -o '\<[^/]*$'
|
||||
else echo ${{ inputs.tag }}
|
||||
fi)
|
||||
fi) >> $GITHUB_OUTPUT
|
||||
id: get-tag
|
||||
shell: bash
|
||||
- uses: ./.github/actions/get-unzip
|
||||
|
||||
265
.github/workflows/main.yml
vendored
265
.github/workflows/main.yml
vendored
@@ -20,6 +20,8 @@ jobs:
|
||||
version-name: ${{ steps.app-info.outputs.version-name }}
|
||||
version-string: ${{ steps.app-info.outputs.version-string }}
|
||||
version-code: ${{ steps.app-info.outputs.version-code }}
|
||||
update-title: ${{ steps.app-info.outputs.update-title }}
|
||||
update-note: ${{ steps.app-info.outputs.update-note }}
|
||||
commit-hash: ${{ steps.git-info.outputs.commit-hash }}
|
||||
base-name: ${{ steps.assemble-base-name.outputs.base-name }}
|
||||
steps:
|
||||
@@ -32,28 +34,42 @@ jobs:
|
||||
shell: lua {0}
|
||||
run: |
|
||||
local version = require "version"
|
||||
print("::set-output name=app-name::Techmino")
|
||||
print("::set-output name=version-name::"..version.name)
|
||||
print("::set-output name=version-string::"..version.string:gsub("%a", ""))
|
||||
print(("::set-output name=version-code::%d"):format(version.code))
|
||||
os.execute('echo "app-name=Techmino" >> $GITHUB_OUTPUT')
|
||||
os.execute('echo "version-name=' .. version.name .. '" >> $GITHUB_OUTPUT')
|
||||
os.execute('echo "version-string=' .. version.string:gsub("%a", "") .. '" >> $GITHUB_OUTPUT')
|
||||
os.execute('echo "version-code=' .. tostring(version.code) .. '" >> $GITHUB_OUTPUT')
|
||||
|
||||
local note = require 'parts.updateLog'
|
||||
local p1 = note:find("\n%d") + 1
|
||||
local p2 = note:find("\n", p1) - 1
|
||||
os.execute('echo "update-title=' .. note:sub(p1, p2) .. '" >> $GITHUB_OUTPUT')
|
||||
local p3 = note:find("\n", note:find("\n%d") + 1) + 1
|
||||
local p4 = note:find("\n%d", p3 + 1)
|
||||
updateNote = note:sub(p3, p4 - 2)
|
||||
:gsub(" ", "- ")
|
||||
:gsub(" ", "# ")
|
||||
os.execute('echo "update-note<<EOF" >> $GITHUB_OUTPUT')
|
||||
os.execute('echo "' .. updateNote .. '" >> $GITHUB_OUTPUT')
|
||||
os.execute('echo "EOF" >> $GITHUB_OUTPUT')
|
||||
- name: Get git info
|
||||
id: git-info
|
||||
shell: bash
|
||||
run: |
|
||||
COMMIT_HASH=$(git rev-parse --short ${{ GITHUB.SHA }})
|
||||
echo ::set-output name=commit-hash::$COMMIT_HASH
|
||||
echo "commit-hash=$COMMIT_HASH" >> $GITHUB_OUTPUT
|
||||
- name: Assemble package base name
|
||||
id: assemble-base-name
|
||||
shell: bash
|
||||
run: |
|
||||
BASE_NAME=Techmino_${{ steps.app-info.outputs.version-string }}_${{ steps.git-info.outputs.commit-hash }}_#${{ GITHUB.RUN_NUMBER }}
|
||||
echo ::set-output name=base-name::$BASE_NAME
|
||||
echo "base-name=$BASE_NAME" >> $GITHUB_OUTPUT
|
||||
|
||||
build-core:
|
||||
runs-on: ubuntu-latest
|
||||
needs: get-info
|
||||
env:
|
||||
OUTPUT_FOLDER: ./build
|
||||
RELEASE_FOLDER: ./release
|
||||
outputs:
|
||||
download-url: ${{ steps.transfer.outputs.download-url }}
|
||||
steps:
|
||||
@@ -66,14 +82,15 @@ jobs:
|
||||
run: |
|
||||
import os
|
||||
import re
|
||||
os.system("echo ::set-output name=product-name::" + re.sub(r"[^A-Za-z0-9]+", "_", "${{ needs.get-info.outputs.app-name }}"))
|
||||
with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
|
||||
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
|
||||
- uses: ./.github/actions/update-version
|
||||
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
|
||||
with:
|
||||
commit: ${{ needs.get-info.outputs.commit-hash }}
|
||||
type: snapshot
|
||||
- name: Build core love package
|
||||
uses: 26F-Studio/love-actions-core@v1
|
||||
uses: love-actions/love-actions-core@v1
|
||||
with:
|
||||
build-list: ./media/ ./parts/ ./Zframework/ ./conf.lua ./main.lua ./version.lua
|
||||
package-path: ${{ env.CORE_LOVE_PACKAGE_PATH }}
|
||||
@@ -91,23 +108,27 @@ jobs:
|
||||
with:
|
||||
name: ${{ needs.get-info.outputs.base-name }}_Core_love
|
||||
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.love
|
||||
- name: Prepare for release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ${{ env.RELEASE_FOLDER }}
|
||||
cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.love ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Bare.love
|
||||
- name: Upload release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
|
||||
uses: softprops/action-gh-release@v1
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
body: ${{ github.event.head_commit.message }}
|
||||
files: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.love
|
||||
allowUpdates: true
|
||||
artifacts: ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Bare.love
|
||||
body: ${{ needs.get-info.outputs.update-note }}
|
||||
name: ${{ needs.get-info.outputs.update-title }}
|
||||
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}
|
||||
- name: Upload to WeTransfer
|
||||
id: transfer
|
||||
run: |
|
||||
curl -sL https://git.io/file-transfer | sh
|
||||
./transfer wet -s -p 16 --no-progress ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.love 2>&1>./wetransfer.log
|
||||
echo "::set-output name=download-url::$(cat ./wetransfer.log | grep https | cut -f3 -d" ")"
|
||||
- name: Show download link
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::notice title=Bare love package::${{ steps.transfer.outputs.download-url }}"
|
||||
echo "download-url=$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" >> $GITHUB_OUTPUT
|
||||
|
||||
auto-test:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -117,7 +138,7 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Love actions for testing
|
||||
uses: 26F-Studio/love-actions-test@v1
|
||||
uses: love-actions/love-actions-test@v1
|
||||
with:
|
||||
font-path: ./parts/fonts/proportional.otf
|
||||
language-folder: ./parts/language
|
||||
@@ -127,6 +148,7 @@ jobs:
|
||||
needs: [get-info, build-core, auto-test]
|
||||
env:
|
||||
OUTPUT_FOLDER: ./build
|
||||
RELEASE_FOLDER: ./release
|
||||
outputs:
|
||||
download-url: ${{ steps.transfer.outputs.download-url }}
|
||||
steps:
|
||||
@@ -139,8 +161,13 @@ jobs:
|
||||
run: |
|
||||
import os
|
||||
import re
|
||||
os.system("echo ::set-output name=bundle-id::org.f26_studio." + re.sub(r"[^A-Za-z0-9]+", "_", "${{ needs.get-info.outputs.app-name }}") + ".snapshot")
|
||||
os.system("echo ::set-output name=product-name::" + re.sub(r"[^A-Za-z0-9]+", "_", "${{ needs.get-info.outputs.app-name }}") + "_Snapshot")
|
||||
with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
|
||||
if "${{ env.BUILD_TYPE }}" == "dev":
|
||||
f.write('bundle-id=org.f26_studio.' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '.snapshot\n')
|
||||
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '_Snapshot\n')
|
||||
else:
|
||||
f.write('bundle-id=org.f26_studio.' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
|
||||
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
|
||||
- name: Download core love package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
@@ -159,7 +186,7 @@ jobs:
|
||||
mv ./ColdClear/arm64-v8a/libCCloader.so ./libAndroid/arm64-v8a/
|
||||
- name: Build Android packages
|
||||
id: build-packages
|
||||
uses: 26F-Studio/love-actions-android@v1
|
||||
uses: love-actions/love-actions-android@v1
|
||||
with:
|
||||
app-name: ${{ needs.get-info.outputs.app-name }}
|
||||
bundle-id: ${{ steps.process-app-name.outputs.bundle-id }}
|
||||
@@ -176,7 +203,7 @@ jobs:
|
||||
version-string: ${{ needs.get-info.outputs.version-string }}
|
||||
version-code: ${{ needs.get-info.outputs.version-code }}
|
||||
output-folder: ${{ env.OUTPUT_FOLDER }}
|
||||
- name: Upload release artifact
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ needs.get-info.outputs.base-name }}_Android_release
|
||||
@@ -185,31 +212,31 @@ jobs:
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p release
|
||||
mv ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}-release.apk release/${{ steps.process-app-name.outputs.product-name }}.apk
|
||||
mkdir -p ${{ env.RELEASE_FOLDER }}
|
||||
cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}-release.apk ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Android.apk
|
||||
- name: Upload release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
|
||||
uses: softprops/action-gh-release@v1
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
body: ${{ github.event.head_commit.message }}
|
||||
files: release/${{ steps.process-app-name.outputs.product-name }}.apk
|
||||
allowUpdates: true
|
||||
artifacts: ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Android.apk
|
||||
body: ${{ needs.get-info.outputs.update-note }}
|
||||
name: ${{ needs.get-info.outputs.update-title }}
|
||||
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}
|
||||
- name: Upload to WeTransfer
|
||||
id: transfer
|
||||
run: |
|
||||
curl -sL https://git.io/file-transfer | sh
|
||||
./transfer wet -s -p 16 --no-progress ${{ steps.build-packages.outputs.package-paths }} 2>&1>./wetransfer.log
|
||||
echo "::set-output name=download-url::$(cat ./wetransfer.log | grep https | cut -f3 -d" ")"
|
||||
- name: Show download link
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::notice title=Android packages::${{ steps.transfer.outputs.download-url }}"
|
||||
echo "download-url=$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" >> $GITHUB_OUTPUT
|
||||
|
||||
build-ios:
|
||||
runs-on: macos-latest
|
||||
if: github.event_name != 'pull_request'
|
||||
needs: [get-info, build-core, auto-test]
|
||||
env:
|
||||
OUTPUT_FOLDER: ./build
|
||||
RELEASE_FOLDER: ./release
|
||||
outputs:
|
||||
download-url: ${{ steps.transfer.outputs.download-url }}
|
||||
steps:
|
||||
@@ -222,8 +249,9 @@ jobs:
|
||||
run: |
|
||||
import os
|
||||
import re
|
||||
os.system("echo ::set-output name=bundle-id::org.26f-studio.techmino")
|
||||
os.system("echo ::set-output name=product-name::" + re.sub(r"[^A-Za-z0-9]+", "_", "${{ needs.get-info.outputs.app-name }}"))
|
||||
with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
|
||||
f.write('bundle-id=org.26f-studio.techmino\n')
|
||||
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
|
||||
- name: Download core love package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
@@ -235,7 +263,7 @@ jobs:
|
||||
dir: ./ColdClear
|
||||
- name: Build iOS packages
|
||||
id: build-packages
|
||||
uses: 26F-Studio/love-actions-ios@v1
|
||||
uses: love-actions/love-actions-ios@v1
|
||||
with:
|
||||
app-name: ${{ needs.get-info.outputs.app-name }}
|
||||
bundle-id: ${{ steps.process-app-name.outputs.bundle-id }}
|
||||
@@ -269,29 +297,34 @@ jobs:
|
||||
with:
|
||||
name: ${{ needs.get-info.outputs.base-name }}_iOS_ipa
|
||||
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.ipa
|
||||
- name: Prepare for release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ${{ env.RELEASE_FOLDER }}
|
||||
cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.ipa ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_iOS.ipa
|
||||
- name: Upload release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
|
||||
uses: softprops/action-gh-release@v1
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
body: ${{ github.event.head_commit.message }}
|
||||
files: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.ipa
|
||||
allowUpdates: true
|
||||
artifacts: ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_iOS.ipa
|
||||
body: ${{ needs.get-info.outputs.update-note }}
|
||||
name: ${{ needs.get-info.outputs.update-title }}
|
||||
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}
|
||||
- name: Upload to WeTransfer
|
||||
id: transfer
|
||||
run: |
|
||||
wget -qO- https://github.com/Mikubill/transfer/releases/download/v0.4.17/transfer_0.4.17_darwin_amd64.tar.gz | tar xvz
|
||||
./transfer wet -s -p 16 --no-progress ${{ steps.build-packages.outputs.package-paths }} 2>&1>./wetransfer.log
|
||||
echo "::set-output name=download-url::$(cat ./wetransfer.log | grep https | cut -f3 -d" ")"
|
||||
- name: Show download link
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::notice title=iOS packages::${{ steps.transfer.outputs.download-url }}"
|
||||
echo "download-url=$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" >> $GITHUB_OUTPUT
|
||||
|
||||
build-linux:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [get-info, build-core, auto-test]
|
||||
env:
|
||||
OUTPUT_FOLDER: ./build
|
||||
RELEASE_FOLDER: ./release
|
||||
outputs:
|
||||
download-url: ${{ steps.transfer.outputs.download-url }}
|
||||
steps:
|
||||
@@ -304,7 +337,8 @@ jobs:
|
||||
run: |
|
||||
import os
|
||||
import re
|
||||
os.system("echo ::set-output name=product-name::" + re.sub(r"[^A-Za-z0-9]+", "_", "${{ needs.get-info.outputs.app-name }}"))
|
||||
with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
|
||||
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
|
||||
- name: Download core love package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
@@ -324,7 +358,7 @@ jobs:
|
||||
mv ./x64/CCloader.so ./shared
|
||||
- name: Build Linux packages
|
||||
id: build-packages
|
||||
uses: 26F-Studio/love-actions-linux@v1
|
||||
uses: love-actions/love-actions-linux@v1
|
||||
with:
|
||||
desktop-file-path: ./.github/build/linux/${{ env.BUILD_TYPE }}/template.desktop
|
||||
executable-name: app
|
||||
@@ -339,29 +373,35 @@ jobs:
|
||||
with:
|
||||
name: ${{ needs.get-info.outputs.base-name }}_Linux_AppImage
|
||||
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.AppImage
|
||||
- name: Prepare for release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ${{ env.RELEASE_FOLDER }}
|
||||
cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.AppImage ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Linux.AppImage
|
||||
- name: Upload release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
|
||||
uses: softprops/action-gh-release@v1
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
body: ${{ github.event.head_commit.message }}
|
||||
files: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.AppImage
|
||||
allowUpdates: true
|
||||
artifacts: ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Linux.AppImage
|
||||
body: ${{ needs.get-info.outputs.update-note }}
|
||||
name: ${{ needs.get-info.outputs.update-title }}
|
||||
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}
|
||||
- name: Upload to WeTransfer
|
||||
id: transfer
|
||||
run: |
|
||||
curl -sL https://git.io/file-transfer | sh
|
||||
./transfer wet -s -p 16 --no-progress ${{ steps.build-packages.outputs.package-paths }} 2>&1>./wetransfer.log
|
||||
echo "::set-output name=download-url::$(cat ./wetransfer.log | grep https | cut -f3 -d" ")"
|
||||
- name: Show download link
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::notice title=Linux packages::${{ steps.transfer.outputs.download-url }}"
|
||||
echo "download-url=$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" >> $GITHUB_OUTPUT
|
||||
|
||||
build-macos-appstore:
|
||||
runs-on: macos-latest
|
||||
if: github.event_name != 'pull_request'
|
||||
needs: [get-info, build-core, auto-test]
|
||||
env:
|
||||
OUTPUT_FOLDER: ./build
|
||||
RELEASE_FOLDER: ./release
|
||||
outputs:
|
||||
download-url: ${{ steps.transfer.outputs.download-url }}
|
||||
steps:
|
||||
@@ -374,8 +414,9 @@ jobs:
|
||||
run: |
|
||||
import os
|
||||
import re
|
||||
os.system("echo ::set-output name=bundle-id::org.26f-studio.techmino")
|
||||
os.system("echo ::set-output name=product-name::" + re.sub(r"[^A-Za-z0-9]+", "_", "${{ needs.get-info.outputs.app-name }}"))
|
||||
with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
|
||||
f.write('bundle-id=org.26f-studio.techmino\n')
|
||||
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
|
||||
- name: Download core love package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
@@ -391,7 +432,7 @@ jobs:
|
||||
rm ./ColdClear/universal/libcold_clear.a
|
||||
- name: Build macOS packages
|
||||
id: build-packages
|
||||
uses: 26F-Studio/love-actions-macos-appstore@v1
|
||||
uses: love-actions/love-actions-macos-appstore@v1
|
||||
with:
|
||||
app-name: ${{ needs.get-info.outputs.app-name }}
|
||||
bundle-id: ${{ steps.process-app-name.outputs.bundle-id }}
|
||||
@@ -424,29 +465,35 @@ jobs:
|
||||
with:
|
||||
name: ${{ needs.get-info.outputs.base-name }}_macOS_appstore_pkg
|
||||
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.pkg
|
||||
- name: Prepare for release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ${{ env.RELEASE_FOLDER }}
|
||||
cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.pkg ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_macOS_appstore.pkg
|
||||
- name: Upload release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
|
||||
uses: softprops/action-gh-release@v1
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
body: ${{ github.event.head_commit.message }}
|
||||
files: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.pkg
|
||||
allowUpdates: true
|
||||
artifacts: ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_macOS_appstore.pkg
|
||||
body: ${{ needs.get-info.outputs.update-note }}
|
||||
name: ${{ needs.get-info.outputs.update-title }}
|
||||
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}
|
||||
- name: Upload to WeTransfer
|
||||
id: transfer
|
||||
run: |
|
||||
wget -qO- https://github.com/Mikubill/transfer/releases/download/v0.4.17/transfer_0.4.17_darwin_amd64.tar.gz | tar xvz
|
||||
./transfer wet -s -p 16 --no-progress ${{ steps.build-packages.outputs.package-paths }} 2>&1>./wetransfer.log
|
||||
echo "::set-output name=download-url::$(cat ./wetransfer.log | grep https | cut -f3 -d" ")"
|
||||
- name: Show download link
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::notice title=macOS App Store packages::${{ steps.transfer.outputs.download-url }}"
|
||||
echo "download-url=$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" >> $GITHUB_OUTPUT
|
||||
|
||||
build-macos-portable:
|
||||
runs-on: macos-latest
|
||||
if: github.event_name != 'pull_request'
|
||||
needs: [get-info, build-core, auto-test]
|
||||
env:
|
||||
OUTPUT_FOLDER: ./build
|
||||
RELEASE_FOLDER: ./release
|
||||
outputs:
|
||||
download-url: ${{ steps.transfer.outputs.download-url }}
|
||||
steps:
|
||||
@@ -459,8 +506,9 @@ jobs:
|
||||
run: |
|
||||
import os
|
||||
import re
|
||||
os.system("echo ::set-output name=bundle-id::org.26f-studio.techmino")
|
||||
os.system("echo ::set-output name=product-name::" + re.sub(r"[^A-Za-z0-9]+", "_", "${{ needs.get-info.outputs.app-name }}"))
|
||||
with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
|
||||
f.write('bundle-id=org.26f-studio.techmino\n')
|
||||
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
|
||||
- name: Download core love package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
@@ -476,7 +524,7 @@ jobs:
|
||||
rm ./ColdClear/universal/libcold_clear.a
|
||||
- name: Build macOS packages
|
||||
id: build-packages
|
||||
uses: 26F-Studio/love-actions-macos-portable@v1
|
||||
uses: love-actions/love-actions-macos-portable@v1
|
||||
with:
|
||||
app-name: ${{ needs.get-info.outputs.app-name }}
|
||||
bundle-id: ${{ steps.process-app-name.outputs.bundle-id }}
|
||||
@@ -518,31 +566,35 @@ jobs:
|
||||
with:
|
||||
name: ${{ needs.get-info.outputs.base-name }}_macOS_portable_bare
|
||||
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.zip
|
||||
- name: Prepare for release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ${{ env.RELEASE_FOLDER }}
|
||||
cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.pkg ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_macOS_portable.pkg
|
||||
cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.dmg ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_macOS_portable.dmg
|
||||
- name: Upload release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
|
||||
uses: softprops/action-gh-release@v1
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
body: ${{ github.event.head_commit.message }}
|
||||
files: |
|
||||
${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.pkg
|
||||
${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.dmg
|
||||
allowUpdates: true
|
||||
artifacts: ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_macOS_portable.pkg, ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_macOS_portable.dmg
|
||||
body: ${{ needs.get-info.outputs.update-note }}
|
||||
name: ${{ needs.get-info.outputs.update-title }}
|
||||
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}
|
||||
- name: Upload to WeTransfer
|
||||
id: transfer
|
||||
run: |
|
||||
wget -qO- https://github.com/Mikubill/transfer/releases/download/v0.4.17/transfer_0.4.17_darwin_amd64.tar.gz | tar xvz
|
||||
./transfer wet -s -p 16 --no-progress ${{ steps.build-packages.outputs.package-paths }} 2>&1>./wetransfer.log
|
||||
echo "::set-output name=download-url::$(cat ./wetransfer.log | grep https | cut -f3 -d" ")"
|
||||
- name: Show download link
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::notice title=macOS portable packages::${{ steps.transfer.outputs.download-url }}"
|
||||
echo "download-url=$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" >> $GITHUB_OUTPUT
|
||||
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
needs: [get-info, build-core, auto-test]
|
||||
env:
|
||||
OUTPUT_FOLDER: ./build
|
||||
RELEASE_FOLDER: ./release
|
||||
outputs:
|
||||
download-url: ${{ steps.transfer.outputs.download-url }}
|
||||
steps:
|
||||
@@ -555,7 +607,8 @@ jobs:
|
||||
run: |
|
||||
import os
|
||||
import re
|
||||
os.system("echo ::set-output name=product-name::" + re.sub(r"[^A-Za-z0-9]+", "_", "${{ needs.get-info.outputs.app-name }}"))
|
||||
with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
|
||||
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
|
||||
- name: Download core love package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
@@ -567,7 +620,7 @@ jobs:
|
||||
dir: ./ColdClear
|
||||
- name: Build Windows packages
|
||||
id: build-packages
|
||||
uses: 26F-Studio/love-actions-windows@v1
|
||||
uses: love-actions/love-actions-windows@v1
|
||||
with:
|
||||
icon-path: ./.github/build/windows/${{ env.BUILD_TYPE }}/icon.ico
|
||||
rc-path: ./.github/build/windows/${{ env.BUILD_TYPE }}/template.rc
|
||||
@@ -587,14 +640,21 @@ jobs:
|
||||
with:
|
||||
name: ${{ needs.get-info.outputs.base-name }}_Windows_x64
|
||||
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_x64.zip
|
||||
- name: Prepare for release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ${{ env.RELEASE_FOLDER }}
|
||||
cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_x86.zip ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Windows_x86.zip
|
||||
cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_x64.zip ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Windows_x64.zip
|
||||
- name: Upload release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
|
||||
uses: softprops/action-gh-release@v1
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
body: ${{ github.event.head_commit.message }}
|
||||
files: |
|
||||
${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_x86.zip
|
||||
${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_x64.zip
|
||||
allowUpdates: true
|
||||
artifacts: ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Windows_x86.zip, ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_Windows_x64.zip
|
||||
body: ${{ needs.get-info.outputs.update-note }}
|
||||
name: ${{ needs.get-info.outputs.update-title }}
|
||||
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}
|
||||
- name: Get transfer
|
||||
env:
|
||||
@@ -606,13 +666,10 @@ jobs:
|
||||
rm ${{ env.TEMP_PATH }}
|
||||
- name: Upload to WeTransfer
|
||||
id: transfer
|
||||
shell: pwsh
|
||||
run: |
|
||||
./transfer wet -s -p 16 --no-progress ${{ steps.build-packages.outputs.package-paths }} 2>&1>./wetransfer.log
|
||||
echo "::set-output name=download-url::$(cat ./wetransfer.log | grep https | cut -f3 -d" ")"
|
||||
- name: Show download link
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::notice title=Windows packages::${{ steps.transfer.outputs.download-url }}"
|
||||
./transfer.exe wet -s -p 16 --no-progress ${{ steps.build-packages.outputs.package-paths }} 2>&1>./wetransfer.log
|
||||
"download-url=$(cat ./wetransfer.log | grep https | cut -f3 -d" ")" >> $env:GITHUB_OUTPUT
|
||||
|
||||
post-build:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -634,11 +691,37 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Cleanup
|
||||
uses: geekyeggo/delete-artifact@v1
|
||||
uses: geekyeggo/delete-artifact@v2
|
||||
with:
|
||||
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
|
||||
- name: Display summary
|
||||
shell: bash
|
||||
run: |
|
||||
echo "# Summary" >> $GITHUB_STEP_SUMMARY
|
||||
echo "## Version: ${{ needs.get-info.outputs.version-string }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "## Package Name: ${{ needs.get-info.outputs.base-name }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "## Download links: " >> $GITHUB_STEP_SUMMARY
|
||||
- name: Display download links
|
||||
shell: python3 {0}
|
||||
run: |
|
||||
import os
|
||||
with open(os.getenv('GITHUB_STEP_SUMMARY'), 'a') as f:
|
||||
if "${{ needs.build-core.result }}" == "success":
|
||||
f.write("- Bare love packages: [WeTransfer](${{ needs.build-core.outputs.download-url }})\n")
|
||||
if "${{ needs.build-android.result }}" == "success":
|
||||
f.write("- Android packages: [WeTransfer](${{ needs.build-android.outputs.download-url }})\n")
|
||||
if "${{ needs.build-ios.result }}" == "success":
|
||||
f.write("- iOS packages: [WeTransfer](${{ needs.build-ios.outputs.download-url }})\n")
|
||||
if "${{ needs.build-linux.result }}" == "success":
|
||||
f.write("- Linux packages: [WeTransfer](${{ needs.build-linux.outputs.download-url }})\n")
|
||||
if "${{ needs.build-macos-appstore.result }}" == "success":
|
||||
f.write("- macOS packages(App Store version): [WeTransfer](${{ needs.build-macos-appstore.outputs.download-url }})\n")
|
||||
if "${{ needs.build-macos-portable.result }}" == "success":
|
||||
f.write("- macOS packages(Portable version): [WeTransfer](${{ needs.build-macos-portable.outputs.download-url }})\n")
|
||||
if "${{ needs.build-windows.result }}" == "success":
|
||||
f.write("- Windows packages: [WeTransfer](${{ needs.build-windows.outputs.download-url }})\n")
|
||||
- name: Send Discord message
|
||||
uses: Sniddl/discord-commits@v1.3
|
||||
uses: Sniddl/discord-commits@v1.5
|
||||
with:
|
||||
webhook: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
message: "Github Actions for **${{ github.repository }}**."
|
||||
|
||||
Submodule Zframework updated: 963af77fe2...8e39257d64
18
conf.lua
18
conf.lua
@@ -1,9 +1,9 @@
|
||||
function love.conf(t)
|
||||
t.identity='Techmino'--Saving folder
|
||||
t.identity='Techmino'-- Saving folder
|
||||
t.version="11.1"
|
||||
t.gammacorrect=false
|
||||
t.appendidentity=true--Search files in source then in save directory
|
||||
t.accelerometerjoystick=false--Accelerometer=joystick on ios/android
|
||||
t.appendidentity=true-- Search files in source then in save directory
|
||||
t.accelerometerjoystick=false-- Accelerometer=joystick on ios/android
|
||||
if t.audio then
|
||||
t.audio.mic=false
|
||||
t.audio.mixwithsystem=true
|
||||
@@ -16,12 +16,12 @@ function love.conf(t)
|
||||
W.borderless=false
|
||||
W.resizable=true
|
||||
W.fullscreen=false
|
||||
W.vsync=0--Unlimited FPS
|
||||
W.msaa=0--Multi-sampled antialiasing
|
||||
W.depth=0--Bits/samp of depth buffer
|
||||
W.stencil=1--Bits/samp of stencil buffer
|
||||
W.display=1--Monitor ID
|
||||
W.highdpi=true--High-dpi mode for the window on a Retina display
|
||||
W.vsync=0-- Unlimited FPS
|
||||
W.msaa=0-- Multi-sampled antialiasing
|
||||
W.depth=0-- Bits/samp of depth buffer
|
||||
W.stencil=1-- Bits/samp of stencil buffer
|
||||
W.display=1-- Monitor ID
|
||||
W.highdpi=true-- High-dpi mode for the window on a Retina display
|
||||
W.x,W.y=nil
|
||||
|
||||
local M=t.modules
|
||||
|
||||
230
main.lua
230
main.lua
@@ -15,26 +15,24 @@
|
||||
]]--
|
||||
|
||||
|
||||
--Var leak check
|
||||
-- setmetatable(_G,{__newindex=function(self,k,v)print('>>'..k)print(debug.traceback():match("\n.-\n\t(.-): "))rawset(self,k,v)end})
|
||||
-- Var leak check
|
||||
-- setmetatable(_G,{__newindex=function(self,k,v) print('>>'..k..string.rep(" ",26-#k),debug.traceback():match("\n.-\n\t(.-): "))rawset(self,k,v) end})
|
||||
|
||||
--System Global Vars Declaration
|
||||
-- System Global Vars Declaration
|
||||
local fs=love.filesystem
|
||||
VERSION=require"version"
|
||||
TIME=love.timer.getTime
|
||||
YIELD=coroutine.yield
|
||||
SYSTEM=love.system.getOS()if SYSTEM=='OS X'then SYSTEM='macOS'end
|
||||
FNNS=SYSTEM:find'\79\83'--What does FNSF stand for? IDK so don't ask me lol
|
||||
MOBILE=SYSTEM=='Android'or SYSTEM=='iOS'
|
||||
SAVEDIR=fs.getSaveDirectory()
|
||||
SYSTEM=love.system.getOS() if SYSTEM=='OS X' then SYSTEM='macOS' end
|
||||
FNNS=SYSTEM:find'\79\83'-- What does FNSF stand for? IDK so don't ask me lol
|
||||
MOBILE=SYSTEM=='Android' or SYSTEM=='iOS'
|
||||
|
||||
--Global Vars & Settings
|
||||
-- Global Vars & Settings
|
||||
SFXPACKS={'chiptune'}
|
||||
VOCPACKS={'miya','mono','xiaoya','miku','rin'}
|
||||
VOCPACKS={'miya','mono','xiaoya','miku'}
|
||||
FIRSTLAUNCH=false
|
||||
DAILYLAUNCH=false
|
||||
|
||||
--System setting
|
||||
-- System setting
|
||||
math.randomseed(os.time()*626)
|
||||
love.setDeprecationOutput(false)
|
||||
love.keyboard.setKeyRepeat(true)
|
||||
@@ -48,7 +46,7 @@ end
|
||||
local _LOADTIMELIST_={}
|
||||
local _LOADTIME_=TIME()
|
||||
|
||||
--Load modules
|
||||
-- Load modules
|
||||
Z=require'Zframework'
|
||||
FONT.load{
|
||||
norm='parts/fonts/proportional.otf',
|
||||
@@ -57,19 +55,18 @@ FONT.load{
|
||||
FONT.setDefault('norm')
|
||||
FONT.setFallback('norm')
|
||||
|
||||
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)
|
||||
VOC.setDiversion(.62)
|
||||
|
||||
WIDGET.setOnChange(function()
|
||||
if SCN.cur~='custom_field'then
|
||||
if SCN.cur~='net_game' and SCN.cur~='custom_field' then
|
||||
local colorList=THEME.getThemeColor()
|
||||
if not colorList then return end
|
||||
local rnd=math.random
|
||||
for _,W in next,SCN.scenes[SCN.cur].widgetList do
|
||||
if W.color then
|
||||
W.color=colorList[rnd(#colorList)]
|
||||
if colorList then
|
||||
for _,W in next,SCN.scenes[SCN.cur].widgetList do
|
||||
if W.color then
|
||||
W.color=colorList[math.random(#colorList)]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -77,7 +74,7 @@ end)
|
||||
|
||||
table.insert(_LOADTIMELIST_,("Load Zframework: %.3fs"):format(TIME()-_LOADTIME_))
|
||||
|
||||
--Create shortcuts
|
||||
-- Create shortcuts
|
||||
setFont=FONT.set
|
||||
getFont=FONT.get
|
||||
mText=GC.simpX
|
||||
@@ -87,15 +84,15 @@ string.repD=STRING.repD
|
||||
string.sArg=STRING.sArg
|
||||
string.split=STRING.split
|
||||
|
||||
--Delete all naked files (from ancient versions)
|
||||
-- Delete all naked files (from ancient versions)
|
||||
FILE.clear('')
|
||||
|
||||
--Create directories
|
||||
for _,v in next,{'conf','record','replay','cache','lib'}do
|
||||
-- Create directories
|
||||
for _,v in next,{'conf','record','replay','cache','lib'} do
|
||||
local info=fs.getInfo(v)
|
||||
if not info then
|
||||
fs.createDirectory(v)
|
||||
elseif info.type~='directory'then
|
||||
elseif info.type~='directory' then
|
||||
fs.remove(v)
|
||||
fs.createDirectory(v)
|
||||
end
|
||||
@@ -105,10 +102,10 @@ CHAR=require'parts.char'
|
||||
require'parts.gameTables'
|
||||
require'parts.gameFuncs'
|
||||
|
||||
--Load shader files from SOURCE ONLY
|
||||
-- Load shader files from SOURCE ONLY
|
||||
SHADER={}
|
||||
for _,v in next,fs.getDirectoryItems('parts/shaders')do
|
||||
if isSafeFile('parts/shaders/'..v)then
|
||||
for _,v in next,fs.getDirectoryItems('parts/shaders') do
|
||||
if FILE.isSafe('parts/shaders/'..v) then
|
||||
local name=v:sub(1,-6)
|
||||
SHADER[name]=love.graphics.newShader('parts/shaders/'..name..'.glsl')
|
||||
end
|
||||
@@ -137,8 +134,8 @@ end})
|
||||
|
||||
table.insert(_LOADTIMELIST_,("Load Parts: %.3fs"):format(TIME()-_LOADTIME_))
|
||||
|
||||
--Init Zframework
|
||||
do--Z.setCursor
|
||||
-- Init Zframework
|
||||
do-- Z.setCursor
|
||||
local normImg=GC.DO{16,16,
|
||||
{'fCirc',8,8,4},
|
||||
{'setCL',1,1,1,.7},
|
||||
@@ -149,6 +146,7 @@ do--Z.setCursor
|
||||
{'dCirc',8,8,7},
|
||||
{'fCirc',8,8,3},
|
||||
}
|
||||
local _
|
||||
Z.setCursor(function(time,x,y)
|
||||
if not SETTING.sysCursor then
|
||||
local R=math.floor((time+1)/2)%7+1
|
||||
@@ -157,14 +155,14 @@ do--Z.setCursor
|
||||
_=DSCP[R][0]
|
||||
GC.draw(TEXTURE.miniBlock[R],x,y,time%math.pi*4,8,8,2*_[2]+1,2*(#BLOCKS[R][0]-_[1])-1)
|
||||
GC.setColor(1,1,1)
|
||||
GC.draw(love.mouse.isDown(1)and holdImg or normImg,x,y,nil,nil,nil,8,8)
|
||||
GC.draw(love.mouse.isDown(1) and holdImg or normImg,x,y,nil,nil,nil,8,8)
|
||||
end
|
||||
end)
|
||||
end
|
||||
Z.setOnFnKeys({
|
||||
function()MES.new('check',PROFILE.switch()and"profile start!"or"profile report copied!")end,
|
||||
function()MES.new('info',("System:%s[%s]\nluaVer:%s\njitVer:%s\njitVerNum:%s"):format(SYSTEM,jit.arch,_VERSION,jit.version,jit.version_num))end,
|
||||
function()MES.new('error',"挂了")end,
|
||||
function() MES.new('check',PROFILE.switch() and "profile start!" or "profile report copied!") end,
|
||||
function() MES.new('info',("System:%s[%s]\nluaVer:%s\njitVer:%s\njitVerNum:%s"):format(SYSTEM,jit.arch,_VERSION,jit.version,jit.version_num)) end,
|
||||
function() MES.new('error',"挂了") end,
|
||||
function()
|
||||
if GAME.playing and not GAME.net then
|
||||
for _=1,8 do
|
||||
@@ -176,17 +174,23 @@ Z.setOnFnKeys({
|
||||
end
|
||||
end
|
||||
end,
|
||||
function()print(BG.locked)end,
|
||||
function()for k,v in next,_G do print(k,v)end end,
|
||||
function()if love['_openConsole']then love['_openConsole']()end end,
|
||||
function() print(BG.locked) end,
|
||||
function() for k,v in next,_G do print(k,v) end end,
|
||||
function() if love['_openConsole'] then love['_openConsole']() end end,
|
||||
})
|
||||
Z.setOnGlobalKey('f11',function()
|
||||
SETTING.fullscreen=not SETTING.fullscreen
|
||||
applySettings()
|
||||
saveSettings()
|
||||
end)
|
||||
Z.setVersionText(VERSION.string)
|
||||
Z.setDebugInfo{
|
||||
{"Cache",gcinfo},
|
||||
{"Tasks",TASK.getCount},
|
||||
{"Voices",VOC.getQueueCount},
|
||||
{"Audios",love.audio.getSourceCount},
|
||||
}
|
||||
do--Z.setOnFocus
|
||||
do-- Z.setOnFocus
|
||||
local function task_autoSoundOff()
|
||||
while true do
|
||||
coroutine.yield()
|
||||
@@ -214,7 +218,7 @@ do--Z.setOnFocus
|
||||
TASK.new(task_autoSoundOn)
|
||||
end
|
||||
else
|
||||
if SCN.cur=='game'and SETTING.autoPause then
|
||||
if SCN.cur=='game' and SETTING.autoPause then
|
||||
pauseGame()
|
||||
end
|
||||
if SETTING.autoMute and SCN.cur~='music' then
|
||||
@@ -224,23 +228,32 @@ do--Z.setOnFocus
|
||||
end
|
||||
end)
|
||||
end
|
||||
Z.setOnQuit(destroyPlayers)
|
||||
Z.setOnBeforeQuit(function()
|
||||
NET.ws_close()
|
||||
TASK.new(function()
|
||||
TEST.yieldT(.26)
|
||||
love.event.quit()
|
||||
end)
|
||||
end)
|
||||
Z.setOnQuit(function()
|
||||
destroyPlayers()
|
||||
end)
|
||||
|
||||
--Load settings and statistics
|
||||
-- Load settings and statistics
|
||||
if
|
||||
not(
|
||||
pcall(TABLE.cover, loadFile('conf/user', '-json -canSkip')or loadFile('conf/user', '-luaon -canSkip')or{},USER) and
|
||||
pcall(TABLE.cover, loadFile('conf/unlock', '-json -canSkip')or loadFile('conf/unlock', '-luaon -canSkip')or{},RANKS) and
|
||||
pcall(TABLE.update,loadFile('conf/settings', '-json -canSkip')or loadFile('conf/settings', '-luaon -canSkip')or{},SETTING) and
|
||||
pcall(TABLE.coverR,loadFile('conf/data', '-json -canSkip')or loadFile('conf/data', '-luaon -canSkip')or{},STAT) and
|
||||
pcall(TABLE.cover, loadFile('conf/key', '-json -canSkip')or loadFile('conf/key', '-luaon -canSkip')or{},KEY_MAP) and
|
||||
pcall(TABLE.cover, loadFile('conf/virtualkey','-json -canSkip')or loadFile('conf/virtualkey','-luaon -canSkip')or{},VK_ORG)
|
||||
not (
|
||||
pcall(TABLE.cover, loadFile('conf/user', '-json -canSkip') or loadFile('conf/user', '-luaon -canSkip') or{},USER) and
|
||||
pcall(TABLE.cover, loadFile('conf/unlock', '-json -canSkip') or loadFile('conf/unlock', '-luaon -canSkip') or{},RANKS) and
|
||||
pcall(TABLE.update,loadFile('conf/settings', '-json -canSkip') or loadFile('conf/settings', '-luaon -canSkip') or{},SETTING) and
|
||||
pcall(TABLE.coverR,loadFile('conf/data', '-json -canSkip') or loadFile('conf/data', '-luaon -canSkip') or{},STAT) and
|
||||
pcall(TABLE.cover, loadFile('conf/key', '-json -canSkip') or loadFile('conf/key', '-luaon -canSkip') or{},KEY_MAP) and
|
||||
pcall(TABLE.cover, loadFile('conf/virtualkey','-json -canSkip') or loadFile('conf/virtualkey','-luaon -canSkip') or{},VK_ORG)
|
||||
)
|
||||
then
|
||||
MES.new('error',"An error occured during loading, and some data was lost.")
|
||||
end
|
||||
|
||||
--Initialize fields, sequence, missions, gameEnv for cutsom game
|
||||
-- Initialize fields, sequence, missions, gameEnv for cutsom game
|
||||
local fieldData=loadFile('conf/customBoards','-string -canSkip')
|
||||
if fieldData then
|
||||
fieldData=STRING.split(fieldData,"!")
|
||||
@@ -265,7 +278,7 @@ end
|
||||
TABLE.complete(require"parts.customEnv0",CUSTOMENV)
|
||||
|
||||
|
||||
--Initialize image libs
|
||||
-- Initialize image libs
|
||||
IMG.init{
|
||||
lock='media/image/mess/lock.png',
|
||||
dialCircle='media/image/mess/dialCircle.png',
|
||||
@@ -344,20 +357,20 @@ SKIN.load{
|
||||
{name="wtf",path='media/image/skin/wtf_mrz.png'},
|
||||
}
|
||||
|
||||
--Initialize sound libs
|
||||
-- Initialize sound libs
|
||||
SFX.init((function()--[Warning] Not loading files here, just get the list of sound needed
|
||||
local L={}
|
||||
for _,v in next,fs.getDirectoryItems('media/effect/chiptune/')do
|
||||
if isSafeFile('media/effect/chiptune/'..v,"Dangerous file : %SAVE%/media/effect/chiptune/"..v)then
|
||||
for _,v in next,fs.getDirectoryItems('media/effect/chiptune/') do
|
||||
if FILE.isSafe('media/effect/chiptune/'..v,"Dangerous file : %SAVE%/media/effect/chiptune/"..v) then
|
||||
table.insert(L,v:sub(1,-5))
|
||||
end
|
||||
end
|
||||
return L
|
||||
end)())
|
||||
BGM.load((function()
|
||||
BGM.init((function()
|
||||
local L={}
|
||||
for _,v in next,fs.getDirectoryItems('media/music')do
|
||||
if isSafeFile('media/music/'..v,"Dangerous file : %SAVE%/media/music/"..v)then
|
||||
for _,v in next,fs.getDirectoryItems('media/music') do
|
||||
if FILE.isSafe('media/music/'..v,"Dangerous file : %SAVE%/media/music/"..v) then
|
||||
L[v:sub(1,-5)]='media/music/'..v
|
||||
end
|
||||
end
|
||||
@@ -373,7 +386,7 @@ VOC.init{
|
||||
'welcome',
|
||||
}
|
||||
|
||||
--Initialize language lib
|
||||
-- Initialize language lib
|
||||
LANG.init('zh',
|
||||
{
|
||||
zh=require'parts.language.lang_zh',
|
||||
@@ -386,17 +399,17 @@ LANG.init('zh',
|
||||
ja=require'parts.language.lang_ja',
|
||||
symbol=require'parts.language.lang_symbol',
|
||||
zh_code=require'parts.language.lang_zh_code',
|
||||
--1. Add language file to LANG folder;
|
||||
--2. Require it;
|
||||
--3. Add a button in parts/scenes/lang.lua;
|
||||
-- 1. Add language file to LANG folder;
|
||||
-- 2. Require it;
|
||||
-- 3. Add a button in parts/scenes/lang.lua;
|
||||
},
|
||||
{
|
||||
block=BLOCK_NAMES
|
||||
},
|
||||
(function()
|
||||
local tipMeta={__call=function(L)return L[math.random(#L)]end}
|
||||
local tipMeta={__call=function(L) return L[math.random(#L)] end}
|
||||
return function(L)
|
||||
if type(rawget(L,'getTip'))=='table'then setmetatable(L.getTip,tipMeta)end
|
||||
if type(rawget(L,'getTip'))=='table' then setmetatable(L.getTip,tipMeta) end
|
||||
setmetatable(L,{__index=function(self,k)
|
||||
local mes="No Text ("..SETTING.locale.."): "..k
|
||||
LOG(mes)
|
||||
@@ -410,32 +423,32 @@ LANG.init('zh',
|
||||
|
||||
table.insert(_LOADTIMELIST_,("Initialize Parts: %.3fs"):format(TIME()-_LOADTIME_))
|
||||
|
||||
--Load background files from SOURCE ONLY
|
||||
for _,v in next,fs.getDirectoryItems('parts/backgrounds')do
|
||||
if isSafeFile('parts/backgrounds/'..v)and v:sub(-3)=='lua'then
|
||||
-- Load background files from SOURCE ONLY
|
||||
for _,v in next,fs.getDirectoryItems('parts/backgrounds') do
|
||||
if FILE.isSafe('parts/backgrounds/'..v) and v:sub(-3)=='lua' then
|
||||
local name=v:sub(1,-5)
|
||||
BG.add(name,require('parts.backgrounds.'..name))
|
||||
end
|
||||
end
|
||||
BG.remList('none')BG.remList('gray')BG.remList('custom')
|
||||
--Load scene files from SOURCE ONLY
|
||||
for _,v in next,fs.getDirectoryItems('parts/scenes')do
|
||||
if isSafeFile('parts/scenes/'..v)then
|
||||
-- Load scene files from SOURCE ONLY
|
||||
for _,v in next,fs.getDirectoryItems('parts/scenes') do
|
||||
if FILE.isSafe('parts/scenes/'..v) then
|
||||
local sceneName=v:sub(1,-5)
|
||||
SCN.add(sceneName,require('parts.scenes.'..sceneName))
|
||||
LANG.addScene(sceneName)
|
||||
end
|
||||
end
|
||||
--Load mode files
|
||||
-- Load mode files
|
||||
for i=1,#MODES do
|
||||
local m=MODES[i]--Mode template
|
||||
if isSafeFile('parts/modes/'..m.name)then
|
||||
local m=MODES[i]-- Mode template
|
||||
if FILE.isSafe('parts/modes/'..m.name) then
|
||||
TABLE.complete(require('parts.modes.'..m.name),MODES[i])
|
||||
MODES[m.name],MODES[i]=MODES[i]
|
||||
end
|
||||
end
|
||||
for _,v in next,fs.getDirectoryItems('parts/modes')do
|
||||
if isSafeFile('parts/modes/'..v)and not MODES[v:sub(1,-5)]then
|
||||
for _,v in next,fs.getDirectoryItems('parts/modes') do
|
||||
if FILE.isSafe('parts/modes/'..v) and not MODES[v:sub(1,-5)] then
|
||||
local M={name=v:sub(1,-5)}
|
||||
local modeData=require('parts.modes.'..M.name)
|
||||
if modeData.env then
|
||||
@@ -447,14 +460,14 @@ end
|
||||
|
||||
table.insert(_LOADTIMELIST_,("Load Files: %.3fs"):format(TIME()-_LOADTIME_))
|
||||
|
||||
--Update data
|
||||
-- Update data
|
||||
do
|
||||
local needSave
|
||||
|
||||
if not fs.getInfo('conf/data')then
|
||||
if not fs.getInfo('conf/data') then
|
||||
needSave=true
|
||||
end
|
||||
if type(STAT.version)~='number'then
|
||||
if type(STAT.version)~='number' then
|
||||
STAT.version=0
|
||||
needSave=true
|
||||
end
|
||||
@@ -467,10 +480,10 @@ do
|
||||
end
|
||||
if STAT.version==1506 then
|
||||
local temp1,temp2
|
||||
if fs.getInfo('record/master_l.rec')then
|
||||
if fs.getInfo('record/master_l.rec') then
|
||||
temp1=fs.read('record/master_l.rec')
|
||||
end
|
||||
if fs.getInfo('record/master_u.rec')then
|
||||
if fs.getInfo('record/master_u.rec') then
|
||||
temp2=fs.read('record/master_u.rec')
|
||||
end
|
||||
if temp1 then
|
||||
@@ -530,16 +543,16 @@ do
|
||||
end
|
||||
if STAT.version~=VERSION.code then
|
||||
for k,v in next,MODE_UPDATE_MAP do
|
||||
if RANKS[k]then
|
||||
if RANKS[k] then
|
||||
RANKS[v]=RANKS[k]
|
||||
RANKS[k]=nil
|
||||
end
|
||||
k='record/'..k
|
||||
if fs.getInfo(k..'.dat')then
|
||||
if fs.getInfo(k..'.dat') then
|
||||
fs.write('record/'..v..'.rec',fs.read(k..'.dat'))
|
||||
fs.remove(k..'.dat')
|
||||
end
|
||||
if fs.getInfo(k..'.rec')then
|
||||
if fs.getInfo(k..'.rec') then
|
||||
fs.write('record/'..v..'.rec',fs.read(k..'.rec'))
|
||||
fs.remove(k..'.rec')
|
||||
end
|
||||
@@ -547,18 +560,19 @@ do
|
||||
STAT.version=VERSION.code
|
||||
needSave=true
|
||||
end
|
||||
SETTING.appLock,SETTING.dataSaving,SETTING.swap=nil
|
||||
SETTING.appLock,SETTING.dataSaving,SETTING.swap,SETTING.autoLogin=nil
|
||||
if not SETTING.VKSkin then SETTING.VKSkin=1 end
|
||||
for _,v in next,SETTING.skin do if v<1 or v>17 then v=17 end end
|
||||
if not RSlist[SETTING.RS]then SETTING.RS='TRS'end
|
||||
if SETTING.ghostType=='greyCell'then SETTING.ghostType='grayCell'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 RSlist[SETTING.RS] then SETTING.RS='TRS' end
|
||||
if SETTING.ghostType=='greyCell' then SETTING.ghostType='grayCell' 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 SETTING.cv then SETTING.vocPack,SETTING.cv=SETTING.cv end
|
||||
if type(SETTING.bg)~='string'then SETTING.bg='on'end
|
||||
if type(SETTING.bg)~='string' then SETTING.bg='on' end
|
||||
if SETTING.skin[18]==10 then SETTING.skin[18]=4 end
|
||||
if SETTING.reTime>3 or SETTING.reTime<.5 then SETTING.reTime=2 end
|
||||
if SETTING.locale=='zh_full' then SETTING.locale='zh' end
|
||||
if SETTING.vocPack=='rin' then SETTING.vocPack='miku' end
|
||||
if RANKS.infinite then RANKS.infinite=0 end
|
||||
if RANKS.infinite_dig then RANKS.infinite_dig=0 end
|
||||
if not RANKS.sprint_10l then RANKS.sprint_10l=0 end
|
||||
@@ -566,26 +580,26 @@ do
|
||||
if RANKS.master_u then RANKS.master_h,RANKS.master_u=RANKS.master_u needSave=true end
|
||||
for _,v in next,VK_ORG do v.color=nil end
|
||||
for name,rank in next,RANKS do
|
||||
if type(name)=='number'or type(rank)~='number'then
|
||||
if type(name)=='number' or type(rank)~='number' then
|
||||
RANKS[name]=nil
|
||||
needSave=true
|
||||
else
|
||||
local M=MODES[name]
|
||||
if M and M.unlock and rank>0 then
|
||||
for _,unlockName in next,M.unlock do
|
||||
if not RANKS[unlockName]then
|
||||
if not RANKS[unlockName] then
|
||||
RANKS[unlockName]=0
|
||||
needSave=true
|
||||
end
|
||||
end
|
||||
end
|
||||
if not(M and M.x)then
|
||||
if not (M and M.x) then
|
||||
RANKS[name]=nil
|
||||
needSave=true
|
||||
end
|
||||
end
|
||||
end
|
||||
if not MODES[STAT.lastPlay]then
|
||||
if not MODES[STAT.lastPlay] then
|
||||
STAT.lastPlay='sprint_10l'
|
||||
needSave=true
|
||||
end
|
||||
@@ -598,7 +612,7 @@ do
|
||||
end
|
||||
end
|
||||
|
||||
--First start
|
||||
-- First start
|
||||
FIRSTLAUNCH=STAT.run==0
|
||||
if FIRSTLAUNCH and MOBILE then
|
||||
SETTING.VKSwitch=true
|
||||
@@ -606,18 +620,18 @@ if FIRSTLAUNCH and MOBILE then
|
||||
SETTING.cleanCanvas=true
|
||||
end
|
||||
|
||||
--Apply system setting
|
||||
-- Apply system setting
|
||||
applySettings()
|
||||
|
||||
--Load replays
|
||||
for _,fileName in next,fs.getDirectoryItems('replay')do
|
||||
if fileName:sub(12,12):match("[a-zA-Z]")then
|
||||
-- Load replays
|
||||
for _,fileName in next,fs.getDirectoryItems('replay') do
|
||||
if fileName:sub(12,12):match("[a-zA-Z]") then
|
||||
local date,mode,version,player,seed,setting,mod
|
||||
local fileData=fs.read('replay/'..fileName)
|
||||
date, fileData=STRING.readLine(fileData)date=date:gsub("[a-zA-Z]","")
|
||||
mode, fileData=STRING.readLine(fileData)mode=MODE_UPDATE_MAP[mode]or mode
|
||||
mode, fileData=STRING.readLine(fileData)mode=MODE_UPDATE_MAP[mode] or mode
|
||||
version,fileData=STRING.readLine(fileData)
|
||||
player, fileData=STRING.readLine(fileData)if player=="Local Player"then player="Stacker"end
|
||||
player, fileData=STRING.readLine(fileData) if player=="Local Player" then player="Stacker" end
|
||||
local success
|
||||
success,fileData=pcall(love.data.decompress,'string','zlib',fileData)
|
||||
if not success then goto BREAK_cannotParse end
|
||||
@@ -653,16 +667,16 @@ for _,fileName in next,fs.getDirectoryItems('replay')do
|
||||
local rep=DATA.parseReplay('replay/'..fileName)
|
||||
table.insert(REPLAY,rep)
|
||||
end
|
||||
table.sort(REPLAY,function(a,b)return a.fileName>b.fileName end)
|
||||
table.sort(REPLAY,function(a,b) return a.fileName>b.fileName end)
|
||||
|
||||
table.insert(_LOADTIMELIST_,("Initialize Data: %.3fs"):format(TIME()-_LOADTIME_))
|
||||
|
||||
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
|
||||
-- Launch testing task if launch param received
|
||||
if TABLE.find(arg,'-- test') then
|
||||
TASK.new(function()
|
||||
while not LOADED do YIELD()end
|
||||
while not LOADED do coroutine.yield() end
|
||||
|
||||
LOG("\27[92m\27[1mAutomatic Test Started\27[0m")
|
||||
BGM.setVol(0)SFX.setVol(0)
|
||||
@@ -670,7 +684,7 @@ if TABLE.find(arg,'--test')then
|
||||
TEST.yieldUntilNextScene()
|
||||
|
||||
for k,mode in next,MODES do
|
||||
if k~='netBattle'then
|
||||
if k~='netBattle' then
|
||||
LOG("Scanning mode: "..mode.name)
|
||||
loadGame(mode.name,true)
|
||||
TEST.yieldUntilNextScene()
|
||||
@@ -684,12 +698,14 @@ if TABLE.find(arg,'--test')then
|
||||
end)
|
||||
TASK.new(function()
|
||||
while true do
|
||||
YIELD()
|
||||
if Z.getErr(1)then break end
|
||||
coroutine.yield()
|
||||
if Z.getErr(1) then break end
|
||||
end
|
||||
LOG("\27[91m\27[1mAutomatic Test Failed :(\27[0m\nThe error message is:\n"..table.concat(Z.getErr(1).mes,"\n").."\27[91m\nAborting\27[0m")
|
||||
TEST.yieldN(60)
|
||||
love.event.quit(1)
|
||||
end)
|
||||
end
|
||||
WS.switchHost('101.43.110.22','10026','/tech/socket/v1')
|
||||
WS.switchHost('cafuuchino1.3322.org','10026','/techmino/ws/v1')
|
||||
HTTP.setHost("cafuuchino1.3322.org:10026")
|
||||
HTTP.setThreadCount(1)
|
||||
|
||||
BIN
media/music/antispace.ogg
Normal file
BIN
media/music/antispace.ogg
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
486
parts/RSlist.lua
486
parts/RSlist.lua
@@ -1,43 +1,43 @@
|
||||
local defaultCenterTex=GC.DO{1,1}--No texture
|
||||
local defaultCenterPos={--For SRS-like RSs
|
||||
--Tetromino
|
||||
{[0]={0,1},{1,0},{1,1},{1,1}},--Z
|
||||
{[0]={0,1},{1,0},{1,1},{1,1}},--S
|
||||
{[0]={0,1},{1,0},{1,1},{1,1}},--J
|
||||
{[0]={0,1},{1,0},{1,1},{1,1}},--L
|
||||
{[0]={0,1},{1,0},{1,1},{1,1}},--T
|
||||
{[0]={.5,.5},{.5,.5},{.5,.5},{.5,.5}},--O
|
||||
{[0]={-.5,1.5},{1.5,-.5},{.5,1.5},{1.5,.5}},--I
|
||||
local defaultCenterTex=GC.DO{1,1}-- No texture
|
||||
local defaultCenterPos={-- For SRS-like RSs
|
||||
-- Tetromino
|
||||
{[0]={0,1},{1,0},{1,1},{1,1}},-- Z
|
||||
{[0]={0,1},{1,0},{1,1},{1,1}},-- S
|
||||
{[0]={0,1},{1,0},{1,1},{1,1}},-- J
|
||||
{[0]={0,1},{1,0},{1,1},{1,1}},-- L
|
||||
{[0]={0,1},{1,0},{1,1},{1,1}},-- T
|
||||
{[0]={.5,.5},{.5,.5},{.5,.5},{.5,.5}},-- O
|
||||
{[0]={-.5,1.5},{1.5,-.5},{.5,1.5},{1.5,.5}},-- I
|
||||
|
||||
--Pentomino
|
||||
{[0]={1,1},{1,1},{1,1},{1,1}},--Z5
|
||||
{[0]={1,1},{1,1},{1,1},{1,1}},--S5
|
||||
{[0]={0,1},{1,0},{1,1},{1,1}},--P
|
||||
{[0]={0,1},{1,0},{1,1},{1,1}},--Q
|
||||
{[0]={1,1},{1,1},{1,1},{1,1}},--F
|
||||
{[0]={1,1},{1,1},{1,1},{1,1}},--E
|
||||
{[0]={1,1},{1,1},{1,1},{1,1}},--T5
|
||||
{[0]={0,1},{1,0},{1,1},{1,1}},--U
|
||||
{[0]={.5,1.5},{.5,.5},{1.5,.5},{1.5,1.5}},--V
|
||||
{[0]={1,1},{1,1},{1,1},{1,1}},--W
|
||||
{[0]={1,1},{1,1},{1,1},{1,1}},--X
|
||||
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},--J5
|
||||
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},--L5
|
||||
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},--R
|
||||
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},--Y
|
||||
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},--N
|
||||
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},--H
|
||||
{[0]={0,2},{2,0},{0,2},{2,0}},--I5
|
||||
-- Pentomino
|
||||
{[0]={1,1},{1,1},{1,1},{1,1}},-- Z5
|
||||
{[0]={1,1},{1,1},{1,1},{1,1}},-- S5
|
||||
{[0]={0,1},{1,0},{1,1},{1,1}},-- P
|
||||
{[0]={0,1},{1,0},{1,1},{1,1}},-- Q
|
||||
{[0]={1,1},{1,1},{1,1},{1,1}},-- F
|
||||
{[0]={1,1},{1,1},{1,1},{1,1}},-- E
|
||||
{[0]={1,1},{1,1},{1,1},{1,1}},-- T5
|
||||
{[0]={0,1},{1,0},{1,1},{1,1}},-- U
|
||||
{[0]={.5,1.5},{.5,.5},{1.5,.5},{1.5,1.5}},-- V
|
||||
{[0]={1,1},{1,1},{1,1},{1,1}},-- W
|
||||
{[0]={1,1},{1,1},{1,1},{1,1}},-- X
|
||||
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},-- J5
|
||||
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},-- L5
|
||||
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},-- R
|
||||
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},-- Y
|
||||
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},-- N
|
||||
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},-- H
|
||||
{[0]={0,2},{2,0},{0,2},{2,0}},-- I5
|
||||
|
||||
--Trimino
|
||||
{[0]={0,1},{1,0},{0,1},{1,0}},--I3
|
||||
{[0]={.5,.5},{.5,.5},{.5,.5},{.5,.5}},--C
|
||||
-- Trimino
|
||||
{[0]={0,1},{1,0},{0,1},{1,0}},-- I3
|
||||
{[0]={.5,.5},{.5,.5},{.5,.5},{.5,.5}},-- C
|
||||
|
||||
--Domino
|
||||
{[0]={-.5,.5},{.5,-.5},{.5,.5},{.5,.5}},--I2
|
||||
-- Domino
|
||||
{[0]={-.5,.5},{.5,-.5},{.5,.5},{.5,.5}},-- I2
|
||||
|
||||
--Dot
|
||||
{[0]={0,0},{0,0},{0,0},{0,0}},--O1
|
||||
-- Dot
|
||||
{[0]={0,0},{0,0},{0,0},{0,0}},-- O1
|
||||
}
|
||||
|
||||
local noKickSet,noKickSet_180 do
|
||||
@@ -52,14 +52,14 @@ local function _strToVec(list)
|
||||
return list
|
||||
end
|
||||
|
||||
--Use this if the block is centrosymmetry, *PTR!!!
|
||||
-- Use this if the block is centrosymmetry, *PTR!!!
|
||||
local function _centroSymSet(L)
|
||||
L[23]=L[01]L[32]=L[10]
|
||||
L[21]=L[03]L[12]=L[30]
|
||||
L[20]=L[02]L[31]=L[13]
|
||||
end
|
||||
|
||||
--Use this to copy a symmetry set
|
||||
-- Use this to copy a symmetry set
|
||||
local function _flipList(O)
|
||||
if not O then
|
||||
return
|
||||
@@ -72,7 +72,7 @@ local function _flipList(O)
|
||||
end
|
||||
|
||||
local function _reflect(a)
|
||||
return{
|
||||
return {
|
||||
[03]=_flipList(a[01]),
|
||||
[01]=_flipList(a[03]),
|
||||
[30]=_flipList(a[10]),
|
||||
@@ -91,21 +91,21 @@ end
|
||||
local TRS
|
||||
do
|
||||
local OspinList={
|
||||
{111,5,2, 0,-1,0},{111,5,2,-1,-1,0},{111,5,0,-1, 0,0},--T
|
||||
{333,5,2,-1,-1,0},{333,5,2, 0,-1,0},{333,5,0, 0, 0,0},--T
|
||||
{313,1,2,-1, 0,0},{313,1,2, 0,-1,0},{313,1,2, 0, 0,0},--Z
|
||||
{131,2,2, 0, 0,0},{131,2,2,-1,-1,0},{131,2,2,-1, 0,0},--S
|
||||
{131,1,2,-1, 0,0},{131,1,2, 0,-1,0},{131,1,2, 0, 0,0},--Z(misOrder)
|
||||
{313,2,2, 0, 0,0},{313,2,2,-1,-1,0},{313,2,2,-1, 0,0},--S(misOrder)
|
||||
{331,3,2, 0,-1,0},--J(farDown)
|
||||
{113,4,2,-1,-1,0},--L(farDown)
|
||||
{113,3,2,-1,-1,0},{113,3,0, 0, 0,0},--J
|
||||
{331,4,2, 0,-1,0},{331,4,0,-1, 0,0},--L
|
||||
{222,7,0,-1, 1,1},{222,7,0,-2, 1,1},{222,7,0, 0, 1,1},--I(high)
|
||||
{222,7,2,-1, 0,2},{222,7,2,-2, 0,2},{222,7,2, 0, 0,2},--I(low)
|
||||
{121,6,0, 1,-1,2},{112,6,0, 2,-1,2},{122,6,0, 1,-2,2},--O
|
||||
{323,6,0,-1,-1,2},{332,6,0,-2,-1,2},{322,6,0,-1,-2,2},--O
|
||||
}--{keys, ID, dir, dx, dy, freeLevel (0=immovable, 1=U/D-immovable, 2=free)}
|
||||
{111,5,2, 0,-1,0},{111,5,2,-1,-1,0},{111,5,0,-1, 0,0},-- T
|
||||
{333,5,2,-1,-1,0},{333,5,2, 0,-1,0},{333,5,0, 0, 0,0},-- T
|
||||
{313,1,2,-1, 0,0},{313,1,2, 0,-1,0},{313,1,2, 0, 0,0},-- Z
|
||||
{131,2,2, 0, 0,0},{131,2,2,-1,-1,0},{131,2,2,-1, 0,0},-- S
|
||||
{131,1,2,-1, 0,0},{131,1,2, 0,-1,0},{131,1,2, 0, 0,0},-- Z(misOrder)
|
||||
{313,2,2, 0, 0,0},{313,2,2,-1,-1,0},{313,2,2,-1, 0,0},-- S(misOrder)
|
||||
{331,3,2, 0,-1,0},-- J(farDown)
|
||||
{113,4,2,-1,-1,0},-- L(farDown)
|
||||
{113,3,2,-1,-1,0},{113,3,0, 0, 0,0},-- J
|
||||
{331,4,2, 0,-1,0},{331,4,0,-1, 0,0},-- L
|
||||
{222,7,0,-1, 1,1},{222,7,0,-2, 1,1},{222,7,0, 0, 1,1},-- I(high)
|
||||
{222,7,2,-1, 0,2},{222,7,2,-2, 0,2},{222,7,2, 0, 0,2},-- I(low)
|
||||
{121,6,0, 1,-1,2},{112,6,0, 2,-1,2},{122,6,0, 1,-2,2},-- O
|
||||
{323,6,0,-1,-1,2},{332,6,0,-2,-1,2},{322,6,0,-1,-2,2},-- O
|
||||
}-- {keys, ID, dir, dx, dy, freeLevel (0=immovable, 1=U/D-immovable, 2=free)}
|
||||
local XspinList={
|
||||
{{ 1,-1},{ 1, 0},{ 1, 1},{ 1,-2},{ 1, 2}},
|
||||
{{ 0,-1},{ 0,-2},{ 0, 1},{ 0,-2},{ 0, 2}},
|
||||
@@ -137,8 +137,8 @@ do
|
||||
[20]={'+0+0','-1+0','+1+0','+0+1','+0-1'},
|
||||
[13]={'+0+0','+0-1','+0+1','+0-2'},
|
||||
[31]={'+0+0','+0+1','+0-1','+0+2'},
|
||||
},--Z
|
||||
false,--S
|
||||
},-- Z
|
||||
false,-- S
|
||||
{
|
||||
[01]={'+0+0','-1+0','-1+1','+0-2','+1+1','+0+1','+0-1'},
|
||||
[10]={'+0+0','+1+0','+1-1','+0+2','-1-1','+0-1','+0+1'},
|
||||
@@ -152,22 +152,22 @@ do
|
||||
[20]={'+0+0','+1+0','-1+0','+0+1','+0-1'},
|
||||
[13]={'+0+0','+0-1','+0+1','+1+0'},
|
||||
[31]={'+0+0','+0+1','+0-1','-1+0'},
|
||||
},--J
|
||||
false,--L
|
||||
},-- J
|
||||
false,-- L
|
||||
{
|
||||
[01]={'+0+0','-1+0','-1+1','+0-2','-1-2','+0+1'},
|
||||
[10]={'+0+0','+1+0','+1-1','+0+2','+1+2','+0+1','+0-1'},
|
||||
[03]={'+0+0','+1+0','+1+1','+0-2','+1-2','+0+1'},
|
||||
[30]={'+0+0','-1+0','-1-1','+0+2','-1+2','+0+1','+0-1'},
|
||||
[12]={'+0+0','+1+0','+1-1','+0-1','-1-1','+0+2','+1+2','+1+1'},
|
||||
[21]={'+0+0','-1+0','+0-2','-1-2','-1-1','+1+1'},
|
||||
[21]={'+0+0','-1+0','+0-2','-1-2','-1-1','+0-1','+1+1'},
|
||||
[32]={'+0+0','-1+0','-1-1','+0-1','+1-1','+0+2','-1+2','-1+1'},
|
||||
[23]={'+0+0','+1+0','+0-2','+1-2','+1-1','-1+1'},
|
||||
[23]={'+0+0','+1+0','+0-2','+1-2','+1-1','+0-1','-1+1'},
|
||||
[02]={'+0+0','-1+0','+1+0','+0+1'},
|
||||
[20]={'+0+0','+1+0','-1+0','+0-1'},
|
||||
[13]={'+0+0','+0-1','+0+1','+1+0','+0-2','+0+2'},
|
||||
[31]={'+0+0','+0-1','+0+1','-1+0','+0-2','+0+2'},
|
||||
},--T
|
||||
},-- T
|
||||
function(P,d)
|
||||
if P.gameEnv.easyFresh then
|
||||
P:freshBlock('fresh')
|
||||
@@ -175,7 +175,7 @@ do
|
||||
if P.gameEnv.ospin then
|
||||
local x,y=P.curX,P.curY
|
||||
local C=P.cur
|
||||
if y==P.ghoY and((P:solid(x-1,y)or P:solid(x-1,y+1)))and(P:solid(x+2,y)or P:solid(x+2,y+1))then
|
||||
if y==P.ghoY and ((P:solid(x-1,y) or P:solid(x-1,y+1))) and (P:solid(x+2,y) or P:solid(x+2,y+1)) then
|
||||
if P.sound then
|
||||
SFX.play('rotatekick',nil,P:getCenterX()*.15)
|
||||
end
|
||||
@@ -186,15 +186,15 @@ do
|
||||
return end
|
||||
for i=1,#OspinList do
|
||||
local L=OspinList[i]
|
||||
if C.spinSeq==L[1]then
|
||||
if C.spinSeq==L[1] then
|
||||
local id,dir=L[2],L[3]
|
||||
local bk=BLOCKS[id][dir]
|
||||
x,y=P.curX+L[4],P.curY+L[5]
|
||||
if
|
||||
not P:ifoverlap(bk,x,y)and(
|
||||
L[6]>0 or(P:ifoverlap(bk,x-1,y)and P:ifoverlap(bk,x+1,y))
|
||||
)and(
|
||||
L[6]==2 or(P:ifoverlap(bk,x,y-1)and P:ifoverlap(bk,x,y+1))
|
||||
not P:ifoverlap(bk,x,y) and (
|
||||
L[6]>0 or (P:ifoverlap(bk,x-1,y) and P:ifoverlap(bk,x+1,y))
|
||||
) and (
|
||||
L[6]==2 or (P:ifoverlap(bk,x,y-1) and P:ifoverlap(bk,x,y+1))
|
||||
)
|
||||
then
|
||||
C.id=id
|
||||
@@ -220,7 +220,7 @@ do
|
||||
SFX.play('rotate',nil,P:getCenterX()*.15)
|
||||
end
|
||||
end
|
||||
end,--O
|
||||
end,-- O
|
||||
{
|
||||
[01]={'+0+0','+0+1','+1+0','-2+0','-2-1','+1+2'},
|
||||
[10]={'+0+0','+2+0','-1+0','-1-2','+2+1','+0+1'},
|
||||
@@ -234,14 +234,14 @@ do
|
||||
[20]={'+0+0','+1+0','-1+0','+0+1','+0-1'},
|
||||
[13]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
|
||||
[31]={'+0+0','+0-1','+1+0','-1+0','+0+1'},
|
||||
},--I
|
||||
},-- I
|
||||
{
|
||||
[01]={'+0+0','+0+1','+1+1','-1+0','+0-3','+0+2','+0-2','+0+3','-1+2'},
|
||||
[10]={'+0+0','+0-1','-1-1','+1+0','+0-3','+0+2','+0-2','+0+3','+1-2'},
|
||||
[03]={'+0+0','+1+0','+0-3','+0-1','+0+1','+0-2','+0+2','+0+3','+1+2'},
|
||||
[30]={'+0+0','-1+0','+0-1','+0+1','+0-2','+0-3','+0+2','+0+3','-1-2'},
|
||||
},--Z5
|
||||
false,--S5
|
||||
},-- Z5
|
||||
false,-- S5
|
||||
{
|
||||
[01]={'+0+0','-1+0','-1+1','+0-2','-1-2','-1-1','+0+1'},
|
||||
[10]={'+0+0','+1+0','+1-1','+0+2','+1+2','+0-1','+1+1'},
|
||||
@@ -255,8 +255,8 @@ do
|
||||
[20]={'+0+0','+1+0','+0+1','+0-1'},
|
||||
[13]={'+0+0','+1+0','+0+1','-1+0'},
|
||||
[31]={'+0+0','-1+0','+0-1','+1+0'},
|
||||
},--P
|
||||
false,--Q
|
||||
},-- P
|
||||
false,-- Q
|
||||
{
|
||||
[01]={'+0+0','-1+0','+1+0','-1+1','+0-2','+0-3'},
|
||||
[10]={'+0+0','+1+0','+1-1','-1+0','+0+2','+0+3'},
|
||||
@@ -270,8 +270,8 @@ do
|
||||
[20]={'+0+0','-1+0','+1+0','+1+1'},
|
||||
[13]={'+0+0','+0-1','-1+1','+0+1'},
|
||||
[31]={'+0+0','+0-1','+1-1','+0+1'},
|
||||
},--F
|
||||
false,--E
|
||||
},-- F
|
||||
false,-- E
|
||||
{
|
||||
[01]={'+0+0','+0-1','-1-1','+1+0','+1+1','+0-3','-1+0','+0+2','-1+2'},
|
||||
[10]={'+0+0','+1+0','+0-1','-1-1','+0-2','-1+1','+0-3','+1-2','+0+1'},
|
||||
@@ -285,7 +285,7 @@ do
|
||||
[20]={'+0+0','+0-1','+0+1','+0-2'},
|
||||
[13]={'+0+0','+1+0','-1+1','-2+0'},
|
||||
[31]={'+0+0','-1+0','+1+1','+2+0'},
|
||||
},--T5
|
||||
},-- T5
|
||||
{
|
||||
[01]={'+0+0','-1+0','-1+1','+0-2','-1-2'},
|
||||
[10]={'+0+0','+1+0','+1-1','+0+2','+1+2'},
|
||||
@@ -299,7 +299,7 @@ do
|
||||
[20]={'+0+0','+0-1'},
|
||||
[13]={'+0+0','+0-1','+0+1','+1+0'},
|
||||
[31]={'+0+0','+0-1','+0+1','-1+0'},
|
||||
},--U
|
||||
},-- U
|
||||
{
|
||||
[01]={'+0+0','+0+1','-1+0','+0-2','-1-2'},
|
||||
[10]={'+0+0','+0+1','+1+0','+0-2','+1-2'},
|
||||
@@ -313,7 +313,7 @@ do
|
||||
[20]={'+0+0','+1-1','-1+1'},
|
||||
[13]={'+0+0','+1+1','-1-1'},
|
||||
[31]={'+0+0','-1-1','+1+1'},
|
||||
},--V
|
||||
},-- V
|
||||
{
|
||||
[01]={'+0+0','+0-1','-1+0','+1+0','+1-1','+0+2'},
|
||||
[10]={'+0+0','+0-1','-1-1','+0+1','+0-2','+1-2','+0+2'},
|
||||
@@ -327,15 +327,15 @@ do
|
||||
[20]={'+0+0','+0+1','+1+0'},
|
||||
[13]={'+0+0','+0+1','-1+0'},
|
||||
[31]={'+0+0','+0-1','+1+0'},
|
||||
},--W
|
||||
},-- W
|
||||
function(P,d)
|
||||
if P.type=='human'then
|
||||
if P.type=='human' then
|
||||
SFX.play('rotate',nil,P:getCenterX()*.15)
|
||||
end
|
||||
local kickData=XspinList[d]
|
||||
for test=1,#kickData do
|
||||
local x,y=P.curX+kickData[test][1],P.curY+kickData[test][2]
|
||||
if not P:ifoverlap(P.cur.bk,x,y)then
|
||||
if not P:ifoverlap(P.cur.bk,x,y) then
|
||||
P.curX,P.curY=x,y
|
||||
P.spinLast=1
|
||||
P:freshBlock('move')
|
||||
@@ -344,7 +344,7 @@ do
|
||||
end
|
||||
end
|
||||
P:freshBlock('fresh')
|
||||
end,--X
|
||||
end,-- X
|
||||
{
|
||||
[01]={'+0+0','-1+0','-1+1','+0-3','-1+1','-1+2','+0+1'},
|
||||
[10]={'+0+0','-1+0','+1-1','+0+3','+1-1','+1-2','+0+1'},
|
||||
@@ -358,8 +358,8 @@ do
|
||||
[20]={'+0+0','+0+1','+1+1','-1+1','+1+0','-2+1'},
|
||||
[13]={'+0+0','-1+0','-1-1','+0+1','-1-2'},
|
||||
[31]={'+0+0','+1+0','+1+1','+0-1','+1+2'},
|
||||
},--J5
|
||||
false,--L5
|
||||
},-- J5
|
||||
false,-- L5
|
||||
{
|
||||
[01]={'+0+0','-1+0','-1+1','+1+0','-1+2','-1-1','+0-3','+0+1'},
|
||||
[10]={'+0+0','-1+0','+1+0','+1-1','+1-2','+1+1','+0+3','+0+1'},
|
||||
@@ -373,8 +373,8 @@ do
|
||||
[20]={'+0+0','+0+1','-1+1','+1+0','-2+1','+0-1'},
|
||||
[13]={'+0+0','-1+0','-1-1','+0+1','-1-2'},
|
||||
[31]={'+0+0','+1+0','+1+1','+0-1','+1+2'},
|
||||
},--R
|
||||
false,--Y
|
||||
},-- R
|
||||
false,-- Y
|
||||
{
|
||||
[01]={'+0+0','-1+0','-1+1','+0+1','+1+0','+1+1','-1+2','-2+0','+0-2'},
|
||||
[10]={'+0+0','+1+0','-1+0','+0-1','-1-1','+1-1','+1-2','+2+0','+0+2'},
|
||||
@@ -388,20 +388,20 @@ do
|
||||
[20]={'+0+0','+1+0','+0-2','+0+1'},
|
||||
[13]={'+0+0','-1+0','-1-1','+0+1','+1+2'},
|
||||
[31]={'+0+0','+1+0','+1+1','+0-1','-1-2'},
|
||||
},--N
|
||||
false,--H
|
||||
},-- N
|
||||
false,-- H
|
||||
{
|
||||
[01]={'+0+0','+1-1','+1+0','+1+1','+0+1','-1+1','-1+0','-1-1','+0-1','+0-2','-2-1','-2-2','+2+0','+2-1','+2-2','+1+2','+2+2','-1+2','-2+2'},
|
||||
[10]={'+0+0','-1+0','-1-1','+0-1','+1-1','-2-2','-2-1','-2+0','-1-2','+0-2','+1-2','+2-2','-1+1','-2+1','-2+2','+1+0','+2+0','+2-1','+0+1','+1-1','+2-2'},
|
||||
[03]={'+0+0','-1-1','-1+0','-1+1','-0+1','+1+1','+1+0','+1-1','-0-1','-0-2','+2-1','+2-2','-2+0','-2-1','-2-2','-1+2','-2+2','+1+2','+2+2'},
|
||||
[30]={'+0+0','+1+0','+1-1','-0-1','-1-1','+2-2','+2-1','+2+0','+1-2','-0-2','-1-2','-2-2','+1+1','+2+1','+2+2','-1+0','-2+0','-2-1','+0+1','-1-1','-2-2'},
|
||||
},--I5
|
||||
[03]={'+0+0','-1-1','-1+0','-1+1','+0+1','+1+1','+1+0','+1-1','+0-1','+0-2','+2-1','+2-2','-2+0','-2-1','-2-2','-1+2','-2+2','+1+2','+2+2'},
|
||||
[30]={'+0+0','+1+0','+1-1','+0-1','-1-1','+2-2','+2-1','+2+0','+1-2','+0-2','-1-2','-2-2','+1+1','+2+1','+2+2','-1+0','-2+0','-2-1','+0+1','-1-1','-2-2'},
|
||||
},-- I5
|
||||
{
|
||||
[01]={'+0+0','-1+0','-1-1','+1+1','-1+1'},
|
||||
[10]={'+0+0','-1+0','+1+0','-1-1','+1+1'},
|
||||
[03]={'+0+0','+1+0','+1-1','-1+1','+1+1'},
|
||||
[30]={'+0+0','+1+0','-1+0','+1-1','-1+1'},
|
||||
},--I3
|
||||
},-- I3
|
||||
{
|
||||
[01]={'+0+0','-1+0','+1+0'},
|
||||
[10]={'+0+0','+1+0','-1+0'},
|
||||
@@ -415,7 +415,7 @@ do
|
||||
[20]={'+0+0','+0+1','-1+1','+1+1'},
|
||||
[13]={'+0+0','+0-1','-1-1','+1-1'},
|
||||
[31]={'+0+0','+0+1','+1+1','-1+1'},
|
||||
},--C
|
||||
},-- C
|
||||
{
|
||||
[01]={'+0+0','-1+0','+0+1'},
|
||||
[10]={'+0+0','+1+0','+0+1'},
|
||||
@@ -429,22 +429,22 @@ do
|
||||
[20]={'+0+0','+0+1','+0-1'},
|
||||
[13]={'+0+0','-1+0','+1+0'},
|
||||
[31]={'+0+0','+1+0','-1+0'},
|
||||
},--I2
|
||||
nil,--O1
|
||||
},-- I2
|
||||
nil,-- O1
|
||||
}
|
||||
}
|
||||
TRS.centerDisp[6]=false
|
||||
TRS.centerDisp[18]=false
|
||||
TRS.kickTable[2]= _reflect(TRS.kickTable[1])--SZ
|
||||
TRS.kickTable[4]= _reflect(TRS.kickTable[3])--LJ
|
||||
TRS.kickTable[9]= _reflect(TRS.kickTable[8])--S5Z5
|
||||
TRS.kickTable[11]=_reflect(TRS.kickTable[10])--PQ
|
||||
TRS.kickTable[13]=_reflect(TRS.kickTable[12])--FE
|
||||
TRS.kickTable[20]=_reflect(TRS.kickTable[19])--L5J5
|
||||
TRS.kickTable[22]=_reflect(TRS.kickTable[21])--RY
|
||||
TRS.kickTable[24]=_reflect(TRS.kickTable[23])--NH
|
||||
_centroSymSet(TRS.kickTable[8])_centroSymSet(TRS.kickTable[9])--S5Z5
|
||||
_centroSymSet(TRS.kickTable[25])_centroSymSet(TRS.kickTable[26])--I5I3
|
||||
TRS.kickTable[2]= _reflect(TRS.kickTable[1])-- SZ
|
||||
TRS.kickTable[4]= _reflect(TRS.kickTable[3])-- LJ
|
||||
TRS.kickTable[9]= _reflect(TRS.kickTable[8])-- S5Z5
|
||||
TRS.kickTable[11]=_reflect(TRS.kickTable[10])-- PQ
|
||||
TRS.kickTable[13]=_reflect(TRS.kickTable[12])-- FE
|
||||
TRS.kickTable[20]=_reflect(TRS.kickTable[19])-- L5J5
|
||||
TRS.kickTable[22]=_reflect(TRS.kickTable[21])-- RY
|
||||
TRS.kickTable[24]=_reflect(TRS.kickTable[23])-- NH
|
||||
_centroSymSet(TRS.kickTable[8])_centroSymSet(TRS.kickTable[9])-- S5Z5
|
||||
_centroSymSet(TRS.kickTable[25])_centroSymSet(TRS.kickTable[26])-- I5I3
|
||||
end
|
||||
|
||||
local SRS
|
||||
@@ -469,12 +469,12 @@ do
|
||||
[32]={'+0+0','-1+0','-1-1','+0+2','-1+2'},
|
||||
[23]={'+0+0','+1+0','+1+1','+0-2','+1-2'},
|
||||
[02]={'+0+0'},[20]={'+0+0'},[13]={'+0+0'},[31]={'+0+0'},
|
||||
},--Z
|
||||
false,--S
|
||||
false,--J
|
||||
false,--L
|
||||
false,--T
|
||||
noKickSet,--O
|
||||
},-- Z
|
||||
false,-- S
|
||||
false,-- J
|
||||
false,-- L
|
||||
false,-- T
|
||||
noKickSet,-- O
|
||||
{
|
||||
[01]={'+0+0','-2+0','+1+0','-2-1','+1+2'},
|
||||
[10]={'+0+0','+2+0','-1+0','+2+1','-1-2'},
|
||||
@@ -485,11 +485,11 @@ do
|
||||
[30]={'+0+0','+1+0','-2+0','+1-2','-2+1'},
|
||||
[03]={'+0+0','-1+0','+2+0','-1+2','+2-1'},
|
||||
[02]={'+0+0'},[20]={'+0+0'},[13]={'+0+0'},[31]={'+0+0'},
|
||||
}--I
|
||||
}-- I
|
||||
}
|
||||
}
|
||||
for i=2,5 do SRS.kickTable[i]=SRS.kickTable[1]end
|
||||
for i=8,29 do SRS.kickTable[i]=SRS.kickTable[1]end
|
||||
for i=2,5 do SRS.kickTable[i]=SRS.kickTable[1] end
|
||||
for i=8,29 do SRS.kickTable[i]=SRS.kickTable[1] end
|
||||
end
|
||||
|
||||
local SRS_plus
|
||||
@@ -519,12 +519,12 @@ do
|
||||
[20]={'+0+0','+1+0','-1+0','+0-1','+0+1'},
|
||||
[13]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
|
||||
[31]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
|
||||
},--Z
|
||||
false,--S
|
||||
false,--J
|
||||
false,--L
|
||||
false,--T
|
||||
noKickSet,--O
|
||||
},-- Z
|
||||
false,-- S
|
||||
false,-- J
|
||||
false,-- L
|
||||
false,-- T
|
||||
noKickSet,-- O
|
||||
{
|
||||
[01]={'+0+0','-2+0','+1+0','-2-1','+1+2'},
|
||||
[10]={'+0+0','+2+0','-1+0','+2+1','-1-2'},
|
||||
@@ -538,11 +538,11 @@ do
|
||||
[20]={'+0+0','+1+0','-1+0','+0+1','+0-1'},
|
||||
[13]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
|
||||
[31]={'+0+0','+0-1','+1+0','-1+0','+0+1'},
|
||||
}--I
|
||||
}-- I
|
||||
}
|
||||
}
|
||||
for i=2,5 do SRS_plus.kickTable[i]=SRS_plus.kickTable[1]end
|
||||
for i=8,29 do SRS_plus.kickTable[i]=SRS_plus.kickTable[1]end
|
||||
for i=2,5 do SRS_plus.kickTable[i]=SRS_plus.kickTable[1] end
|
||||
for i=8,29 do SRS_plus.kickTable[i]=SRS_plus.kickTable[1] end
|
||||
end
|
||||
|
||||
local SRS_X
|
||||
@@ -570,19 +570,19 @@ do
|
||||
[20]={'+0+0','+1+0','-1+0','+0-1','+0+1'},
|
||||
[13]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
|
||||
[31]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
|
||||
},--Z
|
||||
false,--S
|
||||
false,--J
|
||||
false,--L
|
||||
false,--T
|
||||
noKickSet,--O
|
||||
false,--I
|
||||
},-- Z
|
||||
false,-- S
|
||||
false,-- J
|
||||
false,-- L
|
||||
false,-- T
|
||||
noKickSet,-- O
|
||||
false,-- I
|
||||
}
|
||||
}
|
||||
for i=2,5 do SRS_X.kickTable[i]=SRS_X.kickTable[1]end
|
||||
for i=7,29 do SRS_X.kickTable[i]=TRS.kickTable[i]end
|
||||
SRS_X.kickTable[10]=SRS_X.kickTable[1]--P
|
||||
SRS_X.kickTable[11]=SRS_X.kickTable[1]--Q
|
||||
for i=2,5 do SRS_X.kickTable[i]=SRS_X.kickTable[1] end
|
||||
for i=7,29 do SRS_X.kickTable[i]=TRS.kickTable[i] end
|
||||
SRS_X.kickTable[10]=SRS_X.kickTable[1]-- P
|
||||
SRS_X.kickTable[11]=SRS_X.kickTable[1]-- Q
|
||||
end
|
||||
|
||||
local BiRS
|
||||
@@ -591,45 +591,45 @@ do
|
||||
local L=_strToVec{'+0+0','+1+0','+1-1','+0-1','+1+1','-1-1','-1+0','+0+1','-1+1','+0+2','+1+2','-1+2','+2+0','-2+0'}
|
||||
local F=_strToVec{'+0+0','+0-1','+0+1','+0+2'}
|
||||
local list={
|
||||
{[02]=L,[20]=R,[13]=R,[31]=L},--Z
|
||||
{[02]=R,[20]=L,[13]=L,[31]=R},--S
|
||||
{[02]=L,[20]=R,[13]=L,[31]=R},--J
|
||||
{[02]=R,[20]=L,[13]=L,[31]=R},--L
|
||||
{[02]=F,[20]=F,[13]=L,[31]=R},--T
|
||||
{[02]=F,[20]=F,[13]=F,[31]=F},--O
|
||||
{[02]=F,[20]=F,[13]=R,[31]=L},--I
|
||||
{[02]=L,[20]=R,[13]=R,[31]=L},-- Z
|
||||
{[02]=R,[20]=L,[13]=L,[31]=R},-- S
|
||||
{[02]=L,[20]=R,[13]=L,[31]=R},-- J
|
||||
{[02]=R,[20]=L,[13]=L,[31]=R},-- L
|
||||
{[02]=F,[20]=F,[13]=L,[31]=R},-- T
|
||||
{[02]=F,[20]=F,[13]=F,[31]=F},-- O
|
||||
{[02]=F,[20]=F,[13]=R,[31]=L},-- I
|
||||
|
||||
{[02]=L,[20]=L,[13]=R,[31]=R},--Z5
|
||||
{[02]=R,[20]=R,[13]=L,[31]=L},--S5
|
||||
{[02]=L,[20]=R,[13]=L,[31]=R},--P
|
||||
{[02]=R,[20]=L,[13]=R,[31]=L},--Q
|
||||
{[02]=R,[20]=L,[13]=L,[31]=R},--F
|
||||
{[02]=L,[20]=R,[13]=R,[31]=L},--E
|
||||
{[02]=F,[20]=F,[13]=L,[31]=R},--T5
|
||||
{[02]=F,[20]=F,[13]=L,[31]=R},--U
|
||||
{[02]=R,[20]=L,[13]=L,[31]=R},--V
|
||||
{[02]=R,[20]=L,[13]=L,[31]=R},--W
|
||||
{[02]=F,[20]=F,[13]=F,[31]=F},--X
|
||||
{[02]=L,[20]=R,[13]=R,[31]=L},--J5
|
||||
{[02]=R,[20]=L,[13]=L,[31]=R},--L5
|
||||
{[02]=L,[20]=R,[13]=R,[31]=L},--R
|
||||
{[02]=R,[20]=L,[13]=L,[31]=R},--Y
|
||||
{[02]=L,[20]=R,[13]=R,[31]=L},--N
|
||||
{[02]=R,[20]=L,[13]=L,[31]=R},--H
|
||||
{[02]=F,[20]=F,[13]=F,[31]=F},--I5
|
||||
{[02]=L,[20]=L,[13]=R,[31]=R},-- Z5
|
||||
{[02]=R,[20]=R,[13]=L,[31]=L},-- S5
|
||||
{[02]=L,[20]=R,[13]=L,[31]=R},-- P
|
||||
{[02]=R,[20]=L,[13]=R,[31]=L},-- Q
|
||||
{[02]=R,[20]=L,[13]=L,[31]=R},-- F
|
||||
{[02]=L,[20]=R,[13]=R,[31]=L},-- E
|
||||
{[02]=F,[20]=F,[13]=L,[31]=R},-- T5
|
||||
{[02]=F,[20]=F,[13]=L,[31]=R},-- U
|
||||
{[02]=R,[20]=L,[13]=L,[31]=R},-- V
|
||||
{[02]=R,[20]=L,[13]=L,[31]=R},-- W
|
||||
{[02]=F,[20]=F,[13]=F,[31]=F},-- X
|
||||
{[02]=L,[20]=R,[13]=R,[31]=L},-- J5
|
||||
{[02]=R,[20]=L,[13]=L,[31]=R},-- L5
|
||||
{[02]=L,[20]=R,[13]=R,[31]=L},-- R
|
||||
{[02]=R,[20]=L,[13]=L,[31]=R},-- Y
|
||||
{[02]=L,[20]=R,[13]=R,[31]=L},-- N
|
||||
{[02]=R,[20]=L,[13]=L,[31]=R},-- H
|
||||
{[02]=F,[20]=F,[13]=F,[31]=F},-- I5
|
||||
|
||||
{[02]=F,[20]=F,[13]=F,[31]=F},--I3
|
||||
{[02]=R,[20]=L,[13]=L,[31]=R},--C
|
||||
{[02]=F,[20]=F,[13]=R,[31]=L},--I2
|
||||
{[02]=F,[20]=F,[13]=F,[31]=F},--O1
|
||||
{[02]=F,[20]=F,[13]=F,[31]=F},-- I3
|
||||
{[02]=R,[20]=L,[13]=L,[31]=R},-- C
|
||||
{[02]=F,[20]=F,[13]=R,[31]=L},-- I2
|
||||
{[02]=F,[20]=F,[13]=F,[31]=F},-- O1
|
||||
}
|
||||
for i=1,29 do
|
||||
local a,b=R,L
|
||||
if i==6 or i==18 then
|
||||
a,b=b,a
|
||||
end
|
||||
list[i][01]=a;list[i][10]=b;list[i][03]=b;list[i][30]=a
|
||||
list[i][12]=a;list[i][21]=b;list[i][32]=b;list[i][23]=a
|
||||
list[i][01]=a; list[i][10]=b; list[i][03]=b; list[i][30]=a
|
||||
list[i][12]=a; list[i][21]=b; list[i][32]=b; list[i][23]=a
|
||||
end
|
||||
BiRS={
|
||||
centerTex=GC.DO{10,10,
|
||||
@@ -653,9 +653,9 @@ do
|
||||
end
|
||||
local dx,dy=0,0 do
|
||||
local pressing=P.keyPressing
|
||||
if pressing[1]and P:ifoverlap(C.bk,P.curX-1,P.curY)then dx=dx-1 end
|
||||
if pressing[2]and P:ifoverlap(C.bk,P.curX+1,P.curY)then dx=dx+1 end
|
||||
if pressing[7]and P:ifoverlap(C.bk,P.curX,P.curY-1)then dy= -1 end
|
||||
if pressing[1] and P:ifoverlap(C.bk,P.curX-1,P.curY) then dx=dx-1 end
|
||||
if pressing[2] and P:ifoverlap(C.bk,P.curX+1,P.curY) then dx=dx+1 end
|
||||
if pressing[7] and P:ifoverlap(C.bk,P.curX,P.curY-1) then dy= -1 end
|
||||
end
|
||||
while true do
|
||||
for test=1,#kickList do
|
||||
@@ -666,7 +666,7 @@ do
|
||||
(P.freshTime>0 or fdy<=0)
|
||||
then
|
||||
local x,y=ix+fdx,iy+fdy
|
||||
if not P:ifoverlap(icb,x,y)then
|
||||
if not P:ifoverlap(icb,x,y) then
|
||||
if P.gameEnv.moveFX and P.gameEnv.block then
|
||||
P:createMoveFX()
|
||||
end
|
||||
@@ -685,7 +685,7 @@ do
|
||||
local sfx
|
||||
if ifpre then
|
||||
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'
|
||||
P:_rotateField(d)
|
||||
else
|
||||
@@ -700,7 +700,7 @@ do
|
||||
end
|
||||
end
|
||||
|
||||
--Try release left/right, then softdrop, failed to rotate otherwise
|
||||
-- Try release left/right, then softdrop, failed to rotate otherwise
|
||||
if dx~=0 then
|
||||
dx=0
|
||||
elseif dy~=0 then
|
||||
@@ -728,24 +728,24 @@ do
|
||||
[02]=upOnly,[20]=upOnly,[13]=upOnly,[31]=upOnly,
|
||||
}
|
||||
local centerPos=TABLE.copy(defaultCenterPos)
|
||||
centerPos[1]={[0]={1,1},{1,0},{1,1},{1,0}}--Z
|
||||
centerPos[2]={[0]={1,1},{1,1},{1,1},{1,1}}--S
|
||||
centerPos[3]={[0]={1,1},{1,0},{1,1},{1,1}}--L
|
||||
centerPos[4]={[0]={1,1},{1,0},{1,1},{1,1}}--J
|
||||
centerPos[5]={[0]={1,1},{1,0},{1,1},{1,1}}--T
|
||||
centerPos[7]={[0]={0,2},{2,0},{0,2},{2,0}}--I
|
||||
centerPos[10]={[0]={1,1},{1,0},{1,1},{1,0}}--P
|
||||
centerPos[11]={[0]={1,1},{1,1},{1,1},{1,1}}--Q
|
||||
centerPos[15]={[0]={1,1},{1,0},{1,1},{1,1}}--U
|
||||
centerPos[16]={[0]={1,1},{1,1},{1,1},{1,1}}--V
|
||||
centerPos[19]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--J5
|
||||
centerPos[20]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--L5
|
||||
centerPos[21]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--R
|
||||
centerPos[22]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--Y
|
||||
centerPos[23]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--N
|
||||
centerPos[24]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--H
|
||||
centerPos[26]={[0]={0,1},{0,0},{0,1},{0,0}}--I3
|
||||
centerPos[28]={[0]={0,1},{0,0},{0,1},{0,0}}--I2
|
||||
centerPos[1]={[0]={1,1},{1,0},{1,1},{1,0}}-- Z
|
||||
centerPos[2]={[0]={1,1},{1,1},{1,1},{1,1}}-- S
|
||||
centerPos[3]={[0]={1,1},{1,0},{1,1},{1,1}}-- L
|
||||
centerPos[4]={[0]={1,1},{1,0},{1,1},{1,1}}-- J
|
||||
centerPos[5]={[0]={1,1},{1,0},{1,1},{1,1}}-- T
|
||||
centerPos[7]={[0]={0,2},{2,0},{0,2},{2,0}}-- I
|
||||
centerPos[10]={[0]={1,1},{1,0},{1,1},{1,0}}-- P
|
||||
centerPos[11]={[0]={1,1},{1,1},{1,1},{1,1}}-- Q
|
||||
centerPos[15]={[0]={1,1},{1,0},{1,1},{1,1}}-- U
|
||||
centerPos[16]={[0]={1,1},{1,1},{1,1},{1,1}}-- V
|
||||
centerPos[19]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- J5
|
||||
centerPos[20]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- L5
|
||||
centerPos[21]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- R
|
||||
centerPos[22]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- Y
|
||||
centerPos[23]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- N
|
||||
centerPos[24]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- H
|
||||
centerPos[26]={[0]={0,1},{0,0},{0,1},{0,0}}-- I3
|
||||
centerPos[28]={[0]={0,1},{0,0},{0,1},{0,0}}-- I2
|
||||
|
||||
ARS_Z={
|
||||
centerTex=GC.DO{10,10,
|
||||
@@ -765,24 +765,24 @@ end
|
||||
local DRS_weak
|
||||
do
|
||||
local centerPos=TABLE.copy(defaultCenterPos)
|
||||
centerPos[1]={[0]={1,1},{1,0},{1,1},{1,1}}--Z
|
||||
centerPos[2]={[0]={1,1},{1,0},{1,1},{1,1}}--S
|
||||
centerPos[3]={[0]={1,1},{1,0},{1,1},{1,1}}--L
|
||||
centerPos[4]={[0]={1,1},{1,0},{1,1},{1,1}}--J
|
||||
centerPos[5]={[0]={1,1},{1,0},{1,1},{1,1}}--T
|
||||
centerPos[7]={[0]={.5,1.5},{1.5,-.5},{.5,1.5},{1.5,.5}}--I
|
||||
centerPos[10]={[0]={1,1},{1,0},{1,1},{1,0}}--P
|
||||
centerPos[11]={[0]={1,1},{1,1},{1,1},{1,1}}--Q
|
||||
centerPos[15]={[0]={1,1},{1,0},{1,1},{1,1}}--U
|
||||
centerPos[16]={[0]={1,1},{1,1},{1,1},{1,1}}--V
|
||||
centerPos[19]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--J5
|
||||
centerPos[20]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--L5
|
||||
centerPos[21]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--R
|
||||
centerPos[22]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--Y
|
||||
centerPos[23]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--N
|
||||
centerPos[24]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--H
|
||||
centerPos[26]={[0]={0,1},{0,0},{0,1},{0,0}}--I3
|
||||
centerPos[28]={[0]={0,1},{0,0},{0,1},{0,0}}--I2
|
||||
centerPos[1]={[0]={1,1},{1,0},{1,1},{1,1}}-- Z
|
||||
centerPos[2]={[0]={1,1},{1,0},{1,1},{1,1}}-- S
|
||||
centerPos[3]={[0]={1,1},{1,0},{1,1},{1,1}}-- L
|
||||
centerPos[4]={[0]={1,1},{1,0},{1,1},{1,1}}-- J
|
||||
centerPos[5]={[0]={1,1},{1,0},{1,1},{1,1}}-- T
|
||||
centerPos[7]={[0]={.5,1.5},{1.5,-.5},{.5,1.5},{1.5,.5}}-- I
|
||||
centerPos[10]={[0]={1,1},{1,0},{1,1},{1,0}}-- P
|
||||
centerPos[11]={[0]={1,1},{1,1},{1,1},{1,1}}-- Q
|
||||
centerPos[15]={[0]={1,1},{1,0},{1,1},{1,1}}-- U
|
||||
centerPos[16]={[0]={1,1},{1,1},{1,1},{1,1}}-- V
|
||||
centerPos[19]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- J5
|
||||
centerPos[20]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- L5
|
||||
centerPos[21]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- R
|
||||
centerPos[22]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- Y
|
||||
centerPos[23]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- N
|
||||
centerPos[24]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- H
|
||||
centerPos[26]={[0]={0,1},{0,0},{0,1},{0,0}}-- I3
|
||||
centerPos[28]={[0]={0,1},{0,0},{0,1},{0,0}}-- I2
|
||||
|
||||
local L={'+0+0','-1+0','+1+0','+0-1','-1-1','+1-1'}
|
||||
local R={'+0+0','+1+0','-1+0','+0-1','+1-1','-1-1'}
|
||||
@@ -802,24 +802,24 @@ do
|
||||
},
|
||||
centerPos=centerPos,
|
||||
kickTable={
|
||||
Z,S,--Z,S
|
||||
Z,S,--J,L
|
||||
Z,--T
|
||||
noKickSet,--O
|
||||
Z,--I
|
||||
Z,S,-- Z,S
|
||||
Z,S,-- J,L
|
||||
Z,-- T
|
||||
noKickSet,-- O
|
||||
Z,-- I
|
||||
|
||||
Z,S,--Z5,S5
|
||||
Z,S,--P,Q
|
||||
Z,S,--F,E
|
||||
Z,Z,Z,Z,--T5,U,V,W
|
||||
noKickSet,--X
|
||||
Z,S,--J5,L5
|
||||
Z,S,--R,Y
|
||||
Z,S,--N,H
|
||||
Z,--I5
|
||||
Z,S,-- Z5,S5
|
||||
Z,S,-- P,Q
|
||||
Z,S,-- F,E
|
||||
Z,Z,Z,Z,-- T5,U,V,W
|
||||
noKickSet,-- X
|
||||
Z,S,-- J5,L5
|
||||
Z,S,-- R,Y
|
||||
Z,S,-- N,H
|
||||
Z,-- I5
|
||||
|
||||
Z,Z,--I3,C
|
||||
Z,Z,--I2,O1
|
||||
Z,Z,-- I3,C
|
||||
Z,Z,-- I2,O1
|
||||
}
|
||||
}
|
||||
end
|
||||
@@ -916,24 +916,24 @@ do
|
||||
{'fRect',3,3,4,4},
|
||||
},
|
||||
kickTable={
|
||||
Z,S,--Z,S
|
||||
Z,S,--J,L
|
||||
Z,--T
|
||||
noKickSet,--O
|
||||
Z,--I
|
||||
Z,S,-- Z,S
|
||||
Z,S,-- J,L
|
||||
Z,-- T
|
||||
noKickSet,-- O
|
||||
Z,-- I
|
||||
|
||||
Z,S,--Z5,S5
|
||||
Z,S,--P,Q
|
||||
Z,S,--F,E
|
||||
Z,Z,Z,Z,--T5,U,V,W
|
||||
noKickSet,--X
|
||||
Z,S,--J5,L5
|
||||
Z,S,--R,Y
|
||||
Z,S,--N,H
|
||||
Z,--I5
|
||||
Z,S,-- Z5,S5
|
||||
Z,S,-- P,Q
|
||||
Z,S,-- F,E
|
||||
Z,Z,Z,Z,-- T5,U,V,W
|
||||
noKickSet,-- X
|
||||
Z,S,-- J5,L5
|
||||
Z,S,-- R,Y
|
||||
Z,S,-- N,H
|
||||
Z,-- I5
|
||||
|
||||
Z,Z,--I3,C
|
||||
Z,Z,--I2,O1
|
||||
Z,Z,-- I3,C
|
||||
Z,Z,-- I2,O1
|
||||
}
|
||||
}
|
||||
end
|
||||
@@ -1009,15 +1009,15 @@ local RSlist={
|
||||
}
|
||||
|
||||
for _,rs in next,RSlist do
|
||||
if not rs.centerDisp then rs.centerDisp=TABLE.new(true,29)end
|
||||
if not rs.centerDisp then rs.centerDisp=TABLE.new(true,29) end
|
||||
if not rs.centerPos then rs.centerPos=defaultCenterPos end
|
||||
if not rs.centerTex then rs.centerTex=defaultCenterTex end
|
||||
|
||||
--Make all string vec to the same table vec
|
||||
-- Make all string vec to the same table vec
|
||||
for _,set in next,rs.kickTable do
|
||||
if type(set)=='table'then
|
||||
if type(set)=='table' then
|
||||
for _,list in next,set do
|
||||
if type(list[1])=='string'then
|
||||
if type(list[1])=='string' then
|
||||
_strToVec(list)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
--Cool liquid background
|
||||
-- Cool liquid background
|
||||
local back={}
|
||||
local shader=SHADER.aura
|
||||
local t
|
||||
|
||||
function back.init()
|
||||
t=math.random()*260
|
||||
t=math.random()*2600
|
||||
BG.resize(SCR.w,SCR.h)
|
||||
end
|
||||
function back.update(dt)
|
||||
t=(t+dt)%2600
|
||||
t=(t+dt)%6200
|
||||
end
|
||||
function back.draw()
|
||||
GC.clear(.08,.08,.084)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
--Horizonal red-blue gradient
|
||||
-- Horizonal red-blue gradient
|
||||
local back={}
|
||||
local shader=SHADER.grad1
|
||||
|
||||
local t
|
||||
function back.init()
|
||||
t=math.random()*260
|
||||
t=math.random()*2600
|
||||
end
|
||||
function back.update(dt)
|
||||
t=(t+dt)%2600
|
||||
t=(t+dt)%6200
|
||||
end
|
||||
function back.draw()
|
||||
GC.clear(.08,.08,.084)
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
--Vertical red-green gradient
|
||||
-- Vertical red-green gradient
|
||||
local back={}
|
||||
local shader=SHADER.grad2
|
||||
|
||||
local t
|
||||
function back.init()
|
||||
t=math.random()*260
|
||||
t=math.random()*2600
|
||||
BG.resize(nil,SCR.h)
|
||||
end
|
||||
function back.update(dt)
|
||||
t=(t+dt)%2600
|
||||
t=(t+dt)%6200
|
||||
end
|
||||
function back.draw()
|
||||
GC.clear(.08,.08,.084)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--Large falling tetrominoes
|
||||
-- Large falling tetrominoes
|
||||
local gc=love.graphics
|
||||
local gc_clear=gc.clear
|
||||
local gc_setColor,gc_draw=gc.setColor,gc.draw
|
||||
@@ -43,8 +43,8 @@ function back.draw()
|
||||
local M=mino[i]
|
||||
local b=M.block
|
||||
for y=1,#b do
|
||||
for x=1,#b[1]do
|
||||
if b[y][x]then
|
||||
for x=1,#b[1] do
|
||||
if b[y][x] then
|
||||
gc_draw(M.texture,M.x+(x-1)*30*M.k,M.y-y*30*M.k,nil,M.k)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--blockhole
|
||||
-- blockhole
|
||||
local gc=love.graphics
|
||||
local gc_clear,gc_replaceTransform=gc.clear,gc.replaceTransform
|
||||
local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth
|
||||
@@ -44,14 +44,14 @@ function back.draw()
|
||||
gc_clear(.1,.1,.1)
|
||||
gc_replaceTransform(SCR.xOy_m)
|
||||
|
||||
--Squares
|
||||
-- Squares
|
||||
gc_setColor(1,1,1,.2)
|
||||
for i=1,#squares do
|
||||
local S=squares[i]
|
||||
gc_draw(S.texture,S.d*cos(S.ang),S.d*sin(S.ang),S.rotate,S.size*.026,nil,15,15)
|
||||
end
|
||||
|
||||
--blockhole
|
||||
-- blockhole
|
||||
gc_setColor(.07,.07,.07)
|
||||
gc_circle('fill',0,0,157)
|
||||
gc_setLineWidth(6)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--Block rain
|
||||
-- Block rain
|
||||
local gc=love.graphics
|
||||
local rnd=math.random
|
||||
local ins,rem=table.insert,table.remove
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--Space but tetrominoes
|
||||
-- Space but tetrominoes
|
||||
local gc=love.graphics
|
||||
local gc_clear,gc_translate=gc.clear,gc.translate
|
||||
local gc_setColor,gc_draw=gc.setColor,gc.draw
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--Flying cubes
|
||||
-- Flying cubes
|
||||
local gc=love.graphics
|
||||
local gc_clear=gc.clear
|
||||
local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--Custom background
|
||||
-- Custom background
|
||||
local gc_clear,gc_setColor=love.graphics.clear,love.graphics.setColor
|
||||
local back={}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--Yuyuko's fan
|
||||
-- Yuyuko's fan
|
||||
local gc=love.graphics
|
||||
local gc_clear,gc_origin,gc_replaceTransform=gc.clear,gc.origin,gc.replaceTransform
|
||||
local gc_translate=gc.translate
|
||||
@@ -61,7 +61,7 @@ function back.draw()
|
||||
|
||||
gc_setLineWidth(6)
|
||||
gc_setColor(.8,.9,1,.3)
|
||||
for i=1,#SVG_TITLE_FAN do gc_polygon('line',SVG_TITLE_FAN[i])end
|
||||
for i=1,#SVG_TITLE_FAN do gc_polygon('line',SVG_TITLE_FAN[i]) end
|
||||
|
||||
gc_setLineWidth(2)
|
||||
gc_setColor(1,.5,.7,.3)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--Firework
|
||||
-- Firework
|
||||
local gc=love.graphics
|
||||
local gc_clear=gc.clear
|
||||
local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth
|
||||
@@ -37,7 +37,7 @@ function back.update(dt)
|
||||
local x,y,color=F.x,F.y,F.color
|
||||
if F.big then
|
||||
SFX.play('fall',.5)
|
||||
for _=1,rnd(62,126)do
|
||||
for _=1,rnd(62,126) do
|
||||
ins(particle,{
|
||||
x=x,y=y,
|
||||
color=color,
|
||||
@@ -48,7 +48,7 @@ function back.update(dt)
|
||||
end
|
||||
else
|
||||
SFX.play('clear_1',.4)
|
||||
for _=1,rnd(16,26)do
|
||||
for _=1,rnd(16,26) do
|
||||
ins(particle,{
|
||||
x=x,y=y,
|
||||
color=color,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--Customizable grey background
|
||||
-- Customizable grey background
|
||||
local back={}
|
||||
local r,g,b=.26,.26,.26
|
||||
function back.draw()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--Flash after random time
|
||||
-- Flash after random time
|
||||
local back={}
|
||||
|
||||
local t
|
||||
|
||||
41
parts/backgrounds/galaxy.lua
Normal file
41
parts/backgrounds/galaxy.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
--Space with stars
|
||||
local gc=love.graphics
|
||||
local circle,setColor,hsv=gc.circle,gc.setColor,COLOR.hsv
|
||||
local sin,cos=math.sin,math.cos
|
||||
local back={}
|
||||
|
||||
local sDist,sRev={},{} -- star data in SoA [distance from center, revolution progress, color]
|
||||
|
||||
function back.init()
|
||||
if sDist[1]then return end
|
||||
local max
|
||||
for i=0,20 do
|
||||
max=16*(i+1)
|
||||
for j=1,max do
|
||||
sDist[#sDist+1]=i+math.random()
|
||||
sRev[#sRev+1]=MATH.tau*j/max+MATH.tau*math.random()/max
|
||||
end
|
||||
end
|
||||
end
|
||||
function back.update(dt)
|
||||
for i=1,#sDist do
|
||||
sRev[i]=(sRev[i]+dt/(sDist[i]+1))%MATH.tau
|
||||
end
|
||||
end
|
||||
function back.draw()
|
||||
gc.clear()
|
||||
gc.translate(SCR.cx,SCR.cy)
|
||||
gc.scale(SCR.k)
|
||||
gc.rotate(1)
|
||||
for i=1,#sDist do
|
||||
local d,r=sDist[i],sRev[i]
|
||||
if d<5 then
|
||||
setColor(hsv(.088,(d-2)/7,1,.7))
|
||||
else
|
||||
setColor(hsv(.572,d/70+.1,(22-d)/12,.7))
|
||||
end
|
||||
circle('fill',8*d*cos(r),24*d*sin(r),3)
|
||||
end
|
||||
end
|
||||
|
||||
return back
|
||||
@@ -1,4 +1,4 @@
|
||||
--Light-dark
|
||||
-- Light-dark
|
||||
local sin=math.sin
|
||||
local back={}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--A lantern background which is full of festive atmosphere. Lantern image by ScF
|
||||
-- A lantern background which is full of festive atmosphere. Lantern image by ScF
|
||||
local int,rnd=math.floor,math.random
|
||||
local ins,rem=table.insert,table.remove
|
||||
local mDraw=mDraw
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--Space with stars
|
||||
-- Space with stars
|
||||
local back={}
|
||||
|
||||
local upCover do
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--Lightning
|
||||
-- Lightning
|
||||
local back={}
|
||||
|
||||
local t
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--Fast lightning + spining tetromino
|
||||
-- Fast lightning + spining tetromino
|
||||
local int,rnd=math.floor,math.random
|
||||
local back={}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--Black-White grid
|
||||
-- Black-White grid
|
||||
local gc=love.graphics
|
||||
local gc_clear,gc_scale=gc.clear,gc.scale
|
||||
local gc_setColor=gc.setColor
|
||||
@@ -9,7 +9,7 @@ local ceil=math.ceil
|
||||
local back={}
|
||||
|
||||
local t
|
||||
local matrixT={}for i=1,50 do matrixT[i]={}for j=1,50 do matrixT[i][j]=love.math.noise(i,j)+2 end end
|
||||
local matrixT={} for i=1,50 do matrixT[i]={} for j=1,50 do matrixT[i][j]=love.math.noise(i,j)+2 end end
|
||||
function back.init()
|
||||
t=math.random()*2600
|
||||
end
|
||||
@@ -21,7 +21,7 @@ function back.draw()
|
||||
local k=SCR.k
|
||||
gc_scale(k)
|
||||
local Y=ceil(SCR.h/80/k)
|
||||
for x=1,ceil(SCR.w/80/k)do
|
||||
for x=1,ceil(SCR.w/80/k) do
|
||||
for y=1,Y do
|
||||
gc_setColor(1,1,1,sin(x+matrixT[x][y]*t)*.04+.04)
|
||||
gc_rectangle('fill',80*x,80*y,-80,-80)
|
||||
|
||||
145
parts/backgrounds/quarks.lua
Normal file
145
parts/backgrounds/quarks.lua
Normal file
@@ -0,0 +1,145 @@
|
||||
local gc=love.graphics
|
||||
local hsv=COLOR.hsv
|
||||
local circle,push,pop,rot,translate,setColor=gc.circle,gc.push,gc.pop,gc.rotate,gc.translate,gc.setColor
|
||||
local rnd,sin,cos,log,ceil=math.random,math.sin,math.cos,math.log,math.ceil
|
||||
local back={}
|
||||
|
||||
local qX,qY,qdX,qdY={},{},{},{} -- quark data in SoA [size, X, Y, dx, dy, color]
|
||||
|
||||
local ptcclr={{1,0,0},{0,1,0},{0,0,1}}
|
||||
local apcclr={{0,1,1},{1,0,1},{1,1,0}}
|
||||
|
||||
local blasts={} -- data about annihilation blasts from particles and antiparticles colliding
|
||||
local ptc={} -- particle-antiparticle data (antiparticle is a mirror of particle)
|
||||
local nextpair
|
||||
|
||||
local W,H,size
|
||||
local quarkCount=400
|
||||
|
||||
local function spawnQuarkRandom(i)
|
||||
qX[i]=rnd(W)-10 -- X
|
||||
qY[i]=rnd(H)-10 -- Y
|
||||
local theta=rnd()*MATH.tau
|
||||
qdX[i]=cos(theta)*300 -- dx
|
||||
qdY[i]=sin(theta)*300 -- dy
|
||||
end
|
||||
local function spawnQuarkEdge(i)
|
||||
local side=rnd(4)
|
||||
if side==1 then -- Up edge of screen
|
||||
qX[i]=rnd(SCR.x-10,SCR.ex+10)
|
||||
qY[i]=SCR.y-10
|
||||
elseif side==2 then -- Right edge of screen
|
||||
qX[i]=SCR.ex+10
|
||||
qY[i]=rnd(SCR.y-10,SCR.ey+10)
|
||||
elseif side==3 then -- Down edge of screen
|
||||
qX[i]=rnd(SCR.x-10,SCR.ex+10)
|
||||
qY[i]=SCR.ey+10
|
||||
elseif side==4 then -- Left edge of screen
|
||||
qX[i]=SCR.x-10
|
||||
qY[i]=rnd(SCR.y-10,SCR.ey+10)
|
||||
end
|
||||
local theta=rnd()*MATH.tau
|
||||
qdX[i]=cos(theta)*300 -- dx
|
||||
qdY[i]=sin(theta)*300 -- dy
|
||||
end
|
||||
local function spawnParticlePair()
|
||||
ptc[#ptc+1]={
|
||||
x=rnd(W)-10,
|
||||
y=rnd(H)-10,
|
||||
dist=0,
|
||||
theta=rnd()*MATH.tau,
|
||||
v=500,
|
||||
c=rnd(3),
|
||||
}
|
||||
end
|
||||
local function spawnBlast(_x,_y)
|
||||
blasts[#blasts+1]={x=_x,y=_y,t=0}
|
||||
end
|
||||
|
||||
function back.init()
|
||||
qX,qY,qdX,qdY={},{},{},{}
|
||||
blasts={}
|
||||
ptc={}
|
||||
nextpair=0
|
||||
BG.resize(SCR.w,SCR.h)
|
||||
end
|
||||
function back.resize(w,h)
|
||||
W,H=w+20,h+20
|
||||
for i=1,quarkCount do spawnQuarkRandom(i) end
|
||||
size=2.6*SCR.k
|
||||
end
|
||||
function back.update(dt)
|
||||
-- Move far-away quarks
|
||||
for i=1,quarkCount do
|
||||
qX[i]=qX[i]+qdX[i]*dt
|
||||
qY[i]=qY[i]+qdY[i]*dt
|
||||
if qX[i]<SCR.x-26 or qX[i]>SCR.ex+26 or qY[i]<SCR.y-26 or qY[i]>SCR.ey+26 then
|
||||
spawnQuarkEdge(i)
|
||||
end
|
||||
end
|
||||
|
||||
-- Particle pair attraction & destruction
|
||||
for i=#ptc,1,-1 do
|
||||
local p=ptc[i]
|
||||
if p then
|
||||
p.dist=p.dist+p.v*dt
|
||||
p.v=p.v-p.dist^2*dt
|
||||
|
||||
-- Destroy colliding particle pairs
|
||||
if p.dist<=10 and p.v<=0 then
|
||||
spawnBlast(p.x,p.y)
|
||||
table.remove(ptc,i)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Age blasts, delete old blasts
|
||||
for i=#blasts,1,-1 do
|
||||
if blasts[i] then
|
||||
blasts[i].t=blasts[i].t+dt
|
||||
if blasts[i].t>=1 then
|
||||
table.remove(blasts,i)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Spawn particle pairs
|
||||
nextpair=nextpair-dt
|
||||
if nextpair<=0 then
|
||||
spawnParticlePair()
|
||||
nextpair=rnd()*4
|
||||
end
|
||||
end
|
||||
function back.draw()
|
||||
gc.clear(.08,.04,.01)
|
||||
translate(-10,-10)
|
||||
|
||||
-- Draw quarks in R/G/B
|
||||
setColor(1,0,0,.8) for i=1, math.floor(quarkCount/3) do circle('fill',qX[i],qY[i],size) end
|
||||
setColor(0,1,0,.8) for i=math.floor(quarkCount/3)+1, math.floor(quarkCount*2/3) do circle('fill',qX[i],qY[i],size) end
|
||||
setColor(0,0,1,.8) for i=math.floor(quarkCount*2/3)+1,quarkCount do circle('fill',qX[i],qY[i],size) end
|
||||
|
||||
for i=1,#ptc do
|
||||
local p=ptc[i]
|
||||
push()
|
||||
translate(p.x,p.y)
|
||||
rot(p.theta)
|
||||
|
||||
setColor(ptcclr[p.c])
|
||||
circle('fill', p.dist,0,4*size)
|
||||
setColor(apcclr[p.c])
|
||||
circle('fill',-p.dist,0,4*size)
|
||||
pop()
|
||||
end
|
||||
for i=1,#blasts do
|
||||
local t=blasts[i].t
|
||||
setColor(hsv(-80*t,1-1.7*log(5*t,10),1,1-t))
|
||||
circle('fill',blasts[i].x,blasts[i].y,62*t^.3)
|
||||
end
|
||||
end
|
||||
function back.discard()
|
||||
qX,qY,qdX,qdY,qC=nil
|
||||
ptc,blasts=nil
|
||||
collectgarbage()
|
||||
end
|
||||
return back
|
||||
@@ -1,14 +1,14 @@
|
||||
--Colorful RGB
|
||||
-- Colorful RGB
|
||||
local back={}
|
||||
local shader=SHADER.rgb1
|
||||
|
||||
local t
|
||||
function back.init()
|
||||
t=math.random()*260
|
||||
t=math.random()*2600
|
||||
BG.resize(SCR.w,SCR.h)
|
||||
end
|
||||
function back.update(dt)
|
||||
t=(t+dt)%2600
|
||||
t=(t+dt)%6200
|
||||
end
|
||||
function back.draw()
|
||||
GC.clear(.08,.08,.084)
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
--Blue RGB
|
||||
-- Blue RGB
|
||||
local back={}
|
||||
local shader=SHADER.rgb2
|
||||
|
||||
local t
|
||||
function back.init()
|
||||
t=math.random()*260
|
||||
t=math.random()*2600
|
||||
BG.resize(SCR.w,SCR.h)
|
||||
end
|
||||
function back.update(dt)
|
||||
t=(t+dt)%2600
|
||||
t=(t+dt)%6200
|
||||
end
|
||||
function back.draw()
|
||||
GC.clear(.08,.08,.084)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--Changing pure color
|
||||
-- Changing pure color
|
||||
local sin=math.sin
|
||||
local back={}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--Snow
|
||||
-- Snow
|
||||
local gc=love.graphics
|
||||
local ellipse=gc.ellipse
|
||||
local rnd=math.random
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--Space with stars
|
||||
-- Space with stars
|
||||
local gc=love.graphics
|
||||
local rectangle=gc.rectangle
|
||||
local rnd=math.random
|
||||
@@ -15,16 +15,16 @@ function back.resize(w,h)
|
||||
local S=stars
|
||||
for i=1,1260,5 do
|
||||
local s=rnd(26,40)*.1
|
||||
S[i]=s*SCR.k --Size
|
||||
S[i+1]=rnd(W)-10 --X
|
||||
S[i+2]=rnd(H)-10 --Y
|
||||
S[i+3]=(rnd()-.5)*.01*s--Vx
|
||||
S[i+4]=(rnd()-.5)*.01*s--Vy
|
||||
S[i]=s*SCR.k -- Size
|
||||
S[i+1]=rnd(W)-10 -- X
|
||||
S[i+2]=rnd(H)-10 -- Y
|
||||
S[i+3]=(rnd()-.5)*.01*s-- Vx
|
||||
S[i+4]=(rnd()-.5)*.01*s-- Vy
|
||||
end
|
||||
end
|
||||
function back.update(dt)
|
||||
local S=stars
|
||||
--Star moving
|
||||
-- Star moving
|
||||
for i=1,1260,5 do
|
||||
S[i+1]=(S[i+1]+S[i+3]*dt*60)%W
|
||||
S[i+2]=(S[i+2]+S[i+4]*dt*60)%H
|
||||
@@ -32,7 +32,7 @@ function back.update(dt)
|
||||
end
|
||||
function back.draw()
|
||||
gc.clear(.08,.08,.084)
|
||||
if not stars[1]then return end
|
||||
if not stars[1] then return end
|
||||
gc.translate(-10,-10)
|
||||
gc.setColor(1,1,1,.6)
|
||||
for i=1,1260,5 do
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--Cool Tunnel
|
||||
-- Cool Tunnel
|
||||
local rnd=math.random
|
||||
local ins,rem=table.insert,table.remove
|
||||
local back={}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--Welcome to Techmino
|
||||
-- Welcome to Techmino
|
||||
local sin=math.sin
|
||||
local back={}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--Flandre's wing
|
||||
-- Flandre's wing
|
||||
local back={}
|
||||
local crystal_img,crystals
|
||||
local wingColor={
|
||||
|
||||
@@ -38,8 +38,8 @@ local FCL={
|
||||
local LclearScore={[0]=0,-200,-150,-100,200}
|
||||
local HclearScore={[0]=0,100,140,200,500}
|
||||
local function _ifoverlapAI(f,bk,x,y)
|
||||
for i=1,#bk do for j=1,#bk[1]do
|
||||
if f[y+i-1]and bk[i][j]and f[y+i-1][x+j-1]>0 then
|
||||
for i=1,#bk do for j=1,#bk[1] do
|
||||
if f[y+i-1] and bk[i][j] and f[y+i-1][x+j-1]>0 then
|
||||
return true
|
||||
end
|
||||
end end
|
||||
@@ -74,7 +74,7 @@ local function _getScore(field,cb,cy)
|
||||
clear=clear+1
|
||||
::CONTINUE_notFull::
|
||||
end
|
||||
if #field==0 then--PC
|
||||
if #field==0 then-- PC
|
||||
return 1e99
|
||||
end
|
||||
for x=1,10 do
|
||||
@@ -116,10 +116,10 @@ local function _getScore(field,cb,cy)
|
||||
-#field*30
|
||||
-#cb*15
|
||||
+(#field>10 and
|
||||
HclearScore[clear]--Clearing
|
||||
-hole*70--Hole
|
||||
-cy*50--Height
|
||||
-sdh--Sum of DeltaH
|
||||
HclearScore[clear]-- Clearing
|
||||
-hole*70-- Hole
|
||||
-cy*50-- Height
|
||||
-sdh-- Sum of DeltaH
|
||||
or
|
||||
LclearScore[clear]
|
||||
-hole*100
|
||||
@@ -139,10 +139,10 @@ local bot_9s={}
|
||||
function bot_9s.thread(bot)
|
||||
local P,data,keys=bot.P,bot.data,bot.keys
|
||||
while true do
|
||||
--Thinking
|
||||
-- Thinking
|
||||
yield()
|
||||
local Tfield={}--Test field
|
||||
local best={x=1,dir=0,hold=false,score=-1e99}--Best method
|
||||
local Tfield={}-- Test field
|
||||
local best={x=1,dir=0,hold=false,score=-1e99}-- Best method
|
||||
local field_org=P.field
|
||||
for i=1,#field_org do
|
||||
Tfield[i]=getRow(0)
|
||||
@@ -152,33 +152,33 @@ function bot_9s.thread(bot)
|
||||
end
|
||||
|
||||
for ifhold=0,data.hold and P.gameEnv.holdCount>0 and 1 or 0 do
|
||||
--Get block id
|
||||
-- Get block id
|
||||
local bn
|
||||
if ifhold==0 then
|
||||
bn=P.cur and P.cur.id
|
||||
else
|
||||
bn=P.holdQueue[1]and P.holdQueue[1].id or P.nextQueue[1]and P.nextQueue[1].id
|
||||
bn=P.holdQueue[1] and P.holdQueue[1].id or P.nextQueue[1] and P.nextQueue[1].id
|
||||
end
|
||||
if bn then
|
||||
for dir=0,dirCount[bn]do--Each dir
|
||||
for dir=0,dirCount[bn] do-- Each dir
|
||||
local cb=BLOCKS[bn][dir]
|
||||
for cx=1,11-#cb[1]do--Each pos
|
||||
for cx=1,11-#cb[1] do-- Each pos
|
||||
local cy=#Tfield+1
|
||||
|
||||
--Move to bottom
|
||||
while cy>1 and not _ifoverlapAI(Tfield,cb,cx,cy-1)do
|
||||
-- Move to bottom
|
||||
while cy>1 and not _ifoverlapAI(Tfield,cb,cx,cy-1) do
|
||||
cy=cy-1
|
||||
end
|
||||
|
||||
--Simulate lock
|
||||
-- Simulate lock
|
||||
for i=1,#cb do
|
||||
local y=cy+i-1
|
||||
if not Tfield[y]then
|
||||
if not Tfield[y] then
|
||||
Tfield[y]=getRow(0)
|
||||
end
|
||||
local L=Tfield[y]
|
||||
for j=1,#cb[1]do
|
||||
if cb[i][j]then
|
||||
for j=1,#cb[1] do
|
||||
if cb[i][j] then
|
||||
L[cx+j-1]=1
|
||||
end
|
||||
end
|
||||
@@ -194,7 +194,7 @@ function bot_9s.thread(bot)
|
||||
end
|
||||
if not best.bn then return 1 end
|
||||
|
||||
--Release cache
|
||||
-- Release cache
|
||||
while #Tfield>0 do
|
||||
discardRow(rem(Tfield,1))
|
||||
end
|
||||
@@ -207,7 +207,7 @@ function bot_9s.thread(bot)
|
||||
end
|
||||
ins(keys,6)
|
||||
|
||||
--Check if time to change target
|
||||
-- Check if time to change target
|
||||
yield()
|
||||
if P.aiRND:random()<.00126 then
|
||||
P:changeAtkMode(P.aiRND:random()<.85 and 1 or #P.atker>3 and 4 or P.aiRND:random()<.3 and 2 or 3)
|
||||
|
||||
@@ -11,9 +11,9 @@ function bot_cc:checkDest(b2b,atk,exblock,yomi)
|
||||
local dest=self.P.destFX
|
||||
if not dest then return end
|
||||
if not (dest.b2b==b2b and dest.attack==atk and dest.extra==exblock) then
|
||||
print(('hope: %s %s %s'):format(dest.b2b,dest.attack,dest.extra))
|
||||
print(('real: %s %s %s'):format(b2b,atk,exblock))
|
||||
print(yomi)
|
||||
-- print(('hope: %s %s %s'):format(dest.b2b,dest.attack,dest.extra))
|
||||
-- print(('real: %s %s %s'):format(b2b,atk,exblock))
|
||||
-- print(yomi)
|
||||
self:lockWrongPlace()
|
||||
self.P.destFX=nil
|
||||
return
|
||||
@@ -21,7 +21,7 @@ function bot_cc:checkDest(b2b,atk,exblock,yomi)
|
||||
local CB=self.P.cur.bk
|
||||
for k=1,#dest,2 do
|
||||
local r=CB[dest[k+1]-self.P.curY+2]
|
||||
if not r or not r[dest[k]-self.P.curX+2]then
|
||||
if not r or not r[dest[k]-self.P.curX+2] then
|
||||
print('wrong place')
|
||||
self:lockWrongPlace()
|
||||
self.P.destFX=nil
|
||||
@@ -50,11 +50,11 @@ function bot_cc:thread()
|
||||
local P,keys=self.P,self.keys
|
||||
local ccBot=self.ccBot
|
||||
while true do
|
||||
--Start thinking
|
||||
-- Start thinking
|
||||
yield()
|
||||
ccBot:think()
|
||||
|
||||
--Poll keys
|
||||
-- Poll keys
|
||||
local success,result,dest,hold,move,b2b,attack,extra,spawn
|
||||
repeat
|
||||
yield()
|
||||
@@ -73,10 +73,10 @@ function bot_cc:thread()
|
||||
dest.extra = extra
|
||||
dest.spawn = spawn
|
||||
P.destFX=dest
|
||||
if hold then--Hold
|
||||
if hold then-- Hold
|
||||
keys[1]=8
|
||||
end
|
||||
while move[1]do
|
||||
while move[1] do
|
||||
local m=rem(move,1)
|
||||
if m<4 then
|
||||
ins(keys,m+1)
|
||||
@@ -89,7 +89,7 @@ function bot_cc:thread()
|
||||
ins(keys,6)
|
||||
end
|
||||
|
||||
--Check if time to change target
|
||||
-- Check if time to change target
|
||||
yield()
|
||||
if P.aiRND:random()<.00126 then
|
||||
P:changeAtkMode(P.aiRND:random()<.85 and 1 or #P.atker>3 and 4 or P.aiRND:random()<.3 and 2 or 3)
|
||||
@@ -105,7 +105,7 @@ function bot_cc:updateField()
|
||||
end end
|
||||
while i<=400 do F[i],i=false,i+1 end
|
||||
local y = P:getNextSpawn()-1
|
||||
if not pcall(self.ccBot.reset,self.ccBot,F,P.b2b,P.combo,P.stat.pc,P.stat.row,y)then
|
||||
if not pcall(self.ccBot.reset,self.ccBot,F,P.b2b,P.combo,P.stat.pc,P.stat.row,y) then
|
||||
print("CC is dead ("..P.id..")","error")
|
||||
for y=#F0,1,-1 do
|
||||
local s=""
|
||||
|
||||
@@ -14,9 +14,9 @@ function baseBot.update(bot)
|
||||
local keys=bot.keys
|
||||
if P.control and P.cur then
|
||||
bot.delay=bot.delay-1
|
||||
if not keys[1]then
|
||||
if not keys[1] then
|
||||
if bot.runningThread then
|
||||
if not pcall(bot.runningThread)then
|
||||
if not pcall(bot.runningThread) then
|
||||
bot.runningThread=false
|
||||
end
|
||||
else
|
||||
@@ -61,18 +61,18 @@ local AISpeed={60,50,42,34,27,21,16,12,9,6}
|
||||
}
|
||||
]]
|
||||
function BOT.template(arg)
|
||||
if arg.type=='CC'then
|
||||
return{
|
||||
if arg.type=='CC' then
|
||||
return {
|
||||
type='CC',
|
||||
next=arg.next,
|
||||
hold=arg.hold,
|
||||
delay=AISpeed[arg.speedLV],
|
||||
node=arg.node,
|
||||
bag=(arg.randomizer or'bag')=='bag',
|
||||
bag=(arg.randomizer or 'bag')=='bag',
|
||||
_20G=arg._20G,
|
||||
}
|
||||
elseif arg.type=='9S'then
|
||||
return{
|
||||
elseif arg.type=='9S' then
|
||||
return {
|
||||
type='9S',
|
||||
delay=math.floor(AISpeed[arg.speedLV]),
|
||||
hold=arg.hold,
|
||||
@@ -82,7 +82,7 @@ end
|
||||
|
||||
function BOT.new(P,data)
|
||||
local bot={P=P,data=data}
|
||||
if data.type=="CC"then
|
||||
if data.type=="CC" then
|
||||
P:setRS('TRS')
|
||||
bot.keys={}
|
||||
bot.bufferedNexts={}
|
||||
@@ -107,8 +107,8 @@ function BOT.new(P,data)
|
||||
local cc_lua=require"parts.bot.bot_cc"
|
||||
setmetatable(bot,{__index=function(self,k)
|
||||
return
|
||||
self.ccBot[k]and function(_,...)self.ccBot[k](self.ccBot,...)end or
|
||||
cc_lua[k]and function(_,...)cc_lua[k](self,...)end or
|
||||
self.ccBot[k] and function(_,...)self.ccBot[k](self.ccBot,...) end or
|
||||
cc_lua[k] and function(_,...)cc_lua[k](self,...) end or
|
||||
assert(baseBot[k],"No CC action called "..k)
|
||||
end})
|
||||
|
||||
@@ -127,7 +127,7 @@ function BOT.new(P,data)
|
||||
end
|
||||
bot.runningThread=coroutine.wrap(cc_lua.thread)
|
||||
bot.runningThread(bot)
|
||||
else--if data.type=="9S"then--9s or else
|
||||
else-- if data.type=="9S" then-- 9s or else
|
||||
TABLE.cover(baseBot,bot)
|
||||
TABLE.cover(require"parts.bot.bot_9s",bot)
|
||||
P:setRS('TRS')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
local L={
|
||||
zChan={--F0000~F003F
|
||||
zChan={-- F0000~F003F
|
||||
none= 0xF0000,
|
||||
normal= 0xF0001,
|
||||
full= 0xF0002,
|
||||
@@ -24,7 +24,7 @@ local L={
|
||||
thinking= 0xF0015,
|
||||
spark= 0xF0016,
|
||||
},
|
||||
mino={--F0040~F007F
|
||||
mino={-- F0040~F007F
|
||||
Z=0xF0040,
|
||||
S=0xF0041,
|
||||
J=0xF0042,
|
||||
@@ -57,7 +57,7 @@ local L={
|
||||
I2=0xF005B,
|
||||
O1=0xF005C,
|
||||
},
|
||||
icon={--F0080~F00FF
|
||||
icon={-- F0080~F00FF
|
||||
menu= 0xF0080,
|
||||
music= 0xF0081,
|
||||
language= 0xF0082,
|
||||
@@ -131,7 +131,7 @@ local L={
|
||||
garbage= 0xF00C6,
|
||||
copy= 0xF00C7,
|
||||
},
|
||||
key={--F0100~F017F
|
||||
key={-- F0100~F017F
|
||||
macCmd= 0xF0100,
|
||||
macOpt= 0xF0101,
|
||||
macCtrl= 0xF0102,
|
||||
@@ -172,7 +172,7 @@ local L={
|
||||
macPgdnAlt= 0xF0125,
|
||||
iecPower= 0xF0126,
|
||||
},
|
||||
controller={--F0180~F01FF
|
||||
controller={-- F0180~F01FF
|
||||
xbox= 0xF0180,
|
||||
lt= 0xF0181,
|
||||
rt= 0xF0182,
|
||||
@@ -212,7 +212,7 @@ local L={
|
||||
psCreate= 0xF01A4,
|
||||
psOption= 0xF01A5,
|
||||
},
|
||||
mahjong={--F0200~F027F
|
||||
mahjong={-- F0200~F027F
|
||||
m1= 0xF0200,
|
||||
m2= 0xF0201,
|
||||
m3= 0xF0202,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
return{
|
||||
return {
|
||||
version=VERSION.code,
|
||||
|
||||
--Basic
|
||||
-- Basic
|
||||
drop=1e99,
|
||||
lock=1e99,
|
||||
wait=0,
|
||||
@@ -9,17 +9,17 @@ return{
|
||||
hang=5,
|
||||
hurry=1e99,
|
||||
|
||||
--Control
|
||||
-- Control
|
||||
nextCount=6,
|
||||
holdMode='hold',
|
||||
holdCount=1,
|
||||
infHold=true,
|
||||
phyHold=false,
|
||||
|
||||
--Visual
|
||||
-- Visual
|
||||
bone=false,
|
||||
|
||||
--Rule
|
||||
-- Rule
|
||||
sequence='bag',
|
||||
lockout=false,
|
||||
fieldH=20,
|
||||
@@ -40,7 +40,7 @@ return{
|
||||
garbageSpeed=1,
|
||||
missionKill=false,
|
||||
|
||||
--Else
|
||||
-- Else
|
||||
bg='blockrain',
|
||||
bgm='hang out',
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ local ins=table.insert
|
||||
local BAG,FIELD,MISSION,CUSTOMENV,GAME=BAG,FIELD,MISSION,CUSTOMENV,GAME
|
||||
|
||||
local DATA={}
|
||||
--Sep symbol: 33 (!)
|
||||
--Safe char: 34~126
|
||||
-- Sep symbol: 33 (!)
|
||||
-- Safe char: 34~126
|
||||
--[[
|
||||
Count: 34~96
|
||||
Block: 97~125
|
||||
@@ -18,7 +18,7 @@ function DATA.copySequence()
|
||||
|
||||
local count=1
|
||||
for i=1,#BAG+1 do
|
||||
if BAG[i+1]~=BAG[i]or count==64 then
|
||||
if BAG[i+1]~=BAG[i] or count==64 then
|
||||
str=str..char(96+BAG[i])
|
||||
if count>1 then
|
||||
str=str..char(32+count)
|
||||
@@ -66,14 +66,14 @@ local fieldMeta={__index=function(self,h)
|
||||
end
|
||||
return self[h]
|
||||
end}
|
||||
function DATA.newBoard(f)--Generate a new board
|
||||
return setmetatable(f and TABLE.shift(f)or{},fieldMeta)
|
||||
function DATA.newBoard(f)-- Generate a new board
|
||||
return setmetatable(f and TABLE.shift(f) or{},fieldMeta)
|
||||
end
|
||||
function DATA.copyBoard(page)--Copy the [page] board
|
||||
function DATA.copyBoard(page)-- Copy the [page] board
|
||||
local F=FIELD[page or 1]
|
||||
local str=""
|
||||
|
||||
--Encode field
|
||||
-- Encode field
|
||||
for y=1,#F do
|
||||
local S=""
|
||||
local L=F[y]
|
||||
@@ -91,25 +91,25 @@ function DATA.copyBoards()
|
||||
end
|
||||
return table.concat(out,"!")
|
||||
end
|
||||
function DATA.pasteBoard(str,page)--Paste [str] data to [page] board
|
||||
function DATA.pasteBoard(str,page)-- Paste [str] data to [page] board
|
||||
if not page then
|
||||
page=1
|
||||
end
|
||||
if not FIELD[page]then
|
||||
if not FIELD[page] then
|
||||
FIELD[page]=DATA.newBoard()
|
||||
end
|
||||
local F=FIELD[page]
|
||||
|
||||
--Decode
|
||||
-- Decode
|
||||
str=STRING.unpackBin(str)
|
||||
if not str then return end
|
||||
|
||||
local fX,fY=1,1--*ptr for Field(r*10+(c-1))
|
||||
local fX,fY=1,1-- *ptr for Field(r*10+(c-1))
|
||||
local p=1
|
||||
while true do
|
||||
local b=byte(str,p)--1byte
|
||||
local b=byte(str,p)-- 1byte
|
||||
|
||||
--Str end
|
||||
-- Str end
|
||||
if not b then
|
||||
if fX~=1 then
|
||||
return
|
||||
@@ -118,16 +118,16 @@ function DATA.pasteBoard(str,page)--Paste [str] data to [page] board
|
||||
end
|
||||
end
|
||||
|
||||
local id=b%32-1--Block id
|
||||
if id>26 then return end--Illegal blockid
|
||||
b=int(b/32)--Mode id
|
||||
local id=b%32-1-- Block id
|
||||
if id>26 then return end-- Illegal blockid
|
||||
b=int(b/32)-- Mode id
|
||||
|
||||
F[fY][fX]=id
|
||||
if fX<10 then
|
||||
fX=fX+1
|
||||
else
|
||||
fY=fY+1
|
||||
if fY>20 then break end
|
||||
if fY>60 then break end
|
||||
fX=1
|
||||
end
|
||||
p=p+1
|
||||
@@ -158,7 +158,7 @@ function DATA.copyMission()
|
||||
|
||||
local count=1
|
||||
for i=1,#MISSION+1 do
|
||||
if MISSION[i+1]~=MISSION[i]or count==13 then
|
||||
if MISSION[i+1]~=MISSION[i] or count==13 then
|
||||
_=33+MISSION[i]
|
||||
str=str..char(_)
|
||||
if count>1 then
|
||||
@@ -186,7 +186,7 @@ function DATA.pasteMission(str)
|
||||
end
|
||||
else
|
||||
if b>=34 and b<=114 then
|
||||
if ENUM_MISSION[reg]then
|
||||
if ENUM_MISSION[reg] then
|
||||
ins(MISSION,reg)
|
||||
reg=b-33
|
||||
else
|
||||
@@ -211,8 +211,8 @@ function DATA.copyQuestArgs()
|
||||
local ENV=CUSTOMENV
|
||||
local str=""..
|
||||
ENV.holdCount..
|
||||
(ENV.ospin and"O"or"Z")..
|
||||
(ENV.missionKill and"M"or"Z")..
|
||||
(ENV.ospin and "O" or "Z")..
|
||||
(ENV.missionKill and "M" or "Z")..
|
||||
ENV.sequence
|
||||
return str
|
||||
end
|
||||
@@ -252,15 +252,15 @@ function DATA.dumpRecording(list,ptr)
|
||||
local out=""
|
||||
local buffer,buffer2=""
|
||||
if not ptr then ptr=1 end
|
||||
local prevFrm=list[ptr-2]or 0
|
||||
while list[ptr]do
|
||||
--Flush buffer
|
||||
local prevFrm=list[ptr-2] or 0
|
||||
while list[ptr] do
|
||||
-- Flush buffer
|
||||
if #buffer>10 then
|
||||
out=out..buffer
|
||||
buffer=""
|
||||
end
|
||||
|
||||
--Encode time
|
||||
-- Encode time
|
||||
local t=list[ptr]-prevFrm
|
||||
prevFrm=list[ptr]
|
||||
if t>=128 then
|
||||
@@ -275,7 +275,7 @@ function DATA.dumpRecording(list,ptr)
|
||||
buffer=buffer..char(t)
|
||||
end
|
||||
|
||||
--Encode event
|
||||
-- Encode event
|
||||
t=list[ptr+1]
|
||||
if t>=128 then
|
||||
buffer2=char(t%128)
|
||||
@@ -289,7 +289,7 @@ function DATA.dumpRecording(list,ptr)
|
||||
buffer=buffer..char(t)
|
||||
end
|
||||
|
||||
--Step
|
||||
-- Step
|
||||
ptr=ptr+2
|
||||
end
|
||||
return out..buffer,ptr
|
||||
@@ -298,10 +298,10 @@ function DATA.pumpRecording(str,L)
|
||||
local len=#str
|
||||
local p=1
|
||||
|
||||
local curFrm=L[#L-1]or 0
|
||||
local curFrm=L[#L-1] or 0
|
||||
local code
|
||||
while p<=len do
|
||||
--Read delta time
|
||||
-- Read delta time
|
||||
code=0
|
||||
local b=byte(str,p)
|
||||
while b>=128 do
|
||||
@@ -324,7 +324,7 @@ function DATA.pumpRecording(str,L)
|
||||
p=p+1
|
||||
end
|
||||
end
|
||||
do--function DATA.saveReplay()
|
||||
do-- function DATA.saveReplay()
|
||||
local noRecList={"custom","solo","round","techmino"}
|
||||
local function _getModList()
|
||||
local res={}
|
||||
@@ -336,17 +336,17 @@ do--function DATA.saveReplay()
|
||||
return res
|
||||
end
|
||||
function DATA.saveReplay()
|
||||
--Filtering modes that cannot be saved
|
||||
-- Filtering modes that cannot be saved
|
||||
for _,v in next,noRecList do
|
||||
if GAME.curModeName:find(v)then
|
||||
if GAME.curModeName:find(v) then
|
||||
MES.new('error',"Cannot save recording of this mode now!")
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
--Write file
|
||||
-- Write file
|
||||
local fileName=os.date("replay/%Y_%m_%d_%H%M%S.rep")
|
||||
if not love.filesystem.getInfo(fileName)then
|
||||
if not love.filesystem.getInfo(fileName) then
|
||||
love.filesystem.write(fileName,
|
||||
love.data.compress('string','zlib',
|
||||
JSON.encode{
|
||||
@@ -371,29 +371,29 @@ do--function DATA.saveReplay()
|
||||
end
|
||||
function DATA.parseReplay(fileName,ifFull)
|
||||
local fileData
|
||||
--Read file
|
||||
-- Read file
|
||||
fileData=love.filesystem.read(fileName)
|
||||
return DATA.parseReplayData(fileName,fileData,ifFull)
|
||||
end
|
||||
function DATA.parseReplayData(fileName,fileData,ifFull)
|
||||
local success,metaData,rep
|
||||
|
||||
if not(fileData and #fileData>0)then goto BREAK_cannotParse end
|
||||
if not (fileData and #fileData>0) then goto BREAK_cannotParse end
|
||||
|
||||
--Decompress file
|
||||
-- Decompress file
|
||||
success,fileData=pcall(love.data.decompress,'string','zlib',fileData)
|
||||
if not success then goto BREAK_cannotParse end
|
||||
|
||||
--Load metadata
|
||||
-- Load metadata
|
||||
metaData,fileData=STRING.readLine(fileData)
|
||||
metaData=JSON.decode(metaData)
|
||||
if not metaData then goto BREAK_cannotParse end
|
||||
|
||||
--Convert ancient replays
|
||||
metaData.mode=MODE_UPDATE_MAP[metaData.mode]or metaData.mode
|
||||
if not MODES[metaData.mode]then goto BREAK_cannotParse end
|
||||
-- Convert ancient replays
|
||||
metaData.mode=MODE_UPDATE_MAP[metaData.mode] or metaData.mode
|
||||
if not MODES[metaData.mode] then goto BREAK_cannotParse end
|
||||
|
||||
--Create replay object
|
||||
-- Create replay object
|
||||
rep={
|
||||
fileName=fileName,
|
||||
available=true,
|
||||
@@ -411,9 +411,9 @@ function DATA.parseReplayData(fileName,fileData,ifFull)
|
||||
if ifFull then rep.data=fileData end
|
||||
do return rep end
|
||||
|
||||
--Create unavailable replay object
|
||||
-- Create unavailable replay object
|
||||
::BREAK_cannotParse::
|
||||
return{
|
||||
return {
|
||||
fileName=fileName,
|
||||
available=false,
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
mesDisp=function(P)
|
||||
setFont(55)
|
||||
GC.mStr(P.modeData.wave,63,200)
|
||||
@@ -8,18 +8,18 @@ return{
|
||||
end,
|
||||
task=function(P)
|
||||
while true do
|
||||
YIELD()
|
||||
coroutine.yield()
|
||||
if P.control and P.atkBufferSum==0 then
|
||||
local D=P.modeData
|
||||
if D.wave==50 then
|
||||
P:win('finish')
|
||||
else
|
||||
if D.wave<20 then
|
||||
local t=1500-30*D.wave--1500~900
|
||||
local t=1500-30*D.wave-- 1500~900
|
||||
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(4,7)),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=3})
|
||||
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(3,8)),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=4})
|
||||
else
|
||||
local t=900-10*(D.wave-20)--900~600
|
||||
local t=900-10*(D.wave-20)-- 900~600
|
||||
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(10)),amount=14,countdown=t,cd0=t,time=0,sent=false,lv=4})
|
||||
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(4,7)),amount=8,countdown=t,cd0=t,time=0,sent=false,lv=5})
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
mesDisp=function(P)
|
||||
setFont(55)
|
||||
GC.mStr(P.modeData.wave,63,200)
|
||||
@@ -8,14 +8,14 @@ return{
|
||||
end,
|
||||
task=function(P)
|
||||
while true do
|
||||
YIELD()
|
||||
coroutine.yield()
|
||||
if P.control and P.atkBufferSum<4 then
|
||||
local D=P.modeData
|
||||
if D.wave==50 then
|
||||
P:win('finish')
|
||||
else
|
||||
local s
|
||||
local t=800-10*D.wave--800~700~600~500
|
||||
local t=800-10*D.wave-- 800~700~600~500
|
||||
if D.wave<10 then
|
||||
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(5,6)),amount=9,countdown=t,cd0=t,time=0,sent=false,lv=3})
|
||||
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(4,7)),amount=11,countdown=t,cd0=t+62,time=0,sent=false,lv=4})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
hook_drop=function(P)
|
||||
if P.lastPiece.atk>0 then
|
||||
P:receive(nil,P.lastPiece.atk,0,generateLine(P.holeRND:random(10)))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
hook_drop=function(P)
|
||||
if P.lastPiece.atk>0 then
|
||||
P:receive(nil,P.lastPiece.atk,120,generateLine(P.holeRND:random(10)))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
hook_drop=function(P)
|
||||
if P.lastPiece.atk>0 then
|
||||
P:receive(nil,P.lastPiece.atk,30,generateLine(P.holeRND:random(10)))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
hook_drop=function(P)
|
||||
if P.lastPiece.atk>0 then
|
||||
P:receive(nil,P.lastPiece.atk,60,generateLine(P.holeRND:random(10)))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
hook_drop=function(P)
|
||||
if P.lastPiece.row>0 then
|
||||
for _=1,#P.clearedRow do
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
mesDisp=function(P)
|
||||
mText(TEXTOBJ.techrash,63,420)
|
||||
setFont(75)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
local rem=table.remove
|
||||
|
||||
return{
|
||||
return {
|
||||
mesDisp=function(P)
|
||||
setFont(45)
|
||||
GC.mStr(P.combo,63,310)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
hook_drop=function(P)
|
||||
if P.lastPiece.row>0 then
|
||||
for _=1,#P.clearedRow do
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
hook_drop=function(P)
|
||||
if P.lastPiece.row==0 then
|
||||
P:lose()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
mesDisp=function(P)
|
||||
setFont(45)
|
||||
GC.mStr(("%.1f"):format(P.stat.atk),63,190)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
return{
|
||||
return {
|
||||
hook_drop=function(P)
|
||||
if P.garbageBeneath==0 then
|
||||
local D=P.modeData
|
||||
D.finished=D.finished+1
|
||||
if FIELD[D.finished+1]then
|
||||
if FIELD[D.finished+1] then
|
||||
P.waiting=26
|
||||
for i=#P.field,1,-1 do
|
||||
P.field[i],P.visTime[i]=nil
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
mesDisp=function(P)
|
||||
setFont(55)
|
||||
local r=10-P.stat.row
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
mesDisp=function(P)
|
||||
setFont(55)
|
||||
local r=100-P.stat.row
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
mesDisp=function(P)
|
||||
setFont(55)
|
||||
local r=1000-P.stat.row
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
mesDisp=function(P)
|
||||
setFont(55)
|
||||
local r=20-P.stat.row
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
mesDisp=function(P)
|
||||
setFont(55)
|
||||
local r=200-P.stat.row
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
mesDisp=function(P)
|
||||
setFont(55)
|
||||
local r=40-P.stat.row
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
mesDisp=function(P)
|
||||
setFont(55)
|
||||
local r=400-P.stat.row
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
hook_drop=function(P)
|
||||
if #PLY_ALIVE>1 then
|
||||
P.control=false
|
||||
@@ -13,7 +13,7 @@ return{
|
||||
end
|
||||
end
|
||||
for i=1,#PLY_ALIVE do
|
||||
if PLY_ALIVE[i].sid==(minMaxID==1e99 and minID or minMaxID)then
|
||||
if PLY_ALIVE[i].sid==(minMaxID==1e99 and minID or minMaxID) then
|
||||
PLY_ALIVE[i].control=true
|
||||
return
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
return{
|
||||
return {
|
||||
hook_drop=function(P)
|
||||
if P.stat.piece%7==0 and #PLY_ALIVE>1 then
|
||||
P.control=false
|
||||
@@ -13,7 +13,7 @@ return{
|
||||
end
|
||||
end
|
||||
for i=1,#PLY_ALIVE do
|
||||
if PLY_ALIVE[i].sid==(minMaxID==1e99 and minID or minMaxID)then
|
||||
if PLY_ALIVE[i].sid==(minMaxID==1e99 and minID or minMaxID) then
|
||||
PLY_ALIVE[i].control=true
|
||||
return
|
||||
end
|
||||
|
||||
@@ -23,7 +23,7 @@ local function GetGravity(lvl)
|
||||
lvl<29 and 2 or
|
||||
1
|
||||
end
|
||||
return{
|
||||
return {
|
||||
das=16,arr=6,
|
||||
sddas=6,sdarr=6,
|
||||
irs=false,ims=false,
|
||||
|
||||
@@ -23,7 +23,7 @@ local function GetGravity(lvl)
|
||||
lvl<29 and 2 or
|
||||
1
|
||||
end
|
||||
return{
|
||||
return {
|
||||
das=16,arr=6,
|
||||
sddas=3,sdarr=3,
|
||||
irs=false,ims=false,
|
||||
|
||||
@@ -23,7 +23,7 @@ local function GetGravity(lvl)
|
||||
lvl<29 and 2 or
|
||||
1
|
||||
end
|
||||
return{
|
||||
return {
|
||||
das=16,arr=6,
|
||||
sddas=2,sdarr=2,
|
||||
irs=false,ims=false,
|
||||
@@ -62,9 +62,9 @@ return{
|
||||
local D=P.modeData
|
||||
D.drought=P.lastPiece.id==7 and 0 or D.drought+1
|
||||
if P.stat.row>=D.target then
|
||||
--if D.target>=200 then
|
||||
-- if D.target>=200 then
|
||||
D.lvl=D.lvl+1
|
||||
--end
|
||||
-- end
|
||||
local dropSpd=GetGravity(D.lvl)
|
||||
if dropSpd~=P.gameEnv.drop then
|
||||
P.gameEnv.drop,P.gameEnv.lock=dropSpd,dropSpd
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user