Alpha V0.7.23test5

This commit is contained in:
MrZ_26
2020-02-04 19:35:50 +08:00
parent 7b797baf6a
commit a29fa973a6
58 changed files with 1611 additions and 968 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
BGM/shining terminal.ogg Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

235
ai.lua
View File

@@ -8,8 +8,76 @@
4deepShape 4deepShape
BlockedWells; BlockedWells;
]] ]]
local abs=math.abs local int,ceil,min,abs,rnd=math.floor,math.ceil,math.min,math.abs,math.random
local ins,rem=table.insert,table.remove
local Timer=love.timer.getTime
-- controlname:
-- 1~5:mL,mR,rR,rL,rF,
-- 6~10:hD,sD,H,A,R,
-- 11~13:LL,RR,DD
local blockPos={4,4,4,4,4,5,4}
local scs={{1,2},{1,2},{1,2},{1,2},{1,2},{1.5,1.5},{0.5,2.5}}
-------------------------------------------------Cold clear
local CCblockID={4,3,5,6,1,2,0}
if system~="Windows"then goto SKIP end
require("CCloader")
BOT={
getConf= cc.get_default_config ,--()options,weights
--setConf= cc.set_options ,--(options,hold,20g,bag7)
new= cc.launch_async ,--(options,weights)bot
addNext= cc.add_next_piece_async ,--(bot,piece)
update= cc.reset_async ,--(bot,field,b2b,combo)
think= cc.request_next_move ,--(bot)
getMove= cc.poll_next_move ,--(bot)success,hold,move
ifDead= cc.is_dead_async ,--(bot)dead
destroy= cc.destroy_async ,--(bot)
setHold= cc.set_hold ,--(opt,bool)
set20G= cc.set_20g ,--(opt,bool)
setBag= cc.set_bag7 ,--(opt,bool)
setNode= cc.set_max_nodes ,--(opt,bool)
free= cc.free ,--(opt/wei)
}
function CC_updateField(P)
local F,i={},1
for y=1,#P.field do
for x=1,10 do
F[i],i=P.field[y][x]>0,i+1
end
end
while i<400 do
F[i],i=false,i+1
end
BOT.update(P.AI_bot,F,P.b2b>=100,P.combo)
end
function CC_switch20G(P)
P.AIdata._20G=true
P.AI_keys={}
BOT.destroy(P.AI_bot)
local opt,wei=BOT.getConf()
BOT.setHold(opt,P.AIdata.hold)
BOT.set20G(opt,P.AIdata._20G)
BOT.setBag(opt,P.AIdata.bag7)
BOT.setNode(opt,P.AIdata.node)
P.AI_bot=BOT.new(opt,wei)
BOT.free(opt)BOT.free(wei)
for i=1,P.AIdata.next do
BOT.addNext(P.AI_bot,CCblockID[P.next[i].id])
end
CC_updateField(P)
P.hold={bk={{}},id=0,color=0,name=0}P.holded=false
P.cur=rem(P.next,1)
P.sc,P.dir=scs[P.cur.id],0
P.r,P.c=#P.cur.bk,#P.cur.bk[1]
P.curX,P.curY=blockPos[P.cur.id],21+ceil(P.fieldBeneath/30)-P.r+min(int(#P.field*.2),2)
P.freshNext()
BOT.addNext(P.AI_bot,CCblockID[P.next[P.AIdata.next].id])
collectgarbage()
end
::SKIP::
-------------------------------------------------⑨Stack setup
local dirCount={1,1,3,3,3,0,1} local dirCount={1,1,3,3,3,0,1}
local spinOffset={ local spinOffset={
{1,0,0},--S {1,0,0},--S
@@ -20,12 +88,6 @@ local spinOffset={
{0,0,0},--O {0,0,0},--O
{2,0,1},--I {2,0,1},--I
}for i=1,7 do spinOffset[i][0]=0 end }for i=1,7 do spinOffset[i][0]=0 end
--[[
controlname:
1~5:mL,mR,rR,rL,rF,
6~10:hD,sD,H,A,R,
11~13:LL,RR,DD
]]
local FCL={ local FCL={
[1]={ [1]={
{{11},{11,2},{1},{},{2},{2,2},{12,1},{12}}, {{11},{11,2},{1},{},{2},{2,2},{12,1},{12}},
@@ -68,7 +130,7 @@ local function resetField(f0,f,start)
end end
end end
end end
local function getScore(field,bn,cb,cx,cy) local function getScore(field,cb,cy)
local score=0 local score=0
local highest=0 local highest=0
local height=getNewRow(0) local height=getNewRow(0)
@@ -123,58 +185,111 @@ local function getScore(field,bn,cb,cx,cy)
if mh1>3 then score=score-40-mh1*30 end if mh1>3 then score=score-40-mh1*30 end
return score return score
end end
function AI_getControls(ctrl) -------------------------------------------------
local Tfield={}--test field AI_think={
local field_org=P.field ["9S"]={
for i=1,#field_org do function(ctrl)
Tfield[i]=getNewRow(0) local Tfield={}--test field
for j=1,10 do local field_org=P.field
Tfield[i][j]=field_org[i][j] for i=1,#field_org do
end Tfield[i]=getNewRow(0)
end for j=1,10 do
local best={x=1,dir=0,hold=false,score=-9e99} Tfield[i][j]=field_org[i][j]
for ifhold=0,P.gameEnv.hold and 1 or 0 do end
local bn=ifhold==0 and P.cur.id or P.hold.id>0 and P.hold.id or P.next[1].id end
for dir=0,dirCount[bn] do--each dir local best={x=1,dir=0,hold=false,score=-9e99}
local cb=blocks[bn][dir] for ifhold=0,P.gameEnv.hold and 1 or 0 do
for cx=1,11-#cb[1]do--each pos local bn=ifhold==0 and P.cur.id or P.hold.id>0 and P.hold.id or P.next[1].id
local cy=#Tfield+1 for dir=0,dirCount[bn] do--each dir
::L::if not ifoverlapAI(Tfield,cb,cx,cy-1)then local cb=blocks[bn][dir]
cy=cy-1 for cx=1,11-#cb[1]do--each pos
goto L local cy=#Tfield+1
end--move to bottom ::L::if not ifoverlapAI(Tfield,cb,cx,cy-1)then
for i=1,#cb do cy=cy-1
local y=cy+i-1 goto L
if not Tfield[y]then Tfield[y]=getNewRow(0)end end--move to bottom
for j=1,#cb[1]do for i=1,#cb do
if cb[i][j]then local y=cy+i-1
Tfield[y][cx+j-1]=1 if not Tfield[y]then Tfield[y]=getNewRow(0)end
end for j=1,#cb[1]do
end if cb[i][j]then
end--simulate lock Tfield[y][cx+j-1]=1
local score=getScore(Tfield,bn,cb,cx,cy) end
if score>best.score then end
best={bn=bn,x=cx,dir=dir,hold=ifhold==1,score=score} end--simulate lock
local score=getScore(Tfield,cb,cy)
if score>best.score then
best={bn=bn,x=cx,dir=dir,hold=ifhold==1,score=score}
end
resetField(field_org,Tfield,cy)
end
end end
resetField(field_org,Tfield,cy)
end end
end
end
::L:: ::L::
if #Tfield>0 then if #Tfield>0 then
removeRow(Tfield,1) removeRow(Tfield,1)
goto L goto L
end--Release cache end--Release cache
local p=#ctrl+1 local p=#ctrl+1
if best.hold then if best.hold then
ctrl[p]=8 ctrl[p]=8
p=p+1 p=p+1
end end
local l=FCL[best.bn][best.dir+1][best.x] local l=FCL[best.bn][best.dir+1][best.x]
for i=1,#l do for i=1,#l do
ctrl[p]=l[i] ctrl[p]=l[i]
p=p+1 p=p+1
end end
ctrl[p]=6 ctrl[p]=6
end return 2
end,
function()
P.AI_delay=P.AI_delay0
if Timer()-P.modeData.point>P.modeData.event then
P.modeData.point=Timer()
P.modeData.event=P.AI_delay0+rnd(2,10)
changeAtkMode(rnd()<.85 and 1 or #P.atker>3 and 4 or rnd()<.3 and 2 or 3)
end
return 1
end,
},
["CC"]={
function()
if P.AI_needFresh then
CC_updateField(P)
P.AI_needFresh=false
end
BOT.think(P.AI_bot)
return 2
end,
function(ctrl)
if BOT.ifDead(P.AI_bot)then ins(ctrl,6)return 3 end
local success,hold,move=BOT.getMove(P.AI_bot)
if success then
if hold then ctrl[1]=8 end--Hold
while move[1]do
local m=rem(move,1)
if m<4 then
ins(ctrl,m+1)
elseif not P.AIdata._20G then
ins(ctrl,13)
end
end
ins(ctrl,6)
return 3
else
return 2--stay this stage
end
end,
function()
P.AI_delay=P.AI_delay0
if Timer()-P.modeData.point>P.modeData.event then
P.modeData.point=Timer()
P.modeData.event=P.AI_delay0+rnd(2,10)
changeAtkMode(rnd()<.85 and 1 or #P.atker>3 and 4 or rnd()<.3 and 2 or 3)
end
return 1
end,
},
}--AI think stage

View File

@@ -1,17 +1,24 @@
Task={}
local rem=table.remove local rem=table.remove
Task={}
metatable_task={__index=Task} function Task:update()
if(not self.P or self.P and scene=="play")and self:code(self.P,self.data)then
local e=#Task
for i=1,e do
if Task[i]==self then
Task[e],Task[i]=nil,Task[e]
return
end
end
end
end
function newTask(code,P,data) function newTask(code,P,data)
local id=#Task+1 Task[#Task+1]={
local obj={ update=Task.update,
code=code, code=code,
P=P, P=P,
data=data, data=data,
id=id,
} }
setmetatable(obj,metatable_task)
Task[id]=obj
end end
function clearTask(opt) function clearTask(opt)
if opt=="all"then if opt=="all"then
@@ -34,14 +41,22 @@ function clearTask(opt)
end end
end end
end end
function Task:update()
if(not self.P or self.P and scene=="play")and self:code(self.P,self.data)then function newButton(x,y,w,h,color,font,code,hide,up,down,left,right)
local e=#Task return{
for i=1,e do type="button",
if Task[i]==self then x=x-w*.5,y=y-h*.5,w=w,h=h,
Task[e],Task[i]=nil,Task[e] color=color,font=font,
return code=code,hide=hide,
end up=up,down=down,left=left,right=right,
end }
end end
function newSlider(x,y,w,unit,color,font,code,hide,up,down,left,right)
return{
type="slider",
x=x,y=y,w=w,unit=unit,
color=color,font=font,
code=code,hide=hide,
up=up,down=down,left=left,right=right,
}
end end

View File

@@ -1,4 +1,4 @@
gameVersion="Alpha V0.7.22" gameVersion="Alpha V0.7.23"
function love.conf(t) function love.conf(t)
t.identity="Techmino"--Save directory name t.identity="Techmino"--Save directory name
t.version="11.1" t.version="11.1"

File diff suppressed because it is too large Load Diff

BIN
font.ttf

Binary file not shown.

View File

@@ -1,29 +1,29 @@
local gc=love.graphics local gc=love.graphics
local int,ceil,abs,rnd,max,min=math.floor,math.ceil,math.abs,math.random,math.max,math.min local int,ceil,abs,rnd,max,min=math.floor,math.ceil,math.abs,math.random,math.max,math.min
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local null=function()end
local gameEnv0={ local gameEnv0={
das=10,arr=2, das=10,arr=2,
sddas=0,sdarr=2, sddas=2,sdarr=2,
ghost=true,center=true, ghost=true,center=true,
grid=false,swap=true, grid=false,swap=true,
_20G=false,bone=false, _20G=false,bone=false,
drop=30,lock=45, drop=60,lock=60,
wait=0,fall=0, wait=0,fall=0,
next=6,hold=true,oncehold=true, next=6,hold=true,oncehold=true,
sequence="bag7", sequence="bag7",
block=true, block=true,
keepVisible=true,visible="show", visible="show",--keepVisible=visile~="show"
Fkey=false,puzzle=false,ospin=true, Fkey=null,puzzle=false,ospin=true,
freshLimit=1e99,target=1e99,reach=null, freshLimit=1e99,easyFresh=true,
target=1e99,dropPiece=null,
bg="none",bgm="race" bg="none",bgm="race"
} }
local blockPos={4,4,4,4,4,5,4}
local renATK={[0]=0,0,0,1,1,2,2,3,3,4,4}--3 else local renATK={[0]=0,0,0,1,1,2,2,3,3,4,4}--3 else
local b2bPoint={50,100,180} local b2bPoint={50,100,180}
local b2bATK={3,5,8} local b2bATK={3,5,8}
local clearSCR={40,100,180} local clearSCR={80,200,400}
local spinSCR={--[blockName][row] local spinSCR={--[blockName][row]
{200,750,1600},--Z {200,750,1600},--Z
{200,750,1600},--S {200,750,1600},--S
@@ -43,6 +43,7 @@ local clearName={"single","double","triple"}
local spin_n={[0]="spin_0","spin_1","spin_2","spin_3"} local spin_n={[0]="spin_0","spin_1","spin_2","spin_3"}
local clear_n={"clear_1","clear_2","clear_3","clear_4"} local clear_n={"clear_1","clear_2","clear_3","clear_4"}
local ren_n={}for i=1,11 do ren_n[i]="ren_"..i end local ren_n={}for i=1,11 do ren_n[i]="ren_"..i end
local blockPos={4,4,4,4,4,5,4}
local scs={ local scs={
{[0]={1,2},{2,1},{2,2},{2,2}}, {[0]={1,2},{2,1},{2,2},{2,2}},
{[0]={1,2},{2,1},{2,2},{2,2}}, {[0]={1,2},{2,1},{2,2},{2,2}},
@@ -60,7 +61,7 @@ local TRS={
[21]={{0,0},{-1,0},{-1,1},{1,0},{0,-2},{-1,-2}}, [21]={{0,0},{-1,0},{-1,1},{1,0},{0,-2},{-1,-2}},
[23]={{0,0},{1,0},{1,1},{1,-1},{0,-2},{1,-2}}, [23]={{0,0},{1,0},{1,1},{1,-1},{0,-2},{1,-2}},
[32]={{0,0},{-1,0},{-1,-1},{-1,1},{0,2},{-1,2}}, [32]={{0,0},{-1,0},{-1,-1},{-1,1},{0,2},{-1,2}},
[30]={{0,0},{-1,0},{-1,-1},{0,2},{-1,2},{0,-1}}, [30]={{0,0},{-1,0},{-1,-1},{0,-1},{0,2},{-1,2}},
[03]={{0,0},{1,0},{1,1},{1,-1},{0,-2},{1,-2},{0,1}}, [03]={{0,0},{1,0},{1,1},{1,-1},{0,-2},{1,-2},{0,1}},
[02]={{0,0},{1,0},{-1,0},{0,-1},{0,1}}, [02]={{0,0},{1,0},{-1,0},{0,-1},{0,1}},
[20]={{0,0},{-1,0},{1,0},{0,1},{0,-1}}, [20]={{0,0},{-1,0},{1,0},{0,1},{0,-1}},
@@ -69,7 +70,7 @@ local TRS={
},--Z/J },--Z/J
[2]={ [2]={
[01]={{0,0},{-1,0},{-1,1},{-1,-1},{0,-2},{-1,-2}}, [01]={{0,0},{-1,0},{-1,1},{-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,-1},{0,2},{1,2}},
[12]={{0,0},{1,0},{1,-1},{1,1},{0,2},{1,2}}, [12]={{0,0},{1,0},{1,-1},{1,1},{0,2},{1,2}},
[21]={{0,0},{-1,0},{-1,1},{-1,-1},{0,-2},{-1,-2}}, [21]={{0,0},{-1,0},{-1,1},{-1,-1},{0,-2},{-1,-2}},
[23]={{0,0},{1,0},{1,1},{-1,0},{0,-2},{1,-2}}, [23]={{0,0},{1,0},{1,1},{-1,0},{0,-2},{1,-2}},
@@ -110,7 +111,27 @@ local TRS={
[31]={{0,0},{1,0},{-1,0}}, [31]={{0,0},{1,0},{-1,0}},
} }
}TRS[3],TRS[4]=TRS[2],TRS[1] }TRS[3],TRS[4]=TRS[2],TRS[1]
local AIRS={{
[01]={{0,0},{-1,0},{-1,1},{0,-2},{-1,-2}},
[10]={{0,0},{1,0},{1,-1},{0,2},{1,2}},
[12]={{0,0},{1,0},{1,-1},{0,2},{1,2}},
[21]={{0,0},{-1,0},{-1,1},{0,-2},{-1,-2}},
[23]={{0,0},{1,0},{1,1},{0,-2},{1,-2}},
[32]={{0,0},{-1,0},{-1,-1},{0,2},{-1,2}},
[30]={{0,0},{-1,0},{-1,-1},{0,2},{-1,2}},
[03]={{0,0},{1,0},{1,1},{0,-2},{1,-2}},
}}for i=2,6 do AIRS[i]=AIRS[1]end
AIRS[7]={
[01]={{0,0},{-2,0},{1,0},{-2,-1},{1,2}},
[10]={{0,0},{2,0},{-1,0},{2,1},{-1,-2}},
[12]={{0,0},{-1,0},{2,0},{-1,2},{2,-1}},
[21]={{0,0},{1,0},{-2,0},{1,-2},{-2,1}},
[23]={{0,0},{2,0},{-1,0},{2,1},{-1,-2}},
[32]={{0,0},{-2,0},{1,0},{-2,-1},{1,2}},
[30]={{0,0},{1,0},{-2,0},{1,-2},{-2,1}},
[03]={{0,0},{-1,0},{2,0},{-1,2},{2,-1}},
}
local CCblockID={4,3,5,6,1,2,0}
local function newNext(n) local function newNext(n)
P.next[#P.next+1]={bk=blocks[n][0],id=n,color=P.gameEnv.bone and 8 or n,name=n} P.next[#P.next+1]={bk=blocks[n][0],id=n,color=P.gameEnv.bone and 8 or n,name=n}
end end
@@ -214,6 +235,7 @@ function changeAtkMode(m)
::L:: ::L::
end end
function changeAtk(P,R) function changeAtk(P,R)
-- if not P.human then R=players[1]end--1vALL mode
if P.atking then if P.atking then
local K=P.atking.atker local K=P.atking.atker
for i=1,#K do for i=1,#K do
@@ -285,11 +307,15 @@ function royaleLevelup()
local P=players.alive[i] local P=players.alive[i]
P.gameEnv.drop=spd P.gameEnv.drop=spd
end end
if curMode.lv==5 and players[1].alive then if curMode.lv==3 then
local P=players[1] for i=1,#players.alive do
P.gameEnv.drop=int(P.gameEnv.drop*.3) local P=players.alive[i]
if P.gameEnv.drop==0 then P.gameEnv.drop=int(P.gameEnv.drop*.3)
P.gameEnv._20G=true if P.gameEnv.drop==0 then
P.curY=P.y_img
P.gameEnv._20G=true
if P.AI_mode=="CC"then CC_switch20G(P)end--little cheating,never mind
end
end end
end end
end end
@@ -303,16 +329,14 @@ function loadGame(mode,level)
end end
local function resetPartGameData() local function resetPartGameData()
frame=30 frame=30
if players then destroyPlayers()
for _,P in next,players do if P.id then
while P.field[1]do
removeRow(P.field)
removeRow(P.visTime)
end
end end
end
players={alive={}}human=0 players={alive={}}human=0
loadmode[curMode.id]() loadmode[curMode.id]()
if modeEnv.task then
for i=1,#players do
newTask(Event_task[modeEnv.task],players[i])
end
end
if modeEnv.royaleMode then if modeEnv.royaleMode then
for i=1,#players do for i=1,#players do
changeAtk(players[i],randomTarget(players[i])) changeAtk(players[i],randomTarget(players[i]))
@@ -330,17 +354,16 @@ function resetGameData()
pushSpeed=3 pushSpeed=3
pauseTime=0--Time paused pauseTime=0--Time paused
pauseCount=0--Times paused pauseCount=0--Times paused
if players then destroyPlayers()
for _,P in next,players do if P.id then
while P.field[1]do
removeRow(P.field)
removeRow(P.visTime)
end
end end
end
players={alive={}}human=0 players={alive={}}human=0
modeEnv=defaultModeEnv[curMode.id][curMode.lv]or defaultModeEnv[curMode.id][1] local E=defaultModeEnv[curMode.id]
loadmode[curMode.id]() modeEnv=E[curMode.lv]or E[1]
loadmode[curMode.id]()--bg/bgm need redefine in custom,so up here
if modeEnv.task then
for i=1,#players do
newTask(Event_task[modeEnv.task],players[i])
end
end
curBG=modeEnv.bg curBG=modeEnv.bg
BGM(modeEnv.bgm) BGM(modeEnv.bgm)
@@ -387,7 +410,7 @@ function gameStart()
end end
setmetatable(_G,nil) setmetatable(_G,nil)
end end
function createPlayer(id,x,y,size,AIspeed,data) function createPlayer(id,x,y,size,AIdata)
players[id]={id=id} players[id]={id=id}
P=players[id] P=players[id]
local P=P local P=P
@@ -406,17 +429,6 @@ function createPlayer(id,x,y,size,AIspeed,data)
P.absFieldY=P.y+60*P.size P.absFieldY=P.y+60*P.size
end end
if AIspeed then
P.ai={
controls={},
controlDelay=30,
controlDelay0=AIspeed,
}
else
P.human=true
human=human+1
end
P.alive=true P.alive=true
P.control=false P.control=false
P.timing=false P.timing=false
@@ -442,9 +454,7 @@ function createPlayer(id,x,y,size,AIspeed,data)
P.gameEnv={}--Game setting vars,like dropDelay setting P.gameEnv={}--Game setting vars,like dropDelay setting
for k,v in pairs(gameEnv0)do for k,v in pairs(gameEnv0)do
if data and data[k]~=nil then if modeEnv[k]~=nil then
P.gameEnv[k]=data[k]
elseif modeEnv[k]~=nil then
P.gameEnv[k]=modeEnv[k] P.gameEnv[k]=modeEnv[k]
elseif setting[k]~=nil then elseif setting[k]~=nil then
P.gameEnv[k]=setting[k] P.gameEnv[k]=setting[k]
@@ -493,6 +503,46 @@ function createPlayer(id,x,y,size,AIspeed,data)
elseif P.gameEnv.sequence==3 then--Pure random elseif P.gameEnv.sequence==3 then--Pure random
end end
if AIdata then
P.human=false
P.AI_mode=AIdata.type
P.AI_stage=1
P.AI_needFresh=false
P.AI_keys={}
P.AI_delay=min(int(P.gameEnv.drop*.8),2*AIdata.delta)
P.AI_delay0=AIdata.delta
P.AIdata={
next=AIdata.next,
hold=AIdata.hold,
_20G=P.gameEnv._20G,
bag7=AIdata.bag7=="bag7",
node=AIdata.node,
}
if not BOT then P.AI_mode="9S"end
if P.AI_mode=="CC"then
P.RS=AIRS
local opt,wei=BOT.getConf()
BOT.setHold(opt,P.AIdata.hold)
BOT.set20G(opt,P.AIdata._20G)
BOT.setBag(opt,P.AIdata.bag7)
BOT.setNode(opt,P.AIdata.node)
P.AI_bot=BOT.new(opt,wei)
BOT.free(opt)BOT.free(wei)
for i=1,AIdata.next do
BOT.addNext(P.AI_bot,CCblockID[P.next[i].id])
end
elseif P.AI_mode=="9S"then
P.RS=TRS
P.AI_keys={}
P.AI_Delay=min(int(P.gameEnv.drop*.8),2*AIdata.delta)
P.AI_Delay0=AIdata.delta
end
else
P.human=true
P.RS=TRS
human=human+1
end
P.showTime=visible_opt[P.gameEnv.visible] P.showTime=visible_opt[P.gameEnv.visible]
P.keepVisible=P.gameEnv.visible=="show" P.keepVisible=P.gameEnv.visible=="show"
P.keyPressing={}for i=1,12 do P.keyPressing[i]=false end P.keyPressing={}for i=1,12 do P.keyPressing[i]=false end
@@ -527,7 +577,7 @@ local function createBeam(S,R,send,time,target,color,clear,spin,mini,combo)
local radius,corner local radius,corner
local a,r,g,b=1,unpack(blockColor[color]) local a,r,g,b=1,unpack(blockColor[color])
if clear>10 then if clear>10 then
radius=30+3*(send-target) radius=10+3*send+100/(target+4)
local t=clear%10 local t=clear%10
if t==1 then if t==1 then
corner=3 corner=3
@@ -562,11 +612,9 @@ local function createBeam(S,R,send,time,target,color,clear,spin,mini,combo)
g=1-g*.3 g=1-g*.3
b=1-b*.3 b=1-b*.3
end end
if modeEnv.royaleMode then if modeEnv.royaleMode and not(S.human or R.human)then
if S.ai and R.ai then radius=radius*.4
radius=radius*.3 a=.35
a=.35
end
end end
FX.attack[#FX.attack+1]={ FX.attack[#FX.attack+1]={
x1=x1,y1=y1, x1=x1,y1=y1,
@@ -583,11 +631,10 @@ local function garbageSend(S,R,send,time,...)
R.lastRecv=S R.lastRecv=S
if R.atkBuffer.sum<20 then if R.atkBuffer.sum<20 then
local B=R.atkBuffer local B=R.atkBuffer
send=min(send,20-B.sum) if B.sum+send>20 then send=20-B.sum end--no more then 20
B.sum=B.sum+send
local m,k=#B,1 local m,k=#B,1
while k<=m and time>B[k].countdown do k=k+1 end while k<=m and time>B[k].countdown do k=k+1 end
for i=k,m do for i=m,k,-1 do
B[i+1]=B[i] B[i+1]=B[i]
end end
B[k]={ B[k]={
@@ -599,6 +646,7 @@ local function garbageSend(S,R,send,time,...)
sent=false, sent=false,
lv=min(int(send^.69),5), lv=min(int(send^.69),5),
}--Sorted insert }--Sorted insert
B.sum=B.sum+send
R.stat.recv=R.stat.recv+send R.stat.recv=R.stat.recv+send
if R.human then if R.human then
SFX(send<4 and "blip_1"or"blip_2",min(send+1,5)*.1) SFX(send<4 and "blip_1"or"blip_2",min(send+1,5)*.1)
@@ -606,15 +654,23 @@ local function garbageSend(S,R,send,time,...)
end end
end end
local function garbageRelease() local function garbageRelease()
for i=1,#P.atkBuffer do local flag
local A=P.atkBuffer[i] while true do
if not A.sent and A.countdown<=0 then local A=P.atkBuffer[1]
if A and A.countdown<=0 and not A.sent then
garbageRise(8+A.lv,A.amount,A.pos) garbageRise(8+A.lv,A.amount,A.pos)
P.atkBuffer.sum=P.atkBuffer.sum-A.amount P.atkBuffer.sum=P.atkBuffer.sum-A.amount
A.sent,A.time=true,0 A.sent,A.time=true,0
P.stat.pend=P.stat.pend+A.amount P.stat.pend=P.stat.pend+A.amount
for i=1,#P.atkBuffer do
P.atkBuffer[i]=P.atkBuffer[i+1]
end
flag=true
else
break
end end
end end
if flag and P.AI_mode=="CC"then CC_updateField(P)end
end end
function garbageRise(color,amount,pos) function garbageRise(color,amount,pos)
local t=P.showTime*2 local t=P.showTime*2
@@ -648,20 +704,24 @@ local function ckfull(i)
end end
local function checkrow(start,height)--(cy,r) local function checkrow(start,height)--(cy,r)
local c=0 local c=0
for i=start,start+height-1 do local h=start
if ckfull(i)then for i=1,height do
ins(P.clearing,1,i) if ckfull(h)then
ins(P.clearing,h)
removeRow(P.field,h)
removeRow(P.visTime,h)
c=c+1 c=c+1
if not P.small then if not P.small then
local S=PTC.dust[P.id] local S=PTC.dust[P.id]
for k=1,100 do for k=1,100 do
S:setPosition(rnd(300),600-30*i+rnd(30)) S:setPosition(rnd(300),600-30*h+rnd(30))
S:emit(3) S:emit(3)
end end
end end
else
h=h+1
end end
end end
if c>0 then P.falling=P.gameEnv.fall end
return c return c
end end
local function solid(x,y) local function solid(x,y)
@@ -714,7 +774,9 @@ end
local function spin(d,ifpre) local function spin(d,ifpre)
local idir=(P.dir+d)%4 local idir=(P.dir+d)%4
if P.cur.id==6 then if P.cur.id==6 then
freshLockDelay() if P.gameEnv.easyFresh then
freshLockDelay()
end
if P.human then if P.human then
SFX(ifpre and"prerotate"or"rotate") SFX(ifpre and"prerotate"or"rotate")
end end
@@ -765,7 +827,7 @@ local function spin(d,ifpre)
local ir,ic=#icb,#icb[1] local ir,ic=#icb,#icb[1]
local ix,iy=P.curX+P.sc[2]-isc[2],P.curY+P.sc[1]-isc[1] local ix,iy=P.curX+P.sc[2]-isc[2],P.curY+P.sc[1]-isc[1]
local t--succssful test local t--succssful test
local iki=TRS[P.cur.id][P.dir*10+idir] local iki=P.RS[P.cur.id][P.dir*10+idir]
for i=1,P.freshTime<=1.2*P.gameEnv.freshLimit and #iki or 1 do for i=1,P.freshTime<=1.2*P.gameEnv.freshLimit and #iki or 1 do
if not ifoverlap(icb,ix+iki[i][1],iy+iki[i][2])then if not ifoverlap(icb,ix+iki[i][1],iy+iki[i][2])then
ix,iy=ix+iki[i][1],iy+iki[i][2] ix,iy=ix+iki[i][1],iy+iki[i][2]
@@ -778,12 +840,13 @@ local function spin(d,ifpre)
if P.human and setting.fxs>0 then if P.human and setting.fxs>0 then
createShade(P.curX,P.curY+P.r-1,P.curX+P.c-1,P.curY) createShade(P.curX,P.curY+P.r-1,P.curX+P.c-1,P.curY)
end end
local y0=P.curY
P.curX,P.curY,P.dir=ix,iy,idir P.curX,P.curY,P.dir=ix,iy,idir
P.sc,P.cur.bk=scs[P.cur.id][idir],icb P.sc,P.cur.bk=scs[P.cur.id][idir],icb
P.r,P.c=ir,ic P.r,P.c=ir,ic
P.spinLast=t==2 and d==2 and 0 or 1 P.spinLast=t==2 and d==2 and 0 or 1
freshgho() if not ifpre then freshgho()end
freshLockDelay() if P.gameEnv.easyFresh or y0>P.curY then freshLockDelay()end
if P.human then if P.human then
SFX(ifpre and"prerotate"or ifoverlap(P.cur.bk,P.curX,P.curY+1)and ifoverlap(P.cur.bk,P.curX-1,P.curY)and ifoverlap(P.cur.bk,P.curX+1,P.curY)and"rotatekick"or"rotate") SFX(ifpre and"prerotate"or ifoverlap(P.cur.bk,P.curX,P.curY+1)and ifoverlap(P.cur.bk,P.curX-1,P.curY)and ifoverlap(P.cur.bk,P.curX+1,P.curY)and"rotatekick"or"rotate")
end end
@@ -797,14 +860,16 @@ local function hold(ifpre)
if P.cur.id==0 then if P.cur.id==0 then
P.cur=rem(P.next,1) P.cur=rem(P.next,1)
P.freshNext() P.freshNext()
if P.AI_mode=="CC"then BOT.addNext(P.AI_bot,CCblockID[P.next[P.AIdata.next].id])end
end end
P.sc,P.dir=scs[P.cur.id][0],0 P.sc,P.dir=scs[P.cur.id][0],0
P.r,P.c=#P.cur.bk,#P.cur.bk[1] P.r,P.c=#P.cur.bk,#P.cur.bk[1]
P.curX,P.curY=blockPos[P.cur.id],21+ceil(P.fieldBeneath/30)-P.r+min(int(#P.field*.2),2) P.curX,P.curY=blockPos[P.cur.id],21+ceil(P.fieldBeneath/30)-P.r+min(int(#P.field*.2),2)
if abs(P.moving)-P.gameEnv.das>1 and not ifoverlap(P.cur.bk,P.curX+(P.moving>0 and 1 or -1),P.curY)then if abs(P.moving)>P.gameEnv.das and not ifoverlap(P.cur.bk,P.curX+(P.moving>0 and 1 or -1),P.curY)then
P.curX=P.curX+(P.moving>0 and 1 or -1) P.curX=P.curX+(P.moving>0 and 1 or -1)
end end
--IMS
freshgho() freshgho()
P.dropDelay,P.lockDelay,P.freshTime=P.gameEnv.drop,P.gameEnv.lock,max(P.freshTime-5,0) P.dropDelay,P.lockDelay,P.freshTime=P.gameEnv.drop,P.gameEnv.lock,max(P.freshTime-5,0)
@@ -820,6 +885,7 @@ function resetblock()
P.holded,P.spinLast=false,false P.holded,P.spinLast=false,false
P.cur=rem(P.next,1) P.cur=rem(P.next,1)
P.freshNext() P.freshNext()
if P.AI_mode=="CC"then BOT.addNext(P.AI_bot,CCblockID[P.next[P.AIdata.next].id])end
P.sc,P.dir=scs[P.cur.id][0],0--spin center/direction P.sc,P.dir=scs[P.cur.id][0],0--spin center/direction
P.r,P.c=#P.cur.bk,#P.cur.bk[1]--row/column P.r,P.c=#P.cur.bk,#P.cur.bk[1]--row/column
P.curX,P.curY=blockPos[P.cur.id],21+ceil(P.fieldBeneath/30)-P.r+min(int(#P.field*.2),2) P.curX,P.curY=blockPos[P.cur.id],21+ceil(P.fieldBeneath/30)-P.r+min(int(#P.field*.2),2)
@@ -829,55 +895,56 @@ function resetblock()
if P.keyPressing[3]then spin(1,true)end if P.keyPressing[3]then spin(1,true)end
if P.keyPressing[4]then spin(-1,true)end if P.keyPressing[4]then spin(-1,true)end
if P.keyPressing[5]then spin(2,true)end if P.keyPressing[5]then spin(2,true)end
if abs(P.moving)-P.gameEnv.das>1 and not ifoverlap(P.cur.bk,P.curX+(P.moving>0 and 1 or -1),P.curY)then if abs(P.moving)>P.gameEnv.das and not ifoverlap(P.cur.bk,P.curX+(P.moving>0 and 1 or -1),P.curY)then
P.curX=P.curX+(P.moving>0 and 1 or -1) P.curX=P.curX+(P.moving>0 and 1 or -1)
end--Initial SYSs end
--Initial SYSs
if ifoverlap(P.cur.bk,P.curX,P.curY)then lock()Event.lose()end if ifoverlap(P.cur.bk,P.curX,P.curY)then lock()Event.lose()end
freshgho() freshgho()
if P.keyPressing[6]then act.hardDrop()P.keyPressing[6]=false end if P.keyPressing[6]then act.hardDrop()P.keyPressing[6]=false end
end end
function drop() function drop()
if P.curY==P.y_img then P.dropTime[11]=ins(P.dropTime,1,frame)--update speed dial
P.dropTime[11]=ins(P.dropTime,1,frame)--update speed dial P.waiting=P.gameEnv.wait
P.waiting=P.gameEnv.wait local dospin=0
local dospin=0 if P.spinLast then
if P.spinLast then if P.cur.id<6 then
if P.cur.id<6 then local x,y=P.curX+P.sc[2]-1,P.curY+P.sc[1]-1
local x,y=P.curX+P.sc[2]-1,P.curY+P.sc[1]-1 local c=0
local c=0 if solid(x-1,y+1)then c=c+1 end
if solid(x-1,y+1)then c=c+1 end if solid(x+1,y+1)then c=c+1 end
if solid(x+1,y+1)then c=c+1 end if c==0 then goto NTC end
if c==0 then goto NTC end if solid(x-1,y-1)then c=c+1 end
if solid(x-1,y-1)then c=c+1 end if solid(x+1,y-1)then c=c+1 end
if solid(x+1,y-1)then c=c+1 end if c>2 then dospin=dospin+1 end
if c>2 then dospin=dospin+1 end end--Three point
end--Three point ::NTC::
::NTC:: if P.cur.id~=6 and ifoverlap(P.cur.bk,P.curX-1,P.curY)and ifoverlap(P.cur.bk,P.curX+1,P.curY)and ifoverlap(P.cur.bk,P.curX,P.curY+1)then
if P.cur.id~=6 and ifoverlap(P.cur.bk,P.curX-1,P.curY)and ifoverlap(P.cur.bk,P.curX+1,P.curY)and ifoverlap(P.cur.bk,P.curX,P.curY+1)then dospin=dospin+2
dospin=dospin+2 end--Immobile
end--Immobile end
end lock()
lock() local cc,send,exblock=checkrow(P.curY,P.r),0,0--Currect clear&send&sendTime
local cc,send,exblock=checkrow(P.curY,P.r),0,0--Currect clear&send&sendTime if cc>0 then P.falling=P.gameEnv.fall end
local cscore,sendTime=0,0 local cscore,sendTime=0,0
local mini local mini
if P.spinLast and cc>0 and dospin>0 then if P.spinLast and cc>0 and dospin>0 then
dospin=dospin+P.spinLast dospin=dospin+P.spinLast
end end
if not P.spinLast then if not P.spinLast then
dospin=false
elseif cc==0 then
if dospin==0 then
dospin=false dospin=false
elseif cc==0 then
if dospin==0 then
dospin=false
end
elseif dospin<2 then
dospin=false
elseif dospin==2 then
mini=P.cur.id<6 and cc<3 and cc<P.r
end end
elseif dospin<2 then
dospin=false
elseif dospin==2 then
mini=P.cur.id<6 and cc<3 and cc<P.r
end
P.combo=P.combo+1--combo=0 is under if cc>0 then
P.combo=P.combo+1
if cc==4 then if cc==4 then
cscore=1000 cscore=1000
if P.b2b>1000 then if P.b2b>1000 then
@@ -955,7 +1022,7 @@ function drop()
VOICE(blockName[P.cur.name]) VOICE(blockName[P.cur.name])
VOICE("spin_") VOICE("spin_")
end end
elseif #P.clearing<#P.field then elseif #P.field>0 then
P.b2b=max(P.b2b-250,0) P.b2b=max(P.b2b-250,0)
showText(P,text.clear[cc],"appear",32+cc*3,-30,(8-cc)*.3) showText(P,text.clear[cc],"appear",32+cc*3,-30,(8-cc)*.3)
send=cc-1 send=cc-1
@@ -967,23 +1034,9 @@ function drop()
if P.human then if P.human then
VOICE(clearName[cc]) VOICE(clearName[cc])
end end
else
P.combo=0
if dospin then
showText(P,text.spin[P.cur.name],"appear",50,-30)
P.b2b=P.b2b+20
P.stat.spin_0=P.stat.spin_0+1
if P.human then
SFX("spin_0")
VOICE(blockName[P.cur.name])
VOICE("spin")
end
cscore=cscore+20
end
cscore=cscore+5
end end
send=send+(renATK[P.combo]or 4) send=send+(renATK[P.combo]or 3)
if #P.clearing==#P.field then if #P.field==0 then
showText(P,text.PC,"flicker",70,-80) showText(P,text.PC,"flicker",70,-80)
send=min(send,4)+min(6+P.stat.pc,10) send=min(send,4)+min(6+P.stat.pc,10)
exblock=exblock+2 exblock=exblock+2
@@ -1005,29 +1058,29 @@ function drop()
showText(P,text.cmb[min(P.combo,20)],P.combo<10 and"appear"or"flicker",20+min(P.combo,25)*3,60) showText(P,text.cmb[min(P.combo,20)],P.combo<10 and"appear"or"flicker",20+min(P.combo,25)*3,60)
cscore=cscore+min(20*P.combo,300)*cc cscore=cscore+min(20*P.combo,300)*cc
end end
sendTime=sendTime+20*P.combo sendTime=sendTime+25*P.combo
if P.human and cc>0 then if P.human then
SFX(clear_n[cc]) SFX(clear_n[cc])
SFX(ren_n[min(P.combo,11)]) SFX(ren_n[min(P.combo,11)])
if P.combo>14 then SFX("ren_mega",(P.combo-10)*.1)end if P.combo>14 then SFX("ren_mega",(P.combo-10)*.1)end
VIB(cc) VIB(cc+1)
end end
if P.b2b>1200 then P.b2b=1200 end if P.b2b>1200 then P.b2b=1200 end
if cc>0 and modeEnv.royaleMode then if modeEnv.royaleMode then
local i=min(#P.atker,9) local i=min(#P.atker,9)
if i>1 then if i>1 then
send=send+reAtk[i] send=send+reAtk[i]
exblock=exblock+reDef[i] exblock=exblock+reDef[i]
end end
end end--Counter attack
if send>0 then if send>0 then
P.stat.atk=P.stat.atk+send P.stat.atk=P.stat.atk+send
--ATK statistics --ATK statistics
if exblock then exblock=int(exblock*(1+P.strength*.25))end if exblock then exblock=int(exblock*(1+P.strength*.25))end
send=send*(1+P.strength*.25) send=send*(1+P.strength*.25)
if mini then send=send end if mini then send=send*.8 end
send=int(send) send=int(send)
--Badge Buff --Badge Buff
if send==0 then goto L end if send==0 then goto L end
@@ -1048,10 +1101,11 @@ function drop()
send=send-A.amount send=send-A.amount
P.atkBuffer.sum=P.atkBuffer.sum-A.amount P.atkBuffer.sum=P.atkBuffer.sum-A.amount
A.sent,A.time=true,0 A.sent,A.time=true,0
goto R if send>0 then goto R end
else else
A.amount=A.amount-send A.amount=A.amount-send
P.atkBuffer.sum=P.atkBuffer.sum-send P.atkBuffer.sum=P.atkBuffer.sum-send
send=0
end end
end end
::E:: ::E::
@@ -1081,59 +1135,39 @@ function drop()
P.stat.send=P.stat.send+send P.stat.send=P.stat.send+send
if P.human and send>3 then SFX("emit",min(send,8)*.125)end if P.human and send>3 then SFX("emit",min(send,8)*.125)end
end end
elseif cc==0 then
if P.b2b>1000 then
P.b2b=max(P.b2b-40,1000)
end
garbageRelease()
end
P.stat.score=P.stat.score+cscore
P.spinLast=dospin and cc>0
P.stat.piece,P.stat.row=P.stat.piece+1,P.stat.row+cc
if P.stat.row>=P.gameEnv.target then
P.gameEnv.reach()
end
if P.human then
SFX("lock")
end end
else else
P.curY=P.curY-1 P.combo=0
P.spinLast=false if dospin then
showText(P,text.spin[P.cur.name],"appear",50,-30)
P.b2b=P.b2b+20
P.stat.spin_0=P.stat.spin_0+1
if P.human then
SFX("spin_0")
VOICE(blockName[P.cur.name])
VOICE("spin")
end
cscore=cscore+30
end
cscore=cscore+10
if P.b2b>1000 then
P.b2b=max(P.b2b-40,1000)
end
garbageRelease()
end end
P.stat.score=P.stat.score+cscore
P.stat.piece,P.stat.row=P.stat.piece+1,P.stat.row+cc
P.gameEnv.dropPiece()
if P.human then SFX("lock")end
end end
function pressKey(i,p) function pressKey(i,p)
P=p P=p;P.keyPressing[i]=true
P.keyPressing[i]=true
if P.human then if P.human then
virtualkeyDown[i]=true virtualkeyDown[i]=true
virtualkeyPressTime[i]=10 virtualkeyPressTime[i]=10
end end
if i==10 then if P.alive then
act.restart() act[actName[i]]()
elseif P.alive then
if P.control and P.waiting==-1 then
act[actName[i]]()
if i>2 and i<7 then P.keyPressing[i]=false end
elseif i==9 and not setting.swap then
P.atkMode=P.atkMode<3 and P.atkMode+2 or 5-P.atkMode
elseif P.keyPressing[9]and setting.swap then
if i==1 then
P.atkMode=1
changeAtk(P,randomTarget(P))
elseif i==2 then
P.atkMode=2
elseif i==6 then
P.atkMode=3
elseif i==7 then
P.atkMode=4
end
else
if i==1 then
P.moving=-1
elseif i==2 then
P.moving=1
end
end
P.keyTime[11]=ins(P.keyTime,1,frame) P.keyTime[11]=ins(P.keyTime,1,frame)
P.stat.key=P.stat.key+1 P.stat.key=P.stat.key+1
end end
@@ -1146,65 +1180,94 @@ function releaseKey(i,p)
end end
act={ act={
moveLeft=function(auto) moveLeft=function(auto)
if P.keyPressing[9]and setting.swap then if P.keyPressing[9]then
changeAtkMode(1) if setting.swap then
else changeAtkMode(1)
if not auto then
P.moving=-1
end end
elseif P.control and P.waiting==-1 then
if not ifoverlap(P.cur.bk,P.curX-1,P.curY)then if not ifoverlap(P.cur.bk,P.curX-1,P.curY)then
P.curX=P.curX-1 P.curX=P.curX-1
local y0=P.curY
freshgho() freshgho()
freshLockDelay() if P.gameEnv.easyFresh or y0~=P.curY then freshLockDelay()end
if P.human and P.curY==P.y_img then SFX("move")end if P.human and P.curY==P.y_img then SFX("move")end
P.spinLast=false P.spinLast=false
if not auto then P.moving=-1 end
else
P.moving=-P.gameEnv.das-1
end end
else
P.moving=-1
end end
end, end,
moveRight=function(auto) moveRight=function(auto)
if P.keyPressing[9]and setting.swap then if P.keyPressing[9]then
changeAtkMode(2) if setting.swap then
else changeAtkMode(2)
if not auto then
P.moving=1
end end
elseif P.control and P.waiting==-1 then
if not ifoverlap(P.cur.bk,P.curX+1,P.curY)then if not ifoverlap(P.cur.bk,P.curX+1,P.curY)then
P.curX=P.curX+1 P.curX=P.curX+1
local y0=P.curY
freshgho() freshgho()
freshLockDelay() if P.gameEnv.easyFresh or y0~=P.curY then freshLockDelay()end
if P.human and P.curY==P.y_img then SFX("move")end if P.human and P.curY==P.y_img then SFX("move")end
P.spinLast=false P.spinLast=false
if not auto then P.moving=1 end
else
P.moving=P.gameEnv.das+1
end end
else
P.moving=1
end
end,
rotRight=function()
if P.control and P.waiting==-1 then
spin(1)
P.keyPressing[3]=false
end
end,
rotLeft=function()
if P.control and P.waiting==-1 then
spin(-1)
P.keyPressing[4]=false
end
end,
rotFlip=function()
if P.control and P.waiting==-1 then
spin(2)
P.keyPressing[5]=false
end end
end, end,
rotRight=function()spin(1)end,
rotLeft=function()spin(-1)end,
rotFlip=function()spin(2)end,
hardDrop=function() hardDrop=function()
if P.keyPressing[9]and setting.swap then if P.keyPressing[9]then
changeAtkMode(3) if setting.swap then
else changeAtkMode(3)
if P.waiting==-1 then
if P.curY~=P.y_img then
if P.human and setting.fxs>0 then
createShade(P.curX,P.curY+1,P.curX+P.c-1,P.y_img+P.r-1)
P.fieldOffY=2*setting.fxs+1
end
P.curY=P.y_img
P.spinLast=false
if P.human then
SFX("drop")
VIB(0)
end
end
P.lockDelay=-1
drop()
end end
P.keyPressing[6]=false
elseif P.control and P.waiting==-1 then
if P.curY~=P.y_img then
if P.human and setting.fxs>0 then
createShade(P.curX,P.curY+1,P.curX+P.c-1,P.y_img+P.r-1)
P.fieldOffY=2*setting.fxs+1
end
P.curY=P.y_img
P.spinLast=false
if P.human then
SFX("drop")
VIB(1)
end
end
P.lockDelay=-1
drop()
P.keyPressing[6]=false
end end
end, end,
softDrop=function() softDrop=function()
if P.keyPressing[9]and setting.swap then if P.keyPressing[9]then
changeAtkMode(4) if setting.swap then
changeAtkMode(4)
end
else else
if P.curY~=P.y_img then if P.curY~=P.y_img then
P.curY=P.curY-1 P.curY=P.curY-1
@@ -1213,33 +1276,21 @@ act={
P.downing=1 P.downing=1
end end
end, end,
hold=function()hold()end, hold=function()
func=function() if P.control and P.waiting==-1 then
if P.gameEnv.Fkey then hold()
if modeEnv.royaleMode then
for i=1,#P.keyPressing do
if P.keyPressing[i]then
P.keyPressing[i]=false
end
end
if setting.swap then
P.keyPressing[9]=true
else
changeAtkMode(P.atkMode<3 and P.atkMode+2 or 5-P.atkMode)
P.swappingAtkMode=30
end
end
if P.gameEnv.puzzle then
P.modeData.event=1-P.modeData.event
end
end end
end, end,
func=function()
P.gameEnv.Fkey()
end,
restart=function() restart=function()
if frame<180 then if frame<180 then
clearTask("play") clearTask("play")
resetPartGameData() resetPartGameData()
end end
end, end,
insDown=function() insDown=function()
if P.curY~=P.y_img then if P.curY~=P.y_img then
if P.human and setting.fxs>0 then if P.human and setting.fxs>0 then
@@ -1252,7 +1303,7 @@ act={
end end
end, end,
insLeft=function() insLeft=function()
local x0=P.curX local x0,y0=P.curX,P.curY
::L::if not ifoverlap(P.cur.bk,P.curX-1,P.curY)then ::L::if not ifoverlap(P.cur.bk,P.curX-1,P.curY)then
P.curX=P.curX-1 P.curX=P.curX-1
if P.human and setting.fxs>0 then if P.human and setting.fxs>0 then
@@ -1265,11 +1316,11 @@ act={
if P.human and setting.fxs>0 then if P.human and setting.fxs>0 then
P.fieldOffX=-2*setting.fxs P.fieldOffX=-2*setting.fxs
end end
freshLockDelay() if P.gameEnv.easyFresh or y0~=P.curY then freshLockDelay()end
end end
end, end,
insRight=function() insRight=function()
local x0=P.curX local x0,y0=P.curX,P.curY
::L::if not ifoverlap(P.cur.bk,P.curX+1,P.curY)then ::L::if not ifoverlap(P.cur.bk,P.curX+1,P.curY)then
P.curX=P.curX+1 P.curX=P.curX+1
if P.human and setting.fxs>0 then if P.human and setting.fxs>0 then
@@ -1282,7 +1333,7 @@ act={
if P.human and setting.fxs>0 then if P.human and setting.fxs>0 then
P.fieldOffX=2*setting.fxs P.fieldOffX=2*setting.fxs
end end
freshLockDelay() if P.gameEnv.easyFresh or y0~=P.curY then freshLockDelay()end
end end
end, end,
down1=function() down1=function()

View File

@@ -15,9 +15,10 @@ return{
PC="Perfect Clear", PC="Perfect Clear",
hold="暂存",next="下一个", hold="暂存",next="下一个",
stage={"关卡 1","关卡 2","关卡 3","关卡 4","关卡 5",}, stage=function(n)return"关卡 "..n end,
awesome="精彩。", great="Great!",
continue="继续。", awesome="Awesome.",
continue="Continue.",
maxspeed="最高速度", maxspeed="最高速度",
speedup="速度加快", speedup="速度加快",
@@ -44,7 +45,7 @@ return{
bgm="背景音乐:", bgm="背景音乐:",
}, },
customVal={ customVal={
drop={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,"","[20G]"}, drop={"[20G]",1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,""},
lock={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,""}, lock={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,""},
wait=nil, wait=nil,
fall=nil, fall=nil,
@@ -54,7 +55,7 @@ return{
visible={"可见","半隐","全隐","瞬隐"}, visible={"可见","半隐","全隐","瞬隐"},
target={10,20,40,100,200,500,1000,""}, target={10,20,40,100,200,500,1000,""},
freshLimit={0,8,15,""}, freshLimit={0,8,15,""},
opponent={"无电脑",1,2,3,4,5,6,7,8,9,10,11}, opponent={"无电脑","9S Lv1","9S Lv2","9S Lv3","9S Lv4","9S Lv5","CC Lv1","CC Lv2","CC Lv3","CC Lv4","CC Lv5","CC Lv6"},
}, },
softdropdas="软降DAS:", softdropdas="软降DAS:",
softdroparr="软降ARR:", softdroparr="软降ARR:",
@@ -68,7 +69,8 @@ return{
actName={"左移:","右移:","顺时针旋转:","逆时针旋转:","180°旋转","硬降:","软降:","暂存:","功能键:","重新开始:","左瞬移:","右瞬移:","软降到底:"}, actName={"左移:","右移:","顺时针旋转:","逆时针旋转:","180°旋转","硬降:","软降:","暂存:","功能键:","重新开始:","左瞬移:","右瞬移:","软降到底:"},
modeName={ modeName={
[0]="自定义", [0]="自定义",
"竞速","马拉松","大师","经典","","无尽","单挑","仅TSD","隐形","挖掘","生存","科研", "竞速","马拉松","大师","经典","","无尽","单挑","回合制","仅TSD","隐形",
"挖掘","生存","防守","进攻","科研",
"C4W练习","全清训练","全清挑战","49人混战","99人混战","干旱","多人", "C4W练习","全清训练","全清挑战","49人混战","99人混战","干旱","多人",
}, },
modeInfo={ modeInfo={
@@ -79,10 +81,13 @@ return{
zen="无重力消除200行", zen="无重力消除200行",
infinite="科研沙盒", infinite="科研沙盒",
solo="打败AI", solo="打败AI",
round="下棋",
tsd="尽可能做TSD", tsd="尽可能做TSD",
blind="最强大脑", blind="最强大脑",
dig="核能挖掘机", dig="核能挖掘机",
survivor="防守练习", survivor="你能存活多久?",
defender="防守练习",
attacker="进攻练习",
tech="尽可能不要普通消除", tech="尽可能不要普通消除",
c4wtrain="无 限 连 击", c4wtrain="无 限 连 击",
pctrain="熟悉全清定式的组合", pctrain="熟悉全清定式的组合",
@@ -147,8 +152,8 @@ return{
"使用LOVE2D引擎", "使用LOVE2D引擎",
"作者:MrZ 邮箱:1046101471@qq.com", "作者:MrZ 邮箱:1046101471@qq.com",
"程序:MrZ 美术:MrZ 音乐:MrZ 音效:MrZ 语音:Miya", "程序:MrZ 美术:MrZ 音乐:MrZ 音效:MrZ 语音:Miya",
"使用工具:VScode,GFIE,Beepbox,Goldwave", "使用工具:VScode,GFIE,Beepbox,Goldwave,Cold_Clear",
"特别感谢:Farter,196,Teatube,Flyz,T830,[所有测试人员]和 你!", "特别感谢:Farter,Flyz,196,Teatube,T830,[所有测试人员]和 你!",
"错误或者建议请附带相关信息发送到作者邮箱~", "错误或者建议请附带相关信息发送到作者邮箱~",
}, },
support="支持作者", support="支持作者",
@@ -217,6 +222,7 @@ return{
}, },
pause={ pause={
resume="继续", resume="继续",
restart="重新开始",
quit="退出", quit="退出",
}, },
setting={ setting={
@@ -224,7 +230,7 @@ return{
center=function()return"旋转中心:"..SWC[setting.center]end, center=function()return"旋转中心:"..SWC[setting.center]end,
grid=function()return"网格:"..SWC[setting.grid]end, grid=function()return"网格:"..SWC[setting.grid]end,
swap=function()return setting.swap and"目标选择:组合键"or"目标选择:循环"end, swap=function()return setting.swap and"目标选择:组合键"or"目标选择:循环"end,
fxs=function()return setting.fxs>0 and"特效等级:"..setting.fxs or"特效 "end, fxs=function()return setting.fxs>0 and"特效等级:"..setting.fxs or"特效:"end,
bg=function()return"背景:"..SWC[setting.bg]end, bg=function()return"背景:"..SWC[setting.bg]end,
dasD="-",dasU="+", dasD="-",dasU="+",
arrD="-",arrU="+", arrD="-",arrU="+",
@@ -248,13 +254,13 @@ return{
back=BK, back=BK,
}, },
setting3={ setting3={
back=BK,
hide=function()return setting.virtualkeySwitch and"隐藏虚拟按键"or"显示虚拟按键"end, hide=function()return setting.virtualkeySwitch and"隐藏虚拟按键"or"显示虚拟按键"end,
default="默认组合", default="默认组合",
snap=function()return text.snapLevelName[snapLevel]end, snap=function()return text.snapLevelName[snapLevel]end,
alpha=function()return setting.virtualkeyAlpha.."0%"end, alpha=function()return setting.virtualkeyAlpha.."0%"end,
icon="图标", icon="图标",
size="大小", size="大小",
back=BK,
}, },
help={ help={
his="历史", his="历史",

View File

@@ -15,7 +15,8 @@ return{
PC="场地全清", PC="场地全清",
hold="暂存",next="下一个", hold="暂存",next="下一个",
stage={"关卡 1","关卡 2","关卡 3","关卡 4","关卡 5",}, stage=function(n)return"关卡 "..n end,
great="不错!",
awesome="精彩。", awesome="精彩。",
continue="继续。", continue="继续。",
maxspeed="最高速度", maxspeed="最高速度",
@@ -44,7 +45,7 @@ return{
bgm="背景音乐:", bgm="背景音乐:",
}, },
customVal={ customVal={
drop={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,"","[20G]"}, drop={"[20G]",1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,""},
lock={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,""}, lock={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,""},
wait=nil, wait=nil,
fall=nil, fall=nil,
@@ -54,7 +55,7 @@ return{
visible={"可见","半隐","全隐","瞬隐"}, visible={"可见","半隐","全隐","瞬隐"},
target={10,20,40,100,200,500,1000,""}, target={10,20,40,100,200,500,1000,""},
freshLimit={0,8,15,""}, freshLimit={0,8,15,""},
opponent={"无电脑",1,2,3,4,5,6,7,8,9,10,11}, opponent={"无电脑","9S Lv1","9S Lv2","9S Lv3","9S Lv4","9S Lv5","CC Lv1","CC Lv2","CC Lv3","CC Lv4","CC Lv5","CC Lv6"},
}, },
softdropdas="软降DAS:", softdropdas="软降DAS:",
softdroparr="软降ARR:", softdroparr="软降ARR:",
@@ -68,7 +69,8 @@ return{
actName={"左移:","右移:","顺时针旋转:","逆时针旋转:","180°旋转","硬降:","软降:","暂存:","功能键:","重新开始:","左瞬移:","右瞬移:","软降到底:"}, actName={"左移:","右移:","顺时针旋转:","逆时针旋转:","180°旋转","硬降:","软降:","暂存:","功能键:","重新开始:","左瞬移:","右瞬移:","软降到底:"},
modeName={ modeName={
[0]="自定义", [0]="自定义",
"竞速","马拉松","大师","经典","","无尽","单挑","仅TSD","隐形","挖掘","生存","科研", "竞速","马拉松","大师","经典","","无尽","单挑","回合制","仅TSD","隐形",
"挖掘","生存","防守","进攻","科研",
"C4W练习","全清训练","全清挑战","49人混战","99人混战","干旱","多人", "C4W练习","全清训练","全清挑战","49人混战","99人混战","干旱","多人",
}, },
modeInfo={ modeInfo={
@@ -79,10 +81,13 @@ return{
zen="无重力消除200行", zen="无重力消除200行",
infinite="科研沙盒", infinite="科研沙盒",
solo="打败AI", solo="打败AI",
round="下棋",
tsd="尽可能做T旋双清", tsd="尽可能做T旋双清",
blind="最强大脑", blind="最强大脑",
dig="核能挖掘机", dig="核能挖掘机",
survivor="防守练习", survivor="你能存活多久?",
defender="防守练习",
attacker="进攻练习",
tech="尽可能不要普通消除!", tech="尽可能不要普通消除!",
c4wtrain="无 限 连 击", c4wtrain="无 限 连 击",
pctrain="熟悉全清定式的组合", pctrain="熟悉全清定式的组合",
@@ -147,8 +152,8 @@ return{
"使用LOVE2D引擎", "使用LOVE2D引擎",
"作者:MrZ 邮箱:1046101471@qq.com", "作者:MrZ 邮箱:1046101471@qq.com",
"程序:MrZ 美术:MrZ 音乐:MrZ 音效:MrZ 语音:Miya", "程序:MrZ 美术:MrZ 音乐:MrZ 音效:MrZ 语音:Miya",
"使用工具:VScode,GFIE,Beepbox,Goldwave", "使用工具:VScode,GFIE,Beepbox,Goldwave,Cold_Clear",
"特别感谢:Farter,Teatube,196,Flyz,T830,[所有测试人员]和 你!", "特别感谢:Farter,Flyz,196,Teatube,T830,[所有测试人员]和 你!",
"错误或者建议请附带相关信息发送到作者邮箱~", "错误或者建议请附带相关信息发送到作者邮箱~",
}, },
support="支持作者", support="支持作者",
@@ -217,6 +222,7 @@ return{
}, },
pause={ pause={
resume="继续", resume="继续",
restart="重新开始",
quit="退出", quit="退出",
}, },
setting={ setting={
@@ -224,7 +230,7 @@ return{
center=function()return"旋转中心:"..SWC[setting.center]end, center=function()return"旋转中心:"..SWC[setting.center]end,
grid=function()return"网格:"..SWC[setting.grid]end, grid=function()return"网格:"..SWC[setting.grid]end,
swap=function()return setting.swap and"目标选择:组合键"or"目标选择:循环"end, swap=function()return setting.swap and"目标选择:组合键"or"目标选择:循环"end,
fxs=function()return setting.fxs>0 and"特效等级:"..setting.fxs or"特效 "end, fxs=function()return setting.fxs>0 and"特效等级:"..setting.fxs or"特效:"end,
bg=function()return"背景:"..SWC[setting.bg]end, bg=function()return"背景:"..SWC[setting.bg]end,
dasD="-",dasU="+", dasD="-",dasU="+",
arrD="-",arrU="+", arrD="-",arrU="+",
@@ -248,13 +254,13 @@ return{
back=BK, back=BK,
}, },
setting3={ setting3={
back=BK,
hide=function()return setting.virtualkeySwitch and"隐藏虚拟按键"or"显示虚拟按键"end, hide=function()return setting.virtualkeySwitch and"隐藏虚拟按键"or"显示虚拟按键"end,
default="默认组合", default="默认组合",
snap=function()return text.snapLevelName[snapLevel]end, snap=function()return text.snapLevelName[snapLevel]end,
alpha=function()return setting.virtualkeyAlpha.."0%"end, alpha=function()return setting.virtualkeyAlpha.."0%"end,
icon="图标", icon="图标",
size="大小", size="大小",
back=BK,
}, },
help={ help={
his="历史", his="历史",

View File

@@ -15,7 +15,8 @@ return{
PC="Perfect Clear", PC="Perfect Clear",
hold="Hold",next="Next", hold="Hold",next="Next",
stage={"STAGE 1","STAGE 2","STAGE 3","STAGE 4","STAGE 5",}, stage=function(n)return"STAGE "..n end,
great="Great!",
awesome="Awesome.", awesome="Awesome.",
continue="Continue.", continue="Continue.",
maxspeed="Max speed", maxspeed="Max speed",
@@ -44,7 +45,7 @@ return{
bgm="BGM:", bgm="BGM:",
}, },
customVal={ customVal={
drop={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,"","[20G]"}, drop={"[20G]",1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,""},
lock={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,""}, lock={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,""},
wait=nil, wait=nil,
fall=nil, fall=nil,
@@ -54,7 +55,7 @@ return{
visible={"normal","time","invisible","sudden"}, visible={"normal","time","invisible","sudden"},
target={10,20,40,100,200,500,1000,""}, target={10,20,40,100,200,500,1000,""},
freshLimit={0,8,15,""}, freshLimit={0,8,15,""},
opponent={"No CPU",1,2,3,4,5,6,7,8,9,10,11}, opponent={"No CPU","9S Lv1","9S Lv2","9S Lv3","9S Lv4","9S Lv5","CC Lv1","CC Lv2","CC Lv3","CC Lv4","CC Lv5","CC Lv6"},
}, },
softdropdas="Down DAS:", softdropdas="Down DAS:",
softdroparr="Down ARR:", softdroparr="Down ARR:",
@@ -68,7 +69,8 @@ return{
actName={"Move Left:","Move Right:","Rotate Right:","Rotate Left:","Rotate Flip:","Hard Drop:","Soft Drop:","Hold:","Function:","Restart:","Instant Left:","Instant Right:","Ins Down:"}, actName={"Move Left:","Move Right:","Rotate Right:","Rotate Left:","Rotate Flip:","Hard Drop:","Soft Drop:","Hold:","Function:","Restart:","Instant Left:","Instant Right:","Ins Down:"},
modeName={ modeName={
[0]="Custom", [0]="Custom",
"Sprint","Marathon","Master","Classic","Zen","Infinite","1v1","TSD-only","Blind","Dig","Survivor","Tech", "Sprint","Marathon","Master","Classic","Zen","Infinite","1v1","Round","TSD-only","Blind",
"Dig","Survivor","Defender","Attacker","Tech",
"C4W Train","PC Train","PC Challenge","Techmino49","Techmino99","Drought","Hotseat", "C4W Train","PC Train","PC Challenge","Techmino49","Techmino99","Drought","Hotseat",
}, },
modeInfo={ modeInfo={
@@ -79,10 +81,13 @@ return{
zen="Clear 200 Lines without gravity", zen="Clear 200 Lines without gravity",
infinite="Infinite game,infinite happiness", infinite="Infinite game,infinite happiness",
solo="Beat AI", solo="Beat AI",
round="Chess?",
tsd="Make more T-spin-doubles", tsd="Make more T-spin-doubles",
blind="Invisible board", blind="Invisible board",
dig="Downstack!", dig="Downstack!",
survivor="Hand them!", survivor="Survive Longer!",
defender="Hand them!",
attacker="Attacking better then defending",
tech="Don't do normal clear", tech="Don't do normal clear",
c4wtrain="Infinite combo", c4wtrain="Infinite combo",
pctrain="Let's learn some PCs", pctrain="Let's learn some PCs",
@@ -147,8 +152,8 @@ return{
"Powered by LOVE2D", "Powered by LOVE2D",
"Author:MrZ E-mail:1046101471@qq.com", "Author:MrZ E-mail:1046101471@qq.com",
"Programe:MrZ Art:MrZ Music:MrZ SFX:MrZ VOICE:Miya", "Programe:MrZ Art:MrZ Music:MrZ SFX:MrZ VOICE:Miya",
"Tool used:VScode,GFIE,Beepbox,Goldwave", "Tool used:VScode,GFIE,Beepbox,Goldwave,Cold_Clear",
"Special thanks:Farter,Teatube,196,Flyz,T830,[all test staff] and YOU!", "Special thanks:Farter,Flyz,196,Teatube,T830,[all test staff] and YOU!",
"Any bugs/suggestions to my E-mail.", "Any bugs/suggestions to my E-mail.",
}, },
support="Support Author", support="Support Author",
@@ -217,6 +222,7 @@ return{
}, },
pause={ pause={
resume="Resume", resume="Resume",
restart="Restart",
quit="Quit", quit="Quit",
}, },
setting={ setting={
@@ -248,13 +254,13 @@ return{
back=BK, back=BK,
}, },
setting3={ setting3={
back=BK,
hide=function()return setting.virtualkeySwitch and"Hide Virtual Key"or"Show Virtual Key"end, hide=function()return setting.virtualkeySwitch and"Hide Virtual Key"or"Show Virtual Key"end,
default="Defaults", default="Defaults",
snap=function()return text.snapLevelName[snapLevel]end, snap=function()return text.snapLevelName[snapLevel]end,
alpha=function()return setting.virtualkeyAlpha.."0%"end, alpha=function()return setting.virtualkeyAlpha.."0%"end,
icon="Icon", icon="Icon",
size="Size", size="Size",
back=BK,
}, },
help={ help={
his="History", his="History",

288
list.lua
View File

@@ -2,7 +2,7 @@ local gc=love.graphics
local tc,kb=love.touch,love.keyboard local tc,kb=love.touch,love.keyboard
local sys=love.system local sys=love.system
local fs=love.filesystem local fs=love.filesystem
local mobile=mobile local mobile=system=="Android"or system=="iOS"
actName={"moveLeft","moveRight","rotRight","rotLeft","rotFlip","hardDrop","softDrop","hold","func","restart","insLeft","insRight","insDown"} actName={"moveLeft","moveRight","rotRight","rotLeft","rotFlip","hardDrop","softDrop","hold","func","restart","insLeft","insRight","insDown"}
color={ color={
@@ -79,6 +79,7 @@ bgm={
"secret8th", "secret8th",
"rockblock", "rockblock",
"8-bit happiness", "8-bit happiness",
"shining terminal",
"end", "end",
} }
voiceList={ voiceList={
@@ -120,12 +121,13 @@ musicID={
"push", "push",
"reason", "reason",
"infinite", "infinite",
"cruelty",
"final",
"secret7th", "secret7th",
"secret8th", "secret8th",
"shining terminal",
"rockblock", "rockblock",
"8-bit happiness", "8-bit happiness",
"cruelty",
"final",
"end", "end",
} }
customID={ customID={
@@ -139,7 +141,7 @@ customID={
"bg","bgm", "bg","bgm",
} }
customRange={ customRange={
drop={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99,-1}, drop={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99},
lock={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99}, lock={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99},
wait={0,1,2,3,4,5,6,7,8,10,15,20,30,60}, wait={0,1,2,3,4,5,6,7,8,10,15,20,30,60},
fall={0,1,2,3,4,5,6,7,8,10,15,20,30,60}, fall={0,1,2,3,4,5,6,7,8,10,15,20,30,60},
@@ -149,7 +151,7 @@ customRange={
visible={"show","time","fast","none"}, visible={"show","time","fast","none"},
target={10,20,40,100,200,500,1000,1e99}, target={10,20,40,100,200,500,1000,1e99},
freshLimit={0,8,15,1e99}, freshLimit={0,8,15,1e99},
opponent={0,60,30,20,15,10,7,5,4,3,2,1}, opponent={0,1,2,3,4,5,11,12,13,14,15,16},
bg={"none","game1","game2","game3","strap","rgb","glow","matrix"}, bg={"none","game1","game2","game3","strap","rgb","glow","matrix"},
bgm={"blank","way","race","newera","push","reason","infinite","secret7th","secret8th","rockblock"}, bgm={"blank","way","race","newera","push","reason","infinite","secret7th","secret8th","rockblock"},
} }
@@ -160,27 +162,31 @@ up0to4={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",}
modeID={ modeID={
[0]="custom", [0]="custom",
"sprint","marathon","master","classic","zen","infinite","solo","tsd","blind","dig","survivor","tech", "sprint","marathon","master","classic","zen","infinite","solo","round","tsd","blind",
"dig","survivor","defender","attacker","tech",
"c4wtrain","pctrain","pcchallenge","techmino49","techmino99","drought","hotseat", "c4wtrain","pctrain","pcchallenge","techmino49","techmino99","drought","hotseat",
} }
modeLevel={ modeLevel={
sprint={"10L","20L","40L","100L","400L","1000L"}, sprint={"10L","20L","40L","100L","400L","1000L"},
marathon={"EASY","NORMAL","HARD"}, marathon={"EASY","NORMAL","HARD"},
master={"LUNATIC","ULTIMATE"}, master={"LUNATIC","ULTIMATE","FINAL"},
classic={"CTWC"}, classic={"CTWC"},
zen={"NORMAL"}, zen={"NORMAL"},
infinite={"NORMAL","EXTRA"}, infinite={"NORMAL","EXTRA"},
solo={"EASY","NORMAL","HARD","LUNATIC"}, solo={"EASY","EASY+","NORMAL","NORMAL+","HARD","HARD+","LUNATIC","LUNATIC+","ULTIMATE"},
round={"EASY","NORMAL","HARD","LUNATIC","ULTIMATE"},
tsd={"NORMAL","HARD"}, tsd={"NORMAL","HARD"},
blind={"EASY","HARD","HARD+","LUNATIC","ULTIMATE","GM"}, blind={"EASY","HARD","HARD+","LUNATIC","ULTIMATE","GM"},
dig={"NORMAL","LUNATIC"}, dig={"NORMAL","LUNATIC"},
survivor={"EASY","NORMAL","HARD","LUNATIC","ULTIMATE","EXTRA"}, survivor={"EASY","NORMAL","HARD","LUNATIC","ULTIMATE","EXTRA"},
defender={"NORMAL","LUNATIC"},
attacker={"HARD","ULTIMATE"},
tech={"NORMAL","NORMAL+","HARD","HARD+","LUNATIC","LUNATIC+",}, tech={"NORMAL","NORMAL+","HARD","HARD+","LUNATIC","LUNATIC+",},
c4wtrain={"NORMAL","LUNATIC"}, c4wtrain={"NORMAL","LUNATIC"},
pctrain={"NORMAL","EXTRA"}, pctrain={"NORMAL","EXTRA"},
pcchallenge={"NORMAL","HARD","LUNATIC"}, pcchallenge={"NORMAL","HARD","LUNATIC"},
techmino49={"EASY","NORMAL","HARD","LUNATIC","ULTIMATE"}, techmino49={"EASY","HARD","ULTIMATE"},
techmino99={"EASY","NORMAL","HARD","LUNATIC","ULTIMATE"}, techmino99={"EASY","HARD","ULTIMATE"},
drought={"NORMAL","MESS"}, drought={"NORMAL","MESS"},
hotseat={"2P","3P","4P",}, hotseat={"2P","3P","4P",},
custom={"Normal","Puzzle"}, custom={"Normal","Puzzle"},
@@ -274,194 +280,192 @@ local function useDefaultSet(n)
curBG=customRange.bg[customSel[12]] curBG=customRange.bg[customSel[12]]
BGM(customRange.bgm[customSel[13]]) BGM(customRange.bgm[customSel[13]])
end end
Buttons={ Widget={
load={}, load={},
intro={}, intro={},
main={ main={
qplay= {x=160,y=300,w=150, h=150, rgb=color.lightRed, f=40,code=function()loadGame(modeSel,levelSel)end,down="stat",right="play"}, qplay= newButton(160, 300,150,150,color.lightRed, 40,function()loadGame(modeSel,levelSel)end, nil, nil, "stat", nil, "play" ),
play= {x=380,y=300,w=240, h=240, rgb=color.red, f=70,code=function()gotoScene("mode")end,down="stat",left="qplay",right="setting"}, play= newButton(380, 300,240,240,color.red, 70,function()gotoScene("mode")end, nil, nil, "stat", "qplay", "setting" ),
setting={x=640,y=300,w=240, h=240, rgb=color.lightBlue,f=55,code=function()gotoScene("setting")end,down="stat",left="play",right="music"}, setting=newButton(640, 300,240,240,color.lightBlue,55,function()gotoScene("setting")end, nil, nil, "stat", "play", "music" ),
music= {x=900,y=300,w=240, h=240, rgb=color.lightCyan,f=42,code=function()gotoScene("music")end,down="help",left="setting",right="quit"}, music= newButton(900, 300,240,240,color.lightCyan,42,function()gotoScene("music")end, nil, nil, "help", "setting", "quit" ),
stat= {x=640,y=560,w=240, h=240, rgb=color.cyan, f=55,code=function()gotoScene("stat")end,up="setting",left="play",right="help"}, stat= newButton(640, 560,240,240,color.cyan, 55,function()gotoScene("stat")end, nil, "setting", nil, "play", "help" ),
help= {x=900,y=560,w=240, h=240, rgb=color.yellow, f=55,code=function()gotoScene("help")end,up="music",left="stat",right="quit"}, help= newButton(900, 560,240,240,color.yellow, 55,function()gotoScene("help")end, nil, "music", nil, "stat", "quit" ),
quit= {x=1180,y=620,w=120,h=120, rgb=color.lightGrey,f=50,code=function()gotoScene("quit")end,up="setting",left="help"}, quit= newButton(1180, 620,120,120,color.lightGrey,50,function()gotoScene("quit")end, nil, "music", nil, "help", nil ),
}, },
mode={ mode={
up= {x=1000,y=210,w=200,h=140, rgb=color.white, f=80, code=function()love.keypressed("up")end, hide=function()return modeSel==1 end,}, up= newButton(1000, 210,200,140,color.white, 80,function()love.keypressed("up")end,function()return modeSel==1 end),
down= {x=1000,y=430,w=200,h=140, rgb=color.white, f=80, code=function()love.keypressed("down")end, hide=function()return modeSel==#modeID end,}, down= newButton(1000, 430,200,140,color.white, 80,function()love.keypressed("down")end,function()return modeSel==#modeID end),
left= {x=190, y=160,w=100,h=80, rgb=color.white, code=function()love.keypressed("left")end, hide=function()return levelSel==1 end,}, left= newButton(190, 160,100,80, color.white, 40,function()love.keypressed("left")end,function()return levelSel==1 end),
right= {x=350, y=160,w=100,h=80, rgb=color.white, code=function()love.keypressed("right")end, hide=function()return levelSel==#modeLevel[modeID[modeSel]]end,}, right= newButton(350, 160,100,80, color.white, 40,function()love.keypressed("right")end,function()return levelSel==#modeLevel[modeID[modeSel]]end),
start= {x=1000,y=600,w=250,h=100, rgb=color.green, f=50, code=function()loadGame(modeSel,levelSel)end}, start= newButton(1000, 600,250,100,color.green, 50,function()loadGame(modeSel,levelSel)end),
custom= {x=275, y=420,w=200,h=90, rgb=color.yellow, code=function()gotoScene("custom")end}, custom= newButton(275, 420,200,90, color.yellow, 40,function()gotoScene("custom")end),
back= {x=640, y=630,w=230,h=90, rgb=color.white, f=45, code=back}, back= newButton(640, 630,230,90, color.white, 45,back),
}, },
music={ music={
bgm= {x=1100,y=80, w=160, h=80, rgb=color.white,code=function()BGM()setting.bgm=not setting.bgm end}, bgm= newButton(1100, 80, 160,80, color.white,40,function()BGM()setting.bgm=not setting.bgm end),
up= {x=1100,y=200, w=120, h=120, rgb=color.white,f=40,hide=function()return not setting.bgm end,code=function()sel=(sel-2)%#musicID+1 end}, up= newButton(1100, 200, 120,120,color.white,60,function()love.keypressed("up")end, function()return not setting.bgm end),
play= {x=1100,y=340, w=120, h=120, rgb=color.white,f=40,hide=function()return not setting.bgm end,code=function()BGM(musicID[sel])end}, play= newButton(1100, 340, 120,120,color.white,40,function()love.keypressed("space")end, function()return not setting.bgm end),
down= {x=1100,y=480, w=120, h=120, rgb=color.white,f=50,hide=function()return not setting.bgm end,code=function()sel=sel%#musicID+1 end}, down= newButton(1100, 480, 120,120,color.white,60,function()love.keypressed("down")end, function()return not setting.bgm end),
back= {x=640, y=630, w=230, h=90, rgb=color.white,f=45,code=back}, back= newButton(640, 630, 230,90, color.white,45,back),
}, },
custom={ custom={
up= {x=1000,y=220, w=100,h=100, rgb=color.white,f=50, code=function()sel=(sel-2)%#customID+1 end}, up= newButton(1000, 220, 100,100,color.white, 50,function()sel=(sel-2)%#customID+1 end),
down= {x=1000,y=460, w=100,h=100, rgb=color.white,f=50, code=function()sel=sel%#customID+1 end}, down= newButton(1000, 460, 100,100,color.white, 50,function()sel=sel%#customID+1 end),
left= {x=880, y=340, w=100,h=100, rgb=color.white,f=50, code=function() left= newButton(880, 340, 100,100,color.white, 50,function()love.keypressed("left")end),
customSel[sel]=(customSel[sel]-2)%#customRange[customID[sel]]+1 right= newButton(1120, 340, 100,100,color.white, 50,function()love.keypressed("right")end),
if sel==12 then start1= newButton(880, 580, 220,70, color.green, 40,function()loadGame(0,1)end),
curBG=customRange.bg[customSel[12]] start2= newButton(1120, 580, 220,70, color.lightPurple, 40,function()loadGame(0,2)end),
elseif sel==13 then draw= newButton(1000, 90, 190,85, color.cyan, 40,function()gotoScene("draw")end),
BGM(customRange.bgm[customSel[13]]) set1= newButton(640, 160, 240,75, color.lightRed, 40,function()useDefaultSet(1)end),
end set2= newButton(640, 250, 240,75, color.lightRed, 40,function()useDefaultSet(2)end),
end}, set3= newButton(640, 340, 240,75, color.lightRed, 40,function()useDefaultSet(3)end),
right= {x=1120,y=340, w=100,h=100, rgb=color.white,f=50, code=function() set4= newButton(640, 430, 240,75, color.lightRed, 40,function()useDefaultSet(4)end),
customSel[sel]=customSel[sel]%#customRange[customID[sel]]+1 set5= newButton(640, 520, 240,75, color.lightRed, 40,function()useDefaultSet(5)end),
if sel==12 then back= newButton(640, 630, 180,60, color.white, 40,back),
curBG=customRange.bg[customSel[12]]
elseif sel==13 then
BGM(customRange.bgm[customSel[13]])
end
end},
start1= {x=880, y=580, w=220,h=70, rgb=color.green, code=function()loadGame(0,1)end},
start2= {x=1120,y=580, w=220,h=70, rgb=color.lightPurple, code=function()loadGame(0,2)end},
draw= {x=1000,y=90, w=190,h=85, rgb=color.cyan, code=function()gotoScene("draw")end},
set1= {x=640, y=160, w=240,h=75, rgb=color.lightRed, code=function()useDefaultSet(1)end},
set2= {x=640, y=250, w=240,h=75, rgb=color.lightRed, code=function()useDefaultSet(2)end},
set3= {x=640, y=340, w=240,h=75, rgb=color.lightRed, code=function()useDefaultSet(3)end},
set4= {x=640, y=430, w=240,h=75, rgb=color.lightRed, code=function()useDefaultSet(4)end},
set5= {x=640, y=520, w=240,h=75, rgb=color.lightRed, code=function()useDefaultSet(5)end},
back= {x=640, y=630, w=180,h=60, rgb=color.white, code=back},
}, },
draw={ draw={
any= {x=700, y=80,w=120,h=120, f=45, rgb=color.lightGrey,code=function()pen=-1 end}, any= newButton(700, 80, 120,120,color.lightGrey, 45,function()pen=0 end),
block1= {x=840, y=80,w=120,h=120, f=65, rgb=color.red, code=function()pen=1 end}, block1= newButton(840, 80, 120,120,color.red, 65,function()pen=1 end),
block2= {x=980, y=80,w=120,h=120, f=65, rgb=color.green, code=function()pen=2 end}, block2= newButton(980, 80, 120,120,color.green, 65,function()pen=2 end),
block3= {x=1120,y=80,w=120,h=120, f=65, rgb=color.orange, code=function()pen=3 end}, block3= newButton(1120, 80, 120,120,color.orange, 65,function()pen=3 end),
block4= {x=840, y=220,w=120,h=120, f=65, rgb=color.blue, code=function()pen=4 end}, block4= newButton(840, 220, 120,120,color.blue, 65,function()pen=4 end),
block5= {x=980, y=220,w=120,h=120, f=65, rgb=color.magenta, code=function()pen=5 end}, block5= newButton(980, 220, 120,120,color.magenta, 65,function()pen=5 end),
block6= {x=1120,y=220,w=120,h=120, f=65, rgb=color.yellow, code=function()pen=6 end}, block6= newButton(1120, 220, 120,120,color.yellow, 65,function()pen=6 end),
block7= {x=840, y=360,w=120,h=120, f=65, rgb=color.cyan, code=function()pen=7 end}, block7= newButton(840, 360, 120,120,color.cyan, 65,function()pen=7 end),
gb1= {x=980, y=360,w=120,h=120, f=65, rgb=color.darkGrey, code=function()pen=9 end}, gb1= newButton(980, 360, 120,120,color.darkGrey, 65,function()pen=9 end),
gb2= {x=1120,y=360,w=120,h=120, f=65, rgb=color.grey, code=function()pen=10 end}, gb2= newButton(1120, 360, 120,120,color.grey, 65,function()pen=10 end),
gb3= {x=840, y=500,w=120,h=120, f=65, rgb=color.darkPurple,code=function()pen=11 end}, gb3= newButton(840, 500, 120,120,color.darkPurple, 65,function()pen=11 end),
gb4= {x=980, y=500,w=120,h=120, f=65, rgb=color.darkRed, code=function()pen=12 end}, gb4= newButton(980, 500, 120,120,color.darkRed, 65,function()pen=12 end),
gb5= {x=1120,y=500,w=120,h=120, f=65, rgb=color.darkGreen,code=function()pen=13 end}, gb5= newButton(1120, 500, 120,120,color.darkGreen, 65,function()pen=13 end),
space= {x=840, y=640,w=120,h=120, f=70, rgb=color.grey, code=function()pen=0 end}, space= newButton(840, 640, 120,120,color.grey, 70,function()pen=-1 end),
clear= {x=1120,y=640,w=120,h=120, f=45, rgb=color.white, code=function() clear= newButton(1120, 640, 120,120,color.white, 45,function()love.keypressed("delete")end),
if clearSureTime>15 then back= newButton(1235, 45, 80, 80, color.white, 35,back),
for y=1,20 do for x=1,10 do preField[y][x]=-1 end end
clearSureTime=0
else
clearSureTime=50
end
end},
back= {x=1235,y=45,w=80,h=80, f=35, rgb=color.white, code=back},
}, },
play={ play={
pause={x=1235,y=45,w=80,h=80,rgb=color.white,f=30,code=pauseGame}, pause= newButton(1235,45,80,80,color.white,30,pauseGame),
}, },
pause={ pause={
resume= {x=640,y=400,w=240,h=100, rgb=color.white,f=50,code=resumeGame}, resume= newButton(640,290,240,100,color.white,50,resumeGame),
quit= {x=640,y=550,w=240,h=100, rgb=color.white,f=50,code=back}, restart=newButton(640,445,240,100,color.white,50,function()
clearTask("play")
updateStat()
resetGameData()
gotoScene("play","none")
end),
quit= newButton(640,600,240,100,color.white,50,back),
}, },
setting={--Normal setting setting={--Normal setting
ghost= {x=290, y=90, w=210, h=60, rgb=color.white,code=function()setting.ghost=not setting.ghost end,down="grid",right="center"}, ghost= newButton(290, 90, 210,60,color.white,40,function()setting.ghost=not setting.ghost end, nil, nil, "grid", nil, "center" ),
center= {x=505, y=90, w=210, h=60, rgb=color.white,code=function()setting.center=not setting.center end,down="swap",left="ghost",right="sfx"}, center= newButton(505, 90, 210,60,color.white,40,function()setting.center=not setting.center end, nil, nil, "swap", "ghost", "sfx" ),
grid= {x=290, y=160, w=210, h=60, rgb=color.white,code=function()setting.grid=not setting.grid end,up="ghost",down="fxs",right="swap"}, grid= newButton(290, 160,210,60,color.white,40,function()setting.grid=not setting.grid end, nil, "ghost", "fxs", nil, "swap" ),
swap= {x=505, y=160, w=210, h=60,f=28, rgb=color.white,code=function()setting.swap=not setting.swap end,up="center",down="bg",left="grid",right="vib"}, swap= newButton(505, 160,210,60,color.white,28,function()setting.swap=not setting.swap end, nil, "center", "bg", "grid", "vib" ),
fxs= {x=290, y=230, w=210, h=60, rgb=color.white,code=function()setting.fxs=(setting.fxs+1)%4 end,up="grid",down="dasU",right="bg"}, fxs= newButton(290, 230,210,60,color.white,40,function()setting.fxs=(setting.fxs+1)%4 end, nil, "grid", "dasU", nil, "bg" ),
bg= {x=505, y=230, w=210, h=60, rgb=color.white,code=function()setting.bg=not setting.bg end,up="swap",down="arrD",left="fxs",right="fullscreen"}, bg= newButton(505, 230,210,60,color.white,40,function()setting.bg=not setting.bg end, nil, "swap", "arrD", "fxs", "fullscreen" ),
dasD= {x=210, y=300, w=50, h=50, rgb=color.white,code=function()setting.das=(setting.das-1)%31 end,up="fxs",down="sddasD",right="dasU"}, dasD= newButton(210, 300,50, 50,color.white,40,function()setting.das=(setting.das-1)%31 end, nil, "fxs", "sddasD", nil, "dasU" ),
dasU= {x=370, y=300, w=50, h=50, rgb=color.white,code=function()setting.das=(setting.das+1)%31 end,up="fxs",down="sddasU",left="dasD",right="arrD"}, dasU= newButton(370, 300,50, 50,color.white,40,function()setting.das=(setting.das+1)%31 end, nil, "fxs", "sddasU", "dasD", "arrD" ),
arrD= {x=425, y=300, w=50, h=50, rgb=color.white,code=function()setting.arr=(setting.arr-1)%16 end,up="bg",down="sdarrD",left="dasU",right="arrU"}, arrD= newButton(425, 300,50, 50,color.white,40,function()
arrU= {x=585, y=300, w=50, h=50, rgb=color.white,code=function()setting.arr=(setting.arr+1)%16 end,up="bg",down="sdarrU",left="arrD",right="bgblock"},--3~6 setting.arr=(setting.arr-1)%16
sddasD= {x=210, y=370, w=50, h=50, rgb=color.white,code=function()setting.sddas=(setting.sddas-1)%11 end,up="dasD",down="ctrl",right="sddasU"}, if setting.arr>setting.das then
sddasU= {x=370, y=370, w=50, h=50, rgb=color.white,code=function()setting.sddas=(setting.sddas+1)%11 end,up="dasU",down="ctrl",left="sddasD",right="sdarrD"}, setting.das=setting.arr
sdarrD= {x=425, y=370, w=50, h=50, rgb=color.white,code=function()setting.sdarr=(setting.sdarr-1)%4 end,up="arrD",down="ctrl",left="sddasU",right="sdarrU"}, Widget.setting.dasU.alpha,Widget.setting.dasD.alpha=1,1
sdarrU= {x=585, y=370, w=50, h=50, rgb=color.white,code=function()setting.sdarr=(setting.sdarr+1)%4 end,up="arrU",down="ctrl",left="sdarrD",right="frame"}, SFX("blip_1",.4)
end
end,nil,"bg","sdarrD","dasU","arrU"),
arrU= newButton(585, 300,50, 50,color.white,40,function()
setting.arr=(setting.arr+1)%16
if setting.arr>setting.das then
setting.das=setting.arr
Widget.setting.dasU.alpha,Widget.setting.dasD.alpha=1,1
SFX("blip_1",.4)
end
end,nil,"bg","sdarrU","arrD","bgblock"),
sddasD= newButton(210, 370,50, 50,color.white,40,function()setting.sddas=(setting.sddas-1)%11 end, nil, "dasD", "ctrl", nil, "sddasU" ),
sddasU= newButton(370, 370,50, 50,color.white,40,function()setting.sddas=(setting.sddas+1)%11 end, nil, "dasU", "ctrl", "sddasD", "sdarrD" ),
sdarrD= newButton(425, 370,50, 50,color.white,40,function()setting.sdarr=(setting.sdarr-1)%4 end, nil, "arrD", "ctrl", "sddasU", "sdarrU" ),
sdarrU= newButton(585, 370,50, 50,color.white,40,function()setting.sdarr=(setting.sdarr+1)%4 end, nil, "arrU", "ctrl", "sdarrD", "frame" ),
ctrl= {x=340,y=440, w=310, h=60,rgb=color.green, code=function()gotoScene("setting2")end,up="sddasU",down="touch",left="lang",right="skin"}, ctrl= newButton(340,440, 310,60,color.green,40, function()gotoScene("setting2")end, nil, "sddasU", "touch", "lang", "skin" ),
touch= {x=340,y=510, w=310, h=60,rgb=color.yellow,code=function()gotoScene("setting3")end,up="ctrl",down="back",right="lang"}, touch= newButton(340,510, 310,60,color.yellow,40, function()gotoScene("setting3")end, nil, "ctrl", "back", nil, "lang" ),
lang= {x=580,y=510, w=150, h=60,rgb=color.red, code=function() lang= newButton(580,510, 150,60,color.red,40, function()
setting.lang=setting.lang%#langName+1 setting.lang=setting.lang%#langName+1
swapLanguage(setting.lang) swapLanguage(setting.lang)
end,up="sdarrU",down="back",left="touch",right="skin"}, end,nil,"sdarrU","back","touch","skin"),
sfx= {x=760,y=90, w=160, h=60, rgb=color.white,code=function()setting.sfx=not setting.sfx end,down="vib",left="center",right="bgm"}, sfx= newButton(760,90, 160,60,color.white,40, function()setting.sfx=not setting.sfx end, nil, nil, "vib", "center", "bgm" ),
bgm= {x=940,y=90, w=160, h=60, rgb=color.white,code=function()BGM()setting.bgm=not setting.bgm BGM("blank")end,down="voc",left="sfx"}, bgm= newButton(940,90, 160,60,color.white,40, function()BGM()setting.bgm=not setting.bgm BGM("blank")end, nil, nil, "voc", "sfx", nil ),
vib= {x=760,y=160, w=160, h=60,rgb=color.white, code=function()setting.vib=(setting.vib+1)%6 VIB(1)end,up="sfx",down="fullscreen",left="swap",right="voc"}, vib= newButton(760,160, 160,60,color.white,40, function()setting.vib=(setting.vib+1)%6 VIB(1)end, nil, "sfx", "fullscreen", "swap", "voc" ),
voc= {x=940,y=160, w=160, h=60,rgb=color.white,code=function()setting.voc=not setting.voc end,up="sfx",down="fullscreen",left="vib"}, voc= newButton(940,160, 160,60,color.white,40, function()setting.voc=not setting.voc end, nil, "sfx", "fullscreen", "vib", nil ),
fullscreen= {x=850,y=230,w=340, h=60,rgb=color.white, code=function() fullscreen= newButton(850,230, 340,60,color.white,40, function()
setting.fullscreen=not setting.fullscreen setting.fullscreen=not setting.fullscreen
love.window.setFullscreen(setting.fullscreen) love.window.setFullscreen(setting.fullscreen)
if not setting.fullscreen then if not setting.fullscreen then
love.resize(gc.getWidth(),gc.getHeight()) love.resize(gc.getWidth(),gc.getHeight())
end end
end,up="vib",down="bgblock",left="bg"}, end,nil,"vib","bgblock","bg",nil),
bgblock={x=850,y=300, w=340, h=60,rgb=color.white, code=function() bgblock= newButton(850,300, 340,60,color.white,40, function()
setting.bgblock=not setting.bgblock setting.bgblock=not setting.bgblock--if not setting.bgblock then for i=1,16 do BGblockList[i].v=3*BGblockList[i].v end end
--if not setting.bgblock then for i=1,16 do BGblockList[i].v=3*BGblockList[i].v end end end,nil,"fullscreen","frame","arrU",nil),
end,up="fullscreen",down="frame",left="arrU"}, frame= newButton(850,370, 340,60,color.white,40, function()
frame= {x=850,y=370, w=340, h=60,rgb=color.white, code=function()
setting.frameMul=setting.frameMul+(setting.frameMul<50 and 5 or 10) setting.frameMul=setting.frameMul+(setting.frameMul<50 and 5 or 10)
if setting.frameMul>100 then setting.frameMul=25 end if setting.frameMul>100 then setting.frameMul=25 end
end,up="bgblock",down="skin",left="sdarrU"}, end,nil,"bgblock","skin","sdarrU",nil),
skin= {x=740,y=440, w=120, h=60,rgb=color.white, code=function() skin= newButton(740,440, 120,60,color.white,40, function()
setting.skin=setting.skin%6+1 setting.skin=setting.skin%6+1
changeBlockSkin(setting.skin) changeBlockSkin(setting.skin)
end,up="frame",down="back",left="ctrl",right="smo"}, end,nil,"frame","back","ctrl","smo"),
smo= {x=920,y=440, w=200, h=60,f=27,rgb=color.white, code=function() smo= newButton(920,440, 200,60,color.white,27, function()
setting.smo=not setting.smo setting.smo=not setting.smo
end,up="frame",down="back",left="skin"}, end,nil,"frame","back","skin",nil),
back= {x=640,y=620, w=300,h=70,rgb=color.white, code=back,up="lang"}, back= newButton(640,620, 300,70,color.white,40, back,nil,nil,"lang",nil,nil),
}, },
setting2={--Control setting setting2={--Control setting
back={x=840,y=630,w=180,h=60,rgb=color.white,code=back}, back=newButton(840,630,180,60,color.white,40,back),
}, },
setting3={--Touch setting setting3={--Touch setting
back={x=640,y=410,w=170,h=80,f=45,code=back}, hide= newButton(640,210,500,80,color.white,45,function()
hide={x=640,y=210,w=500,h=80,f=45,code=function()
setting.virtualkeySwitch=not setting.virtualkeySwitch setting.virtualkeySwitch=not setting.virtualkeySwitch
end}, end),
default={x=450,y=310,w=170,h=80,code=function() default=newButton(450,310,170,80,color.white,40,function()
for K=1,#virtualkey do for K=1,#virtualkey do
local b,b0=virtualkey[K],virtualkeySet[defaultSel][K] local b,b0=virtualkey[K],virtualkeySet[defaultSel][K]
b[1],b[2],b[3],b[4]=b0[1],b0[2],b0[3],b0[4] b[1],b[2],b[3],b[4]=b0[1],b0[2],b0[3],b0[4]
end--Default virtualkey end--Default virtualkey
defaultSel=defaultSel%5+1 defaultSel=defaultSel%5+1
end}, end),
snap={x=640,y=310,w=170,h=80,code=function() snap= newButton(640,310,170,80,color.white,40,function()
snapLevel=snapLevel%6+1 snapLevel=snapLevel%6+1
end}, end),
alpha={x=830,y=310,w=170,h=80,f=45,code=function() alpha= newButton(830,310,170,80,color.white,45,function()
setting.virtualkeyAlpha=(setting.virtualkeyAlpha+1)%11 setting.virtualkeyAlpha=(setting.virtualkeyAlpha+1)%11
--Adjust virtualkey alpha --Adjust virtualkey alpha
end}, end),
icon={x=450,y=410,w=170,h=80,f=45,code=function() icon= newButton(450,410,170,80,color.white,45,function()
setting.virtualkeyIcon=not setting.virtualkeyIcon setting.virtualkeyIcon=not setting.virtualkeyIcon
--Switch virtualkey icon --Switch virtualkey icon
end}, end),
size={x=830,y=410,w=170,h=80,f=45,code=function() size= newButton(830,410,170,80,color.white,45,function()
if sel then if sel then
local b=virtualkey[sel] local b=virtualkey[sel]
b[4]=b[4]+10 b[4]=b[4]+10
if b[4]==150 then b[4]=40 end if b[4]==150 then b[4]=40 end
b[3]=b[4]^2 b[3]=b[4]^2
end end
end}, end),
back= newButton(640,410,170,80,color.white,45,back),
}, },
help={ help={
his={x=1050,y=520,w=230,h=60,rgb=color.white,code=function()gotoScene("history")end,down="qq",left="back"}, his= newButton(1050, 520,230,60,color.white,40,function()gotoScene("history")end, nil, nil, "qq", "back", nil),
qq={x=1050,y=600,w=230,h=60,hide=function()return mobile end,rgb=color.white,code=function()sys.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,up="his",left="back"}, qq= newButton(1050, 600,230,60,color.white,40,function()sys.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end, function()return mobile end,"his", nil, "back", nil),
back={x=640,y=600,w=180,h=60,rgb=color.white,code=back,up="his",right="qq"}, back= newButton(640, 600,180,60,color.white,40,back, nil, "his", nil, nil, "qq"),
}, },
history={ history={
prev= {x=75, y=320,w=100, h=300, rgb=color.white,hide=function()return sel==1 end,code=function()sel=sel-1 end}, prev= newButton(75, 320,100,300,color.white,40,function()love.keypressed("left")end,function()return sel==1 end),
next= {x=1205,y=320,w=100, h=300, rgb=color.white,hide=function()return sel==#updateLog end,code=function()sel=sel+1 end}, next= newButton(1205, 320,100,300,color.white,40,function()love.keypressed("right")end,function()return sel==#updateLog end),
back= {x=640, y=640,w=200,h=70, rgb=color.white,code=back}, back= newButton(640, 640,200,70, color.white,40,back),
}, },
stat={ stat={
path={x=980,y=590,w=250,h=60,f=30,rgb=color.white,hide=function()return mobile end,code=function()sys.openURL(fs.getSaveDirectory())end,left="back"}, path= newButton(980,590,250,60,color.white,30,function()sys.openURL(fs.getSaveDirectory())end,function()return mobile end,nil,nil,"back",nil),
back={x=640,y=590,w=180,h=60,rgb=color.white,code=back,right="path"}, back= newButton(640,590,180,60,color.white,40,back,nil,nil,nil,nil,"path"),
}, },
sel=nil,--selected button id(integer) sel=nil,--selected widget id
} }

292
main.lua
View File

@@ -7,10 +7,11 @@ local find,format=string.find,string.format
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local Timer=tm.getTime local Timer=tm.getTime
-- sort=table.sort -- sort=table.sort
-------------------------------------------------------------
local F=false
null=function()end null=function()end
-------------------------------------------------------------
system=sys.getOS() system=sys.getOS()
local mobile=system=="Android"or system=="iOS"
local xOy=love.math.newTransform() local xOy=love.math.newTransform()
local mx,my,mouseShow=-20,-20,false local mx,my,mouseShow=-20,-20,false
local touching--1st touching ID local touching--1st touching ID
@@ -22,10 +23,9 @@ curBG="none"
voicePlaying={} voicePlaying={}
local devMode=0 local devMode=0
local F=false kb.setKeyRepeat(true)
kb.setKeyRepeat(F) kb.setTextInput(false)
kb.setTextInput(F) ms.setVisible(false)
ms.setVisible(F)
------------------------------------------------------------- -------------------------------------------------------------
local Fonts={} local Fonts={}
function setFont(s) function setFont(s)
@@ -43,21 +43,21 @@ function setFont(s)
end end
customSel={22,22,1,1,7,3,1,1,8,4,1,1,1} customSel={22,22,1,1,7,3,1,1,8,4,1,1,1}
preField={h=20} preField={h=20}
for i=1,18 do preField[i]={0,0,0,0,0,0,0,0,0,0}end for i=1,10 do preField[i]={-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}end
for i=19,20 do preField[i]={-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}end for i=11,20 do preField[i]={0,0,0,0,0,0,0,0,0,0}end
freeRow={L=40}for i=1,40 do freeRow[i]={0,0,0,0,0,0,0,0,0,0}end freeRow={L=40}for i=1,40 do freeRow[i]={0,0,0,0,0,0,0,0,0,0}end
--Game system Vars --Game system Vars
setting={ setting={
ghost=true,center=true, ghost=true,center=true,
grid=F,swap=true, grid=false,swap=true,
fxs=3,bg=true, fxs=3,bg=true,
das=10,arr=2, das=10,arr=2,
sddas=0,sdarr=2, sddas=0,sdarr=2,
lang=1, lang=1,
sfx=true,bgm=true, sfx=true,bgm=true,
vib=3,voc=F, vib=3,voc=false,
fullscreen=F, fullscreen=false,
bgblock=true, bgblock=true,
skin=1,smo=true, skin=1,smo=true,
keyMap={ keyMap={
@@ -91,7 +91,7 @@ setting={
}, },
virtualkeyAlpha=3, virtualkeyAlpha=3,
virtualkeyIcon=true, virtualkeyIcon=true,
virtualkeySwitch=F, virtualkeySwitch=false,
frameMul=100, frameMul=100,
} }
stat={ stat={
@@ -126,9 +126,9 @@ virtualkeyPressTime={0,0,0,0,0,0,0,0,0,0,0,0,0}
------------------------------------------------------------- -------------------------------------------------------------
require("class") require("class")
require("toolfunc") require("toolfunc")
require("ai")
require("gamefunc") require("gamefunc")
require("list") require("list")
require("ai")
require("dataList") require("dataList")
require("texture") require("texture")
local Tmr=require("timer") local Tmr=require("timer")
@@ -147,18 +147,7 @@ if sys.getPowerInfo()~="unknown"then
gc.clear(0,0,0,.3) gc.clear(0,0,0,.3)
gc.setLineWidth(4) gc.setLineWidth(4)
setFont(25) setFont(25)
if pow then local charging
gc.setColor(1,1,1)
gc.draw(batteryImage,58,3)
if pow>90 then gc.setColor(color.lightGreen)
elseif pow<60 then gc.setColor(color.lightRed)
elseif pow<20 then gc.setColor(color.red)
elseif pow==26 then gc.setColor(color.purple)
end
gc.rectangle("fill",61,6,pow*.15,10)
gc.setColor(1,1,1)
gc.print(pow.."%",94,-3)
end
if state~="battery"then if state~="battery"then
gc.setColor(1,1,1) gc.setColor(1,1,1)
if state=="nobattery"then if state=="nobattery"then
@@ -166,8 +155,22 @@ if sys.getPowerInfo()~="unknown"then
gc.line(61.5,.5,83.5,22.5) gc.line(61.5,.5,83.5,22.5)
elseif state=="charging"or state=="charged"then elseif state=="charging"or state=="charged"then
gc.draw(chargeImage,84,3) gc.draw(chargeImage,84,3)
F=true
end end
end end
if pow then
if charging then gc.setColor(0,1,0)
elseif pow>50 then gc.setColor(1,1,1)
elseif pow>26 then gc.setColor(1,1,0)
elseif pow<26 then gc.setColor(1,0,0)
else gc.setColor(.5,0,1)--special~
end
::L::
gc.rectangle("fill",61,6,pow*.15,10)
gc.setColor(1,1,1)
gc.draw(batteryImage,58,3)
gc.print(pow.."%",94,-3)
end
gc.print(os.date("%H:%M",os.time()),2,-3) gc.print(os.date("%H:%M",os.time()),2,-3)
gc.pop()gc.setCanvas() gc.pop()gc.setCanvas()
end end
@@ -209,20 +212,22 @@ local sceneInit={
mode=function() mode=function()
curBG="none" curBG="none"
saveData() saveData()
destroyPlayers()
BGM("blank") BGM("blank")
end, end,
custom=function() custom=function()
sel=sel or 1 sel=sel or 1
destroyPlayers()
curBG=customRange.bg[customSel[12]] curBG=customRange.bg[customSel[12]]
BGM(customRange.bgm[customSel[13]]) BGM(customRange.bgm[customSel[13]])
end, end,
draw=function() draw=function()
curBG="none" curBG="none"
kb.setKeyRepeat(true)
clearSureTime=0 clearSureTime=0
pen,sx,sy=1,1,1 pen,sx,sy=1,1,1
end, end,
play=function() play=function()
kb.setKeyRepeat(false)
restartCount=0 restartCount=0
if needResetGameData then if needResetGameData then
resetGameData() resetGameData()
@@ -276,37 +281,41 @@ local function onVirtualkey(x,y)
end end
local function buttonControl_key(i) local function buttonControl_key(i)
if i=="up"or i=="down"or i=="left"or i=="right"then if i=="up"or i=="down"or i=="left"or i=="right"then
if Buttons.sel then if Widget.sel then
Buttons.sel=Buttons[scene][Buttons.sel[i]]or Buttons.sel Widget.sel=Widget[scene][Widget.sel[i]]or Widget.sel
else else
Buttons.sel=select(2,next(Buttons[scene])) Widget.sel=select(2,next(Widget[scene]))
end end
elseif i=="space"or i=="return"then elseif i=="space"or i=="return"then
if not sceneSwaping and Buttons.sel then if not sceneSwaping and Widget.sel then
local B=Buttons.sel local W=Widget.sel
B.alpha=1 if W.type=="button"then
B.code() W.alpha=1
if B.hide and B.hide()then Buttons.sel=nil end W.code()
SFX("button") if W.hide and W.hide()then Widget.sel=nil end
VOICE("nya") SFX("button")
VOICE("nya")
end
end end
end end
end end
local function buttonControl_gamepad(i) local function buttonControl_gamepad(i)
if i=="dpup"or i=="dpdown"or i=="dpleft"or i=="dpright"then if i=="dpup"or i=="dpdown"or i=="dpleft"or i=="dpright"then
if Buttons.sel then if Widget.sel then
Buttons.sel=Buttons[scene][Buttons.sel[i=="dpup"and"up"or i=="dpdown"and"down"or i=="dpleft"and"left"or"right"]]or Buttons.sel Widget.sel=Widget[scene][Widget.sel[i=="dpup"and"up"or i=="dpdown"and"down"or i=="dpleft"and"left"or"right"]]or Widget.sel
else else
Buttons.sel=select(2,next(Buttons[scene])) Widget.sel=select(2,next(Widget[scene]))
end end
elseif i=="start"then elseif i=="start"then
if not sceneSwaping and Buttons.sel then if not sceneSwaping and Widget.sel then
local B=Buttons.sel local W=Widget.sel
B.alpha=1 if W.type=="button"then
B.code() W.alpha=1
if B.hide and B.hide()then Buttons.sel=nil end W.code()
SFX("button") if W.hide and W.hide()then Widget.sel=nil end
VOICE("nya") SFX("button")
VOICE("nya")
end
end end
end end
end end
@@ -381,7 +390,11 @@ function keyDown.music(key)
elseif key=="up"then elseif key=="up"then
sel=(sel-2)%#musicID+1 sel=(sel-2)%#musicID+1
elseif key=="return"or key=="space"then elseif key=="return"or key=="space"then
BGM(musicID[sel]) if bgmPlaying~=musicID[sel]then
BGM(musicID[sel])
else
BGM()
end
elseif key=="escape"then elseif key=="escape"then
back() back()
end end
@@ -450,7 +463,12 @@ function touchMove.draw(id,x,y,dx,dy)
end end
function keyDown.draw(key) function keyDown.draw(key)
if key=="delete"then if key=="delete"then
Buttons.draw.clear.code() if clearSureTime>15 then
for y=1,20 do for x=1,10 do preField[y][x]=0 end end
clearSureTime=0
else
clearSureTime=50
end
elseif key=="up"or key=="down"or key=="left"or key=="right"then elseif key=="up"or key=="down"or key=="left"or key=="right"then
if not sx then sx=1 end if not sx then sx=1 end
if not sy then sy=1 end if not sy then sy=1 end
@@ -606,6 +624,7 @@ function touchDown.play(id,x,y)
local t=onVirtualkey(x,y) local t=onVirtualkey(x,y)
if t then if t then
pressKey(t,players[1]) pressKey(t,players[1])
VIB(0)
end end
end end
end end
@@ -702,15 +721,17 @@ function love.mousepressed(x,y,k,t,num)
back() back()
end end
if k==1 then if k==1 then
if not sceneSwaping and Buttons.sel then if not sceneSwaping and Widget.sel then
local B=Buttons.sel local W=Widget.sel
B.code() if W.type=="button"then
B.alpha=1 W.code()
Buttons.sel=nil W.alpha=1
love.mousemoved(x,y,0,0) Widget.sel=nil
SFX("button") love.mousemoved(x,y,0,0)
VOICE("nya") SFX("button")
VIB(1) VOICE("nya")
VIB(1)
end
end end
end end
end end
@@ -718,15 +739,17 @@ function love.mousemoved(x,y,dx,dy,t)
if t then return end if t then return end
mouseShow=true mouseShow=true
mx,my=xOy:inverseTransformPoint(x,y) mx,my=xOy:inverseTransformPoint(x,y)
Buttons.sel=nil Widget.sel=nil
if mouseMove[scene]then if mouseMove[scene]then
mouseMove[scene](mx,my,dx/scr.k,dy/scr.k) mouseMove[scene](mx,my,dx/scr.k,dy/scr.k)
end end
for _,B in next,Buttons[scene]do for _,W in next,Widget[scene]do
if not(B.hide and B.hide())then if not(W.hide and W.hide())then
if abs(mx-B.x)<B.w*.5 and abs(my-B.y)<B.h*.5 then if W.type=="button"then
Buttons.sel=B if mx>W.x and mx<W.x+W.w and my>W.y and my<W.y+W.h then
return Widget.sel=W
return
end
end end
end end
end end
@@ -755,16 +778,17 @@ end
function love.touchreleased(id,x,y) function love.touchreleased(id,x,y)
if id==touching then if id==touching then
touching=nil touching=nil
if Buttons.sel then if Widget.sel then
local B=Buttons.sel local W=Widget.sel
B.code() if W.type=="button"then
B.alpha=1 W.code()
Buttons.sel=nil W.alpha=1
SFX("button") SFX("button")
VOICE("nya") VOICE("nya")
VIB(1) VIB(1)
end
end end
Buttons.sel=nil Widget.sel=nil
end end
if touchUp[scene]then if touchUp[scene]then
touchUp[scene](id,xOy:inverseTransformPoint(x,y)) touchUp[scene](id,xOy:inverseTransformPoint(x,y))
@@ -775,16 +799,18 @@ function love.touchmoved(id,x,y,dx,dy)
if touchMove[scene]then if touchMove[scene]then
touchMove[scene](id,x,y,dx/scr.k,dy/scr.k) touchMove[scene](id,x,y,dx/scr.k,dy/scr.k)
end end
Buttons.sel=nil Widget.sel=nil
for _,B in next,Buttons[scene]do for _,W in next,Widget[scene]do
if not(B.hide and B.hide())then if not(W.hide and W.hide())then
if abs(x-B.x)<B.w*.5 and abs(y-B.y)<B.h*.5 then if W.type=="button"then
Buttons.sel=B if x>W.x and x<W.x+W.w and y>W.y and y<W.y+W.h then
return Widget.sel=W
return
end
end end
end end
end end
if not Buttons.sel then if not Widget.sel then
touching=nil touching=nil
end end
end end
@@ -793,24 +819,26 @@ function love.keypressed(i)
if i=="f8"then devMode=(devMode+1)%3 end if i=="f8"then devMode=(devMode+1)%3 end
if devMode==2 then if devMode==2 then
if i=="k"then if i=="k"then
P=players.alive[rnd(#players.alive)] for i=1,8 do
if P.id~=1 then P=players.alive[rnd(#players.alive)]
P.lastRecv=players[1] if P.id~=1 then
Event.lose() P.lastRecv=players[1]
Event.lose()
end
end end
--Test code here --Test code here
elseif i=="q"then elseif i=="q"then
local B=Buttons.sel if B then print(format("x=%d,y=%d,w=%d,h=%d",B.x,B.y,B.w,B.h))end local W=Widget.sel if W then print(format("x=%d,y=%d,w=%d,h=%d",W.x,W.y,W.w,W.h))end
elseif Buttons.sel then elseif Widget.sel then
local B=Buttons.sel local W=Widget.sel
if i=="left"then B.x=B.x-10 if i=="left"then W.x=W.x-10
elseif i=="right"then B.x=B.x+10 elseif i=="right"then W.x=W.x+10
elseif i=="up"then B.y=B.y-10 elseif i=="up"then W.y=W.y-10
elseif i=="down"then B.y=B.y+10 elseif i=="down"then W.y=W.y+10
elseif i==","then B.w=B.w-10 elseif i==","then W.w=W.w-10
elseif i=="."then B.w=B.w+10 elseif i=="."then W.w=W.w+10
elseif i=="/"then B.h=B.h-10 elseif i=="/"then W.h=W.h-10
elseif i=="'"then B.h=B.h+10 elseif i=="'"then W.h=W.h+10
end end
end end
else else
@@ -890,12 +918,15 @@ function love.update(dt)
if sceneSwaping then if sceneSwaping then
sceneSwaping.time=sceneSwaping.time-1 sceneSwaping.time=sceneSwaping.time-1
if sceneSwaping.time==sceneSwaping.mid then if sceneSwaping.time==sceneSwaping.mid then
for k,B in next,Buttons[scene]do for k,W in next,Widget[scene]do
B.alpha=0 if W.type=="button"then
end--Reset buttons' alpha W.alpha=0
Buttons.sel=nil end--Reset widgets' alpha
end
Widget.sel=nil
scene=sceneSwaping.tar scene=sceneSwaping.tar
sceneInit[scene]() sceneInit[scene]()
--scene swapped!
elseif sceneSwaping.time==0 then elseif sceneSwaping.time==0 then
sceneSwaping=nil sceneSwaping=nil
end end
@@ -912,11 +943,13 @@ function love.update(dt)
end end
if voicePlaying[1] and not voicePlaying[1]:isPlaying()then voicePlaying[1]:play()end if voicePlaying[1] and not voicePlaying[1]:isPlaying()then voicePlaying[1]:play()end
end end
for k,B in next,Buttons[scene]do for k,W in next,Widget[scene]do
local t=B==Buttons.sel and .4 or 0 if W.type=="button"then
B.alpha=abs(B.alpha-t)>.02 and(B.alpha+(B.alpha<t and .02 or -.02))or t local t=W==Widget.sel and .4 or 0
if B.alpha>t then B.alpha=B.alpha-.02 elseif B.alpha<t then B.alpha=B.alpha+.02 end W.alpha=abs(W.alpha-t)>.02 and(W.alpha+(W.alpha<t and .02 or -.02))or t
end--update Buttons if W.alpha>t then W.alpha=W.alpha-.02 elseif W.alpha<t then W.alpha=W.alpha+.02 end
end
end--update Widgets
end end
local scs={1,2,1,2,1,2,1,2,1,2,1.5,1.5,.5,2.5} local scs={1,2,1,2,1,2,1,2,1,2,1.5,1.5,.5,2.5}
function love.draw() function love.draw()
@@ -933,30 +966,32 @@ function love.draw()
end end end end
end end
if Pnt[scene]then Pnt[scene]()end if Pnt[scene]then Pnt[scene]()end
for k,B in next,Buttons[scene]do for k,W in next,Widget[scene]do
if not(B.hide and B.hide())then if not(W.hide and W.hide())then
local C=B.rgb or color.white if W.type=="button"then
gc.setColor(C[1],C[2],C[3],B.alpha) local C=W.color
gc.rectangle("fill",B.x-B.w*.5,B.y-B.h*.5,B.w,B.h) gc.setColor(C[1],C[2],C[3],W.alpha)
gc.setColor(C) gc.rectangle("fill",W.x,W.y,W.w,W.h)
gc.setLineWidth(3)gc.rectangle("line",B.x-B.w*.5,B.y-B.h*.5,B.w,B.h,4)
gc.setColor(C[1],C[2],C[3],.3)
gc.setLineWidth(5)gc.rectangle("line",B.x-B.w*.5,B.y-B.h*.5,B.w,B.h,4)
local t=B.t
local y0
if t then
if type(t)=="function"then t=t()end
setFont(B.f or 40)
y0=B.y-currentFont*.64
gc.printf(t,B.x-201,y0+2,400,"center")
gc.printf(t,B.x-199,y0+2,400,"center")
gc.printf(t,B.x-201,y0,400,"center")
gc.printf(t,B.x-199,y0,400,"center")
gc.setColor(C) gc.setColor(C)
mStr(t,B.x,y0+1) gc.setLineWidth(3)gc.rectangle("line",W.x,W.y,W.w,W.h,4)
gc.setColor(C[1],C[2],C[3],.3)
gc.setLineWidth(5)gc.rectangle("line",W.x,W.y,W.w,W.h,4)
local t=W.text
if t then
if type(t)=="function"then t=t()end
setFont(W.font)
local x=W.x+W.w*.5
local y0=W.y+W.h*.5-currentFont*.64
gc.printf(t,x-201,y0+2,400,"center")
gc.printf(t,x-199,y0+2,400,"center")
gc.printf(t,x-201,y0,400,"center")
gc.printf(t,x-199,y0,400,"center")
gc.setColor(C)
mStr(t,x,y0+1)
end
end end
end end
end--Draw buttons end--Draw widgets
if mouseShow and not touching then if mouseShow and not touching then
local r=Timer()*.5 local r=Timer()*.5
gc.setColor(1,1,1,min(1-abs(1-r%1*2),.3)) gc.setColor(1,1,1,min(1-abs(1-r%1*2),.3))
@@ -985,6 +1020,9 @@ function love.draw()
setFont(20) setFont(20)
gc.print(tm.getFPS(),5,700) gc.print(tm.getFPS(),5,700)
if devMode>0 then if devMode>0 then
if devMode==2 then
gc.setColor(1,1,0)
end
gc.print(mx.." "..my,5,640) gc.print(mx.." "..my,5,640)
gc.print(#freeRow.."/"..freeRow.L,5,660) gc.print(#freeRow.."/"..freeRow.L,5,660)
gc.print(gcinfo(),5,680) gc.print(gcinfo(),5,680)
@@ -999,7 +1037,7 @@ function love.run()
return function() return function()
PUMP() PUMP()
for N,a,b,c,d,e in POLL()do for N,a,b,c,d,e in POLL()do
if N=="quit"then return 0 if N=="quit"then destroyPlayers()return 0
elseif love[N]then love[N](a,b,c,d,e)end elseif love[N]then love[N](a,b,c,d,e)end
end end
tm.step() tm.step()
@@ -1031,7 +1069,7 @@ if fs.getInfo("usersetting")then
loadSetting() loadSetting()
elseif system=="Android" or system=="iOS"then elseif system=="Android" or system=="iOS"then
setting.virtualkeySwitch=true setting.virtualkeySwitch=true
setting.swap=F setting.swap=false
end end
math.randomseed(os.time()*626) math.randomseed(os.time()*626)
swapLanguage(setting.lang) swapLanguage(setting.lang)

View File

@@ -26,11 +26,13 @@ local modeLevelColor={
NORMAL=color.green, NORMAL=color.green,
HARD=color.magenta, HARD=color.magenta,
LUNATIC=color.red, LUNATIC=color.red,
EXTRA=color.lightMagenta,
ULTIMATE=color.lightYellow,
FINAL=color.lightGrey,
["EASY+"]=color.darkCyan,
["NORMAL+"]=color.darkGreen, ["NORMAL+"]=color.darkGreen,
["HARD+"]=color.darkMagenta, ["HARD+"]=color.darkMagenta,
["LUNATIC+"]=color.darkRed, ["LUNATIC+"]=color.darkRed,
EXTRA=color.lightMagenta,
ULTIMATE=color.lightYellow,
MESS=color.lightGrey, MESS=color.lightGrey,
GM=color.blue, GM=color.blue,
@@ -246,27 +248,27 @@ end,
game1=function() game1=function()
gc.setColor(1,1,1) gc.setColor(1,1,1)
gc.draw(background1,640,360,Timer()*.15,12,nil,64,64) gc.draw(background1,640,360,Timer()*.15,12,nil,64,64)
end, end,--Rainbow
game2=function() game2=function()
gc.setColor(1,.5,.5) gc.setColor(1,.5,.5)
gc.draw(background1,640,360,Timer()*.2,12,nil,64,64) gc.draw(background1,640,360,Timer()*.2,12,nil,64,64)
end, end,--Red rainbow
game3=function() game3=function()
gc.setColor(.6,.6,1) gc.setColor(.6,.6,1)
gc.draw(background1,640,360,Timer()*.25,12,nil,64,64) gc.draw(background1,640,360,Timer()*.25,12,nil,64,64)
end, end,--Blue rainbow
game4=function() game4=function()
gc.setColor(.1,.5,.5) gc.setColor(.1,.5,.5)
local x=Timer()%4*320 local x=Timer()%4*320
gc.draw(background2,x,0,nil,10) gc.draw(background2,x,0,nil,10)
gc.draw(background2,x-1280,0,nil,10) gc.draw(background2,x-1280,0,nil,10)
end, end,--Fast strap
game5=function() game5=function()
local t=2.5-Timer()%20%6%2.5 local t=2.5-Timer()%20%6%2.5
if t<.5 then gc.clear(t,t,t) if t<.5 then gc.clear(t,t,t)
else gc.clear(0,0,0) else gc.clear(0,0,0)
end end
end, end,--Lightning
game6=function() game6=function()
local t=1.2-Timer()%10%3%1.2 local t=1.2-Timer()%10%3%1.2
if t<.5 then gc.clear(t,t,t) if t<.5 then gc.clear(t,t,t)
@@ -275,7 +277,7 @@ game6=function()
gc.setColor(.3,.3,.3) gc.setColor(.3,.3,.3)
local r=7-int(Timer()*.5)%7 local r=7-int(Timer()*.5)%7
gc.draw(mouseBlock[r],640,360,Timer()%3.1416*6,400,400,scs[r][2]-.5,#blocks[r][0]-scs[r][1]+.5) gc.draw(mouseBlock[r],640,360,Timer()%3.1416*6,400,400,scs[r][2]-.5,#blocks[r][0]-scs[r][1]+.5)
end, end,--Fast lightning&spining tetromino
rgb=function() rgb=function()
gc.clear( gc.clear(
sin(Timer()*1.2)*.15+.5, sin(Timer()*1.2)*.15+.5,
@@ -361,19 +363,19 @@ function Pnt.mode()
end end
function Pnt.music() function Pnt.music()
gc.setColor(1,1,1,.3+sin(Timer()*5)*.2) gc.setColor(1,1,1,.3+sin(Timer()*5)*.2)
gc.rectangle("fill",45,98+30*sel,237,30) gc.rectangle("fill",45,98+30*sel,250,30)
gc.setColor(.8,.8,.8) gc.setColor(.8,.8,.8)
gc.draw(drawableText.musicRoom,20,20) gc.draw(drawableText.musicRoom,20,20)
gc.setColor(1,1,1) gc.setColor(1,1,1)
gc.draw(drawableText.musicRoom,22,23) gc.draw(drawableText.musicRoom,22,23)
gc.draw(drawableText.nowPlaying,520,83) gc.draw(drawableText.nowPlaying,490,110)
setFont(35) setFont(35)
for i=1,#musicID do for i=1,#musicID do
gc.print(musicID[i],50,90+30*i) gc.print(musicID[i],50,90+30*i)
end end
setFont(50) setFont(50)
gc.setColor(sin(Timer()*.5)*.2+.8,sin(Timer()*.7)*.2+.8,sin(Timer())*.2+.8) gc.setColor(sin(Timer()*.5)*.2+.8,sin(Timer()*.7)*.2+.8,sin(Timer())*.2+.8)
gc.print(bgmPlaying or"",600,140) mStr(bgmPlaying or"",630,180)
end end
function Pnt.custom() function Pnt.custom()
gc.setColor(1,1,1,.3+sin(Timer()*8)*.2) gc.setColor(1,1,1,.3+sin(Timer()*8)*.2)
@@ -406,7 +408,7 @@ function Pnt.draw()
local B=preField[y][x] local B=preField[y][x]
if B>0 then if B>0 then
drawPixel(y,x,B) drawPixel(y,x,B)
elseif B==0 then elseif B==-1 then
gc.line(30*x-25,605-30*y,30*x-5,625-30*y) gc.line(30*x-25,605-30*y,30*x-5,625-30*y)
gc.line(30*x-25,625-30*y,30*x-5,605-30*y) gc.line(30*x-25,625-30*y,30*x-5,605-30*y)
end end
@@ -424,7 +426,7 @@ function Pnt.draw()
gc.setLineWidth(13) gc.setLineWidth(13)
gc.setColor(blockColor[pen]) gc.setColor(blockColor[pen])
gc.rectangle("line",945,605,70,70) gc.rectangle("line",945,605,70,70)
elseif pen==0 then elseif pen==-1 then
gc.setLineWidth(5) gc.setLineWidth(5)
gc.setColor(.9,.9,.9) gc.setColor(.9,.9,.9)
gc.line(960,620,1000,660) gc.line(960,620,1000,660)
@@ -443,16 +445,11 @@ function Pnt.play()
gc.push("transform") gc.push("transform")
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)
local h=#P.clearing
local F=P.field local F=P.field
for j=1,#F do for j=1,#F do
if j==P.clearing[h]and P.falling>-1 then for i=1,10 do if F[j][i]>0 then
h=h-1 gc.draw(blockSkinmini[F[j][i]],6*i-6,120-6*j)
else end end
for i=1,10 do if F[j][i]>0 then
gc.draw(blockSkinmini[F[j][i]],6*i-6,120-6*j)
end end
end
end--Field end--Field
if P.alive then if P.alive then
gc.setLineWidth(2) gc.setLineWidth(2)
@@ -471,6 +468,7 @@ function Pnt.play()
end end
gc.pop() gc.pop()
gc.setCanvas() gc.setCanvas()
--draw content
end end
gc.setColor(1,1,1) gc.setColor(1,1,1)
gc.draw(P.canvas,P.x,P.y,nil,P.size*10) gc.draw(P.canvas,P.x,P.y,nil,P.size*10)
@@ -479,6 +477,7 @@ function Pnt.play()
gc.setColor(1,0,0,min(P.endCounter,25)*.04) gc.setColor(1,0,0,min(P.endCounter,25)*.04)
gc.circle("line",P.centerX,P.centerY,(840-20*min(P.endCounter,30))*P.size) gc.circle("line",P.centerX,P.centerY,(840-20*min(P.endCounter,30))*P.size)
end end
--draw Canvas
else else
gc.push("transform") gc.push("transform")
gc.translate(P.x,P.y)gc.scale(P.size)--Position gc.translate(P.x,P.y)gc.scale(P.size)--Position
@@ -497,26 +496,24 @@ function Pnt.play()
end--Grid lines end--Grid lines
gc.translate(0,P.fieldBeneath) gc.translate(0,P.fieldBeneath)
gc.setScissor(scr.x+P.absFieldX*scr.k,scr.y+P.absFieldY*scr.k,300*P.size*scr.k,610*P.size*scr.k) gc.setScissor(scr.x+P.absFieldX*scr.k,scr.y+P.absFieldY*scr.k,300*P.size*scr.k,610*P.size*scr.k)
-- local dy=setting.smo and(P.y_img~=P.curY and min(P.dropDelay,8e98)/P.gameEnv.drop or min(P.lockDelay,8e98)/P.gameEnv.lock)^4*30 or 0 local dy,stepY=0,setting.smo and(P.falling/(P.gameEnv.fall+1))^2.5*30 or 30
local dy,stepY=0,setting.smo and (1-(P.falling/P.gameEnv.fall)^3)*30 or 0 local h=1
local h=#P.clearing
for j=int(P.fieldBeneath/30+1),#P.field do for j=int(P.fieldBeneath/30+1),#P.field do
if j==P.clearing[h]and P.falling>-1 then while j==P.clearing[h]and P.falling>-1 do
h=h-1 h=h+1
dy=dy+stepY dy=dy+stepY
gc.translate(0,stepY) gc.translate(0,-stepY)
gc.setColor(1,1,1,P.falling/P.gameEnv.fall) gc.setColor(1,1,1,P.falling/P.gameEnv.fall)
gc.rectangle("fill",0,600-30*j,320,30-stepY) gc.rectangle("fill",0,630-30*j,320,stepY)
else end
for i=1,10 do for i=1,10 do
if P.field[j][i]>0 then if P.field[j][i]>0 then
gc.setColor(1,1,1,min(P.visTime[j][i]*.05,1)) gc.setColor(1,1,1,min(P.visTime[j][i]*.05,1))
drawPixel(j,i,P.field[j][i]) drawPixel(j,i,P.field[j][i])
end
end end
end end
end--Field end--Field
gc.translate(0,-dy) gc.translate(0,dy)
for i=1,#P.shade do for i=1,#P.shade do
local S=P.shade[i] local S=P.shade[i]
gc.setColor(1,1,1,S[1]*.12) gc.setColor(1,1,1,S[1]*.12)
@@ -535,10 +532,28 @@ function Pnt.play()
end end
end end end end
end--Ghost end--Ghost
local dy=setting.smo and(P.y_img~=P.curY and min(P.dropDelay,8e98)/P.gameEnv.drop or min(P.lockDelay,8e98)/P.gameEnv.lock)^4*30 or 0 -- local dy=setting.smo and(P.y_img~=P.curY and or 1)^4*30 or 0
local dy
if setting.smo then
if P.y_img~=P.curY then
dy=(min(P.dropDelay,1e99)/P.gameEnv.drop-1)*30
else
dy=0
end
--[[
if P.y_img~=P.curY then
dy=(min(P.dropDelay,8e98)/P.gameEnv.drop)^4*30
else
dy=(min(P.lockDelay,8e98)/P.gameEnv.lock)^(P.gameEnv._20G and 3 or 7)*30
end
]]
else
dy=0
end
gc.translate(0,-dy) gc.translate(0,-dy)
local trans=P.lockDelay/P.gameEnv.lock
if P.gameEnv.block then if P.gameEnv.block then
gc.setColor(1,1,1,P.lockDelay/P.gameEnv.lock) gc.setColor(1,1,1,trans)
for i=1,P.r do for j=1,P.c do for i=1,P.r do for j=1,P.c do
if P.cur.bk[i][j]then if P.cur.bk[i][j]then
gc.rectangle("fill",30*(j+P.curX-1)-33,597-30*(i+P.curY-1),36,36) gc.rectangle("fill",30*(j+P.curX-1)-33,597-30*(i+P.curY-1),36,36)
@@ -552,7 +567,7 @@ function Pnt.play()
end end--Block end end--Block
end end
if P.gameEnv.center then if P.gameEnv.center then
gc.setColor(1,1,1) gc.setColor(1,1,1,trans)
local x=30*(P.curX+P.sc[2]-1)-30+15 local x=30*(P.curX+P.sc[2]-1)-30+15
gc.draw(spinCenter,x,600-30*(P.curY+P.sc[1]-1)+15,nil,nil,nil,4,4) gc.draw(spinCenter,x,600-30*(P.curY+P.sc[1]-1)+15,nil,nil,nil,4,4)
gc.translate(0,dy) gc.translate(0,dy)
@@ -761,10 +776,10 @@ function Pnt.pause()
end end
setFont(40) setFont(40)
if system~="Android"then if system~="Android"then
mStr(text.space.."/"..text.enter,640,300) mStr(text.space.."/"..text.enter,640,335)
gc.print("ESC",610,598) gc.print("ESC",610,509)
end end
mDraw(gamefinished and drawableText.finish or drawableText.pause,640,140-12*(5-pauseTimer*.1)^2) mDraw(gamefinished and drawableText.finish or drawableText.pause,640,60-10*(5-pauseTimer*.1)^1.5)
end end
function Pnt.setting() function Pnt.setting()
gc.setColor(1,1,1) gc.setColor(1,1,1)

122
timer.lua
View File

@@ -102,8 +102,12 @@ play=function(dt)
end end
for p=1,#players do for p=1,#players do
P=players[p] P=players[p]
if P.keyPressing[1]or P.keyPressing[2]then if P.keyPressing[1]then
P.moving=P.moving+(P.moving>0 and 1 or -1) if P.moving>0 then P.moving=0 end
P.moving=P.moving-1
elseif P.keyPressing[2]then
if P.moving<0 then P.moving=0 end
P.moving=P.moving+1
else else
P.moving=0 P.moving=0
end end
@@ -140,23 +144,15 @@ play=function(dt)
end end
end end
if P.ai and P.waiting==-1 then if not P.human and P.control and P.waiting==-1 then
P.ai.controlDelay=P.ai.controlDelay-1 local C=P.AI_keys
if P.ai.controlDelay==0 then P.AI_delay=P.AI_delay-1
if #P.ai.controls>0 then if not C[1]then
local C=P.ai.controls P.AI_stage=AI_think[P.AI_mode][P.AI_stage](C)
pressKey(C[1],P)releaseKey(C[1],P) elseif P.AI_delay<=0 then
local k=#C for i=1,k do C[i]=C[i+1]end--table.remove(C,1) pressKey(C[1],P)releaseKey(C[1],P)
P.ai.controlDelay=P.ai.controlDelay0+1 local k=#C for i=1,k do C[i]=C[i+1]end--table.remove(C,1)
else P.AI_delay=P.AI_delay0*2
AI_getControls(P.ai.controls)
P.ai.controlDelay=P.ai.controlDelay0+2
if Timer()-P.modeData.point>P.modeData.event then
P.modeData.point=Timer()
P.modeData.event=P.ai.controlDelay0+rnd(2,10)
changeAtkMode(rnd()<.85 and 1 or #P.atker>3 and 4 or rnd()<.3 and 2 or 3)
end
end
end end
end end
if not P.keepVisible then if not P.keepVisible then
@@ -164,21 +160,38 @@ play=function(dt)
if P.visTime[j][i]>0 then P.visTime[j][i]=P.visTime[j][i]-1 end if P.visTime[j][i]>0 then P.visTime[j][i]=P.visTime[j][i]-1 end
end end end end
end--Fresh visible time end--Fresh visible time
if P.moving<0 then
if P.keyPressing[1]or P.keyPressing[2]then if P.keyPressing[1]then
P.moving=P.moving+(P.moving>0 and 1 or -1) if -P.moving<=P.gameEnv.das then
local d=abs(P.moving)-P.gameEnv.das P.moving=P.moving-1
if d>1 then elseif P.waiting==-1 then
if P.gameEnv.arr>0 then local x=P.curX
if d%P.gameEnv.arr==0 then if P.gameEnv.arr>0 then
act[P.moving>0 and"moveRight"or"moveLeft"](true) act.moveLeft(true)
else
act.insLeft()
end end
else if x~=P.curX then P.moving=P.moving+P.gameEnv.arr-1 end
act[P.moving>0 and"insRight"or"insLeft"]()
end end
else
P.moving=0
end
elseif P.moving>0 then
if P.keyPressing[2]then
if P.moving<=P.gameEnv.das then
P.moving=P.moving+1
elseif P.waiting==-1 then
local x=P.curX
if P.gameEnv.arr>0 then
act.moveRight(true)
else
act.insRight()
end
if x~=P.curX then P.moving=P.moving-P.gameEnv.arr+1 end
end
else
P.moving=0
end end
else
P.moving=0
end end
if P.keyPressing[7]and not P.keyPressing[9]then if P.keyPressing[7]and not P.keyPressing[9]then
local d=abs(P.downing)-P.gameEnv.sddas local d=abs(P.downing)-P.gameEnv.sddas
@@ -197,16 +210,17 @@ play=function(dt)
end end
if P.falling>=0 then if P.falling>=0 then
P.falling=P.falling-1 P.falling=P.falling-1
if P.falling>=0 then goto stop end if P.falling>=0 then
if P.human and P.gameEnv.fall>0 and #P.field>P.clearing[1]then SFX("fall")end goto stop
for i=1,#P.clearing do else
removeRow(P.field,P.clearing[i]) local L=#P.clearing
removeRow(P.visTime,P.clearing[i]) if P.human and P.gameEnv.fall>0 and #P.field+L>P.clearing[L]then SFX("fall")end
end for i=1,L do
for i=1,#P.clearing do P.clearing[i]=nil
P.clearing[i]=nil end
end end
end end
if not P.control then goto stop end
if P.waiting>=0 then if P.waiting>=0 then
P.waiting=P.waiting-1 P.waiting=P.waiting-1
if P.waiting==-1 then resetblock()end if P.waiting==-1 then resetblock()end
@@ -215,11 +229,17 @@ play=function(dt)
if P.curY~=P.y_img then if P.curY~=P.y_img then
if P.dropDelay>=0 then if P.dropDelay>=0 then
P.dropDelay=P.dropDelay-1 P.dropDelay=P.dropDelay-1
if P.dropDelay>=0 then goto stop end if P.dropDelay>0 then goto stop end
end end
drop() P.curY=P.curY-1
P.spinLast=false
if P.y_img~=P.curY then if P.y_img~=P.curY then
P.dropDelay=P.gameEnv.drop P.dropDelay=P.gameEnv.drop
elseif P.AI_mode=="CC"then
P.AI_needFresh=true
if not P.AIdata._20G and P.gameEnv.drop<P.AI_delay0*.5 then
CC_switch20G(P)
end
end end
if P.freshTime<=P.gameEnv.freshLimit then if P.freshTime<=P.gameEnv.freshLimit then
P.lockDelay=P.gameEnv.lock P.lockDelay=P.gameEnv.lock
@@ -228,6 +248,9 @@ play=function(dt)
P.lockDelay=P.lockDelay-1 P.lockDelay=P.lockDelay-1
if P.lockDelay>=0 then goto stop end if P.lockDelay>=0 then goto stop end
drop() drop()
if P.AI_mode=="CC"then
P.AI_needFresh=true
end
end end
::stop:: ::stop::
if P.b2b1==P.b2b then if P.b2b1==P.b2b then
@@ -248,14 +271,14 @@ play=function(dt)
end end
if P.falling>=0 then if P.falling>=0 then
P.falling=P.falling-1 P.falling=P.falling-1
if P.falling>=0 then goto stop end if P.falling>=0 then
if P.human and P.gameEnv.fall>0 and #P.field>P.clearing[1]then SFX("fall")end goto stop
for i=1,#P.clearing do else
removeRow(P.field,P.clearing[i]) local L=#P.clearing
removeRow(P.visTime,P.clearing[i]) if P.human and P.gameEnv.fall>0 and #P.field+L>P.clearing[L]then SFX("fall")end
end for i=1,L do
for i=1,#P.clearing do P.clearing[i]=nil
P.clearing[i]=nil end
end end
end::stop:: end::stop::
if P.endCounter<40 then if P.endCounter<40 then
@@ -297,6 +320,7 @@ play=function(dt)
if b.t>=60 then rem(P.bonus,i)end if b.t>=60 then rem(P.bonus,i)end
end end
end end
for i=#P.atkBuffer,1,-1 do for i=#P.atkBuffer,1,-1 do
local atk=P.atkBuffer[i] local atk=P.atkBuffer[i]
atk.time=atk.time+1 atk.time=atk.time+1

View File

@@ -25,6 +25,22 @@ function mDraw(s,x,y)
gc.draw(s,x-s:getWidth()*.5,y) gc.draw(s,x-s:getWidth()*.5,y)
end end
function destroyPlayers()
if players then
for _,P in next,players do if P.id then
while P.field[1]do
removeRow(P.field)
removeRow(P.visTime)
end
if P.AI_mode=="CC"then
BOT.free(P.bot_opt)
BOT.free(P.bot_wei)
BOT.destroy(P.AI_bot)
P.AI_mode=nil
end
end end
end
end
function getNewRow(val) function getNewRow(val)
local t=rem(freeRow) local t=rem(freeRow)
for i=1,10 do for i=1,10 do
@@ -62,11 +78,13 @@ local drawableTextLoad={
} }
function swapLanguage(l) function swapLanguage(l)
text=require("language/"..langID[l]) text=require("language/"..langID[l])
Buttons.sel=nil Widget.sel=nil
for S,L in next,Buttons do for S,L in next,Widget do
for N,B in next,L do for N,W in next,L do
B.alpha=0 if W.type=="button"then
B.t=text.ButtonText[S][N] W.alpha=0
W.text=text.ButtonText[S][N]
end
end end
end end
gc.push("transform") gc.push("transform")
@@ -101,7 +119,7 @@ function changeBlockSkin(n)
gc.setCanvas() gc.setCanvas()
end end
local vibrateLevel={0,.02,.03,.04,.05,.06,.07,.08} local vibrateLevel={0,.015,.02,.03,.04,.05,.06,.07,.08,.09}
function VIB(t) function VIB(t)
if setting.vib>0 then if setting.vib>0 then
love.system.vibrate(vibrateLevel[setting.vib+t]) love.system.vibrate(vibrateLevel[setting.vib+t])
@@ -132,21 +150,25 @@ function VOICE(s,n)
end end
end end
function BGM(s) function BGM(s)
if setting.bgm and bgmPlaying~=s then if setting.bgm then
if bgmPlaying then newTask(Event_task.bgmFadeOut,nil,bgmPlaying)end if bgmPlaying~=s then
for i=#Task,1,-1 do if bgmPlaying then newTask(Event_task.bgmFadeOut,nil,bgmPlaying)end
local T=Task[i] for i=#Task,1,-1 do
if T.code==Event_task.bgmFadeIn then local T=Task[i]
T.code=Event_task.bgmFadeOut if T.code==Event_task.bgmFadeIn then
elseif T.code==Event_task.bgmFadeOut and T.data==s then T.code=Event_task.bgmFadeOut
rem(Task,i) elseif T.code==Event_task.bgmFadeOut and T.data==s then
rem(Task,i)
end
end end
if s then
newTask(Event_task.bgmFadeIn,nil,s)
bgm[s]:play()
end
bgmPlaying=s
else
if bgmPlaying then bgm[bgmPlaying]:play()end
end end
if s then
newTask(Event_task.bgmFadeIn,nil,s)
bgm[s]:play()
end
bgmPlaying=s
end end
end end
@@ -199,7 +221,7 @@ function gotoScene(s,style)
time=swap[style][1],mid=swap[style][2], time=swap[style][1],mid=swap[style][2],
draw=swap[style].d draw=swap[style].d
} }
Buttons.sel=nil Widget.sel=nil
if style~="none"then if style~="none"then
SFX("swipe") SFX("swipe")
end end
@@ -218,10 +240,10 @@ local prevMenu={
mode="main", mode="main",
custom="mode", custom="mode",
draw=function() draw=function()
kb.setKeyRepeat(false)
gotoScene("custom") gotoScene("custom")
end, end,
play=function() play=function()
kb.setKeyRepeat(true)
updateStat() updateStat()
clearTask("play") clearTask("play")
gotoScene(curMode.id~="custom"and"mode"or"custom","deck") gotoScene(curMode.id~="custom"and"mode"or"custom","deck")
@@ -249,7 +271,6 @@ function pauseGame()
pauseTimer=0--Pause timer for animation pauseTimer=0--Pause timer for animation
if not gamefinished then if not gamefinished then
pauseCount=pauseCount+1 pauseCount=pauseCount+1
if bgmPlaying then bgm[bgmPlaying]:pause()end
end end
for i=1,#players.alive do for i=1,#players.alive do
local l=players.alive[i].keyPressing local l=players.alive[i].keyPressing
@@ -262,7 +283,6 @@ function pauseGame()
gotoScene("pause","none") gotoScene("pause","none")
end end
function resumeGame() function resumeGame()
if bgmPlaying then bgm[bgmPlaying]:play()end
gotoScene("play","fade") gotoScene("play","fade")
end end
local dataOpt={ local dataOpt={

View File

@@ -1,27 +1,40 @@
return{ return{
[=[Future outlook: [=[Future outlook:
"classic" rule Brand New GUI:
backfire mode custom restart method
Encrypt source code(JIT to byte code) custom block color/direction
game recording custom sequence
virtual key switch(all keys) virtual key switch(all keys)
easier CTWC Normal Things:
fineese/bigbang mode demo play at main menu
more FXs any screen size
TTT mode CC smarter(think of gaebage buffer)
smarter AI fineese/bigbang mode & easier CTWC
new AI:task-Z
game recording
TTT mode
Hard Things:
Encrypt source code(JIT to byte code)
infinite 1v1 infinite 1v1
square mode square mode
3d features more FXs & 3d features & animations]=],[=[
layer-feeling 0.7.23:
more animation]=],[=[ remake all BGM!
new mode:Master-Final
new modes:attacker & defender(not survivor!)
add restart button when pause
Code Clear added,face it bravely!(Windows only)
change falling animation
new GUI details
louder sound
code optimized & many bugs fixed]=],[=[
0.7.22: 0.7.22:
scoring system scoring system
smooth dropping smooth dropping
can change FX level can change FX level
new attaking FX new attaking FX
new bone skin new bone skin
baattery info/time display battery info/time display
in-game update log(this page) in-game update log(this page)
fast game fast game
much many more better GUI details much many more better GUI details