注释后加空格
联网稍微推进
This commit is contained in:
Submodule Zframework updated: 779c841f1a...17e3cb26ed
18
conf.lua
18
conf.lua
@@ -1,9 +1,9 @@
|
|||||||
function love.conf(t)
|
function love.conf(t)
|
||||||
t.identity='Techmino'--Saving folder
|
t.identity='Techmino'-- Saving folder
|
||||||
t.version="11.1"
|
t.version="11.1"
|
||||||
t.gammacorrect=false
|
t.gammacorrect=false
|
||||||
t.appendidentity=true--Search files in source then in save directory
|
t.appendidentity=true-- Search files in source then in save directory
|
||||||
t.accelerometerjoystick=false--Accelerometer=joystick on ios/android
|
t.accelerometerjoystick=false-- Accelerometer=joystick on ios/android
|
||||||
if t.audio then
|
if t.audio then
|
||||||
t.audio.mic=false
|
t.audio.mic=false
|
||||||
t.audio.mixwithsystem=true
|
t.audio.mixwithsystem=true
|
||||||
@@ -16,12 +16,12 @@ function love.conf(t)
|
|||||||
W.borderless=false
|
W.borderless=false
|
||||||
W.resizable=true
|
W.resizable=true
|
||||||
W.fullscreen=false
|
W.fullscreen=false
|
||||||
W.vsync=0--Unlimited FPS
|
W.vsync=0-- Unlimited FPS
|
||||||
W.msaa=0--Multi-sampled antialiasing
|
W.msaa=0-- Multi-sampled antialiasing
|
||||||
W.depth=0--Bits/samp of depth buffer
|
W.depth=0-- Bits/samp of depth buffer
|
||||||
W.stencil=1--Bits/samp of stencil buffer
|
W.stencil=1-- Bits/samp of stencil buffer
|
||||||
W.display=1--Monitor ID
|
W.display=1-- Monitor ID
|
||||||
W.highdpi=true--High-dpi mode for the window on a Retina display
|
W.highdpi=true-- High-dpi mode for the window on a Retina display
|
||||||
W.x,W.y=nil
|
W.x,W.y=nil
|
||||||
|
|
||||||
local M=t.modules
|
local M=t.modules
|
||||||
|
|||||||
64
main.lua
64
main.lua
@@ -15,24 +15,24 @@
|
|||||||
]]--
|
]]--
|
||||||
|
|
||||||
|
|
||||||
--Var leak check
|
-- 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})
|
-- setmetatable(_G,{__newindex=function(self,k,v) print('>>'..k..string.rep(" ",26-#k),debug.traceback():match("\n.-\n\t(.-): "))rawset(self,k,v) end})
|
||||||
|
|
||||||
--System Global Vars Declaration
|
-- System Global Vars Declaration
|
||||||
local fs=love.filesystem
|
local fs=love.filesystem
|
||||||
VERSION=require"version"
|
VERSION=require"version"
|
||||||
TIME=love.timer.getTime
|
TIME=love.timer.getTime
|
||||||
SYSTEM=love.system.getOS() if SYSTEM=='OS X' then SYSTEM='macOS' end
|
SYSTEM=love.system.getOS() if SYSTEM=='OS X' then SYSTEM='macOS' end
|
||||||
FNNS=SYSTEM:find'\79\83'--What does FNSF stand for? IDK so don't ask me lol
|
FNNS=SYSTEM:find'\79\83'-- What does FNSF stand for? IDK so don't ask me lol
|
||||||
MOBILE=SYSTEM=='Android' or SYSTEM=='iOS'
|
MOBILE=SYSTEM=='Android' or SYSTEM=='iOS'
|
||||||
|
|
||||||
--Global Vars & Settings
|
-- Global Vars & Settings
|
||||||
SFXPACKS={'chiptune'}
|
SFXPACKS={'chiptune'}
|
||||||
VOCPACKS={'miya','mono','xiaoya','miku'}
|
VOCPACKS={'miya','mono','xiaoya','miku'}
|
||||||
FIRSTLAUNCH=false
|
FIRSTLAUNCH=false
|
||||||
DAILYLAUNCH=false
|
DAILYLAUNCH=false
|
||||||
|
|
||||||
--System setting
|
-- System setting
|
||||||
math.randomseed(os.time()*626)
|
math.randomseed(os.time()*626)
|
||||||
love.setDeprecationOutput(false)
|
love.setDeprecationOutput(false)
|
||||||
love.keyboard.setKeyRepeat(true)
|
love.keyboard.setKeyRepeat(true)
|
||||||
@@ -46,7 +46,7 @@ end
|
|||||||
local _LOADTIMELIST_={}
|
local _LOADTIMELIST_={}
|
||||||
local _LOADTIME_=TIME()
|
local _LOADTIME_=TIME()
|
||||||
|
|
||||||
--Load modules
|
-- Load modules
|
||||||
Z=require'Zframework'
|
Z=require'Zframework'
|
||||||
FONT.load{
|
FONT.load{
|
||||||
norm='parts/fonts/proportional.otf',
|
norm='parts/fonts/proportional.otf',
|
||||||
@@ -55,7 +55,7 @@ FONT.load{
|
|||||||
FONT.setDefault('norm')
|
FONT.setDefault('norm')
|
||||||
FONT.setFallback('norm')
|
FONT.setFallback('norm')
|
||||||
|
|
||||||
SCR.setSize(1280,720)--Initialize Screen size
|
SCR.setSize(1280,720)-- Initialize Screen size
|
||||||
BGM.setMaxSources(5)
|
BGM.setMaxSources(5)
|
||||||
VOC.setDiversion(.62)
|
VOC.setDiversion(.62)
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ end)
|
|||||||
|
|
||||||
table.insert(_LOADTIMELIST_,("Load Zframework: %.3fs"):format(TIME()-_LOADTIME_))
|
table.insert(_LOADTIMELIST_,("Load Zframework: %.3fs"):format(TIME()-_LOADTIME_))
|
||||||
|
|
||||||
--Create shortcuts
|
-- Create shortcuts
|
||||||
setFont=FONT.set
|
setFont=FONT.set
|
||||||
getFont=FONT.get
|
getFont=FONT.get
|
||||||
mText=GC.simpX
|
mText=GC.simpX
|
||||||
@@ -84,10 +84,10 @@ string.repD=STRING.repD
|
|||||||
string.sArg=STRING.sArg
|
string.sArg=STRING.sArg
|
||||||
string.split=STRING.split
|
string.split=STRING.split
|
||||||
|
|
||||||
--Delete all naked files (from ancient versions)
|
-- Delete all naked files (from ancient versions)
|
||||||
FILE.clear('')
|
FILE.clear('')
|
||||||
|
|
||||||
--Create directories
|
-- Create directories
|
||||||
for _,v in next,{'conf','record','replay','cache','lib'} do
|
for _,v in next,{'conf','record','replay','cache','lib'} do
|
||||||
local info=fs.getInfo(v)
|
local info=fs.getInfo(v)
|
||||||
if not info then
|
if not info then
|
||||||
@@ -102,7 +102,7 @@ CHAR=require'parts.char'
|
|||||||
require'parts.gameTables'
|
require'parts.gameTables'
|
||||||
require'parts.gameFuncs'
|
require'parts.gameFuncs'
|
||||||
|
|
||||||
--Load shader files from SOURCE ONLY
|
-- Load shader files from SOURCE ONLY
|
||||||
SHADER={}
|
SHADER={}
|
||||||
for _,v in next,fs.getDirectoryItems('parts/shaders') do
|
for _,v in next,fs.getDirectoryItems('parts/shaders') do
|
||||||
if FILE.isSafe('parts/shaders/'..v) then
|
if FILE.isSafe('parts/shaders/'..v) then
|
||||||
@@ -134,8 +134,8 @@ end})
|
|||||||
|
|
||||||
table.insert(_LOADTIMELIST_,("Load Parts: %.3fs"):format(TIME()-_LOADTIME_))
|
table.insert(_LOADTIMELIST_,("Load Parts: %.3fs"):format(TIME()-_LOADTIME_))
|
||||||
|
|
||||||
--Init Zframework
|
-- Init Zframework
|
||||||
do--Z.setCursor
|
do-- Z.setCursor
|
||||||
local normImg=GC.DO{16,16,
|
local normImg=GC.DO{16,16,
|
||||||
{'fCirc',8,8,4},
|
{'fCirc',8,8,4},
|
||||||
{'setCL',1,1,1,.7},
|
{'setCL',1,1,1,.7},
|
||||||
@@ -190,7 +190,7 @@ Z.setDebugInfo{
|
|||||||
{"Voices",VOC.getQueueCount},
|
{"Voices",VOC.getQueueCount},
|
||||||
{"Audios",love.audio.getSourceCount},
|
{"Audios",love.audio.getSourceCount},
|
||||||
}
|
}
|
||||||
do--Z.setOnFocus
|
do-- Z.setOnFocus
|
||||||
local function task_autoSoundOff()
|
local function task_autoSoundOff()
|
||||||
while true do
|
while true do
|
||||||
coroutine.yield()
|
coroutine.yield()
|
||||||
@@ -230,7 +230,7 @@ do--Z.setOnFocus
|
|||||||
end
|
end
|
||||||
Z.setOnQuit(destroyPlayers)
|
Z.setOnQuit(destroyPlayers)
|
||||||
|
|
||||||
--Load settings and statistics
|
-- Load settings and statistics
|
||||||
if
|
if
|
||||||
not (
|
not (
|
||||||
pcall(TABLE.cover, loadFile('conf/user', '-json -canSkip') or loadFile('conf/user', '-luaon -canSkip') or{},USER) and
|
pcall(TABLE.cover, loadFile('conf/user', '-json -canSkip') or loadFile('conf/user', '-luaon -canSkip') or{},USER) and
|
||||||
@@ -244,7 +244,7 @@ then
|
|||||||
MES.new('error',"An error occured during loading, and some data was lost.")
|
MES.new('error',"An error occured during loading, and some data was lost.")
|
||||||
end
|
end
|
||||||
|
|
||||||
--Initialize fields, sequence, missions, gameEnv for cutsom game
|
-- Initialize fields, sequence, missions, gameEnv for cutsom game
|
||||||
local fieldData=loadFile('conf/customBoards','-string -canSkip')
|
local fieldData=loadFile('conf/customBoards','-string -canSkip')
|
||||||
if fieldData then
|
if fieldData then
|
||||||
fieldData=STRING.split(fieldData,"!")
|
fieldData=STRING.split(fieldData,"!")
|
||||||
@@ -269,7 +269,7 @@ end
|
|||||||
TABLE.complete(require"parts.customEnv0",CUSTOMENV)
|
TABLE.complete(require"parts.customEnv0",CUSTOMENV)
|
||||||
|
|
||||||
|
|
||||||
--Initialize image libs
|
-- Initialize image libs
|
||||||
IMG.init{
|
IMG.init{
|
||||||
lock='media/image/mess/lock.png',
|
lock='media/image/mess/lock.png',
|
||||||
dialCircle='media/image/mess/dialCircle.png',
|
dialCircle='media/image/mess/dialCircle.png',
|
||||||
@@ -348,7 +348,7 @@ SKIN.load{
|
|||||||
{name="wtf",path='media/image/skin/wtf_mrz.png'},
|
{name="wtf",path='media/image/skin/wtf_mrz.png'},
|
||||||
}
|
}
|
||||||
|
|
||||||
--Initialize sound libs
|
-- Initialize sound libs
|
||||||
SFX.init((function()--[Warning] Not loading files here, just get the list of sound needed
|
SFX.init((function()--[Warning] Not loading files here, just get the list of sound needed
|
||||||
local L={}
|
local L={}
|
||||||
for _,v in next,fs.getDirectoryItems('media/effect/chiptune/') do
|
for _,v in next,fs.getDirectoryItems('media/effect/chiptune/') do
|
||||||
@@ -377,7 +377,7 @@ VOC.init{
|
|||||||
'welcome',
|
'welcome',
|
||||||
}
|
}
|
||||||
|
|
||||||
--Initialize language lib
|
-- Initialize language lib
|
||||||
LANG.init('zh',
|
LANG.init('zh',
|
||||||
{
|
{
|
||||||
zh=require'parts.language.lang_zh',
|
zh=require'parts.language.lang_zh',
|
||||||
@@ -390,9 +390,9 @@ LANG.init('zh',
|
|||||||
ja=require'parts.language.lang_ja',
|
ja=require'parts.language.lang_ja',
|
||||||
symbol=require'parts.language.lang_symbol',
|
symbol=require'parts.language.lang_symbol',
|
||||||
zh_code=require'parts.language.lang_zh_code',
|
zh_code=require'parts.language.lang_zh_code',
|
||||||
--1. Add language file to LANG folder;
|
-- 1. Add language file to LANG folder;
|
||||||
--2. Require it;
|
-- 2. Require it;
|
||||||
--3. Add a button in parts/scenes/lang.lua;
|
-- 3. Add a button in parts/scenes/lang.lua;
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
block=BLOCK_NAMES
|
block=BLOCK_NAMES
|
||||||
@@ -414,7 +414,7 @@ LANG.init('zh',
|
|||||||
|
|
||||||
table.insert(_LOADTIMELIST_,("Initialize Parts: %.3fs"):format(TIME()-_LOADTIME_))
|
table.insert(_LOADTIMELIST_,("Initialize Parts: %.3fs"):format(TIME()-_LOADTIME_))
|
||||||
|
|
||||||
--Load background files from SOURCE ONLY
|
-- Load background files from SOURCE ONLY
|
||||||
for _,v in next,fs.getDirectoryItems('parts/backgrounds') do
|
for _,v in next,fs.getDirectoryItems('parts/backgrounds') do
|
||||||
if FILE.isSafe('parts/backgrounds/'..v) and v:sub(-3)=='lua' then
|
if FILE.isSafe('parts/backgrounds/'..v) and v:sub(-3)=='lua' then
|
||||||
local name=v:sub(1,-5)
|
local name=v:sub(1,-5)
|
||||||
@@ -422,7 +422,7 @@ for _,v in next,fs.getDirectoryItems('parts/backgrounds') do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
BG.remList('none')BG.remList('gray')BG.remList('custom')
|
BG.remList('none')BG.remList('gray')BG.remList('custom')
|
||||||
--Load scene files from SOURCE ONLY
|
-- Load scene files from SOURCE ONLY
|
||||||
for _,v in next,fs.getDirectoryItems('parts/scenes') do
|
for _,v in next,fs.getDirectoryItems('parts/scenes') do
|
||||||
if FILE.isSafe('parts/scenes/'..v) then
|
if FILE.isSafe('parts/scenes/'..v) then
|
||||||
local sceneName=v:sub(1,-5)
|
local sceneName=v:sub(1,-5)
|
||||||
@@ -430,9 +430,9 @@ for _,v in next,fs.getDirectoryItems('parts/scenes') do
|
|||||||
LANG.addScene(sceneName)
|
LANG.addScene(sceneName)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--Load mode files
|
-- Load mode files
|
||||||
for i=1,#MODES do
|
for i=1,#MODES do
|
||||||
local m=MODES[i]--Mode template
|
local m=MODES[i]-- Mode template
|
||||||
if FILE.isSafe('parts/modes/'..m.name) then
|
if FILE.isSafe('parts/modes/'..m.name) then
|
||||||
TABLE.complete(require('parts.modes.'..m.name),MODES[i])
|
TABLE.complete(require('parts.modes.'..m.name),MODES[i])
|
||||||
MODES[m.name],MODES[i]=MODES[i]
|
MODES[m.name],MODES[i]=MODES[i]
|
||||||
@@ -451,7 +451,7 @@ end
|
|||||||
|
|
||||||
table.insert(_LOADTIMELIST_,("Load Files: %.3fs"):format(TIME()-_LOADTIME_))
|
table.insert(_LOADTIMELIST_,("Load Files: %.3fs"):format(TIME()-_LOADTIME_))
|
||||||
|
|
||||||
--Update data
|
-- Update data
|
||||||
do
|
do
|
||||||
local needSave
|
local needSave
|
||||||
|
|
||||||
@@ -603,7 +603,7 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--First start
|
-- First start
|
||||||
FIRSTLAUNCH=STAT.run==0
|
FIRSTLAUNCH=STAT.run==0
|
||||||
if FIRSTLAUNCH and MOBILE then
|
if FIRSTLAUNCH and MOBILE then
|
||||||
SETTING.VKSwitch=true
|
SETTING.VKSwitch=true
|
||||||
@@ -611,10 +611,10 @@ if FIRSTLAUNCH and MOBILE then
|
|||||||
SETTING.cleanCanvas=true
|
SETTING.cleanCanvas=true
|
||||||
end
|
end
|
||||||
|
|
||||||
--Apply system setting
|
-- Apply system setting
|
||||||
applySettings()
|
applySettings()
|
||||||
|
|
||||||
--Load replays
|
-- Load replays
|
||||||
for _,fileName in next,fs.getDirectoryItems('replay') do
|
for _,fileName in next,fs.getDirectoryItems('replay') do
|
||||||
if fileName:sub(12,12):match("[a-zA-Z]") then
|
if fileName:sub(12,12):match("[a-zA-Z]") then
|
||||||
local date,mode,version,player,seed,setting,mod
|
local date,mode,version,player,seed,setting,mod
|
||||||
@@ -664,8 +664,8 @@ table.insert(_LOADTIMELIST_,("Initialize Data: %.3fs"):format(TIME()-_LOADTIME_)
|
|||||||
|
|
||||||
for i=1,#_LOADTIMELIST_ do LOG(_LOADTIMELIST_[i]) end
|
for i=1,#_LOADTIMELIST_ do LOG(_LOADTIMELIST_[i]) end
|
||||||
|
|
||||||
--Launch testing task if launch param received
|
-- Launch testing task if launch param received
|
||||||
if TABLE.find(arg,'--test') then
|
if TABLE.find(arg,'-- test') then
|
||||||
TASK.new(function()
|
TASK.new(function()
|
||||||
while not LOADED do coroutine.yield() end
|
while not LOADED do coroutine.yield() end
|
||||||
|
|
||||||
|
|||||||
428
parts/RSlist.lua
428
parts/RSlist.lua
@@ -1,43 +1,43 @@
|
|||||||
local defaultCenterTex=GC.DO{1,1}--No texture
|
local defaultCenterTex=GC.DO{1,1}-- No texture
|
||||||
local defaultCenterPos={--For SRS-like RSs
|
local defaultCenterPos={-- For SRS-like RSs
|
||||||
--Tetromino
|
-- Tetromino
|
||||||
{[0]={0,1},{1,0},{1,1},{1,1}},--Z
|
{[0]={0,1},{1,0},{1,1},{1,1}},-- Z
|
||||||
{[0]={0,1},{1,0},{1,1},{1,1}},--S
|
{[0]={0,1},{1,0},{1,1},{1,1}},-- S
|
||||||
{[0]={0,1},{1,0},{1,1},{1,1}},--J
|
{[0]={0,1},{1,0},{1,1},{1,1}},-- J
|
||||||
{[0]={0,1},{1,0},{1,1},{1,1}},--L
|
{[0]={0,1},{1,0},{1,1},{1,1}},-- L
|
||||||
{[0]={0,1},{1,0},{1,1},{1,1}},--T
|
{[0]={0,1},{1,0},{1,1},{1,1}},-- T
|
||||||
{[0]={.5,.5},{.5,.5},{.5,.5},{.5,.5}},--O
|
{[0]={.5,.5},{.5,.5},{.5,.5},{.5,.5}},-- O
|
||||||
{[0]={-.5,1.5},{1.5,-.5},{.5,1.5},{1.5,.5}},--I
|
{[0]={-.5,1.5},{1.5,-.5},{.5,1.5},{1.5,.5}},-- I
|
||||||
|
|
||||||
--Pentomino
|
-- Pentomino
|
||||||
{[0]={1,1},{1,1},{1,1},{1,1}},--Z5
|
{[0]={1,1},{1,1},{1,1},{1,1}},-- Z5
|
||||||
{[0]={1,1},{1,1},{1,1},{1,1}},--S5
|
{[0]={1,1},{1,1},{1,1},{1,1}},-- S5
|
||||||
{[0]={0,1},{1,0},{1,1},{1,1}},--P
|
{[0]={0,1},{1,0},{1,1},{1,1}},-- P
|
||||||
{[0]={0,1},{1,0},{1,1},{1,1}},--Q
|
{[0]={0,1},{1,0},{1,1},{1,1}},-- Q
|
||||||
{[0]={1,1},{1,1},{1,1},{1,1}},--F
|
{[0]={1,1},{1,1},{1,1},{1,1}},-- F
|
||||||
{[0]={1,1},{1,1},{1,1},{1,1}},--E
|
{[0]={1,1},{1,1},{1,1},{1,1}},-- E
|
||||||
{[0]={1,1},{1,1},{1,1},{1,1}},--T5
|
{[0]={1,1},{1,1},{1,1},{1,1}},-- T5
|
||||||
{[0]={0,1},{1,0},{1,1},{1,1}},--U
|
{[0]={0,1},{1,0},{1,1},{1,1}},-- U
|
||||||
{[0]={.5,1.5},{.5,.5},{1.5,.5},{1.5,1.5}},--V
|
{[0]={.5,1.5},{.5,.5},{1.5,.5},{1.5,1.5}},-- V
|
||||||
{[0]={1,1},{1,1},{1,1},{1,1}},--W
|
{[0]={1,1},{1,1},{1,1},{1,1}},-- W
|
||||||
{[0]={1,1},{1,1},{1,1},{1,1}},--X
|
{[0]={1,1},{1,1},{1,1},{1,1}},-- X
|
||||||
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},--J5
|
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},-- J5
|
||||||
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},--L5
|
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},-- L5
|
||||||
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},--R
|
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},-- R
|
||||||
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},--Y
|
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},-- Y
|
||||||
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},--N
|
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},-- N
|
||||||
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},--H
|
{[0]={.5,1.5},{1.5,.5},{.5,1.5},{1.5,.5}},-- H
|
||||||
{[0]={0,2},{2,0},{0,2},{2,0}},--I5
|
{[0]={0,2},{2,0},{0,2},{2,0}},-- I5
|
||||||
|
|
||||||
--Trimino
|
-- Trimino
|
||||||
{[0]={0,1},{1,0},{0,1},{1,0}},--I3
|
{[0]={0,1},{1,0},{0,1},{1,0}},-- I3
|
||||||
{[0]={.5,.5},{.5,.5},{.5,.5},{.5,.5}},--C
|
{[0]={.5,.5},{.5,.5},{.5,.5},{.5,.5}},-- C
|
||||||
|
|
||||||
--Domino
|
-- Domino
|
||||||
{[0]={-.5,.5},{.5,-.5},{.5,.5},{.5,.5}},--I2
|
{[0]={-.5,.5},{.5,-.5},{.5,.5},{.5,.5}},-- I2
|
||||||
|
|
||||||
--Dot
|
-- Dot
|
||||||
{[0]={0,0},{0,0},{0,0},{0,0}},--O1
|
{[0]={0,0},{0,0},{0,0},{0,0}},-- O1
|
||||||
}
|
}
|
||||||
|
|
||||||
local noKickSet,noKickSet_180 do
|
local noKickSet,noKickSet_180 do
|
||||||
@@ -52,14 +52,14 @@ local function _strToVec(list)
|
|||||||
return list
|
return list
|
||||||
end
|
end
|
||||||
|
|
||||||
--Use this if the block is centrosymmetry, *PTR!!!
|
-- Use this if the block is centrosymmetry, *PTR!!!
|
||||||
local function _centroSymSet(L)
|
local function _centroSymSet(L)
|
||||||
L[23]=L[01]L[32]=L[10]
|
L[23]=L[01]L[32]=L[10]
|
||||||
L[21]=L[03]L[12]=L[30]
|
L[21]=L[03]L[12]=L[30]
|
||||||
L[20]=L[02]L[31]=L[13]
|
L[20]=L[02]L[31]=L[13]
|
||||||
end
|
end
|
||||||
|
|
||||||
--Use this to copy a symmetry set
|
-- Use this to copy a symmetry set
|
||||||
local function _flipList(O)
|
local function _flipList(O)
|
||||||
if not O then
|
if not O then
|
||||||
return
|
return
|
||||||
@@ -91,21 +91,21 @@ end
|
|||||||
local TRS
|
local TRS
|
||||||
do
|
do
|
||||||
local OspinList={
|
local OspinList={
|
||||||
{111,5,2, 0,-1,0},{111,5,2,-1,-1,0},{111,5,0,-1, 0,0},--T
|
{111,5,2, 0,-1,0},{111,5,2,-1,-1,0},{111,5,0,-1, 0,0},-- T
|
||||||
{333,5,2,-1,-1,0},{333,5,2, 0,-1,0},{333,5,0, 0, 0,0},--T
|
{333,5,2,-1,-1,0},{333,5,2, 0,-1,0},{333,5,0, 0, 0,0},-- T
|
||||||
{313,1,2,-1, 0,0},{313,1,2, 0,-1,0},{313,1,2, 0, 0,0},--Z
|
{313,1,2,-1, 0,0},{313,1,2, 0,-1,0},{313,1,2, 0, 0,0},-- Z
|
||||||
{131,2,2, 0, 0,0},{131,2,2,-1,-1,0},{131,2,2,-1, 0,0},--S
|
{131,2,2, 0, 0,0},{131,2,2,-1,-1,0},{131,2,2,-1, 0,0},-- S
|
||||||
{131,1,2,-1, 0,0},{131,1,2, 0,-1,0},{131,1,2, 0, 0,0},--Z(misOrder)
|
{131,1,2,-1, 0,0},{131,1,2, 0,-1,0},{131,1,2, 0, 0,0},-- Z(misOrder)
|
||||||
{313,2,2, 0, 0,0},{313,2,2,-1,-1,0},{313,2,2,-1, 0,0},--S(misOrder)
|
{313,2,2, 0, 0,0},{313,2,2,-1,-1,0},{313,2,2,-1, 0,0},-- S(misOrder)
|
||||||
{331,3,2, 0,-1,0},--J(farDown)
|
{331,3,2, 0,-1,0},-- J(farDown)
|
||||||
{113,4,2,-1,-1,0},--L(farDown)
|
{113,4,2,-1,-1,0},-- L(farDown)
|
||||||
{113,3,2,-1,-1,0},{113,3,0, 0, 0,0},--J
|
{113,3,2,-1,-1,0},{113,3,0, 0, 0,0},-- J
|
||||||
{331,4,2, 0,-1,0},{331,4,0,-1, 0,0},--L
|
{331,4,2, 0,-1,0},{331,4,0,-1, 0,0},-- L
|
||||||
{222,7,0,-1, 1,1},{222,7,0,-2, 1,1},{222,7,0, 0, 1,1},--I(high)
|
{222,7,0,-1, 1,1},{222,7,0,-2, 1,1},{222,7,0, 0, 1,1},-- I(high)
|
||||||
{222,7,2,-1, 0,2},{222,7,2,-2, 0,2},{222,7,2, 0, 0,2},--I(low)
|
{222,7,2,-1, 0,2},{222,7,2,-2, 0,2},{222,7,2, 0, 0,2},-- I(low)
|
||||||
{121,6,0, 1,-1,2},{112,6,0, 2,-1,2},{122,6,0, 1,-2,2},--O
|
{121,6,0, 1,-1,2},{112,6,0, 2,-1,2},{122,6,0, 1,-2,2},-- O
|
||||||
{323,6,0,-1,-1,2},{332,6,0,-2,-1,2},{322,6,0,-1,-2,2},--O
|
{323,6,0,-1,-1,2},{332,6,0,-2,-1,2},{322,6,0,-1,-2,2},-- O
|
||||||
}--{keys, ID, dir, dx, dy, freeLevel (0=immovable, 1=U/D-immovable, 2=free)}
|
}-- {keys, ID, dir, dx, dy, freeLevel (0=immovable, 1=U/D-immovable, 2=free)}
|
||||||
local XspinList={
|
local XspinList={
|
||||||
{{ 1,-1},{ 1, 0},{ 1, 1},{ 1,-2},{ 1, 2}},
|
{{ 1,-1},{ 1, 0},{ 1, 1},{ 1,-2},{ 1, 2}},
|
||||||
{{ 0,-1},{ 0,-2},{ 0, 1},{ 0,-2},{ 0, 2}},
|
{{ 0,-1},{ 0,-2},{ 0, 1},{ 0,-2},{ 0, 2}},
|
||||||
@@ -137,8 +137,8 @@ do
|
|||||||
[20]={'+0+0','-1+0','+1+0','+0+1','+0-1'},
|
[20]={'+0+0','-1+0','+1+0','+0+1','+0-1'},
|
||||||
[13]={'+0+0','+0-1','+0+1','+0-2'},
|
[13]={'+0+0','+0-1','+0+1','+0-2'},
|
||||||
[31]={'+0+0','+0+1','+0-1','+0+2'},
|
[31]={'+0+0','+0+1','+0-1','+0+2'},
|
||||||
},--Z
|
},-- Z
|
||||||
false,--S
|
false,-- S
|
||||||
{
|
{
|
||||||
[01]={'+0+0','-1+0','-1+1','+0-2','+1+1','+0+1','+0-1'},
|
[01]={'+0+0','-1+0','-1+1','+0-2','+1+1','+0+1','+0-1'},
|
||||||
[10]={'+0+0','+1+0','+1-1','+0+2','-1-1','+0-1','+0+1'},
|
[10]={'+0+0','+1+0','+1-1','+0+2','-1-1','+0-1','+0+1'},
|
||||||
@@ -152,8 +152,8 @@ do
|
|||||||
[20]={'+0+0','+1+0','-1+0','+0+1','+0-1'},
|
[20]={'+0+0','+1+0','-1+0','+0+1','+0-1'},
|
||||||
[13]={'+0+0','+0-1','+0+1','+1+0'},
|
[13]={'+0+0','+0-1','+0+1','+1+0'},
|
||||||
[31]={'+0+0','+0+1','+0-1','-1+0'},
|
[31]={'+0+0','+0+1','+0-1','-1+0'},
|
||||||
},--J
|
},-- J
|
||||||
false,--L
|
false,-- L
|
||||||
{
|
{
|
||||||
[01]={'+0+0','-1+0','-1+1','+0-2','-1-2','+0+1'},
|
[01]={'+0+0','-1+0','-1+1','+0-2','-1-2','+0+1'},
|
||||||
[10]={'+0+0','+1+0','+1-1','+0+2','+1+2','+0+1','+0-1'},
|
[10]={'+0+0','+1+0','+1-1','+0+2','+1+2','+0+1','+0-1'},
|
||||||
@@ -167,7 +167,7 @@ do
|
|||||||
[20]={'+0+0','+1+0','-1+0','+0-1'},
|
[20]={'+0+0','+1+0','-1+0','+0-1'},
|
||||||
[13]={'+0+0','+0-1','+0+1','+1+0','+0-2','+0+2'},
|
[13]={'+0+0','+0-1','+0+1','+1+0','+0-2','+0+2'},
|
||||||
[31]={'+0+0','+0-1','+0+1','-1+0','+0-2','+0+2'},
|
[31]={'+0+0','+0-1','+0+1','-1+0','+0-2','+0+2'},
|
||||||
},--T
|
},-- T
|
||||||
function(P,d)
|
function(P,d)
|
||||||
if P.gameEnv.easyFresh then
|
if P.gameEnv.easyFresh then
|
||||||
P:freshBlock('fresh')
|
P:freshBlock('fresh')
|
||||||
@@ -220,7 +220,7 @@ do
|
|||||||
SFX.play('rotate',nil,P:getCenterX()*.15)
|
SFX.play('rotate',nil,P:getCenterX()*.15)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,--O
|
end,-- O
|
||||||
{
|
{
|
||||||
[01]={'+0+0','+0+1','+1+0','-2+0','-2-1','+1+2'},
|
[01]={'+0+0','+0+1','+1+0','-2+0','-2-1','+1+2'},
|
||||||
[10]={'+0+0','+2+0','-1+0','-1-2','+2+1','+0+1'},
|
[10]={'+0+0','+2+0','-1+0','-1-2','+2+1','+0+1'},
|
||||||
@@ -234,14 +234,14 @@ do
|
|||||||
[20]={'+0+0','+1+0','-1+0','+0+1','+0-1'},
|
[20]={'+0+0','+1+0','-1+0','+0+1','+0-1'},
|
||||||
[13]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
|
[13]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
|
||||||
[31]={'+0+0','+0-1','+1+0','-1+0','+0+1'},
|
[31]={'+0+0','+0-1','+1+0','-1+0','+0+1'},
|
||||||
},--I
|
},-- I
|
||||||
{
|
{
|
||||||
[01]={'+0+0','+0+1','+1+1','-1+0','+0-3','+0+2','+0-2','+0+3','-1+2'},
|
[01]={'+0+0','+0+1','+1+1','-1+0','+0-3','+0+2','+0-2','+0+3','-1+2'},
|
||||||
[10]={'+0+0','+0-1','-1-1','+1+0','+0-3','+0+2','+0-2','+0+3','+1-2'},
|
[10]={'+0+0','+0-1','-1-1','+1+0','+0-3','+0+2','+0-2','+0+3','+1-2'},
|
||||||
[03]={'+0+0','+1+0','+0-3','+0-1','+0+1','+0-2','+0+2','+0+3','+1+2'},
|
[03]={'+0+0','+1+0','+0-3','+0-1','+0+1','+0-2','+0+2','+0+3','+1+2'},
|
||||||
[30]={'+0+0','-1+0','+0-1','+0+1','+0-2','+0-3','+0+2','+0+3','-1-2'},
|
[30]={'+0+0','-1+0','+0-1','+0+1','+0-2','+0-3','+0+2','+0+3','-1-2'},
|
||||||
},--Z5
|
},-- Z5
|
||||||
false,--S5
|
false,-- S5
|
||||||
{
|
{
|
||||||
[01]={'+0+0','-1+0','-1+1','+0-2','-1-2','-1-1','+0+1'},
|
[01]={'+0+0','-1+0','-1+1','+0-2','-1-2','-1-1','+0+1'},
|
||||||
[10]={'+0+0','+1+0','+1-1','+0+2','+1+2','+0-1','+1+1'},
|
[10]={'+0+0','+1+0','+1-1','+0+2','+1+2','+0-1','+1+1'},
|
||||||
@@ -255,8 +255,8 @@ do
|
|||||||
[20]={'+0+0','+1+0','+0+1','+0-1'},
|
[20]={'+0+0','+1+0','+0+1','+0-1'},
|
||||||
[13]={'+0+0','+1+0','+0+1','-1+0'},
|
[13]={'+0+0','+1+0','+0+1','-1+0'},
|
||||||
[31]={'+0+0','-1+0','+0-1','+1+0'},
|
[31]={'+0+0','-1+0','+0-1','+1+0'},
|
||||||
},--P
|
},-- P
|
||||||
false,--Q
|
false,-- Q
|
||||||
{
|
{
|
||||||
[01]={'+0+0','-1+0','+1+0','-1+1','+0-2','+0-3'},
|
[01]={'+0+0','-1+0','+1+0','-1+1','+0-2','+0-3'},
|
||||||
[10]={'+0+0','+1+0','+1-1','-1+0','+0+2','+0+3'},
|
[10]={'+0+0','+1+0','+1-1','-1+0','+0+2','+0+3'},
|
||||||
@@ -270,8 +270,8 @@ do
|
|||||||
[20]={'+0+0','-1+0','+1+0','+1+1'},
|
[20]={'+0+0','-1+0','+1+0','+1+1'},
|
||||||
[13]={'+0+0','+0-1','-1+1','+0+1'},
|
[13]={'+0+0','+0-1','-1+1','+0+1'},
|
||||||
[31]={'+0+0','+0-1','+1-1','+0+1'},
|
[31]={'+0+0','+0-1','+1-1','+0+1'},
|
||||||
},--F
|
},-- F
|
||||||
false,--E
|
false,-- E
|
||||||
{
|
{
|
||||||
[01]={'+0+0','+0-1','-1-1','+1+0','+1+1','+0-3','-1+0','+0+2','-1+2'},
|
[01]={'+0+0','+0-1','-1-1','+1+0','+1+1','+0-3','-1+0','+0+2','-1+2'},
|
||||||
[10]={'+0+0','+1+0','+0-1','-1-1','+0-2','-1+1','+0-3','+1-2','+0+1'},
|
[10]={'+0+0','+1+0','+0-1','-1-1','+0-2','-1+1','+0-3','+1-2','+0+1'},
|
||||||
@@ -285,7 +285,7 @@ do
|
|||||||
[20]={'+0+0','+0-1','+0+1','+0-2'},
|
[20]={'+0+0','+0-1','+0+1','+0-2'},
|
||||||
[13]={'+0+0','+1+0','-1+1','-2+0'},
|
[13]={'+0+0','+1+0','-1+1','-2+0'},
|
||||||
[31]={'+0+0','-1+0','+1+1','+2+0'},
|
[31]={'+0+0','-1+0','+1+1','+2+0'},
|
||||||
},--T5
|
},-- T5
|
||||||
{
|
{
|
||||||
[01]={'+0+0','-1+0','-1+1','+0-2','-1-2'},
|
[01]={'+0+0','-1+0','-1+1','+0-2','-1-2'},
|
||||||
[10]={'+0+0','+1+0','+1-1','+0+2','+1+2'},
|
[10]={'+0+0','+1+0','+1-1','+0+2','+1+2'},
|
||||||
@@ -299,7 +299,7 @@ do
|
|||||||
[20]={'+0+0','+0-1'},
|
[20]={'+0+0','+0-1'},
|
||||||
[13]={'+0+0','+0-1','+0+1','+1+0'},
|
[13]={'+0+0','+0-1','+0+1','+1+0'},
|
||||||
[31]={'+0+0','+0-1','+0+1','-1+0'},
|
[31]={'+0+0','+0-1','+0+1','-1+0'},
|
||||||
},--U
|
},-- U
|
||||||
{
|
{
|
||||||
[01]={'+0+0','+0+1','-1+0','+0-2','-1-2'},
|
[01]={'+0+0','+0+1','-1+0','+0-2','-1-2'},
|
||||||
[10]={'+0+0','+0+1','+1+0','+0-2','+1-2'},
|
[10]={'+0+0','+0+1','+1+0','+0-2','+1-2'},
|
||||||
@@ -313,7 +313,7 @@ do
|
|||||||
[20]={'+0+0','+1-1','-1+1'},
|
[20]={'+0+0','+1-1','-1+1'},
|
||||||
[13]={'+0+0','+1+1','-1-1'},
|
[13]={'+0+0','+1+1','-1-1'},
|
||||||
[31]={'+0+0','-1-1','+1+1'},
|
[31]={'+0+0','-1-1','+1+1'},
|
||||||
},--V
|
},-- V
|
||||||
{
|
{
|
||||||
[01]={'+0+0','+0-1','-1+0','+1+0','+1-1','+0+2'},
|
[01]={'+0+0','+0-1','-1+0','+1+0','+1-1','+0+2'},
|
||||||
[10]={'+0+0','+0-1','-1-1','+0+1','+0-2','+1-2','+0+2'},
|
[10]={'+0+0','+0-1','-1-1','+0+1','+0-2','+1-2','+0+2'},
|
||||||
@@ -327,7 +327,7 @@ do
|
|||||||
[20]={'+0+0','+0+1','+1+0'},
|
[20]={'+0+0','+0+1','+1+0'},
|
||||||
[13]={'+0+0','+0+1','-1+0'},
|
[13]={'+0+0','+0+1','-1+0'},
|
||||||
[31]={'+0+0','+0-1','+1+0'},
|
[31]={'+0+0','+0-1','+1+0'},
|
||||||
},--W
|
},-- W
|
||||||
function(P,d)
|
function(P,d)
|
||||||
if P.type=='human' then
|
if P.type=='human' then
|
||||||
SFX.play('rotate',nil,P:getCenterX()*.15)
|
SFX.play('rotate',nil,P:getCenterX()*.15)
|
||||||
@@ -344,7 +344,7 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
P:freshBlock('fresh')
|
P:freshBlock('fresh')
|
||||||
end,--X
|
end,-- X
|
||||||
{
|
{
|
||||||
[01]={'+0+0','-1+0','-1+1','+0-3','-1+1','-1+2','+0+1'},
|
[01]={'+0+0','-1+0','-1+1','+0-3','-1+1','-1+2','+0+1'},
|
||||||
[10]={'+0+0','-1+0','+1-1','+0+3','+1-1','+1-2','+0+1'},
|
[10]={'+0+0','-1+0','+1-1','+0+3','+1-1','+1-2','+0+1'},
|
||||||
@@ -358,8 +358,8 @@ do
|
|||||||
[20]={'+0+0','+0+1','+1+1','-1+1','+1+0','-2+1'},
|
[20]={'+0+0','+0+1','+1+1','-1+1','+1+0','-2+1'},
|
||||||
[13]={'+0+0','-1+0','-1-1','+0+1','-1-2'},
|
[13]={'+0+0','-1+0','-1-1','+0+1','-1-2'},
|
||||||
[31]={'+0+0','+1+0','+1+1','+0-1','+1+2'},
|
[31]={'+0+0','+1+0','+1+1','+0-1','+1+2'},
|
||||||
},--J5
|
},-- J5
|
||||||
false,--L5
|
false,-- L5
|
||||||
{
|
{
|
||||||
[01]={'+0+0','-1+0','-1+1','+1+0','-1+2','-1-1','+0-3','+0+1'},
|
[01]={'+0+0','-1+0','-1+1','+1+0','-1+2','-1-1','+0-3','+0+1'},
|
||||||
[10]={'+0+0','-1+0','+1+0','+1-1','+1-2','+1+1','+0+3','+0+1'},
|
[10]={'+0+0','-1+0','+1+0','+1-1','+1-2','+1+1','+0+3','+0+1'},
|
||||||
@@ -373,8 +373,8 @@ do
|
|||||||
[20]={'+0+0','+0+1','-1+1','+1+0','-2+1','+0-1'},
|
[20]={'+0+0','+0+1','-1+1','+1+0','-2+1','+0-1'},
|
||||||
[13]={'+0+0','-1+0','-1-1','+0+1','-1-2'},
|
[13]={'+0+0','-1+0','-1-1','+0+1','-1-2'},
|
||||||
[31]={'+0+0','+1+0','+1+1','+0-1','+1+2'},
|
[31]={'+0+0','+1+0','+1+1','+0-1','+1+2'},
|
||||||
},--R
|
},-- R
|
||||||
false,--Y
|
false,-- Y
|
||||||
{
|
{
|
||||||
[01]={'+0+0','-1+0','-1+1','+0+1','+1+0','+1+1','-1+2','-2+0','+0-2'},
|
[01]={'+0+0','-1+0','-1+1','+0+1','+1+0','+1+1','-1+2','-2+0','+0-2'},
|
||||||
[10]={'+0+0','+1+0','-1+0','+0-1','-1-1','+1-1','+1-2','+2+0','+0+2'},
|
[10]={'+0+0','+1+0','-1+0','+0-1','-1-1','+1-1','+1-2','+2+0','+0+2'},
|
||||||
@@ -388,20 +388,20 @@ do
|
|||||||
[20]={'+0+0','+1+0','+0-2','+0+1'},
|
[20]={'+0+0','+1+0','+0-2','+0+1'},
|
||||||
[13]={'+0+0','-1+0','-1-1','+0+1','+1+2'},
|
[13]={'+0+0','-1+0','-1-1','+0+1','+1+2'},
|
||||||
[31]={'+0+0','+1+0','+1+1','+0-1','-1-2'},
|
[31]={'+0+0','+1+0','+1+1','+0-1','-1-2'},
|
||||||
},--N
|
},-- N
|
||||||
false,--H
|
false,-- H
|
||||||
{
|
{
|
||||||
[01]={'+0+0','+1-1','+1+0','+1+1','+0+1','-1+1','-1+0','-1-1','+0-1','+0-2','-2-1','-2-2','+2+0','+2-1','+2-2','+1+2','+2+2','-1+2','-2+2'},
|
[01]={'+0+0','+1-1','+1+0','+1+1','+0+1','-1+1','-1+0','-1-1','+0-1','+0-2','-2-1','-2-2','+2+0','+2-1','+2-2','+1+2','+2+2','-1+2','-2+2'},
|
||||||
[10]={'+0+0','-1+0','-1-1','+0-1','+1-1','-2-2','-2-1','-2+0','-1-2','+0-2','+1-2','+2-2','-1+1','-2+1','-2+2','+1+0','+2+0','+2-1','+0+1','+1-1','+2-2'},
|
[10]={'+0+0','-1+0','-1-1','+0-1','+1-1','-2-2','-2-1','-2+0','-1-2','+0-2','+1-2','+2-2','-1+1','-2+1','-2+2','+1+0','+2+0','+2-1','+0+1','+1-1','+2-2'},
|
||||||
[03]={'+0+0','-1-1','-1+0','-1+1','+0+1','+1+1','+1+0','+1-1','+0-1','+0-2','+2-1','+2-2','-2+0','-2-1','-2-2','-1+2','-2+2','+1+2','+2+2'},
|
[03]={'+0+0','-1-1','-1+0','-1+1','+0+1','+1+1','+1+0','+1-1','+0-1','+0-2','+2-1','+2-2','-2+0','-2-1','-2-2','-1+2','-2+2','+1+2','+2+2'},
|
||||||
[30]={'+0+0','+1+0','+1-1','+0-1','-1-1','+2-2','+2-1','+2+0','+1-2','+0-2','-1-2','-2-2','+1+1','+2+1','+2+2','-1+0','-2+0','-2-1','+0+1','-1-1','-2-2'},
|
[30]={'+0+0','+1+0','+1-1','+0-1','-1-1','+2-2','+2-1','+2+0','+1-2','+0-2','-1-2','-2-2','+1+1','+2+1','+2+2','-1+0','-2+0','-2-1','+0+1','-1-1','-2-2'},
|
||||||
},--I5
|
},-- I5
|
||||||
{
|
{
|
||||||
[01]={'+0+0','-1+0','-1-1','+1+1','-1+1'},
|
[01]={'+0+0','-1+0','-1-1','+1+1','-1+1'},
|
||||||
[10]={'+0+0','-1+0','+1+0','-1-1','+1+1'},
|
[10]={'+0+0','-1+0','+1+0','-1-1','+1+1'},
|
||||||
[03]={'+0+0','+1+0','+1-1','-1+1','+1+1'},
|
[03]={'+0+0','+1+0','+1-1','-1+1','+1+1'},
|
||||||
[30]={'+0+0','+1+0','-1+0','+1-1','-1+1'},
|
[30]={'+0+0','+1+0','-1+0','+1-1','-1+1'},
|
||||||
},--I3
|
},-- I3
|
||||||
{
|
{
|
||||||
[01]={'+0+0','-1+0','+1+0'},
|
[01]={'+0+0','-1+0','+1+0'},
|
||||||
[10]={'+0+0','+1+0','-1+0'},
|
[10]={'+0+0','+1+0','-1+0'},
|
||||||
@@ -415,7 +415,7 @@ do
|
|||||||
[20]={'+0+0','+0+1','-1+1','+1+1'},
|
[20]={'+0+0','+0+1','-1+1','+1+1'},
|
||||||
[13]={'+0+0','+0-1','-1-1','+1-1'},
|
[13]={'+0+0','+0-1','-1-1','+1-1'},
|
||||||
[31]={'+0+0','+0+1','+1+1','-1+1'},
|
[31]={'+0+0','+0+1','+1+1','-1+1'},
|
||||||
},--C
|
},-- C
|
||||||
{
|
{
|
||||||
[01]={'+0+0','-1+0','+0+1'},
|
[01]={'+0+0','-1+0','+0+1'},
|
||||||
[10]={'+0+0','+1+0','+0+1'},
|
[10]={'+0+0','+1+0','+0+1'},
|
||||||
@@ -429,22 +429,22 @@ do
|
|||||||
[20]={'+0+0','+0+1','+0-1'},
|
[20]={'+0+0','+0+1','+0-1'},
|
||||||
[13]={'+0+0','-1+0','+1+0'},
|
[13]={'+0+0','-1+0','+1+0'},
|
||||||
[31]={'+0+0','+1+0','-1+0'},
|
[31]={'+0+0','+1+0','-1+0'},
|
||||||
},--I2
|
},-- I2
|
||||||
nil,--O1
|
nil,-- O1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TRS.centerDisp[6]=false
|
TRS.centerDisp[6]=false
|
||||||
TRS.centerDisp[18]=false
|
TRS.centerDisp[18]=false
|
||||||
TRS.kickTable[2]= _reflect(TRS.kickTable[1])--SZ
|
TRS.kickTable[2]= _reflect(TRS.kickTable[1])-- SZ
|
||||||
TRS.kickTable[4]= _reflect(TRS.kickTable[3])--LJ
|
TRS.kickTable[4]= _reflect(TRS.kickTable[3])-- LJ
|
||||||
TRS.kickTable[9]= _reflect(TRS.kickTable[8])--S5Z5
|
TRS.kickTable[9]= _reflect(TRS.kickTable[8])-- S5Z5
|
||||||
TRS.kickTable[11]=_reflect(TRS.kickTable[10])--PQ
|
TRS.kickTable[11]=_reflect(TRS.kickTable[10])-- PQ
|
||||||
TRS.kickTable[13]=_reflect(TRS.kickTable[12])--FE
|
TRS.kickTable[13]=_reflect(TRS.kickTable[12])-- FE
|
||||||
TRS.kickTable[20]=_reflect(TRS.kickTable[19])--L5J5
|
TRS.kickTable[20]=_reflect(TRS.kickTable[19])-- L5J5
|
||||||
TRS.kickTable[22]=_reflect(TRS.kickTable[21])--RY
|
TRS.kickTable[22]=_reflect(TRS.kickTable[21])-- RY
|
||||||
TRS.kickTable[24]=_reflect(TRS.kickTable[23])--NH
|
TRS.kickTable[24]=_reflect(TRS.kickTable[23])-- NH
|
||||||
_centroSymSet(TRS.kickTable[8])_centroSymSet(TRS.kickTable[9])--S5Z5
|
_centroSymSet(TRS.kickTable[8])_centroSymSet(TRS.kickTable[9])-- S5Z5
|
||||||
_centroSymSet(TRS.kickTable[25])_centroSymSet(TRS.kickTable[26])--I5I3
|
_centroSymSet(TRS.kickTable[25])_centroSymSet(TRS.kickTable[26])-- I5I3
|
||||||
end
|
end
|
||||||
|
|
||||||
local SRS
|
local SRS
|
||||||
@@ -469,12 +469,12 @@ do
|
|||||||
[32]={'+0+0','-1+0','-1-1','+0+2','-1+2'},
|
[32]={'+0+0','-1+0','-1-1','+0+2','-1+2'},
|
||||||
[23]={'+0+0','+1+0','+1+1','+0-2','+1-2'},
|
[23]={'+0+0','+1+0','+1+1','+0-2','+1-2'},
|
||||||
[02]={'+0+0'},[20]={'+0+0'},[13]={'+0+0'},[31]={'+0+0'},
|
[02]={'+0+0'},[20]={'+0+0'},[13]={'+0+0'},[31]={'+0+0'},
|
||||||
},--Z
|
},-- Z
|
||||||
false,--S
|
false,-- S
|
||||||
false,--J
|
false,-- J
|
||||||
false,--L
|
false,-- L
|
||||||
false,--T
|
false,-- T
|
||||||
noKickSet,--O
|
noKickSet,-- O
|
||||||
{
|
{
|
||||||
[01]={'+0+0','-2+0','+1+0','-2-1','+1+2'},
|
[01]={'+0+0','-2+0','+1+0','-2-1','+1+2'},
|
||||||
[10]={'+0+0','+2+0','-1+0','+2+1','-1-2'},
|
[10]={'+0+0','+2+0','-1+0','+2+1','-1-2'},
|
||||||
@@ -485,7 +485,7 @@ do
|
|||||||
[30]={'+0+0','+1+0','-2+0','+1-2','-2+1'},
|
[30]={'+0+0','+1+0','-2+0','+1-2','-2+1'},
|
||||||
[03]={'+0+0','-1+0','+2+0','-1+2','+2-1'},
|
[03]={'+0+0','-1+0','+2+0','-1+2','+2-1'},
|
||||||
[02]={'+0+0'},[20]={'+0+0'},[13]={'+0+0'},[31]={'+0+0'},
|
[02]={'+0+0'},[20]={'+0+0'},[13]={'+0+0'},[31]={'+0+0'},
|
||||||
}--I
|
}-- I
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for i=2,5 do SRS.kickTable[i]=SRS.kickTable[1] end
|
for i=2,5 do SRS.kickTable[i]=SRS.kickTable[1] end
|
||||||
@@ -519,12 +519,12 @@ do
|
|||||||
[20]={'+0+0','+1+0','-1+0','+0-1','+0+1'},
|
[20]={'+0+0','+1+0','-1+0','+0-1','+0+1'},
|
||||||
[13]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
|
[13]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
|
||||||
[31]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
|
[31]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
|
||||||
},--Z
|
},-- Z
|
||||||
false,--S
|
false,-- S
|
||||||
false,--J
|
false,-- J
|
||||||
false,--L
|
false,-- L
|
||||||
false,--T
|
false,-- T
|
||||||
noKickSet,--O
|
noKickSet,-- O
|
||||||
{
|
{
|
||||||
[01]={'+0+0','-2+0','+1+0','-2-1','+1+2'},
|
[01]={'+0+0','-2+0','+1+0','-2-1','+1+2'},
|
||||||
[10]={'+0+0','+2+0','-1+0','+2+1','-1-2'},
|
[10]={'+0+0','+2+0','-1+0','+2+1','-1-2'},
|
||||||
@@ -538,7 +538,7 @@ do
|
|||||||
[20]={'+0+0','+1+0','-1+0','+0+1','+0-1'},
|
[20]={'+0+0','+1+0','-1+0','+0+1','+0-1'},
|
||||||
[13]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
|
[13]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
|
||||||
[31]={'+0+0','+0-1','+1+0','-1+0','+0+1'},
|
[31]={'+0+0','+0-1','+1+0','-1+0','+0+1'},
|
||||||
}--I
|
}-- I
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for i=2,5 do SRS_plus.kickTable[i]=SRS_plus.kickTable[1] end
|
for i=2,5 do SRS_plus.kickTable[i]=SRS_plus.kickTable[1] end
|
||||||
@@ -570,19 +570,19 @@ do
|
|||||||
[20]={'+0+0','+1+0','-1+0','+0-1','+0+1'},
|
[20]={'+0+0','+1+0','-1+0','+0-1','+0+1'},
|
||||||
[13]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
|
[13]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
|
||||||
[31]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
|
[31]={'+0+0','+0-1','-1+0','+1+0','+0+1'},
|
||||||
},--Z
|
},-- Z
|
||||||
false,--S
|
false,-- S
|
||||||
false,--J
|
false,-- J
|
||||||
false,--L
|
false,-- L
|
||||||
false,--T
|
false,-- T
|
||||||
noKickSet,--O
|
noKickSet,-- O
|
||||||
false,--I
|
false,-- I
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for i=2,5 do SRS_X.kickTable[i]=SRS_X.kickTable[1] end
|
for i=2,5 do SRS_X.kickTable[i]=SRS_X.kickTable[1] end
|
||||||
for i=7,29 do SRS_X.kickTable[i]=TRS.kickTable[i] end
|
for i=7,29 do SRS_X.kickTable[i]=TRS.kickTable[i] end
|
||||||
SRS_X.kickTable[10]=SRS_X.kickTable[1]--P
|
SRS_X.kickTable[10]=SRS_X.kickTable[1]-- P
|
||||||
SRS_X.kickTable[11]=SRS_X.kickTable[1]--Q
|
SRS_X.kickTable[11]=SRS_X.kickTable[1]-- Q
|
||||||
end
|
end
|
||||||
|
|
||||||
local BiRS
|
local BiRS
|
||||||
@@ -591,37 +591,37 @@ do
|
|||||||
local L=_strToVec{'+0+0','+1+0','+1-1','+0-1','+1+1','-1-1','-1+0','+0+1','-1+1','+0+2','+1+2','-1+2','+2+0','-2+0'}
|
local L=_strToVec{'+0+0','+1+0','+1-1','+0-1','+1+1','-1-1','-1+0','+0+1','-1+1','+0+2','+1+2','-1+2','+2+0','-2+0'}
|
||||||
local F=_strToVec{'+0+0','+0-1','+0+1','+0+2'}
|
local F=_strToVec{'+0+0','+0-1','+0+1','+0+2'}
|
||||||
local list={
|
local list={
|
||||||
{[02]=L,[20]=R,[13]=R,[31]=L},--Z
|
{[02]=L,[20]=R,[13]=R,[31]=L},-- Z
|
||||||
{[02]=R,[20]=L,[13]=L,[31]=R},--S
|
{[02]=R,[20]=L,[13]=L,[31]=R},-- S
|
||||||
{[02]=L,[20]=R,[13]=L,[31]=R},--J
|
{[02]=L,[20]=R,[13]=L,[31]=R},-- J
|
||||||
{[02]=R,[20]=L,[13]=L,[31]=R},--L
|
{[02]=R,[20]=L,[13]=L,[31]=R},-- L
|
||||||
{[02]=F,[20]=F,[13]=L,[31]=R},--T
|
{[02]=F,[20]=F,[13]=L,[31]=R},-- T
|
||||||
{[02]=F,[20]=F,[13]=F,[31]=F},--O
|
{[02]=F,[20]=F,[13]=F,[31]=F},-- O
|
||||||
{[02]=F,[20]=F,[13]=R,[31]=L},--I
|
{[02]=F,[20]=F,[13]=R,[31]=L},-- I
|
||||||
|
|
||||||
{[02]=L,[20]=L,[13]=R,[31]=R},--Z5
|
{[02]=L,[20]=L,[13]=R,[31]=R},-- Z5
|
||||||
{[02]=R,[20]=R,[13]=L,[31]=L},--S5
|
{[02]=R,[20]=R,[13]=L,[31]=L},-- S5
|
||||||
{[02]=L,[20]=R,[13]=L,[31]=R},--P
|
{[02]=L,[20]=R,[13]=L,[31]=R},-- P
|
||||||
{[02]=R,[20]=L,[13]=R,[31]=L},--Q
|
{[02]=R,[20]=L,[13]=R,[31]=L},-- Q
|
||||||
{[02]=R,[20]=L,[13]=L,[31]=R},--F
|
{[02]=R,[20]=L,[13]=L,[31]=R},-- F
|
||||||
{[02]=L,[20]=R,[13]=R,[31]=L},--E
|
{[02]=L,[20]=R,[13]=R,[31]=L},-- E
|
||||||
{[02]=F,[20]=F,[13]=L,[31]=R},--T5
|
{[02]=F,[20]=F,[13]=L,[31]=R},-- T5
|
||||||
{[02]=F,[20]=F,[13]=L,[31]=R},--U
|
{[02]=F,[20]=F,[13]=L,[31]=R},-- U
|
||||||
{[02]=R,[20]=L,[13]=L,[31]=R},--V
|
{[02]=R,[20]=L,[13]=L,[31]=R},-- V
|
||||||
{[02]=R,[20]=L,[13]=L,[31]=R},--W
|
{[02]=R,[20]=L,[13]=L,[31]=R},-- W
|
||||||
{[02]=F,[20]=F,[13]=F,[31]=F},--X
|
{[02]=F,[20]=F,[13]=F,[31]=F},-- X
|
||||||
{[02]=L,[20]=R,[13]=R,[31]=L},--J5
|
{[02]=L,[20]=R,[13]=R,[31]=L},-- J5
|
||||||
{[02]=R,[20]=L,[13]=L,[31]=R},--L5
|
{[02]=R,[20]=L,[13]=L,[31]=R},-- L5
|
||||||
{[02]=L,[20]=R,[13]=R,[31]=L},--R
|
{[02]=L,[20]=R,[13]=R,[31]=L},-- R
|
||||||
{[02]=R,[20]=L,[13]=L,[31]=R},--Y
|
{[02]=R,[20]=L,[13]=L,[31]=R},-- Y
|
||||||
{[02]=L,[20]=R,[13]=R,[31]=L},--N
|
{[02]=L,[20]=R,[13]=R,[31]=L},-- N
|
||||||
{[02]=R,[20]=L,[13]=L,[31]=R},--H
|
{[02]=R,[20]=L,[13]=L,[31]=R},-- H
|
||||||
{[02]=F,[20]=F,[13]=F,[31]=F},--I5
|
{[02]=F,[20]=F,[13]=F,[31]=F},-- I5
|
||||||
|
|
||||||
{[02]=F,[20]=F,[13]=F,[31]=F},--I3
|
{[02]=F,[20]=F,[13]=F,[31]=F},-- I3
|
||||||
{[02]=R,[20]=L,[13]=L,[31]=R},--C
|
{[02]=R,[20]=L,[13]=L,[31]=R},-- C
|
||||||
{[02]=F,[20]=F,[13]=R,[31]=L},--I2
|
{[02]=F,[20]=F,[13]=R,[31]=L},-- I2
|
||||||
{[02]=F,[20]=F,[13]=F,[31]=F},--O1
|
{[02]=F,[20]=F,[13]=F,[31]=F},-- O1
|
||||||
}
|
}
|
||||||
for i=1,29 do
|
for i=1,29 do
|
||||||
local a,b=R,L
|
local a,b=R,L
|
||||||
@@ -700,7 +700,7 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Try release left/right, then softdrop, failed to rotate otherwise
|
-- Try release left/right, then softdrop, failed to rotate otherwise
|
||||||
if dx~=0 then
|
if dx~=0 then
|
||||||
dx=0
|
dx=0
|
||||||
elseif dy~=0 then
|
elseif dy~=0 then
|
||||||
@@ -728,24 +728,24 @@ do
|
|||||||
[02]=upOnly,[20]=upOnly,[13]=upOnly,[31]=upOnly,
|
[02]=upOnly,[20]=upOnly,[13]=upOnly,[31]=upOnly,
|
||||||
}
|
}
|
||||||
local centerPos=TABLE.copy(defaultCenterPos)
|
local centerPos=TABLE.copy(defaultCenterPos)
|
||||||
centerPos[1]={[0]={1,1},{1,0},{1,1},{1,0}}--Z
|
centerPos[1]={[0]={1,1},{1,0},{1,1},{1,0}}-- Z
|
||||||
centerPos[2]={[0]={1,1},{1,1},{1,1},{1,1}}--S
|
centerPos[2]={[0]={1,1},{1,1},{1,1},{1,1}}-- S
|
||||||
centerPos[3]={[0]={1,1},{1,0},{1,1},{1,1}}--L
|
centerPos[3]={[0]={1,1},{1,0},{1,1},{1,1}}-- L
|
||||||
centerPos[4]={[0]={1,1},{1,0},{1,1},{1,1}}--J
|
centerPos[4]={[0]={1,1},{1,0},{1,1},{1,1}}-- J
|
||||||
centerPos[5]={[0]={1,1},{1,0},{1,1},{1,1}}--T
|
centerPos[5]={[0]={1,1},{1,0},{1,1},{1,1}}-- T
|
||||||
centerPos[7]={[0]={0,2},{2,0},{0,2},{2,0}}--I
|
centerPos[7]={[0]={0,2},{2,0},{0,2},{2,0}}-- I
|
||||||
centerPos[10]={[0]={1,1},{1,0},{1,1},{1,0}}--P
|
centerPos[10]={[0]={1,1},{1,0},{1,1},{1,0}}-- P
|
||||||
centerPos[11]={[0]={1,1},{1,1},{1,1},{1,1}}--Q
|
centerPos[11]={[0]={1,1},{1,1},{1,1},{1,1}}-- Q
|
||||||
centerPos[15]={[0]={1,1},{1,0},{1,1},{1,1}}--U
|
centerPos[15]={[0]={1,1},{1,0},{1,1},{1,1}}-- U
|
||||||
centerPos[16]={[0]={1,1},{1,1},{1,1},{1,1}}--V
|
centerPos[16]={[0]={1,1},{1,1},{1,1},{1,1}}-- V
|
||||||
centerPos[19]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--J5
|
centerPos[19]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- J5
|
||||||
centerPos[20]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--L5
|
centerPos[20]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- L5
|
||||||
centerPos[21]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--R
|
centerPos[21]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- R
|
||||||
centerPos[22]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--Y
|
centerPos[22]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- Y
|
||||||
centerPos[23]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--N
|
centerPos[23]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- N
|
||||||
centerPos[24]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--H
|
centerPos[24]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- H
|
||||||
centerPos[26]={[0]={0,1},{0,0},{0,1},{0,0}}--I3
|
centerPos[26]={[0]={0,1},{0,0},{0,1},{0,0}}-- I3
|
||||||
centerPos[28]={[0]={0,1},{0,0},{0,1},{0,0}}--I2
|
centerPos[28]={[0]={0,1},{0,0},{0,1},{0,0}}-- I2
|
||||||
|
|
||||||
ARS_Z={
|
ARS_Z={
|
||||||
centerTex=GC.DO{10,10,
|
centerTex=GC.DO{10,10,
|
||||||
@@ -765,24 +765,24 @@ end
|
|||||||
local DRS_weak
|
local DRS_weak
|
||||||
do
|
do
|
||||||
local centerPos=TABLE.copy(defaultCenterPos)
|
local centerPos=TABLE.copy(defaultCenterPos)
|
||||||
centerPos[1]={[0]={1,1},{1,0},{1,1},{1,1}}--Z
|
centerPos[1]={[0]={1,1},{1,0},{1,1},{1,1}}-- Z
|
||||||
centerPos[2]={[0]={1,1},{1,0},{1,1},{1,1}}--S
|
centerPos[2]={[0]={1,1},{1,0},{1,1},{1,1}}-- S
|
||||||
centerPos[3]={[0]={1,1},{1,0},{1,1},{1,1}}--L
|
centerPos[3]={[0]={1,1},{1,0},{1,1},{1,1}}-- L
|
||||||
centerPos[4]={[0]={1,1},{1,0},{1,1},{1,1}}--J
|
centerPos[4]={[0]={1,1},{1,0},{1,1},{1,1}}-- J
|
||||||
centerPos[5]={[0]={1,1},{1,0},{1,1},{1,1}}--T
|
centerPos[5]={[0]={1,1},{1,0},{1,1},{1,1}}-- T
|
||||||
centerPos[7]={[0]={.5,1.5},{1.5,-.5},{.5,1.5},{1.5,.5}}--I
|
centerPos[7]={[0]={.5,1.5},{1.5,-.5},{.5,1.5},{1.5,.5}}-- I
|
||||||
centerPos[10]={[0]={1,1},{1,0},{1,1},{1,0}}--P
|
centerPos[10]={[0]={1,1},{1,0},{1,1},{1,0}}-- P
|
||||||
centerPos[11]={[0]={1,1},{1,1},{1,1},{1,1}}--Q
|
centerPos[11]={[0]={1,1},{1,1},{1,1},{1,1}}-- Q
|
||||||
centerPos[15]={[0]={1,1},{1,0},{1,1},{1,1}}--U
|
centerPos[15]={[0]={1,1},{1,0},{1,1},{1,1}}-- U
|
||||||
centerPos[16]={[0]={1,1},{1,1},{1,1},{1,1}}--V
|
centerPos[16]={[0]={1,1},{1,1},{1,1},{1,1}}-- V
|
||||||
centerPos[19]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--J5
|
centerPos[19]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- J5
|
||||||
centerPos[20]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--L5
|
centerPos[20]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- L5
|
||||||
centerPos[21]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--R
|
centerPos[21]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- R
|
||||||
centerPos[22]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--Y
|
centerPos[22]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- Y
|
||||||
centerPos[23]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--N
|
centerPos[23]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- N
|
||||||
centerPos[24]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}--H
|
centerPos[24]={[0]={1.5,1.5},{1.5,0.5},{1.5,1.5},{1.5,0.5}}-- H
|
||||||
centerPos[26]={[0]={0,1},{0,0},{0,1},{0,0}}--I3
|
centerPos[26]={[0]={0,1},{0,0},{0,1},{0,0}}-- I3
|
||||||
centerPos[28]={[0]={0,1},{0,0},{0,1},{0,0}}--I2
|
centerPos[28]={[0]={0,1},{0,0},{0,1},{0,0}}-- I2
|
||||||
|
|
||||||
local L={'+0+0','-1+0','+1+0','+0-1','-1-1','+1-1'}
|
local L={'+0+0','-1+0','+1+0','+0-1','-1-1','+1-1'}
|
||||||
local R={'+0+0','+1+0','-1+0','+0-1','+1-1','-1-1'}
|
local R={'+0+0','+1+0','-1+0','+0-1','+1-1','-1-1'}
|
||||||
@@ -802,24 +802,24 @@ do
|
|||||||
},
|
},
|
||||||
centerPos=centerPos,
|
centerPos=centerPos,
|
||||||
kickTable={
|
kickTable={
|
||||||
Z,S,--Z,S
|
Z,S,-- Z,S
|
||||||
Z,S,--J,L
|
Z,S,-- J,L
|
||||||
Z,--T
|
Z,-- T
|
||||||
noKickSet,--O
|
noKickSet,-- O
|
||||||
Z,--I
|
Z,-- I
|
||||||
|
|
||||||
Z,S,--Z5,S5
|
Z,S,-- Z5,S5
|
||||||
Z,S,--P,Q
|
Z,S,-- P,Q
|
||||||
Z,S,--F,E
|
Z,S,-- F,E
|
||||||
Z,Z,Z,Z,--T5,U,V,W
|
Z,Z,Z,Z,-- T5,U,V,W
|
||||||
noKickSet,--X
|
noKickSet,-- X
|
||||||
Z,S,--J5,L5
|
Z,S,-- J5,L5
|
||||||
Z,S,--R,Y
|
Z,S,-- R,Y
|
||||||
Z,S,--N,H
|
Z,S,-- N,H
|
||||||
Z,--I5
|
Z,-- I5
|
||||||
|
|
||||||
Z,Z,--I3,C
|
Z,Z,-- I3,C
|
||||||
Z,Z,--I2,O1
|
Z,Z,-- I2,O1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@@ -916,24 +916,24 @@ do
|
|||||||
{'fRect',3,3,4,4},
|
{'fRect',3,3,4,4},
|
||||||
},
|
},
|
||||||
kickTable={
|
kickTable={
|
||||||
Z,S,--Z,S
|
Z,S,-- Z,S
|
||||||
Z,S,--J,L
|
Z,S,-- J,L
|
||||||
Z,--T
|
Z,-- T
|
||||||
noKickSet,--O
|
noKickSet,-- O
|
||||||
Z,--I
|
Z,-- I
|
||||||
|
|
||||||
Z,S,--Z5,S5
|
Z,S,-- Z5,S5
|
||||||
Z,S,--P,Q
|
Z,S,-- P,Q
|
||||||
Z,S,--F,E
|
Z,S,-- F,E
|
||||||
Z,Z,Z,Z,--T5,U,V,W
|
Z,Z,Z,Z,-- T5,U,V,W
|
||||||
noKickSet,--X
|
noKickSet,-- X
|
||||||
Z,S,--J5,L5
|
Z,S,-- J5,L5
|
||||||
Z,S,--R,Y
|
Z,S,-- R,Y
|
||||||
Z,S,--N,H
|
Z,S,-- N,H
|
||||||
Z,--I5
|
Z,-- I5
|
||||||
|
|
||||||
Z,Z,--I3,C
|
Z,Z,-- I3,C
|
||||||
Z,Z,--I2,O1
|
Z,Z,-- I2,O1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@@ -1013,7 +1013,7 @@ for _,rs in next,RSlist do
|
|||||||
if not rs.centerPos then rs.centerPos=defaultCenterPos end
|
if not rs.centerPos then rs.centerPos=defaultCenterPos end
|
||||||
if not rs.centerTex then rs.centerTex=defaultCenterTex end
|
if not rs.centerTex then rs.centerTex=defaultCenterTex end
|
||||||
|
|
||||||
--Make all string vec to the same table vec
|
-- Make all string vec to the same table vec
|
||||||
for _,set in next,rs.kickTable do
|
for _,set in next,rs.kickTable do
|
||||||
if type(set)=='table' then
|
if type(set)=='table' then
|
||||||
for _,list in next,set do
|
for _,list in next,set do
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Cool liquid background
|
-- Cool liquid background
|
||||||
local back={}
|
local back={}
|
||||||
local shader=SHADER.aura
|
local shader=SHADER.aura
|
||||||
local t
|
local t
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Horizonal red-blue gradient
|
-- Horizonal red-blue gradient
|
||||||
local back={}
|
local back={}
|
||||||
local shader=SHADER.grad1
|
local shader=SHADER.grad1
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Vertical red-green gradient
|
-- Vertical red-green gradient
|
||||||
local back={}
|
local back={}
|
||||||
local shader=SHADER.grad2
|
local shader=SHADER.grad2
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Large falling tetrominoes
|
-- Large falling tetrominoes
|
||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
local gc_clear=gc.clear
|
local gc_clear=gc.clear
|
||||||
local gc_setColor,gc_draw=gc.setColor,gc.draw
|
local gc_setColor,gc_draw=gc.setColor,gc.draw
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--blockhole
|
-- blockhole
|
||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
local gc_clear,gc_replaceTransform=gc.clear,gc.replaceTransform
|
local gc_clear,gc_replaceTransform=gc.clear,gc.replaceTransform
|
||||||
local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth
|
local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth
|
||||||
@@ -44,14 +44,14 @@ function back.draw()
|
|||||||
gc_clear(.1,.1,.1)
|
gc_clear(.1,.1,.1)
|
||||||
gc_replaceTransform(SCR.xOy_m)
|
gc_replaceTransform(SCR.xOy_m)
|
||||||
|
|
||||||
--Squares
|
-- Squares
|
||||||
gc_setColor(1,1,1,.2)
|
gc_setColor(1,1,1,.2)
|
||||||
for i=1,#squares do
|
for i=1,#squares do
|
||||||
local S=squares[i]
|
local S=squares[i]
|
||||||
gc_draw(S.texture,S.d*cos(S.ang),S.d*sin(S.ang),S.rotate,S.size*.026,nil,15,15)
|
gc_draw(S.texture,S.d*cos(S.ang),S.d*sin(S.ang),S.rotate,S.size*.026,nil,15,15)
|
||||||
end
|
end
|
||||||
|
|
||||||
--blockhole
|
-- blockhole
|
||||||
gc_setColor(.07,.07,.07)
|
gc_setColor(.07,.07,.07)
|
||||||
gc_circle('fill',0,0,157)
|
gc_circle('fill',0,0,157)
|
||||||
gc_setLineWidth(6)
|
gc_setLineWidth(6)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Block rain
|
-- Block rain
|
||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
local rnd=math.random
|
local rnd=math.random
|
||||||
local ins,rem=table.insert,table.remove
|
local ins,rem=table.insert,table.remove
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Space but tetrominoes
|
-- Space but tetrominoes
|
||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
local gc_clear,gc_translate=gc.clear,gc.translate
|
local gc_clear,gc_translate=gc.clear,gc.translate
|
||||||
local gc_setColor,gc_draw=gc.setColor,gc.draw
|
local gc_setColor,gc_draw=gc.setColor,gc.draw
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Flying cubes
|
-- Flying cubes
|
||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
local gc_clear=gc.clear
|
local gc_clear=gc.clear
|
||||||
local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth
|
local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Custom background
|
-- Custom background
|
||||||
local gc_clear,gc_setColor=love.graphics.clear,love.graphics.setColor
|
local gc_clear,gc_setColor=love.graphics.clear,love.graphics.setColor
|
||||||
local back={}
|
local back={}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Yuyuko's fan
|
-- Yuyuko's fan
|
||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
local gc_clear,gc_origin,gc_replaceTransform=gc.clear,gc.origin,gc.replaceTransform
|
local gc_clear,gc_origin,gc_replaceTransform=gc.clear,gc.origin,gc.replaceTransform
|
||||||
local gc_translate=gc.translate
|
local gc_translate=gc.translate
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Firework
|
-- Firework
|
||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
local gc_clear=gc.clear
|
local gc_clear=gc.clear
|
||||||
local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth
|
local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Customizable grey background
|
-- Customizable grey background
|
||||||
local back={}
|
local back={}
|
||||||
local r,g,b=.26,.26,.26
|
local r,g,b=.26,.26,.26
|
||||||
function back.draw()
|
function back.draw()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Flash after random time
|
-- Flash after random time
|
||||||
local back={}
|
local back={}
|
||||||
|
|
||||||
local t
|
local t
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Light-dark
|
-- Light-dark
|
||||||
local sin=math.sin
|
local sin=math.sin
|
||||||
local back={}
|
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 int,rnd=math.floor,math.random
|
||||||
local ins,rem=table.insert,table.remove
|
local ins,rem=table.insert,table.remove
|
||||||
local mDraw=mDraw
|
local mDraw=mDraw
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Space with stars
|
-- Space with stars
|
||||||
local back={}
|
local back={}
|
||||||
|
|
||||||
local upCover do
|
local upCover do
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Lightning
|
-- Lightning
|
||||||
local back={}
|
local back={}
|
||||||
|
|
||||||
local t
|
local t
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Fast lightning + spining tetromino
|
-- Fast lightning + spining tetromino
|
||||||
local int,rnd=math.floor,math.random
|
local int,rnd=math.floor,math.random
|
||||||
local back={}
|
local back={}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Black-White grid
|
-- Black-White grid
|
||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
local gc_clear,gc_scale=gc.clear,gc.scale
|
local gc_clear,gc_scale=gc.clear,gc.scale
|
||||||
local gc_setColor=gc.setColor
|
local gc_setColor=gc.setColor
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Colorful RGB
|
-- Colorful RGB
|
||||||
local back={}
|
local back={}
|
||||||
local shader=SHADER.rgb1
|
local shader=SHADER.rgb1
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Blue RGB
|
-- Blue RGB
|
||||||
local back={}
|
local back={}
|
||||||
local shader=SHADER.rgb2
|
local shader=SHADER.rgb2
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Changing pure color
|
-- Changing pure color
|
||||||
local sin=math.sin
|
local sin=math.sin
|
||||||
local back={}
|
local back={}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Snow
|
-- Snow
|
||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
local ellipse=gc.ellipse
|
local ellipse=gc.ellipse
|
||||||
local rnd=math.random
|
local rnd=math.random
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Space with stars
|
-- Space with stars
|
||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
local rectangle=gc.rectangle
|
local rectangle=gc.rectangle
|
||||||
local rnd=math.random
|
local rnd=math.random
|
||||||
@@ -15,16 +15,16 @@ function back.resize(w,h)
|
|||||||
local S=stars
|
local S=stars
|
||||||
for i=1,1260,5 do
|
for i=1,1260,5 do
|
||||||
local s=rnd(26,40)*.1
|
local s=rnd(26,40)*.1
|
||||||
S[i]=s*SCR.k --Size
|
S[i]=s*SCR.k -- Size
|
||||||
S[i+1]=rnd(W)-10 --X
|
S[i+1]=rnd(W)-10 -- X
|
||||||
S[i+2]=rnd(H)-10 --Y
|
S[i+2]=rnd(H)-10 -- Y
|
||||||
S[i+3]=(rnd()-.5)*.01*s--Vx
|
S[i+3]=(rnd()-.5)*.01*s-- Vx
|
||||||
S[i+4]=(rnd()-.5)*.01*s--Vy
|
S[i+4]=(rnd()-.5)*.01*s-- Vy
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function back.update(dt)
|
function back.update(dt)
|
||||||
local S=stars
|
local S=stars
|
||||||
--Star moving
|
-- Star moving
|
||||||
for i=1,1260,5 do
|
for i=1,1260,5 do
|
||||||
S[i+1]=(S[i+1]+S[i+3]*dt*60)%W
|
S[i+1]=(S[i+1]+S[i+3]*dt*60)%W
|
||||||
S[i+2]=(S[i+2]+S[i+4]*dt*60)%H
|
S[i+2]=(S[i+2]+S[i+4]*dt*60)%H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Cool Tunnel
|
-- Cool Tunnel
|
||||||
local rnd=math.random
|
local rnd=math.random
|
||||||
local ins,rem=table.insert,table.remove
|
local ins,rem=table.insert,table.remove
|
||||||
local back={}
|
local back={}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Welcome to Techmino
|
-- Welcome to Techmino
|
||||||
local sin=math.sin
|
local sin=math.sin
|
||||||
local back={}
|
local back={}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Flandre's wing
|
-- Flandre's wing
|
||||||
local back={}
|
local back={}
|
||||||
local crystal_img,crystals
|
local crystal_img,crystals
|
||||||
local wingColor={
|
local wingColor={
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ local function _getScore(field,cb,cy)
|
|||||||
clear=clear+1
|
clear=clear+1
|
||||||
::CONTINUE_notFull::
|
::CONTINUE_notFull::
|
||||||
end
|
end
|
||||||
if #field==0 then--PC
|
if #field==0 then-- PC
|
||||||
return 1e99
|
return 1e99
|
||||||
end
|
end
|
||||||
for x=1,10 do
|
for x=1,10 do
|
||||||
@@ -116,10 +116,10 @@ local function _getScore(field,cb,cy)
|
|||||||
-#field*30
|
-#field*30
|
||||||
-#cb*15
|
-#cb*15
|
||||||
+(#field>10 and
|
+(#field>10 and
|
||||||
HclearScore[clear]--Clearing
|
HclearScore[clear]-- Clearing
|
||||||
-hole*70--Hole
|
-hole*70-- Hole
|
||||||
-cy*50--Height
|
-cy*50-- Height
|
||||||
-sdh--Sum of DeltaH
|
-sdh-- Sum of DeltaH
|
||||||
or
|
or
|
||||||
LclearScore[clear]
|
LclearScore[clear]
|
||||||
-hole*100
|
-hole*100
|
||||||
@@ -139,10 +139,10 @@ local bot_9s={}
|
|||||||
function bot_9s.thread(bot)
|
function bot_9s.thread(bot)
|
||||||
local P,data,keys=bot.P,bot.data,bot.keys
|
local P,data,keys=bot.P,bot.data,bot.keys
|
||||||
while true do
|
while true do
|
||||||
--Thinking
|
-- Thinking
|
||||||
yield()
|
yield()
|
||||||
local Tfield={}--Test field
|
local Tfield={}-- Test field
|
||||||
local best={x=1,dir=0,hold=false,score=-1e99}--Best method
|
local best={x=1,dir=0,hold=false,score=-1e99}-- Best method
|
||||||
local field_org=P.field
|
local field_org=P.field
|
||||||
for i=1,#field_org do
|
for i=1,#field_org do
|
||||||
Tfield[i]=getRow(0)
|
Tfield[i]=getRow(0)
|
||||||
@@ -152,7 +152,7 @@ function bot_9s.thread(bot)
|
|||||||
end
|
end
|
||||||
|
|
||||||
for ifhold=0,data.hold and P.gameEnv.holdCount>0 and 1 or 0 do
|
for ifhold=0,data.hold and P.gameEnv.holdCount>0 and 1 or 0 do
|
||||||
--Get block id
|
-- Get block id
|
||||||
local bn
|
local bn
|
||||||
if ifhold==0 then
|
if ifhold==0 then
|
||||||
bn=P.cur and P.cur.id
|
bn=P.cur and P.cur.id
|
||||||
@@ -160,17 +160,17 @@ function bot_9s.thread(bot)
|
|||||||
bn=P.holdQueue[1] and P.holdQueue[1].id or P.nextQueue[1] and P.nextQueue[1].id
|
bn=P.holdQueue[1] and P.holdQueue[1].id or P.nextQueue[1] and P.nextQueue[1].id
|
||||||
end
|
end
|
||||||
if bn then
|
if bn then
|
||||||
for dir=0,dirCount[bn] do--Each dir
|
for dir=0,dirCount[bn] do-- Each dir
|
||||||
local cb=BLOCKS[bn][dir]
|
local cb=BLOCKS[bn][dir]
|
||||||
for cx=1,11-#cb[1] do--Each pos
|
for cx=1,11-#cb[1] do-- Each pos
|
||||||
local cy=#Tfield+1
|
local cy=#Tfield+1
|
||||||
|
|
||||||
--Move to bottom
|
-- Move to bottom
|
||||||
while cy>1 and not _ifoverlapAI(Tfield,cb,cx,cy-1) do
|
while cy>1 and not _ifoverlapAI(Tfield,cb,cx,cy-1) do
|
||||||
cy=cy-1
|
cy=cy-1
|
||||||
end
|
end
|
||||||
|
|
||||||
--Simulate lock
|
-- Simulate lock
|
||||||
for i=1,#cb do
|
for i=1,#cb do
|
||||||
local y=cy+i-1
|
local y=cy+i-1
|
||||||
if not Tfield[y] then
|
if not Tfield[y] then
|
||||||
@@ -194,7 +194,7 @@ function bot_9s.thread(bot)
|
|||||||
end
|
end
|
||||||
if not best.bn then return 1 end
|
if not best.bn then return 1 end
|
||||||
|
|
||||||
--Release cache
|
-- Release cache
|
||||||
while #Tfield>0 do
|
while #Tfield>0 do
|
||||||
discardRow(rem(Tfield,1))
|
discardRow(rem(Tfield,1))
|
||||||
end
|
end
|
||||||
@@ -207,7 +207,7 @@ function bot_9s.thread(bot)
|
|||||||
end
|
end
|
||||||
ins(keys,6)
|
ins(keys,6)
|
||||||
|
|
||||||
--Check if time to change target
|
-- Check if time to change target
|
||||||
yield()
|
yield()
|
||||||
if P.aiRND:random()<.00126 then
|
if P.aiRND:random()<.00126 then
|
||||||
P:changeAtkMode(P.aiRND:random()<.85 and 1 or #P.atker>3 and 4 or P.aiRND:random()<.3 and 2 or 3)
|
P:changeAtkMode(P.aiRND:random()<.85 and 1 or #P.atker>3 and 4 or P.aiRND:random()<.3 and 2 or 3)
|
||||||
|
|||||||
@@ -50,11 +50,11 @@ function bot_cc:thread()
|
|||||||
local P,keys=self.P,self.keys
|
local P,keys=self.P,self.keys
|
||||||
local ccBot=self.ccBot
|
local ccBot=self.ccBot
|
||||||
while true do
|
while true do
|
||||||
--Start thinking
|
-- Start thinking
|
||||||
yield()
|
yield()
|
||||||
ccBot:think()
|
ccBot:think()
|
||||||
|
|
||||||
--Poll keys
|
-- Poll keys
|
||||||
local success,result,dest,hold,move,b2b,attack,extra,spawn
|
local success,result,dest,hold,move,b2b,attack,extra,spawn
|
||||||
repeat
|
repeat
|
||||||
yield()
|
yield()
|
||||||
@@ -73,7 +73,7 @@ function bot_cc:thread()
|
|||||||
dest.extra = extra
|
dest.extra = extra
|
||||||
dest.spawn = spawn
|
dest.spawn = spawn
|
||||||
P.destFX=dest
|
P.destFX=dest
|
||||||
if hold then--Hold
|
if hold then-- Hold
|
||||||
keys[1]=8
|
keys[1]=8
|
||||||
end
|
end
|
||||||
while move[1] do
|
while move[1] do
|
||||||
@@ -89,7 +89,7 @@ function bot_cc:thread()
|
|||||||
ins(keys,6)
|
ins(keys,6)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Check if time to change target
|
-- Check if time to change target
|
||||||
yield()
|
yield()
|
||||||
if P.aiRND:random()<.00126 then
|
if P.aiRND:random()<.00126 then
|
||||||
P:changeAtkMode(P.aiRND:random()<.85 and 1 or #P.atker>3 and 4 or P.aiRND:random()<.3 and 2 or 3)
|
P:changeAtkMode(P.aiRND:random()<.85 and 1 or #P.atker>3 and 4 or P.aiRND:random()<.3 and 2 or 3)
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ function BOT.new(P,data)
|
|||||||
end
|
end
|
||||||
bot.runningThread=coroutine.wrap(cc_lua.thread)
|
bot.runningThread=coroutine.wrap(cc_lua.thread)
|
||||||
bot.runningThread(bot)
|
bot.runningThread(bot)
|
||||||
else--if data.type=="9S" then--9s or else
|
else-- if data.type=="9S" then-- 9s or else
|
||||||
TABLE.cover(baseBot,bot)
|
TABLE.cover(baseBot,bot)
|
||||||
TABLE.cover(require"parts.bot.bot_9s",bot)
|
TABLE.cover(require"parts.bot.bot_9s",bot)
|
||||||
P:setRS('TRS')
|
P:setRS('TRS')
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
local L={
|
local L={
|
||||||
zChan={--F0000~F003F
|
zChan={-- F0000~F003F
|
||||||
none= 0xF0000,
|
none= 0xF0000,
|
||||||
normal= 0xF0001,
|
normal= 0xF0001,
|
||||||
full= 0xF0002,
|
full= 0xF0002,
|
||||||
@@ -24,7 +24,7 @@ local L={
|
|||||||
thinking= 0xF0015,
|
thinking= 0xF0015,
|
||||||
spark= 0xF0016,
|
spark= 0xF0016,
|
||||||
},
|
},
|
||||||
mino={--F0040~F007F
|
mino={-- F0040~F007F
|
||||||
Z=0xF0040,
|
Z=0xF0040,
|
||||||
S=0xF0041,
|
S=0xF0041,
|
||||||
J=0xF0042,
|
J=0xF0042,
|
||||||
@@ -57,7 +57,7 @@ local L={
|
|||||||
I2=0xF005B,
|
I2=0xF005B,
|
||||||
O1=0xF005C,
|
O1=0xF005C,
|
||||||
},
|
},
|
||||||
icon={--F0080~F00FF
|
icon={-- F0080~F00FF
|
||||||
menu= 0xF0080,
|
menu= 0xF0080,
|
||||||
music= 0xF0081,
|
music= 0xF0081,
|
||||||
language= 0xF0082,
|
language= 0xF0082,
|
||||||
@@ -131,7 +131,7 @@ local L={
|
|||||||
garbage= 0xF00C6,
|
garbage= 0xF00C6,
|
||||||
copy= 0xF00C7,
|
copy= 0xF00C7,
|
||||||
},
|
},
|
||||||
key={--F0100~F017F
|
key={-- F0100~F017F
|
||||||
macCmd= 0xF0100,
|
macCmd= 0xF0100,
|
||||||
macOpt= 0xF0101,
|
macOpt= 0xF0101,
|
||||||
macCtrl= 0xF0102,
|
macCtrl= 0xF0102,
|
||||||
@@ -172,7 +172,7 @@ local L={
|
|||||||
macPgdnAlt= 0xF0125,
|
macPgdnAlt= 0xF0125,
|
||||||
iecPower= 0xF0126,
|
iecPower= 0xF0126,
|
||||||
},
|
},
|
||||||
controller={--F0180~F01FF
|
controller={-- F0180~F01FF
|
||||||
xbox= 0xF0180,
|
xbox= 0xF0180,
|
||||||
lt= 0xF0181,
|
lt= 0xF0181,
|
||||||
rt= 0xF0182,
|
rt= 0xF0182,
|
||||||
@@ -212,7 +212,7 @@ local L={
|
|||||||
psCreate= 0xF01A4,
|
psCreate= 0xF01A4,
|
||||||
psOption= 0xF01A5,
|
psOption= 0xF01A5,
|
||||||
},
|
},
|
||||||
mahjong={--F0200~F027F
|
mahjong={-- F0200~F027F
|
||||||
m1= 0xF0200,
|
m1= 0xF0200,
|
||||||
m2= 0xF0201,
|
m2= 0xF0201,
|
||||||
m3= 0xF0202,
|
m3= 0xF0202,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
return{
|
return{
|
||||||
version=VERSION.code,
|
version=VERSION.code,
|
||||||
|
|
||||||
--Basic
|
-- Basic
|
||||||
drop=1e99,
|
drop=1e99,
|
||||||
lock=1e99,
|
lock=1e99,
|
||||||
wait=0,
|
wait=0,
|
||||||
@@ -9,17 +9,17 @@ return{
|
|||||||
hang=5,
|
hang=5,
|
||||||
hurry=1e99,
|
hurry=1e99,
|
||||||
|
|
||||||
--Control
|
-- Control
|
||||||
nextCount=6,
|
nextCount=6,
|
||||||
holdMode='hold',
|
holdMode='hold',
|
||||||
holdCount=1,
|
holdCount=1,
|
||||||
infHold=true,
|
infHold=true,
|
||||||
phyHold=false,
|
phyHold=false,
|
||||||
|
|
||||||
--Visual
|
-- Visual
|
||||||
bone=false,
|
bone=false,
|
||||||
|
|
||||||
--Rule
|
-- Rule
|
||||||
sequence='bag',
|
sequence='bag',
|
||||||
lockout=false,
|
lockout=false,
|
||||||
fieldH=20,
|
fieldH=20,
|
||||||
@@ -40,7 +40,7 @@ return{
|
|||||||
garbageSpeed=1,
|
garbageSpeed=1,
|
||||||
missionKill=false,
|
missionKill=false,
|
||||||
|
|
||||||
--Else
|
-- Else
|
||||||
bg='blockrain',
|
bg='blockrain',
|
||||||
bgm='hang out',
|
bgm='hang out',
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ local ins=table.insert
|
|||||||
local BAG,FIELD,MISSION,CUSTOMENV,GAME=BAG,FIELD,MISSION,CUSTOMENV,GAME
|
local BAG,FIELD,MISSION,CUSTOMENV,GAME=BAG,FIELD,MISSION,CUSTOMENV,GAME
|
||||||
|
|
||||||
local DATA={}
|
local DATA={}
|
||||||
--Sep symbol: 33 (!)
|
-- Sep symbol: 33 (!)
|
||||||
--Safe char: 34~126
|
-- Safe char: 34~126
|
||||||
--[[
|
--[[
|
||||||
Count: 34~96
|
Count: 34~96
|
||||||
Block: 97~125
|
Block: 97~125
|
||||||
@@ -66,14 +66,14 @@ local fieldMeta={__index=function(self,h)
|
|||||||
end
|
end
|
||||||
return self[h]
|
return self[h]
|
||||||
end}
|
end}
|
||||||
function DATA.newBoard(f)--Generate a new board
|
function DATA.newBoard(f)-- Generate a new board
|
||||||
return setmetatable(f and TABLE.shift(f) or{},fieldMeta)
|
return setmetatable(f and TABLE.shift(f) or{},fieldMeta)
|
||||||
end
|
end
|
||||||
function DATA.copyBoard(page)--Copy the [page] board
|
function DATA.copyBoard(page)-- Copy the [page] board
|
||||||
local F=FIELD[page or 1]
|
local F=FIELD[page or 1]
|
||||||
local str=""
|
local str=""
|
||||||
|
|
||||||
--Encode field
|
-- Encode field
|
||||||
for y=1,#F do
|
for y=1,#F do
|
||||||
local S=""
|
local S=""
|
||||||
local L=F[y]
|
local L=F[y]
|
||||||
@@ -91,7 +91,7 @@ function DATA.copyBoards()
|
|||||||
end
|
end
|
||||||
return table.concat(out,"!")
|
return table.concat(out,"!")
|
||||||
end
|
end
|
||||||
function DATA.pasteBoard(str,page)--Paste [str] data to [page] board
|
function DATA.pasteBoard(str,page)-- Paste [str] data to [page] board
|
||||||
if not page then
|
if not page then
|
||||||
page=1
|
page=1
|
||||||
end
|
end
|
||||||
@@ -100,16 +100,16 @@ function DATA.pasteBoard(str,page)--Paste [str] data to [page] board
|
|||||||
end
|
end
|
||||||
local F=FIELD[page]
|
local F=FIELD[page]
|
||||||
|
|
||||||
--Decode
|
-- Decode
|
||||||
str=STRING.unpackBin(str)
|
str=STRING.unpackBin(str)
|
||||||
if not str then return end
|
if not str then return end
|
||||||
|
|
||||||
local fX,fY=1,1--*ptr for Field(r*10+(c-1))
|
local fX,fY=1,1-- *ptr for Field(r*10+(c-1))
|
||||||
local p=1
|
local p=1
|
||||||
while true do
|
while true do
|
||||||
local b=byte(str,p)--1byte
|
local b=byte(str,p)-- 1byte
|
||||||
|
|
||||||
--Str end
|
-- Str end
|
||||||
if not b then
|
if not b then
|
||||||
if fX~=1 then
|
if fX~=1 then
|
||||||
return
|
return
|
||||||
@@ -118,9 +118,9 @@ function DATA.pasteBoard(str,page)--Paste [str] data to [page] board
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local id=b%32-1--Block id
|
local id=b%32-1-- Block id
|
||||||
if id>26 then return end--Illegal blockid
|
if id>26 then return end-- Illegal blockid
|
||||||
b=int(b/32)--Mode id
|
b=int(b/32)-- Mode id
|
||||||
|
|
||||||
F[fY][fX]=id
|
F[fY][fX]=id
|
||||||
if fX<10 then
|
if fX<10 then
|
||||||
@@ -254,13 +254,13 @@ function DATA.dumpRecording(list,ptr)
|
|||||||
if not ptr then ptr=1 end
|
if not ptr then ptr=1 end
|
||||||
local prevFrm=list[ptr-2] or 0
|
local prevFrm=list[ptr-2] or 0
|
||||||
while list[ptr] do
|
while list[ptr] do
|
||||||
--Flush buffer
|
-- Flush buffer
|
||||||
if #buffer>10 then
|
if #buffer>10 then
|
||||||
out=out..buffer
|
out=out..buffer
|
||||||
buffer=""
|
buffer=""
|
||||||
end
|
end
|
||||||
|
|
||||||
--Encode time
|
-- Encode time
|
||||||
local t=list[ptr]-prevFrm
|
local t=list[ptr]-prevFrm
|
||||||
prevFrm=list[ptr]
|
prevFrm=list[ptr]
|
||||||
if t>=128 then
|
if t>=128 then
|
||||||
@@ -275,7 +275,7 @@ function DATA.dumpRecording(list,ptr)
|
|||||||
buffer=buffer..char(t)
|
buffer=buffer..char(t)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Encode event
|
-- Encode event
|
||||||
t=list[ptr+1]
|
t=list[ptr+1]
|
||||||
if t>=128 then
|
if t>=128 then
|
||||||
buffer2=char(t%128)
|
buffer2=char(t%128)
|
||||||
@@ -289,7 +289,7 @@ function DATA.dumpRecording(list,ptr)
|
|||||||
buffer=buffer..char(t)
|
buffer=buffer..char(t)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Step
|
-- Step
|
||||||
ptr=ptr+2
|
ptr=ptr+2
|
||||||
end
|
end
|
||||||
return out..buffer,ptr
|
return out..buffer,ptr
|
||||||
@@ -301,7 +301,7 @@ function DATA.pumpRecording(str,L)
|
|||||||
local curFrm=L[#L-1] or 0
|
local curFrm=L[#L-1] or 0
|
||||||
local code
|
local code
|
||||||
while p<=len do
|
while p<=len do
|
||||||
--Read delta time
|
-- Read delta time
|
||||||
code=0
|
code=0
|
||||||
local b=byte(str,p)
|
local b=byte(str,p)
|
||||||
while b>=128 do
|
while b>=128 do
|
||||||
@@ -324,7 +324,7 @@ function DATA.pumpRecording(str,L)
|
|||||||
p=p+1
|
p=p+1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
do--function DATA.saveReplay()
|
do-- function DATA.saveReplay()
|
||||||
local noRecList={"custom","solo","round","techmino"}
|
local noRecList={"custom","solo","round","techmino"}
|
||||||
local function _getModList()
|
local function _getModList()
|
||||||
local res={}
|
local res={}
|
||||||
@@ -336,7 +336,7 @@ do--function DATA.saveReplay()
|
|||||||
return res
|
return res
|
||||||
end
|
end
|
||||||
function DATA.saveReplay()
|
function DATA.saveReplay()
|
||||||
--Filtering modes that cannot be saved
|
-- Filtering modes that cannot be saved
|
||||||
for _,v in next,noRecList do
|
for _,v in next,noRecList do
|
||||||
if GAME.curModeName:find(v) then
|
if GAME.curModeName:find(v) then
|
||||||
MES.new('error',"Cannot save recording of this mode now!")
|
MES.new('error',"Cannot save recording of this mode now!")
|
||||||
@@ -344,7 +344,7 @@ do--function DATA.saveReplay()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Write file
|
-- Write file
|
||||||
local fileName=os.date("replay/%Y_%m_%d_%H%M%S.rep")
|
local fileName=os.date("replay/%Y_%m_%d_%H%M%S.rep")
|
||||||
if not love.filesystem.getInfo(fileName) then
|
if not love.filesystem.getInfo(fileName) then
|
||||||
love.filesystem.write(fileName,
|
love.filesystem.write(fileName,
|
||||||
@@ -371,7 +371,7 @@ do--function DATA.saveReplay()
|
|||||||
end
|
end
|
||||||
function DATA.parseReplay(fileName,ifFull)
|
function DATA.parseReplay(fileName,ifFull)
|
||||||
local fileData
|
local fileData
|
||||||
--Read file
|
-- Read file
|
||||||
fileData=love.filesystem.read(fileName)
|
fileData=love.filesystem.read(fileName)
|
||||||
return DATA.parseReplayData(fileName,fileData,ifFull)
|
return DATA.parseReplayData(fileName,fileData,ifFull)
|
||||||
end
|
end
|
||||||
@@ -380,20 +380,20 @@ function DATA.parseReplayData(fileName,fileData,ifFull)
|
|||||||
|
|
||||||
if not (fileData and #fileData>0) then goto BREAK_cannotParse end
|
if not (fileData and #fileData>0) then goto BREAK_cannotParse end
|
||||||
|
|
||||||
--Decompress file
|
-- Decompress file
|
||||||
success,fileData=pcall(love.data.decompress,'string','zlib',fileData)
|
success,fileData=pcall(love.data.decompress,'string','zlib',fileData)
|
||||||
if not success then goto BREAK_cannotParse end
|
if not success then goto BREAK_cannotParse end
|
||||||
|
|
||||||
--Load metadata
|
-- Load metadata
|
||||||
metaData,fileData=STRING.readLine(fileData)
|
metaData,fileData=STRING.readLine(fileData)
|
||||||
metaData=JSON.decode(metaData)
|
metaData=JSON.decode(metaData)
|
||||||
if not metaData then goto BREAK_cannotParse end
|
if not metaData then goto BREAK_cannotParse end
|
||||||
|
|
||||||
--Convert ancient replays
|
-- Convert ancient replays
|
||||||
metaData.mode=MODE_UPDATE_MAP[metaData.mode] or metaData.mode
|
metaData.mode=MODE_UPDATE_MAP[metaData.mode] or metaData.mode
|
||||||
if not MODES[metaData.mode] then goto BREAK_cannotParse end
|
if not MODES[metaData.mode] then goto BREAK_cannotParse end
|
||||||
|
|
||||||
--Create replay object
|
-- Create replay object
|
||||||
rep={
|
rep={
|
||||||
fileName=fileName,
|
fileName=fileName,
|
||||||
available=true,
|
available=true,
|
||||||
@@ -411,7 +411,7 @@ function DATA.parseReplayData(fileName,fileData,ifFull)
|
|||||||
if ifFull then rep.data=fileData end
|
if ifFull then rep.data=fileData end
|
||||||
do return rep end
|
do return rep end
|
||||||
|
|
||||||
--Create unavailable replay object
|
-- Create unavailable replay object
|
||||||
::BREAK_cannotParse::
|
::BREAK_cannotParse::
|
||||||
return{
|
return{
|
||||||
fileName=fileName,
|
fileName=fileName,
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ return{
|
|||||||
P:win('finish')
|
P:win('finish')
|
||||||
else
|
else
|
||||||
if D.wave<20 then
|
if D.wave<20 then
|
||||||
local t=1500-30*D.wave--1500~900
|
local t=1500-30*D.wave-- 1500~900
|
||||||
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(4,7)),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=3})
|
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(4,7)),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=3})
|
||||||
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(3,8)),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=4})
|
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(3,8)),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=4})
|
||||||
else
|
else
|
||||||
local t=900-10*(D.wave-20)--900~600
|
local t=900-10*(D.wave-20)-- 900~600
|
||||||
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(10)),amount=14,countdown=t,cd0=t,time=0,sent=false,lv=4})
|
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(10)),amount=14,countdown=t,cd0=t,time=0,sent=false,lv=4})
|
||||||
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(4,7)),amount=8,countdown=t,cd0=t,time=0,sent=false,lv=5})
|
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(4,7)),amount=8,countdown=t,cd0=t,time=0,sent=false,lv=5})
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ return{
|
|||||||
P:win('finish')
|
P:win('finish')
|
||||||
else
|
else
|
||||||
local s
|
local s
|
||||||
local t=800-10*D.wave--800~700~600~500
|
local t=800-10*D.wave-- 800~700~600~500
|
||||||
if D.wave<10 then
|
if D.wave<10 then
|
||||||
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(5,6)),amount=9,countdown=t,cd0=t,time=0,sent=false,lv=3})
|
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(5,6)),amount=9,countdown=t,cd0=t,time=0,sent=false,lv=3})
|
||||||
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(4,7)),amount=11,countdown=t,cd0=t+62,time=0,sent=false,lv=4})
|
table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(4,7)),amount=11,countdown=t,cd0=t+62,time=0,sent=false,lv=4})
|
||||||
|
|||||||
@@ -62,9 +62,9 @@ return{
|
|||||||
local D=P.modeData
|
local D=P.modeData
|
||||||
D.drought=P.lastPiece.id==7 and 0 or D.drought+1
|
D.drought=P.lastPiece.id==7 and 0 or D.drought+1
|
||||||
if P.stat.row>=D.target then
|
if P.stat.row>=D.target then
|
||||||
--if D.target>=200 then
|
-- if D.target>=200 then
|
||||||
D.lvl=D.lvl+1
|
D.lvl=D.lvl+1
|
||||||
--end
|
-- end
|
||||||
local dropSpd=GetGravity(D.lvl)
|
local dropSpd=GetGravity(D.lvl)
|
||||||
if dropSpd~=P.gameEnv.drop then
|
if dropSpd~=P.gameEnv.drop then
|
||||||
P.gameEnv.drop,P.gameEnv.lock=dropSpd,dropSpd
|
P.gameEnv.drop,P.gameEnv.lock=dropSpd,dropSpd
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ local dropSpeed={
|
|||||||
50,42,35,30,25,20,16,13,11,10,
|
50,42,35,30,25,20,16,13,11,10,
|
||||||
9,8,7,6,5,5,4,4,3,3,
|
9,8,7,6,5,5,4,4,3,3,
|
||||||
3,2,2,2,2,1,1,1,1,1,
|
3,2,2,2,2,1,1,1,1,1,
|
||||||
.5,.5,.5,.5,.25,.25,.25,.125,.125,--Total 39 numbers, switch to 20G when reach 400 lines
|
.5,.5,.5,.5,.25,.25,.25,.125,.125,-- Total 39 numbers, switch to 20G when reach 400 lines
|
||||||
}
|
}
|
||||||
local lockDelay={
|
local lockDelay={
|
||||||
57,54,51,48,46,44,42,40,38,36,
|
57,54,51,48,46,44,42,40,38,36,
|
||||||
@@ -17,7 +17,7 @@ local lockDelay={
|
|||||||
4,4,4,4,4,4,4,4,4,4,
|
4,4,4,4,4,4,4,4,4,4,
|
||||||
3,3,3,3,3,3,3,3,3,3,
|
3,3,3,3,3,3,3,3,3,3,
|
||||||
2,2,2,2,2,2,2,2,2,2,
|
2,2,2,2,2,2,2,2,2,2,
|
||||||
1,1,1,1,1,1,1,1,1,--Finish at 1700
|
1,1,1,1,1,1,1,1,1,-- Finish at 1700
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -40,10 +40,10 @@ return{
|
|||||||
PLY.draw.drawTargetLine(P,getRollGoal(P))
|
PLY.draw.drawTargetLine(P,getRollGoal(P))
|
||||||
end,
|
end,
|
||||||
hook_drop=function(P)
|
hook_drop=function(P)
|
||||||
if P.modeData.rankPoint<140-passPoint then--If Less then X
|
if P.modeData.rankPoint<140-passPoint then-- If Less then X
|
||||||
local R=#P.clearedRow
|
local R=#P.clearedRow
|
||||||
if R>0 then
|
if R>0 then
|
||||||
if R==4 then R=10 end--Techrash +10
|
if R==4 then R=10 end-- Techrash +10
|
||||||
P.modeData.rankPoint=math.min(P.modeData.rankPoint+R,140-passPoint)
|
P.modeData.rankPoint=math.min(P.modeData.rankPoint+R,140-passPoint)
|
||||||
P.modeData.rankName=sectionName[math.floor(P.modeData.rankPoint/10)+1]
|
P.modeData.rankName=sectionName[math.floor(P.modeData.rankPoint/10)+1]
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -21,12 +21,12 @@ return{
|
|||||||
|
|
||||||
if D.pt%100==99 then
|
if D.pt%100==99 then
|
||||||
SFX.play('warn_1')
|
SFX.play('warn_1')
|
||||||
elseif D.pt>=D.target then--Level up!
|
elseif D.pt>=D.target then-- Level up!
|
||||||
s=D.target/100--range from 1 to 9
|
s=D.target/100-- range from 1 to 9
|
||||||
local E=P.gameEnv
|
local E=P.gameEnv
|
||||||
if s<4 then
|
if s<4 then
|
||||||
P:stageComplete(s)
|
P:stageComplete(s)
|
||||||
--First 300
|
-- First 300
|
||||||
if s~=1 then E.lock=E.lock-1 end
|
if s~=1 then E.lock=E.lock-1 end
|
||||||
if s~=2 then E.wait=E.wait-1 end
|
if s~=2 then E.wait=E.wait-1 end
|
||||||
if s~=3 then E.fall=E.fall-1 end
|
if s~=3 then E.fall=E.fall-1 end
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ local isInRoll=false
|
|||||||
local rollGrades=0
|
local rollGrades=0
|
||||||
local cool_time={3120,3120,2940,2700,2700,2520,2520,2280,2280,0}
|
local cool_time={3120,3120,2940,2700,2700,2520,2520,2280,2280,0}
|
||||||
local reg_time= {5400,4500,4500,4080,3600,3600,3000,3000,3000,3000}
|
local reg_time= {5400,4500,4500,4080,3600,3600,3000,3000,3000,3000}
|
||||||
local prevDrop70=false --determines if previous piece has level less than __70
|
local prevDrop70=false -- determines if previous piece has level less than __70
|
||||||
local nextSpeedUp=false --determines if the next section speed should be boosted by 100
|
local nextSpeedUp=false -- determines if the next section speed should be boosted by 100
|
||||||
local isInRollTrans=false
|
local isInRollTrans=false
|
||||||
local function getGrav(l)
|
local function getGrav(l)
|
||||||
return
|
return
|
||||||
@@ -220,7 +220,7 @@ return{
|
|||||||
|
|
||||||
if D.pt+1==D.target then
|
if D.pt+1==D.target then
|
||||||
SFX.play('warn_1')
|
SFX.play('warn_1')
|
||||||
elseif D.pt>=D.target then--Level up!
|
elseif D.pt>=D.target then-- Level up!
|
||||||
spd_lvl=nextSpeedUp and spd_lvl+100 or spd_lvl
|
spd_lvl=nextSpeedUp and spd_lvl+100 or spd_lvl
|
||||||
nextSpeedUp=false
|
nextSpeedUp=false
|
||||||
prevDrop70=false
|
prevDrop70=false
|
||||||
@@ -301,7 +301,7 @@ return{
|
|||||||
end
|
end
|
||||||
if isInRollTrans then
|
if isInRollTrans then
|
||||||
if P.waiting>=220 then
|
if P.waiting>=220 then
|
||||||
--Make field invisible
|
-- Make field invisible
|
||||||
for y=1,#P.field do for x=1,10 do
|
for y=1,#P.field do for x=1,10 do
|
||||||
P.visTime[y][x]=P.waiting-220
|
P.visTime[y][x]=P.waiting-220
|
||||||
end end
|
end end
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ return{
|
|||||||
|
|
||||||
if D.pt%100==99 then
|
if D.pt%100==99 then
|
||||||
SFX.play('warn_1')
|
SFX.play('warn_1')
|
||||||
elseif D.pt>=D.target then--Level up!
|
elseif D.pt>=D.target then-- Level up!
|
||||||
s=D.target/100
|
s=D.target/100
|
||||||
local E=P.gameEnv
|
local E=P.gameEnv
|
||||||
E.lock=death_lock[s]
|
E.lock=death_lock[s]
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ return{
|
|||||||
|
|
||||||
if D.pt%100==99 then
|
if D.pt%100==99 then
|
||||||
SFX.play('warn_1')
|
SFX.play('warn_1')
|
||||||
elseif D.pt>=D.target then--Level up!
|
elseif D.pt>=D.target then-- Level up!
|
||||||
s=D.target/100
|
s=D.target/100
|
||||||
local E=P.gameEnv
|
local E=P.gameEnv
|
||||||
E.lock=inv_lock[s]
|
E.lock=inv_lock[s]
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ return{
|
|||||||
|
|
||||||
if D.pt%100==99 then
|
if D.pt%100==99 then
|
||||||
SFX.play('warn_1')
|
SFX.play('warn_1')
|
||||||
elseif D.pt>=D.target then--Level up!
|
elseif D.pt>=D.target then-- Level up!
|
||||||
s=D.target/100
|
s=D.target/100
|
||||||
local E=P.gameEnv
|
local E=P.gameEnv
|
||||||
E.lock=rush_lock[s]
|
E.lock=rush_lock[s]
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ return
|
|||||||
if p>=P.modeData.target then
|
if p>=P.modeData.target then
|
||||||
local ENV=P.gameEnv
|
local ENV=P.gameEnv
|
||||||
local T=P.modeData.target
|
local T=P.modeData.target
|
||||||
--Stage 1: clear 3 techrash
|
-- Stage 1: clear 3 techrash
|
||||||
if T==12 then--Stage 2: swap color of S/Z & J/L
|
if T==12 then-- Stage 2: swap color of S/Z & J/L
|
||||||
P:stageComplete(2)
|
P:stageComplete(2)
|
||||||
P.waiting=30
|
P.waiting=30
|
||||||
P.curMission=false
|
P.curMission=false
|
||||||
@@ -34,9 +34,9 @@ return
|
|||||||
|
|
||||||
P.modeData.target=26
|
P.modeData.target=26
|
||||||
SFX.play('reach')
|
SFX.play('reach')
|
||||||
elseif T==26 then--Stage 3: dig to bottom
|
elseif T==26 then-- Stage 3: dig to bottom
|
||||||
P:stageComplete(3)
|
P:stageComplete(3)
|
||||||
if not P.holdQueue[1] then--1 up if ban hold
|
if not P.holdQueue[1] then-- 1 up if ban hold
|
||||||
P.life=P.life+1
|
P.life=P.life+1
|
||||||
end
|
end
|
||||||
P.waiting=45
|
P.waiting=45
|
||||||
@@ -79,7 +79,7 @@ return
|
|||||||
|
|
||||||
P.modeData.target=42
|
P.modeData.target=42
|
||||||
SFX.play('reach')
|
SFX.play('reach')
|
||||||
elseif T==42 then--Stage 4: survive in high speed
|
elseif T==42 then-- Stage 4: survive in high speed
|
||||||
if P.garbageBeneath==0 then
|
if P.garbageBeneath==0 then
|
||||||
P:stageComplete(4)
|
P:stageComplete(4)
|
||||||
P.waiting=30
|
P.waiting=30
|
||||||
@@ -93,7 +93,7 @@ return
|
|||||||
else
|
else
|
||||||
p=41
|
p=41
|
||||||
end
|
end
|
||||||
elseif T==62 then--Stage 5: survive without easy-fresh rule
|
elseif T==62 then-- Stage 5: survive without easy-fresh rule
|
||||||
P:stageComplete(5)
|
P:stageComplete(5)
|
||||||
P.life=P.life+1
|
P.life=P.life+1
|
||||||
ENV.lock=13
|
ENV.lock=13
|
||||||
@@ -104,7 +104,7 @@ return
|
|||||||
|
|
||||||
P.modeData.target=126
|
P.modeData.target=126
|
||||||
SFX.play('reach')
|
SFX.play('reach')
|
||||||
elseif T==126 then--Stage 6: speed up
|
elseif T==126 then-- Stage 6: speed up
|
||||||
P:stageComplete(6)
|
P:stageComplete(6)
|
||||||
P.life=P.life+1
|
P.life=P.life+1
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ return
|
|||||||
|
|
||||||
P.modeData.target=162
|
P.modeData.target=162
|
||||||
SFX.play('reach')
|
SFX.play('reach')
|
||||||
elseif T==162 then--Stage 7: speed up+++
|
elseif T==162 then-- Stage 7: speed up+++
|
||||||
P:stageComplete(7)
|
P:stageComplete(7)
|
||||||
P.life=P.life+1
|
P.life=P.life+1
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ return
|
|||||||
|
|
||||||
P.modeData.target=226
|
P.modeData.target=226
|
||||||
SFX.play('reach')
|
SFX.play('reach')
|
||||||
elseif T==226 then--Stage 8: final invisible
|
elseif T==226 then-- Stage 8: final invisible
|
||||||
P:stageComplete(8)
|
P:stageComplete(8)
|
||||||
P.life=P.life+1
|
P.life=P.life+1
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ return
|
|||||||
|
|
||||||
P.modeData.target=259
|
P.modeData.target=259
|
||||||
SFX.play('reach')
|
SFX.play('reach')
|
||||||
elseif T==259 then--Stage 9: ending
|
elseif T==259 then-- Stage 9: ending
|
||||||
P:stageComplete(9)
|
P:stageComplete(9)
|
||||||
P.life=P.life+1
|
P.life=P.life+1
|
||||||
for i=1,7 do ENV.skin[i]=P.holeRND:random(16) end
|
for i=1,7 do ENV.skin[i]=P.holeRND:random(16) end
|
||||||
|
|||||||
@@ -50,5 +50,5 @@ return{
|
|||||||
mText(TEXTOBJ.pc,63,330)
|
mText(TEXTOBJ.pc,63,330)
|
||||||
end,
|
end,
|
||||||
hook_drop=_check,
|
hook_drop=_check,
|
||||||
task=_check,--Just run one time at first to start first level
|
task=_check,-- Just run one time at first to start first level
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,5 +43,5 @@ return{
|
|||||||
mText(TEXTOBJ.pc,63,330)
|
mText(TEXTOBJ.pc,63,330)
|
||||||
end,
|
end,
|
||||||
hook_drop=_check,
|
hook_drop=_check,
|
||||||
task=_check,--Just run one time at first to start first level
|
task=_check,-- Just run one time at first to start first level
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ end
|
|||||||
local F={}
|
local F={}
|
||||||
|
|
||||||
-- local ranks={"10","9","8","7","6","5","4","3","2","1","S1","S2","S3","S4","S5","S6","S7","S8","S9","GM","GM+","TM","TM+","TM+₂","TM+₃", "TM+₄","TM+₅"}
|
-- local ranks={"10","9","8","7","6","5","4","3","2","1","S1","S2","S3","S4","S5","S6","S7","S8","S9","GM","GM+","TM","TM+","TM+₂","TM+₃", "TM+₄","TM+₅"}
|
||||||
-- lines: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
-- lines: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
||||||
|
|
||||||
local function getSmallNum(num)
|
local function getSmallNum(num)
|
||||||
local smalldigit={[0]="₀","₁","₂","₃","₄","₅","₆","₇","₈","₉"}
|
local smalldigit={[0]="₀","₁","₂","₃","₄","₅","₆","₇","₈","₉"}
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ local playSFX=SFX.play
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--System
|
-- System
|
||||||
do--function tryBack()
|
do-- function tryBack()
|
||||||
local sureTime=-1e99
|
local sureTime=-1e99
|
||||||
function tryBack()
|
function tryBack()
|
||||||
if TIME()-sureTime<1 then
|
if TIME()-sureTime<1 then
|
||||||
@@ -27,7 +27,7 @@ do--function tryBack()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
do--function tryReset()
|
do-- function tryReset()
|
||||||
local sureTime=-1e99
|
local sureTime=-1e99
|
||||||
function tryReset()
|
function tryReset()
|
||||||
if TIME()-sureTime<1 then
|
if TIME()-sureTime<1 then
|
||||||
@@ -39,7 +39,7 @@ do--function tryReset()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
do--function tryDelete()
|
do-- function tryDelete()
|
||||||
local sureTime=-1e99
|
local sureTime=-1e99
|
||||||
function tryDelete()
|
function tryDelete()
|
||||||
if TIME()-sureTime<1 then
|
if TIME()-sureTime<1 then
|
||||||
@@ -51,7 +51,7 @@ do--function tryDelete()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
do--function loadFile(name,args), function saveFile(data,name,args)
|
do-- function loadFile(name,args), function saveFile(data,name,args)
|
||||||
local t=setmetatable({},{__index=function() return"'$1' loading failed: $2" end})
|
local t=setmetatable({},{__index=function() return"'$1' loading failed: $2" end})
|
||||||
function loadFile(name,args)
|
function loadFile(name,args)
|
||||||
local text=text or t
|
local text=text or t
|
||||||
@@ -102,7 +102,7 @@ end
|
|||||||
function saveSettings()
|
function saveSettings()
|
||||||
return saveFile(SETTING,'conf/settings')
|
return saveFile(SETTING,'conf/settings')
|
||||||
end
|
end
|
||||||
do--function applySettings()
|
do-- function applySettings()
|
||||||
local saturateValues={
|
local saturateValues={
|
||||||
normal={0,1},
|
normal={0,1},
|
||||||
soft={.2,.7},
|
soft={.2,.7},
|
||||||
@@ -111,7 +111,7 @@ do--function applySettings()
|
|||||||
color={-.2,1.2},
|
color={-.2,1.2},
|
||||||
}
|
}
|
||||||
function applySettings()
|
function applySettings()
|
||||||
--Apply language
|
-- Apply language
|
||||||
text=LANG.get(SETTING.locale)
|
text=LANG.get(SETTING.locale)
|
||||||
WIDGET.setLang(text.WidgetText)
|
WIDGET.setLang(text.WidgetText)
|
||||||
for k,v in next,TEXTOBJ do
|
for k,v in next,TEXTOBJ do
|
||||||
@@ -120,29 +120,29 @@ do--function applySettings()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Apply cursor
|
-- Apply cursor
|
||||||
love.mouse.setVisible(SETTING.sysCursor)
|
love.mouse.setVisible(SETTING.sysCursor)
|
||||||
|
|
||||||
--Apply fullscreen
|
-- Apply fullscreen
|
||||||
love.window.setFullscreen(SETTING.fullscreen)
|
love.window.setFullscreen(SETTING.fullscreen)
|
||||||
love.resize(GC.getWidth(),GC.getHeight())
|
love.resize(GC.getWidth(),GC.getHeight())
|
||||||
|
|
||||||
--Apply Zframework setting
|
-- Apply Zframework setting
|
||||||
Z.setClickFX(SETTING.clickFX)
|
Z.setClickFX(SETTING.clickFX)
|
||||||
Z.setFrameMul(SETTING.frameMul)
|
Z.setFrameMul(SETTING.frameMul)
|
||||||
Z.setPowerInfo(SETTING.powerInfo)
|
Z.setPowerInfo(SETTING.powerInfo)
|
||||||
Z.setCleanCanvas(SETTING.cleanCanvas)
|
Z.setCleanCanvas(SETTING.cleanCanvas)
|
||||||
|
|
||||||
--Apply VK shape
|
-- Apply VK shape
|
||||||
VK.setShape(SETTING.VKSkin)
|
VK.setShape(SETTING.VKSkin)
|
||||||
|
|
||||||
--Apply sound
|
-- Apply sound
|
||||||
love.audio.setVolume(SETTING.mainVol)
|
love.audio.setVolume(SETTING.mainVol)
|
||||||
BGM.setVol(SETTING.bgm)
|
BGM.setVol(SETTING.bgm)
|
||||||
SFX.setVol(SETTING.sfx)
|
SFX.setVol(SETTING.sfx)
|
||||||
VOC.setVol(SETTING.voc)
|
VOC.setVol(SETTING.voc)
|
||||||
|
|
||||||
--Apply saturs
|
-- Apply saturs
|
||||||
local m
|
local m
|
||||||
m=saturateValues[SETTING.blockSatur] or saturateValues.normal
|
m=saturateValues[SETTING.blockSatur] or saturateValues.normal
|
||||||
SHADER.blockSatur:send('b',m[1])
|
SHADER.blockSatur:send('b',m[1])
|
||||||
@@ -151,7 +151,7 @@ do--function applySettings()
|
|||||||
SHADER.fieldSatur:send('b',m[1])
|
SHADER.fieldSatur:send('b',m[1])
|
||||||
SHADER.fieldSatur:send('k',m[2])
|
SHADER.fieldSatur:send('k',m[2])
|
||||||
|
|
||||||
--Apply BG
|
-- Apply BG
|
||||||
if SETTING.bg=='on' then
|
if SETTING.bg=='on' then
|
||||||
BG.unlock()
|
BG.unlock()
|
||||||
BG.set()
|
BG.set()
|
||||||
@@ -171,7 +171,7 @@ do--function applySettings()
|
|||||||
else
|
else
|
||||||
MES.new('error',text.customBGloadFailed)
|
MES.new('error',text.customBGloadFailed)
|
||||||
end
|
end
|
||||||
else--Switch off when custom BG not found
|
else-- Switch off when custom BG not found
|
||||||
SETTING.bg='off'
|
SETTING.bg='off'
|
||||||
BG.unlock()
|
BG.unlock()
|
||||||
BG.set('fixColor',SETTING.bgAlpha,SETTING.bgAlpha,SETTING.bgAlpha)
|
BG.set('fixColor',SETTING.bgAlpha,SETTING.bgAlpha,SETTING.bgAlpha)
|
||||||
@@ -181,8 +181,8 @@ do--function applySettings()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Royale mode
|
-- Royale mode
|
||||||
function randomTarget(P)--Return a random opponent for P
|
function randomTarget(P)-- Return a random opponent for P
|
||||||
if #PLY_ALIVE>1 then
|
if #PLY_ALIVE>1 then
|
||||||
local R
|
local R
|
||||||
repeat
|
repeat
|
||||||
@@ -277,7 +277,7 @@ function royaleLevelup()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Sound shortcuts
|
-- Sound shortcuts
|
||||||
function playClearSFX(cc)
|
function playClearSFX(cc)
|
||||||
if cc<=0 or cc%1~=0 then return end
|
if cc<=0 or cc%1~=0 then return end
|
||||||
if cc<=4 then
|
if cc<=4 then
|
||||||
@@ -329,7 +329,7 @@ function playReadySFX(i,vol)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--Game
|
-- Game
|
||||||
function getItem(itemName,amount)
|
function getItem(itemName,amount)
|
||||||
STAT.item[itemName]=STAT.item[itemName]+(amount or 1)
|
STAT.item[itemName]=STAT.item[itemName]+(amount or 1)
|
||||||
end
|
end
|
||||||
@@ -381,7 +381,7 @@ function freshDate(args)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function legalGameTime()--Check if today's playtime is legal
|
function legalGameTime()-- Check if today's playtime is legal
|
||||||
if
|
if
|
||||||
SETTING.locale:find'zh' and
|
SETTING.locale:find'zh' and
|
||||||
RANKS.sprint_10l<4 and
|
RANKS.sprint_10l<4 and
|
||||||
@@ -399,7 +399,7 @@ function legalGameTime()--Check if today's playtime is legal
|
|||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
do--function trySettingWarn()
|
do-- function trySettingWarn()
|
||||||
local lastWarnTime=0
|
local lastWarnTime=0
|
||||||
function trySettingWarn()
|
function trySettingWarn()
|
||||||
if TIME()-lastWarnTime>2.6 then
|
if TIME()-lastWarnTime>2.6 then
|
||||||
@@ -409,7 +409,7 @@ do--function trySettingWarn()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function mergeStat(stat,delta)--Merge delta stat. to global stat.
|
function mergeStat(stat,delta)-- Merge delta stat. to global stat.
|
||||||
for k,v in next,delta do
|
for k,v in next,delta do
|
||||||
if type(v)=='table' then
|
if type(v)=='table' then
|
||||||
if type(stat[k])=='table' then
|
if type(stat[k])=='table' then
|
||||||
@@ -422,7 +422,7 @@ function mergeStat(stat,delta)--Merge delta stat. to global stat.
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function scoreValid()--Check if any unranked mods are activated
|
function scoreValid()-- Check if any unranked mods are activated
|
||||||
for _,M in next,GAME.mod do
|
for _,M in next,GAME.mod do
|
||||||
if M.unranked then
|
if M.unranked then
|
||||||
return false
|
return false
|
||||||
@@ -433,7 +433,7 @@ function scoreValid()--Check if any unranked mods are activated
|
|||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
function destroyPlayers()--Destroy all player objects, restore freerows and free CCs
|
function destroyPlayers()-- Destroy all player objects, restore freerows and free CCs
|
||||||
for i=#PLAYERS,1,-1 do
|
for i=#PLAYERS,1,-1 do
|
||||||
local P=PLAYERS[i]
|
local P=PLAYERS[i]
|
||||||
if P.canvas then
|
if P.canvas then
|
||||||
@@ -468,7 +468,7 @@ function pauseGame()
|
|||||||
SCN.swapTo('pause','none')
|
SCN.swapTo('pause','none')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function applyCustomGame()--Apply CUSTOMENV, BAG, MISSION
|
function applyCustomGame()-- Apply CUSTOMENV, BAG, MISSION
|
||||||
for k,v in next,CUSTOMENV do
|
for k,v in next,CUSTOMENV do
|
||||||
GAME.modeEnv[k]=v
|
GAME.modeEnv[k]=v
|
||||||
end
|
end
|
||||||
@@ -483,7 +483,7 @@ function applyCustomGame()--Apply CUSTOMENV, BAG, MISSION
|
|||||||
GAME.modeEnv.mission=nil
|
GAME.modeEnv.mission=nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function loadGame(mode,ifQuickPlay,ifNet)--Load a mode and go to game scene
|
function loadGame(mode,ifQuickPlay,ifNet)-- Load a mode and go to game scene
|
||||||
freshDate()
|
freshDate()
|
||||||
if legalGameTime() then
|
if legalGameTime() then
|
||||||
if not MODES[mode] and FILE.isSafe('parts/modes/'..mode) then
|
if not MODES[mode] and FILE.isSafe('parts/modes/'..mode) then
|
||||||
@@ -510,7 +510,7 @@ function loadGame(mode,ifQuickPlay,ifNet)--Load a mode and go to game scene
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function gameOver()--Save record
|
function gameOver()-- Save record
|
||||||
if GAME.replaying then
|
if GAME.replaying then
|
||||||
local R=GAME.curMode.getRank
|
local R=GAME.curMode.getRank
|
||||||
if R then
|
if R then
|
||||||
@@ -526,13 +526,13 @@ function gameOver()--Save record
|
|||||||
local R=M.getRank
|
local R=M.getRank
|
||||||
if R then
|
if R then
|
||||||
local P=PLAYERS[1]
|
local P=PLAYERS[1]
|
||||||
R=R(P)--New rank
|
R=R(P)-- New rank
|
||||||
if R then
|
if R then
|
||||||
if R>0 then
|
if R>0 then
|
||||||
GAME.rank=R
|
GAME.rank=R
|
||||||
end
|
end
|
||||||
if not GAME.replaying and M.score and scoreValid() then
|
if not GAME.replaying and M.score and scoreValid() then
|
||||||
if RANKS[M.name] then--Old rank exist
|
if RANKS[M.name] then-- Old rank exist
|
||||||
local needSave
|
local needSave
|
||||||
if R>RANKS[M.name] then
|
if R>RANKS[M.name] then
|
||||||
RANKS[M.name]=R
|
RANKS[M.name]=R
|
||||||
@@ -558,9 +558,9 @@ function gameOver()--Save record
|
|||||||
end
|
end
|
||||||
local D=M.score(P)
|
local D=M.score(P)
|
||||||
local L=M.records
|
local L=M.records
|
||||||
local p=#L--Rank-1
|
local p=#L-- Rank-1
|
||||||
if p>0 then
|
if p>0 then
|
||||||
while M.comp(D,L[p]) do--If higher rank
|
while M.comp(D,L[p]) do-- If higher rank
|
||||||
p=p-1
|
p=p-1
|
||||||
if p==0 then break end
|
if p==0 then break end
|
||||||
end
|
end
|
||||||
@@ -592,9 +592,9 @@ function trySave()
|
|||||||
saveStats()
|
saveStats()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
do--function freshPlayerPosition(sudden)
|
do-- function freshPlayerPosition(sudden)
|
||||||
local posLists={
|
local posLists={
|
||||||
--1~5
|
-- 1~5
|
||||||
{
|
{
|
||||||
{340,75,1},
|
{340,75,1},
|
||||||
{965,390,.5},
|
{965,390,.5},
|
||||||
@@ -602,7 +602,7 @@ do--function freshPlayerPosition(sudden)
|
|||||||
{20,390,.5},
|
{20,390,.5},
|
||||||
{20,30,.5},
|
{20,30,.5},
|
||||||
},
|
},
|
||||||
--6~17
|
-- 6~17
|
||||||
(function()
|
(function()
|
||||||
local L={{340,75,1}}
|
local L={{340,75,1}}
|
||||||
for i=1,4 do ins(L,{15,-160+180*i,.25}) end
|
for i=1,4 do ins(L,{15,-160+180*i,.25}) end
|
||||||
@@ -611,7 +611,7 @@ do--function freshPlayerPosition(sudden)
|
|||||||
for i=1,4 do ins(L,{1120,-160+180*i,.25}) end
|
for i=1,4 do ins(L,{1120,-160+180*i,.25}) end
|
||||||
return L
|
return L
|
||||||
end)(),
|
end)(),
|
||||||
--18~31
|
-- 18~31
|
||||||
(function()
|
(function()
|
||||||
local L={{340,75,1}}
|
local L={{340,75,1}}
|
||||||
for i=1,5 do ins(L,{10, -100+135*i,.18}) end
|
for i=1,5 do ins(L,{10, -100+135*i,.18}) end
|
||||||
@@ -622,14 +622,14 @@ do--function freshPlayerPosition(sudden)
|
|||||||
for i=1,5 do ins(L,{1160,-100+135*i,.18}) end
|
for i=1,5 do ins(L,{1160,-100+135*i,.18}) end
|
||||||
return L
|
return L
|
||||||
end)(),
|
end)(),
|
||||||
--32~49
|
-- 32~49
|
||||||
(function()
|
(function()
|
||||||
local L={{340,75,1}}
|
local L={{340,75,1}}
|
||||||
for i=1,4 do for j=1,6 do ins(L,{78*i-54,115*j-98,.09}) end end
|
for i=1,4 do for j=1,6 do ins(L,{78*i-54,115*j-98,.09}) end end
|
||||||
for i=9,12 do for j=1,6 do ins(L,{78*i+267,115*j-98,.09}) end end
|
for i=9,12 do for j=1,6 do ins(L,{78*i+267,115*j-98,.09}) end end
|
||||||
return L
|
return L
|
||||||
end)(),
|
end)(),
|
||||||
--50~99
|
-- 50~99
|
||||||
(function()
|
(function()
|
||||||
local L={{340,75,1}}
|
local L={{340,75,1}}
|
||||||
for i=1,7 do for j=1,7 do ins(L,{46*i-36,97*j-72,.068}) end end
|
for i=1,7 do for j=1,7 do ins(L,{46*i-36,97*j-72,.068}) end end
|
||||||
@@ -637,7 +637,7 @@ do--function freshPlayerPosition(sudden)
|
|||||||
return L
|
return L
|
||||||
end)(),
|
end)(),
|
||||||
}
|
}
|
||||||
function freshPlayerPosition(sudden)--Set initial position for every player
|
function freshPlayerPosition(sudden)-- Set initial position for every player
|
||||||
local L=PLY_ALIVE
|
local L=PLY_ALIVE
|
||||||
if not sudden then
|
if not sudden then
|
||||||
for i=1,#L do
|
for i=1,#L do
|
||||||
@@ -657,21 +657,21 @@ do--function freshPlayerPosition(sudden)
|
|||||||
for i=1,#L do L[i][method](L[i],unpack(posList[i])) end
|
for i=1,#L do L[i][method](L[i],unpack(posList[i])) end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
do--function dumpBasicConfig()
|
do-- function dumpBasicConfig()
|
||||||
local gameSetting={
|
local gameSetting={
|
||||||
--Tuning
|
-- Tuning
|
||||||
'das','arr','dascut','dropcut','sddas','sdarr',
|
'das','arr','dascut','dropcut','sddas','sdarr',
|
||||||
'ihs','irs','ims','RS',
|
'ihs','irs','ims','RS',
|
||||||
|
|
||||||
--System
|
-- System
|
||||||
'skin','face',
|
'skin','face',
|
||||||
|
|
||||||
--Graphic
|
-- Graphic
|
||||||
'ghostType','block','ghost','center','bagLine',
|
'ghostType','block','ghost','center','bagLine',
|
||||||
'dropFX','moveFX','shakeFX',
|
'dropFX','moveFX','shakeFX',
|
||||||
'text','highCam','nextPos',
|
'text','highCam','nextPos',
|
||||||
|
|
||||||
--Unnecessary graphic
|
-- Unnecessary graphic
|
||||||
-- 'grid','smooth',
|
-- 'grid','smooth',
|
||||||
-- 'lockFX','clearFX','splashFX','atkFX',
|
-- 'lockFX','clearFX','splashFX','atkFX',
|
||||||
-- 'score',
|
-- 'score',
|
||||||
@@ -684,7 +684,7 @@ do--function dumpBasicConfig()
|
|||||||
return JSON.encode(S)
|
return JSON.encode(S)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
do--function resetGameData(args)
|
do-- function resetGameData(args)
|
||||||
local function task_showMods()
|
local function task_showMods()
|
||||||
local time=0
|
local time=0
|
||||||
while true do
|
while true do
|
||||||
@@ -701,14 +701,14 @@ do--function resetGameData(args)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
local gameSetting={
|
local gameSetting={
|
||||||
--Tuning
|
-- Tuning
|
||||||
'das','arr','dascut','dropcut','sddas','sdarr',
|
'das','arr','dascut','dropcut','sddas','sdarr',
|
||||||
'ihs','irs','ims','RS',
|
'ihs','irs','ims','RS',
|
||||||
|
|
||||||
--System
|
-- System
|
||||||
'skin','face',
|
'skin','face',
|
||||||
|
|
||||||
--Graphic
|
-- Graphic
|
||||||
'block','ghost','center','smooth','grid','bagLine',
|
'block','ghost','center','smooth','grid','bagLine',
|
||||||
'lockFX','dropFX','moveFX','clearFX','splashFX','shakeFX','atkFX',
|
'lockFX','dropFX','moveFX','clearFX','splashFX','shakeFX','atkFX',
|
||||||
'text','score','warn','highCam','nextPos',
|
'text','score','warn','highCam','nextPos',
|
||||||
@@ -785,14 +785,14 @@ do--function resetGameData(args)
|
|||||||
collectgarbage()
|
collectgarbage()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
do--function checkWarning()
|
do-- function checkWarning()
|
||||||
local max=math.max
|
local max=math.max
|
||||||
function checkWarning(dt)
|
function checkWarning(dt)
|
||||||
local P1=PLAYERS[1]
|
local P1=PLAYERS[1]
|
||||||
if P1.alive then
|
if P1.alive then
|
||||||
if P1.frameRun%26==0 then
|
if P1.frameRun%26==0 then
|
||||||
local F=P1.field
|
local F=P1.field
|
||||||
local height=0--Max height of row 4~7
|
local height=0-- Max height of row 4~7
|
||||||
for x=4,7 do
|
for x=4,7 do
|
||||||
for y=#F,1,-1 do
|
for y=#F,1,-1 do
|
||||||
if F[y][x]>0 then
|
if F[y][x]>0 then
|
||||||
@@ -823,8 +823,8 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--Game draw
|
-- Game draw
|
||||||
do--function drawSelfProfile()
|
do-- function drawSelfProfile()
|
||||||
local name
|
local name
|
||||||
local textObj,scaleK,width,offY
|
local textObj,scaleK,width,offY
|
||||||
function drawSelfProfile()
|
function drawSelfProfile()
|
||||||
@@ -832,14 +832,14 @@ do--function drawSelfProfile()
|
|||||||
gc_push('transform')
|
gc_push('transform')
|
||||||
gc_replaceTransform(SCR.xOy_ur)
|
gc_replaceTransform(SCR.xOy_ur)
|
||||||
|
|
||||||
--Draw avatar
|
-- Draw avatar
|
||||||
gc_setLineWidth(2)
|
gc_setLineWidth(2)
|
||||||
gc_setColor(COLOR.X)gc_rectangle('fill',0,0,-300,80)
|
gc_setColor(COLOR.X)gc_rectangle('fill',0,0,-300,80)
|
||||||
gc_setColor(1,1,1)gc_rectangle('line',-300,0,300,80,5)
|
gc_setColor(1,1,1)gc_rectangle('line',-300,0,300,80,5)
|
||||||
gc_rectangle('line',-73,7,66,66,2)
|
gc_rectangle('line',-73,7,66,66,2)
|
||||||
gc_draw(selfAvatar,-72,8,nil,.5)
|
gc_draw(selfAvatar,-72,8,nil,.5)
|
||||||
|
|
||||||
--Draw username
|
-- Draw username
|
||||||
if name~=USERS.getUsername(USER.uid) then
|
if name~=USERS.getUsername(USER.uid) then
|
||||||
name=USERS.getUsername(USER.uid)
|
name=USERS.getUsername(USER.uid)
|
||||||
textObj=GC.newText(getFont(30),name)
|
textObj=GC.newText(getFont(30),name)
|
||||||
@@ -874,9 +874,9 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--Widget function shortcuts
|
-- Widget function shortcuts
|
||||||
function backScene() SCN.back() end
|
function backScene() SCN.back() end
|
||||||
do--function goScene(name,style)
|
do-- function goScene(name,style)
|
||||||
local cache={}
|
local cache={}
|
||||||
function goScene(name,style)
|
function goScene(name,style)
|
||||||
local hash=style and name..style or name
|
local hash=style and name..style or name
|
||||||
@@ -886,7 +886,7 @@ do--function goScene(name,style)
|
|||||||
return cache[hash]
|
return cache[hash]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
do--function swapScene(name,style)
|
do-- function swapScene(name,style)
|
||||||
local cache={}
|
local cache={}
|
||||||
function swapScene(name,style)
|
function swapScene(name,style)
|
||||||
local hash=style and name..style or name
|
local hash=style and name..style or name
|
||||||
@@ -896,7 +896,7 @@ do--function swapScene(name,style)
|
|||||||
return cache[hash]
|
return cache[hash]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
do--function pressKey(k)
|
do-- function pressKey(k)
|
||||||
local cache={}
|
local cache={}
|
||||||
function pressKey(k)
|
function pressKey(k)
|
||||||
if not cache[k] then
|
if not cache[k] then
|
||||||
@@ -905,7 +905,7 @@ do--function pressKey(k)
|
|||||||
return cache[k]
|
return cache[k]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
do--CUS/SETXXX(k)
|
do-- CUS/SETXXX(k)
|
||||||
local CUSTOMENV=CUSTOMENV
|
local CUSTOMENV=CUSTOMENV
|
||||||
local warnList={
|
local warnList={
|
||||||
'das','arr','dascut','dropcut','sddas','sdarr',
|
'das','arr','dascut','dropcut','sddas','sdarr',
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--Static data tables
|
-- Static data tables
|
||||||
BLOCK_NAMES={
|
BLOCK_NAMES={
|
||||||
'Z','S','J','L','T','O','I',
|
'Z','S','J','L','T','O','I',
|
||||||
'Z5','S5','P','Q','F','E',
|
'Z5','S5','P','Q','F','E',
|
||||||
@@ -20,7 +20,7 @@ RANK_COLORS={
|
|||||||
{1,.5,.4},
|
{1,.5,.4},
|
||||||
{.95,.5,.95},
|
{.95,.5,.95},
|
||||||
}
|
}
|
||||||
do--SVG_TITLE_FILL, SVG_TITLE_LINE
|
do-- SVG_TITLE_FILL, SVG_TITLE_LINE
|
||||||
SVG_TITLE_FILL={
|
SVG_TITLE_FILL={
|
||||||
{
|
{
|
||||||
0,0,
|
0,0,
|
||||||
@@ -134,21 +134,21 @@ do--SVG_TITLE_FILL, SVG_TITLE_LINE
|
|||||||
for j=1,16 do SVG_TITLE_LINE[8][j]=SVG_TITLE_FILL[8][j] end
|
for j=1,16 do SVG_TITLE_LINE[8][j]=SVG_TITLE_FILL[8][j] end
|
||||||
for j=19,#SVG_TITLE_FILL[8]-2 do SVG_TITLE_LINE[9][j-18]=SVG_TITLE_FILL[8][j] end
|
for j=19,#SVG_TITLE_FILL[8]-2 do SVG_TITLE_LINE[9][j-18]=SVG_TITLE_FILL[8][j] end
|
||||||
end
|
end
|
||||||
do--SVG_TITLE_FAN
|
do-- SVG_TITLE_FAN
|
||||||
SVG_TITLE_FAN={}
|
SVG_TITLE_FAN={}
|
||||||
local sin,cos=math.sin,math.cos
|
local sin,cos=math.sin,math.cos
|
||||||
for i=1,9 do
|
for i=1,9 do
|
||||||
local L=TABLE.copy(SVG_TITLE_LINE[i])
|
local L=TABLE.copy(SVG_TITLE_LINE[i])
|
||||||
SVG_TITLE_FAN[i]=L
|
SVG_TITLE_FAN[i]=L
|
||||||
for j=1,#L,2 do
|
for j=1,#L,2 do
|
||||||
local x,y=L[j],L[j+1]--0<x<988, 290<y<1280
|
local x,y=L[j],L[j+1]-- 0<x<988, 290<y<1280
|
||||||
x,y=-(x+280)*.002,(y-580)*.9--X=ang, Y=dist
|
x,y=-(x+280)*.002,(y-580)*.9-- X=ang, Y=dist
|
||||||
x,y=y*cos(x),-y*sin(x)--Rec-Pol-Rec
|
x,y=y*cos(x),-y*sin(x)-- Rec-Pol-Rec
|
||||||
L[j],L[j+1]=x,y+300
|
L[j],L[j+1]=x,y+300
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
do--MISSIONENUM
|
do-- MISSIONENUM
|
||||||
ENUM_MISSION={
|
ENUM_MISSION={
|
||||||
_1=01,_2=02,_3=03,_4=04,
|
_1=01,_2=02,_3=03,_4=04,
|
||||||
A1=05,A2=06,A3=07,A4=08,
|
A1=05,A2=06,A3=07,A4=08,
|
||||||
@@ -165,7 +165,7 @@ do--MISSIONENUM
|
|||||||
for k,v in next,ENUM_MISSION do L[v]=k end
|
for k,v in next,ENUM_MISSION do L[v]=k end
|
||||||
for k,v in next,L do ENUM_MISSION[k]=v end
|
for k,v in next,L do ENUM_MISSION[k]=v end
|
||||||
end
|
end
|
||||||
do--TEXTOBJ
|
do-- TEXTOBJ
|
||||||
local function T(s,t) return love.graphics.newText(getFont(s),t) end
|
local function T(s,t) return love.graphics.newText(getFont(s),t) end
|
||||||
TEXTOBJ={
|
TEXTOBJ={
|
||||||
modeName=T(30),
|
modeName=T(30),
|
||||||
@@ -189,51 +189,51 @@ do--TEXTOBJ
|
|||||||
noScore=T(45),highScore=T(30),modeLocked=T(45),
|
noScore=T(45),highScore=T(30),modeLocked=T(45),
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
do--BLOCKS
|
do-- BLOCKS
|
||||||
local O,_=true,false
|
local O,_=true,false
|
||||||
BLOCKS={
|
BLOCKS={
|
||||||
--Tetromino
|
-- Tetromino
|
||||||
{{_,O,O},{O,O,_}},--Z
|
{{_,O,O},{O,O,_}},-- Z
|
||||||
{{O,O,_},{_,O,O}},--S
|
{{O,O,_},{_,O,O}},-- S
|
||||||
{{O,O,O},{O,_,_}},--J
|
{{O,O,O},{O,_,_}},-- J
|
||||||
{{O,O,O},{_,_,O}},--L
|
{{O,O,O},{_,_,O}},-- L
|
||||||
{{O,O,O},{_,O,_}},--T
|
{{O,O,O},{_,O,_}},-- T
|
||||||
{{O,O},{O,O}}, --O
|
{{O,O},{O,O}}, -- O
|
||||||
{{O,O,O,O}}, --I
|
{{O,O,O,O}}, -- I
|
||||||
|
|
||||||
--Pentomino
|
-- Pentomino
|
||||||
{{_,O,O},{_,O,_},{O,O,_}},--Z5
|
{{_,O,O},{_,O,_},{O,O,_}},-- Z5
|
||||||
{{O,O,_},{_,O,_},{_,O,O}},--S5
|
{{O,O,_},{_,O,_},{_,O,O}},-- S5
|
||||||
{{O,O,O},{O,O,_}}, --P
|
{{O,O,O},{O,O,_}}, -- P
|
||||||
{{O,O,O},{_,O,O}}, --Q
|
{{O,O,O},{_,O,O}}, -- Q
|
||||||
{{_,O,_},{O,O,O},{O,_,_}},--F
|
{{_,O,_},{O,O,O},{O,_,_}},-- F
|
||||||
{{_,O,_},{O,O,O},{_,_,O}},--E
|
{{_,O,_},{O,O,O},{_,_,O}},-- E
|
||||||
{{O,O,O},{_,O,_},{_,O,_}},--T5
|
{{O,O,O},{_,O,_},{_,O,_}},-- T5
|
||||||
{{O,O,O},{O,_,O}}, --U
|
{{O,O,O},{O,_,O}}, -- U
|
||||||
{{O,O,O},{_,_,O},{_,_,O}},--V
|
{{O,O,O},{_,_,O},{_,_,O}},-- V
|
||||||
{{_,O,O},{O,O,_},{O,_,_}},--W
|
{{_,O,O},{O,O,_},{O,_,_}},-- W
|
||||||
{{_,O,_},{O,O,O},{_,O,_}},--X
|
{{_,O,_},{O,O,O},{_,O,_}},-- X
|
||||||
{{O,O,O,O},{O,_,_,_}}, --J5
|
{{O,O,O,O},{O,_,_,_}}, -- J5
|
||||||
{{O,O,O,O},{_,_,_,O}}, --L5
|
{{O,O,O,O},{_,_,_,O}}, -- L5
|
||||||
{{O,O,O,O},{_,O,_,_}}, --R
|
{{O,O,O,O},{_,O,_,_}}, -- R
|
||||||
{{O,O,O,O},{_,_,O,_}}, --Y
|
{{O,O,O,O},{_,_,O,_}}, -- Y
|
||||||
{{_,O,O,O},{O,O,_,_}}, --N
|
{{_,O,O,O},{O,O,_,_}}, -- N
|
||||||
{{O,O,O,_},{_,_,O,O}}, --H
|
{{O,O,O,_},{_,_,O,O}}, -- H
|
||||||
{{O,O,O,O,O}}, --I5
|
{{O,O,O,O,O}}, -- I5
|
||||||
|
|
||||||
--Trimino
|
-- Trimino
|
||||||
{{O,O,O}}, --I3
|
{{O,O,O}}, -- I3
|
||||||
{{O,O},{_,O}},--C
|
{{O,O},{_,O}},-- C
|
||||||
|
|
||||||
--Domino
|
-- Domino
|
||||||
{{O,O}},--I2
|
{{O,O}},-- I2
|
||||||
|
|
||||||
--Dot
|
-- Dot
|
||||||
{{O}},--O1
|
{{O}},-- O1
|
||||||
}
|
}
|
||||||
local function _RotCW(B)
|
local function _RotCW(B)
|
||||||
local N={}
|
local N={}
|
||||||
local r,c=#B,#B[1]--row,col
|
local r,c=#B,#B[1]-- row,col
|
||||||
for x=1,c do
|
for x=1,c do
|
||||||
N[x]={}
|
N[x]={}
|
||||||
for y=1,r do
|
for y=1,r do
|
||||||
@@ -339,11 +339,11 @@ EVENTSETS={
|
|||||||
'ultra',
|
'ultra',
|
||||||
}
|
}
|
||||||
|
|
||||||
do--Mod data
|
do-- Mod data
|
||||||
local function _disableKey(P,key)
|
local function _disableKey(P,key)
|
||||||
table.insert(P.gameEnv.keyCancel,key)
|
table.insert(P.gameEnv.keyCancel,key)
|
||||||
end
|
end
|
||||||
MODOPT={--Mod options
|
MODOPT={-- Mod options
|
||||||
{no=0,id="NX",name="next",
|
{no=0,id="NX",name="next",
|
||||||
key="q",x=80,y=230,color='lO',
|
key="q",x=80,y=230,color='lO',
|
||||||
list={0,1,2,3,4,5,6},
|
list={0,1,2,3,4,5,6},
|
||||||
@@ -489,44 +489,44 @@ do--Mod data
|
|||||||
M.color=COLOR[M.color]
|
M.color=COLOR[M.color]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
do--Game data tables
|
do-- Game data tables
|
||||||
PLAYERS={}--Players data
|
PLAYERS={}-- Players data
|
||||||
PLY_ALIVE={}
|
PLY_ALIVE={}
|
||||||
FIELD={}--Field(s) for custom game
|
FIELD={}-- Field(s) for custom game
|
||||||
BAG={}--Sequence for custom game
|
BAG={}-- Sequence for custom game
|
||||||
MISSION={}--Clearing mission for custom game
|
MISSION={}-- Clearing mission for custom game
|
||||||
GAME={--Global game data
|
GAME={-- Global game data
|
||||||
playing=false, --If in-game
|
playing=false, -- If in-game
|
||||||
init=false, --If need initializing game when enter scene-play
|
init=false, -- If need initializing game when enter scene-play
|
||||||
net=false, --If play net game
|
net=false, -- If play net game
|
||||||
|
|
||||||
result=false, --Game result (string)
|
result=false, -- Game result (string)
|
||||||
rank=0, --Rank reached
|
rank=0, -- Rank reached
|
||||||
pauseTime=0, --Time paused
|
pauseTime=0, -- Time paused
|
||||||
pauseCount=0, --Pausing count
|
pauseCount=0, -- Pausing count
|
||||||
warnLVL0=0, --Warning level
|
warnLVL0=0, -- Warning level
|
||||||
warnLVL=0, --Warning level (show)
|
warnLVL=0, -- Warning level (show)
|
||||||
|
|
||||||
seed=1046101471, --Game seed
|
seed=1046101471, -- Game seed
|
||||||
curMode=false, --Current gamemode object
|
curMode=false, -- Current gamemode object
|
||||||
mod={}, --List of loaded mods
|
mod={}, -- List of loaded mods
|
||||||
modeEnv=false, --Current gamemode environment
|
modeEnv=false, -- Current gamemode environment
|
||||||
setting={}, --Game settings
|
setting={}, -- Game settings
|
||||||
rep={}, --Recording list, key,time,key,time...
|
rep={}, -- Recording list, key,time,key,time...
|
||||||
statSaved=true, --If recording saved
|
statSaved=true, -- If recording saved
|
||||||
recording=false, --If recording
|
recording=false, -- If recording
|
||||||
replaying=false, --If replaying
|
replaying=false, -- If replaying
|
||||||
saved=false, --If recording saved
|
saved=false, -- If recording saved
|
||||||
tasUsed=false, --If tasMode used
|
tasUsed=false, -- If tasMode used
|
||||||
|
|
||||||
prevBG=false, --Previous background, for restore BG when quit setting page
|
prevBG=false, -- Previous background, for restore BG when quit setting page
|
||||||
|
|
||||||
--Data for royale mode
|
-- Data for royale mode
|
||||||
stage=false, --Game stage
|
stage=false, -- Game stage
|
||||||
mostBadge=false, --Most badge owner
|
mostBadge=false, -- Most badge owner
|
||||||
secBadge=false, --Second badge owner
|
secBadge=false, -- Second badge owner
|
||||||
mostDangerous=false,--Most dangerous player
|
mostDangerous=false,-- Most dangerous player
|
||||||
secDangerous=false, --Second dangerous player
|
secDangerous=false, -- Second dangerous player
|
||||||
}
|
}
|
||||||
ROYALEDATA={
|
ROYALEDATA={
|
||||||
powerUp=false,
|
powerUp=false,
|
||||||
@@ -534,25 +534,25 @@ do--Game data tables
|
|||||||
}
|
}
|
||||||
CUSTOMENV={}
|
CUSTOMENV={}
|
||||||
ROOMENV={
|
ROOMENV={
|
||||||
--Room config
|
-- Room config
|
||||||
capacity=10,
|
capacity=10,
|
||||||
|
|
||||||
--Basic
|
-- Basic
|
||||||
drop=30,lock=60,
|
drop=30,lock=60,
|
||||||
wait=0,fall=0,
|
wait=0,fall=0,
|
||||||
hang=5,hurry=1e99,
|
hang=5,hurry=1e99,
|
||||||
|
|
||||||
--Control
|
-- Control
|
||||||
nextCount=6,
|
nextCount=6,
|
||||||
holdMode='hold',
|
holdMode='hold',
|
||||||
holdCount=1,
|
holdCount=1,
|
||||||
infHold=false,
|
infHold=false,
|
||||||
phyHold=false,
|
phyHold=false,
|
||||||
|
|
||||||
--Visual
|
-- Visual
|
||||||
bone=false,
|
bone=false,
|
||||||
|
|
||||||
--Rule
|
-- Rule
|
||||||
life=0,
|
life=0,
|
||||||
pushSpeed=5,
|
pushSpeed=5,
|
||||||
garbageSpeed=2,
|
garbageSpeed=2,
|
||||||
@@ -571,10 +571,10 @@ do--Game data tables
|
|||||||
|
|
||||||
eventSet="X",
|
eventSet="X",
|
||||||
}
|
}
|
||||||
REPLAY={}--Replay objects (not include stream data)
|
REPLAY={}-- Replay objects (not include stream data)
|
||||||
end
|
end
|
||||||
do--Userdata tables
|
do-- Userdata tables
|
||||||
USER=setmetatable({--User infomation
|
USER=setmetatable({-- User infomation
|
||||||
__data={
|
__data={
|
||||||
email=false,
|
email=false,
|
||||||
password=false,
|
password=false,
|
||||||
@@ -592,8 +592,8 @@ do--Userdata tables
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
SETTING={--Settings
|
SETTING={-- Settings
|
||||||
--Tuning
|
-- Tuning
|
||||||
das=10,arr=2,
|
das=10,arr=2,
|
||||||
dascut=0,dropcut=0,
|
dascut=0,dropcut=0,
|
||||||
sddas=0,sdarr=2,
|
sddas=0,sdarr=2,
|
||||||
@@ -601,7 +601,7 @@ do--Userdata tables
|
|||||||
holdMode='hold',
|
holdMode='hold',
|
||||||
RS='TRS',
|
RS='TRS',
|
||||||
|
|
||||||
--System
|
-- System
|
||||||
reTime=2,
|
reTime=2,
|
||||||
allowTAS=false,
|
allowTAS=false,
|
||||||
autoPause=true,
|
autoPause=true,
|
||||||
@@ -621,7 +621,7 @@ do--Userdata tables
|
|||||||
},
|
},
|
||||||
face={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
face={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||||||
|
|
||||||
--Graphic
|
-- Graphic
|
||||||
ghostType='gray',
|
ghostType='gray',
|
||||||
block=true,ghost=.3,center=1,
|
block=true,ghost=.3,center=1,
|
||||||
smooth=true,grid=.16,lineNum=.5,
|
smooth=true,grid=.16,lineNum=.5,
|
||||||
@@ -651,7 +651,7 @@ do--Userdata tables
|
|||||||
clickFX=true,
|
clickFX=true,
|
||||||
warn=true,
|
warn=true,
|
||||||
|
|
||||||
--Sound
|
-- Sound
|
||||||
autoMute=true,
|
autoMute=true,
|
||||||
sfxPack='chiptune',
|
sfxPack='chiptune',
|
||||||
vocPack='miya',
|
vocPack='miya',
|
||||||
@@ -664,19 +664,19 @@ do--Userdata tables
|
|||||||
vib=0,
|
vib=0,
|
||||||
voc=0,
|
voc=0,
|
||||||
|
|
||||||
--Virtualkey
|
-- Virtualkey
|
||||||
VKSFX=.2,--SFX volume
|
VKSFX=.2,-- SFX volume
|
||||||
VKVIB=0,--VIB
|
VKVIB=0,-- VIB
|
||||||
VKSwitch=false,--If disp
|
VKSwitch=false,-- If disp
|
||||||
VKSkin=1,--If disp
|
VKSkin=1,-- If disp
|
||||||
VKTrack=false,--If tracked
|
VKTrack=false,-- If tracked
|
||||||
VKDodge=false,--If dodge
|
VKDodge=false,-- If dodge
|
||||||
VKTchW=.3,--Touch-Pos Weight
|
VKTchW=.3,-- Touch-Pos Weight
|
||||||
VKCurW=.4,--Cur-Pos Weight
|
VKCurW=.4,-- Cur-Pos Weight
|
||||||
VKIcon=true,--If disp icon
|
VKIcon=true,-- If disp icon
|
||||||
VKAlpha=.3,
|
VKAlpha=.3,
|
||||||
}
|
}
|
||||||
KEY_MAP={--Key setting
|
KEY_MAP={-- Key setting
|
||||||
keyboard={
|
keyboard={
|
||||||
left=1,right=2,x=3,z=4,c=5,
|
left=1,right=2,x=3,z=4,c=5,
|
||||||
up=6,down=7,space=8,a=9,s=10,
|
up=6,down=7,space=8,a=9,s=10,
|
||||||
@@ -688,29 +688,29 @@ do--Userdata tables
|
|||||||
leftshoulder=0,
|
leftshoulder=0,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
VK_ORG={--Virtualkey layout, refresh all VKs' position with this before each game
|
VK_ORG={-- Virtualkey layout, refresh all VKs' position with this before each game
|
||||||
{ava=true, x=80, y=720-200,r=80},--moveLeft
|
{ava=true, x=80, y=720-200,r=80},-- moveLeft
|
||||||
{ava=true, x=320, y=720-200,r=80},--moveRight
|
{ava=true, x=320, y=720-200,r=80},-- moveRight
|
||||||
{ava=true, x=1280-80, y=720-200,r=80},--rotRight
|
{ava=true, x=1280-80, y=720-200,r=80},-- rotRight
|
||||||
{ava=true, x=1280-200,y=720-80, r=80},--rotLeft
|
{ava=true, x=1280-200,y=720-80, r=80},-- rotLeft
|
||||||
{ava=true, x=1280-200,y=720-320,r=80},--rot180
|
{ava=true, x=1280-200,y=720-320,r=80},-- rot180
|
||||||
{ava=true, x=200, y=720-320,r=80},--hardDrop
|
{ava=true, x=200, y=720-320,r=80},-- hardDrop
|
||||||
{ava=true, x=200, y=720-80, r=80},--softDrop
|
{ava=true, x=200, y=720-80, r=80},-- softDrop
|
||||||
{ava=true, x=1280-320,y=720-200,r=80},--hold
|
{ava=true, x=1280-320,y=720-200,r=80},-- hold
|
||||||
{ava=true, x=80, y=280, r=80},--func1
|
{ava=true, x=80, y=280, r=80},-- func1
|
||||||
{ava=true, x=1280-80, y=280, r=80},--func2
|
{ava=true, x=1280-80, y=280, r=80},-- func2
|
||||||
{ava=false, x=670, y=50, r=30},--insLeft
|
{ava=false, x=670, y=50, r=30},-- insLeft
|
||||||
{ava=false, x=730, y=50, r=30},--insRight
|
{ava=false, x=730, y=50, r=30},-- insRight
|
||||||
{ava=false, x=790, y=50, r=30},--insDown
|
{ava=false, x=790, y=50, r=30},-- insDown
|
||||||
{ava=false, x=850, y=50, r=30},--down1
|
{ava=false, x=850, y=50, r=30},-- down1
|
||||||
{ava=false, x=910, y=50, r=30},--down4
|
{ava=false, x=910, y=50, r=30},-- down4
|
||||||
{ava=false, x=970, y=50, r=30},--down10
|
{ava=false, x=970, y=50, r=30},-- down10
|
||||||
{ava=false, x=1030, y=50, r=30},--dropLeft
|
{ava=false, x=1030, y=50, r=30},-- dropLeft
|
||||||
{ava=false, x=1090, y=50, r=30},--dropRight
|
{ava=false, x=1090, y=50, r=30},-- dropRight
|
||||||
{ava=false, x=1150, y=50, r=30},--zangiLeft
|
{ava=false, x=1150, y=50, r=30},-- zangiLeft
|
||||||
{ava=false, x=1210, y=50, r=30},--zangiRight
|
{ava=false, x=1210, y=50, r=30},-- zangiRight
|
||||||
}
|
}
|
||||||
RANKS={sprint_10l=0}--Ranks of modes
|
RANKS={sprint_10l=0}-- Ranks of modes
|
||||||
STAT={
|
STAT={
|
||||||
version=VERSION.code,
|
version=VERSION.code,
|
||||||
run=0,game=0,time=0,frame=0,
|
run=0,game=0,time=0,frame=0,
|
||||||
@@ -722,7 +722,7 @@ do--Userdata tables
|
|||||||
clear=(function() local L={} for i=1,29 do L[i]={0,0,0,0,0,0} end return L end)(),
|
clear=(function() local L={} for i=1,29 do L[i]={0,0,0,0,0,0} end return L end)(),
|
||||||
spin=(function() local L={} for i=1,29 do L[i]={0,0,0,0,0,0,0} end return L end)(),
|
spin=(function() local L={} for i=1,29 do L[i]={0,0,0,0,0,0,0} end return L end)(),
|
||||||
pc=0,hpc=0,b2b=0,b3b=0,score=0,
|
pc=0,hpc=0,b2b=0,b3b=0,score=0,
|
||||||
lastPlay='sprint_10l',--Last played mode ID
|
lastPlay='sprint_10l',-- Last played mode ID
|
||||||
item=setmetatable({},{__index=function(self,k)
|
item=setmetatable({},{__index=function(self,k)
|
||||||
self[k]=0
|
self[k]=0
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ return{
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
--Webpages / Organizations
|
-- Webpages / Organizations
|
||||||
{"Github Repository",
|
{"Github Repository",
|
||||||
"githubrepository sourcecode src",
|
"githubrepository sourcecode src",
|
||||||
"org",
|
"org",
|
||||||
@@ -134,7 +134,7 @@ return{
|
|||||||
FNNS and "https://youtu.be/dQw4w9WgXcQ" or "https://www.p\97\116\114\101\111\110.com/techmino",
|
FNNS and "https://youtu.be/dQw4w9WgXcQ" or "https://www.p\97\116\114\101\111\110.com/techmino",
|
||||||
},
|
},
|
||||||
|
|
||||||
--Games
|
-- Games
|
||||||
{"TTT",
|
{"TTT",
|
||||||
"tetris trainer tres bien",
|
"tetris trainer tres bien",
|
||||||
"game",
|
"game",
|
||||||
@@ -363,7 +363,7 @@ return{
|
|||||||
"Windows | Multiplayer\n(火拼俄罗斯)\n\nThe Tetris game on Tencent Game Center, 12-wide board, DAS/ARR the same as typing on the keyboard, one Next, no Hold. Can only send garbage through Tetris (sends three lines) and Triple (sends two lines). Garbage is checker-board-shaped and is nearly impossible to dig through.",
|
"Windows | Multiplayer\n(火拼俄罗斯)\n\nThe Tetris game on Tencent Game Center, 12-wide board, DAS/ARR the same as typing on the keyboard, one Next, no Hold. Can only send garbage through Tetris (sends three lines) and Triple (sends two lines). Garbage is checker-board-shaped and is nearly impossible to dig through.",
|
||||||
},
|
},
|
||||||
|
|
||||||
--Terms
|
-- Terms
|
||||||
{"Translator Note 2",
|
{"Translator Note 2",
|
||||||
"",
|
"",
|
||||||
"help",
|
"help",
|
||||||
@@ -448,7 +448,7 @@ return{
|
|||||||
{"Tetris",
|
{"Tetris",
|
||||||
"tetris 4",
|
"tetris 4",
|
||||||
"term",
|
"term",
|
||||||
"The name of the game (and its trademark). Also the term for clearing four lines at one time in official games.\nCoined from Tetra (Greek for “four” <τέτταρες>) and Tennis (favorite sport of the creator of Tetris). Also, the Tetris games developed by Nintendo and SEGA were licensed by TTC. These two companies do not have the copyright of Tetris.",--Thanks to Alexey Pajitnov!
|
"The name of the game (and its trademark). Also the term for clearing four lines at one time in official games.\nCoined from Tetra (Greek for “four” <τέτταρες>) and Tennis (favorite sport of the creator of Tetris). Also, the Tetris games developed by Nintendo and SEGA were licensed by TTC. These two companies do not have the copyright of Tetris.",-- Thanks to Alexey Pajitnov!
|
||||||
},
|
},
|
||||||
{"All Clear",
|
{"All Clear",
|
||||||
"pc perfectclear ac allclear",
|
"pc perfectclear ac allclear",
|
||||||
@@ -675,7 +675,7 @@ return{
|
|||||||
{"Donation",
|
{"Donation",
|
||||||
"donate",
|
"donate",
|
||||||
"term",
|
"term",
|
||||||
"A method of “plugging” up the Tetris hole to send a T-Spin. After the T-Spin, the Tetris hole is opened up once again to allow the continuation of Tetris or downstacking.\n--Harddrop wiki",
|
"A method of “plugging” up the Tetris hole to send a T-Spin. After the T-Spin, the Tetris hole is opened up once again to allow the continuation of Tetris or downstacking.\n-- Harddrop wiki",
|
||||||
},
|
},
|
||||||
{"‘Debt’",
|
{"‘Debt’",
|
||||||
"qianzhai debt owe",
|
"qianzhai debt owe",
|
||||||
@@ -975,7 +975,7 @@ return{
|
|||||||
"A Tetris bot. Built by the Chinese Tetris player 奏之章 (Zòu Zhī Zhāng, see entry below) and has decent performance in many games",
|
"A Tetris bot. Built by the Chinese Tetris player 奏之章 (Zòu Zhī Zhāng, see entry below) and has decent performance in many games",
|
||||||
},
|
},
|
||||||
|
|
||||||
--Setups
|
-- Setups
|
||||||
{"Openers",
|
{"Openers",
|
||||||
"setup openers",
|
"setup openers",
|
||||||
"setup",
|
"setup",
|
||||||
@@ -1090,7 +1090,7 @@ return{
|
|||||||
HDsearch.."Gamushiro_Stacking",
|
HDsearch.."Gamushiro_Stacking",
|
||||||
},
|
},
|
||||||
|
|
||||||
--Pattern
|
-- Pattern
|
||||||
{"Mid-game Setups",
|
{"Mid-game Setups",
|
||||||
"midgamesetups",
|
"midgamesetups",
|
||||||
"pattern",
|
"pattern",
|
||||||
@@ -1174,7 +1174,7 @@ return{
|
|||||||
"https://four.lol/perfect-clears/5th",
|
"https://four.lol/perfect-clears/5th",
|
||||||
},
|
},
|
||||||
|
|
||||||
--Savedata managing
|
-- Savedata managing
|
||||||
{"Console",
|
{"Console",
|
||||||
"cmd commamd minglinghang kongzhitai terminal",
|
"cmd commamd minglinghang kongzhitai terminal",
|
||||||
"command",
|
"command",
|
||||||
@@ -1216,7 +1216,7 @@ return{
|
|||||||
"Go to console, type “rm -s cache” and then press enter/return.\nTake effect immediately.",
|
"Go to console, type “rm -s cache” and then press enter/return.\nTake effect immediately.",
|
||||||
},
|
},
|
||||||
|
|
||||||
--English
|
-- English
|
||||||
{"SFX",
|
{"SFX",
|
||||||
"soundeffects",
|
"soundeffects",
|
||||||
"english",
|
"english",
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ return{
|
|||||||
"https://tetris.huijiwiki.com",
|
"https://tetris.huijiwiki.com",
|
||||||
},
|
},
|
||||||
|
|
||||||
--Webpages / Organizations
|
-- Webpages / Organizations
|
||||||
{"Githubリポジトリー",
|
{"Githubリポジトリー",
|
||||||
"githubrepository sourcecode リポジトリー ソースコード",
|
"githubrepository sourcecode リポジトリー ソースコード",
|
||||||
"org",
|
"org",
|
||||||
@@ -98,7 +98,7 @@ return{
|
|||||||
FNNS and "https://youtu.be/dQw4w9WgXcQ" or "https://www.p\97\116\114\101\111\110.com/techmino",
|
FNNS and "https://youtu.be/dQw4w9WgXcQ" or "https://www.p\97\116\114\101\111\110.com/techmino",
|
||||||
},
|
},
|
||||||
|
|
||||||
--Games
|
-- Games
|
||||||
{"テトリス トレーナー トレビアン (TTT)",
|
{"テトリス トレーナー トレビアン (TTT)",
|
||||||
"tetris trainer tres bien テトリス トレーナー トレビアン",
|
"tetris trainer tres bien テトリス トレーナー トレビアン",
|
||||||
"game",
|
"game",
|
||||||
@@ -320,7 +320,7 @@ return{
|
|||||||
"Windows | Multiplayer\n(火拼俄罗斯)\n\nThe Tetris game on Tencent Game Center, 12-wide board, DAS/ARR the same as your typing, 1 next, no hold. Can only send garbage through Tetris (sends 3 lines) and Triple (sends 2 lines). Garbage is checker-board-shaped and is nearly impossible to dig through.",
|
"Windows | Multiplayer\n(火拼俄罗斯)\n\nThe Tetris game on Tencent Game Center, 12-wide board, DAS/ARR the same as your typing, 1 next, no hold. Can only send garbage through Tetris (sends 3 lines) and Triple (sends 2 lines). Garbage is checker-board-shaped and is nearly impossible to dig through.",
|
||||||
},
|
},
|
||||||
|
|
||||||
--Terms
|
-- Terms
|
||||||
{"Translator Note 2",
|
{"Translator Note 2",
|
||||||
"",
|
"",
|
||||||
"help",
|
"help",
|
||||||
@@ -405,7 +405,7 @@ return{
|
|||||||
{"Tetris",
|
{"Tetris",
|
||||||
"tetris",
|
"tetris",
|
||||||
"term",
|
"term",
|
||||||
"The name of the game (and its trademark). Also the name for clearing 4 lines at one time in official games.\nCoined from Tetra (greek for \"four\") and Tennis (favorite sport of the creator of Tetris). Also, the Tetris games developed by Nintendo and SEGA was licensed by TTC and these two companies do not have the copyright of Tetris.",--Thanks to Alexey Pajitnov!
|
"The name of the game (and its trademark). Also the name for clearing 4 lines at one time in official games.\nCoined from Tetra (greek for \"four\") and Tennis (favorite sport of the creator of Tetris). Also, the Tetris games developed by Nintendo and SEGA was licensed by TTC and these two companies do not have the copyright of Tetris.",-- Thanks to Alexey Pajitnov!
|
||||||
},
|
},
|
||||||
{"All Clear",
|
{"All Clear",
|
||||||
"pc perfectclear ac allclear",
|
"pc perfectclear ac allclear",
|
||||||
@@ -612,7 +612,7 @@ return{
|
|||||||
{"Donation",
|
{"Donation",
|
||||||
"donate",
|
"donate",
|
||||||
"term",
|
"term",
|
||||||
"A method of \"plugging\" up the Tetris hole to send a T-Spin. After the T-Spin, the Tetris hole is opened up once again to allow the continuation of Tetris or downstacking.\n--Harddrop wiki",
|
"A method of \"plugging\" up the Tetris hole to send a T-Spin. After the T-Spin, the Tetris hole is opened up once again to allow the continuation of Tetris or downstacking.\n-- Harddrop wiki",
|
||||||
},
|
},
|
||||||
{"\"Debt\"",
|
{"\"Debt\"",
|
||||||
"qianzhai debt owe",
|
"qianzhai debt owe",
|
||||||
@@ -833,7 +833,7 @@ return{
|
|||||||
{"Passthrough",
|
{"Passthrough",
|
||||||
"pingthrough",
|
"pingthrough",
|
||||||
"term",
|
"term",
|
||||||
"",--TODO
|
"",-- TODO
|
||||||
},
|
},
|
||||||
{"Tetris OL attack",
|
{"Tetris OL attack",
|
||||||
"top tetrisonlineattack",
|
"top tetrisonlineattack",
|
||||||
@@ -917,7 +917,7 @@ return{
|
|||||||
"A Tetris bot. Built by the Chinese Tetris player 奏之章 (Zou Zhi Zhang) and has decent performance in many games",
|
"A Tetris bot. Built by the Chinese Tetris player 奏之章 (Zou Zhi Zhang) and has decent performance in many games",
|
||||||
},
|
},
|
||||||
|
|
||||||
--Setups
|
-- Setups
|
||||||
{"Openers",
|
{"Openers",
|
||||||
"setup openers",
|
"setup openers",
|
||||||
"setup",
|
"setup",
|
||||||
@@ -1009,7 +1009,7 @@ return{
|
|||||||
"An All Clear opener with a high success rate. In Techmino's PC Practice modes, the setup that leaves an irregular opening is this setup.",
|
"An All Clear opener with a high success rate. In Techmino's PC Practice modes, the setup that leaves an irregular opening is this setup.",
|
||||||
},
|
},
|
||||||
|
|
||||||
--Pattern
|
-- Pattern
|
||||||
{"Mid-game Setups",
|
{"Mid-game Setups",
|
||||||
"midgamesetups",
|
"midgamesetups",
|
||||||
"pattern",
|
"pattern",
|
||||||
@@ -1072,7 +1072,7 @@ return{
|
|||||||
"Stacking TST(s) on top of a STSD.",
|
"Stacking TST(s) on top of a STSD.",
|
||||||
},
|
},
|
||||||
|
|
||||||
--Savedata managing
|
-- Savedata managing
|
||||||
{"Console",
|
{"Console",
|
||||||
"cmd commamd minglinghang kongzhitai terminal",
|
"cmd commamd minglinghang kongzhitai terminal",
|
||||||
"command",
|
"command",
|
||||||
@@ -1114,7 +1114,7 @@ return{
|
|||||||
"Go to console and type \"rm -s cache\" then press enter.\nTake effect immediately.",
|
"Go to console and type \"rm -s cache\" then press enter.\nTake effect immediately.",
|
||||||
},
|
},
|
||||||
|
|
||||||
--English
|
-- English
|
||||||
{"SFX",
|
{"SFX",
|
||||||
"soundeffects",
|
"soundeffects",
|
||||||
"english",
|
"english",
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ return{
|
|||||||
"https://knewjade.github.io/fumen-for-mobile/"
|
"https://knewjade.github.io/fumen-for-mobile/"
|
||||||
},
|
},
|
||||||
|
|
||||||
--相关网页/组织
|
-- 相关网页/组织
|
||||||
{"GitHub仓库",
|
{"GitHub仓库",
|
||||||
"源代码 源码 github git sourcecode yuandaima src",
|
"源代码 源码 github git sourcecode yuandaima src",
|
||||||
"org",
|
"org",
|
||||||
@@ -126,7 +126,7 @@ return{
|
|||||||
FNNS and "https://b23.tv/BV1uT4y1P7CX" or "https://www.p\97\116\114\101\111\110.com/techmino",
|
FNNS and "https://b23.tv/BV1uT4y1P7CX" or "https://www.p\97\116\114\101\111\110.com/techmino",
|
||||||
},
|
},
|
||||||
|
|
||||||
--游戏(题库)
|
-- 游戏(题库)
|
||||||
{"TTT",
|
{"TTT",
|
||||||
"教程 trainer tres bien",
|
"教程 trainer tres bien",
|
||||||
"game",
|
"game",
|
||||||
@@ -152,7 +152,7 @@ return{
|
|||||||
"http://121.36.2.245:3000/tpo"
|
"http://121.36.2.245:3000/tpo"
|
||||||
},
|
},
|
||||||
|
|
||||||
--游戏(网页)
|
-- 游戏(网页)
|
||||||
{"注[1]",
|
{"注[1]",
|
||||||
"备注 notice",
|
"备注 notice",
|
||||||
"game",
|
"game",
|
||||||
@@ -228,7 +228,7 @@ return{
|
|||||||
"网页游戏 | 单机\ntetris.com官网上的俄罗斯方块,在马拉松基础上添加了技能,场地上会随机冒出技能方块,消除后会得到各种各样或好或坏的技能。",
|
"网页游戏 | 单机\ntetris.com官网上的俄罗斯方块,在马拉松基础上添加了技能,场地上会随机冒出技能方块,消除后会得到各种各样或好或坏的技能。",
|
||||||
},
|
},
|
||||||
|
|
||||||
--游戏(跨平台)
|
-- 游戏(跨平台)
|
||||||
{"Techmino",
|
{"Techmino",
|
||||||
"铁壳米诺 方块研究所 tieke",
|
"铁壳米诺 方块研究所 tieke",
|
||||||
"game",
|
"game",
|
||||||
@@ -250,7 +250,7 @@ return{
|
|||||||
"Windows/Android | 单机\n块圈玩家自制方块,正在开发中,有一个原创旋转系统。",
|
"Windows/Android | 单机\n块圈玩家自制方块,正在开发中,有一个原创旋转系统。",
|
||||||
},
|
},
|
||||||
|
|
||||||
--游戏(街机/类街机)
|
-- 游戏(街机/类街机)
|
||||||
{"TGM",
|
{"TGM",
|
||||||
"俄罗斯方块大师 tetrisgrandmaster",
|
"俄罗斯方块大师 tetrisgrandmaster",
|
||||||
"game",
|
"game",
|
||||||
@@ -273,7 +273,7 @@ return{
|
|||||||
"Windows | 单机\n简称Tex,包含TGM的所有模式,可以用来练习TGM,但World规则不完全一样(如软降到底无锁延,踢墙表有细节不同等)。",
|
"Windows | 单机\n简称Tex,包含TGM的所有模式,可以用来练习TGM,但World规则不完全一样(如软降到底无锁延,踢墙表有细节不同等)。",
|
||||||
},
|
},
|
||||||
|
|
||||||
--游戏(其他)
|
-- 游戏(其他)
|
||||||
{"Tetris Effect",
|
{"Tetris Effect",
|
||||||
"效应 tec tetriseffectconnected xiaoyinglianjie",
|
"效应 tec tetriseffectconnected xiaoyinglianjie",
|
||||||
"game",
|
"game",
|
||||||
@@ -356,7 +356,7 @@ return{
|
|||||||
"Windows | 多人\n腾讯游戏大厅的方块,场地12列,打字的 DAS 和 ARR,1 Next无 Hold,攻击途径只有消4打3、 消3打2,垃圾行为国际象棋棋盘式,几乎不可能挖掘。",
|
"Windows | 多人\n腾讯游戏大厅的方块,场地12列,打字的 DAS 和 ARR,1 Next无 Hold,攻击途径只有消4打3、 消3打2,垃圾行为国际象棋棋盘式,几乎不可能挖掘。",
|
||||||
},
|
},
|
||||||
|
|
||||||
--术语(缩写)
|
-- 术语(缩写)
|
||||||
{"LPM",
|
{"LPM",
|
||||||
"速度 sudu",
|
"速度 sudu",
|
||||||
"term",
|
"term",
|
||||||
@@ -413,7 +413,7 @@ return{
|
|||||||
"Attack Per Line\n攻击每行,也叫效率,体现玩家攻击的行利用率。例如消四和T旋的效率就比消二和消三高。",
|
"Attack Per Line\n攻击每行,也叫效率,体现玩家攻击的行利用率。例如消四和T旋的效率就比消二和消三高。",
|
||||||
},
|
},
|
||||||
|
|
||||||
--术语(消除名)
|
-- 术语(消除名)
|
||||||
{"Single",
|
{"Single",
|
||||||
"1 xiaoyi",
|
"1 xiaoyi",
|
||||||
"term",
|
"term",
|
||||||
@@ -450,7 +450,7 @@ return{
|
|||||||
"Half-PC\nPC(全消)的外延,“下方有剩余方块” 的全消(特别地,如果只消1行则必须不剩余玩家放置的方块),能打出一些攻击和防御(Techmino限定)。",
|
"Half-PC\nPC(全消)的外延,“下方有剩余方块” 的全消(特别地,如果只消1行则必须不剩余玩家放置的方块),能打出一些攻击和防御(Techmino限定)。",
|
||||||
},
|
},
|
||||||
|
|
||||||
--术语(旋转相关)
|
-- 术语(旋转相关)
|
||||||
{"Spin",
|
{"Spin",
|
||||||
"转 xuanzhuan zuandong",
|
"转 xuanzhuan zuandong",
|
||||||
"term",
|
"term",
|
||||||
@@ -578,7 +578,7 @@ return{
|
|||||||
"X Rotation System\nT-ex原创旋转系统,引入了 “按住方向键换一套踢墙表” 的设定(在对应的方向需要顶住墙),让 “想去哪” 能被游戏捕获从而转到玩家希望到达的位置。\n\n其他旋转系统无论踢墙表怎么设计,块处在某个位置时旋转后最终只能按固定顺序测试,这导致不同的踢墙是竞争的,若存在两个可能想去的位置就只能二选一,XRS解决了这个问题。",
|
"X Rotation System\nT-ex原创旋转系统,引入了 “按住方向键换一套踢墙表” 的设定(在对应的方向需要顶住墙),让 “想去哪” 能被游戏捕获从而转到玩家希望到达的位置。\n\n其他旋转系统无论踢墙表怎么设计,块处在某个位置时旋转后最终只能按固定顺序测试,这导致不同的踢墙是竞争的,若存在两个可能想去的位置就只能二选一,XRS解决了这个问题。",
|
||||||
},
|
},
|
||||||
|
|
||||||
--术语(其他)
|
-- 术语(其他)
|
||||||
{"B2B",
|
{"B2B",
|
||||||
"大满贯 btb backtoback",
|
"大满贯 btb backtoback",
|
||||||
"term",
|
"term",
|
||||||
@@ -903,7 +903,7 @@ return{
|
|||||||
{"C2序列",
|
{"C2序列",
|
||||||
"seq",
|
"seq",
|
||||||
"term",
|
"term",
|
||||||
"(七个块初始权重设为0)\n要取块的时候,\n先把七个数都除以2然后加上0~1的随机数,\n最大的数字是第几个的就出对应的块,然后将其权重除以3.5\n循环。",--Discovered by zxc
|
"(七个块初始权重设为0)\n要取块的时候,\n先把七个数都除以2然后加上0~1的随机数,\n最大的数字是第几个的就出对应的块,然后将其权重除以3.5\n循环。",-- Discovered by zxc
|
||||||
},
|
},
|
||||||
{"堆叠(Stack)",
|
{"堆叠(Stack)",
|
||||||
"duidie stacking",
|
"duidie stacking",
|
||||||
@@ -972,7 +972,7 @@ return{
|
|||||||
"一个AI的名字(就跟AlphaGo一样)\n由研究群群友奏之章开发,重新调参后在各个游戏平台上的表现都很不错。",
|
"一个AI的名字(就跟AlphaGo一样)\n由研究群群友奏之章开发,重新调参后在各个游戏平台上的表现都很不错。",
|
||||||
},
|
},
|
||||||
|
|
||||||
--定式
|
-- 定式
|
||||||
{"开局定式(Setup)",
|
{"开局定式(Setup)",
|
||||||
"opening kaijudingshi opener",
|
"opening kaijudingshi opener",
|
||||||
"setup",
|
"setup",
|
||||||
@@ -1086,7 +1086,7 @@ return{
|
|||||||
HDsearch.."Gamushiro_Stacking",
|
HDsearch.."Gamushiro_Stacking",
|
||||||
},
|
},
|
||||||
|
|
||||||
--形状
|
-- 形状
|
||||||
{"中局定式",
|
{"中局定式",
|
||||||
"setup dingshi",
|
"setup dingshi",
|
||||||
"pattern",
|
"pattern",
|
||||||
@@ -1171,7 +1171,7 @@ return{
|
|||||||
"https://four.lol/perfect-clears/5th"
|
"https://four.lol/perfect-clears/5th"
|
||||||
},
|
},
|
||||||
|
|
||||||
--存档管理
|
-- 存档管理
|
||||||
{"控制台",
|
{"控制台",
|
||||||
"console cmd commamd minglinghang kongzhitai",
|
"console cmd commamd minglinghang kongzhitai",
|
||||||
"command",
|
"command",
|
||||||
@@ -1213,7 +1213,7 @@ return{
|
|||||||
"前往控制台输入 “rm -s cache” 并回车。\n立即生效。",
|
"前往控制台输入 “rm -s cache” 并回车。\n立即生效。",
|
||||||
},
|
},
|
||||||
|
|
||||||
--英文
|
-- 英文
|
||||||
{"SFX",
|
{"SFX",
|
||||||
"",
|
"",
|
||||||
"english",
|
"english",
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ return{
|
|||||||
|
|
||||||
-- cc_fixed="CC is incompatible with fixed sequences",
|
-- cc_fixed="CC is incompatible with fixed sequences",
|
||||||
-- cc_swap="CC is incompatible with swap holdmode",
|
-- cc_swap="CC is incompatible with swap holdmode",
|
||||||
--ai_prebag="The AI is incompatible with custom sequences which have nontetromino.",'IA est incompatible avec les séquences personnalisées.",
|
-- ai_prebag="The AI is incompatible with custom sequences which have nontetromino.",'IA est incompatible avec les séquences personnalisées.",
|
||||||
ai_mission="L'IA est incompatible avec les missions personnalisées.",
|
ai_mission="L'IA est incompatible avec les missions personnalisées.",
|
||||||
switchSpawnSFX="Activez les effets sonores d'apparition des pièces pour jouer",
|
switchSpawnSFX="Activez les effets sonores d'apparition des pièces pour jouer",
|
||||||
needRestart="Fonctionnera dès la prochaine partie",
|
needRestart="Fonctionnera dès la prochaine partie",
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ return{
|
|||||||
|
|
||||||
-- cc_fixed="CC is incompatible with fixed sequences",
|
-- cc_fixed="CC is incompatible with fixed sequences",
|
||||||
-- cc_swap="CC is incompatible with swap holdmode",
|
-- cc_swap="CC is incompatible with swap holdmode",
|
||||||
--ai_prebag="The AI is incompatible with custom sequences which have nontetromino.", inteligência é incompatível com sequências fixas.",
|
-- ai_prebag="The AI is incompatible with custom sequences which have nontetromino.", inteligência é incompatível com sequências fixas.",
|
||||||
ai_mission="A inteligência é incompatível com missões costumizadas.",
|
ai_mission="A inteligência é incompatível com missões costumizadas.",
|
||||||
switchSpawnSFX="Switch on spawn SFX to play",
|
switchSpawnSFX="Switch on spawn SFX to play",
|
||||||
needRestart="Funciona após reiniciar",
|
needRestart="Funciona após reiniciar",
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ return{
|
|||||||
ctrl="=?=",
|
ctrl="=?=",
|
||||||
key="=?",
|
key="=?",
|
||||||
touch="_?",
|
touch="_?",
|
||||||
showVK="--?",
|
showVK="-- ?",
|
||||||
reTime="3-2-1",
|
reTime="3-2-1",
|
||||||
RS="''?",
|
RS="''?",
|
||||||
menuPos="←M→?",
|
menuPos="←M→?",
|
||||||
@@ -258,7 +258,7 @@ return{
|
|||||||
ghost="__↓__",
|
ghost="__↓__",
|
||||||
center="+",
|
center="+",
|
||||||
grid="#",
|
grid="#",
|
||||||
lineNum="--No.",
|
lineNum="-- No.",
|
||||||
|
|
||||||
lockFX="↓_~",
|
lockFX="↓_~",
|
||||||
dropFX="↓~",
|
dropFX="↓~",
|
||||||
@@ -509,7 +509,7 @@ return{
|
|||||||
color="~~~",
|
color="~~~",
|
||||||
invis="???",
|
invis="???",
|
||||||
slide="~_~",
|
slide="~_~",
|
||||||
pathVis="--==>",
|
pathVis="-- ==>",
|
||||||
revKB="Reverse",
|
revKB="Reverse",
|
||||||
},
|
},
|
||||||
app_schulteG={
|
app_schulteG={
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ return{
|
|||||||
"NOT_A_ROBOT",
|
"NOT_A_ROBOT",
|
||||||
"sakurw",
|
"sakurw",
|
||||||
"Airun",
|
"Airun",
|
||||||
--"XMiao",
|
-- "XMiao",
|
||||||
"幽灵3383",
|
"幽灵3383",
|
||||||
"",
|
"",
|
||||||
"Performances",
|
"Performances",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local LINE={}
|
local LINE={}
|
||||||
local L={}--Storage
|
local L={}-- Storage
|
||||||
local len=0--Length
|
local len=0-- Length
|
||||||
function LINE.new(val,isGarbage)
|
function LINE.new(val,isGarbage)
|
||||||
if len==0 then
|
if len==0 then
|
||||||
for i=1,10 do
|
for i=1,10 do
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ return{
|
|||||||
{3,2,6,6,1,4,0,0,0,7},
|
{3,2,6,6,1,4,0,0,0,7},
|
||||||
{3,3,3,4,4,4,0,0,0,7},
|
{3,3,3,4,4,4,0,0,0,7},
|
||||||
},
|
},
|
||||||
},--3*4 shape
|
},-- 3*4 shape
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
{1,1,0,0,0,0,0,3,3,3},
|
{1,1,0,0,0,0,0,3,3,3},
|
||||||
@@ -50,7 +50,7 @@ return{
|
|||||||
{3,6,6,5,5,2,2,0,0,0},
|
{3,6,6,5,5,2,2,0,0,0},
|
||||||
{3,3,3,5,2,2,0,0,0,0},
|
{3,3,3,5,2,2,0,0,0,0},
|
||||||
},
|
},
|
||||||
},--7 piece opener(right>)(without i)
|
},-- 7 piece opener(right>)(without i)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
{4,4,4,3,3,3,0,0,0,0},
|
{4,4,4,3,3,3,0,0,0,0},
|
||||||
@@ -64,7 +64,7 @@ return{
|
|||||||
{3,2,6,6,1,4,0,0,0,0},
|
{3,2,6,6,1,4,0,0,0,0},
|
||||||
{3,3,3,4,4,4,0,0,0,0},
|
{3,3,3,4,4,4,0,0,0,0},
|
||||||
},
|
},
|
||||||
},--6 piece opener
|
},-- 6 piece opener
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
{0,0,0,0,0,1,3,5,6,7},
|
{0,0,0,0,0,1,3,5,6,7},
|
||||||
@@ -84,7 +84,7 @@ return{
|
|||||||
{1,3,0,0,0,0,0,5,6,7},
|
{1,3,0,0,0,0,0,5,6,7},
|
||||||
{1,3,0,0,0,0,0,5,6,7},
|
{1,3,0,0,0,0,0,5,6,7},
|
||||||
},
|
},
|
||||||
},--4*5
|
},-- 4*5
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
{0,0,0,0,0,0,1,3,5,7},
|
{0,0,0,0,0,0,1,3,5,7},
|
||||||
@@ -104,5 +104,5 @@ return{
|
|||||||
{5,7,0,0,0,0,0,0,3,1},
|
{5,7,0,0,0,0,0,0,3,1},
|
||||||
{1,3,0,0,0,0,0,0,7,5},
|
{1,3,0,0,0,0,0,0,7,5},
|
||||||
},
|
},
|
||||||
},--4*6
|
},-- 4*6
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -26,7 +26,7 @@ return{
|
|||||||
GC.clear(.2,.2,.2)
|
GC.clear(.2,.2,.2)
|
||||||
GC.setColor(.5,.5,.5)
|
GC.setColor(.5,.5,.5)
|
||||||
|
|
||||||
--Frame & Username
|
-- Frame & Username
|
||||||
GC.setColor(.8,.8,.8)
|
GC.setColor(.8,.8,.8)
|
||||||
GC.setLineWidth(2)
|
GC.setLineWidth(2)
|
||||||
GC.rectangle('line',12,20,100,80,5)
|
GC.rectangle('line',12,20,100,80,5)
|
||||||
@@ -38,13 +38,13 @@ return{
|
|||||||
GC.pop()
|
GC.pop()
|
||||||
end
|
end
|
||||||
|
|
||||||
--Figures
|
-- Figures
|
||||||
local t=TIME()
|
local t=TIME()
|
||||||
GC.setColor(1,1,1,.5+.2*sin(t))
|
GC.setColor(1,1,1,.5+.2*sin(t))
|
||||||
GC.draw(IMG.hbm,-276,-86,0,1.5)
|
GC.draw(IMG.hbm,-276,-86,0,1.5)
|
||||||
GC.draw(IMG.electric,476,152,0,2.6)
|
GC.draw(IMG.electric,476,152,0,2.6)
|
||||||
|
|
||||||
--Texts
|
-- Texts
|
||||||
GC.setColor(.8,.8,.8)
|
GC.setColor(.8,.8,.8)
|
||||||
mText(TEXTOBJ.techrash,63,420)
|
mText(TEXTOBJ.techrash,63,420)
|
||||||
setFont(75)
|
setFont(75)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ return{
|
|||||||
load=function()
|
load=function()
|
||||||
applyCustomGame()
|
applyCustomGame()
|
||||||
|
|
||||||
--Switch clear sprint mode on
|
-- Switch clear sprint mode on
|
||||||
if #FIELD[1]>0 then
|
if #FIELD[1]>0 then
|
||||||
GAME.modeEnv.hook_drop=require'parts.eventsets.checkClearBoard'.hook_drop
|
GAME.modeEnv.hook_drop=require'parts.eventsets.checkClearBoard'.hook_drop
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ return{
|
|||||||
local height=TABLE.new(0,10)
|
local height=TABLE.new(0,10)
|
||||||
local max=#P.field
|
local max=#P.field
|
||||||
if max>0 then
|
if max>0 then
|
||||||
--Get heights
|
-- Get heights
|
||||||
for x=1,10 do
|
for x=1,10 do
|
||||||
local h=max
|
local h=max
|
||||||
while P.field[h][x]==0 and h>1 do
|
while P.field[h][x]==0 and h>1 do
|
||||||
@@ -30,15 +30,15 @@ return{
|
|||||||
for i=1,10 do
|
for i=1,10 do
|
||||||
d=d+height[i]
|
d=d+height[i]
|
||||||
end
|
end
|
||||||
if d<40 or P.stat.row>2*42 then--Low field or almost win, give SZO
|
if d<40 or P.stat.row>2*42 then-- Low field or almost win, give SZO
|
||||||
for _=1,4 do
|
for _=1,4 do
|
||||||
ins(wei,1)
|
ins(wei,1)
|
||||||
ins(wei,2)
|
ins(wei,2)
|
||||||
ins(wei,6)
|
ins(wei,6)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
--Give I when no hole
|
-- Give I when no hole
|
||||||
local tempDeltaHei=-999--Height difference
|
local tempDeltaHei=-999-- Height difference
|
||||||
for x=2,11 do
|
for x=2,11 do
|
||||||
local deltaHei=height[x]-height[x-1]
|
local deltaHei=height[x]-height[x-1]
|
||||||
if tempDeltaHei<-2 and deltaHei>2 then
|
if tempDeltaHei<-2 and deltaHei>2 then
|
||||||
@@ -50,9 +50,9 @@ return{
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Give O when no d=0/give T when no d=1
|
-- Give O when no d=0/give T when no d=1
|
||||||
local flatCount=0--d=0 count
|
local flatCount=0-- d=0 count
|
||||||
local stairCount=0--d=1 count
|
local stairCount=0-- d=1 count
|
||||||
for x=2,10 do
|
for x=2,10 do
|
||||||
local _=height[x]-height[x-1]
|
local _=height[x]-height[x-1]
|
||||||
if _==0 then
|
if _==0 then
|
||||||
|
|||||||
166
parts/net.lua
166
parts/net.lua
@@ -5,7 +5,7 @@ local NET={
|
|||||||
accessToken=false,
|
accessToken=false,
|
||||||
cloudData={},
|
cloudData={},
|
||||||
|
|
||||||
roomState={--A copy of room structure on server
|
roomState={-- A copy of room structure on server
|
||||||
info={
|
info={
|
||||||
name=false,
|
name=false,
|
||||||
type=false,
|
type=false,
|
||||||
@@ -17,8 +17,8 @@ local NET={
|
|||||||
private=false,
|
private=false,
|
||||||
start=false,
|
start=false,
|
||||||
},
|
},
|
||||||
spectate=false,--If player is spectating
|
spectate=false,-- If player is spectating
|
||||||
specSRID=false,--Cached SRID when enter playing room, for connect WS after scene swapped
|
specSRID=false,-- Cached SRID when enter playing room, for connect WS after scene swapped
|
||||||
seed=false,
|
seed=false,
|
||||||
|
|
||||||
roomReadyState=false,
|
roomReadyState=false,
|
||||||
@@ -293,18 +293,16 @@ local function wsSend(act,data)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
--Room
|
-- Room
|
||||||
NET.room={}
|
NET.room={}
|
||||||
function NET.room.chat(mes,rid)
|
function NET.room.chat(mes,rid)
|
||||||
wsSend(1300,{
|
wsSend(1300,{
|
||||||
message=mes,
|
message=mes,
|
||||||
roomId=rid,--Admin
|
roomId=rid,-- Admin
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
function NET.room.create(roomName,description,capacity,roomType,roomData,password)
|
function NET.room.create(roomName,description,capacity,roomType,roomData,password)
|
||||||
if not TASK.lock('enterRoom',2) then return end
|
if not TASK.lock('enterRoom',6) then return end
|
||||||
NET.roomState.private=not not password
|
|
||||||
NET.roomState.capacity=capacity
|
|
||||||
wsSend(1301,{
|
wsSend(1301,{
|
||||||
capacity=capacity,
|
capacity=capacity,
|
||||||
info={
|
info={
|
||||||
@@ -314,84 +312,86 @@ function NET.room.create(roomName,description,capacity,roomType,roomData,passwor
|
|||||||
description=description,
|
description=description,
|
||||||
},
|
},
|
||||||
data=roomData,
|
data=roomData,
|
||||||
|
|
||||||
password=password,
|
password=password,
|
||||||
})
|
})
|
||||||
|
WAIT{
|
||||||
|
quit=function()
|
||||||
|
TASK.unlock('enterRoom')
|
||||||
|
end,
|
||||||
|
timeout=1e99,
|
||||||
|
}
|
||||||
end
|
end
|
||||||
function NET.room.getData(rid)
|
function NET.room.getData(rid)
|
||||||
wsSend(1302,{
|
wsSend(1302,{
|
||||||
roomId=rid,--Admin
|
roomId=rid,-- Admin
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
function NET.room.setData(data,rid)
|
function NET.room.setData(data,rid)
|
||||||
wsSend(1303,{
|
wsSend(1303,{
|
||||||
data=data,
|
data=data,
|
||||||
roomId=rid,--Admin
|
roomId=rid,-- Admin
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
function NET.room.getInfo(rid)
|
function NET.room.getInfo(rid)
|
||||||
wsSend(1304,{
|
wsSend(1304,{
|
||||||
roomId=rid,--Admin
|
roomId=rid,-- Admin
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
function NET.room.setInfo(info,rid)
|
function NET.room.setInfo(info,rid)
|
||||||
wsSend(1305,{
|
wsSend(1305,{
|
||||||
info=info,
|
info=info,
|
||||||
roomId=rid,--Admin
|
roomId=rid,-- Admin
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
function NET.room.enter(rid,password)
|
function NET.room.enter(rid,password)
|
||||||
if TASK.lock('enterRoom',6) then
|
if not TASK.lock('enterRoom',6) then return end
|
||||||
SFX.play('reach',.6)
|
SFX.play('reach',.6)
|
||||||
wsSend(1306,{
|
wsSend(1306,{
|
||||||
data={
|
data={
|
||||||
roomId=rid,
|
roomId=rid,
|
||||||
password=password,
|
password=password,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end
|
|
||||||
end
|
end
|
||||||
function NET.room.kick(pid,rid)
|
function NET.room.kick(pid,rid)
|
||||||
wsSend(1307,{
|
wsSend(1307,{
|
||||||
playerId=pid,--Host
|
playerId=pid,-- Host
|
||||||
roomId=rid,--Admin
|
roomId=rid,-- Admin
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
function NET.room.leave()
|
function NET.room.leave()
|
||||||
wsSend(1308)
|
wsSend(1308)
|
||||||
end
|
end
|
||||||
function NET.room.fetch()
|
function NET.room.fetch()
|
||||||
if TASK.lock('fetchRoom',3) then
|
if not TASK.lock('fetchRoom',3) then return end
|
||||||
wsSend(1309,{
|
wsSend(1309,{
|
||||||
data={
|
data={
|
||||||
pageIndex=0,
|
pageIndex=0,
|
||||||
pageSize=26,
|
pageSize=26,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end
|
|
||||||
end
|
end
|
||||||
function NET.room.setPW(pw,rid)
|
function NET.room.setPW(pw,rid)
|
||||||
if TASK.lock('fetchRoom',3) then
|
if not TASK.lock('setRoomPW',2) then return end
|
||||||
wsSend(1310,{
|
wsSend(1310,{
|
||||||
data={
|
data={
|
||||||
password=pw,
|
password=pw,
|
||||||
roomId=rid,--Admin
|
roomId=rid,-- Admin
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end
|
|
||||||
end
|
end
|
||||||
function NET.room.remove(rid)
|
function NET.room.remove(rid)
|
||||||
wsSend(1311,{
|
wsSend(1311,{
|
||||||
roomId=rid--Admin
|
roomId=rid-- Admin
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
--Player
|
-- Player
|
||||||
NET.player={}
|
NET.player={}
|
||||||
function NET.player.updateConf()
|
function NET.player.updateConf()
|
||||||
wsSend(1200,dumpBasicConfig())
|
wsSend(1200,dumpBasicConfig())
|
||||||
end
|
end
|
||||||
function NET.player.finish(mes)--what mes?
|
function NET.player.finish(mes)-- what mes?
|
||||||
wsSend(1201,mes)
|
wsSend(1201,mes)
|
||||||
end
|
end
|
||||||
function NET.player.joinGroup(gid)
|
function NET.player.joinGroup(gid)
|
||||||
@@ -416,7 +416,7 @@ function NET.player.setPlaying(playing)
|
|||||||
wsSend(1207,playing and 'Gamer' or 'Spectator')
|
wsSend(1207,playing and 'Gamer' or 'Spectator')
|
||||||
end
|
end
|
||||||
|
|
||||||
--WS
|
-- WS
|
||||||
function NET.connectWS()
|
function NET.connectWS()
|
||||||
if WS.status('game')=='dead' then
|
if WS.status('game')=='dead' then
|
||||||
WS.connect('game','',{['x-access-token']=USER.aToken},6)
|
WS.connect('game','',{['x-access-token']=USER.aToken},6)
|
||||||
@@ -450,26 +450,34 @@ function NET.updateWS()
|
|||||||
elseif res.action==1100 then-- TODO
|
elseif res.action==1100 then-- TODO
|
||||||
elseif res.action==1101 then-- TODO
|
elseif res.action==1101 then-- TODO
|
||||||
elseif res.action==1102 then-- TODO
|
elseif res.action==1102 then-- TODO
|
||||||
elseif res.action==1201 then-- TODO
|
elseif res.action==1201 then-- Finish
|
||||||
elseif res.action==1202 then-- TODO
|
elseif res.action==1202 then-- Join group
|
||||||
elseif res.action==1203 then-- TODO
|
elseif res.action==1203 then-- Set ready
|
||||||
elseif res.action==1204 then-- TODO
|
elseif res.action==1204 then-- Set host
|
||||||
elseif res.action==1205 then-- TODO
|
elseif res.action==1205 then-- Set state
|
||||||
elseif res.action==1206 then-- TODO
|
elseif res.action==1206 then-- Stream
|
||||||
elseif res.action==1207 then-- TODO
|
elseif res.action==1207 then-- Set playing
|
||||||
elseif res.action==1301 then-- TODO
|
elseif res.action==1301 then-- Create room
|
||||||
elseif res.action==1302 then-- TODO
|
TASK.unlock('enterRoom')
|
||||||
elseif res.action==1303 then-- TODO
|
-- NET.roomState=...
|
||||||
elseif res.action==1304 then-- TODO
|
-- SCN.go('net_game')
|
||||||
elseif res.action==1305 then-- TODO
|
WAIT.interrupt()
|
||||||
elseif res.action==1306 then-- TODO
|
elseif res.action==1302 then-- Get room data
|
||||||
elseif res.action==1307 then-- TODO
|
elseif res.action==1303 then-- Set room data
|
||||||
elseif res.action==1308 then-- TODO
|
elseif res.action==1304 then-- Get room info
|
||||||
elseif res.action==1309 then--Fetch rooms
|
elseif res.action==1305 then-- Set room info
|
||||||
|
elseif res.action==1306 then-- Enter room
|
||||||
|
TASK.unlock('enterRoom')
|
||||||
|
-- NET.roomState=...
|
||||||
|
-- SCN.go('net_game')
|
||||||
|
WAIT.interrupt()
|
||||||
|
elseif res.action==1307 then-- Kick room
|
||||||
|
elseif res.action==1308 then-- Leave room
|
||||||
|
elseif res.action==1309 then-- Fetch rooms
|
||||||
TASK.unlock('fetchRoom')
|
TASK.unlock('fetchRoom')
|
||||||
if res.data then SCN.scenes.net_rooms.widgetList.roomList:setList(res.data) end
|
if res.data then SCN.scenes.net_rooms.widgetList.roomList:setList(res.data) end
|
||||||
elseif res.action==1310 then-- TODO
|
elseif res.action==1310 then-- Set password
|
||||||
elseif res.action==1311 then-- TODO
|
elseif res.action==1311 then-- Remove room
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
WS.alert('user')
|
WS.alert('user')
|
||||||
@@ -480,7 +488,7 @@ function NET.updateWS()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--------------------------<OLD ONLINE API>
|
--------------------------<OLD ONLINE API>
|
||||||
--Account & User
|
-- Account & User
|
||||||
function NET.getUserInfo(uid)
|
function NET.getUserInfo(uid)
|
||||||
wsSend({
|
wsSend({
|
||||||
data={
|
data={
|
||||||
@@ -490,26 +498,24 @@ function NET.getUserInfo(uid)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
--Save
|
-- Save
|
||||||
function NET.uploadSave()
|
function NET.uploadSave()
|
||||||
if TASK.lock('uploadSave',8) then
|
if not TASK.lock('uploadSave',8) then return end
|
||||||
wsSend({data={sections={
|
wsSend({data={sections={
|
||||||
{section=1,data=STRING.packTable(STAT)},
|
{section=1,data=STRING.packTable(STAT)},
|
||||||
{section=2,data=STRING.packTable(RANKS)},
|
{section=2,data=STRING.packTable(RANKS)},
|
||||||
{section=3,data=STRING.packTable(SETTING)},
|
{section=3,data=STRING.packTable(SETTING)},
|
||||||
{section=4,data=STRING.packTable(KEY_MAP)},
|
{section=4,data=STRING.packTable(KEY_MAP)},
|
||||||
{section=5,data=STRING.packTable(VK_ORG)},
|
{section=5,data=STRING.packTable(VK_ORG)},
|
||||||
{section=6,data=STRING.packTable(loadFile('conf/vkSave1','-canSkip') or{})},
|
{section=6,data=STRING.packTable(loadFile('conf/vkSave1','-canSkip') or{})},
|
||||||
{section=7,data=STRING.packTable(loadFile('conf/vkSave2','-canSkip') or{})},
|
{section=7,data=STRING.packTable(loadFile('conf/vkSave2','-canSkip') or{})},
|
||||||
}}})
|
}}})
|
||||||
MES.new('info',"Uploading")
|
MES.new('info',"Uploading")
|
||||||
end
|
|
||||||
end
|
end
|
||||||
function NET.downloadSave()
|
function NET.downloadSave()
|
||||||
if TASK.lock('downloadSave',8) then
|
if not TASK.lock('downloadSave',8) then return end
|
||||||
wsSend({data={sections={1,2,3,4,5,6,7}}})
|
wsSend({data={sections={1,2,3,4,5,6,7}}})
|
||||||
MES.new('info',"Downloading")
|
MES.new('info',"Downloading")
|
||||||
end
|
|
||||||
end
|
end
|
||||||
function NET.loadSavedData(sections)
|
function NET.loadSavedData(sections)
|
||||||
for _,sec in next,sections do
|
for _,sec in next,sections do
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ local ins,rem=table.insert,table.remove
|
|||||||
local setFont=FONT.set
|
local setFont=FONT.set
|
||||||
|
|
||||||
local posLists={
|
local posLists={
|
||||||
--1~5
|
-- 1~5
|
||||||
(function()
|
(function()
|
||||||
local L={}
|
local L={}
|
||||||
for i=1,5 do
|
for i=1,5 do
|
||||||
@@ -15,7 +15,7 @@ local posLists={
|
|||||||
end
|
end
|
||||||
return L
|
return L
|
||||||
end)(),
|
end)(),
|
||||||
--6~17
|
-- 6~17
|
||||||
(function()
|
(function()
|
||||||
local L={}
|
local L={}
|
||||||
for i=1,10 do
|
for i=1,10 do
|
||||||
@@ -26,7 +26,7 @@ local posLists={
|
|||||||
end
|
end
|
||||||
return L
|
return L
|
||||||
end)(),
|
end)(),
|
||||||
--18~31
|
-- 18~31
|
||||||
(function()
|
(function()
|
||||||
local L={}
|
local L={}
|
||||||
for i=1,11 do L[i]= {x=40,y=65+50*i,w=330,h=45} end
|
for i=1,11 do L[i]= {x=40,y=65+50*i,w=330,h=45} end
|
||||||
@@ -34,7 +34,7 @@ local posLists={
|
|||||||
for i=1,9 do L[22+i]= {x=760,y=65+50*i,w=330,h=45} end
|
for i=1,9 do L[22+i]= {x=760,y=65+50*i,w=330,h=45} end
|
||||||
return L
|
return L
|
||||||
end)(),
|
end)(),
|
||||||
--32~49
|
-- 32~49
|
||||||
(function()
|
(function()
|
||||||
local L={}
|
local L={}
|
||||||
for i=1,10 do L[i]= {x=30,y=60+50*i,w=200,h=45} end
|
for i=1,10 do L[i]= {x=30,y=60+50*i,w=200,h=45} end
|
||||||
@@ -44,7 +44,7 @@ local posLists={
|
|||||||
for i=1,9 do L[40+i]= {x=870,y=60+50*i,w=200,h=45} end
|
for i=1,9 do L[40+i]= {x=870,y=60+50*i,w=200,h=45} end
|
||||||
return L
|
return L
|
||||||
end)(),
|
end)(),
|
||||||
--50~99
|
-- 50~99
|
||||||
(function()
|
(function()
|
||||||
local L={}
|
local L={}
|
||||||
for i=1,11 do L[i]= {x=30,y=60+50*i,w=100,h=45} end
|
for i=1,11 do L[i]= {x=30,y=60+50*i,w=100,h=45} end
|
||||||
@@ -90,7 +90,7 @@ local function _freshPos()
|
|||||||
posList=posLists[3]
|
posList=posLists[3]
|
||||||
elseif #PLYlist<=49 then
|
elseif #PLYlist<=49 then
|
||||||
posList=posLists[4]
|
posList=posLists[4]
|
||||||
else--if #PLY<=99 then
|
else-- if #PLY<=99 then
|
||||||
posList=posLists[5]
|
posList=posLists[5]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -211,7 +211,7 @@ function NETPLY.draw()
|
|||||||
for i=1,#PLYlist do
|
for i=1,#PLYlist do
|
||||||
local p=PLYlist[i]
|
local p=PLYlist[i]
|
||||||
gc_translate(p.x,p.y)
|
gc_translate(p.x,p.y)
|
||||||
--Rectangle
|
-- Rectangle
|
||||||
gc_setColor(COLOR[
|
gc_setColor(COLOR[
|
||||||
p.mode==0 and 'lH' or
|
p.mode==0 and 'lH' or
|
||||||
p.mode==1 and 'N' or
|
p.mode==1 and 'N' or
|
||||||
@@ -225,17 +225,17 @@ function NETPLY.draw()
|
|||||||
gc_rectangle('fill',0,0,p.w,p.h)
|
gc_rectangle('fill',0,0,p.w,p.h)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Stencil
|
-- Stencil
|
||||||
stencilW,stencilH=p.w,p.h
|
stencilW,stencilH=p.w,p.h
|
||||||
gc_setStencilTest('equal',1)
|
gc_setStencilTest('equal',1)
|
||||||
gc_stencil(_playerFrameStencil)
|
gc_stencil(_playerFrameStencil)
|
||||||
gc_setColor(1,1,1)
|
gc_setColor(1,1,1)
|
||||||
|
|
||||||
--Avatar
|
-- Avatar
|
||||||
local avatarSize=math.min(p.h,50)/128*.9
|
local avatarSize=math.min(p.h,50)/128*.9
|
||||||
gc_draw(USERS.getAvatar(p.uid),2,2,nil,avatarSize)
|
gc_draw(USERS.getAvatar(p.uid),2,2,nil,avatarSize)
|
||||||
|
|
||||||
--UID & Username
|
-- UID & Username
|
||||||
if p.h>=47 then
|
if p.h>=47 then
|
||||||
setFont(40)
|
setFont(40)
|
||||||
gc_print("#"..p.uid,50,-5)
|
gc_print("#"..p.uid,50,-5)
|
||||||
@@ -247,7 +247,7 @@ function NETPLY.draw()
|
|||||||
gc_print(p.username,p.h,8)
|
gc_print(p.username,p.h,8)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Stat
|
-- Stat
|
||||||
local S=p.stat
|
local S=p.stat
|
||||||
if S and (p.h>=55 or p.w>=180) then
|
if S and (p.h>=55 or p.w>=180) then
|
||||||
setFont(20)
|
setFont(20)
|
||||||
|
|||||||
@@ -118,14 +118,14 @@ local function _stencilBoard() gc_rectangle('fill',0,-10,300,610) end
|
|||||||
local function _applyField(P)
|
local function _applyField(P)
|
||||||
gc_push('transform')
|
gc_push('transform')
|
||||||
|
|
||||||
--Apply shaking
|
-- Apply shaking
|
||||||
if P.shakeTimer>0 then
|
if P.shakeTimer>0 then
|
||||||
local dx=int(P.shakeTimer/2)
|
local dx=int(P.shakeTimer/2)
|
||||||
local dy=int(P.shakeTimer/3)
|
local dy=int(P.shakeTimer/3)
|
||||||
gc_translate(dx^1.6*(dx%2*2-1)*(P.gameEnv.shakeFX+1)/30,dy^1.4*(dy%2*2-1)*(P.gameEnv.shakeFX+1)/30)
|
gc_translate(dx^1.6*(dx%2*2-1)*(P.gameEnv.shakeFX+1)/30,dy^1.4*(dy%2*2-1)*(P.gameEnv.shakeFX+1)/30)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Apply swingOffset
|
-- Apply swingOffset
|
||||||
local O=P.swingOffset
|
local O=P.swingOffset
|
||||||
if P.gameEnv.shakeFX then
|
if P.gameEnv.shakeFX then
|
||||||
local k=P.gameEnv.shakeFX
|
local k=P.gameEnv.shakeFX
|
||||||
@@ -136,11 +136,11 @@ local function _applyField(P)
|
|||||||
gc_translate(150,0)
|
gc_translate(150,0)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Apply stencil
|
-- Apply stencil
|
||||||
gc_stencil(_stencilBoard)
|
gc_stencil(_stencilBoard)
|
||||||
gc_setStencilTest('equal',1)
|
gc_setStencilTest('equal',1)
|
||||||
|
|
||||||
--Move camera
|
-- Move camera
|
||||||
gc_push('transform')
|
gc_push('transform')
|
||||||
_boardTransform(P.gameEnv.flipBoard)
|
_boardTransform(P.gameEnv.flipBoard)
|
||||||
gc_translate(0,P.fieldBeneath+P.fieldUp)
|
gc_translate(0,P.fieldBeneath+P.fieldUp)
|
||||||
@@ -170,23 +170,23 @@ local function _drawField(P,showInvis)
|
|||||||
local V,F=P.visTime,P.field
|
local V,F=P.visTime,P.field
|
||||||
local start=int((P.fieldBeneath+P.fieldUp)/30+1)
|
local start=int((P.fieldBeneath+P.fieldUp)/30+1)
|
||||||
local texture=P.skinLib
|
local texture=P.skinLib
|
||||||
if P.falling==0 then--Blocks only
|
if P.falling==0 then-- Blocks only
|
||||||
if ENV.upEdge then
|
if ENV.upEdge then
|
||||||
gc_setShader(shader_lighter)
|
gc_setShader(shader_lighter)
|
||||||
gc_translate(0,-4)
|
gc_translate(0,-4)
|
||||||
--<drawRow>
|
-- <drawRow>
|
||||||
for j=start,min(start+21,#F) do _drawRow(texture,j,V[j],F[j]) end
|
for j=start,min(start+21,#F) do _drawRow(texture,j,V[j],F[j]) end
|
||||||
--</drawRow>
|
-- </drawRow>
|
||||||
gc_setShader(shader_fieldSatur)
|
gc_setShader(shader_fieldSatur)
|
||||||
gc_translate(0,4)
|
gc_translate(0,4)
|
||||||
else
|
else
|
||||||
gc_setShader(shader_fieldSatur)
|
gc_setShader(shader_fieldSatur)
|
||||||
end
|
end
|
||||||
|
|
||||||
--<drawRow>
|
-- <drawRow>
|
||||||
for j=start,min(start+21,#F) do _drawRow(texture,j,V[j],F[j],showInvis) end
|
for j=start,min(start+21,#F) do _drawRow(texture,j,V[j],F[j],showInvis) end
|
||||||
--</drawRow>
|
-- </drawRow>
|
||||||
else--With falling animation
|
else-- With falling animation
|
||||||
local stepY=ENV.smooth and (P.falling/(ENV.fall+1))^1.6*30 or 30
|
local stepY=ENV.smooth and (P.falling/(ENV.fall+1))^1.6*30 or 30
|
||||||
local alpha=P.falling/ENV.fall
|
local alpha=P.falling/ENV.fall
|
||||||
local h=1
|
local h=1
|
||||||
@@ -194,7 +194,7 @@ local function _drawField(P,showInvis)
|
|||||||
gc_push('transform')
|
gc_push('transform')
|
||||||
gc_setShader(shader_lighter)
|
gc_setShader(shader_lighter)
|
||||||
gc_translate(0,-4)
|
gc_translate(0,-4)
|
||||||
--<drawRow>
|
-- <drawRow>
|
||||||
for j=start,min(start+21,#F) do
|
for j=start,min(start+21,#F) do
|
||||||
while j==P.clearingRow[h] do
|
while j==P.clearingRow[h] do
|
||||||
h=h+1
|
h=h+1
|
||||||
@@ -202,7 +202,7 @@ local function _drawField(P,showInvis)
|
|||||||
end
|
end
|
||||||
_drawRow(texture,j,V[j],F[j])
|
_drawRow(texture,j,V[j],F[j])
|
||||||
end
|
end
|
||||||
--</drawRow>
|
-- </drawRow>
|
||||||
gc_setShader(shader_fieldSatur)
|
gc_setShader(shader_fieldSatur)
|
||||||
gc_pop()
|
gc_pop()
|
||||||
h=1
|
h=1
|
||||||
@@ -211,7 +211,7 @@ local function _drawField(P,showInvis)
|
|||||||
end
|
end
|
||||||
|
|
||||||
gc_push('transform')
|
gc_push('transform')
|
||||||
--<drawRow>
|
-- <drawRow>
|
||||||
for j=start,min(start+21,#F) do
|
for j=start,min(start+21,#F) do
|
||||||
while j==P.clearingRow[h] do
|
while j==P.clearingRow[h] do
|
||||||
h=h+1
|
h=h+1
|
||||||
@@ -221,13 +221,13 @@ local function _drawField(P,showInvis)
|
|||||||
end
|
end
|
||||||
_drawRow(texture,j,V[j],F[j],showInvis)
|
_drawRow(texture,j,V[j],F[j],showInvis)
|
||||||
end
|
end
|
||||||
--</drawRow>
|
-- </drawRow>
|
||||||
gc_pop()
|
gc_pop()
|
||||||
end
|
end
|
||||||
gc_setShader()
|
gc_setShader()
|
||||||
end
|
end
|
||||||
local function _drawFXs(P)
|
local function _drawFXs(P)
|
||||||
--LockFX
|
-- LockFX
|
||||||
for i=1,#P.lockFX do
|
for i=1,#P.lockFX do
|
||||||
local S=P.lockFX[i]
|
local S=P.lockFX[i]
|
||||||
if S[3]<.5 then
|
if S[3]<.5 then
|
||||||
@@ -239,7 +239,7 @@ local function _drawFXs(P)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--DropFX
|
-- DropFX
|
||||||
for i=1,#P.dropFX do
|
for i=1,#P.dropFX do
|
||||||
local S=P.dropFX[i]
|
local S=P.dropFX[i]
|
||||||
gc_setColor(1,1,1,.6-S[5]*.6)
|
gc_setColor(1,1,1,.6-S[5]*.6)
|
||||||
@@ -247,7 +247,7 @@ local function _drawFXs(P)
|
|||||||
gc_rectangle('fill',30*S[1]-30+15*S[3]-w*.5,-30*S[2],w,30*S[4])
|
gc_rectangle('fill',30*S[1]-30+15*S[3]-w*.5,-30*S[2],w,30*S[4])
|
||||||
end
|
end
|
||||||
|
|
||||||
--MoveFX
|
-- MoveFX
|
||||||
local texture=P.skinLib
|
local texture=P.skinLib
|
||||||
for i=1,#P.moveFX do
|
for i=1,#P.moveFX do
|
||||||
local S=P.moveFX[i]
|
local S=P.moveFX[i]
|
||||||
@@ -255,7 +255,7 @@ local function _drawFXs(P)
|
|||||||
gc_draw(texture[S[1]],30*S[2]-30,-30*S[3])
|
gc_draw(texture[S[1]],30*S[2]-30,-30*S[3])
|
||||||
end
|
end
|
||||||
|
|
||||||
--ClearFX
|
-- ClearFX
|
||||||
for i=1,#P.clearFX do
|
for i=1,#P.clearFX do
|
||||||
local S=P.clearFX[i]
|
local S=P.clearFX[i]
|
||||||
local t=S[2]
|
local t=S[2]
|
||||||
@@ -383,12 +383,12 @@ local function _drawBuffer(atkBuffer,bufferWarn,atkBufferSum1,atkBufferSum)
|
|||||||
local bar=A.amount*30
|
local bar=A.amount*30
|
||||||
if h+bar>600 then bar=600-h end
|
if h+bar>600 then bar=600-h end
|
||||||
if not A.sent then
|
if not A.sent then
|
||||||
--Appear
|
-- Appear
|
||||||
if A.time<20 then
|
if A.time<20 then
|
||||||
bar=bar*(20*A.time)^.5*.05
|
bar=bar*(20*A.time)^.5*.05
|
||||||
end
|
end
|
||||||
if A.countdown>0 then
|
if A.countdown>0 then
|
||||||
--Timing
|
-- Timing
|
||||||
gc_setColor(attackColor[A.lv][1])
|
gc_setColor(attackColor[A.lv][1])
|
||||||
gc_rectangle('fill',303,600-h-bar,11,bar,2)
|
gc_rectangle('fill',303,600-h-bar,11,bar,2)
|
||||||
gc_setColor(1,1,1)
|
gc_setColor(1,1,1)
|
||||||
@@ -398,7 +398,7 @@ local function _drawBuffer(atkBuffer,bufferWarn,atkBufferSum1,atkBufferSum)
|
|||||||
gc_setColor(attackColor[A.lv][2])
|
gc_setColor(attackColor[A.lv][2])
|
||||||
gc_rectangle('fill',303,600-h-bar,11,bar*(1-A.countdown/A.cd0),2)
|
gc_rectangle('fill',303,600-h-bar,11,bar*(1-A.countdown/A.cd0),2)
|
||||||
else
|
else
|
||||||
--Warning
|
-- Warning
|
||||||
local a=math.sin((TIME()-i)*30)*.5+.5
|
local a=math.sin((TIME()-i)*30)*.5+.5
|
||||||
local c1,c2=attackColor[A.lv][1],attackColor[A.lv][2]
|
local c1,c2=attackColor[A.lv][1],attackColor[A.lv][2]
|
||||||
gc_setColor(c1[1]*a+c2[1]*(1-a),c1[2]*a+c2[2]*(1-a),c1[3]*a+c2[3]*(1-a))
|
gc_setColor(c1[1]*a+c2[1]*(1-a),c1[2]*a+c2[2]*(1-a),c1[3]*a+c2[3]*(1-a))
|
||||||
@@ -408,7 +408,7 @@ local function _drawBuffer(atkBuffer,bufferWarn,atkBufferSum1,atkBufferSum)
|
|||||||
gc_setColor(attackColor[A.lv][1])
|
gc_setColor(attackColor[A.lv][1])
|
||||||
bar=bar*(20-A.time)*.05
|
bar=bar*(20-A.time)*.05
|
||||||
gc_rectangle('fill',303,600-h-bar,11,bar,2)
|
gc_rectangle('fill',303,600-h-bar,11,bar,2)
|
||||||
--Disappear
|
-- Disappear
|
||||||
end
|
end
|
||||||
h=h+bar
|
h=h+bar
|
||||||
end
|
end
|
||||||
@@ -445,7 +445,7 @@ local function _drawB2Bbar(b2b,b2b1)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local function _drawLDI(easyFresh,length,freshTime)--Lock Delay Indicator
|
local function _drawLDI(easyFresh,length,freshTime)-- Lock Delay Indicator
|
||||||
if easyFresh then
|
if easyFresh then
|
||||||
gc_setColor(.97,.97,.97)
|
gc_setColor(.97,.97,.97)
|
||||||
else
|
else
|
||||||
@@ -506,7 +506,7 @@ local function _drawNext(P,repMode)
|
|||||||
gc_push('transform')
|
gc_push('transform')
|
||||||
gc_translate(50,40)
|
gc_translate(50,40)
|
||||||
|
|
||||||
--Draw nexts
|
-- Draw nexts
|
||||||
gc_setLineWidth(6)
|
gc_setLineWidth(6)
|
||||||
gc_setColor(1,1,1,.2)
|
gc_setColor(1,1,1,.2)
|
||||||
gc_setShader(shader_blockSatur)
|
gc_setShader(shader_blockSatur)
|
||||||
@@ -540,7 +540,7 @@ local function _drawNext(P,repMode)
|
|||||||
end
|
end
|
||||||
gc_setShader()
|
gc_setShader()
|
||||||
|
|
||||||
--Draw more nexts
|
-- Draw more nexts
|
||||||
if repMode then
|
if repMode then
|
||||||
gc_translate(50,-28)
|
gc_translate(50,-28)
|
||||||
local blockImg=TEXTURE.miniBlock
|
local blockImg=TEXTURE.miniBlock
|
||||||
@@ -564,7 +564,7 @@ local function _drawNext(P,repMode)
|
|||||||
end
|
end
|
||||||
if ENV.bagLine then
|
if ENV.bagLine then
|
||||||
gc_setColor(.8,.8,.8,.8)
|
gc_setColor(.8,.8,.8,.8)
|
||||||
for i=-P.pieceCount%ENV.bagLine,N-1,ENV.bagLine do--i=phase
|
for i=-P.pieceCount%ENV.bagLine,N-1,ENV.bagLine do-- i=phase
|
||||||
gc_rectangle('fill',1,72*i+3,98,2)
|
gc_rectangle('fill',1,72*i+3,98,2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -624,7 +624,7 @@ local function _drawLife(life)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
local function _drawMission(curMission,L,missionkill)
|
local function _drawMission(curMission,L,missionkill)
|
||||||
--Draw current mission
|
-- Draw current mission
|
||||||
setFont(35)
|
setFont(35)
|
||||||
if missionkill then
|
if missionkill then
|
||||||
gc_setColor(1,.7+.2*sin(TIME()*6.26),.4)
|
gc_setColor(1,.7+.2*sin(TIME()*6.26),.4)
|
||||||
@@ -633,7 +633,7 @@ local function _drawMission(curMission,L,missionkill)
|
|||||||
end
|
end
|
||||||
gc_print(ENUM_MISSION[L[curMission]],85,110)
|
gc_print(ENUM_MISSION[L[curMission]],85,110)
|
||||||
|
|
||||||
--Draw next mission
|
-- Draw next mission
|
||||||
setFont(20)
|
setFont(20)
|
||||||
for i=1,3 do
|
for i=1,3 do
|
||||||
local m=L[curMission+i]
|
local m=L[curMission+i]
|
||||||
@@ -719,25 +719,25 @@ function draw.norm(P,repMode)
|
|||||||
gc_translate(P.x,P.y)
|
gc_translate(P.x,P.y)
|
||||||
gc_scale(P.size)
|
gc_scale(P.size)
|
||||||
|
|
||||||
--Draw username
|
-- Draw username
|
||||||
setFont(30)
|
setFont(30)
|
||||||
gc_setColor(.97,.97,.97)
|
gc_setColor(.97,.97,.97)
|
||||||
GC.mStr(P.username,300,-60)
|
GC.mStr(P.username,300,-60)
|
||||||
|
|
||||||
--Draw HUD
|
-- Draw HUD
|
||||||
if ENV.nextCount>0 then _drawNext(P,repMode) end
|
if ENV.nextCount>0 then _drawNext(P,repMode) end
|
||||||
if ENV.holdMode=='hold' and ENV.holdCount>0 then _drawHold(P.holdQueue,ENV.holdCount,P.holdTime,P.skinLib) end
|
if ENV.holdMode=='hold' and ENV.holdCount>0 then _drawHold(P.holdQueue,ENV.holdCount,P.holdTime,P.skinLib) end
|
||||||
if P.curMission then _drawMission(P.curMission,ENV.mission,ENV.missionKill) end
|
if P.curMission then _drawMission(P.curMission,ENV.mission,ENV.missionKill) end
|
||||||
_drawDial(499,505,P.dropSpeed)
|
_drawDial(499,505,P.dropSpeed)
|
||||||
if P.life>0 then _drawLife(P.life) end
|
if P.life>0 then _drawLife(P.life) end
|
||||||
|
|
||||||
--Field-related things
|
-- Field-related things
|
||||||
_applyField(P)
|
_applyField(P)
|
||||||
--Fill field
|
-- Fill field
|
||||||
gc_setColor(0,0,0,.6)
|
gc_setColor(0,0,0,.6)
|
||||||
gc_rectangle('fill',0,-10-camDY,300,610)
|
gc_rectangle('fill',0,-10-camDY,300,610)
|
||||||
|
|
||||||
--Draw grid
|
-- Draw grid
|
||||||
if ENV.grid then
|
if ENV.grid then
|
||||||
gc_setColor(1,1,1,ENV.grid)
|
gc_setColor(1,1,1,ENV.grid)
|
||||||
gc_draw(gridLines,0,-40-(camDY-camDY%30))
|
gc_draw(gridLines,0,-40-(camDY-camDY%30))
|
||||||
@@ -747,16 +747,16 @@ function draw.norm(P,repMode)
|
|||||||
|
|
||||||
local fieldTop=-ENV.fieldH*30
|
local fieldTop=-ENV.fieldH*30
|
||||||
|
|
||||||
--Draw dangerous area
|
-- Draw dangerous area
|
||||||
if fieldTop-camDY<610 then
|
if fieldTop-camDY<610 then
|
||||||
gc_setColor(1,0,0,.26)
|
gc_setColor(1,0,0,.26)
|
||||||
gc_rectangle('fill',0,fieldTop,300,-10-camDY-(600-fieldTop))
|
gc_rectangle('fill',0,fieldTop,300,-10-camDY-(600-fieldTop))
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw field
|
-- Draw field
|
||||||
_drawField(P,repMode)
|
_drawField(P,repMode)
|
||||||
|
|
||||||
--Draw line number
|
-- Draw line number
|
||||||
if ENV.lineNum then
|
if ENV.lineNum then
|
||||||
setFont(20)
|
setFont(20)
|
||||||
local dy=camDY<900 and 0 or camDY-camDY%300-600
|
local dy=camDY<900 and 0 or camDY-camDY%300-600
|
||||||
@@ -772,19 +772,19 @@ function draw.norm(P,repMode)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw spawn line
|
-- Draw spawn line
|
||||||
gc_setLineWidth(4)
|
gc_setLineWidth(4)
|
||||||
gc_setColor(1,sin(t)*.4+.5,0,.5)
|
gc_setColor(1,sin(t)*.4+.5,0,.5)
|
||||||
gc_rectangle('fill',0,fieldTop,300,4)
|
gc_rectangle('fill',0,fieldTop,300,4)
|
||||||
|
|
||||||
--Draw height limit line
|
-- Draw height limit line
|
||||||
gc_setColor(.4,.7+sin(t*12)*.3,1,.7)
|
gc_setColor(.4,.7+sin(t*12)*.3,1,.7)
|
||||||
gc_rectangle('fill',0,-ENV.heightLimit*30-FBN-2,300,4)
|
gc_rectangle('fill',0,-ENV.heightLimit*30-FBN-2,300,4)
|
||||||
|
|
||||||
--Draw FXs
|
-- Draw FXs
|
||||||
_drawFXs(P)
|
_drawFXs(P)
|
||||||
|
|
||||||
--Draw current block
|
-- Draw current block
|
||||||
if P.alive and P.control and P.cur then
|
if P.alive and P.control and P.cur then
|
||||||
local C=P.cur
|
local C=P.cur
|
||||||
local curColor=C.color
|
local curColor=C.color
|
||||||
@@ -793,7 +793,7 @@ function draw.norm(P,repMode)
|
|||||||
local centerPos=C.RS.centerPos[C.id][C.dir]
|
local centerPos=C.RS.centerPos[C.id][C.dir]
|
||||||
local centerX=30*(P.curX+centerPos[2])-20
|
local centerX=30*(P.curX+centerPos[2])-20
|
||||||
|
|
||||||
--Draw ghost & rotation center
|
-- Draw ghost & rotation center
|
||||||
local centerDisp=ENV.center and C.RS.centerDisp[C.id]
|
local centerDisp=ENV.center and C.RS.centerDisp[C.id]
|
||||||
if ENV.ghost then
|
if ENV.ghost then
|
||||||
drawGhost[ENV.ghostType](P.cur.bk,P.curX,P.ghoY,ENV.ghost,P.skinLib,curColor)
|
drawGhost[ENV.ghostType](P.cur.bk,P.curX,P.ghoY,ENV.ghost,P.skinLib,curColor)
|
||||||
@@ -807,7 +807,7 @@ function draw.norm(P,repMode)
|
|||||||
|
|
||||||
local dy=ENV.smooth and P.ghoY~=P.curY and (P.dropDelay/ENV.drop-1)*30 or 0
|
local dy=ENV.smooth and P.ghoY~=P.curY and (P.dropDelay/ENV.drop-1)*30 or 0
|
||||||
gc_translate(0,-dy)
|
gc_translate(0,-dy)
|
||||||
--Draw block & rotation center
|
-- Draw block & rotation center
|
||||||
if ENV.block then
|
if ENV.block then
|
||||||
_drawBlockOutline(P.cur.bk,P.curX,P.curY,P.skinLib[curColor],trans)
|
_drawBlockOutline(P.cur.bk,P.curX,P.curY,P.skinLib[curColor],trans)
|
||||||
_drawBlock(P.cur.bk,P.curX,P.curY,P.skinLib[curColor])
|
_drawBlock(P.cur.bk,P.curX,P.curY,P.skinLib[curColor])
|
||||||
@@ -821,13 +821,13 @@ function draw.norm(P,repMode)
|
|||||||
gc_translate(0,dy)
|
gc_translate(0,dy)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw next preview
|
-- Draw next preview
|
||||||
if ENV.nextPos then
|
if ENV.nextPos then
|
||||||
if P.nextQueue[1] then _drawNextPreview(P.nextQueue[1],ENV.fieldH,P.fieldBeneath) end
|
if P.nextQueue[1] then _drawNextPreview(P.nextQueue[1],ENV.fieldH,P.fieldBeneath) end
|
||||||
if P.holdQueue[1] then _drawHoldPreview(P.holdQueue[1],ENV.fieldH,P.fieldBeneath) end
|
if P.holdQueue[1] then _drawHoldPreview(P.holdQueue[1],ENV.fieldH,P.fieldBeneath) end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw AI's drop destination
|
-- Draw AI's drop destination
|
||||||
if P.destFX then
|
if P.destFX then
|
||||||
local L=P.destFX
|
local L=P.destFX
|
||||||
local texture=TEXTURE.puzzleMark[21]
|
local texture=TEXTURE.puzzleMark[21]
|
||||||
@@ -836,7 +836,7 @@ function draw.norm(P,repMode)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Board cover
|
-- Board cover
|
||||||
if ENV.hideBoard then
|
if ENV.hideBoard then
|
||||||
gc_stencil(hideBoardStencil[ENV.hideBoard])
|
gc_stencil(hideBoardStencil[ENV.hideBoard])
|
||||||
gc_setStencilTest('equal',1)
|
gc_setStencilTest('equal',1)
|
||||||
@@ -857,14 +857,14 @@ function draw.norm(P,repMode)
|
|||||||
gc_translate(0,-600)
|
gc_translate(0,-600)
|
||||||
gc_setStencilTest()
|
gc_setStencilTest()
|
||||||
gc_pop()
|
gc_pop()
|
||||||
--Draw Frame and buffers
|
-- Draw Frame and buffers
|
||||||
gc_setColor(P.frameColor)
|
gc_setColor(P.frameColor)
|
||||||
gc_draw(playerborder,-17,-12)
|
gc_draw(playerborder,-17,-12)
|
||||||
_drawBuffer(P.atkBuffer,ENV.bufferWarn,P.atkBufferSum1,P.atkBufferSum)
|
_drawBuffer(P.atkBuffer,ENV.bufferWarn,P.atkBufferSum1,P.atkBufferSum)
|
||||||
_drawB2Bbar(P.b2b,P.b2b1)
|
_drawB2Bbar(P.b2b,P.b2b1)
|
||||||
_drawLDI(ENV.easyFresh,P.lockDelay/ENV.lock,P.freshTime)
|
_drawLDI(ENV.easyFresh,P.lockDelay/ENV.lock,P.freshTime)
|
||||||
|
|
||||||
--Draw target selecting pad
|
-- Draw target selecting pad
|
||||||
if ENV.layout=='royale' then
|
if ENV.layout=='royale' then
|
||||||
if P.atkMode then
|
if P.atkMode then
|
||||||
gc_setColor(1,.8,0,min(P.swappingAtkMode,30)*.02)
|
gc_setColor(1,.8,0,min(P.swappingAtkMode,30)*.02)
|
||||||
@@ -879,7 +879,7 @@ function draw.norm(P,repMode)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Spike
|
-- Spike
|
||||||
local sp,spt=P.spike,P.spikeTime
|
local sp,spt=P.spike,P.spikeTime
|
||||||
if ENV.showSpike and spt>0 and sp>=10 then
|
if ENV.showSpike and spt>0 and sp>=10 then
|
||||||
local rg=10/sp
|
local rg=10/sp
|
||||||
@@ -892,18 +892,18 @@ function draw.norm(P,repMode)
|
|||||||
mDraw(P.spikeText,x,y,nil,min(.3+(sp/26)*.4+spt/100*.3,1))
|
mDraw(P.spikeText,x,y,nil,min(.3+(sp/26)*.4+spt/100*.3,1))
|
||||||
end
|
end
|
||||||
|
|
||||||
--Bonus texts
|
-- Bonus texts
|
||||||
TEXT.draw(P.bonus)
|
TEXT.draw(P.bonus)
|
||||||
|
|
||||||
--Display Ys
|
-- Display Ys
|
||||||
-- gc_setLineWidth(6)
|
-- gc_setLineWidth(6)
|
||||||
-- if P.curY then gc_setColor(COLOR.R)gc_line(0,611-P.curY*30,300,610-P.curY*30) end
|
-- if P.curY then gc_setColor(COLOR.R)gc_line(0,611-P.curY*30,300,610-P.curY*30) end
|
||||||
-- if P.ghoY then gc_setColor(COLOR.G)gc_line(0,615-P.ghoY*30,300,615-P.ghoY*30) end
|
-- if P.ghoY then gc_setColor(COLOR.G)gc_line(0,615-P.ghoY*30,300,615-P.ghoY*30) end
|
||||||
-- if P.minY then gc_setColor(COLOR.B)gc_line(0,619-P.minY*30,300,620-P.minY*30) end
|
-- if P.minY then gc_setColor(COLOR.B)gc_line(0,619-P.minY*30,300,620-P.minY*30) end
|
||||||
-- gc_line(0,600-P.garbageBeneath*30,300,600-P.garbageBeneath*30)
|
-- gc_line(0,600-P.garbageBeneath*30,300,600-P.garbageBeneath*30)
|
||||||
gc_pop()
|
gc_pop()
|
||||||
|
|
||||||
--Score & Time
|
-- Score & Time
|
||||||
setFont(25)
|
setFont(25)
|
||||||
local tm=STRING.time(P.stat.time)
|
local tm=STRING.time(P.stat.time)
|
||||||
gc_setColor(0,0,0,.3)
|
gc_setColor(0,0,0,.3)
|
||||||
@@ -914,10 +914,10 @@ function draw.norm(P,repMode)
|
|||||||
gc_setColor(.85,.9,.97)
|
gc_setColor(.85,.9,.97)
|
||||||
gc_print(tm,20,540)
|
gc_print(tm,20,540)
|
||||||
|
|
||||||
--FinesseCombo
|
-- FinesseCombo
|
||||||
;(P.type=='remote' and _drawFinesseCombo_remote or _drawFinesseCombo_norm)(P)
|
;(P.type=='remote' and _drawFinesseCombo_remote or _drawFinesseCombo_norm)(P)
|
||||||
|
|
||||||
--Mode informations
|
-- Mode informations
|
||||||
for i=1,#ENV.mesDisp do
|
for i=1,#ENV.mesDisp do
|
||||||
gc_setColor(.97,.97,.97)
|
gc_setColor(.97,.97,.97)
|
||||||
ENV.mesDisp[i](P,repMode)
|
ENV.mesDisp[i](P,repMode)
|
||||||
@@ -929,7 +929,7 @@ function draw.norm(P,repMode)
|
|||||||
gc_pop()
|
gc_pop()
|
||||||
end
|
end
|
||||||
function draw.small(P)
|
function draw.small(P)
|
||||||
--Update canvas
|
-- Update canvas
|
||||||
P.frameWait=P.frameWait-1
|
P.frameWait=P.frameWait-1
|
||||||
if P.frameWait==0 then
|
if P.frameWait==0 then
|
||||||
P.frameWait=10
|
P.frameWait=10
|
||||||
@@ -939,7 +939,7 @@ function draw.small(P)
|
|||||||
gc_origin()
|
gc_origin()
|
||||||
gc_setColor(1,1,1,P.result and max(20-P.endCounter,0)*.05 or 1)
|
gc_setColor(1,1,1,P.result and max(20-P.endCounter,0)*.05 or 1)
|
||||||
|
|
||||||
--Field
|
-- Field
|
||||||
local F=P.field
|
local F=P.field
|
||||||
local texture=SKIN.libMini[SETTING.skinSet]
|
local texture=SKIN.libMini[SETTING.skinSet]
|
||||||
for j=1,#F do
|
for j=1,#F do
|
||||||
@@ -948,14 +948,14 @@ function draw.small(P)
|
|||||||
end end
|
end end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw border
|
-- Draw border
|
||||||
if P.alive then
|
if P.alive then
|
||||||
gc_setLineWidth(2)
|
gc_setLineWidth(2)
|
||||||
gc_setColor(P.frameColor)
|
gc_setColor(P.frameColor)
|
||||||
gc_rectangle('line',0,0,60,120)
|
gc_rectangle('line',0,0,60,120)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw badge
|
-- Draw badge
|
||||||
if P.gameEnv.layout=='royale' then
|
if P.gameEnv.layout=='royale' then
|
||||||
gc_setColor(1,1,1)
|
gc_setColor(1,1,1)
|
||||||
for i=1,P.strength do
|
for i=1,P.strength do
|
||||||
@@ -963,7 +963,7 @@ function draw.small(P)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw result
|
-- Draw result
|
||||||
if P.result then
|
if P.result then
|
||||||
gc_setColor(1,1,1,min(P.endCounter,60)*.01)
|
gc_setColor(1,1,1,min(P.endCounter,60)*.01)
|
||||||
setFont(20)mDraw(TEXTOBJ[P.result],30,60,nil,P.size)
|
setFont(20)mDraw(TEXTOBJ[P.result],30,60,nil,P.size)
|
||||||
@@ -973,7 +973,7 @@ function draw.small(P)
|
|||||||
gc_setCanvas()
|
gc_setCanvas()
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw Canvas
|
-- Draw Canvas
|
||||||
gc_setColor(1,1,1)
|
gc_setColor(1,1,1)
|
||||||
local size=P.size
|
local size=P.size
|
||||||
gc_draw(P.canvas,P.x,P.y,nil,size*10)
|
gc_draw(P.canvas,P.x,P.y,nil,size*10)
|
||||||
@@ -985,7 +985,7 @@ end
|
|||||||
function draw.demo(P)
|
function draw.demo(P)
|
||||||
local ENV=P.gameEnv
|
local ENV=P.gameEnv
|
||||||
|
|
||||||
--Camera
|
-- Camera
|
||||||
gc_push('transform')
|
gc_push('transform')
|
||||||
gc_translate(P.x,P.y)
|
gc_translate(P.x,P.y)
|
||||||
gc_scale(P.size)
|
gc_scale(P.size)
|
||||||
@@ -1017,7 +1017,7 @@ function draw.demo(P)
|
|||||||
local blockImg=TEXTURE.miniBlock
|
local blockImg=TEXTURE.miniBlock
|
||||||
local skinSet=ENV.skin
|
local skinSet=ENV.skin
|
||||||
|
|
||||||
--Draw hold
|
-- Draw hold
|
||||||
local N=1
|
local N=1
|
||||||
while P.holdQueue[N] do
|
while P.holdQueue[N] do
|
||||||
local id=P.holdQueue[N].id
|
local id=P.holdQueue[N].id
|
||||||
@@ -1028,7 +1028,7 @@ function draw.demo(P)
|
|||||||
N=N+1
|
N=N+1
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw next
|
-- Draw next
|
||||||
N=1
|
N=1
|
||||||
while N<=ENV.nextCount and P.nextQueue[N] do
|
while N<=ENV.nextCount and P.nextQueue[N] do
|
||||||
local id=P.nextQueue[N].id
|
local id=P.nextQueue[N].id
|
||||||
@@ -1039,7 +1039,7 @@ function draw.demo(P)
|
|||||||
N=N+1
|
N=N+1
|
||||||
end
|
end
|
||||||
|
|
||||||
--Frame
|
-- Frame
|
||||||
gc_setLineWidth(2)
|
gc_setLineWidth(2)
|
||||||
gc_setColor(COLOR.Z)
|
gc_setColor(COLOR.Z)
|
||||||
gc_rectangle('line',-1,-1,302,602,3)
|
gc_rectangle('line',-1,-1,302,602,3)
|
||||||
|
|||||||
@@ -41,11 +41,11 @@ local function _newEmptyPlayer(id,mini)
|
|||||||
PLAYERS[id]=P
|
PLAYERS[id]=P
|
||||||
PLY_ALIVE[id]=P
|
PLY_ALIVE[id]=P
|
||||||
|
|
||||||
--Inherit functions of Player class
|
-- Inherit functions of Player class
|
||||||
for k,v in next,Player do P[k]=v end
|
for k,v in next,Player do P[k]=v end
|
||||||
|
|
||||||
--Field position
|
-- Field position
|
||||||
P.swingOffset={--Shake FX
|
P.swingOffset={-- Shake FX
|
||||||
x=0,y=0,
|
x=0,y=0,
|
||||||
vx=0,vy=0,
|
vx=0,vy=0,
|
||||||
a=0,va=0,
|
a=0,va=0,
|
||||||
@@ -54,12 +54,12 @@ local function _newEmptyPlayer(id,mini)
|
|||||||
P.x,P.y,P.size=0,0,1
|
P.x,P.y,P.size=0,0,1
|
||||||
P.frameColor=COLOR.Z
|
P.frameColor=COLOR.Z
|
||||||
|
|
||||||
--Set these at Player:setPosition()
|
-- Set these at Player:setPosition()
|
||||||
-- P.fieldX,P.fieldY=...
|
-- P.fieldX,P.fieldY=...
|
||||||
-- P.centerX,P.centerY=...
|
-- P.centerX,P.centerY=...
|
||||||
-- P.absFieldX,P.absFieldY=...
|
-- P.absFieldX,P.absFieldY=...
|
||||||
|
|
||||||
--Minimode
|
-- Minimode
|
||||||
P.miniMode=mini
|
P.miniMode=mini
|
||||||
if mini then
|
if mini then
|
||||||
P.canvas=love.graphics.newCanvas(60,120)
|
P.canvas=love.graphics.newCanvas(60,120)
|
||||||
@@ -69,37 +69,37 @@ local function _newEmptyPlayer(id,mini)
|
|||||||
P.draw=ply_draw.norm
|
P.draw=ply_draw.norm
|
||||||
end
|
end
|
||||||
|
|
||||||
--States
|
-- States
|
||||||
P.type='none'
|
P.type='none'
|
||||||
P.sound=false
|
P.sound=false
|
||||||
P.alive=true
|
P.alive=true
|
||||||
P.control=false
|
P.control=false
|
||||||
P.timing=false
|
P.timing=false
|
||||||
P.trigFrame=0
|
P.trigFrame=0
|
||||||
P.result=false--String: 'finish'|'win'|'lose'
|
P.result=false-- String: 'finish'|'win'|'lose'
|
||||||
P.stat=_getNewStatTable()
|
P.stat=_getNewStatTable()
|
||||||
P.modeData=setmetatable({},modeDataMeta)--Data use by mode
|
P.modeData=setmetatable({},modeDataMeta)-- Data use by mode
|
||||||
P.keyPressing={} for i=1,12 do P.keyPressing[i]=false end
|
P.keyPressing={} for i=1,12 do P.keyPressing[i]=false end
|
||||||
P.clearingRow,P.clearedRow={},{}--Clearing animation height,cleared row mark
|
P.clearingRow,P.clearedRow={},{}-- Clearing animation height,cleared row mark
|
||||||
P.dropFX,P.moveFX,P.lockFX,P.clearFX={},{},{},{}
|
P.dropFX,P.moveFX,P.lockFX,P.clearFX={},{},{},{}
|
||||||
-- P.destFX={}--Normally created by bot
|
-- P.destFX={}-- Normally created by bot
|
||||||
P.tasks={}
|
P.tasks={}
|
||||||
P.bonus={}--Texts
|
P.bonus={}-- Texts
|
||||||
|
|
||||||
--Times
|
-- Times
|
||||||
P.frameRun=GAME.frameStart--Frame run, mainly for replay
|
P.frameRun=GAME.frameStart-- Frame run, mainly for replay
|
||||||
P.endCounter=0--Used after gameover
|
P.endCounter=0-- Used after gameover
|
||||||
P.dropTime={} for i=1,10 do P.dropTime[i]=-1e99 end P.dropSpeed=0
|
P.dropTime={} for i=1,10 do P.dropTime[i]=-1e99 end P.dropSpeed=0
|
||||||
P.stream={}
|
P.stream={}
|
||||||
P.streamProgress=false--1 to start play recording
|
P.streamProgress=false-- 1 to start play recording
|
||||||
|
|
||||||
--Randomizers
|
-- Randomizers
|
||||||
P.seqRND=love.math.newRandomGenerator(GAME.seed)
|
P.seqRND=love.math.newRandomGenerator(GAME.seed)
|
||||||
P.atkRND=love.math.newRandomGenerator(GAME.seed)
|
P.atkRND=love.math.newRandomGenerator(GAME.seed)
|
||||||
P.holeRND=love.math.newRandomGenerator(GAME.seed)
|
P.holeRND=love.math.newRandomGenerator(GAME.seed)
|
||||||
P.aiRND=love.math.newRandomGenerator(GAME.seed+P.id)
|
P.aiRND=love.math.newRandomGenerator(GAME.seed+P.id)
|
||||||
|
|
||||||
--Field-related
|
-- Field-related
|
||||||
P.field,P.visTime={},{}
|
P.field,P.visTime={},{}
|
||||||
P.keepVisible=true
|
P.keepVisible=true
|
||||||
P.showTime=false
|
P.showTime=false
|
||||||
@@ -107,25 +107,25 @@ local function _newEmptyPlayer(id,mini)
|
|||||||
P.fieldBeneath=0
|
P.fieldBeneath=0
|
||||||
P.fieldUp=0
|
P.fieldUp=0
|
||||||
|
|
||||||
--Attack-related
|
-- Attack-related
|
||||||
P.atkBuffer={}
|
P.atkBuffer={}
|
||||||
P.atkBufferSum,P.atkBufferSum1=0,0
|
P.atkBufferSum,P.atkBufferSum1=0,0
|
||||||
P.spike,P.spikeTime=0,0
|
P.spike,P.spikeTime=0,0
|
||||||
P.spikeText=love.graphics.newText(getFont(100))
|
P.spikeText=love.graphics.newText(getFont(100))
|
||||||
|
|
||||||
--Attacker-related
|
-- Attacker-related
|
||||||
P.badge,P.strength=0,0
|
P.badge,P.strength=0,0
|
||||||
P.atkMode,P.swappingAtkMode=1,20
|
P.atkMode,P.swappingAtkMode=1,20
|
||||||
P.atker,P.atking,P.lastRecv={}
|
P.atker,P.atking,P.lastRecv={}
|
||||||
|
|
||||||
--User-related
|
-- User-related
|
||||||
P.username=""
|
P.username=""
|
||||||
P.uid=false
|
P.uid=false
|
||||||
P.sid=id
|
P.sid=id
|
||||||
|
|
||||||
--Block states
|
-- Block states
|
||||||
--[[
|
--[[
|
||||||
P.curX,P.curY,P.ghoY,P.minY=0,0,0,0--x,y,ghostY
|
P.curX,P.curY,P.ghoY,P.minY=0,0,0,0-- x,y,ghostY
|
||||||
P.cur={
|
P.cur={
|
||||||
id=shapeID,
|
id=shapeID,
|
||||||
bk=matrix[2],
|
bk=matrix[2],
|
||||||
@@ -134,66 +134,66 @@ local function _newEmptyPlayer(id,mini)
|
|||||||
name=nameID
|
name=nameID
|
||||||
color=colorID,
|
color=colorID,
|
||||||
}
|
}
|
||||||
P.newNext=false--Warped coroutine to get new next, loaded in applyGameEnv()
|
P.newNext=false-- Warped coroutine to get new next, loaded in applyGameEnv()
|
||||||
]]
|
]]
|
||||||
P.movDir,P.moving,P.downing=0,0,-1--Last move key,DAS charging,downDAS charging
|
P.movDir,P.moving,P.downing=0,0,-1-- Last move key,DAS charging,downDAS charging
|
||||||
P.dropDelay,P.lockDelay=0,0
|
P.dropDelay,P.lockDelay=0,0
|
||||||
P.waiting,P.falling=0,0
|
P.waiting,P.falling=0,0
|
||||||
P.freshTime=0
|
P.freshTime=0
|
||||||
P.spinLast=false
|
P.spinLast=false
|
||||||
P.ctrlCount=0--Key press time, for finesse check
|
P.ctrlCount=0-- Key press time, for finesse check
|
||||||
|
|
||||||
--Game states
|
-- Game states
|
||||||
P.combo=0
|
P.combo=0
|
||||||
P.b2b,P.b2b1=0,0--B2B point & Displayed B2B point
|
P.b2b,P.b2b1=0,0-- B2B point & Displayed B2B point
|
||||||
P.score1=0--Displayed score
|
P.score1=0-- Displayed score
|
||||||
P.pieceCount=0--Count pieces from next, for drawing bagline
|
P.pieceCount=0-- Count pieces from next, for drawing bagline
|
||||||
P.finesseCombo,P.finesseComboTime=0,0
|
P.finesseCombo,P.finesseComboTime=0,0
|
||||||
P.nextQueue={}
|
P.nextQueue={}
|
||||||
P.holdQueue={}
|
P.holdQueue={}
|
||||||
P.holdTime=0
|
P.holdTime=0
|
||||||
P.lastPiece={
|
P.lastPiece={
|
||||||
id=0,name=0,--block id/name
|
id=0,name=0,-- block id/name
|
||||||
|
|
||||||
curX=0,curY=0,--block position
|
curX=0,curY=0,-- block position
|
||||||
centX=0,centY=0,--center position
|
centX=0,centY=0,-- center position
|
||||||
dir=0,--direction
|
dir=0,-- direction
|
||||||
|
|
||||||
frame=-1e99,--lock time
|
frame=-1e99,-- lock time
|
||||||
autoLock=true,--if lock with gravity
|
autoLock=true,-- if lock with gravity
|
||||||
|
|
||||||
finePts=0,--finesse Points
|
finePts=0,-- finesse Points
|
||||||
|
|
||||||
row=0,dig=0,--lines/garbage cleared
|
row=0,dig=0,-- lines/garbage cleared
|
||||||
score=0,--score gained
|
score=0,-- score gained
|
||||||
atk=0,exblock=0,--lines attack/defend
|
atk=0,exblock=0,-- lines attack/defend
|
||||||
off=0,send=0,--lines offset/sent
|
off=0,send=0,-- lines offset/sent
|
||||||
|
|
||||||
spin=false,mini=false,--if spin/mini
|
spin=false,mini=false,-- if spin/mini
|
||||||
pc=false,hpc=false,--if pc/hpc
|
pc=false,hpc=false,-- if pc/hpc
|
||||||
special=false,--if special clear (spin, >=4, pc)
|
special=false,-- if special clear (spin, >=4, pc)
|
||||||
}
|
}
|
||||||
return P
|
return P
|
||||||
end
|
end
|
||||||
local function _loadGameEnv(P)--Load gameEnv
|
local function _loadGameEnv(P)-- Load gameEnv
|
||||||
P.gameEnv={}--Current game setting environment
|
P.gameEnv={}-- Current game setting environment
|
||||||
local ENV=P.gameEnv
|
local ENV=P.gameEnv
|
||||||
local GAME,SETTING=GAME,SETTING
|
local GAME,SETTING=GAME,SETTING
|
||||||
--Load game settings
|
-- Load game settings
|
||||||
for k,v in next,gameEnv0 do
|
for k,v in next,gameEnv0 do
|
||||||
if GAME.modeEnv[k]~=nil then
|
if GAME.modeEnv[k]~=nil then
|
||||||
v=GAME.modeEnv[k] --Mode setting
|
v=GAME.modeEnv[k] -- Mode setting
|
||||||
-- print("mode-"..k..":"..tostring(v))
|
-- print("mode-"..k..":"..tostring(v))
|
||||||
elseif GAME.setting[k]~=nil then
|
elseif GAME.setting[k]~=nil then
|
||||||
v=GAME.setting[k] --Game setting
|
v=GAME.setting[k] -- Game setting
|
||||||
-- print("game-"..k..":"..tostring(v))
|
-- print("game-"..k..":"..tostring(v))
|
||||||
elseif SETTING[k]~=nil then
|
elseif SETTING[k]~=nil then
|
||||||
v=SETTING[k] --Global setting
|
v=SETTING[k] -- Global setting
|
||||||
-- print("global-"..k..":"..tostring(v))
|
-- print("global-"..k..":"..tostring(v))
|
||||||
-- else
|
-- else
|
||||||
-- print("default-"..k..":"..tostring(v))
|
-- print("default-"..k..":"..tostring(v))
|
||||||
end
|
end
|
||||||
if type(v)~='table' then --Default setting
|
if type(v)~='table' then -- Default setting
|
||||||
ENV[k]=v
|
ENV[k]=v
|
||||||
else
|
else
|
||||||
ENV[k]=TABLE.copy(v)
|
ENV[k]=TABLE.copy(v)
|
||||||
@@ -205,26 +205,26 @@ local function _loadGameEnv(P)--Load gameEnv
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local function _loadRemoteEnv(P,confStr)--Load gameEnv
|
local function _loadRemoteEnv(P,confStr)-- Load gameEnv
|
||||||
confStr=JSON.decode(confStr)
|
confStr=JSON.decode(confStr)
|
||||||
if not confStr then
|
if not confStr then
|
||||||
confStr={}
|
confStr={}
|
||||||
MES.new('warn',"Bad conf from "..P.username.."#"..P.uid)
|
MES.new('warn',"Bad conf from "..P.username.."#"..P.uid)
|
||||||
end
|
end
|
||||||
|
|
||||||
P.gameEnv={}--Current game setting environment
|
P.gameEnv={}-- Current game setting environment
|
||||||
local ENV=P.gameEnv
|
local ENV=P.gameEnv
|
||||||
local GAME,SETTING=GAME,SETTING
|
local GAME,SETTING=GAME,SETTING
|
||||||
--Load game settings
|
-- Load game settings
|
||||||
for k,v in next,gameEnv0 do
|
for k,v in next,gameEnv0 do
|
||||||
if GAME.modeEnv[k]~=nil then
|
if GAME.modeEnv[k]~=nil then
|
||||||
v=GAME.modeEnv[k] --Mode setting
|
v=GAME.modeEnv[k] -- Mode setting
|
||||||
elseif confStr[k]~=nil then
|
elseif confStr[k]~=nil then
|
||||||
v=confStr[k] --Game setting
|
v=confStr[k] -- Game setting
|
||||||
elseif SETTING[k]~=nil then
|
elseif SETTING[k]~=nil then
|
||||||
v=SETTING[k] --Global setting
|
v=SETTING[k] -- Global setting
|
||||||
end
|
end
|
||||||
if type(v)~='table' then--Default setting
|
if type(v)~='table' then-- Default setting
|
||||||
ENV[k]=v
|
ENV[k]=v
|
||||||
else
|
else
|
||||||
ENV[k]=TABLE.copy(v)
|
ENV[k]=TABLE.copy(v)
|
||||||
@@ -241,16 +241,16 @@ local function _mergeFuncTable(f,L)
|
|||||||
end
|
end
|
||||||
return L
|
return L
|
||||||
end
|
end
|
||||||
local function _applyGameEnv(P)--Finish gameEnv processing
|
local function _applyGameEnv(P)-- Finish gameEnv processing
|
||||||
local ENV=P.gameEnv
|
local ENV=P.gameEnv
|
||||||
|
|
||||||
--Apply events
|
-- Apply events
|
||||||
ENV.mesDisp=_mergeFuncTable(ENV.mesDisp,{})
|
ENV.mesDisp=_mergeFuncTable(ENV.mesDisp,{})
|
||||||
ENV.hook_drop=_mergeFuncTable(ENV.hook_drop,{})
|
ENV.hook_drop=_mergeFuncTable(ENV.hook_drop,{})
|
||||||
ENV.hook_die=_mergeFuncTable(ENV.hook_die,{})
|
ENV.hook_die=_mergeFuncTable(ENV.hook_die,{})
|
||||||
ENV.task=_mergeFuncTable(ENV.task,{})
|
ENV.task=_mergeFuncTable(ENV.task,{})
|
||||||
|
|
||||||
--Apply eventSet
|
-- Apply eventSet
|
||||||
if ENV.eventSet and ENV.eventSet~="X" then
|
if ENV.eventSet and ENV.eventSet~="X" then
|
||||||
if type(ENV.eventSet)=='string' then
|
if type(ENV.eventSet)=='string' then
|
||||||
local eventSet=require('parts.eventsets.'..ENV.eventSet)
|
local eventSet=require('parts.eventsets.'..ENV.eventSet)
|
||||||
@@ -362,7 +362,7 @@ local function _applyGameEnv(P)--Finish gameEnv processing
|
|||||||
if ENV.center==0 then ENV.center=false end
|
if ENV.center==0 then ENV.center=false end
|
||||||
if ENV.lineNum==0 then ENV.lineNum=false end
|
if ENV.lineNum==0 then ENV.lineNum=false end
|
||||||
|
|
||||||
--Load tasks
|
-- Load tasks
|
||||||
for i=1,#ENV.task do P:newTask(ENV.task[i]) end
|
for i=1,#ENV.task do P:newTask(ENV.task[i]) end
|
||||||
end
|
end
|
||||||
--------------------------</Libs>--------------------------
|
--------------------------</Libs>--------------------------
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -23,10 +23,10 @@ local seqGenerators={
|
|||||||
local rndGen=P.seqRND
|
local rndGen=P.seqRND
|
||||||
local len=#seq0
|
local len=#seq0
|
||||||
local bag=TABLE.shift(seq0)
|
local bag=TABLE.shift(seq0)
|
||||||
do--Get a good first-bag
|
do-- Get a good first-bag
|
||||||
--Shuffle
|
-- Shuffle
|
||||||
for i=1,len-1 do ins(bag,rem(bag,rndGen:random(len-i+1))) end
|
for i=1,len-1 do ins(bag,rem(bag,rndGen:random(len-i+1))) end
|
||||||
--Skip Uncomfortable minoes
|
-- Skip Uncomfortable minoes
|
||||||
for _=1,len-1 do
|
for _=1,len-1 do
|
||||||
if
|
if
|
||||||
bag[1]==1 or bag[1]==2 or bag[1]==6 or bag[1]==8 or bag[1]==9 or
|
bag[1]==1 or bag[1]==2 or bag[1]==6 or bag[1]==8 or bag[1]==9 or
|
||||||
@@ -39,7 +39,7 @@ local seqGenerators={
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--Finish
|
-- Finish
|
||||||
for i=1,len do P:getNext(bag[i]) end
|
for i=1,len do P:getNext(bag[i]) end
|
||||||
end
|
end
|
||||||
bag={}
|
bag={}
|
||||||
@@ -63,7 +63,7 @@ local seqGenerators={
|
|||||||
while true do
|
while true do
|
||||||
while #P.nextQueue<10 do
|
while #P.nextQueue<10 do
|
||||||
local r
|
local r
|
||||||
for _=1,hisLen do--Reroll up to [hisLen] times
|
for _=1,hisLen do-- Reroll up to [hisLen] times
|
||||||
r=rndGen:random(len)
|
r=rndGen:random(len)
|
||||||
for i=1,hisLen do
|
for i=1,hisLen do
|
||||||
if r==history[i] then
|
if r==history[i] then
|
||||||
@@ -86,17 +86,17 @@ local seqGenerators={
|
|||||||
local rndGen=P.seqRND
|
local rndGen=P.seqRND
|
||||||
local len=#seq0
|
local len=#seq0
|
||||||
local hisLen=math.ceil(len*.5)
|
local hisLen=math.ceil(len*.5)
|
||||||
local history=TABLE.new(0,hisLen)--Indexes of mino-index
|
local history=TABLE.new(0,hisLen)-- Indexes of mino-index
|
||||||
|
|
||||||
local poolLen=5*len
|
local poolLen=5*len
|
||||||
local droughtTimes=TABLE.new(len,len)--Drought times of seq0
|
local droughtTimes=TABLE.new(len,len)-- Drought times of seq0
|
||||||
local pool={} for i=1,len do for _=1,5 do ins(pool,i) end end--5 times indexes of seq0
|
local pool={} for i=1,len do for _=1,5 do ins(pool,i) end end-- 5 times indexes of seq0
|
||||||
local function _poolPick()
|
local function _poolPick()
|
||||||
local r=rndGen:random(poolLen)
|
local r=rndGen:random(poolLen)
|
||||||
local res=pool[r]
|
local res=pool[r]
|
||||||
|
|
||||||
--Find droughtest(s) minoes
|
-- Find droughtest(s) minoes
|
||||||
local droughtList={1}--Droughtst minoes' indexes of seq0
|
local droughtList={1}-- Droughtst minoes' indexes of seq0
|
||||||
local maxTime=droughtTimes[1]
|
local maxTime=droughtTimes[1]
|
||||||
for i=2,len do
|
for i=2,len do
|
||||||
if droughtTimes[i]>maxTime then
|
if droughtTimes[i]>maxTime then
|
||||||
@@ -111,11 +111,11 @@ local seqGenerators={
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Update droughtTimes
|
-- Update droughtTimes
|
||||||
for i=1,len do droughtTimes[i]=droughtTimes[i]+1 end
|
for i=1,len do droughtTimes[i]=droughtTimes[i]+1 end
|
||||||
droughtTimes[res]=0
|
droughtTimes[res]=0
|
||||||
|
|
||||||
--Update pool
|
-- Update pool
|
||||||
-- print("Rem "..res)
|
-- print("Rem "..res)
|
||||||
pool[r]=droughtList[rndGen:random(#droughtList)]
|
pool[r]=droughtList[rndGen:random(#droughtList)]
|
||||||
-- print("Add "..pool[r])
|
-- print("Add "..pool[r])
|
||||||
@@ -126,10 +126,10 @@ local seqGenerators={
|
|||||||
while true do
|
while true do
|
||||||
while #P.nextQueue<10 do
|
while #P.nextQueue<10 do
|
||||||
-- print"======================"
|
-- print"======================"
|
||||||
--Pick a mino from pool
|
-- Pick a mino from pool
|
||||||
local tryTime=0
|
local tryTime=0
|
||||||
::REPEAT_pickAgain::
|
::REPEAT_pickAgain::
|
||||||
local r=_poolPick()--Random mino-index in pool
|
local r=_poolPick()-- Random mino-index in pool
|
||||||
for i=1,len do
|
for i=1,len do
|
||||||
if r==history[i] then
|
if r==history[i] then
|
||||||
tryTime=tryTime+1
|
tryTime=tryTime+1
|
||||||
@@ -139,7 +139,7 @@ local seqGenerators={
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Give mino to player & update history
|
-- Give mino to player & update history
|
||||||
if history[1]~=0 then
|
if history[1]~=0 then
|
||||||
P:getNext(seq0[r])
|
P:getNext(seq0[r])
|
||||||
end
|
end
|
||||||
@@ -263,7 +263,7 @@ local seqGenerators={
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
return function(P)--Return a piece-generating function for player P
|
return function(P)-- Return a piece-generating function for player P
|
||||||
local s=P.gameEnv.sequence
|
local s=P.gameEnv.sequence
|
||||||
if type(s)=='function' then
|
if type(s)=='function' then
|
||||||
return s
|
return s
|
||||||
|
|||||||
@@ -24,18 +24,18 @@ function scene.keyDown(key)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function scene.draw()
|
function scene.draw()
|
||||||
--Texts
|
-- Texts
|
||||||
setFont(20)
|
setFont(20)
|
||||||
gc.setColor(COLOR.Z)
|
gc.setColor(COLOR.Z)
|
||||||
for i=1,#text.aboutTexts do
|
for i=1,#text.aboutTexts do
|
||||||
gc.print(text.aboutTexts[i],62,35*i)
|
gc.print(text.aboutTexts[i],62,35*i)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Lib used
|
-- Lib used
|
||||||
setFont(15)
|
setFont(15)
|
||||||
gc.print(text.used,495,426)--❤Flandre❤
|
gc.print(text.used,495,426)-- ❤Flandre❤
|
||||||
|
|
||||||
--Logo
|
-- Logo
|
||||||
gc.draw(TEXTURE.title,280,610,.1,.4+.03*sin(TIME()*2.6),nil,580,118)
|
gc.draw(TEXTURE.title,280,610,.1,.4+.03*sin(TIME()*2.6),nil,580,118)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -198,31 +198,31 @@ local frontColor={
|
|||||||
COLOR.lG,COLOR.lB,COLOR.lB,COLOR.lB,
|
COLOR.lG,COLOR.lB,COLOR.lB,COLOR.lB,
|
||||||
COLOR.lG,COLOR.lY,COLOR.lV,COLOR.lV,
|
COLOR.lG,COLOR.lY,COLOR.lV,COLOR.lV,
|
||||||
COLOR.lG,COLOR.lY,COLOR.lV,COLOR.lV,
|
COLOR.lG,COLOR.lY,COLOR.lV,COLOR.lV,
|
||||||
},--Colored(rank)
|
},-- Colored(rank)
|
||||||
rainbow={
|
rainbow={
|
||||||
COLOR.lR,COLOR.lR,COLOR.lR,COLOR.lR,
|
COLOR.lR,COLOR.lR,COLOR.lR,COLOR.lR,
|
||||||
COLOR.lO,COLOR.lY,COLOR.lY,COLOR.lY,
|
COLOR.lO,COLOR.lY,COLOR.lY,COLOR.lY,
|
||||||
COLOR.lO,COLOR.lG,COLOR.lB,COLOR.lB,
|
COLOR.lO,COLOR.lG,COLOR.lB,COLOR.lB,
|
||||||
COLOR.lO,COLOR.lG,COLOR.lB,COLOR.lB,
|
COLOR.lO,COLOR.lG,COLOR.lB,COLOR.lB,
|
||||||
},--Rainbow(rank)
|
},-- Rainbow(rank)
|
||||||
color2={
|
color2={
|
||||||
COLOR.lR,COLOR.lR,COLOR.lR,COLOR.lR,
|
COLOR.lR,COLOR.lR,COLOR.lR,COLOR.lR,
|
||||||
COLOR.lB,COLOR.lB,COLOR.lB,COLOR.lB,
|
COLOR.lB,COLOR.lB,COLOR.lB,COLOR.lB,
|
||||||
COLOR.lG,COLOR.lY,COLOR.lV,COLOR.lV,
|
COLOR.lG,COLOR.lY,COLOR.lV,COLOR.lV,
|
||||||
COLOR.lG,COLOR.lY,COLOR.lV,COLOR.lV,
|
COLOR.lG,COLOR.lY,COLOR.lV,COLOR.lV,
|
||||||
},--Colored(row)
|
},-- Colored(row)
|
||||||
gray={
|
gray={
|
||||||
COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z,
|
COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z,
|
||||||
COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z,
|
COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z,
|
||||||
COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z,
|
COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z,
|
||||||
COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z,
|
COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z,
|
||||||
},--Gray
|
},-- Gray
|
||||||
black={
|
black={
|
||||||
COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z,
|
COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z,
|
||||||
COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z,
|
COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z,
|
||||||
COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z,
|
COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z,
|
||||||
COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z,
|
COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z,
|
||||||
},--Black
|
},-- Black
|
||||||
}
|
}
|
||||||
local backColor={
|
local backColor={
|
||||||
color1={
|
color1={
|
||||||
@@ -230,31 +230,31 @@ local backColor={
|
|||||||
COLOR.dG,COLOR.dB,COLOR.dB,COLOR.dB,
|
COLOR.dG,COLOR.dB,COLOR.dB,COLOR.dB,
|
||||||
COLOR.dG,COLOR.dY,COLOR.dP,COLOR.dP,
|
COLOR.dG,COLOR.dY,COLOR.dP,COLOR.dP,
|
||||||
COLOR.dG,COLOR.dY,COLOR.dP,COLOR.dP,
|
COLOR.dG,COLOR.dY,COLOR.dP,COLOR.dP,
|
||||||
},--Colored(rank)
|
},-- Colored(rank)
|
||||||
rainbow={
|
rainbow={
|
||||||
COLOR.dR,COLOR.dR,COLOR.dR,COLOR.dR,
|
COLOR.dR,COLOR.dR,COLOR.dR,COLOR.dR,
|
||||||
COLOR.dO,COLOR.dY,COLOR.dY,COLOR.dY,
|
COLOR.dO,COLOR.dY,COLOR.dY,COLOR.dY,
|
||||||
COLOR.dO,COLOR.dG,COLOR.dB,COLOR.dB,
|
COLOR.dO,COLOR.dG,COLOR.dB,COLOR.dB,
|
||||||
COLOR.dO,COLOR.dG,COLOR.dB,COLOR.dB,
|
COLOR.dO,COLOR.dG,COLOR.dB,COLOR.dB,
|
||||||
},--Rainbow(rank)
|
},-- Rainbow(rank)
|
||||||
color2={
|
color2={
|
||||||
COLOR.dR,COLOR.dR,COLOR.dR,COLOR.dR,
|
COLOR.dR,COLOR.dR,COLOR.dR,COLOR.dR,
|
||||||
COLOR.dB,COLOR.dB,COLOR.dB,COLOR.dB,
|
COLOR.dB,COLOR.dB,COLOR.dB,COLOR.dB,
|
||||||
COLOR.dG,COLOR.dY,COLOR.dP,COLOR.dP,
|
COLOR.dG,COLOR.dY,COLOR.dP,COLOR.dP,
|
||||||
COLOR.dG,COLOR.dY,COLOR.dP,COLOR.dP,
|
COLOR.dG,COLOR.dY,COLOR.dP,COLOR.dP,
|
||||||
},--Colored(row)
|
},-- Colored(row)
|
||||||
gray={
|
gray={
|
||||||
COLOR.dH,COLOR.dH,COLOR.dH,COLOR.dH,
|
COLOR.dH,COLOR.dH,COLOR.dH,COLOR.dH,
|
||||||
COLOR.dH,COLOR.dH,COLOR.dH,COLOR.dH,
|
COLOR.dH,COLOR.dH,COLOR.dH,COLOR.dH,
|
||||||
COLOR.dH,COLOR.dH,COLOR.dH,COLOR.dH,
|
COLOR.dH,COLOR.dH,COLOR.dH,COLOR.dH,
|
||||||
COLOR.dH,COLOR.dH,COLOR.dH,COLOR.dH,
|
COLOR.dH,COLOR.dH,COLOR.dH,COLOR.dH,
|
||||||
},--Gray
|
},-- Gray
|
||||||
black={
|
black={
|
||||||
COLOR.D,COLOR.D,COLOR.D,COLOR.D,
|
COLOR.D,COLOR.D,COLOR.D,COLOR.D,
|
||||||
COLOR.D,COLOR.D,COLOR.D,COLOR.D,
|
COLOR.D,COLOR.D,COLOR.D,COLOR.D,
|
||||||
COLOR.D,COLOR.D,COLOR.D,COLOR.D,
|
COLOR.D,COLOR.D,COLOR.D,COLOR.D,
|
||||||
COLOR.D,COLOR.D,COLOR.D,COLOR.D,
|
COLOR.D,COLOR.D,COLOR.D,COLOR.D,
|
||||||
},--Black
|
},-- Black
|
||||||
}
|
}
|
||||||
function scene.draw()
|
function scene.draw()
|
||||||
FONT.set(40)
|
FONT.set(40)
|
||||||
@@ -266,15 +266,15 @@ function scene.draw()
|
|||||||
gc.print(push,1026,180)
|
gc.print(push,1026,180)
|
||||||
|
|
||||||
if state==2 then
|
if state==2 then
|
||||||
--Draw no-setting area
|
-- Draw no-setting area
|
||||||
gc.setColor(1,0,0,.3)
|
gc.setColor(1,0,0,.3)
|
||||||
gc.rectangle('fill',15,295,285,340)
|
gc.rectangle('fill',15,295,285,340)
|
||||||
|
|
||||||
gc.setColor(.9,.9,0)--win
|
gc.setColor(.9,.9,0)-- win
|
||||||
elseif state==1 then
|
elseif state==1 then
|
||||||
gc.setColor(.9,.9,.9)--game
|
gc.setColor(.9,.9,.9)-- game
|
||||||
elseif state==0 then
|
elseif state==0 then
|
||||||
gc.setColor(.2,.8,.2)--ready
|
gc.setColor(.2,.8,.2)-- ready
|
||||||
end
|
end
|
||||||
gc.setLineWidth(10)
|
gc.setLineWidth(10)
|
||||||
gc.rectangle('line',313,33,654,654,18)
|
gc.rectangle('line',313,33,654,654,18)
|
||||||
|
|||||||
@@ -54,13 +54,13 @@ local tileColor={
|
|||||||
{.22,.19,.17},
|
{.22,.19,.17},
|
||||||
}
|
}
|
||||||
local tileFont={
|
local tileFont={
|
||||||
80,80,80,--2/4/8
|
80,80,80,-- 2/4/8
|
||||||
70,70,70,--16/32/64
|
70,70,70,-- 16/32/64
|
||||||
60,60,60,--128/256/512
|
60,60,60,-- 128/256/512
|
||||||
55,55,55,55,--1024/2048/4096/8192
|
55,55,55,55,-- 1024/2048/4096/8192
|
||||||
50,50,50,--16384/32768/65536
|
50,50,50,-- 16384/32768/65536
|
||||||
45,45,45,--131072/262144/524288
|
45,45,45,-- 131072/262144/524288
|
||||||
30,--1048576
|
30,-- 1048576
|
||||||
}
|
}
|
||||||
local tileName={[0]="X","2","4","8","16","32","64","128","256","512","1024","2048","4096","8192","16384","32768","65536","131072","262144","524288","2^20"}
|
local tileName={[0]="X","2","4","8","16","32","64","128","256","512","1024","2048","4096","8192","16384","32768","65536","131072","262144","524288","2^20"}
|
||||||
local function airExist()
|
local function airExist()
|
||||||
@@ -71,7 +71,7 @@ local function airExist()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
local function newTile()
|
local function newTile()
|
||||||
--Select position & generate number
|
-- Select position & generate number
|
||||||
nextPos=(nextPos+6)%16+1
|
nextPos=(nextPos+6)%16+1
|
||||||
while board[nextPos] do
|
while board[nextPos] do
|
||||||
nextPos=(nextPos-4)%16+1
|
nextPos=(nextPos-4)%16+1
|
||||||
@@ -80,11 +80,11 @@ local function newTile()
|
|||||||
prevPos=nextPos
|
prevPos=nextPos
|
||||||
prevSpawnTime=0
|
prevSpawnTime=0
|
||||||
|
|
||||||
--Fresh score
|
-- Fresh score
|
||||||
score=score+2^nextTile
|
score=score+2^nextTile
|
||||||
TEXT.show("+"..2^nextTile,1130+rnd(-60,60),575+rnd(-30,30),30,'score',1.5)
|
TEXT.show("+"..2^nextTile,1130+rnd(-60,60),575+rnd(-30,30),30,'score',1.5)
|
||||||
|
|
||||||
--Generate next number
|
-- Generate next number
|
||||||
nextCD=nextCD-1
|
nextCD=nextCD-1
|
||||||
if nextCD>0 then
|
if nextCD>0 then
|
||||||
nextTile=1
|
nextTile=1
|
||||||
@@ -93,10 +93,10 @@ local function newTile()
|
|||||||
nextCD=rnd(8,12)
|
nextCD=rnd(8,12)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Check if board is full
|
-- Check if board is full
|
||||||
if airExist() then return end
|
if airExist() then return end
|
||||||
|
|
||||||
--Check if board is locked in all-directions
|
-- Check if board is locked in all-directions
|
||||||
for i=1,12 do
|
for i=1,12 do
|
||||||
if board[i]==board[i+4] then
|
if board[i]==board[i+4] then
|
||||||
return
|
return
|
||||||
@@ -112,7 +112,7 @@ local function newTile()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Die.
|
-- Die.
|
||||||
state=2
|
state=2
|
||||||
SFX.play(maxTile>=10 and 'win' or 'fail')
|
SFX.play(maxTile>=10 and 'win' or 'fail')
|
||||||
end
|
end
|
||||||
@@ -139,10 +139,10 @@ local function squash(L)
|
|||||||
p1=p1+1
|
p1=p1+1
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if not L[p1] then--air←2
|
if not L[p1] then-- air←2
|
||||||
L[p1],L[p2]=L[p2],false
|
L[p1],L[p2]=L[p2],false
|
||||||
moved=true
|
moved=true
|
||||||
elseif L[p1]==L[p2] then--2←2
|
elseif L[p1]==L[p2] then-- 2←2
|
||||||
L[p1],L[p2]=L[p1]+1,false
|
L[p1],L[p2]=L[p1]+1,false
|
||||||
if L[p1]>maxTile then
|
if L[p1]>maxTile then
|
||||||
freshMaxTile()
|
freshMaxTile()
|
||||||
@@ -150,11 +150,11 @@ local function squash(L)
|
|||||||
L[p2]=false
|
L[p2]=false
|
||||||
p1=p1+1
|
p1=p1+1
|
||||||
moved=true
|
moved=true
|
||||||
elseif p1+1~=p2 then--2←4
|
elseif p1+1~=p2 then-- 2←4
|
||||||
L[p1+1],L[p2]=L[p2],false
|
L[p1+1],L[p2]=L[p2],false
|
||||||
p1=p1+1
|
p1=p1+1
|
||||||
moved=true
|
moved=true
|
||||||
else--2,4
|
else-- 2,4
|
||||||
p1=p1+1
|
p1=p1+1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -351,14 +351,14 @@ function scene.draw()
|
|||||||
gc.print(("%.3f"):format(time),1000,10)
|
gc.print(("%.3f"):format(time),1000,10)
|
||||||
gc.print(move,1000,45)
|
gc.print(move,1000,45)
|
||||||
|
|
||||||
--Progress time list
|
-- Progress time list
|
||||||
setFont(20)
|
setFont(20)
|
||||||
setColor(.6,.6,.6)
|
setColor(.6,.6,.6)
|
||||||
for i=1,#progress do
|
for i=1,#progress do
|
||||||
gc.print(progress[i],1000,65+20*i)
|
gc.print(progress[i],1000,65+20*i)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Repeater
|
-- Repeater
|
||||||
gc.setLineWidth(6)
|
gc.setLineWidth(6)
|
||||||
setFont(25)
|
setFont(25)
|
||||||
for i=1,2 do
|
for i=1,2 do
|
||||||
@@ -377,27 +377,27 @@ function scene.draw()
|
|||||||
gc.print(repeater.seq[i],1000,313+60*i)
|
gc.print(repeater.seq[i],1000,313+60*i)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Score
|
-- Score
|
||||||
setFont(40)
|
setFont(40)
|
||||||
setColor(1,.7,.7)
|
setColor(1,.7,.7)
|
||||||
GC.mStr(score,1130,510)
|
GC.mStr(score,1130,510)
|
||||||
|
|
||||||
--Messages
|
-- Messages
|
||||||
if state==2 then
|
if state==2 then
|
||||||
--Draw no-setting area
|
-- Draw no-setting area
|
||||||
setColor(1,0,0,.3)
|
setColor(1,0,0,.3)
|
||||||
rectangle('fill',15,265,285,140)
|
rectangle('fill',15,265,285,140)
|
||||||
|
|
||||||
setColor(.9,.9,0)--win
|
setColor(.9,.9,0)-- win
|
||||||
elseif state==1 then
|
elseif state==1 then
|
||||||
setColor(.9,.9,.9)--game
|
setColor(.9,.9,.9)-- game
|
||||||
elseif state==0 then
|
elseif state==0 then
|
||||||
setColor(.2,.8,.2)--ready
|
setColor(.2,.8,.2)-- ready
|
||||||
end
|
end
|
||||||
gc.setLineWidth(10)
|
gc.setLineWidth(10)
|
||||||
rectangle('line',310,30,660,660)
|
rectangle('line',310,30,660,660)
|
||||||
|
|
||||||
--Board
|
-- Board
|
||||||
for i=1,16 do
|
for i=1,16 do
|
||||||
if board[i] then
|
if board[i] then
|
||||||
local x,y=1+(i-1)%4,int((i+3)/4)
|
local x,y=1+(i-1)%4,int((i+3)/4)
|
||||||
@@ -429,7 +429,7 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Next indicator
|
-- Next indicator
|
||||||
setColor(1,1,1)
|
setColor(1,1,1)
|
||||||
if nextCD<=12 then
|
if nextCD<=12 then
|
||||||
for i=1,nextCD do
|
for i=1,nextCD do
|
||||||
@@ -437,7 +437,7 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Next
|
-- Next
|
||||||
setFont(40)
|
setFont(40)
|
||||||
gc.print("Next",50,195)
|
gc.print("Next",50,195)
|
||||||
if nextTile>1 then
|
if nextTile>1 then
|
||||||
@@ -446,27 +446,27 @@ function scene.draw()
|
|||||||
setFont(70)
|
setFont(70)
|
||||||
GC.mStr(tileName[nextTile],220,175)
|
GC.mStr(tileName[nextTile],220,175)
|
||||||
|
|
||||||
--Skip CoolDown
|
-- Skip CoolDown
|
||||||
if skipper.cd and skipper.cd>0 then
|
if skipper.cd and skipper.cd>0 then
|
||||||
setFont(50)
|
setFont(50)
|
||||||
setColor(1,1,.5)
|
setColor(1,1,.5)
|
||||||
GC.mStr(skipper.cd,155,600)
|
GC.mStr(skipper.cd,155,600)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Skip mark
|
-- Skip mark
|
||||||
if skipper.used then
|
if skipper.used then
|
||||||
setColor(1,1,.5)
|
setColor(1,1,.5)
|
||||||
gc.circle('fill',280,675,10)
|
gc.circle('fill',280,675,10)
|
||||||
end
|
end
|
||||||
|
|
||||||
--New tile position
|
-- New tile position
|
||||||
local x,y=1+(prevPos-1)%4,int((prevPos+3)/4)
|
local x,y=1+(prevPos-1)%4,int((prevPos+3)/4)
|
||||||
gc.setLineWidth(8)
|
gc.setLineWidth(8)
|
||||||
setColor(.2,.8,0,prevSpawnTime)
|
setColor(.2,.8,0,prevSpawnTime)
|
||||||
local d=25-prevSpawnTime*25
|
local d=25-prevSpawnTime*25
|
||||||
rectangle('line',x*160+163-d,y*160-117-d,154+2*d,154+2*d,15)
|
rectangle('line',x*160+163-d,y*160-117-d,154+2*d,154+2*d,15)
|
||||||
|
|
||||||
--Touch control border line
|
-- Touch control border line
|
||||||
if tapControl then
|
if tapControl then
|
||||||
gc.setLineWidth(6)
|
gc.setLineWidth(6)
|
||||||
setColor(1,1,1,.2)
|
setColor(1,1,1,.2)
|
||||||
|
|||||||
@@ -96,11 +96,11 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if state==2 then
|
if state==2 then
|
||||||
gc.setColor(.9,.9,0)--win
|
gc.setColor(.9,.9,0)-- win
|
||||||
elseif state==1 then
|
elseif state==1 then
|
||||||
gc.setColor(.9,.9,.9)--game
|
gc.setColor(.9,.9,.9)-- game
|
||||||
elseif state==0 then
|
elseif state==0 then
|
||||||
gc.setColor(.2,.8,.2)--ready
|
gc.setColor(.2,.8,.2)-- ready
|
||||||
end
|
end
|
||||||
|
|
||||||
FONT.set(100)
|
FONT.set(100)
|
||||||
|
|||||||
@@ -130,15 +130,15 @@ scene.touchUp=scene.mouseDown
|
|||||||
|
|
||||||
function scene.draw()
|
function scene.draw()
|
||||||
gc.push('transform')
|
gc.push('transform')
|
||||||
--origin pos:0,140; scale:4
|
-- origin pos:0,140; scale:4
|
||||||
gc.translate(280,0)
|
gc.translate(280,0)
|
||||||
gc.scale(8)
|
gc.scale(8)
|
||||||
|
|
||||||
--Draw board
|
-- Draw board
|
||||||
gc.setColor(COLOR.dX)
|
gc.setColor(COLOR.dX)
|
||||||
gc.rectangle('fill',0,0,90,90)
|
gc.rectangle('fill',0,0,90,90)
|
||||||
|
|
||||||
--Draw target area
|
-- Draw target area
|
||||||
gc.setColor(1,1,1,math.sin((TIME()-placeTime)*5)*.1+.15)
|
gc.setColor(1,1,1,math.sin((TIME()-placeTime)*5)*.1+.15)
|
||||||
if target then
|
if target then
|
||||||
gc.rectangle('fill',(target-1)%3*30,int((target-1)/3)*30,30,30)
|
gc.rectangle('fill',(target-1)%3*30,int((target-1)/3)*30,30,30)
|
||||||
@@ -146,7 +146,7 @@ function scene.draw()
|
|||||||
gc.rectangle('fill',0,0,90,90)
|
gc.rectangle('fill',0,0,90,90)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw cursor
|
-- Draw cursor
|
||||||
if curX then
|
if curX then
|
||||||
gc.setColor(1,1,1,.3)
|
gc.setColor(1,1,1,.3)
|
||||||
gc.rectangle('fill',(curX-1)%3*30+(curx-1)%3*10-.5,int((curX-1)/3)*30+int((curx-1)/3)*10-.5,11,11)
|
gc.rectangle('fill',(curX-1)%3*30+(curx-1)%3*10-.5,int((curX-1)/3)*30+int((curx-1)/3)*10-.5,11,11)
|
||||||
@@ -181,7 +181,7 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw board line
|
-- Draw board line
|
||||||
gc.setLineWidth(.8)
|
gc.setLineWidth(.8)
|
||||||
for x=0,9 do
|
for x=0,9 do
|
||||||
gc.setColor(1,1,1,x%3==0 and 1 or .3)
|
gc.setColor(1,1,1,x%3==0 and 1 or .3)
|
||||||
@@ -189,7 +189,7 @@ function scene.draw()
|
|||||||
gc.line(0,10*x,90,10*x)
|
gc.line(0,10*x,90,10*x)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw last pos
|
-- Draw last pos
|
||||||
if lastX then
|
if lastX then
|
||||||
gc.setColor(.5,1,.4,.8)
|
gc.setColor(.5,1,.4,.8)
|
||||||
local r=.5+.5*math.sin(TIME()*6.26)
|
local r=.5+.5*math.sin(TIME()*6.26)
|
||||||
@@ -198,7 +198,7 @@ function scene.draw()
|
|||||||
gc.pop()
|
gc.pop()
|
||||||
|
|
||||||
if gameover then
|
if gameover then
|
||||||
--Draw result
|
-- Draw result
|
||||||
FONT.set(60)
|
FONT.set(60)
|
||||||
if gameover==0 then
|
if gameover==0 then
|
||||||
gc.setColor(1,.6,.6)
|
gc.setColor(1,.6,.6)
|
||||||
@@ -211,7 +211,7 @@ function scene.draw()
|
|||||||
GC.mStr("TIE",1140,240)
|
GC.mStr("TIE",1140,240)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
--Draw current round mark
|
-- Draw current round mark
|
||||||
gc.setColor(COLOR.X)
|
gc.setColor(COLOR.X)
|
||||||
gc.rectangle('fill',80,80,160,160)
|
gc.rectangle('fill',80,80,160,160)
|
||||||
gc.setColor(COLOR.Z)
|
gc.setColor(COLOR.Z)
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ local keySounds={
|
|||||||
|
|
||||||
local scene={}
|
local scene={}
|
||||||
|
|
||||||
local reg--register
|
local reg-- register
|
||||||
local val--result value
|
local val-- result value
|
||||||
local sym--symbol
|
local sym-- symbol
|
||||||
|
|
||||||
local function _autoReturn()
|
local function _autoReturn()
|
||||||
if reg and sym then
|
if reg and sym then
|
||||||
|
|||||||
@@ -75,24 +75,24 @@ function scene.update()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local scoreColor={
|
local scoreColor={
|
||||||
'Z',--0
|
'Z',-- 0
|
||||||
'A',--20
|
'A',-- 20
|
||||||
'N',--40
|
'N',-- 40
|
||||||
'B',--60
|
'B',-- 60
|
||||||
'P',--80
|
'P',-- 80
|
||||||
'W',--100
|
'W',-- 100
|
||||||
'R','F','O','Y','lA',--200
|
'R','F','O','Y','lA',-- 200
|
||||||
'lN','lB','lP','lW','lR',--300
|
'lN','lB','lP','lW','lR',-- 300
|
||||||
'lF','lO','lY','dA','dN',--400
|
'lF','lO','lY','dA','dN',-- 400
|
||||||
'dB','dP','dW','dR','dF',--500
|
'dB','dP','dW','dR','dF',-- 500
|
||||||
'dY','lH','H','dH',--before 600, black after
|
'dY','lH','H','dH',-- before 600, black after
|
||||||
}
|
}
|
||||||
function scene.draw()
|
function scene.draw()
|
||||||
--Spawn area
|
-- Spawn area
|
||||||
gc.setColor(1,1,1,.2)
|
gc.setColor(1,1,1,.2)
|
||||||
gc.rectangle('fill',85,0,190,720)
|
gc.rectangle('fill',85,0,190,720)
|
||||||
|
|
||||||
--Power & Angle
|
-- Power & Angle
|
||||||
gc.setColor(COLOR.Z)
|
gc.setColor(COLOR.Z)
|
||||||
if state~=2 then
|
if state~=2 then
|
||||||
gc.setLineWidth(2)
|
gc.setLineWidth(2)
|
||||||
@@ -104,7 +104,7 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Info
|
-- Info
|
||||||
FONT.set(40)
|
FONT.set(40)
|
||||||
if combo>1 then
|
if combo>1 then
|
||||||
gc.setColor(1,1,.6)
|
gc.setColor(1,1,.6)
|
||||||
@@ -113,15 +113,15 @@ function scene.draw()
|
|||||||
gc.setColor(COLOR[scoreColor[int(score/20)+1] or 'D'])
|
gc.setColor(COLOR[scoreColor[int(score/20)+1] or 'D'])
|
||||||
gc.print(score,300,30)
|
gc.print(score,300,30)
|
||||||
|
|
||||||
--Cannon ball
|
-- Cannon ball
|
||||||
gc.circle('fill',x,y,15)
|
gc.circle('fill',x,y,15)
|
||||||
|
|
||||||
--Arrow
|
-- Arrow
|
||||||
if y<-15 then
|
if y<-15 then
|
||||||
gc.print("↑",x-20.5,0)
|
gc.print("↑",x-20.5,0)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Target
|
-- Target
|
||||||
gc.setColor(1,1,.4)
|
gc.setColor(1,1,.4)
|
||||||
gc.circle('fill',ex,ey,15)
|
gc.circle('fill',ex,ey,15)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -27,13 +27,13 @@ local commands={} do
|
|||||||
details: an array of strings containing documents, shows when user types 'help [command]'.
|
details: an array of strings containing documents, shows when user types 'help [command]'.
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local cmdList={}--List of all non-alias commands
|
local cmdList={}-- List of all non-alias commands
|
||||||
|
|
||||||
--Basic
|
-- Basic
|
||||||
commands.help={
|
commands.help={
|
||||||
code=function(arg)
|
code=function(arg)
|
||||||
if #arg>0 then
|
if #arg>0 then
|
||||||
--help [command]
|
-- help [command]
|
||||||
if commands[arg] then
|
if commands[arg] then
|
||||||
if commands[arg].description then
|
if commands[arg].description then
|
||||||
log{C.H,("%s"):format(commands[arg].description)}
|
log{C.H,("%s"):format(commands[arg].description)}
|
||||||
@@ -47,7 +47,7 @@ local commands={} do
|
|||||||
log{C.Y,("No command called '%s'"):format(arg)}
|
log{C.Y,("No command called '%s'"):format(arg)}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
--help
|
-- help
|
||||||
for i=1,#cmdList do
|
for i=1,#cmdList do
|
||||||
local cmd=cmdList[i]
|
local cmd=cmdList[i]
|
||||||
local body=commands[cmd]
|
local body=commands[cmd]
|
||||||
@@ -111,8 +111,8 @@ local commands={} do
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
--File
|
-- File
|
||||||
do--tree
|
do-- tree
|
||||||
local function tree(path,name,depth)
|
local function tree(path,name,depth)
|
||||||
local info=love.filesystem.getInfo(path..name)
|
local info=love.filesystem.getInfo(path..name)
|
||||||
if info.type=='file' then
|
if info.type=='file' then
|
||||||
@@ -144,7 +144,7 @@ local commands={} do
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
do--del
|
do-- del
|
||||||
local function delFile(name)
|
local function delFile(name)
|
||||||
if love.filesystem.remove(name) then
|
if love.filesystem.remove(name) then
|
||||||
log{C.Y,("Deleted: '%s'"):format(name)}
|
log{C.Y,("Deleted: '%s'"):format(name)}
|
||||||
@@ -231,7 +231,7 @@ local commands={} do
|
|||||||
end
|
end
|
||||||
commands.mv={
|
commands.mv={
|
||||||
code=function(arg)
|
code=function(arg)
|
||||||
--Check arguments
|
-- Check arguments
|
||||||
arg=arg:split(" ")
|
arg=arg:split(" ")
|
||||||
if #arg>2 then
|
if #arg>2 then
|
||||||
log{C.lY,"Warning: file names must have no spaces"}
|
log{C.lY,"Warning: file names must have no spaces"}
|
||||||
@@ -241,7 +241,7 @@ local commands={} do
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
--Check file exist
|
-- Check file exist
|
||||||
local info
|
local info
|
||||||
info=love.filesystem.getInfo(arg[1])
|
info=love.filesystem.getInfo(arg[1])
|
||||||
if not (info and info.type=='file') then
|
if not (info and info.type=='file') then
|
||||||
@@ -254,21 +254,21 @@ local commands={} do
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
--Read file
|
-- Read file
|
||||||
local data,err1=love.filesystem.read('data',arg[1])
|
local data,err1=love.filesystem.read('data',arg[1])
|
||||||
if not data then
|
if not data then
|
||||||
log{C.R,("Failed to read file '%s': "):format(arg[1],err1 or "Unknown error")}
|
log{C.R,("Failed to read file '%s': "):format(arg[1],err1 or "Unknown error")}
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
--Write file
|
-- Write file
|
||||||
local res,err2=love.filesystem.write(arg[2],data)
|
local res,err2=love.filesystem.write(arg[2],data)
|
||||||
if not res then
|
if not res then
|
||||||
log{C.R,("Failed to write file: "):format(err2 or "Unknown error")}
|
log{C.R,("Failed to write file: "):format(err2 or "Unknown error")}
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
--Delete file
|
-- Delete file
|
||||||
if not love.filesystem.remove(arg[1]) then
|
if not love.filesystem.remove(arg[1]) then
|
||||||
log{C.R,("Failed to delete old file ''"):format(arg[1])}
|
log{C.R,("Failed to delete old file ''"):format(arg[1])}
|
||||||
return
|
return
|
||||||
@@ -315,7 +315,7 @@ local commands={} do
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
--System
|
-- System
|
||||||
commands.crash={
|
commands.crash={
|
||||||
code=function() error("ERROR") end,
|
code=function() error("ERROR") end,
|
||||||
description="Manually crash the game",
|
description="Manually crash the game",
|
||||||
@@ -545,7 +545,7 @@ local commands={} do
|
|||||||
"Usage: support",
|
"Usage: support",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
do--app
|
do-- app
|
||||||
local APPs={
|
local APPs={
|
||||||
{
|
{
|
||||||
code="calc",
|
code="calc",
|
||||||
@@ -754,7 +754,7 @@ local commands={} do
|
|||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
--Game
|
-- Game
|
||||||
commands.rmconf={
|
commands.rmconf={
|
||||||
code=function(key)
|
code=function(key)
|
||||||
if #key>0 then
|
if #key>0 then
|
||||||
@@ -869,7 +869,7 @@ local commands={} do
|
|||||||
description="Show a random tip",
|
description="Show a random tip",
|
||||||
}
|
}
|
||||||
|
|
||||||
--Network
|
-- Network
|
||||||
commands.switchhost={
|
commands.switchhost={
|
||||||
code=function(arg)
|
code=function(arg)
|
||||||
arg=arg:split(" ")
|
arg=arg:split(" ")
|
||||||
@@ -944,7 +944,7 @@ local combKey={
|
|||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
--Environment for user's function
|
-- Environment for user's function
|
||||||
local userG={
|
local userG={
|
||||||
timer=TIME,
|
timer=TIME,
|
||||||
|
|
||||||
@@ -992,7 +992,7 @@ setmetatable(userG.package,dangerousLibMeta)
|
|||||||
setmetatable(userG.io,dangerousLibMeta)
|
setmetatable(userG.io,dangerousLibMeta)
|
||||||
setmetatable(userG.os,dangerousLibMeta)
|
setmetatable(userG.os,dangerousLibMeta)
|
||||||
|
|
||||||
--Puzzle box
|
-- Puzzle box
|
||||||
local first_key={}
|
local first_key={}
|
||||||
local fleg={
|
local fleg={
|
||||||
pw=the_secret,
|
pw=the_secret,
|
||||||
@@ -1028,16 +1028,16 @@ function scene.keyDown(key)
|
|||||||
local input=STRING.trim(inputBox:getText())
|
local input=STRING.trim(inputBox:getText())
|
||||||
if input=="" then return end
|
if input=="" then return end
|
||||||
|
|
||||||
--Write History
|
-- Write History
|
||||||
ins(history,input)
|
ins(history,input)
|
||||||
if history[27] then
|
if history[27] then
|
||||||
rem(history,1)
|
rem(history,1)
|
||||||
end
|
end
|
||||||
hisPtr=nil
|
hisPtr=nil
|
||||||
|
|
||||||
--Execute
|
-- Execute
|
||||||
if input:byte()==35 then
|
if input:byte()==35 then
|
||||||
--Execute lua code
|
-- Execute lua code
|
||||||
log{C.lC,"> "..input}
|
log{C.lC,"> "..input}
|
||||||
local code,err=loadstring(input:sub(2))
|
local code,err=loadstring(input:sub(2))
|
||||||
if code then
|
if code then
|
||||||
@@ -1062,7 +1062,7 @@ function scene.keyDown(key)
|
|||||||
log{C.R,"[SyntaxErr] ",C.R,err}
|
log{C.R,"[SyntaxErr] ",C.R,err}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
--Execute builtin command
|
-- Execute builtin command
|
||||||
log{C.lS,"> "..input}
|
log{C.lS,"> "..input}
|
||||||
local p=input:find(" ")
|
local p=input:find(" ")
|
||||||
local cmd,arg
|
local cmd,arg
|
||||||
@@ -1081,7 +1081,7 @@ function scene.keyDown(key)
|
|||||||
end
|
end
|
||||||
inputBox:clear()
|
inputBox:clear()
|
||||||
|
|
||||||
--Insert empty line
|
-- Insert empty line
|
||||||
log""
|
log""
|
||||||
elseif key=='up' then
|
elseif key=='up' then
|
||||||
if not hisPtr then
|
if not hisPtr then
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ function scene.update(dt)
|
|||||||
if dt>.06 then dt=.06 end
|
if dt>.06 then dt=.06 end
|
||||||
dt=dt*600
|
dt=dt*600
|
||||||
|
|
||||||
--Update cubes' position
|
-- Update cubes' position
|
||||||
local cy=cubesY
|
local cy=cubesY
|
||||||
local step=speed*dt*.005
|
local step=speed*dt*.005
|
||||||
for i=1,40 do
|
for i=1,40 do
|
||||||
@@ -141,7 +141,7 @@ function scene.update(dt)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Collision detect
|
-- Collision detect
|
||||||
if play then
|
if play then
|
||||||
for j=1,40 do
|
for j=1,40 do
|
||||||
local i=(j+lastCube-2)%40+1
|
local i=(j+lastCube-2)%40+1
|
||||||
@@ -159,7 +159,7 @@ function scene.update(dt)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Screen rotation
|
-- Screen rotation
|
||||||
if moveDir~=0 then
|
if moveDir~=0 then
|
||||||
player=player+moveDir*dt*.003*speed^.8
|
player=player+moveDir*dt*.003*speed^.8
|
||||||
if abs(rot)<.16 or moveDir*rot>0 then
|
if abs(rot)<.16 or moveDir*rot>0 then
|
||||||
@@ -220,42 +220,42 @@ local function _sunStencil()
|
|||||||
gc.rectangle('fill',-60,-440,120,120)
|
gc.rectangle('fill',-60,-440,120,120)
|
||||||
end
|
end
|
||||||
function scene.draw()
|
function scene.draw()
|
||||||
--Health bar
|
-- Health bar
|
||||||
if life1>0 then
|
if life1>0 then
|
||||||
gc.setColor(1,0,0)
|
gc.setColor(1,0,0)
|
||||||
gc.rectangle('fill',640-life1*.64,710,life1*1.28,10)
|
gc.rectangle('fill',640-life1*.64,710,life1*1.28,10)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw player
|
-- Draw player
|
||||||
if play and inv%8<4 then
|
if play and inv%8<4 then
|
||||||
gc.setColor(COLOR.Z)
|
gc.setColor(COLOR.Z)
|
||||||
gc.rectangle('fill',620,670,40,40)
|
gc.rectangle('fill',620,670,40,40)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Set screen rotation
|
-- Set screen rotation
|
||||||
gc.push('transform')
|
gc.push('transform')
|
||||||
gc.translate(640,690)
|
gc.translate(640,690)
|
||||||
gc.rotate(rot)
|
gc.rotate(rot)
|
||||||
|
|
||||||
--Draw sun
|
-- Draw sun
|
||||||
gc.setStencilTest('notequal',1)
|
gc.setStencilTest('notequal',1)
|
||||||
gc.stencil(_sunStencil)
|
gc.stencil(_sunStencil)
|
||||||
gc.setColor(.7,.5,.3)
|
gc.setColor(.7,.5,.3)
|
||||||
gc.circle('fill',0,-380-sunH,60)
|
gc.circle('fill',0,-380-sunH,60)
|
||||||
gc.setStencilTest()
|
gc.setStencilTest()
|
||||||
|
|
||||||
--Draw direction
|
-- Draw direction
|
||||||
if play then
|
if play then
|
||||||
gc.setLineWidth(3)
|
gc.setLineWidth(3)
|
||||||
gc.setColor(1,1,1,.1)
|
gc.setColor(1,1,1,.1)
|
||||||
gc.polygon('fill',-15,30,0,-440,15,30)
|
gc.polygon('fill',-15,30,0,-440,15,30)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw Horizon/Direction
|
-- Draw Horizon/Direction
|
||||||
gc.setColor(COLOR.Z)
|
gc.setColor(COLOR.Z)
|
||||||
gc.line(-942,-440,942,-440)
|
gc.line(-942,-440,942,-440)
|
||||||
|
|
||||||
--Draw cubes
|
-- Draw cubes
|
||||||
for j=1,40 do
|
for j=1,40 do
|
||||||
local i=(j+lastCube-2)%40+1
|
local i=(j+lastCube-2)%40+1
|
||||||
local Y=cubesY[i]
|
local Y=cubesY[i]
|
||||||
@@ -273,7 +273,7 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw menu
|
-- Draw menu
|
||||||
if play then
|
if play then
|
||||||
setFont(60)
|
setFont(60)
|
||||||
mStr(int(score),-300,-640)
|
mStr(int(score),-300,-640)
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ local gc=love.graphics
|
|||||||
local rnd,int,max=math.random,math.floor,math.max
|
local rnd,int,max=math.random,math.floor,math.max
|
||||||
local setFont,mStr=FONT.set,GC.mStr
|
local setFont,mStr=FONT.set,GC.mStr
|
||||||
|
|
||||||
--This mini-game is written for TI-nSpire CX CAS many years ago.
|
-- This mini-game is written for TI-nSpire CX CAS many years ago.
|
||||||
--Deliberately, some grammar mistakes and typos in the 'great' list remained.
|
-- Deliberately, some grammar mistakes and typos in the 'great' list remained.
|
||||||
--So no need to correct them.
|
-- So no need to correct them.
|
||||||
|
|
||||||
local perfect={"Perfect!","Excellent!","Nice!","Good!","Great!","Just!","300"}
|
local perfect={"Perfect!","Excellent!","Nice!","Good!","Great!","Just!","300"}
|
||||||
local great={"Pay attention!","Be carefully!","Teacher behind you!","Feel tired?","You are in danger!","Do your homework!","A good game!","Minecraft!","y=ax^2+bx+c!","No music?","Internet unavailable.","It's raining!","Too hard!","Shorter?","Higher!","English messages!","Hi!","^_^","Drop!","Colorful!",":)","100$","~~~wave~~~","★★★","中文!","NOW!!!!!","Also try the TEN!","I'm a programer!","Also try minesweeperZ!","This si Dropper!","Hold your calculatoor!","Look! UFO!","Bonjour!","[string]","Author:MrZ","Boom!","PvZ!","China!","TI-nspire!","I love LUA!"}
|
local great={"Pay attention!","Be carefully!","Teacher behind you!","Feel tired?","You are in danger!","Do your homework!","A good game!","Minecraft!","y=ax^2+bx+c!","No music?","Internet unavailable.","It's raining!","Too hard!","Shorter?","Higher!","English messages!","Hi!","^_^","Drop!","Colorful!",":)","100$","~~~wave~~~","★★★","中文!","NOW!!!!!","Also try the TEN!","I'm a programer!","Also try minesweeperZ!","This si Dropper!","Hold your calculatoor!","Look! UFO!","Bonjour!","[string]","Author:MrZ","Boom!","PvZ!","China!","TI-nspire!","I love LUA!"}
|
||||||
@@ -175,7 +175,7 @@ backColor.__index=function(t,lv)
|
|||||||
end
|
end
|
||||||
setmetatable(backColor,backColor)
|
setmetatable(backColor,backColor)
|
||||||
function scene.draw()
|
function scene.draw()
|
||||||
--Background
|
-- Background
|
||||||
local lv,height=int(camY/700),camY%700
|
local lv,height=int(camY/700),camY%700
|
||||||
gc.setColor(backColor[lv+1] or COLOR.D)
|
gc.setColor(backColor[lv+1] or COLOR.D)
|
||||||
gc.rectangle('fill',0,720,1280,height-700)
|
gc.rectangle('fill',0,720,1280,height-700)
|
||||||
@@ -205,7 +205,7 @@ function scene.draw()
|
|||||||
gc.print("Ported / Rewritten / Balanced by MrZ",740,260)
|
gc.print("Ported / Rewritten / Balanced by MrZ",740,260)
|
||||||
end
|
end
|
||||||
if state~='menu' then
|
if state~='menu' then
|
||||||
--High floor
|
-- High floor
|
||||||
gc.setColor(COLOR.Z)
|
gc.setColor(COLOR.Z)
|
||||||
gc.setLineWidth(2)
|
gc.setLineWidth(2)
|
||||||
local y=690+camY-30*highFloor
|
local y=690+camY-30*highFloor
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ local keyTime
|
|||||||
local speed,maxSpeed
|
local speed,maxSpeed
|
||||||
local arcade,rollSpeed
|
local arcade,rollSpeed
|
||||||
|
|
||||||
local reset=error--function, defined later
|
local reset=error-- function, defined later
|
||||||
|
|
||||||
local bgm="secret7th"
|
local bgm="secret7th"
|
||||||
local tileColor="black"
|
local tileColor="black"
|
||||||
@@ -134,37 +134,37 @@ local generator={
|
|||||||
Singlestream=function()
|
Singlestream=function()
|
||||||
ins(pos,get1(pos[#pos] or 0))
|
ins(pos,get1(pos[#pos] or 0))
|
||||||
end,
|
end,
|
||||||
Light_Jumpstream=function()--2111
|
Light_Jumpstream=function()-- 2111
|
||||||
ins(pos,get2(pos[#pos] or 0))
|
ins(pos,get2(pos[#pos] or 0))
|
||||||
ins(pos,get1(pos[#pos]))
|
ins(pos,get1(pos[#pos]))
|
||||||
ins(pos,get1(pos[#pos]))
|
ins(pos,get1(pos[#pos]))
|
||||||
ins(pos,get1(pos[#pos]))
|
ins(pos,get1(pos[#pos]))
|
||||||
end,
|
end,
|
||||||
Dense_Jumpstream=function()--2121
|
Dense_Jumpstream=function()-- 2121
|
||||||
ins(pos,get2(pos[#pos] or 0))
|
ins(pos,get2(pos[#pos] or 0))
|
||||||
ins(pos,get1(pos[#pos]))
|
ins(pos,get1(pos[#pos]))
|
||||||
ins(pos,get2(pos[#pos]))
|
ins(pos,get2(pos[#pos]))
|
||||||
ins(pos,get1(pos[#pos]))
|
ins(pos,get1(pos[#pos]))
|
||||||
end,
|
end,
|
||||||
Light_Handstream=function()--3111
|
Light_Handstream=function()-- 3111
|
||||||
ins(pos,get3(pos[#pos] or 0))
|
ins(pos,get3(pos[#pos] or 0))
|
||||||
ins(pos,get1(pos[#pos]))
|
ins(pos,get1(pos[#pos]))
|
||||||
ins(pos,get1(pos[#pos]))
|
ins(pos,get1(pos[#pos]))
|
||||||
ins(pos,get1(pos[#pos]))
|
ins(pos,get1(pos[#pos]))
|
||||||
end,
|
end,
|
||||||
Dense_Handstream=function()--3121
|
Dense_Handstream=function()-- 3121
|
||||||
ins(pos,get3(pos[#pos] or 0))
|
ins(pos,get3(pos[#pos] or 0))
|
||||||
ins(pos,get1(pos[#pos]))
|
ins(pos,get1(pos[#pos]))
|
||||||
ins(pos,get2(pos[#pos]))
|
ins(pos,get2(pos[#pos]))
|
||||||
ins(pos,get1(pos[#pos]))
|
ins(pos,get1(pos[#pos]))
|
||||||
end,
|
end,
|
||||||
Light_Quadstream=function()--4111
|
Light_Quadstream=function()-- 4111
|
||||||
ins(pos,1234)
|
ins(pos,1234)
|
||||||
ins(pos,get1(pos[#pos-1] or 0))
|
ins(pos,get1(pos[#pos-1] or 0))
|
||||||
ins(pos,get1(pos[#pos]))
|
ins(pos,get1(pos[#pos]))
|
||||||
ins(pos,get1(pos[#pos]))
|
ins(pos,get1(pos[#pos]))
|
||||||
end,
|
end,
|
||||||
Quadstream=function()--4121
|
Quadstream=function()-- 4121
|
||||||
ins(pos,1234)
|
ins(pos,1234)
|
||||||
ins(pos,get1(pos[#pos-1] or 0))
|
ins(pos,get1(pos[#pos-1] or 0))
|
||||||
ins(pos,get2(pos[#pos]))
|
ins(pos,get2(pos[#pos]))
|
||||||
@@ -306,36 +306,36 @@ local function boardStencil() gc.rectangle('fill',300,0,680,720) end
|
|||||||
function scene.draw()
|
function scene.draw()
|
||||||
setFont(50)
|
setFont(50)
|
||||||
if arcade then
|
if arcade then
|
||||||
--Draw rolling speed
|
-- Draw rolling speed
|
||||||
mStr(("%.2f/s"):format(rollSpeed/2),155,490)
|
mStr(("%.2f/s"):format(rollSpeed/2),155,490)
|
||||||
else
|
else
|
||||||
--Draw speed
|
-- Draw speed
|
||||||
setFont(45)
|
setFont(45)
|
||||||
gc.setColor(1,.6,.6)
|
gc.setColor(1,.6,.6)
|
||||||
mStr(("%.2f"):format(maxSpeed/60),155,460)
|
mStr(("%.2f"):format(maxSpeed/60),155,460)
|
||||||
gc.setColor(COLOR.Z)
|
gc.setColor(COLOR.Z)
|
||||||
mStr(("%.2f"):format(speed/60),155,520)
|
mStr(("%.2f"):format(speed/60),155,520)
|
||||||
|
|
||||||
--Progress time list
|
-- Progress time list
|
||||||
setFont(30)
|
setFont(30)
|
||||||
gc.setColor(.6,.6,.6)
|
gc.setColor(.6,.6,.6)
|
||||||
for i=1,#progress do
|
for i=1,#progress do
|
||||||
gc.print(progress[i],1030,120+25*i)
|
gc.print(progress[i],1030,120+25*i)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw time
|
-- Draw time
|
||||||
gc.setColor(COLOR.Z)
|
gc.setColor(COLOR.Z)
|
||||||
setFont(45)
|
setFont(45)
|
||||||
gc.print(("%.3f"):format(time),1030,70)
|
gc.print(("%.3f"):format(time),1030,70)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw mode
|
-- Draw mode
|
||||||
if state~=0 then
|
if state~=0 then
|
||||||
gc.setColor(COLOR.Z)
|
gc.setColor(COLOR.Z)
|
||||||
setFont(30)mStr(mode,155,212)
|
setFont(30)mStr(mode,155,212)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw tiles
|
-- Draw tiles
|
||||||
gc.stencil(boardStencil)
|
gc.stencil(boardStencil)
|
||||||
gc.setStencilTest('equal',1)
|
gc.setStencilTest('equal',1)
|
||||||
gc.rectangle('fill',300,0,680,720)
|
gc.rectangle('fill',300,0,680,720)
|
||||||
@@ -351,7 +351,7 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
gc.pop()
|
gc.pop()
|
||||||
gc.setStencilTest()
|
gc.setStencilTest()
|
||||||
--Draw track line
|
-- Draw track line
|
||||||
gc.setColor(COLOR.D)
|
gc.setColor(COLOR.D)
|
||||||
gc.setLineWidth(2)
|
gc.setLineWidth(2)
|
||||||
for x=1,5 do
|
for x=1,5 do
|
||||||
@@ -363,13 +363,13 @@ function scene.draw()
|
|||||||
gc.line(300,y,980,y)
|
gc.line(300,y,980,y)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw red tile
|
-- Draw red tile
|
||||||
if diePos then
|
if diePos then
|
||||||
gc.setColor(1,.2,.2)
|
gc.setColor(1,.2,.2)
|
||||||
gc.rectangle('fill',130+170*diePos+8,600-height+8,170-16,120-16)
|
gc.rectangle('fill',130+170*diePos+8,600-height+8,170-16,120-16)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw score
|
-- Draw score
|
||||||
setFont(100)
|
setFont(100)
|
||||||
gc.push('transform')
|
gc.push('transform')
|
||||||
gc.translate(640,26)
|
gc.translate(640,26)
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ local function resetBoard()
|
|||||||
local colors=levels[level].color
|
local colors=levels[level].color
|
||||||
field.c,field.r=levels[level].c,levels[level].r
|
field.c,field.r=levels[level].c,levels[level].r
|
||||||
|
|
||||||
local total=field.r*field.c/2--Total cell count
|
local total=field.r*field.c/2-- Total cell count
|
||||||
local pool=TABLE.new(int(total/colors),colors)
|
local pool=TABLE.new(int(total/colors),colors)
|
||||||
for i=1,total%colors do pool[i]=pool[i]+1 end
|
for i=1,total%colors do pool[i]=pool[i]+1 end
|
||||||
for i=1,#pool do pool[i]=pool[i]*2 end
|
for i=1,#pool do pool[i]=pool[i]*2 end
|
||||||
@@ -117,7 +117,7 @@ local function addPoint(list,x,y)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
local function checkLink(x1,y1,x2,y2)
|
local function checkLink(x1,y1,x2,y2)
|
||||||
--Y-X-Y Check
|
-- Y-X-Y Check
|
||||||
local bestLen,bestLine=1e99,false
|
local bestLen,bestLine=1e99,false
|
||||||
do
|
do
|
||||||
if x1>x2 then x1,y1,x2,y2=x2,y2,x1,y1 end
|
if x1>x2 then x1,y1,x2,y2=x2,y2,x1,y1 end
|
||||||
@@ -141,7 +141,7 @@ local function checkLink(x1,y1,x2,y2)
|
|||||||
::CONTINUE_nextRow::
|
::CONTINUE_nextRow::
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--X-Y-X Check
|
-- X-Y-X Check
|
||||||
do
|
do
|
||||||
if y1>y2 then x1,y1,x2,y2=x2,y2,x1,y1 end
|
if y1>y2 then x1,y1,x2,y2=x2,y2,x1,y1 end
|
||||||
local ulx,urx,dlx,drx=x1,x1,x2,x2
|
local ulx,urx,dlx,drx=x1,x1,x2,x2
|
||||||
@@ -177,18 +177,18 @@ local function tap(x,y)
|
|||||||
if line then
|
if line then
|
||||||
ins(lines,{time=0,line=line})
|
ins(lines,{time=0,line=line})
|
||||||
|
|
||||||
--Clear
|
-- Clear
|
||||||
field[y][x]=false
|
field[y][x]=false
|
||||||
field[selY][selX]=false
|
field[selY][selX]=false
|
||||||
field.remain=field.remain-1
|
field.remain=field.remain-1
|
||||||
field.full=false
|
field.full=false
|
||||||
|
|
||||||
--Score
|
-- Score
|
||||||
local s=1000+int(combo^.9)
|
local s=1000+int(combo^.9)
|
||||||
score=score+s
|
score=score+s
|
||||||
TEXT.show("+"..s,1205,600,20,'score')
|
TEXT.show("+"..s,1205,600,20,'score')
|
||||||
|
|
||||||
--Combo
|
-- Combo
|
||||||
if comboTime==0 then
|
if comboTime==0 then
|
||||||
combo=0
|
combo=0
|
||||||
noComboBreak=false
|
noComboBreak=false
|
||||||
@@ -197,7 +197,7 @@ local function tap(x,y)
|
|||||||
combo=combo+1
|
combo=combo+1
|
||||||
if combo>maxCombo then maxCombo=combo end
|
if combo>maxCombo then maxCombo=combo end
|
||||||
|
|
||||||
--Check win
|
-- Check win
|
||||||
if field.remain==0 then
|
if field.remain==0 then
|
||||||
if noComboBreak then
|
if noComboBreak then
|
||||||
SFX.play('emit')
|
SFX.play('emit')
|
||||||
@@ -295,15 +295,15 @@ end
|
|||||||
|
|
||||||
function scene.draw()
|
function scene.draw()
|
||||||
gc.push('transform')
|
gc.push('transform')
|
||||||
--Camera
|
-- Camera
|
||||||
gc.translate(field.x,field.y)
|
gc.translate(field.x,field.y)
|
||||||
gc.scale(field.w/field.c,field.h/field.r)
|
gc.scale(field.w/field.c,field.h/field.r)
|
||||||
|
|
||||||
--Background
|
-- Background
|
||||||
gc.setColor(COLOR.dX)
|
gc.setColor(COLOR.dX)
|
||||||
gc.rectangle('fill',0,0,field.w,field.h)
|
gc.rectangle('fill',0,0,field.w,field.h)
|
||||||
|
|
||||||
--Matrix
|
-- Matrix
|
||||||
local mono=state==0 or invis and not field.full
|
local mono=state==0 or invis and not field.full
|
||||||
if mono then
|
if mono then
|
||||||
gc_setColor(COLOR.dH)
|
gc_setColor(COLOR.dH)
|
||||||
@@ -328,51 +328,51 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Selecting box
|
-- Selecting box
|
||||||
gc.setLineWidth(.1)
|
gc.setLineWidth(.1)
|
||||||
if selX then
|
if selX then
|
||||||
gc_setColor(1,1,1)
|
gc_setColor(1,1,1)
|
||||||
gc_rectangle('line',selX-1+.05,selY-1+.05,.9,.9)
|
gc_rectangle('line',selX-1+.05,selY-1+.05,.9,.9)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Clearing lines
|
-- Clearing lines
|
||||||
gc.translate(-.5,-.5)
|
gc.translate(-.5,-.5)
|
||||||
for i=1,#lines do
|
for i=1,#lines do
|
||||||
gc_setColor(1,1,1,1-lines[i].time)
|
gc_setColor(1,1,1,1-lines[i].time)
|
||||||
gc.line(lines[i].line)
|
gc.line(lines[i].line)
|
||||||
end
|
end
|
||||||
gc.pop()
|
gc.pop()
|
||||||
--Frame
|
-- Frame
|
||||||
|
|
||||||
if state==2 then
|
if state==2 then
|
||||||
gc.setColor(.9,.9,0)--win
|
gc.setColor(.9,.9,0)-- win
|
||||||
elseif state==1 then
|
elseif state==1 then
|
||||||
gc.setColor(.9,.9,.9)--game
|
gc.setColor(.9,.9,.9)-- game
|
||||||
elseif state==0 then
|
elseif state==0 then
|
||||||
gc.setColor(.2,.8,.2)--ready
|
gc.setColor(.2,.8,.2)-- ready
|
||||||
end
|
end
|
||||||
gc.setLineWidth(6)
|
gc.setLineWidth(6)
|
||||||
gc.rectangle('line',field.x-5,field.y-5,field.w+10,field.h+10)
|
gc.rectangle('line',field.x-5,field.y-5,field.w+10,field.h+10)
|
||||||
|
|
||||||
--Draw no-setting area
|
-- Draw no-setting area
|
||||||
if state==2 then
|
if state==2 then
|
||||||
gc.setColor(1,0,0,.3)
|
gc.setColor(1,0,0,.3)
|
||||||
gc.rectangle('fill',0,100,155,80)
|
gc.rectangle('fill',0,100,155,80)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Maxcombo
|
-- Maxcombo
|
||||||
setFont(20)gc.setColor(COLOR.dF)
|
setFont(20)gc.setColor(COLOR.dF)
|
||||||
gc.print(maxCombo,1142,1)
|
gc.print(maxCombo,1142,1)
|
||||||
|
|
||||||
--Time
|
-- Time
|
||||||
setFont(30)gc.setColor(COLOR.Z)
|
setFont(30)gc.setColor(COLOR.Z)
|
||||||
gc.print(("%.3f"):format(time),1140,20)
|
gc.print(("%.3f"):format(time),1140,20)
|
||||||
|
|
||||||
--Progress time list
|
-- Progress time list
|
||||||
setFont(15)gc.setColor(.6,.6,.6)
|
setFont(15)gc.setColor(.6,.6,.6)
|
||||||
for i=1,#progress do gc.print(progress[i],1140,40+20*i) end
|
for i=1,#progress do gc.print(progress[i],1140,40+20*i) end
|
||||||
|
|
||||||
--Combo Rectangle
|
-- Combo Rectangle
|
||||||
if comboTime>0 then
|
if comboTime>0 then
|
||||||
local r=32*comboTime^.3
|
local r=32*comboTime^.3
|
||||||
gc.setColor(1,1,1,min(.6+comboTime,1)*.25)
|
gc.setColor(1,1,1,min(.6+comboTime,1)*.25)
|
||||||
@@ -382,7 +382,7 @@ function scene.draw()
|
|||||||
gc.rectangle('line',1205-r,440-r,2*r,2*r,4)
|
gc.rectangle('line',1205-r,440-r,2*r,2*r,4)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Combo Text
|
-- Combo Text
|
||||||
setFont(60)
|
setFont(60)
|
||||||
if combo>50 then
|
if combo>50 then
|
||||||
gc.setColor(1,.2,.2,min(.3+comboTime*.5,1)*min(comboTime,1))
|
gc.setColor(1,.2,.2,min(.3+comboTime*.5,1)*min(comboTime,1))
|
||||||
@@ -391,7 +391,7 @@ function scene.draw()
|
|||||||
gc.setColor(1,1,max(1-combo*.001,.5),min(.4+comboTime,1))
|
gc.setColor(1,1,max(1-combo*.001,.5),min(.4+comboTime,1))
|
||||||
mStr(combo,1205,398)
|
mStr(combo,1205,398)
|
||||||
|
|
||||||
--Score
|
-- Score
|
||||||
setFont(25)gc.setColor(COLOR.Z)
|
setFont(25)gc.setColor(COLOR.Z)
|
||||||
mStr(score1,1205,560)
|
mStr(score1,1205,560)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
|
|
||||||
local state--0=playing, 1=gameover
|
local state-- 0=playing, 1=gameover
|
||||||
local timeUsed
|
local timeUsed
|
||||||
local level
|
local level
|
||||||
local showNum
|
local showNum
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ function scene.sceneInit()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function scene.touchDown(x,y,k)
|
function scene.touchDown(x,y,k)
|
||||||
--TODO
|
-- TODO
|
||||||
end
|
end
|
||||||
scene.mouseDown=scene.touchDown
|
scene.mouseDown=scene.touchDown
|
||||||
|
|
||||||
|
|||||||
@@ -49,11 +49,11 @@ function scene.keyDown(key,isRep)
|
|||||||
SCN.back()
|
SCN.back()
|
||||||
end
|
end
|
||||||
elseif key=='space' then
|
elseif key=='space' then
|
||||||
if state==0 then--main
|
if state==0 then-- main
|
||||||
if timer==0 then
|
if timer==0 then
|
||||||
state=1
|
state=1
|
||||||
end
|
end
|
||||||
elseif state==3 then--play
|
elseif state==3 then-- play
|
||||||
local c=(math.floor((pos-ang)*side/tau)-1)%side+1
|
local c=(math.floor((pos-ang)*side/tau)-1)%side+1
|
||||||
if hit[c]==0 then
|
if hit[c]==0 then
|
||||||
hit[c]=1
|
hit[c]=1
|
||||||
@@ -87,12 +87,12 @@ function scene.touchDown()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function scene.update()
|
function scene.update()
|
||||||
if state==0 then--main
|
if state==0 then-- main
|
||||||
ang=ang-.02
|
ang=ang-.02
|
||||||
if ang>0 then ang=ang-tau end
|
if ang>0 then ang=ang-tau end
|
||||||
if pos<ang then pos=pos+tau end
|
if pos<ang then pos=pos+tau end
|
||||||
if timer>0 then timer=timer-1 end
|
if timer>0 then timer=timer-1 end
|
||||||
elseif state==1 or state==2 then--zoom
|
elseif state==1 or state==2 then-- zoom
|
||||||
ang=ang+.02+timer/260
|
ang=ang+.02+timer/260
|
||||||
pos=pos-.016
|
pos=pos-.016
|
||||||
if ang>0 then ang=ang-tau end
|
if ang>0 then ang=ang-tau end
|
||||||
@@ -115,7 +115,7 @@ function scene.update()
|
|||||||
state=3
|
state=3
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif state==3 then--play
|
elseif state==3 then-- play
|
||||||
ang=ang+.02
|
ang=ang+.02
|
||||||
pos=pos-.016
|
pos=pos-.016
|
||||||
if ang>0 then
|
if ang>0 then
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ local rnd=math.random
|
|||||||
local scene={}
|
local scene={}
|
||||||
|
|
||||||
local state
|
local state
|
||||||
local bx,by=640,360--Ball posotion
|
local bx,by=640,360-- Ball posotion
|
||||||
local vx,vy=0,0--Ball velocity
|
local vx,vy=0,0-- Ball velocity
|
||||||
local ry=0--Rotation Y
|
local ry=0-- Rotation Y
|
||||||
|
|
||||||
local p1,p2--Player data
|
local p1,p2-- Player data
|
||||||
|
|
||||||
function scene.sceneInit()
|
function scene.sceneInit()
|
||||||
BG.set('none')
|
BG.set('none')
|
||||||
@@ -70,9 +70,9 @@ end
|
|||||||
function scene.touchMove(x,y)(x<640 and p1 or p2).y0=y end
|
function scene.touchMove(x,y)(x<640 and p1 or p2).y0=y end
|
||||||
function scene.mouseMove(x,y)(x<640 and p1 or p2).y0=y end
|
function scene.mouseMove(x,y)(x<640 and p1 or p2).y0=y end
|
||||||
|
|
||||||
--Rect Area X:150~1130 Y:20~700
|
-- Rect Area X:150~1130 Y:20~700
|
||||||
function scene.update()
|
function scene.update()
|
||||||
--Update pads
|
-- Update pads
|
||||||
local P=p1
|
local P=p1
|
||||||
while P do
|
while P do
|
||||||
if P.y0 then
|
if P.y0 then
|
||||||
@@ -105,7 +105,7 @@ function scene.update()
|
|||||||
P=P==p1 and p2
|
P=P==p1 and p2
|
||||||
end
|
end
|
||||||
|
|
||||||
--Update ball
|
-- Update ball
|
||||||
bx,by=bx+vx,by+vy
|
bx,by=bx+vx,by+vy
|
||||||
if ry~=0 then
|
if ry~=0 then
|
||||||
if ry>0 then
|
if ry>0 then
|
||||||
@@ -116,7 +116,7 @@ function scene.update()
|
|||||||
vy=vy+.1
|
vy=vy+.1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if state==1 then--Playing
|
if state==1 then-- Playing
|
||||||
if bx<160 or bx>1120 then
|
if bx<160 or bx>1120 then
|
||||||
P=bx<160 and p1 or p2
|
P=bx<160 and p1 or p2
|
||||||
local d=by-P.y
|
local d=by-P.y
|
||||||
@@ -134,7 +134,7 @@ function scene.update()
|
|||||||
vy,ry=-vy,-ry
|
vy,ry=-vy,-ry
|
||||||
SFX.play('collect')
|
SFX.play('collect')
|
||||||
end
|
end
|
||||||
elseif state==2 then--Game over
|
elseif state==2 then-- Game over
|
||||||
if bx<-120 or bx>1400 or by<-40 or by>760 then
|
if bx<-120 or bx>1400 or by<-40 or by>760 then
|
||||||
P=bx>640 and p1 or p2
|
P=bx>640 and p1 or p2
|
||||||
P.score=P.score+1
|
P.score=P.score+1
|
||||||
@@ -150,25 +150,25 @@ function scene.update()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function scene.draw()
|
function scene.draw()
|
||||||
--Draw score
|
-- Draw score
|
||||||
gc.setColor(.4,.4,.4)
|
gc.setColor(.4,.4,.4)
|
||||||
FONT.set(100)
|
FONT.set(100)
|
||||||
GC.mStr(p1.score,470,20)
|
GC.mStr(p1.score,470,20)
|
||||||
GC.mStr(p2.score,810,20)
|
GC.mStr(p2.score,810,20)
|
||||||
|
|
||||||
--Draw boundary
|
-- Draw boundary
|
||||||
gc.setColor(COLOR.Z)
|
gc.setColor(COLOR.Z)
|
||||||
gc.setLineWidth(4)
|
gc.setLineWidth(4)
|
||||||
gc.line(134,20,1146,20)
|
gc.line(134,20,1146,20)
|
||||||
gc.line(134,700,1146,700)
|
gc.line(134,700,1146,700)
|
||||||
|
|
||||||
--Draw ball & speed line
|
-- Draw ball & speed line
|
||||||
gc.setColor(1,1,1-abs(ry)*.16)
|
gc.setColor(1,1,1-abs(ry)*.16)
|
||||||
gc.circle('fill',bx,by,10)
|
gc.circle('fill',bx,by,10)
|
||||||
gc.setColor(1,1,1,.1)
|
gc.setColor(1,1,1,.1)
|
||||||
gc.line(bx+vx*22,by+vy*22,bx+vx*30,by+vy*30)
|
gc.line(bx+vx*22,by+vy*22,bx+vx*30,by+vy*30)
|
||||||
|
|
||||||
--Draw pads
|
-- Draw pads
|
||||||
gc.setColor(1,.8,.8)
|
gc.setColor(1,.8,.8)
|
||||||
gc.rectangle('fill',134,p1.y-50,16,100)
|
gc.rectangle('fill',134,p1.y-50,16,100)
|
||||||
gc.setColor(.8,.8,1)
|
gc.setColor(.8,.8,1)
|
||||||
|
|||||||
@@ -31,12 +31,12 @@ function scene.keyDown(key,isRep)
|
|||||||
elseif state==2 and #key==1 then
|
elseif state==2 and #key==1 then
|
||||||
key=("qapl"):find(key,nil,true)
|
key=("qapl"):find(key,nil,true)
|
||||||
if key then
|
if key then
|
||||||
--BEAUTIFUL LOGIC BELOW:
|
-- BEAUTIFUL LOGIC BELOW:
|
||||||
|
|
||||||
--early = error, [UP-key]==[target is up] = correct sfx, else = wrong sfx
|
-- early = error, [UP-key]==[target is up] = correct sfx, else = wrong sfx
|
||||||
SFX.play(ct>6 and 'finesseError' or key%2==1==up and 'reach' or 'fail')
|
SFX.play(ct>6 and 'finesseError' or key%2==1==up and 'reach' or 'fail')
|
||||||
|
|
||||||
--(early && P2-key || not early && [P1-key]==[target is up]) = P1 win, else P2 win
|
-- (early && P2-key || not early && [P1-key]==[target is up]) = P1 win, else P2 win
|
||||||
if ct>6 and key>2 or ct<=6 and key%4<2==up then
|
if ct>6 and key>2 or ct<=6 and key%4<2==up then
|
||||||
winner=1; s1=s1+1
|
winner=1; s1=s1+1
|
||||||
else
|
else
|
||||||
@@ -56,20 +56,20 @@ function scene.touchDown(x,y)
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
function scene.update()
|
function scene.update()
|
||||||
if state==0 then--Menu
|
if state==0 then-- Menu
|
||||||
if ct>0 then
|
if ct>0 then
|
||||||
ct=ct-1
|
ct=ct-1
|
||||||
elseif rnd()<.00626 then
|
elseif rnd()<.00626 then
|
||||||
ct=30
|
ct=30
|
||||||
end
|
end
|
||||||
elseif state==1 then--Waiting
|
elseif state==1 then-- Waiting
|
||||||
ct=ct-1
|
ct=ct-1
|
||||||
if ct==0 then
|
if ct==0 then
|
||||||
ct=rnd(26,162)
|
ct=rnd(26,162)
|
||||||
up=rnd()<.5
|
up=rnd()<.5
|
||||||
state=2
|
state=2
|
||||||
end
|
end
|
||||||
elseif state==2 then--Winking
|
elseif state==2 then-- Winking
|
||||||
ct=ct-1
|
ct=ct-1
|
||||||
if ct==0 then ct=6 end
|
if ct==0 then ct=6 end
|
||||||
elseif state==3 then
|
elseif state==3 then
|
||||||
@@ -85,21 +85,21 @@ function scene.update()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function scene.draw()
|
function scene.draw()
|
||||||
--Dividing line
|
-- Dividing line
|
||||||
gc.setLineWidth(10)
|
gc.setLineWidth(10)
|
||||||
gc.setColor(1,1,1,.9)
|
gc.setColor(1,1,1,.9)
|
||||||
gc.line(640,0,640,720)
|
gc.line(640,0,640,720)
|
||||||
gc.setColor(1,1,1,.3)
|
gc.setColor(1,1,1,.3)
|
||||||
gc.line(500,360,780,360)
|
gc.line(500,360,780,360)
|
||||||
|
|
||||||
--Help
|
-- Help
|
||||||
setFont(100)
|
setFont(100)
|
||||||
mStr("Q",80,100)
|
mStr("Q",80,100)
|
||||||
mStr("A",80,480)
|
mStr("A",80,480)
|
||||||
mStr("P",1200,100)
|
mStr("P",1200,100)
|
||||||
mStr("L",1200,480)
|
mStr("L",1200,480)
|
||||||
|
|
||||||
--Score
|
-- Score
|
||||||
setFont(80)
|
setFont(80)
|
||||||
gc.printf(s1,50,300,200)
|
gc.printf(s1,50,300,200)
|
||||||
gc.printf(s2,1030,300,200,'right')
|
gc.printf(s2,1030,300,200,'right')
|
||||||
|
|||||||
@@ -128,16 +128,16 @@ function scene.draw()
|
|||||||
gc.setColor(COLOR.dX)
|
gc.setColor(COLOR.dX)
|
||||||
gc.rectangle('fill',310,30,660,660)
|
gc.rectangle('fill',310,30,660,660)
|
||||||
if state==2 then
|
if state==2 then
|
||||||
gc.setColor(.9,.9,0)--win
|
gc.setColor(.9,.9,0)-- win
|
||||||
elseif state==1 then
|
elseif state==1 then
|
||||||
gc.setColor(.9,.9,.9)--game
|
gc.setColor(.9,.9,.9)-- game
|
||||||
elseif state==0 then
|
elseif state==0 then
|
||||||
gc.setColor(.2,.8,.2)--ready
|
gc.setColor(.2,.8,.2)-- ready
|
||||||
end
|
end
|
||||||
gc.setLineWidth(10)
|
gc.setLineWidth(10)
|
||||||
gc.rectangle('line',310,30,660,660)
|
gc.rectangle('line',310,30,660,660)
|
||||||
|
|
||||||
--Draw no-setting area
|
-- Draw no-setting area
|
||||||
if state==2 then
|
if state==2 then
|
||||||
gc.setColor(1,0,0,.3)
|
gc.setColor(1,0,0,.3)
|
||||||
gc.rectangle('fill',15,295,285,250)
|
gc.rectangle('fill',15,295,285,250)
|
||||||
|
|||||||
@@ -232,14 +232,14 @@ function scene.draw()
|
|||||||
gc.print(("%.3f"):format(time),1026,50)
|
gc.print(("%.3f"):format(time),1026,50)
|
||||||
gc.print(score,1026,100)
|
gc.print(score,1026,100)
|
||||||
|
|
||||||
--Progress time list
|
-- Progress time list
|
||||||
setFont(25)
|
setFont(25)
|
||||||
setColor(.7,.7,.7)
|
setColor(.7,.7,.7)
|
||||||
for i=1,#progress do
|
for i=1,#progress do
|
||||||
gc.print(progress[i],1000,140+30*i)
|
gc.print(progress[i],1000,140+30*i)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Previews
|
-- Previews
|
||||||
if nexts then
|
if nexts then
|
||||||
gc.setColor(COLOR.dX)
|
gc.setColor(COLOR.dX)
|
||||||
rectangle('fill',20,450,280,75)
|
rectangle('fill',20,450,280,75)
|
||||||
@@ -254,7 +254,7 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if state==2 then
|
if state==2 then
|
||||||
--Draw no-setting area
|
-- Draw no-setting area
|
||||||
setColor(1,0,0,.3)
|
setColor(1,0,0,.3)
|
||||||
rectangle('fill',15,200,285,210)
|
rectangle('fill',15,200,285,210)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,20 +7,20 @@ local ins,rem=table.insert,table.remove
|
|||||||
local setFont,mStr=FONT.set,GC.mStr
|
local setFont,mStr=FONT.set,GC.mStr
|
||||||
|
|
||||||
local tileColor={
|
local tileColor={
|
||||||
[-2]=COLOR.R, --Bomb
|
[-2]=COLOR.R, -- Bomb
|
||||||
[-1]=COLOR.H, --Stone
|
[-1]=COLOR.H, -- Stone
|
||||||
{.39, 1.0, .39},--Tile 1
|
{.39, 1.0, .39},-- Tile 1
|
||||||
{.39, .39, 1.0},--Tile 2
|
{.39, .39, 1.0},-- Tile 2
|
||||||
{1.0, .70, .31},--Tile 3
|
{1.0, .70, .31},-- Tile 3
|
||||||
{.94, .31, .31},--Tile 4
|
{.94, .31, .31},-- Tile 4
|
||||||
{.00, .71, .12},--Tile 5
|
{.00, .71, .12},-- Tile 5
|
||||||
{.90, .20, .90},--Tile 6
|
{.90, .20, .90},-- Tile 6
|
||||||
{.94, .47, .39},--Tile 7
|
{.94, .47, .39},-- Tile 7
|
||||||
{.90, .00, .00},--Tile 8
|
{.90, .00, .00},-- Tile 8
|
||||||
{.86, .86, .31},--Tile 9
|
{.86, .86, .31},-- Tile 9
|
||||||
{.78, .31, .00},--Tile 10
|
{.78, .31, .00},-- Tile 10
|
||||||
{.78, .55, .04},--Tile 11
|
{.78, .55, .04},-- Tile 11
|
||||||
{.12, .12, .51},--Tile 12
|
{.12, .12, .51},-- Tile 12
|
||||||
}
|
}
|
||||||
local textColor={
|
local textColor={
|
||||||
[-2]=COLOR.dR,
|
[-2]=COLOR.dR,
|
||||||
@@ -222,29 +222,29 @@ function player:drawBoard()
|
|||||||
gc.push('transform')
|
gc.push('transform')
|
||||||
gc.translate(self.x,self.y)
|
gc.translate(self.x,self.y)
|
||||||
|
|
||||||
--Board background
|
-- Board background
|
||||||
setColor(COLOR.dX)
|
setColor(COLOR.dX)
|
||||||
rectangle("fill",0,0,600,600)
|
rectangle("fill",0,0,600,600)
|
||||||
|
|
||||||
|
|
||||||
--Hold slot
|
-- Hold slot
|
||||||
setColor(0,1,1,.4)
|
setColor(0,1,1,.4)
|
||||||
rectangle("fill",0,0,100,100)
|
rectangle("fill",0,0,100,100)
|
||||||
gc.setLineWidth(10)
|
gc.setLineWidth(10)
|
||||||
setColor(COLOR.lC)
|
setColor(COLOR.lC)
|
||||||
rectangle("line",5,5,90,90)
|
rectangle("line",5,5,90,90)
|
||||||
|
|
||||||
--Hold tile
|
-- Hold tile
|
||||||
setFont(60)
|
setFont(60)
|
||||||
drawTile(1,1,self.hold)
|
drawTile(1,1,self.hold)
|
||||||
|
|
||||||
--Board tiles
|
-- Board tiles
|
||||||
local b=self.board
|
local b=self.board
|
||||||
for y=1,6 do for x=1,6 do
|
for y=1,6 do for x=1,6 do
|
||||||
drawTile(x,y,b[y][x])
|
drawTile(x,y,b[y][x])
|
||||||
end end
|
end end
|
||||||
|
|
||||||
--Board lines
|
-- Board lines
|
||||||
setColor(COLOR.Z)
|
setColor(COLOR.Z)
|
||||||
gc.setLineWidth(2)
|
gc.setLineWidth(2)
|
||||||
for x=1,5 do gc.line(x*100,0,x*100,600) end
|
for x=1,5 do gc.line(x*100,0,x*100,600) end
|
||||||
@@ -252,7 +252,7 @@ function player:drawBoard()
|
|||||||
gc.setLineWidth(6)
|
gc.setLineWidth(6)
|
||||||
rectangle("line",0,0,600,600)
|
rectangle("line",0,0,600,600)
|
||||||
|
|
||||||
--Select box
|
-- Select box
|
||||||
if self.selectX then
|
if self.selectX then
|
||||||
local c=tileColor[self.nexts[1]]
|
local c=tileColor[self.nexts[1]]
|
||||||
setColor(c[1],c[2],c[3],.6+.3*math.sin(TIME()*9.29))
|
setColor(c[1],c[2],c[3],.6+.3*math.sin(TIME()*9.29))
|
||||||
@@ -325,7 +325,7 @@ function scene.draw()
|
|||||||
gc.print(("%.3f"):format(player.time),1026,50)
|
gc.print(("%.3f"):format(player.time),1026,50)
|
||||||
gc.print(player.score,1026,100)
|
gc.print(player.score,1026,100)
|
||||||
|
|
||||||
--Progress time list
|
-- Progress time list
|
||||||
setFont(25)
|
setFont(25)
|
||||||
setColor(.7,.7,.7)
|
setColor(.7,.7,.7)
|
||||||
for i=1,#player.progress do
|
for i=1,#player.progress do
|
||||||
|
|||||||
@@ -127,13 +127,13 @@ function scene.draw()
|
|||||||
gc.translate(0,-WIDGET.scrollPos)
|
gc.translate(0,-WIDGET.scrollPos)
|
||||||
setFont(30)
|
setFont(30)
|
||||||
|
|
||||||
--Sequence
|
-- Sequence
|
||||||
if #MISSION>0 then
|
if #MISSION>0 then
|
||||||
gc.setColor(1,CUSTOMENV.missionKill and 0 or 1,int(TIME()*6.26)%2)
|
gc.setColor(1,CUSTOMENV.missionKill and 0 or 1,int(TIME()*6.26)%2)
|
||||||
gc.print("#"..#MISSION,70,220)
|
gc.print("#"..#MISSION,70,220)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Field content
|
-- Field content
|
||||||
if #FIELD[1]>0 then
|
if #FIELD[1]>0 then
|
||||||
gc.push('transform')
|
gc.push('transform')
|
||||||
gc.translate(330,240)
|
gc.translate(330,240)
|
||||||
@@ -159,7 +159,7 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Sequence
|
-- Sequence
|
||||||
if #BAG>0 then
|
if #BAG>0 then
|
||||||
gc.setColor(1,1,int(TIME()*6.26)%2)
|
gc.setColor(1,1,int(TIME()*6.26)%2)
|
||||||
gc.print("#"..#BAG,615,220)
|
gc.print("#"..#BAG,615,220)
|
||||||
@@ -178,7 +178,7 @@ scene.widgetList={
|
|||||||
WIDGET.newKey{name='reset', x=1110,y=90,w=230,h=90,color='R',code=pressKey'delete'},
|
WIDGET.newKey{name='reset', x=1110,y=90,w=230,h=90,color='R',code=pressKey'delete'},
|
||||||
WIDGET.newKey{name='mod', x=1110,y=200,w=230,h=90,color='Z',code=pressKey'f1'},
|
WIDGET.newKey{name='mod', x=1110,y=200,w=230,h=90,color='Z',code=pressKey'f1'},
|
||||||
|
|
||||||
--Mission / Field / Sequence
|
-- Mission / Field / Sequence
|
||||||
WIDGET.newKey{name='mission', x=170,y=180,w=240,h=80,color='N',font=25,code=pressKey'm'},
|
WIDGET.newKey{name='mission', x=170,y=180,w=240,h=80,color='N',font=25,code=pressKey'm'},
|
||||||
WIDGET.newKey{name='field', x=450,y=180,w=240,h=80,color='A',font=25,code=pressKey'f'},
|
WIDGET.newKey{name='field', x=450,y=180,w=240,h=80,color='A',font=25,code=pressKey'f'},
|
||||||
WIDGET.newKey{name='sequence', x=730,y=180,w=240,h=80,color='W',font=25,code=pressKey's'},
|
WIDGET.newKey{name='sequence', x=730,y=180,w=240,h=80,color='W',font=25,code=pressKey's'},
|
||||||
@@ -186,7 +186,7 @@ scene.widgetList={
|
|||||||
WIDGET.newText{name='noMsn', x=50, y=220,align='L',color='H',hideF=function() return MISSION[1] end},
|
WIDGET.newText{name='noMsn', x=50, y=220,align='L',color='H',hideF=function() return MISSION[1] end},
|
||||||
WIDGET.newText{name='defSeq', x=610,y=220,align='L',color='H',hideF=function() return BAG[1] end},
|
WIDGET.newText{name='defSeq', x=610,y=220,align='L',color='H',hideF=function() return BAG[1] end},
|
||||||
|
|
||||||
--Selectors
|
-- Selectors
|
||||||
WIDGET.newSelector{name='opponent', x=170,y=330,w=260,color='R',list=sList.opponent, disp=CUSval('opponent'), code=CUSsto('opponent')},
|
WIDGET.newSelector{name='opponent', x=170,y=330,w=260,color='R',list=sList.opponent, disp=CUSval('opponent'), code=CUSsto('opponent')},
|
||||||
WIDGET.newSelector{name='life', x=170,y=410,w=260,color='R',list=sList.life, disp=CUSval('life'), code=CUSsto('life')},
|
WIDGET.newSelector{name='life', x=170,y=410,w=260,color='R',list=sList.life, disp=CUSval('life'), code=CUSsto('life')},
|
||||||
WIDGET.newSelector{name='pushSpeed', x=170,y=520,w=260,color='V',list=sList.pushSpeed, disp=CUSval('pushSpeed'), code=CUSsto('pushSpeed')},
|
WIDGET.newSelector{name='pushSpeed', x=170,y=520,w=260,color='V',list=sList.pushSpeed, disp=CUSval('pushSpeed'), code=CUSsto('pushSpeed')},
|
||||||
@@ -205,17 +205,17 @@ scene.widgetList={
|
|||||||
WIDGET.newSelector{name='hurry', x=730,y=680,w=260,color='G',list=sList.hurry,disp=CUSval('hurry'),code=CUSsto('hurry')},
|
WIDGET.newSelector{name='hurry', x=730,y=680,w=260,color='G',list=sList.hurry,disp=CUSval('hurry'),code=CUSsto('hurry')},
|
||||||
WIDGET.newSelector{name='hang', x=730,y=760,w=260,color='G',list=sList.hang,disp=CUSval('hang'),code=CUSsto('hang')},
|
WIDGET.newSelector{name='hang', x=730,y=760,w=260,color='G',list=sList.hang,disp=CUSval('hang'),code=CUSsto('hang')},
|
||||||
|
|
||||||
--Copy / Paste / Start
|
-- Copy / Paste / Start
|
||||||
WIDGET.newButton{name='copy', x=1070,y=300,w=310,h=70,color='lR',font=25,code=pressKey'cC'},
|
WIDGET.newButton{name='copy', x=1070,y=300,w=310,h=70,color='lR',font=25,code=pressKey'cC'},
|
||||||
WIDGET.newButton{name='paste', x=1070,y=380,w=310,h=70,color='lB',font=25,code=pressKey'cV'},
|
WIDGET.newButton{name='paste', x=1070,y=380,w=310,h=70,color='lB',font=25,code=pressKey'cV'},
|
||||||
WIDGET.newButton{name='play_clear', x=1070,y=460,w=310,h=70,color='lY',font=35,code=pressKey'play1'},
|
WIDGET.newButton{name='play_clear', x=1070,y=460,w=310,h=70,color='lY',font=35,code=pressKey'play1'},
|
||||||
WIDGET.newButton{name='play_puzzle', x=1070,y=540,w=310,h=70,color='lM',font=35,code=pressKey'play2',hideF=function() return #FIELD[1]==0 end},
|
WIDGET.newButton{name='play_puzzle', x=1070,y=540,w=310,h=70,color='lM',font=35,code=pressKey'play2',hideF=function() return #FIELD[1]==0 end},
|
||||||
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=pressKey'escape'},
|
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=pressKey'escape'},
|
||||||
|
|
||||||
--Rule set
|
-- Rule set
|
||||||
WIDGET.newSelector{name='eventSet', x=1050,y=760,w=340,color='H',list=sList.eventSet,disp=CUSval('eventSet'),code=CUSsto('eventSet')},
|
WIDGET.newSelector{name='eventSet', x=1050,y=760,w=340,color='H',list=sList.eventSet,disp=CUSval('eventSet'),code=CUSsto('eventSet')},
|
||||||
|
|
||||||
--Special rules
|
-- Special rules
|
||||||
WIDGET.newSwitch{name='ospin', x=850, y=830, lim=210,disp=CUSval('ospin'), code=CUSrev('ospin')},
|
WIDGET.newSwitch{name='ospin', x=850, y=830, lim=210,disp=CUSval('ospin'), code=CUSrev('ospin')},
|
||||||
WIDGET.newSwitch{name='fineKill', x=850, y=890, lim=210,disp=CUSval('fineKill'), code=CUSrev('fineKill')},
|
WIDGET.newSwitch{name='fineKill', x=850, y=890, lim=210,disp=CUSval('fineKill'), code=CUSrev('fineKill')},
|
||||||
WIDGET.newSwitch{name='b2bKill', x=850, y=950, lim=210,disp=CUSval('b2bKill'), code=CUSrev('b2bKill')},
|
WIDGET.newSwitch{name='b2bKill', x=850, y=950, lim=210,disp=CUSval('b2bKill'), code=CUSrev('b2bKill')},
|
||||||
@@ -224,14 +224,14 @@ scene.widgetList={
|
|||||||
WIDGET.newSwitch{name='deepDrop', x=1170,y=890, lim=250,disp=CUSval('deepDrop'), code=CUSrev('deepDrop')},
|
WIDGET.newSwitch{name='deepDrop', x=1170,y=890, lim=250,disp=CUSval('deepDrop'), code=CUSrev('deepDrop')},
|
||||||
WIDGET.newSwitch{name='bone', x=1170,y=950, lim=250,disp=CUSval('bone'), code=CUSrev('bone')},
|
WIDGET.newSwitch{name='bone', x=1170,y=950, lim=250,disp=CUSval('bone'), code=CUSrev('bone')},
|
||||||
|
|
||||||
--Next & Hold
|
-- Next & Hold
|
||||||
WIDGET.newSelector{name='holdMode', x=310, y=890, w=300,color='lY',list=sList.holdMode,disp=CUSval('holdMode'),code=CUSsto('holdMode'),hideF=function() return CUSTOMENV.holdCount==0 end},
|
WIDGET.newSelector{name='holdMode', x=310, y=890, w=300,color='lY',list=sList.holdMode,disp=CUSval('holdMode'),code=CUSsto('holdMode'),hideF=function() return CUSTOMENV.holdCount==0 end},
|
||||||
WIDGET.newSlider{name='nextCount', x=140, y=960, lim=130,w=180,axis={0,6,1},disp=CUSval('nextCount'),code=CUSsto('nextCount')},
|
WIDGET.newSlider{name='nextCount', x=140, y=960, lim=130,w=180,axis={0,6,1},disp=CUSval('nextCount'),code=CUSsto('nextCount')},
|
||||||
WIDGET.newSlider{name='holdCount', x=140, y=1030,lim=130,w=180,axis={0,6,1},disp=CUSval('holdCount'),code=CUSsto('holdCount')},
|
WIDGET.newSlider{name='holdCount', x=140, y=1030,lim=130,w=180,axis={0,6,1},disp=CUSval('holdCount'),code=CUSsto('holdCount')},
|
||||||
WIDGET.newSwitch{name='infHold', x=560, y=960, lim=200, disp=CUSval('infHold'),code=CUSrev('infHold'),hideF=function() return CUSTOMENV.holdCount==0 end},
|
WIDGET.newSwitch{name='infHold', x=560, y=960, lim=200, disp=CUSval('infHold'),code=CUSrev('infHold'),hideF=function() return CUSTOMENV.holdCount==0 end},
|
||||||
WIDGET.newSwitch{name='phyHold', x=560, y=1030,lim=200, disp=CUSval('phyHold'),code=CUSrev('phyHold'),hideF=function() return CUSTOMENV.holdCount==0 end},
|
WIDGET.newSwitch{name='phyHold', x=560, y=1030,lim=200, disp=CUSval('phyHold'),code=CUSrev('phyHold'),hideF=function() return CUSTOMENV.holdCount==0 end},
|
||||||
|
|
||||||
--BG & BGM
|
-- BG & BGM
|
||||||
WIDGET.newSelector{name='bg', x=840, y=1090,w=250,color='Y',list=BG.getList(),disp=CUSval('bg'),code=function(i) CUSTOMENV.bg=i BG.set(i) end},
|
WIDGET.newSelector{name='bg', x=840, y=1090,w=250,color='Y',list=BG.getList(),disp=CUSval('bg'),code=function(i) CUSTOMENV.bg=i BG.set(i) end},
|
||||||
WIDGET.newSelector{name='bgm', x=1120,y=1090,w=250,color='Y',list=BGM.getList(),disp=CUSval('bgm'),code=function(i) CUSTOMENV.bgm=i BGM.play(i) end},
|
WIDGET.newSelector{name='bgm', x=1120,y=1090,w=250,color='Y',list=BGM.getList(),disp=CUSval('bgm'),code=function(i) CUSTOMENV.bgm=i BGM.play(i) end},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ local FIELD=FIELD
|
|||||||
local scene={}
|
local scene={}
|
||||||
|
|
||||||
local curPen
|
local curPen
|
||||||
local pens={-2,0,-1,[false]=false}--Color (air/smart)
|
local pens={-2,0,-1,[false]=false}-- Color (air/smart)
|
||||||
local penMode
|
local penMode
|
||||||
local penPath={}
|
local penPath={}
|
||||||
local penX,penY
|
local penX,penY
|
||||||
local demo--If show x
|
local demo-- If show x
|
||||||
local page
|
local page
|
||||||
|
|
||||||
local function isEmpty(L)
|
local function isEmpty(L)
|
||||||
@@ -28,35 +28,35 @@ local penKey={
|
|||||||
z=0,x=-1,c=-2,
|
z=0,x=-1,c=-2,
|
||||||
}
|
}
|
||||||
local minoPosCode={
|
local minoPosCode={
|
||||||
[102]=1,[1121]=1,--Z
|
[102]=1,[1121]=1,-- Z
|
||||||
[195]=2,[610]=2,--S
|
[195]=2,[610]=2,-- S
|
||||||
[39]=3,[1569]=3,[228]=3,[1091]=3,--J
|
[39]=3,[1569]=3,[228]=3,[1091]=3,-- J
|
||||||
[135]=4,[547]=4,[225]=4,[1602]=4,--L
|
[135]=4,[547]=4,[225]=4,[1602]=4,-- L
|
||||||
[71]=5,[609]=5,[226]=5,[1122]=5,--T
|
[71]=5,[609]=5,[226]=5,[1122]=5,-- T
|
||||||
[99]=6,--O
|
[99]=6,-- O
|
||||||
[15]=7,[4641]=7,--I
|
[15]=7,[4641]=7,-- I
|
||||||
[1606]=8,[2273]=8,--Z5
|
[1606]=8,[2273]=8,-- Z5
|
||||||
[3139]=9,[740]=9,--S5
|
[3139]=9,[740]=9,-- S5
|
||||||
[103]=10,[1633]=10,[230]=10,[1123]=10,--P
|
[103]=10,[1633]=10,[230]=10,[1123]=10,-- P
|
||||||
[199]=11,[611]=11,[227]=11,[1634]=11,--Q
|
[199]=11,[611]=11,[227]=11,[1634]=11,-- Q
|
||||||
[738]=12,[3170]=12,[1252]=12,[1219]=12,--F
|
[738]=12,[3170]=12,[1252]=12,[1219]=12,-- F
|
||||||
[2274]=13,[1126]=13,[1249]=13,[1730]=13,--E
|
[2274]=13,[1126]=13,[1249]=13,[1730]=13,-- E
|
||||||
[1095]=14,[737]=14,[3650]=14,[2276]=14,--T5
|
[1095]=14,[737]=14,[3650]=14,[2276]=14,-- T5
|
||||||
[167]=15,[1571]=15,[229]=15,[1603]=15,--U
|
[167]=15,[1571]=15,[229]=15,[1603]=15,-- U
|
||||||
[2183]=16,[551]=16,[3617]=16,[3716]=16,--V
|
[2183]=16,[551]=16,[3617]=16,[3716]=16,-- V
|
||||||
[614]=17,[3169]=17,[1732]=17,[2243]=17,--W
|
[614]=17,[3169]=17,[1732]=17,[2243]=17,-- W
|
||||||
[1250]=18,--X
|
[1250]=18,-- X
|
||||||
[47]=19,[12833]=19,[488]=19,[9283]=19,--J5
|
[47]=19,[12833]=19,[488]=19,[9283]=19,-- J5
|
||||||
[271]=20,[4643]=20,[481]=20,[13378]=20,--L5
|
[271]=20,[4643]=20,[481]=20,[13378]=20,-- L5
|
||||||
[79]=21,[5665]=21,[484]=21,[9314]=21,--R
|
[79]=21,[5665]=21,[484]=21,[9314]=21,-- R
|
||||||
[143]=22,[4705]=22,[482]=22,[9794]=22,--Y
|
[143]=22,[4705]=22,[482]=22,[9794]=22,-- Y
|
||||||
[110]=23,[9761]=23,[236]=23,[9313]=23,--N
|
[110]=23,[9761]=23,[236]=23,[9313]=23,-- N
|
||||||
[391]=24,[4706]=24,[451]=24,[5698]=24,--H
|
[391]=24,[4706]=24,[451]=24,[5698]=24,-- H
|
||||||
[31]=25,[21025]=25,--I5
|
[31]=25,[21025]=25,-- I5
|
||||||
[7]=26,[545]=26,--I3
|
[7]=26,[545]=26,-- I3
|
||||||
[67]=27,[35]=27,[97]=27,[98]=27,--C
|
[67]=27,[35]=27,[97]=27,[98]=27,-- C
|
||||||
[3]=28,[33]=28,--I2
|
[3]=28,[33]=28,-- I2
|
||||||
[1]=29,--O1
|
[1]=29,-- O1
|
||||||
}
|
}
|
||||||
local function _pTouch(x,y)
|
local function _pTouch(x,y)
|
||||||
if not curPen then return end
|
if not curPen then return end
|
||||||
@@ -78,7 +78,7 @@ local function _pDraw()
|
|||||||
local l=#penPath
|
local l=#penPath
|
||||||
if l==0 then return end
|
if l==0 then return end
|
||||||
|
|
||||||
local C--Color
|
local C-- Color
|
||||||
if penMode==0 then
|
if penMode==0 then
|
||||||
if pens[curPen]==-2 then
|
if pens[curPen]==-2 then
|
||||||
if l<=5 then
|
if l<=5 then
|
||||||
@@ -227,7 +227,7 @@ function scene.keyDown(key)
|
|||||||
MES.new('check',text.exportSuccess)
|
MES.new('check',text.exportSuccess)
|
||||||
elseif key=='v' and kb.isDown('lctrl','rctrl') or key=='cV' then
|
elseif key=='v' and kb.isDown('lctrl','rctrl') or key=='cV' then
|
||||||
local str=sys.getClipboardText()
|
local str=sys.getClipboardText()
|
||||||
local p=str:find(":")--ptr*
|
local p=str:find(":")-- ptr*
|
||||||
if p then
|
if p then
|
||||||
if not str:sub(1,p-1):find("Field") then
|
if not str:sub(1,p-1):find("Field") then
|
||||||
MES.new('error',text.pasteWrongPlace)
|
MES.new('error',text.pasteWrongPlace)
|
||||||
@@ -264,13 +264,13 @@ end
|
|||||||
function scene.draw()
|
function scene.draw()
|
||||||
gc.translate(200,60)
|
gc.translate(200,60)
|
||||||
|
|
||||||
--Draw grid
|
-- Draw grid
|
||||||
gc.setColor(1,1,1,.2)
|
gc.setColor(1,1,1,.2)
|
||||||
gc.setLineWidth(1)
|
gc.setLineWidth(1)
|
||||||
for x=1,9 do gc.line(30*x,0,30*x,600) end
|
for x=1,9 do gc.line(30*x,0,30*x,600) end
|
||||||
for y=0,19 do gc.line(0,30*y,300,30*y) end
|
for y=0,19 do gc.line(0,30*y,300,30*y) end
|
||||||
|
|
||||||
--Draw field
|
-- Draw field
|
||||||
gc.setColor(COLOR.Z)
|
gc.setColor(COLOR.Z)
|
||||||
gc.setLineWidth(2)
|
gc.setLineWidth(2)
|
||||||
gc.rectangle('line',-2,-2,304,604,5)
|
gc.rectangle('line',-2,-2,304,604,5)
|
||||||
@@ -287,7 +287,7 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
end end
|
end end
|
||||||
|
|
||||||
--Draw pen
|
-- Draw pen
|
||||||
if penX and penY then
|
if penX and penY then
|
||||||
local x,y=30*penX,600-30*penY
|
local x,y=30*penX,600-30*penY
|
||||||
if curPen==1 or curPen==2 then
|
if curPen==1 or curPen==2 then
|
||||||
@@ -305,7 +305,7 @@ function scene.draw()
|
|||||||
gc.rectangle('fill',x-30,y,30,30,3)
|
gc.rectangle('fill',x-30,y,30,30,3)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw smart pen path
|
-- Draw smart pen path
|
||||||
if #penPath>0 then
|
if #penPath>0 then
|
||||||
gc.setLineWidth(4)
|
gc.setLineWidth(4)
|
||||||
if penMode==0 then
|
if penMode==0 then
|
||||||
@@ -344,23 +344,23 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
gc.translate(-200,-60)
|
gc.translate(-200,-60)
|
||||||
|
|
||||||
--Draw page
|
-- Draw page
|
||||||
setFont(55)
|
setFont(55)
|
||||||
gc.setColor(COLOR.Z)
|
gc.setColor(COLOR.Z)
|
||||||
GC.mStr(page,100,530)
|
GC.mStr(page,100,530)
|
||||||
GC.mStr(#FIELD,100,600)
|
GC.mStr(#FIELD,100,600)
|
||||||
gc.rectangle('fill',50,600,100,6)
|
gc.rectangle('fill',50,600,100,6)
|
||||||
|
|
||||||
--Draw mouse & pen color
|
-- Draw mouse & pen color
|
||||||
gc.translate(560,475)
|
gc.translate(560,475)
|
||||||
--Mouse
|
-- Mouse
|
||||||
gc.setLineWidth(2)
|
gc.setLineWidth(2)
|
||||||
gc.rectangle('line',0,0,80,110,5)
|
gc.rectangle('line',0,0,80,110,5)
|
||||||
gc.line(0,40,80,40)
|
gc.line(0,40,80,40)
|
||||||
gc.line(33,0,33,25,47,25,47,0)
|
gc.line(33,0,33,25,47,25,47,0)
|
||||||
gc.line(40,25,40,40)
|
gc.line(40,25,40,40)
|
||||||
|
|
||||||
--Left button
|
-- Left button
|
||||||
if pens[1]>0 then
|
if pens[1]>0 then
|
||||||
gc.setColor(BLOCK_COLORS[pens[1]])
|
gc.setColor(BLOCK_COLORS[pens[1]])
|
||||||
gc.rectangle('fill',5,5,23,30,3)
|
gc.rectangle('fill',5,5,23,30,3)
|
||||||
@@ -381,7 +381,7 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Right button
|
-- Right button
|
||||||
if pens[2]>0 then
|
if pens[2]>0 then
|
||||||
gc.setColor(BLOCK_COLORS[pens[2]])
|
gc.setColor(BLOCK_COLORS[pens[2]])
|
||||||
gc.rectangle('fill',52,5,23,30,3)
|
gc.rectangle('fill',52,5,23,30,3)
|
||||||
@@ -403,7 +403,7 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Middle button
|
-- Middle button
|
||||||
if pens[3]>0 then
|
if pens[3]>0 then
|
||||||
gc.setColor(BLOCK_COLORS[pens[3]])
|
gc.setColor(BLOCK_COLORS[pens[3]])
|
||||||
gc.rectangle('fill',35,2,10,21,3)
|
gc.rectangle('fill',35,2,10,21,3)
|
||||||
@@ -426,7 +426,7 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
gc.translate(-560,-475)
|
gc.translate(-560,-475)
|
||||||
|
|
||||||
--Block name
|
-- Block name
|
||||||
setFont(55)
|
setFont(55)
|
||||||
gc.setColor(1,1,1)
|
gc.setColor(1,1,1)
|
||||||
for i=1,7 do
|
for i=1,7 do
|
||||||
@@ -440,32 +440,32 @@ scene.widgetList={
|
|||||||
WIDGET.newText{name='title', x=1020,y=5,lim=480,font=70,align='R'},
|
WIDGET.newText{name='title', x=1020,y=5,lim=480,font=70,align='R'},
|
||||||
WIDGET.newText{name='subTitle', x=1030,y=50,lim=170,font=35,align='L',color='H'},
|
WIDGET.newText{name='subTitle', x=1030,y=50,lim=170,font=35,align='L',color='H'},
|
||||||
|
|
||||||
WIDGET.newButton{name='b1', x=580, y=130,w=73,fText="",color='R',code=_setPen(1)},--B1
|
WIDGET.newButton{name='b1', x=580, y=130,w=73,fText="",color='R',code=_setPen(1)},-- B1
|
||||||
WIDGET.newButton{name='b2', x=660, y=130,w=73,fText="",color='F',code=_setPen(2)},--B2
|
WIDGET.newButton{name='b2', x=660, y=130,w=73,fText="",color='F',code=_setPen(2)},-- B2
|
||||||
WIDGET.newButton{name='b3', x=740, y=130,w=73,fText="",color='O',code=_setPen(3)},--B3
|
WIDGET.newButton{name='b3', x=740, y=130,w=73,fText="",color='O',code=_setPen(3)},-- B3
|
||||||
WIDGET.newButton{name='b4', x=820, y=130,w=73,fText="",color='Y',code=_setPen(4)},--B4
|
WIDGET.newButton{name='b4', x=820, y=130,w=73,fText="",color='Y',code=_setPen(4)},-- B4
|
||||||
WIDGET.newButton{name='b5', x=900, y=130,w=73,fText="",color='L',code=_setPen(5)},--B5
|
WIDGET.newButton{name='b5', x=900, y=130,w=73,fText="",color='L',code=_setPen(5)},-- B5
|
||||||
WIDGET.newButton{name='b6', x=980, y=130,w=73,fText="",color='J',code=_setPen(6)},--B6
|
WIDGET.newButton{name='b6', x=980, y=130,w=73,fText="",color='J',code=_setPen(6)},-- B6
|
||||||
WIDGET.newButton{name='b7', x=1060,y=130,w=73,fText="",color='G',code=_setPen(7)},--B7
|
WIDGET.newButton{name='b7', x=1060,y=130,w=73,fText="",color='G',code=_setPen(7)},-- B7
|
||||||
WIDGET.newButton{name='b8', x=1140,y=130,w=73,fText="",color='A',code=_setPen(8)},--B8
|
WIDGET.newButton{name='b8', x=1140,y=130,w=73,fText="",color='A',code=_setPen(8)},-- B8
|
||||||
|
|
||||||
WIDGET.newButton{name='b9', x=580, y=210,w=73,fText="",color='C',code=_setPen(9)},--B9
|
WIDGET.newButton{name='b9', x=580, y=210,w=73,fText="",color='C',code=_setPen(9)},-- B9
|
||||||
WIDGET.newButton{name='b10', x=660, y=210,w=73,fText="",color='N',code=_setPen(10)},--B10
|
WIDGET.newButton{name='b10', x=660, y=210,w=73,fText="",color='N',code=_setPen(10)},-- B10
|
||||||
WIDGET.newButton{name='b11', x=740, y=210,w=73,fText="",color='S',code=_setPen(11)},--B11
|
WIDGET.newButton{name='b11', x=740, y=210,w=73,fText="",color='S',code=_setPen(11)},-- B11
|
||||||
WIDGET.newButton{name='b12', x=820, y=210,w=73,fText="",color='B',code=_setPen(12)},--B12
|
WIDGET.newButton{name='b12', x=820, y=210,w=73,fText="",color='B',code=_setPen(12)},-- B12
|
||||||
WIDGET.newButton{name='b13', x=900, y=210,w=73,fText="",color='V',code=_setPen(13)},--B13
|
WIDGET.newButton{name='b13', x=900, y=210,w=73,fText="",color='V',code=_setPen(13)},-- B13
|
||||||
WIDGET.newButton{name='b14', x=980, y=210,w=73,fText="",color='P',code=_setPen(14)},--B14
|
WIDGET.newButton{name='b14', x=980, y=210,w=73,fText="",color='P',code=_setPen(14)},-- B14
|
||||||
WIDGET.newButton{name='b15', x=1060,y=210,w=73,fText="",color='M',code=_setPen(15)},--B15
|
WIDGET.newButton{name='b15', x=1060,y=210,w=73,fText="",color='M',code=_setPen(15)},-- B15
|
||||||
WIDGET.newButton{name='b16', x=1140,y=210,w=73,fText="",color='W',code=_setPen(16)},--B16
|
WIDGET.newButton{name='b16', x=1140,y=210,w=73,fText="",color='W',code=_setPen(16)},-- B16
|
||||||
|
|
||||||
WIDGET.newButton{name='b17', x=580, y=290,w=73,font=40,fText=CHAR.icon.bone, color='dH',code=_setPen(17)},--BONE
|
WIDGET.newButton{name='b17', x=580, y=290,w=73,font=40,fText=CHAR.icon.bone, color='dH',code=_setPen(17)},-- BONE
|
||||||
WIDGET.newButton{name='b18', x=660, y=290,w=73,font=40,fText=CHAR.icon.invis, color='D', code=_setPen(18)},--HIDE
|
WIDGET.newButton{name='b18', x=660, y=290,w=73,font=40,fText=CHAR.icon.invis, color='D', code=_setPen(18)},-- HIDE
|
||||||
WIDGET.newButton{name='b19', x=740, y=290,w=73,font=40,fText=CHAR.icon.bomb, color='lY',code=_setPen(19)},--BOMB
|
WIDGET.newButton{name='b19', x=740, y=290,w=73,font=40,fText=CHAR.icon.bomb, color='lY',code=_setPen(19)},-- BOMB
|
||||||
WIDGET.newButton{name='b20', x=820, y=290,w=73,font=40,fText=CHAR.icon.garbage,color='H', code=_setPen(20)},--GB1
|
WIDGET.newButton{name='b20', x=820, y=290,w=73,font=40,fText=CHAR.icon.garbage,color='H', code=_setPen(20)},-- GB1
|
||||||
WIDGET.newButton{name='b21', x=900, y=290,w=73,font=40,fText=CHAR.icon.garbage,color='lH',code=_setPen(21)},--GB2
|
WIDGET.newButton{name='b21', x=900, y=290,w=73,font=40,fText=CHAR.icon.garbage,color='lH',code=_setPen(21)},-- GB2
|
||||||
WIDGET.newButton{name='b22', x=980, y=290,w=73,font=40,fText=CHAR.icon.garbage,color='dV',code=_setPen(22)},--GB3
|
WIDGET.newButton{name='b22', x=980, y=290,w=73,font=40,fText=CHAR.icon.garbage,color='dV',code=_setPen(22)},-- GB3
|
||||||
WIDGET.newButton{name='b23', x=1060,y=290,w=73,font=40,fText=CHAR.icon.garbage,color='dR',code=_setPen(23)},--GB4
|
WIDGET.newButton{name='b23', x=1060,y=290,w=73,font=40,fText=CHAR.icon.garbage,color='dR',code=_setPen(23)},-- GB4
|
||||||
WIDGET.newButton{name='b24', x=1140,y=290,w=73,font=40,fText=CHAR.icon.garbage,color='dG',code=_setPen(24)},--GB5
|
WIDGET.newButton{name='b24', x=1140,y=290,w=73,font=40,fText=CHAR.icon.garbage,color='dG',code=_setPen(24)},-- GB5
|
||||||
|
|
||||||
WIDGET.newButton{name='any', x=600, y=400,w=120,color='lH', font=40,code=_setPen(0)},
|
WIDGET.newButton{name='any', x=600, y=400,w=120,color='lH', font=40,code=_setPen(0)},
|
||||||
WIDGET.newButton{name='space', x=730, y=400,w=120,color='H', font=55,code=_setPen(-1),fText=CHAR.icon.cross_thick},
|
WIDGET.newButton{name='space', x=730, y=400,w=120,color='H', font=55,code=_setPen(-1),fText=CHAR.icon.cross_thick},
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ local ins,rem=table.insert,table.remove
|
|||||||
|
|
||||||
local scene={}
|
local scene={}
|
||||||
|
|
||||||
local input--Input buffer
|
local input-- Input buffer
|
||||||
local cur--Cursor position
|
local cur-- Cursor position
|
||||||
|
|
||||||
function scene.sceneInit()
|
function scene.sceneInit()
|
||||||
input=""
|
input=""
|
||||||
@@ -72,7 +72,7 @@ function scene.keyDown(key)
|
|||||||
end
|
end
|
||||||
elseif key=='v' and kb.isDown('lctrl','rctrl') or key=='cV' then
|
elseif key=='v' and kb.isDown('lctrl','rctrl') or key=='cV' then
|
||||||
local str=sys.getClipboardText()
|
local str=sys.getClipboardText()
|
||||||
local p=str:find(":")--ptr*
|
local p=str:find(":")-- ptr*
|
||||||
if p then
|
if p then
|
||||||
if not str:sub(1,p-1):find("Target") then
|
if not str:sub(1,p-1):find("Target") then
|
||||||
MES.new('error',text.pasteWrongPlace)
|
MES.new('error',text.pasteWrongPlace)
|
||||||
@@ -112,22 +112,22 @@ function scene.keyDown(key)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function scene.draw()
|
function scene.draw()
|
||||||
--Draw frame
|
-- Draw frame
|
||||||
gc.setLineWidth(2)
|
gc.setLineWidth(2)
|
||||||
gc.setColor(COLOR.Z)
|
gc.setColor(COLOR.Z)
|
||||||
gc.rectangle('line',58,108,1164,174,5)
|
gc.rectangle('line',58,108,1164,174,5)
|
||||||
|
|
||||||
--Draw inputing target
|
-- Draw inputing target
|
||||||
setFont(30)
|
setFont(30)
|
||||||
gc.setColor(.9,.9,.9)
|
gc.setColor(.9,.9,.9)
|
||||||
gc.print(input,1200,275)
|
gc.print(input,1200,275)
|
||||||
|
|
||||||
--Draw targets
|
-- Draw targets
|
||||||
local libColor=BLOCK_COLORS
|
local libColor=BLOCK_COLORS
|
||||||
local set=SETTING.skin
|
local set=SETTING.skin
|
||||||
local L=MISSION
|
local L=MISSION
|
||||||
local x,y=100,136--Next block pos
|
local x,y=100,136-- Next block pos
|
||||||
local cx,cy=100,136--Cursor-center pos
|
local cx,cy=100,136-- Cursor-center pos
|
||||||
local i,j=1,#L
|
local i,j=1,#L
|
||||||
local count=1
|
local count=1
|
||||||
repeat
|
repeat
|
||||||
@@ -169,7 +169,7 @@ function scene.draw()
|
|||||||
i=i+1
|
i=i+1
|
||||||
until i>j+1
|
until i>j+1
|
||||||
|
|
||||||
--Draw cursor
|
-- Draw cursor
|
||||||
gc.setColor(1,1,.4,.6+.4*sin(TIME()*6.26))
|
gc.setColor(1,1,.4,.6+.4*sin(TIME()*6.26))
|
||||||
gc.line(cx-5,cy-20,cx-5,cy+20)
|
gc.line(cx-5,cy-20,cx-5,cy+20)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ local gc_setColor,gc_print=gc.setColor,gc.print
|
|||||||
|
|
||||||
local scene={}
|
local scene={}
|
||||||
|
|
||||||
local cur--Cursor position
|
local cur-- Cursor position
|
||||||
|
|
||||||
function scene.sceneInit()
|
function scene.sceneInit()
|
||||||
cur=#BAG
|
cur=#BAG
|
||||||
@@ -80,7 +80,7 @@ function scene.keyDown(key)
|
|||||||
end
|
end
|
||||||
elseif key=='v' and kb.isDown('lctrl','rctrl') or key=='cV' then
|
elseif key=='v' and kb.isDown('lctrl','rctrl') or key=='cV' then
|
||||||
local str=sys.getClipboardText()
|
local str=sys.getClipboardText()
|
||||||
local p=str:find(":")--ptr*
|
local p=str:find(":")-- ptr*
|
||||||
if p then
|
if p then
|
||||||
if not str:sub(1,p-1):find("SEQ") then
|
if not str:sub(1,p-1):find("SEQ") then
|
||||||
MES.new('error',text.pasteWrongPlace)
|
MES.new('error',text.pasteWrongPlace)
|
||||||
@@ -114,17 +114,17 @@ end
|
|||||||
|
|
||||||
local blockCharWidth={} for i=1,#BLOCK_CHARS do blockCharWidth[i]=gc.newText(FONT.get(60),BLOCK_CHARS[i]):getWidth() end
|
local blockCharWidth={} for i=1,#BLOCK_CHARS do blockCharWidth[i]=gc.newText(FONT.get(60),BLOCK_CHARS[i]):getWidth() end
|
||||||
function scene.draw()
|
function scene.draw()
|
||||||
--Draw frame
|
-- Draw frame
|
||||||
gc_setColor(COLOR.Z)
|
gc_setColor(COLOR.Z)
|
||||||
gc.setLineWidth(2)
|
gc.setLineWidth(2)
|
||||||
gc.rectangle('line',100,110,1080,260,5)
|
gc.rectangle('line',100,110,1080,260,5)
|
||||||
|
|
||||||
--Draw sequence
|
-- Draw sequence
|
||||||
local BLOCK_COLORS=BLOCK_COLORS
|
local BLOCK_COLORS=BLOCK_COLORS
|
||||||
local skinSetting=SETTING.skin
|
local skinSetting=SETTING.skin
|
||||||
local BAG=BAG
|
local BAG=BAG
|
||||||
local x,y=120,136--Next block pos
|
local x,y=120,136-- Next block pos
|
||||||
local cx,cy=120,136--Cursor-center pos
|
local cx,cy=120,136-- Cursor-center pos
|
||||||
local i,j=1,#BAG
|
local i,j=1,#BAG
|
||||||
local count=1
|
local count=1
|
||||||
repeat
|
repeat
|
||||||
@@ -159,12 +159,12 @@ function scene.draw()
|
|||||||
i=i+1
|
i=i+1
|
||||||
until i>j+1
|
until i>j+1
|
||||||
|
|
||||||
--Draw lenth
|
-- Draw lenth
|
||||||
setFont(40)
|
setFont(40)
|
||||||
gc_setColor(COLOR.Z)
|
gc_setColor(COLOR.Z)
|
||||||
gc_print(#BAG,120,310)
|
gc_print(#BAG,120,310)
|
||||||
|
|
||||||
--Draw cursor
|
-- Draw cursor
|
||||||
gc_setColor(.5,1,.5,.6+.4*sin(TIME()*6.26))
|
gc_setColor(.5,1,.5,.6+.4*sin(TIME()*6.26))
|
||||||
gc.line(cx-5,cy-20,cx-5,cy+20)
|
gc.line(cx-5,cy-20,cx-5,cy+20)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -30,16 +30,16 @@ function scene.update(dt)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function scene.draw()
|
function scene.draw()
|
||||||
--Game scene
|
-- Game scene
|
||||||
SCN.scenes.game.draw()
|
SCN.scenes.game.draw()
|
||||||
|
|
||||||
--Gray screen cover
|
-- Gray screen cover
|
||||||
gc.setColor(.12,.12,.12,timer*8-7)
|
gc.setColor(.12,.12,.12,timer*8-7)
|
||||||
gc.replaceTransform(SCR.origin)
|
gc.replaceTransform(SCR.origin)
|
||||||
gc.rectangle('fill',0,0,SCR.w,SCR.h)
|
gc.rectangle('fill',0,0,SCR.w,SCR.h)
|
||||||
gc.replaceTransform(SCR.xOy)
|
gc.replaceTransform(SCR.xOy)
|
||||||
|
|
||||||
--Counter bar
|
-- Counter bar
|
||||||
gc.setLineWidth(2)
|
gc.setLineWidth(2)
|
||||||
gc.setColor(.9,.9,.9,math.min(1,12*timer,8*(1-timer))*.6)
|
gc.setColor(.9,.9,.9,math.min(1,12*timer,8*(1-timer))*.6)
|
||||||
gc.rectangle('line',494,336,292,48,14)
|
gc.rectangle('line',494,336,292,48,14)
|
||||||
|
|||||||
@@ -8,15 +8,15 @@ local find=string.find
|
|||||||
|
|
||||||
local scene={}
|
local scene={}
|
||||||
|
|
||||||
local dict--Dict list
|
local dict-- Dict list
|
||||||
local result--Result Lable
|
local result-- Result Lable
|
||||||
|
|
||||||
local lastTickInput
|
local lastTickInput
|
||||||
local searchWait--Searching animation timer
|
local searchWait-- Searching animation timer
|
||||||
local selected--Selected option
|
local selected-- Selected option
|
||||||
local scrollPos--Scroll down length
|
local scrollPos-- Scroll down length
|
||||||
|
|
||||||
local lastSearch--Last searched string
|
local lastSearch-- Last searched string
|
||||||
|
|
||||||
local typeColor={
|
local typeColor={
|
||||||
help=COLOR.Y,
|
help=COLOR.Y,
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ local function _checkGameKeyDown(key)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return true--No key pressed
|
return true-- No key pressed
|
||||||
end
|
end
|
||||||
|
|
||||||
function scene.sceneInit()
|
function scene.sceneInit()
|
||||||
@@ -283,19 +283,19 @@ function scene.gamepadUp(key)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function _update_common(dt)
|
local function _update_common(dt)
|
||||||
--Update control
|
-- Update control
|
||||||
touchMoveLastFrame=false
|
touchMoveLastFrame=false
|
||||||
VK.update(dt)
|
VK.update(dt)
|
||||||
|
|
||||||
--Update players
|
-- Update players
|
||||||
for p=1,#PLAYERS do PLAYERS[p]:update(dt) end
|
for p=1,#PLAYERS do PLAYERS[p]:update(dt) end
|
||||||
|
|
||||||
--Fresh royale target
|
-- Fresh royale target
|
||||||
if PLAYERS[1].frameRun%120==0 and PLAYERS[1].gameEnv.layout=='royale' then
|
if PLAYERS[1].frameRun%120==0 and PLAYERS[1].gameEnv.layout=='royale' then
|
||||||
freshMostDangerous()
|
freshMostDangerous()
|
||||||
end
|
end
|
||||||
|
|
||||||
--Warning check
|
-- Warning check
|
||||||
checkWarning(dt)
|
checkWarning(dt)
|
||||||
end
|
end
|
||||||
function scene.update(dt)
|
function scene.update(dt)
|
||||||
@@ -328,15 +328,15 @@ function scene.draw()
|
|||||||
|
|
||||||
local repMode=GAME.replaying or tas
|
local repMode=GAME.replaying or tas
|
||||||
|
|
||||||
--Players
|
-- Players
|
||||||
for p=1,#PLAYERS do
|
for p=1,#PLAYERS do
|
||||||
PLAYERS[p]:draw(repMode)
|
PLAYERS[p]:draw(repMode)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Virtual keys
|
-- Virtual keys
|
||||||
VK.draw()
|
VK.draw()
|
||||||
|
|
||||||
--Attacking & Being attacked
|
-- Attacking & Being attacked
|
||||||
if PLAYERS[1].gameEnv.layout=='royale' then
|
if PLAYERS[1].gameEnv.layout=='royale' then
|
||||||
local P=PLAYERS[1]
|
local P=PLAYERS[1]
|
||||||
gc_setLineWidth(5)
|
gc_setLineWidth(5)
|
||||||
@@ -357,7 +357,7 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Mode info
|
-- Mode info
|
||||||
gc_setColor(1,1,1,.82)
|
gc_setColor(1,1,1,.82)
|
||||||
gc_draw(TEXTOBJ.modeName,modeTextPos,10,0,modeTextWidK,1)
|
gc_draw(TEXTOBJ.modeName,modeTextPos,10,0,modeTextWidK,1)
|
||||||
local M=GAME.curMode
|
local M=GAME.curMode
|
||||||
@@ -378,7 +378,7 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Replaying
|
-- Replaying
|
||||||
if replaying or tas then
|
if replaying or tas then
|
||||||
setFont(20)
|
setFont(20)
|
||||||
gc_setColor(1,1,TIME()%.8>.4 and 1 or 0)
|
gc_setColor(1,1,TIME()%.8>.4 and 1 or 0)
|
||||||
@@ -387,7 +387,7 @@ function scene.draw()
|
|||||||
mStr(("%s %sf"):format(repRateStrings[gameRate],PLAYERS[1].frameRun),770,31)
|
mStr(("%s %sf"):format(repRateStrings[gameRate],PLAYERS[1].frameRun),770,31)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Warning
|
-- Warning
|
||||||
drawWarning()
|
drawWarning()
|
||||||
end
|
end
|
||||||
scene.widgetList={
|
scene.widgetList={
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ pad={x=140,y=65,page=1,
|
|||||||
{{},{},{},{},{},{},{},{}},
|
{{},{},{},{},{},{},{},{}},
|
||||||
{{},{},{},{},{},{},{},{}},
|
{{},{},{},{},{},{},{},{}},
|
||||||
},
|
},
|
||||||
(function()--BGM page
|
(function()-- BGM page
|
||||||
local L=BGM.getList()
|
local L=BGM.getList()
|
||||||
local B={}
|
local B={}
|
||||||
for y=1,8 do
|
for y=1,8 do
|
||||||
@@ -233,13 +233,13 @@ function scene.draw()
|
|||||||
gc_translate(pad.x,pad.y)
|
gc_translate(pad.x,pad.y)
|
||||||
gc_setLineWidth(2)
|
gc_setLineWidth(2)
|
||||||
|
|
||||||
--Pad frame
|
-- Pad frame
|
||||||
gc_setColor(COLOR.dX)
|
gc_setColor(COLOR.dX)
|
||||||
gc_rectangle('fill',-3,-3,726,646,2)
|
gc_rectangle('fill',-3,-3,726,646,2)
|
||||||
gc_setColor(white)
|
gc_setColor(white)
|
||||||
gc_rectangle('line',-3,-3,726,646,2)
|
gc_rectangle('line',-3,-3,726,646,2)
|
||||||
|
|
||||||
--Buttons
|
-- Buttons
|
||||||
for y=1,8 do
|
for y=1,8 do
|
||||||
gc_setColor(COLOR.dX)
|
gc_setColor(COLOR.dX)
|
||||||
gc_circle('fill',40,(y-1)*80+40,34)
|
gc_circle('fill',40,(y-1)*80+40,34)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user