diff --git a/BGM/8-bit happiness.ogg b/BGM/8-bit happiness.ogg
index 8aa54438..794e38f6 100644
Binary files a/BGM/8-bit happiness.ogg and b/BGM/8-bit happiness.ogg differ
diff --git a/BGM/blank.ogg b/BGM/blank.ogg
index c0153d55..4d12965a 100644
Binary files a/BGM/blank.ogg and b/BGM/blank.ogg differ
diff --git a/BGM/cruelty.ogg b/BGM/cruelty.ogg
index 5ce469a4..2fdb8dfd 100644
Binary files a/BGM/cruelty.ogg and b/BGM/cruelty.ogg differ
diff --git a/BGM/end.ogg b/BGM/end.ogg
index 333376b1..e89b77ac 100644
Binary files a/BGM/end.ogg and b/BGM/end.ogg differ
diff --git a/BGM/final.ogg b/BGM/final.ogg
index 02b7ea14..554009a9 100644
Binary files a/BGM/final.ogg and b/BGM/final.ogg differ
diff --git a/BGM/infinite.ogg b/BGM/infinite.ogg
index d0817092..613970ca 100644
Binary files a/BGM/infinite.ogg and b/BGM/infinite.ogg differ
diff --git a/BGM/newera.ogg b/BGM/newera.ogg
index 8df49888..afc07959 100644
Binary files a/BGM/newera.ogg and b/BGM/newera.ogg differ
diff --git a/BGM/ogg 44100Hz 0.5q 1chn b/BGM/ogg 44100Hz 0.4q 2chn
similarity index 100%
rename from BGM/ogg 44100Hz 0.5q 1chn
rename to BGM/ogg 44100Hz 0.4q 2chn
diff --git a/BGM/push.ogg b/BGM/push.ogg
index 370d2b18..aeaf51e4 100644
Binary files a/BGM/push.ogg and b/BGM/push.ogg differ
diff --git a/BGM/race.ogg b/BGM/race.ogg
index 914dd44f..e8548faa 100644
Binary files a/BGM/race.ogg and b/BGM/race.ogg differ
diff --git a/BGM/reason.ogg b/BGM/reason.ogg
index 53188909..6a2cf560 100644
Binary files a/BGM/reason.ogg and b/BGM/reason.ogg differ
diff --git a/BGM/rockblock.ogg b/BGM/rockblock.ogg
index 086514d6..16843419 100644
Binary files a/BGM/rockblock.ogg and b/BGM/rockblock.ogg differ
diff --git a/BGM/secret7th.ogg b/BGM/secret7th.ogg
index fab18ff7..2747238c 100644
Binary files a/BGM/secret7th.ogg and b/BGM/secret7th.ogg differ
diff --git a/BGM/secret8th.ogg b/BGM/secret8th.ogg
index 1ee1cd83..ac3c049f 100644
Binary files a/BGM/secret8th.ogg and b/BGM/secret8th.ogg differ
diff --git a/BGM/shining terminal.ogg b/BGM/shining terminal.ogg
new file mode 100644
index 00000000..346ecc0f
Binary files /dev/null and b/BGM/shining terminal.ogg differ
diff --git a/BGM/way.ogg b/BGM/way.ogg
index 7138d82a..57542671 100644
Binary files a/BGM/way.ogg and b/BGM/way.ogg differ
diff --git a/SFX/blip_1.ogg b/SFX/blip_1.ogg
index 70c3bf49..832e4842 100644
Binary files a/SFX/blip_1.ogg and b/SFX/blip_1.ogg differ
diff --git a/SFX/blip_2.ogg b/SFX/blip_2.ogg
index 35415288..2065b6d1 100644
Binary files a/SFX/blip_2.ogg and b/SFX/blip_2.ogg differ
diff --git a/SFX/button.ogg b/SFX/button.ogg
index 2ef7892a..ea60c207 100644
Binary files a/SFX/button.ogg and b/SFX/button.ogg differ
diff --git a/SFX/clear_1.ogg b/SFX/clear_1.ogg
index b29f5a58..cbd8ea9b 100644
Binary files a/SFX/clear_1.ogg and b/SFX/clear_1.ogg differ
diff --git a/SFX/clear_2.ogg b/SFX/clear_2.ogg
index b6f5f87d..36e156a5 100644
Binary files a/SFX/clear_2.ogg and b/SFX/clear_2.ogg differ
diff --git a/SFX/clear_3.ogg b/SFX/clear_3.ogg
index c48473ff..c8812026 100644
Binary files a/SFX/clear_3.ogg and b/SFX/clear_3.ogg differ
diff --git a/SFX/clear_4.ogg b/SFX/clear_4.ogg
index ead8370a..708b884a 100644
Binary files a/SFX/clear_4.ogg and b/SFX/clear_4.ogg differ
diff --git a/SFX/collect.ogg b/SFX/collect.ogg
index 99639a16..23f251d9 100644
Binary files a/SFX/collect.ogg and b/SFX/collect.ogg differ
diff --git a/SFX/drop.ogg b/SFX/drop.ogg
index 56377365..2192f71c 100644
Binary files a/SFX/drop.ogg and b/SFX/drop.ogg differ
diff --git a/SFX/fail.ogg b/SFX/fail.ogg
index 3aeaef8c..5f09b25f 100644
Binary files a/SFX/fail.ogg and b/SFX/fail.ogg differ
diff --git a/SFX/fall.ogg b/SFX/fall.ogg
index 0df52ee4..f6576715 100644
Binary files a/SFX/fall.ogg and b/SFX/fall.ogg differ
diff --git a/SFX/hold.ogg b/SFX/hold.ogg
index 49b2a0ab..9b927c05 100644
Binary files a/SFX/hold.ogg and b/SFX/hold.ogg differ
diff --git a/SFX/lock.ogg b/SFX/lock.ogg
index 16b65bac..a428fe3f 100644
Binary files a/SFX/lock.ogg and b/SFX/lock.ogg differ
diff --git a/SFX/move.ogg b/SFX/move.ogg
index ba5d57cc..6072b1bf 100644
Binary files a/SFX/move.ogg and b/SFX/move.ogg differ
diff --git a/SFX/perfectclear.ogg b/SFX/perfectclear.ogg
index 38a0c059..13640a84 100644
Binary files a/SFX/perfectclear.ogg and b/SFX/perfectclear.ogg differ
diff --git a/SFX/prehold.ogg b/SFX/prehold.ogg
index 8810fca6..37b22ade 100644
Binary files a/SFX/prehold.ogg and b/SFX/prehold.ogg differ
diff --git a/SFX/prerotate.ogg b/SFX/prerotate.ogg
index e7bef7bb..3a1e8d8c 100644
Binary files a/SFX/prerotate.ogg and b/SFX/prerotate.ogg differ
diff --git a/SFX/reach.ogg b/SFX/reach.ogg
index 48f3e65d..68bc84ec 100644
Binary files a/SFX/reach.ogg and b/SFX/reach.ogg differ
diff --git a/SFX/ready.ogg b/SFX/ready.ogg
index 0fcd417a..a707e57e 100644
Binary files a/SFX/ready.ogg and b/SFX/ready.ogg differ
diff --git a/SFX/rotate.ogg b/SFX/rotate.ogg
index d96f0c99..1bff575a 100644
Binary files a/SFX/rotate.ogg and b/SFX/rotate.ogg differ
diff --git a/SFX/rotatekick.ogg b/SFX/rotatekick.ogg
index e8e99386..7d10e8a9 100644
Binary files a/SFX/rotatekick.ogg and b/SFX/rotatekick.ogg differ
diff --git a/SFX/spin_1.ogg b/SFX/spin_1.ogg
index f7db4af0..050f2510 100644
Binary files a/SFX/spin_1.ogg and b/SFX/spin_1.ogg differ
diff --git a/SFX/spin_2.ogg b/SFX/spin_2.ogg
index 6727ac3b..2b6bc94e 100644
Binary files a/SFX/spin_2.ogg and b/SFX/spin_2.ogg differ
diff --git a/SFX/spin_3.ogg b/SFX/spin_3.ogg
index 5b765d50..ed626814 100644
Binary files a/SFX/spin_3.ogg and b/SFX/spin_3.ogg differ
diff --git a/SFX/start.ogg b/SFX/start.ogg
index 1a1d335c..f15bacfe 100644
Binary files a/SFX/start.ogg and b/SFX/start.ogg differ
diff --git a/SFX/swipe.ogg b/SFX/swipe.ogg
index 0fd1196b..86662acb 100644
Binary files a/SFX/swipe.ogg and b/SFX/swipe.ogg differ
diff --git a/SFX/win.ogg b/SFX/win.ogg
index fdd74a10..d34ceaec 100644
Binary files a/SFX/win.ogg and b/SFX/win.ogg differ
diff --git a/ai.lua b/ai.lua
index 3b19e7a6..da66926f 100644
--- a/ai.lua
+++ b/ai.lua
@@ -8,8 +8,76 @@
4deepShape
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 spinOffset={
{1,0,0},--S
@@ -20,12 +88,6 @@ local spinOffset={
{0,0,0},--O
{2,0,1},--I
}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={
[1]={
{{11},{11,2},{1},{},{2},{2,2},{12,1},{12}},
@@ -68,7 +130,7 @@ local function resetField(f0,f,start)
end
end
end
-local function getScore(field,bn,cb,cx,cy)
+local function getScore(field,cb,cy)
local score=0
local highest=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
return score
end
-function AI_getControls(ctrl)
- local Tfield={}--test field
- local field_org=P.field
- for i=1,#field_org do
- Tfield[i]=getNewRow(0)
- for j=1,10 do
- Tfield[i][j]=field_org[i][j]
- end
- end
- local best={x=1,dir=0,hold=false,score=-9e99}
- for ifhold=0,P.gameEnv.hold and 1 or 0 do
- local bn=ifhold==0 and P.cur.id or P.hold.id>0 and P.hold.id or P.next[1].id
- for dir=0,dirCount[bn] do--each dir
- local cb=blocks[bn][dir]
- for cx=1,11-#cb[1]do--each pos
- local cy=#Tfield+1
- ::L::if not ifoverlapAI(Tfield,cb,cx,cy-1)then
- cy=cy-1
- goto L
- end--move to bottom
- for i=1,#cb do
- local y=cy+i-1
- if not Tfield[y]then Tfield[y]=getNewRow(0)end
- for j=1,#cb[1]do
- if cb[i][j]then
- Tfield[y][cx+j-1]=1
- end
- end
- end--simulate lock
- local score=getScore(Tfield,bn,cb,cx,cy)
- if score>best.score then
- best={bn=bn,x=cx,dir=dir,hold=ifhold==1,score=score}
+-------------------------------------------------
+AI_think={
+ ["9S"]={
+ function(ctrl)
+ local Tfield={}--test field
+ local field_org=P.field
+ for i=1,#field_org do
+ Tfield[i]=getNewRow(0)
+ for j=1,10 do
+ Tfield[i][j]=field_org[i][j]
+ end
+ end
+ local best={x=1,dir=0,hold=false,score=-9e99}
+ for ifhold=0,P.gameEnv.hold and 1 or 0 do
+ local bn=ifhold==0 and P.cur.id or P.hold.id>0 and P.hold.id or P.next[1].id
+ for dir=0,dirCount[bn] do--each dir
+ local cb=blocks[bn][dir]
+ for cx=1,11-#cb[1]do--each pos
+ local cy=#Tfield+1
+ ::L::if not ifoverlapAI(Tfield,cb,cx,cy-1)then
+ cy=cy-1
+ goto L
+ end--move to bottom
+ for i=1,#cb do
+ local y=cy+i-1
+ if not Tfield[y]then Tfield[y]=getNewRow(0)end
+ for j=1,#cb[1]do
+ if cb[i][j]then
+ Tfield[y][cx+j-1]=1
+ end
+ end
+ 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
- resetField(field_org,Tfield,cy)
end
- end
- end
- ::L::
- if #Tfield>0 then
- removeRow(Tfield,1)
- goto L
- end--Release cache
- local p=#ctrl+1
- if best.hold then
- ctrl[p]=8
- p=p+1
- end
- local l=FCL[best.bn][best.dir+1][best.x]
- for i=1,#l do
- ctrl[p]=l[i]
- p=p+1
- end
- ctrl[p]=6
-end
\ No newline at end of file
+ ::L::
+ if #Tfield>0 then
+ removeRow(Tfield,1)
+ goto L
+ end--Release cache
+ local p=#ctrl+1
+ if best.hold then
+ ctrl[p]=8
+ p=p+1
+ end
+ local l=FCL[best.bn][best.dir+1][best.x]
+ for i=1,#l do
+ ctrl[p]=l[i]
+ p=p+1
+ end
+ ctrl[p]=6
+ 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
\ No newline at end of file
diff --git a/class.lua b/class.lua
index 83fc0dd3..221bdfce 100644
--- a/class.lua
+++ b/class.lua
@@ -1,17 +1,24 @@
-Task={}
local rem=table.remove
-
-metatable_task={__index=Task}
+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)
- local id=#Task+1
- local obj={
+ Task[#Task+1]={
+ update=Task.update,
+
code=code,
P=P,
data=data,
- id=id,
}
- setmetatable(obj,metatable_task)
- Task[id]=obj
end
function clearTask(opt)
if opt=="all"then
@@ -34,14 +41,22 @@ function clearTask(opt)
end
end
end
-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
+
+function newButton(x,y,w,h,color,font,code,hide,up,down,left,right)
+ return{
+ type="button",
+ x=x-w*.5,y=y-h*.5,w=w,h=h,
+ color=color,font=font,
+ code=code,hide=hide,
+ up=up,down=down,left=left,right=right,
+ }
+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
\ No newline at end of file
diff --git a/conf.lua b/conf.lua
index 57f9e4ce..cac48524 100644
--- a/conf.lua
+++ b/conf.lua
@@ -1,4 +1,4 @@
-gameVersion="Alpha V0.7.22"
+gameVersion="Alpha V0.7.23"
function love.conf(t)
t.identity="Techmino"--Save directory name
t.version="11.1"
diff --git a/dataList.lua b/dataList.lua
index be840bf9..2d301198 100644
--- a/dataList.lua
+++ b/dataList.lua
@@ -52,6 +52,23 @@ local function throwBadge(S,R)--Sender/Receiver
end
FX.badge[#FX.badge+1]={x1,y1,x2,y2,t=0}
end
+local AISpeed={60,50,45,35,25,15,9,7,5,3}
+local function AITemplate(type,speedLV,next,hold,node)
+ if type=="CC"then
+ return{
+ type=type,
+ delta=AISpeed[speedLV],
+ next=next,
+ hold=true,--hold,-------------!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ node=node,
+ }
+ elseif type=="9S"then
+ return{
+ type=type,
+ delta=int(AISpeed[speedLV]*.5),
+ }
+ end
+end
loadmode={
sprint=function()
createPlayer(1,340,15)
@@ -79,7 +96,40 @@ loadmode={
end,
solo=function()
createPlayer(1,340,15)
- createPlayer(2,965,360,.5,customRange.opponent[3*curMode.lv])
+ if curMode.lv==1 then
+ createPlayer(2,965,360,.5,AITemplate("9S",3))
+ elseif curMode.lv==2 then
+ createPlayer(2,965,360,.5,AITemplate("CC",2,2,false,25000))
+ elseif curMode.lv==3 then
+ createPlayer(2,965,360,.5,AITemplate("9S",6))
+ elseif curMode.lv==4 then
+ createPlayer(2,965,360,.5,AITemplate("CC",5,2,true,35000))
+ elseif curMode.lv==5 then
+ createPlayer(2,965,360,.5,AITemplate("9S",9))
+ elseif curMode.lv==6 then
+ createPlayer(2,965,360,.5,AITemplate("CC",8,3,true,50000))
+ elseif curMode.lv==7 then
+ createPlayer(2,965,360,.5,AITemplate("9S",10))
+ elseif curMode.lv==8 then
+ createPlayer(2,965,360,.5,AITemplate("CC",9,3,true,100000))
+ elseif curMode.lv==9 then
+ createPlayer(2,965,360,.5,AITemplate("CC",10,4,true,200000))
+ end
+ end,
+ round=function()
+ createPlayer(1,340,15)
+ if curMode.lv==1 then
+ createPlayer(2,965,360,.5,AITemplate("9S",nil,10))
+ elseif curMode.lv==2 then
+ createPlayer(2,965,360,.5,AITemplate("CC",10,2,false,20000))
+ elseif curMode.lv==3 then
+ createPlayer(2,965,360,.5,AITemplate("CC",10,3,true,50000))
+ elseif curMode.lv==4 then
+ createPlayer(2,965,360,.5,AITemplate("CC",10,4,true,100000))
+ elseif curMode.lv==5 then
+ createPlayer(2,965,360,.5,AITemplate("CC",10,6,true,1000000))
+ end
+ garbageSpeed=1e4
end,
tsd=function()
createPlayer(1,340,15)
@@ -89,14 +139,26 @@ loadmode={
end,
dig=function()
createPlayer(1,340,15)
- newTask(Event_task[curMode.lv==1 and"dig_normal"or curMode.lv==2 and"dig_lunatic"],P)
pushSpeed=1
end,
survivor=function()
createPlayer(1,340,15)
- newTask(Event_task[curMode.lv==1 and"survivor_easy"or curMode.lv==2 and"survivor_normal"or curMode.lv==3 and"survivor_hard"or curMode.lv==4 and"survivor_lunatic"or curMode.lv==5 and"survivor_ultimate"or curMode.lv==6 and"survivor_extra"],P)
pushSpeed=curMode.lv>2 and 2 or 1
end,
+ defender=function()
+ createPlayer(1,340,15)
+ if curMode.lv==1 then
+ pushSpeed=1
+ elseif curMode.lv==2 then
+ pushSpeed=2
+ end
+ end,
+ attacker=function()
+ createPlayer(1,340,15)
+ if curMode.lv==1 then
+ pushSpeed=2
+ end
+ end,
tech=function()
createPlayer(1,340,15)
end,
@@ -127,33 +189,67 @@ loadmode={
end,
techmino49=function()
createPlayer(1,340,15)
- if curMode.lv==5 then players[1].gameEnv.drop=15 end
- local n,min,max=2,curMode.lv,35-6*curMode.lv
+ local LV=curMode.lv
+ if LV==3 then players[1].gameEnv.drop=15 end
+ local L={}for i=1,49 do L[i]=true end
+ local t=int(LV^2.5)
+ repeat
+ local r=rnd(2,49)
+ if L[r]then L[r],t=false,t-1 end
+ until t==0
+ local min,max
+ if LV==1 then min,max=3,5
+ elseif LV==2 then min,max=4,8
+ elseif LV==3 then min,max=8,10
+ end
+ local n=2
for i=1,4 do for j=1,6 do
- createPlayer(n,78*i-54,115*j-98,.09,rnd(min,max))
+ if L[n]then
+ createPlayer(n,78*i-54,115*j-98,.09,AITemplate("9S",rnd(min,max)))
+ else
+ createPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(min,max),LV+1,true,LV^2*3500))
+ end
n=n+1
end end
for i=9,12 do for j=1,6 do
- createPlayer(n,78*i+267,115*j-98,.09,rnd(min,max))
+ if L[n]then
+ createPlayer(n,78*i+267,115*j-98,.09,AITemplate("9S",rnd(min,max)))
+ else
+ createPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(min,max),LV+1,true,LV^2*3500))
+ end
n=n+1
end end
end,
techmino99=function()
createPlayer(1,340,15)
- if curMode.lv==5 then players[1].gameEnv.drop=15 end
- local n,min,max=2
- if curMode.lv==1 then min,max=5,32
- elseif curMode.lv==2 then min,max=3,25
- elseif curMode.lv==3 then min,max=2,18
- elseif curMode.lv==4 then min,max=2,12
- elseif curMode.lv==5 then min,max=1,12
+ local LV=curMode.lv
+ if LV==3 then players[1].gameEnv.drop=15 end
+ local L={}for i=1,100 do L[i]=true end
+ local t=2*int(LV^2.5)
+ repeat
+ local r=rnd(2,99)
+ if L[r]then L[r],t=false,t-1 end
+ until t==0
+ local min,max
+ if LV==1 then min,max=3,5
+ elseif LV==2 then min,max=4,9
+ elseif LV==3 then min,max=7,10
end
+ local n=2
for i=1,7 do for j=1,7 do
- createPlayer(n,46*i-36,97*j-72,.068,rnd(min,max))
+ if L[n]then
+ createPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(min,max)))
+ else
+ createPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(min,max),LV+1,true,LV^2*3000))
+ end
n=n+1
end end
for i=15,21 do for j=1,7 do
- createPlayer(n,46*i+264,97*j-72,.068,rnd(min,max))
+ if L[n]then
+ createPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(min,max)))
+ else
+ createPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(min,max),LV+1,true,LV^2*3000))
+ end
n=n+1
end end
end,
@@ -180,13 +276,20 @@ loadmode={
local k=customID[i]
modeEnv[k]=customRange[k][customSel[i]]
end
- modeEnv._20G=modeEnv.drop==-1
+ modeEnv._20G=modeEnv.drop==0
modeEnv.oncehold=customSel[6]==1
+ if curMode.lv==2 then
+ modeEnv.target=0
+ end
createPlayer(1,340,15)
- if modeEnv.opponent==0 then
- else
+ local L=modeEnv.opponent
+ if L~=0 then
modeEnv.target=nil
- createPlayer(2,965,360,.5,modeEnv.opponent)
+ if L<10 then
+ createPlayer(2,965,360,.5,AITemplate("9S",2*L))
+ else
+ createPlayer(2,965,360,.5,AITemplate("CC",L-6,2+int((L-11)*.5),true,15000+5000*(L-10)))
+ end
end
preField.h=20
repeat
@@ -228,13 +331,13 @@ mesDisp={
setFont(50)
mStr(P.stat.row,-82,320)
mStr(P.gameEnv.target,-82,370)
- gc.rectangle("fill",-128,376,90,4)
+ gc.rectangle("fill",-125,375,90,4)
end,
master=function()
setFont(50)
mStr(P.modeData.point,-82,320)
mStr((P.modeData.event+1)*100,-82,370)
- gc.rectangle("fill",-128,376,90,4)
+ gc.rectangle("fill",-125,375,90,4)
end,
classic=function()
setFont(80)
@@ -245,7 +348,7 @@ mesDisp={
setFont(50)
mStr(P.stat.row,-82,320)
mStr(P.gameEnv.target,-82,370)
- gc.rectangle("fill",-128,376,90,4)
+ gc.rectangle("fill",-125,375,90,4)
end,
zen=function()
setFont(75)
@@ -280,7 +383,7 @@ mesDisp={
end,
dig=function()
setFont(70)
- mStr(P.modeData.event-20,-82,310)
+ mStr(P.modeData.event,-82,310)
setFont(30)
mStr("Wave",-82,375)
end,
@@ -290,6 +393,18 @@ mesDisp={
setFont(30)
mStr("Wave",-82,375)
end,
+ defender=function()
+ setFont(60)
+ mStr(P.modeData.point,-82,315)
+ setFont(30)
+ mStr("RPM",-82,375)
+ end,
+ attacker=function()
+ setFont(60)
+ mStr(P.modeData.point,-82,315)
+ setFont(30)
+ mStr("RPM",-82,375)
+ end,
tech=function()
setFont(50)
mStr(P.stat.atk,-82,310)
@@ -321,8 +436,10 @@ mesDisp={
setFont(50)
mStr(max(100-P.stat.row,0),-82,250)
gc.setColor(.5,.5,.5)
- local y=72*(7-(P.stat.piece+1)%7)-36
- gc.line(320,y,442,y)
+ if frame>179 then
+ local y=72*(7-(P.stat.piece+(P.hold.id>0 and 2 or 1))%7)-36
+ gc.line(320,y,442,y)
+ end
end,
techmino49=function()
setFont(40)
@@ -359,13 +476,14 @@ mesDisp={
mStr(max(100-P.stat.row,0),-82,280)
end,
custom=function()
- setFont(25)
- mStr("Rows",-82,300)
- setFont(65)
- mStr(P.stat.row,-82,225)
- if P.gameEnv.target<1e4 then
- setFont(75)
- mStr(max(P.gameEnv.target-P.stat.row,0),-82,280)
+ if P.gameEnv.puzzle or P.gameEnv.target>1e10 then
+ setFont(25)
+ mStr("Rows",-82,290)
+ setFont(65)
+ mStr(P.stat.row,-82,225)
+ else
+ setFont(60)
+ mStr(max(P.gameEnv.target-P.stat.row,0),-82,240)
end
if P.gameEnv.puzzle and P.modeData.event==0 then
gc.setLineWidth(3)
@@ -389,6 +507,11 @@ mesDisp={
end
}
Event={
+ reach_winCheck=function()
+ if P.stat.row>=P.gameEnv.target then
+ Event.win()
+ end
+ end,
win=function()
P.alive=false
P.control=false
@@ -505,80 +628,107 @@ Event={
newTask(Event_task.finish,P)
end
end,
- marathon_reach=function()
- local s=int(P.stat.row*.1)
- if s>=20 then
- P.stat.row=200
- Event.win()
- else
- P.gameEnv.drop=marathon_drop[s]
- if s==18 then P.gameEnv._20G=true end
- P.gameEnv.target=s*10+10
+
+ marathon_update=function()
+ if P.stat.row>=P.gameEnv.target then
+ local s=int(P.stat.row*.1)
+ if s>=20 then
+ P.stat.row=200
+ Event.win()
+ else
+ P.gameEnv.drop=marathon_drop[s]
+ if s==18 then P.gameEnv._20G=true end
+ P.gameEnv.target=s*10+10
+ SFX("reach")
+ end
+ end
+ end,
+ master_score=function()
+ local c=#P.clearing
+ if c==0 and P.modeData.point%100==99 then return end
+ local s=c<3 and c+1 or c==3 and 5 or 7
+ if P.combo>7 then s=s+2
+ elseif P.combo>3 then s=s+1
+ end
+ P.modeData.point=P.modeData.point+s
+ if P.modeData.point%100==99 then
+ SFX("blip_1")
+ elseif P.modeData.point>100*P.modeData.event+100 then
+ local s=P.modeData.event+1;P.modeData.event=s--level up!
+ showText(P,text.stage(s),"fly",80,-120)
+ local E=P.gameEnv
+ local mode=curMode.lv
+ if mode==1 then
+ curBG=s==2 and"game1"or s==3 and"game2"or s==4 and"game3"or s==5 and"game4"
+ E.lock=rush_lock[s]
+ E.wait=rush_wait[s]
+ E.fall=rush_fall[s]
+ E.das=10-s
+ if s==3 then P.gameEnv.arr=2 end
+ if s==5 then P.gameEnv.bone=true end
+ elseif mode==2 then
+ curBG=s==2 and"game3"or s==3 and"game4"or s==4 and"game5"or s==5 and"game6"
+ E.lock=death_lock[s]
+ E.wait=death_wait[s]
+ E.fall=death_fall[s]
+ E.das=int(7.3-s*.4)
+ if s==4 then P.gameEnv.bone=true end
+ end
SFX("reach")
end
end,
- master_reach_lunatic=function()
- local t=P.modeData.point
+ master_score_hard=function()
local c=#P.clearing
- if t%100==99 and c==0 then return end
- t=t+(c<3 and c+1 or c==3 and 5 or 7)
- if int(t*.01)>P.modeData.event then
- P.modeData.event=P.modeData.event+1
- if P.modeData.event==5 then
- P.modeData.event=4
- P.modeData.point=500
- Event.win()
- return
+ if P.modeData.point%100<60 then
+ P.modeData.point=P.modeData.point+(c<3 and c+1 or c==3 and 5 or 7)--[1]2 3 5 7
+ if P.modeData.point%100>59 then SFX("blip_1")end
+ return
+ else
+ if c==0 then return end
+ local s
+ if P.lastClear<10 then
+ s=c-1--0,1,2,X
else
- local s=P.modeData.event+1
- curBG=s==2 and"game1"or s==3 and"game2"or s==4 and"game3"or s==5 and"game4"
- P.gameEnv.lock=rush_lock[s]
- P.gameEnv.wait=rush_wait[s]
- P.gameEnv.fall=rush_fall[s]
- P.gameEnv.das=10-s
- if s==3 then P.gameEnv.arr=2 end
- if s==5 then P.gameEnv.bone=true end
- showText(P,text.stage[s],"fly",80,-120)
- SFX("reach")
+ s=int(c^1.45)--1,2,4,7
end
+ if P.combo>9 then s=s+3
+ elseif P.combo>4 then s=s+2
+ elseif P.combo>2 then s=s+1
+ end
+ P.modeData.point=P.modeData.point+s
end
- P.modeData.point=t
- if t%100==99 then SFX("blip_1")end
- end,
- master_reach_ultimate=function()
- local t=P.modeData.point
- local c=#P.clearing
- if t%100==99 and c==0 then return end
- t=t+(c<3 and c+1 or c==3 and 5 or 7)
- if int(t*.01)>P.modeData.event then
- P.modeData.event=P.modeData.event+1
- if P.modeData.event==5 then
- curBG="game5"
- P.modeData.event=4
- P.modeData.point=500
- Event.win()
- return
+ if int(P.modeData.point*.01)>P.modeData.event then
+ local s=P.modeData.event+1;P.modeData.event=s--level up!
+ showText(P,text.stage(s),"fly",80,-120)
+ if s<4 then--first 300
+ if s~=1 then P.gameEnv.lock=P.gameEnv.lock-1 end
+ if s~=2 then P.gameEnv.wait=P.gameEnv.wait-1 end
+ if s~=3 then P.gameEnv.fall=P.gameEnv.fall-1 end
+ elseif s<10 then
+ if s==4 or s==7 then P.gameEnv.das=P.gameEnv.das-1 end
+ s=s%3
+ if s==0 then
+ P.gameEnv.lock=P.gameEnv.lock-1
+ elseif s==1 then
+ P.gameEnv.wait=P.gameEnv.wait-1
+ elseif s==2 then
+ P.gameEnv.fall=P.gameEnv.fall-1
+ end
else
- local s=P.modeData.event+1
- curBG=s==2 and"game3"or s==3 and"game4"or s==4 and"game5"or s==5 and"game6"
- P.gameEnv.lock=death_lock[s]
- P.gameEnv.wait=death_wait[s]
- P.gameEnv.fall=death_fall[s]
- P.gameEnv.das=int(7.3-s*.4)
- if s==4 then P.gameEnv.bone=true end
- showText(P,text.stage[s],"fly",80,-120)
- SFX("reach")
+ P.modeData.point,P.modeData.event=1000,9
+ Event.win()
end
+ SFX("reach")
end
- P.modeData.point=t
- if t%100==99 then SFX("blip_1")end
end,
classic_reach=function()
- P.gameEnv.target=P.gameEnv.target+10
- if P.gameEnv.target==100 then
- P.gameEnv.drop,P.gameEnv.lock=0,0
+ if P.stat.row>=P.gameEnv.target then
+ P.gameEnv.target=P.gameEnv.target+10
+ if P.gameEnv.target==100 then
+ P.gameEnv.drop,P.gameEnv.lock=1,1
+ end
+ SFX("reach")
end
- SFX("reach")
end,
infinite_check=function()
for i=1,#P.clearing do
@@ -587,6 +737,17 @@ Event={
end
end
end,
+ round_check=function()
+ if #players.alive>1 then
+ P.control=false
+ local ID=P.id
+ repeat
+ ID=ID+1
+ if not players[ID]then ID=1 end
+ until players[ID].alive or ID==P.id
+ players[ID].control=true
+ end
+ end,
GM_reach=function()
local R=#P.clearing
if R==4 then R=10 end
@@ -596,17 +757,17 @@ Event={
end
end,
tsd_reach=function()
- if P.lastClear~=52 then
- Event.lose()
- elseif #P.clearing>0 then
- P.modeData.event=P.modeData.event+1
+ if #P.clearing>0 then
+ if P.lastClear~=52 then
+ Event.lose()
+ elseif #P.clearing>0 then
+ P.modeData.event=P.modeData.event+1
+ end
end
end,
tech_reach_easy=function()
- if P.b2b<40 then
+ if #P.clearing>0 and P.b2b<40 then
Event.lose()
- elseif P.stat.row==3 then
- Event.win()
end
end,
tech_reach_hard=function()
@@ -639,53 +800,50 @@ Event={
end
end,
newPC=function()
- if P.stat.piece%4==0 then
- if #P.field==#P.clearing then
- P.modeData.event=P.modeData.event==0 and 1 or 0
- local r=rnd(#PClist)
- local f=P.modeData.event==0
- for i=1,4 do
- local b=PClist[r][i]
- if f then
- if b<3 then b=3-b
- elseif b<5 then b=7-b
- end
- end
- newNext(b)
- end
- P.counter=P.stat.piece==0 and 20 or 0
- newTask(Event_task.PC,P)
- if curMode.lv==2 then
- local s=P.stat.pc*.5
- if int(s)==s and s>0 then
- P.gameEnv.drop=pc_drop[s]or 10
- P.gameEnv.lock=pc_lock[s]or 20
- P.gameEnv.fall=pc_fall[s]or 5
- if s==10 then
- showText(P,text.maxspeed,"appear",100,-140,.6)
- else
- showText(P,text.speedup,"appear",40,-140)
- end
- end
- end
- else
- Event.lose()
- end
- elseif P.curY+P.r>5-P.stat.row%4+#P.clearing then
+ if P.curY+P.r>5-P.stat.row%4+#P.clearing then
Event.lose()
end
+ if P.stat.piece%4==0 and #P.field==#P.clearing then
+ P.modeData.event=P.modeData.event==0 and 1 or 0
+ local r=rnd(#PClist)
+ local f=P.modeData.event==0
+ for i=1,4 do
+ local b=PClist[r][i]
+ if f then
+ if b<3 then b=3-b
+ elseif b<5 then b=7-b
+ end
+ end
+ newNext(b)
+ end
+ P.counter=P.stat.piece==0 and 20 or 0
+ newTask(Event_task.PC,P)
+ if curMode.lv==2 then
+ local s=P.stat.pc*.5
+ if int(s)==s and s>0 then
+ P.gameEnv.drop=pc_drop[s]or 10
+ P.gameEnv.lock=pc_lock[s]or 20
+ P.gameEnv.fall=pc_fall[s]or 5
+ if s==10 then
+ showText(P,text.maxspeed,"appear",100,-140,.6)
+ else
+ showText(P,text.speedup,"appear",40,-140)
+ end
+ end
+ end
+ end
end,
puzzleCheck=function()
for y=1,20 do
local L=P.field[y]
for x=1,10 do
local a,b=preField[y][x],L and L[x]or 0
- if a~=-1 and(a==0 and b>0 or a<8 and a~=b or a>7 and b==0)then return end
+ if a~=0 and(a==0 and b>0 or a<8 and a~=b or a>7 and b==0)then return end
end
end
P.modeData.event=1
Event.win()
- end
+ end,
}
Event_task={
finish=function(self,P)
@@ -727,6 +885,7 @@ Event_task={
end
if data[2]<=0 then return true end
end,
+
dig_normal=function(self,P)
if not P.control then return end
P.counter=P.counter+1
@@ -821,37 +980,131 @@ Event_task={
P.modeData.event=P.modeData.event+1
end
end,
- survivor_extra=function(self,P)
+ defender_normal=function(self,P)
if not P.control then return end
- if P.atkBuffer.sum<3 then
- local p=#P.atkBuffer+1
- local T=P.modeData.event
- if T<15 then
- local t=1200-20*T--1200~900
- P.atkBuffer[p] ={pos=rnd(5,6),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=3}
- P.atkBuffer[p+1]={pos=rnd(4,7),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=4}
- elseif T<30 then
- local t=900-20*(T-15)--900~600
- P.atkBuffer[p] ={pos=rnd(3,8),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=4}
- P.atkBuffer[p+1]={pos=rnd(4,7),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=5}
- else
- local t=max(480,720-16*(T-30))--720~480
- P.atkBuffer[p] ={pos=rnd(2)*9-8,amount=12,countdown=t,cd0=t,time=0,sent=false,lv=5}
- P.atkBuffer[p+1]={pos=rnd(3,8),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=5}
+ P.counter=P.counter+1
+ local t=360-P.modeData.event*2
+ if P.counter>=t then
+ P.counter=0
+ for i=1,3 do
+ P.atkBuffer[#P.atkBuffer+1]={pos=rnd(2,9),amount=1,countdown=2*t,cd0=2*t,time=0,sent=false,lv=1}
end
- P.atkBuffer.sum=P.atkBuffer.sum+20
- P.stat.recv=P.stat.recv+20
- P.modeData.event=P.modeData.event+1
- if P.modeData.event==15 then
- showText(P,text.awesome,"appear",100,-140,.6)
- elseif P.modeData.event==16 then
- pushSpeed=4
- elseif P.modeData.event==30 then
- showText(P,text.continue,"appear",100,-140,.6)
- elseif P.modeData.event==31 then
- pushSpeed=6
- elseif P.modeData.event==45 then
- showText(P,text.maxspeed,"appear",100,-140,.6)
+ P.atkBuffer.sum=P.atkBuffer.sum+3
+ P.stat.recv=P.stat.recv+3
+ local D=P.modeData
+ if D.event<90 then
+ D.event=D.event+1
+ D.point=int(108e3/(360-D.event*2))*.1
+ if D.event==25 then
+ showText(P,text.great,"appear",100,-140,.6)
+ pushSpeed=2
+ P.dropDelay,P.gameEnv.drop=20,20
+ elseif D.event==50 then
+ showText(P,text.awesome,"appear",100,-140,.6)
+ pushSpeed=3
+ P.dropDelay,P.gameEnv.drop=10,10
+ elseif D.event==90 then
+ P.dropDelay,P.gameEnv.drop=5,5
+ showText(P,text.maxspeed,"appear",100,-140,.6)
+ end
+ end
+ end
+ end,
+ defender_lunatic=function(self,P)
+ if not P.control then return end
+ P.counter=P.counter+1
+ local t=240-2*P.modeData.event
+ if P.counter>=t then
+ P.counter=0
+ for i=1,4 do
+ P.atkBuffer[#P.atkBuffer+1]={pos=rnd(10),amount=1,countdown=5*t,cd0=5*t,time=0,sent=false,lv=2}
+ end
+ P.atkBuffer.sum=P.atkBuffer.sum+4
+ P.stat.recv=P.stat.recv+4
+ local D=P.modeData
+ if D.event<75 then
+ D.event=D.event+1
+ D.point=int(144e3/(240-2*D.event))*.1
+ if D.event==25 then
+ showText(P,text.great,"appear",100,-140,.6)
+ pushSpeed=3
+ P.dropDelay,P.gameEnv.drop=4,4
+ elseif D.event==50 then
+ showText(P,text.awesome,"appear",100,-140,.6)
+ pushSpeed=4
+ P.dropDelay,P.gameEnv.drop=3,3
+ elseif D.event==75 then
+ showText(P,text.maxspeed,"appear",100,-140,.6)
+ P.dropDelay,P.gameEnv.drop=2,2
+ end
+ end
+ end
+ end,
+ attacker_hard=function(self,P)
+ if not P.control then return end
+ if P.atkBuffer.sum==0 then
+ local p=#P.atkBuffer+1
+ local B,D=P.atkBuffer,P.modeData
+ local t
+ if D.event<20 then
+ t=1500-30*D.event--1500~900
+ B[p]= {pos=rnd(4,7),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=3}
+ B[p+1]= {pos=rnd(3,8),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=4}
+ else
+ t=900-10*(D.event-20)--900~600
+ B[p]= {pos=rnd(10),amount=6,countdown=t,cd0=t,time=0,sent=false,lv=4}
+ B[p+1]= {pos=rnd(4,7),amount=16,countdown=t,cd0=t,time=0,sent=false,lv=5}
+ end
+ B.sum=B.sum+22
+ P.stat.recv=P.stat.recv+22
+ if D.event<50 then
+ D.event=D.event+1
+ D.point=int(72e4/t)*.1
+ if D.event==20 then
+ showText(P,text.great,"appear",100,-140,.6)
+ pushSpeed=3
+ elseif D.event==50 then
+ showText(P,text.maxspeed,"appear",100,-140,.6)
+ end
+ end
+ end
+ end,
+ attacker_ultimate=function(self,P)
+ if not P.control then return end
+ if P.atkBuffer.sum<2 then
+ local p=#P.atkBuffer+1
+ local B,D=P.atkBuffer,P.modeData
+ local s,t
+ if D.event<10 then
+ t=1000-20*D.event--1000~800
+ B[p]= {pos=rnd(5,6),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=3}
+ B[p+1]= {pos=rnd(4,7),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=4}
+ s=22
+ elseif D.event<20 then
+ t=800-20*(D.event-15)--800~600
+ B[p]= {pos=rnd(3,8),amount=11,countdown=t,cd0=t,time=0,sent=false,lv=4}
+ B[p+1]= {pos=rnd(4,7),amount=14,countdown=t,cd0=t,time=0,sent=false,lv=5}
+ s=25
+ else
+ t=600-15*(D.event-30)--600~450
+ B[p]= {pos=rnd(2)*9-8,amount=12,countdown=t,cd0=t,time=0,sent=false,lv=5}
+ B[p+1]= {pos=rnd(3,8),amount=16,countdown=t,cd0=t,time=0,sent=false,lv=5}
+ s=28
+ end
+ B.sum=B.sum+s
+ P.stat.recv=P.stat.recv+s
+ if D.event<45 then
+ D.event=D.event+1
+ D.point=int(s*36e3/t)*.1
+ if D.event==10 then
+ showText(P,text.great,"appear",100,-140,.6)
+ pushSpeed=4
+ elseif D.event==20 then
+ showText(P,text.awesome,"appear",100,-140,.6)
+ pushSpeed=5
+ elseif D.event==30 then
+ showText(P,text.maxspeed,"appear",100,-140,.6)
+ end
end
end
end,
@@ -899,85 +1152,112 @@ Event_task={
end
end
}
+local Fkey_func={
+ royale=function()
+ if setting.swap then
+ for i=1,#P.keyPressing do
+ if P.keyPressing[i]then
+ P.keyPressing[i]=false
+ end
+ end
+ P.keyPressing[9]=true
+ else
+ changeAtkMode(P.atkMode<3 and P.atkMode+2 or 5-P.atkMode)
+ P.swappingAtkMode=30
+ end
+ end,
+ puzzle=function()
+ P.modeData.event=1-P.modeData.event
+ end,
+}
defaultModeEnv={
sprint={
{
drop=60,lock=60,
- target=10,reach=Event.win,
+ target=10,dropPiece=Event.reach_winCheck,
bg="strap",bgm="race",
},
{
drop=60,lock=60,
- target=20,reach=Event.win,
+ target=20,dropPiece=Event.reach_winCheck,
bg="strap",bgm="race",
},
{
drop=60,lock=60,
- target=40,reach=Event.win,
+ target=40,dropPiece=Event.reach_winCheck,
bg="strap",bgm="race",
},
{
drop=60,lock=60,
- target=100,reach=Event.win,
+ target=100,dropPiece=Event.reach_winCheck,
bg="strap",bgm="race",
},
{
drop=60,lock=60,
- target=400,reach=Event.win,
+ target=400,dropPiece=Event.reach_winCheck,
bg="strap",bgm="push",
},
{
drop=60,lock=60,
- target=1000,reach=Event.win,
+ target=1000,dropPiece=Event.reach_winCheck,
bg="strap",bgm="push",
},
},
marathon={
{
drop=60,lock=60,fall=30,
- target=200,reach=Event.marathon_reach,
+ target=200,dropPiece=Event.reach_winCheck,
bg="strap",bgm="way",
},
{
drop=60,fall=20,
- target=10,reach=Event.marathon_reach,
+ target=10,dropPiece=Event.marathon_update,
bg="strap",bgm="way",
},
{
_20G=true,fall=15,
- target=200,reach=Event.marathon_reach,
+ target=200,dropPiece=Event.reach_winCheck,
bg="strap",bgm="race",
},
},
master={
{
- _20G=true,drop=0,lock=rush_lock[1],
+ _20G=true,lock=rush_lock[1],
wait=rush_wait[1],
fall=rush_fall[1],
- target=0,reach=Event.master_reach_lunatic,
+ dropPiece=Event.master_score,
das=9,arr=3,
freshLimit=15,
bg="strap",bgm="secret8th",
},
{
- _20G=true,drop=0,lock=death_lock[1],
+ _20G=true,lock=death_lock[1],
wait=death_wait[1],
fall=death_fall[1],
- target=0,reach=Event.master_reach_ultimate,
+ dropPiece=Event.master_score,
das=6,arr=1,
freshLimit=15,
bg="game2",bgm="secret7th",
},
+ {
+ _20G=true,lock=12,
+ wait=10,fall=10,
+ dropPiece=Event.master_score_hard,
+ das=5,arr=1,
+ freshLimit=15,
+ easyFresh=false,bone=true,
+ bg="none",bgm="shining terminal",
+ },
},
classic={
{
das=15,arr=3,sddas=2,sdarr=2,
ghost=false,center=false,
- drop=1,lock=1,wait=10,fall=25,
+ drop=2,lock=2,wait=10,fall=25,
next=1,hold=false,
sequence="rnd",
freshLimit=0,
- target=10,reach=Event.classic_reach,
+ target=10,dropPiece=Event.classic_reach,
bg="rgb",bgm="rockblock",
},
},
@@ -985,7 +1265,7 @@ defaultModeEnv={
{
drop=1e99,lock=1e99,
oncehold=false,
- target=200,reach=Event.win,
+ dropPiece=Event.reach_winCheck,
bg="strap",bgm="infinite",
},
},
@@ -998,48 +1278,58 @@ defaultModeEnv={
{
drop=1e99,lock=1e99,
oncehold=false,
- target=1,reach=Event.infinite_check,
+ dropPiece=Event.infinite_check,
bg="glow",bgm="infinite",
},
},
solo={
{
+ drop=60,lock=60,
freshLimit=15,
bg="game2",bgm="race",
},
},
+ round={
+ {
+ drop=1e99,lock=1e99,
+ oncehold=false,
+ dropPiece=Event.round_check,
+ bg="game2",bgm="push",
+ },
+ },
tsd={
{
oncehold=false,
drop=1e99,lock=1e99,
freshLimit=15,
- target=1,reach=Event.tsd_reach,
+ dropPiece=Event.tsd_reach,
ospin=false,
bg="matrix",bgm="reason",
},
{
drop=60,lock=60,
freshLimit=15,
- target=1,reach=Event.tsd_reach,
+ dropPiece=Event.tsd_reach,
ospin=false,
bg="matrix",bgm="reason",
},
},
blind={
{
- drop=30,lock=60,
- freshLimit=15,
+ drop=30,lock=45,
+ freshLimit=10,
visible="time",
bg="glow",bgm="newera",
},
{
- drop=15,lock=60,
- freshLimit=15,
+ drop=15,lock=45,
+ freshLimit=10,
visible="fast",
freshLimit=10,
bg="glow",bgm="reason",
},
{
+ drop=15,lock=45,
fall=10,lock=60,
center=false,
visible="none",
@@ -1047,18 +1337,18 @@ defaultModeEnv={
bg="rgb",bgm="secret7th",
},
{
+ drop=10,lock=45,
fall=5,lock=60,
- center=false,
- ghost=false,
+ center=false,ghost=false,
visible="none",
freshLimit=15,
bg="rgb",bgm="secret8th",
},
{
- fall=5,lock=60,
+ drop=30,lock=60,
+ fall=5,
block=false,
- center=false,
- ghost=false,
+ center=false,ghost=false,
visible="none",
freshLimit=15,
bg="rgb",bgm="secret7th",
@@ -1069,9 +1359,9 @@ defaultModeEnv={
wait=10,fall=15,
visible="fast",
freshLimit=15,
- target=1,reach=Event.GM_reach,
+ dropPiece=Event.GM_reach,
arr=1,
- bg="game3",bgm="secret8th",
+ bg="game3",bgm="shining terminal",
},
},
dig={
@@ -1079,11 +1369,13 @@ defaultModeEnv={
drop=60,lock=120,
fall=20,
freshLimit=15,
+ task="dig_normal",
bg="game2",bgm="push",
},
{
drop=10,lock=30,
freshLimit=15,
+ task="dig_lunatic",
bg="game2",bgm="secret7th",
},
},
@@ -1092,87 +1384,122 @@ defaultModeEnv={
drop=60,lock=120,
fall=30,
freshLimit=15,
+ task="survivor_easy",
bg="game2",bgm="push",
},
{
drop=30,lock=60,
fall=20,
freshLimit=15,
+ task="survivor_normal",
bg="game2",bgm="newera",
},
{
drop=10,lock=60,
fall=15,
freshLimit=15,
+ task="survivor_hard",
bg="game2",bgm="secret8th",
},
{
drop=6,lock=60,
fall=10,
freshLimit=15,
+ task="survivor_lunatic",
bg="game3",bgm="secret7th",
},
{
drop=5,lock=60,
fall=10,
freshLimit=15,
+ task="survivor_ultimate",
bg="rgb",bgm="secret7th",
},
+ },
+ defender={
{
- drop=3,lock=60,
+ drop=30,lock=60,
+ fall=10,
+ freshLimit=15,
+ task="defender_normal",
+ bg="game3",bgm="way",
+ },
+ {
+ drop=5,lock=60,
+ fall=6,
+ freshLimit=15,
+ task="defender_lunatic",
+ bg="game4",bgm="way",
+ },
+ },
+ attacker={
+ {
+ drop=30,lock=60,
+ fall=12,
+ freshLimit=15,
+ task="attacker_hard",
+ bg="game3",bgm="push",
+ },
+ {
+ drop=5,lock=60,
fall=8,
freshLimit=15,
- bg="game4",bgm="push",
+ task="attacker_ultimate",
+ bg="game4",bgm="shining terminal",
},
},
tech={
{
oncehold=false,
drop=1e99,lock=1e99,
- target=1,reach=Event.tech_reach_easy,
+ dropPiece=Event.tech_reach_easy,
bg="matrix",bgm="newera",
},
{
oncehold=false,
drop=1e99,lock=1e99,
- target=1,reach=Event.tech_reach_ultimate,
+ dropPiece=Event.tech_reach_ultimate,
bg="matrix",bgm="newera",
},
{
drop=10,lock=60,
freshLimit=15,
- target=1,reach=Event.tech_reach_easy,
+ dropPiece=Event.tech_reach_easy,
bg="matrix",bgm="secret8th",
},
{
drop=30,lock=60,
freshLimit=15,
- target=1,reach=Event.tech_reach_ultimate,
+ dropPiece=Event.tech_reach_ultimate,
bg="matrix",bgm="secret8th",
},
{
_20G=true,lock=60,
freshLimit=15,
- target=1,reach=Event.tech_reach_hard,
+ dropPiece=Event.tech_reach_hard,
bg="matrix",bgm="secret7th",
},
{
_20G=true,lock=60,
freshLimit=15,
- target=1,reach=Event.tech_reach_ultimate,
+ dropPiece=Event.tech_reach_ultimate,
bg="matrix",bgm="secret7th",
},
},
c4wtrain={
{
+ drop=30,lock=60,
+ oncehold=false,
freshLimit=15,
- target=0,reach=Event.c4w_reach,
+ dropPiece=Event.c4w_reach,
+ ospin=false,
bg="rgb",bgm="newera",
},
{
drop=5,lock=30,
freshLimit=15,
- target=0,reach=Event.c4w_reach,
+ dropPiece=Event.c4w_reach,
+ ospin=false,
bg="rgb",bgm="newera",
},
},
@@ -1183,7 +1510,7 @@ defaultModeEnv={
drop=150,lock=150,
fall=20,
sequence="none",
- target=0,reach=Event.newPC,
+ dropPiece=Event.newPC,
ospin=false,
bg="rgb",bgm="newera",
},
@@ -1194,7 +1521,7 @@ defaultModeEnv={
fall=20,
sequence="none",
freshLimit=15,
- target=0,reach=Event.newPC,
+ dropPiece=Event.newPC,
ospin=false,
bg="rgb",bgm="newera",
},
@@ -1203,20 +1530,22 @@ defaultModeEnv={
{
oncehold=false,
drop=300,lock=1e99,
- target=100,reach=Event.win,
+ target=100,dropPiece=Event.reach_winCheck,
ospin=false,
bg="rgb",bgm="newera",
},
{
- drop=60,lock=120,fall=10,
- target=100,reach=Event.win,
+ drop=60,lock=120,
+ fall=10,
+ target=100,dropPiece=Event.reach_winCheck,
freshLimit=15,
ospin=false,
bg="rgb",bgm="infinite",
},
{
- drop=20,lock=60,fall=20,
- target=100,reach=Event.win,
+ drop=20,lock=60,
+ fall=20,
+ target=100,dropPiece=Event.reach_winCheck,
freshLimit=15,
ospin=false,
bg="rgb",bgm="infinite",
@@ -1224,9 +1553,10 @@ defaultModeEnv={
},
techmino49={
{
+ drop=60,lock=60,
fall=20,
royaleMode=true,
- Fkey=true,
+ Fkey=Fkey_func.royale,
royalePowerup={2,5,10,20},
royaleRemain={30,20,15,10,5},
pushSpeed=2,
@@ -1236,9 +1566,10 @@ defaultModeEnv={
},
techmino99={
{
+ drop=60,lock=60,
fall=20,
royaleMode=true,
- Fkey=true,
+ Fkey=Fkey_func.royale,
royalePowerup={2,6,14,30},
royaleRemain={75,50,35,20,10},
pushSpeed=2,
@@ -1250,8 +1581,7 @@ defaultModeEnv={
{
drop=20,lock=60,
sequence="drought1",
- target=100,
- reach=Event.win,
+ target=100,dropPiece=Event.reach_winCheck,
ospin=false,
freshLimit=15,
bg="glow",bgm="reason",
@@ -1259,8 +1589,7 @@ defaultModeEnv={
{
drop=20,lock=60,
sequence="drought2",
- target=100,
- reach=Event.win,
+ target=100,dropPiece=Event.reach_winCheck,
ospin=false,
freshLimit=15,
bg="glow",bgm="reason",
@@ -1268,17 +1597,18 @@ defaultModeEnv={
},
hotseat={
{
+ drop=60,lock=60,
freshLimit=15,
bg="none",bgm="way",
},
},
custom={
{
- reach=Event.win,
+ dropPiece=Event.reach_winCheck,
},
{
- Fkey=true,puzzle=true,
- target=0,reach=Event.puzzleCheck,
+ Fkey=Fkey_func.puzzle,puzzle=true,
+ dropPiece=Event.puzzleCheck,
},
},
}
\ No newline at end of file
diff --git a/font.ttf b/font.ttf
index 3653471e..fa708b47 100644
Binary files a/font.ttf and b/font.ttf differ
diff --git a/gamefunc.lua b/gamefunc.lua
index 54055df8..c1e71ecf 100644
--- a/gamefunc.lua
+++ b/gamefunc.lua
@@ -1,29 +1,29 @@
local gc=love.graphics
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 null=function()end
local gameEnv0={
das=10,arr=2,
- sddas=0,sdarr=2,
+ sddas=2,sdarr=2,
ghost=true,center=true,
grid=false,swap=true,
_20G=false,bone=false,
- drop=30,lock=45,
+ drop=60,lock=60,
wait=0,fall=0,
next=6,hold=true,oncehold=true,
sequence="bag7",
block=true,
- keepVisible=true,visible="show",
- Fkey=false,puzzle=false,ospin=true,
- freshLimit=1e99,target=1e99,reach=null,
+ visible="show",--keepVisible=visile~="show"
+ Fkey=null,puzzle=false,ospin=true,
+ freshLimit=1e99,easyFresh=true,
+ target=1e99,dropPiece=null,
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 b2bPoint={50,100,180}
local b2bATK={3,5,8}
-local clearSCR={40,100,180}
+local clearSCR={80,200,400}
local spinSCR={--[blockName][row]
{200,750,1600},--Z
{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 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 blockPos={4,4,4,4,4,5,4}
local scs={
{[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}},
[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}},
- [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}},
[02]={{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
[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}},
[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}},
@@ -110,7 +111,27 @@ local TRS={
[31]={{0,0},{1,0},{-1,0}},
}
}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)
P.next[#P.next+1]={bk=blocks[n][0],id=n,color=P.gameEnv.bone and 8 or n,name=n}
end
@@ -214,6 +235,7 @@ function changeAtkMode(m)
::L::
end
function changeAtk(P,R)
+ -- if not P.human then R=players[1]end--1vALL mode
if P.atking then
local K=P.atking.atker
for i=1,#K do
@@ -285,11 +307,15 @@ function royaleLevelup()
local P=players.alive[i]
P.gameEnv.drop=spd
end
- if curMode.lv==5 and players[1].alive then
- local P=players[1]
- P.gameEnv.drop=int(P.gameEnv.drop*.3)
- if P.gameEnv.drop==0 then
- P.gameEnv._20G=true
+ if curMode.lv==3 then
+ for i=1,#players.alive do
+ local P=players.alive[i]
+ P.gameEnv.drop=int(P.gameEnv.drop*.3)
+ 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
@@ -303,16 +329,14 @@ function loadGame(mode,level)
end
local function resetPartGameData()
frame=30
- 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
- end end
- end
+ destroyPlayers()
players={alive={}}human=0
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
for i=1,#players do
changeAtk(players[i],randomTarget(players[i]))
@@ -330,17 +354,16 @@ function resetGameData()
pushSpeed=3
pauseTime=0--Time paused
pauseCount=0--Times paused
- 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
- end end
- end
+ destroyPlayers()
players={alive={}}human=0
- modeEnv=defaultModeEnv[curMode.id][curMode.lv]or defaultModeEnv[curMode.id][1]
- loadmode[curMode.id]()
+ local E=defaultModeEnv[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
BGM(modeEnv.bgm)
@@ -387,7 +410,7 @@ function gameStart()
end
setmetatable(_G,nil)
end
-function createPlayer(id,x,y,size,AIspeed,data)
+function createPlayer(id,x,y,size,AIdata)
players[id]={id=id}
P=players[id]
local P=P
@@ -406,17 +429,6 @@ function createPlayer(id,x,y,size,AIspeed,data)
P.absFieldY=P.y+60*P.size
end
- if AIspeed then
- P.ai={
- controls={},
- controlDelay=30,
- controlDelay0=AIspeed,
- }
- else
- P.human=true
- human=human+1
- end
-
P.alive=true
P.control=false
P.timing=false
@@ -442,9 +454,7 @@ function createPlayer(id,x,y,size,AIspeed,data)
P.gameEnv={}--Game setting vars,like dropDelay setting
for k,v in pairs(gameEnv0)do
- if data and data[k]~=nil then
- P.gameEnv[k]=data[k]
- elseif modeEnv[k]~=nil then
+ if modeEnv[k]~=nil then
P.gameEnv[k]=modeEnv[k]
elseif setting[k]~=nil then
P.gameEnv[k]=setting[k]
@@ -462,7 +472,7 @@ function createPlayer(id,x,y,size,AIspeed,data)
P.dropDelay,P.lockDelay=P.gameEnv.drop,P.gameEnv.lock
P.freshTime=0
P.spinLast,P.lastClear=false,nil
-
+
P.his={rnd(7),rnd(7),rnd(7),rnd(7)}
local s=P.gameEnv.sequence
if s=="bag7"or s=="his4"then
@@ -493,6 +503,46 @@ function createPlayer(id,x,y,size,AIspeed,data)
elseif P.gameEnv.sequence==3 then--Pure random
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.keepVisible=P.gameEnv.visible=="show"
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 a,r,g,b=1,unpack(blockColor[color])
if clear>10 then
- radius=30+3*(send-target)
+ radius=10+3*send+100/(target+4)
local t=clear%10
if t==1 then
corner=3
@@ -562,11 +612,9 @@ local function createBeam(S,R,send,time,target,color,clear,spin,mini,combo)
g=1-g*.3
b=1-b*.3
end
- if modeEnv.royaleMode then
- if S.ai and R.ai then
- radius=radius*.3
- a=.35
- end
+ if modeEnv.royaleMode and not(S.human or R.human)then
+ radius=radius*.4
+ a=.35
end
FX.attack[#FX.attack+1]={
x1=x1,y1=y1,
@@ -583,11 +631,10 @@ local function garbageSend(S,R,send,time,...)
R.lastRecv=S
if R.atkBuffer.sum<20 then
local B=R.atkBuffer
- send=min(send,20-B.sum)
- B.sum=B.sum+send
+ if B.sum+send>20 then send=20-B.sum end--no more then 20
local m,k=#B,1
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]
end
B[k]={
@@ -599,6 +646,7 @@ local function garbageSend(S,R,send,time,...)
sent=false,
lv=min(int(send^.69),5),
}--Sorted insert
+ B.sum=B.sum+send
R.stat.recv=R.stat.recv+send
if R.human then
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
local function garbageRelease()
- for i=1,#P.atkBuffer do
- local A=P.atkBuffer[i]
- if not A.sent and A.countdown<=0 then
+ local flag
+ while true do
+ local A=P.atkBuffer[1]
+ if A and A.countdown<=0 and not A.sent then
garbageRise(8+A.lv,A.amount,A.pos)
P.atkBuffer.sum=P.atkBuffer.sum-A.amount
A.sent,A.time=true,0
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
+ if flag and P.AI_mode=="CC"then CC_updateField(P)end
end
function garbageRise(color,amount,pos)
local t=P.showTime*2
@@ -648,20 +704,24 @@ local function ckfull(i)
end
local function checkrow(start,height)--(cy,r)
local c=0
- for i=start,start+height-1 do
- if ckfull(i)then
- ins(P.clearing,1,i)
+ local h=start
+ for i=1,height do
+ if ckfull(h)then
+ ins(P.clearing,h)
+ removeRow(P.field,h)
+ removeRow(P.visTime,h)
c=c+1
if not P.small then
local S=PTC.dust[P.id]
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)
end
end
+ else
+ h=h+1
end
end
- if c>0 then P.falling=P.gameEnv.fall end
return c
end
local function solid(x,y)
@@ -714,7 +774,9 @@ end
local function spin(d,ifpre)
local idir=(P.dir+d)%4
if P.cur.id==6 then
- freshLockDelay()
+ if P.gameEnv.easyFresh then
+ freshLockDelay()
+ end
if P.human then
SFX(ifpre and"prerotate"or"rotate")
end
@@ -765,7 +827,7 @@ local function spin(d,ifpre)
local ir,ic=#icb,#icb[1]
local ix,iy=P.curX+P.sc[2]-isc[2],P.curY+P.sc[1]-isc[1]
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
if not ifoverlap(icb,ix+iki[i][1],iy+iki[i][2])then
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
createShade(P.curX,P.curY+P.r-1,P.curX+P.c-1,P.curY)
end
+ local y0=P.curY
P.curX,P.curY,P.dir=ix,iy,idir
P.sc,P.cur.bk=scs[P.cur.id][idir],icb
P.r,P.c=ir,ic
P.spinLast=t==2 and d==2 and 0 or 1
- freshgho()
- freshLockDelay()
+ if not ifpre then freshgho()end
+ if P.gameEnv.easyFresh or y0>P.curY then freshLockDelay()end
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")
end
@@ -797,15 +860,17 @@ local function hold(ifpre)
if P.cur.id==0 then
P.cur=rem(P.next,1)
P.freshNext()
+ if P.AI_mode=="CC"then BOT.addNext(P.AI_bot,CCblockID[P.next[P.AIdata.next].id])end
end
P.sc,P.dir=scs[P.cur.id][0],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)
- 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)
end
-
+ --IMS
+
freshgho()
P.dropDelay,P.lockDelay,P.freshTime=P.gameEnv.drop,P.gameEnv.lock,max(P.freshTime-5,0)
if ifoverlap(P.cur.bk,P.curX,P.curY)then lock()Event.lose()end
@@ -820,6 +885,7 @@ function resetblock()
P.holded,P.spinLast=false,false
P.cur=rem(P.next,1)
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.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)
@@ -829,55 +895,56 @@ function resetblock()
if P.keyPressing[3]then spin(1,true)end
if P.keyPressing[4]then spin(-1,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)
- end--Initial SYSs
-
+ end
+ --Initial SYSs
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
end
function drop()
- if P.curY==P.y_img then
- P.dropTime[11]=ins(P.dropTime,1,frame)--update speed dial
- P.waiting=P.gameEnv.wait
- local dospin=0
- if P.spinLast then
- if P.cur.id<6 then
- local x,y=P.curX+P.sc[2]-1,P.curY+P.sc[1]-1
- 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 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 c>2 then dospin=dospin+1 end
- end--Three point
- ::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
- dospin=dospin+2
- end--Immobile
- end
- lock()
- local cc,send,exblock=checkrow(P.curY,P.r),0,0--Currect clear&send&sendTime
- local cscore,sendTime=0,0
- local mini
- if P.spinLast and cc>0 and dospin>0 then
- dospin=dospin+P.spinLast
- end
- if not P.spinLast then
+ P.dropTime[11]=ins(P.dropTime,1,frame)--update speed dial
+ P.waiting=P.gameEnv.wait
+ local dospin=0
+ if P.spinLast then
+ if P.cur.id<6 then
+ local x,y=P.curX+P.sc[2]-1,P.curY+P.sc[1]-1
+ 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 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 c>2 then dospin=dospin+1 end
+ end--Three point
+ ::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
+ dospin=dospin+2
+ end--Immobile
+ end
+ lock()
+ 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 mini
+ if P.spinLast and cc>0 and dospin>0 then
+ dospin=dospin+P.spinLast
+ end
+ if not P.spinLast then
+ dospin=false
+ elseif cc==0 then
+ if dospin==0 then
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
0 then
+ P.combo=P.combo+1
if cc==4 then
cscore=1000
if P.b2b>1000 then
@@ -955,7 +1022,7 @@ function drop()
VOICE(blockName[P.cur.name])
VOICE("spin_")
end
- elseif #P.clearing<#P.field then
+ elseif #P.field>0 then
P.b2b=max(P.b2b-250,0)
showText(P,text.clear[cc],"appear",32+cc*3,-30,(8-cc)*.3)
send=cc-1
@@ -967,23 +1034,9 @@ function drop()
if P.human then
VOICE(clearName[cc])
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
- send=send+(renATK[P.combo]or 4)
- if #P.clearing==#P.field then
+ send=send+(renATK[P.combo]or 3)
+ if #P.field==0 then
showText(P,text.PC,"flicker",70,-80)
send=min(send,4)+min(6+P.stat.pc,10)
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)
cscore=cscore+min(20*P.combo,300)*cc
end
- sendTime=sendTime+20*P.combo
- if P.human and cc>0 then
+ sendTime=sendTime+25*P.combo
+ if P.human then
SFX(clear_n[cc])
SFX(ren_n[min(P.combo,11)])
if P.combo>14 then SFX("ren_mega",(P.combo-10)*.1)end
- VIB(cc)
+ VIB(cc+1)
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)
if i>1 then
send=send+reAtk[i]
exblock=exblock+reDef[i]
end
- end
+ end--Counter attack
if send>0 then
P.stat.atk=P.stat.atk+send
--ATK statistics
if exblock then exblock=int(exblock*(1+P.strength*.25))end
send=send*(1+P.strength*.25)
- if mini then send=send end
+ if mini then send=send*.8 end
send=int(send)
--Badge Buff
if send==0 then goto L end
@@ -1048,10 +1101,11 @@ function drop()
send=send-A.amount
P.atkBuffer.sum=P.atkBuffer.sum-A.amount
A.sent,A.time=true,0
- goto R
+ if send>0 then goto R end
else
A.amount=A.amount-send
P.atkBuffer.sum=P.atkBuffer.sum-send
+ send=0
end
end
::E::
@@ -1081,59 +1135,39 @@ function drop()
P.stat.send=P.stat.send+send
if P.human and send>3 then SFX("emit",min(send,8)*.125)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
else
- P.curY=P.curY-1
- P.spinLast=false
+ 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+30
+ end
+ cscore=cscore+10
+ if P.b2b>1000 then
+ P.b2b=max(P.b2b-40,1000)
+ end
+ garbageRelease()
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
function pressKey(i,p)
- P=p
- P.keyPressing[i]=true
+ P=p;P.keyPressing[i]=true
if P.human then
virtualkeyDown[i]=true
virtualkeyPressTime[i]=10
end
- if i==10 then
- act.restart()
- 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
+ if P.alive then
+ act[actName[i]]()
P.keyTime[11]=ins(P.keyTime,1,frame)
P.stat.key=P.stat.key+1
end
@@ -1146,65 +1180,94 @@ function releaseKey(i,p)
end
act={
moveLeft=function(auto)
- if P.keyPressing[9]and setting.swap then
- changeAtkMode(1)
- else
- if not auto then
- P.moving=-1
+ if P.keyPressing[9]then
+ if setting.swap then
+ changeAtkMode(1)
end
+ elseif P.control and P.waiting==-1 then
if not ifoverlap(P.cur.bk,P.curX-1,P.curY)then
P.curX=P.curX-1
+ local y0=P.curY
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
P.spinLast=false
+ if not auto then P.moving=-1 end
+ else
+ P.moving=-P.gameEnv.das-1
end
+ else
+ P.moving=-1
end
end,
moveRight=function(auto)
- if P.keyPressing[9]and setting.swap then
- changeAtkMode(2)
- else
- if not auto then
- P.moving=1
+ if P.keyPressing[9]then
+ if setting.swap then
+ changeAtkMode(2)
end
+ elseif P.control and P.waiting==-1 then
if not ifoverlap(P.cur.bk,P.curX+1,P.curY)then
P.curX=P.curX+1
+ local y0=P.curY
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
P.spinLast=false
+ if not auto then P.moving=1 end
+ else
+ P.moving=P.gameEnv.das+1
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,
- rotRight=function()spin(1)end,
- rotLeft=function()spin(-1)end,
- rotFlip=function()spin(2)end,
hardDrop=function()
- if P.keyPressing[9]and setting.swap then
- changeAtkMode(3)
- else
- 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()
+ if P.keyPressing[9]then
+ if setting.swap then
+ changeAtkMode(3)
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,
softDrop=function()
- if P.keyPressing[9]and setting.swap then
- changeAtkMode(4)
+ if P.keyPressing[9]then
+ if setting.swap then
+ changeAtkMode(4)
+ end
else
if P.curY~=P.y_img then
P.curY=P.curY-1
@@ -1213,33 +1276,21 @@ act={
P.downing=1
end
end,
- hold=function()hold()end,
- func=function()
- if P.gameEnv.Fkey then
- 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
+ hold=function()
+ if P.control and P.waiting==-1 then
+ hold()
end
end,
+ func=function()
+ P.gameEnv.Fkey()
+ end,
restart=function()
if frame<180 then
clearTask("play")
resetPartGameData()
end
end,
+
insDown=function()
if P.curY~=P.y_img then
if P.human and setting.fxs>0 then
@@ -1252,7 +1303,7 @@ act={
end
end,
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
P.curX=P.curX-1
if P.human and setting.fxs>0 then
@@ -1265,11 +1316,11 @@ act={
if P.human and setting.fxs>0 then
P.fieldOffX=-2*setting.fxs
end
- freshLockDelay()
+ if P.gameEnv.easyFresh or y0~=P.curY then freshLockDelay()end
end
end,
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
P.curX=P.curX+1
if P.human and setting.fxs>0 then
@@ -1282,7 +1333,7 @@ act={
if P.human and setting.fxs>0 then
P.fieldOffX=2*setting.fxs
end
- freshLockDelay()
+ if P.gameEnv.easyFresh or y0~=P.curY then freshLockDelay()end
end
end,
down1=function()
diff --git a/language/chi.lua b/language/chi.lua
index ea133677..d3db3278 100644
--- a/language/chi.lua
+++ b/language/chi.lua
@@ -15,9 +15,10 @@ return{
PC="Perfect Clear",
hold="暂存",next="下一个",
- stage={"关卡 1","关卡 2","关卡 3","关卡 4","关卡 5",},
- awesome="精彩。",
- continue="继续。",
+ stage=function(n)return"关卡 "..n end,
+ great="Great!",
+ awesome="Awesome.",
+ continue="Continue.",
maxspeed="最高速度",
speedup="速度加快",
@@ -44,7 +45,7 @@ return{
bgm="背景音乐:",
},
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,"∞"},
wait=nil,
fall=nil,
@@ -54,7 +55,7 @@ return{
visible={"可见","半隐","全隐","瞬隐"},
target={10,20,40,100,200,500,1000,"∞"},
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:",
softdroparr="软降ARR:",
@@ -68,7 +69,8 @@ return{
actName={"左移:","右移:","顺时针旋转:","逆时针旋转:","180°旋转","硬降:","软降:","暂存:","功能键:","重新开始:","左瞬移:","右瞬移:","软降到底:"},
modeName={
[0]="自定义",
- "竞速","马拉松","大师","经典","禅","无尽","单挑","仅TSD","隐形","挖掘","生存","科研",
+ "竞速","马拉松","大师","经典","禅","无尽","单挑","回合制","仅TSD","隐形",
+ "挖掘","生存","防守","进攻","科研",
"C4W练习","全清训练","全清挑战","49人混战","99人混战","干旱","多人",
},
modeInfo={
@@ -79,10 +81,13 @@ return{
zen="无重力消除200行",
infinite="科研沙盒",
solo="打败AI",
+ round="下棋",
tsd="尽可能做TSD",
blind="最强大脑",
dig="核能挖掘机",
- survivor="防守练习",
+ survivor="你能存活多久?",
+ defender="防守练习",
+ attacker="进攻练习",
tech="尽可能不要普通消除",
c4wtrain="无 限 连 击",
pctrain="熟悉全清定式的组合",
@@ -147,8 +152,8 @@ return{
"使用LOVE2D引擎",
"作者:MrZ 邮箱:1046101471@qq.com",
"程序:MrZ 美术:MrZ 音乐:MrZ 音效:MrZ 语音:Miya",
- "使用工具:VScode,GFIE,Beepbox,Goldwave",
- "特别感谢:Farter,196,Teatube,Flyz,T830,[所有测试人员]和 你!",
+ "使用工具:VScode,GFIE,Beepbox,Goldwave,Cold_Clear",
+ "特别感谢:Farter,Flyz,196,Teatube,T830,[所有测试人员]和 你!",
"错误或者建议请附带相关信息发送到作者邮箱~",
},
support="支持作者",
@@ -217,6 +222,7 @@ return{
},
pause={
resume="继续",
+ restart="重新开始",
quit="退出",
},
setting={
@@ -224,7 +230,7 @@ return{
center=function()return"旋转中心:"..SWC[setting.center]end,
grid=function()return"网格:"..SWC[setting.grid]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,
dasD="-",dasU="+",
arrD="-",arrU="+",
@@ -248,13 +254,13 @@ return{
back=BK,
},
setting3={
- back=BK,
hide=function()return setting.virtualkeySwitch and"隐藏虚拟按键"or"显示虚拟按键"end,
default="默认组合",
snap=function()return text.snapLevelName[snapLevel]end,
alpha=function()return setting.virtualkeyAlpha.."0%"end,
icon="图标",
size="大小",
+ back=BK,
},
help={
his="历史",
diff --git a/language/chi_full.lua b/language/chi_full.lua
index 614e7710..2f1e8233 100644
--- a/language/chi_full.lua
+++ b/language/chi_full.lua
@@ -15,7 +15,8 @@ return{
PC="场地全清",
hold="暂存",next="下一个",
- stage={"关卡 1","关卡 2","关卡 3","关卡 4","关卡 5",},
+ stage=function(n)return"关卡 "..n end,
+ great="不错!",
awesome="精彩。",
continue="继续。",
maxspeed="最高速度",
@@ -44,7 +45,7 @@ return{
bgm="背景音乐:",
},
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,"∞"},
wait=nil,
fall=nil,
@@ -54,7 +55,7 @@ return{
visible={"可见","半隐","全隐","瞬隐"},
target={10,20,40,100,200,500,1000,"∞"},
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:",
softdroparr="软降ARR:",
@@ -68,7 +69,8 @@ return{
actName={"左移:","右移:","顺时针旋转:","逆时针旋转:","180°旋转","硬降:","软降:","暂存:","功能键:","重新开始:","左瞬移:","右瞬移:","软降到底:"},
modeName={
[0]="自定义",
- "竞速","马拉松","大师","经典","禅","无尽","单挑","仅TSD","隐形","挖掘","生存","科研",
+ "竞速","马拉松","大师","经典","禅","无尽","单挑","回合制","仅TSD","隐形",
+ "挖掘","生存","防守","进攻","科研",
"C4W练习","全清训练","全清挑战","49人混战","99人混战","干旱","多人",
},
modeInfo={
@@ -79,10 +81,13 @@ return{
zen="无重力消除200行",
infinite="科研沙盒",
solo="打败AI",
+ round="下棋",
tsd="尽可能做T旋双清",
blind="最强大脑",
dig="核能挖掘机",
- survivor="防守练习",
+ survivor="你能存活多久?",
+ defender="防守练习",
+ attacker="进攻练习",
tech="尽可能不要普通消除!",
c4wtrain="无 限 连 击",
pctrain="熟悉全清定式的组合",
@@ -147,8 +152,8 @@ return{
"使用LOVE2D引擎",
"作者:MrZ 邮箱:1046101471@qq.com",
"程序:MrZ 美术:MrZ 音乐:MrZ 音效:MrZ 语音:Miya",
- "使用工具:VScode,GFIE,Beepbox,Goldwave",
- "特别感谢:Farter,Teatube,196,Flyz,T830,[所有测试人员]和 你!",
+ "使用工具:VScode,GFIE,Beepbox,Goldwave,Cold_Clear",
+ "特别感谢:Farter,Flyz,196,Teatube,T830,[所有测试人员]和 你!",
"错误或者建议请附带相关信息发送到作者邮箱~",
},
support="支持作者",
@@ -217,6 +222,7 @@ return{
},
pause={
resume="继续",
+ restart="重新开始",
quit="退出",
},
setting={
@@ -224,7 +230,7 @@ return{
center=function()return"旋转中心:"..SWC[setting.center]end,
grid=function()return"网格:"..SWC[setting.grid]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,
dasD="-",dasU="+",
arrD="-",arrU="+",
@@ -248,13 +254,13 @@ return{
back=BK,
},
setting3={
- back=BK,
hide=function()return setting.virtualkeySwitch and"隐藏虚拟按键"or"显示虚拟按键"end,
default="默认组合",
snap=function()return text.snapLevelName[snapLevel]end,
alpha=function()return setting.virtualkeyAlpha.."0%"end,
icon="图标",
size="大小",
+ back=BK,
},
help={
his="历史",
diff --git a/language/eng.lua b/language/eng.lua
index ed8e64f1..dcb28250 100644
--- a/language/eng.lua
+++ b/language/eng.lua
@@ -15,7 +15,8 @@ return{
PC="Perfect Clear",
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.",
continue="Continue.",
maxspeed="Max speed",
@@ -26,7 +27,7 @@ return{
pause="PAUSE",
finish="FINISH",
pauseTime="Pause time",
-
+
custom="Custom Game",
customOption={
drop="Drop delay:",
@@ -44,7 +45,7 @@ return{
bgm="BGM:",
},
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,"∞"},
wait=nil,
fall=nil,
@@ -54,7 +55,7 @@ return{
visible={"normal","time","invisible","sudden"},
target={10,20,40,100,200,500,1000,"∞"},
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:",
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:"},
modeName={
[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",
},
modeInfo={
@@ -79,10 +81,13 @@ return{
zen="Clear 200 Lines without gravity",
infinite="Infinite game,infinite happiness",
solo="Beat AI",
+ round="Chess?",
tsd="Make more T-spin-doubles",
blind="Invisible board",
dig="Downstack!",
- survivor="Hand them!",
+ survivor="Survive Longer!",
+ defender="Hand them!",
+ attacker="Attacking better then defending",
tech="Don't do normal clear",
c4wtrain="Infinite combo",
pctrain="Let's learn some PCs",
@@ -147,8 +152,8 @@ return{
"Powered by LOVE2D",
"Author:MrZ E-mail:1046101471@qq.com",
"Programe:MrZ Art:MrZ Music:MrZ SFX:MrZ VOICE:Miya",
- "Tool used:VScode,GFIE,Beepbox,Goldwave",
- "Special thanks:Farter,Teatube,196,Flyz,T830,[all test staff] and YOU!",
+ "Tool used:VScode,GFIE,Beepbox,Goldwave,Cold_Clear",
+ "Special thanks:Farter,Flyz,196,Teatube,T830,[all test staff] and YOU!",
"Any bugs/suggestions to my E-mail.",
},
support="Support Author",
@@ -217,6 +222,7 @@ return{
},
pause={
resume="Resume",
+ restart="Restart",
quit="Quit",
},
setting={
@@ -248,13 +254,13 @@ return{
back=BK,
},
setting3={
- back=BK,
hide=function()return setting.virtualkeySwitch and"Hide Virtual Key"or"Show Virtual Key"end,
default="Defaults",
snap=function()return text.snapLevelName[snapLevel]end,
alpha=function()return setting.virtualkeyAlpha.."0%"end,
icon="Icon",
size="Size",
+ back=BK,
},
help={
his="History",
diff --git a/list.lua b/list.lua
index a3a077d9..6941d85e 100644
--- a/list.lua
+++ b/list.lua
@@ -2,7 +2,7 @@ local gc=love.graphics
local tc,kb=love.touch,love.keyboard
local sys=love.system
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"}
color={
@@ -79,6 +79,7 @@ bgm={
"secret8th",
"rockblock",
"8-bit happiness",
+ "shining terminal",
"end",
}
voiceList={
@@ -120,12 +121,13 @@ musicID={
"push",
"reason",
"infinite",
- "cruelty",
- "final",
"secret7th",
"secret8th",
+ "shining terminal",
"rockblock",
"8-bit happiness",
+ "cruelty",
+ "final",
"end",
}
customID={
@@ -139,7 +141,7 @@ customID={
"bg","bgm",
}
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},
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},
@@ -149,7 +151,7 @@ customRange={
visible={"show","time","fast","none"},
target={10,20,40,100,200,500,1000,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"},
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={
[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",
}
modeLevel={
sprint={"10L","20L","40L","100L","400L","1000L"},
marathon={"EASY","NORMAL","HARD"},
- master={"LUNATIC","ULTIMATE"},
+ master={"LUNATIC","ULTIMATE","FINAL"},
classic={"CTWC"},
zen={"NORMAL"},
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"},
blind={"EASY","HARD","HARD+","LUNATIC","ULTIMATE","GM"},
dig={"NORMAL","LUNATIC"},
survivor={"EASY","NORMAL","HARD","LUNATIC","ULTIMATE","EXTRA"},
+ defender={"NORMAL","LUNATIC"},
+ attacker={"HARD","ULTIMATE"},
tech={"NORMAL","NORMAL+","HARD","HARD+","LUNATIC","LUNATIC+",},
c4wtrain={"NORMAL","LUNATIC"},
pctrain={"NORMAL","EXTRA"},
pcchallenge={"NORMAL","HARD","LUNATIC"},
- techmino49={"EASY","NORMAL","HARD","LUNATIC","ULTIMATE"},
- techmino99={"EASY","NORMAL","HARD","LUNATIC","ULTIMATE"},
+ techmino49={"EASY","HARD","ULTIMATE"},
+ techmino99={"EASY","HARD","ULTIMATE"},
drought={"NORMAL","MESS"},
hotseat={"2P","3P","4P",},
custom={"Normal","Puzzle"},
@@ -274,194 +280,192 @@ local function useDefaultSet(n)
curBG=customRange.bg[customSel[12]]
BGM(customRange.bgm[customSel[13]])
end
-Buttons={
+Widget={
load={},
intro={},
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"},
- 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"},
- 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"},
- 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"},
- 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"},
- 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"},
- quit= {x=1180,y=620,w=120,h=120, rgb=color.lightGrey,f=50,code=function()gotoScene("quit")end,up="setting",left="help"},
+ qplay= newButton(160, 300,150,150,color.lightRed, 40,function()loadGame(modeSel,levelSel)end, nil, nil, "stat", nil, "play" ),
+ play= newButton(380, 300,240,240,color.red, 70,function()gotoScene("mode")end, nil, nil, "stat", "qplay", "setting" ),
+ setting=newButton(640, 300,240,240,color.lightBlue,55,function()gotoScene("setting")end, nil, nil, "stat", "play", "music" ),
+ music= newButton(900, 300,240,240,color.lightCyan,42,function()gotoScene("music")end, nil, nil, "help", "setting", "quit" ),
+ stat= newButton(640, 560,240,240,color.cyan, 55,function()gotoScene("stat")end, nil, "setting", nil, "play", "help" ),
+ help= newButton(900, 560,240,240,color.yellow, 55,function()gotoScene("help")end, nil, "music", nil, "stat", "quit" ),
+ quit= newButton(1180, 620,120,120,color.lightGrey,50,function()gotoScene("quit")end, nil, "music", nil, "help", nil ),
},
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,},
- 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,},
- left= {x=190, y=160,w=100,h=80, rgb=color.white, code=function()love.keypressed("left")end, hide=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,},
- start= {x=1000,y=600,w=250,h=100, rgb=color.green, f=50, code=function()loadGame(modeSel,levelSel)end},
- custom= {x=275, y=420,w=200,h=90, rgb=color.yellow, code=function()gotoScene("custom")end},
- back= {x=640, y=630,w=230,h=90, rgb=color.white, f=45, code=back},
+ up= newButton(1000, 210,200,140,color.white, 80,function()love.keypressed("up")end,function()return modeSel==1 end),
+ down= newButton(1000, 430,200,140,color.white, 80,function()love.keypressed("down")end,function()return modeSel==#modeID end),
+ left= newButton(190, 160,100,80, color.white, 40,function()love.keypressed("left")end,function()return levelSel==1 end),
+ right= newButton(350, 160,100,80, color.white, 40,function()love.keypressed("right")end,function()return levelSel==#modeLevel[modeID[modeSel]]end),
+ start= newButton(1000, 600,250,100,color.green, 50,function()loadGame(modeSel,levelSel)end),
+ custom= newButton(275, 420,200,90, color.yellow, 40,function()gotoScene("custom")end),
+ back= newButton(640, 630,230,90, color.white, 45,back),
},
music={
- bgm= {x=1100,y=80, w=160, h=80, rgb=color.white,code=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},
- 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},
- 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},
- back= {x=640, y=630, w=230, h=90, rgb=color.white,f=45,code=back},
+ bgm= newButton(1100, 80, 160,80, color.white,40,function()BGM()setting.bgm=not setting.bgm end),
+ up= newButton(1100, 200, 120,120,color.white,60,function()love.keypressed("up")end, function()return not setting.bgm end),
+ play= newButton(1100, 340, 120,120,color.white,40,function()love.keypressed("space")end, function()return not setting.bgm end),
+ down= newButton(1100, 480, 120,120,color.white,60,function()love.keypressed("down")end, function()return not setting.bgm end),
+ back= newButton(640, 630, 230,90, color.white,45,back),
},
custom={
- up= {x=1000,y=220, w=100,h=100, rgb=color.white,f=50, code=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},
- left= {x=880, y=340, w=100,h=100, rgb=color.white,f=50, code=function()
- customSel[sel]=(customSel[sel]-2)%#customRange[customID[sel]]+1
- if sel==12 then
- curBG=customRange.bg[customSel[12]]
- elseif sel==13 then
- BGM(customRange.bgm[customSel[13]])
- end
- end},
- right= {x=1120,y=340, w=100,h=100, rgb=color.white,f=50, code=function()
- customSel[sel]=customSel[sel]%#customRange[customID[sel]]+1
- if sel==12 then
- 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},
+ up= newButton(1000, 220, 100,100,color.white, 50,function()sel=(sel-2)%#customID+1 end),
+ down= newButton(1000, 460, 100,100,color.white, 50,function()sel=sel%#customID+1 end),
+ left= newButton(880, 340, 100,100,color.white, 50,function()love.keypressed("left")end),
+ right= newButton(1120, 340, 100,100,color.white, 50,function()love.keypressed("right")end),
+ start1= newButton(880, 580, 220,70, color.green, 40,function()loadGame(0,1)end),
+ start2= newButton(1120, 580, 220,70, color.lightPurple, 40,function()loadGame(0,2)end),
+ draw= newButton(1000, 90, 190,85, color.cyan, 40,function()gotoScene("draw")end),
+ set1= newButton(640, 160, 240,75, color.lightRed, 40,function()useDefaultSet(1)end),
+ set2= newButton(640, 250, 240,75, color.lightRed, 40,function()useDefaultSet(2)end),
+ set3= newButton(640, 340, 240,75, color.lightRed, 40,function()useDefaultSet(3)end),
+ set4= newButton(640, 430, 240,75, color.lightRed, 40,function()useDefaultSet(4)end),
+ set5= newButton(640, 520, 240,75, color.lightRed, 40,function()useDefaultSet(5)end),
+ back= newButton(640, 630, 180,60, color.white, 40,back),
},
draw={
- any= {x=700, y=80,w=120,h=120, f=45, rgb=color.lightGrey,code=function()pen=-1 end},
- block1= {x=840, y=80,w=120,h=120, f=65, rgb=color.red, code=function()pen=1 end},
- block2= {x=980, y=80,w=120,h=120, f=65, rgb=color.green, code=function()pen=2 end},
- block3= {x=1120,y=80,w=120,h=120, f=65, rgb=color.orange, code=function()pen=3 end},
- block4= {x=840, y=220,w=120,h=120, f=65, rgb=color.blue, code=function()pen=4 end},
- block5= {x=980, y=220,w=120,h=120, f=65, rgb=color.magenta, code=function()pen=5 end},
- block6= {x=1120,y=220,w=120,h=120, f=65, rgb=color.yellow, code=function()pen=6 end},
- block7= {x=840, y=360,w=120,h=120, f=65, rgb=color.cyan, code=function()pen=7 end},
- gb1= {x=980, y=360,w=120,h=120, f=65, rgb=color.darkGrey, code=function()pen=9 end},
- gb2= {x=1120,y=360,w=120,h=120, f=65, rgb=color.grey, code=function()pen=10 end},
- gb3= {x=840, y=500,w=120,h=120, f=65, rgb=color.darkPurple,code=function()pen=11 end},
- gb4= {x=980, y=500,w=120,h=120, f=65, rgb=color.darkRed, code=function()pen=12 end},
- gb5= {x=1120,y=500,w=120,h=120, f=65, rgb=color.darkGreen,code=function()pen=13 end},
- space= {x=840, y=640,w=120,h=120, f=70, rgb=color.grey, code=function()pen=0 end},
- clear= {x=1120,y=640,w=120,h=120, f=45, rgb=color.white, code=function()
- if clearSureTime>15 then
- 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},
+ any= newButton(700, 80, 120,120,color.lightGrey, 45,function()pen=0 end),
+ block1= newButton(840, 80, 120,120,color.red, 65,function()pen=1 end),
+ block2= newButton(980, 80, 120,120,color.green, 65,function()pen=2 end),
+ block3= newButton(1120, 80, 120,120,color.orange, 65,function()pen=3 end),
+ block4= newButton(840, 220, 120,120,color.blue, 65,function()pen=4 end),
+ block5= newButton(980, 220, 120,120,color.magenta, 65,function()pen=5 end),
+ block6= newButton(1120, 220, 120,120,color.yellow, 65,function()pen=6 end),
+ block7= newButton(840, 360, 120,120,color.cyan, 65,function()pen=7 end),
+ gb1= newButton(980, 360, 120,120,color.darkGrey, 65,function()pen=9 end),
+ gb2= newButton(1120, 360, 120,120,color.grey, 65,function()pen=10 end),
+ gb3= newButton(840, 500, 120,120,color.darkPurple, 65,function()pen=11 end),
+ gb4= newButton(980, 500, 120,120,color.darkRed, 65,function()pen=12 end),
+ gb5= newButton(1120, 500, 120,120,color.darkGreen, 65,function()pen=13 end),
+ space= newButton(840, 640, 120,120,color.grey, 70,function()pen=-1 end),
+ clear= newButton(1120, 640, 120,120,color.white, 45,function()love.keypressed("delete")end),
+ back= newButton(1235, 45, 80, 80, color.white, 35,back),
},
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={
- resume= {x=640,y=400,w=240,h=100, rgb=color.white,f=50,code=resumeGame},
- quit= {x=640,y=550,w=240,h=100, rgb=color.white,f=50,code=back},
+ resume= newButton(640,290,240,100,color.white,50,resumeGame),
+ 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
- ghost= {x=290, y=90, w=210, h=60, rgb=color.white,code=function()setting.ghost=not setting.ghost end,down="grid",right="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"},
- 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"},
- 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"},
- 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"},
- 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"},
- 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"},
- 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"},
- 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"},
- 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
- 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"},
- 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"},
- 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"},
- 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"},
+ ghost= newButton(290, 90, 210,60,color.white,40,function()setting.ghost=not setting.ghost end, nil, nil, "grid", nil, "center" ),
+ center= newButton(505, 90, 210,60,color.white,40,function()setting.center=not setting.center end, nil, nil, "swap", "ghost", "sfx" ),
+ grid= newButton(290, 160,210,60,color.white,40,function()setting.grid=not setting.grid end, nil, "ghost", "fxs", nil, "swap" ),
+ swap= newButton(505, 160,210,60,color.white,28,function()setting.swap=not setting.swap end, nil, "center", "bg", "grid", "vib" ),
+ fxs= newButton(290, 230,210,60,color.white,40,function()setting.fxs=(setting.fxs+1)%4 end, nil, "grid", "dasU", nil, "bg" ),
+ bg= newButton(505, 230,210,60,color.white,40,function()setting.bg=not setting.bg end, nil, "swap", "arrD", "fxs", "fullscreen" ),
+ dasD= newButton(210, 300,50, 50,color.white,40,function()setting.das=(setting.das-1)%31 end, nil, "fxs", "sddasD", nil, "dasU" ),
+ dasU= newButton(370, 300,50, 50,color.white,40,function()setting.das=(setting.das+1)%31 end, nil, "fxs", "sddasU", "dasD", "arrD" ),
+ arrD= newButton(425, 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","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"},
- touch= {x=340,y=510, w=310, h=60,rgb=color.yellow,code=function()gotoScene("setting3")end,up="ctrl",down="back",right="lang"},
- lang= {x=580,y=510, w=150, h=60,rgb=color.red, code=function()
+ ctrl= newButton(340,440, 310,60,color.green,40, function()gotoScene("setting2")end, nil, "sddasU", "touch", "lang", "skin" ),
+ touch= newButton(340,510, 310,60,color.yellow,40, function()gotoScene("setting3")end, nil, "ctrl", "back", nil, "lang" ),
+ lang= newButton(580,510, 150,60,color.red,40, function()
setting.lang=setting.lang%#langName+1
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"},
- 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"},
- 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"},
- 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"},
- fullscreen= {x=850,y=230,w=340, h=60,rgb=color.white, code=function()
+ sfx= newButton(760,90, 160,60,color.white,40, function()setting.sfx=not setting.sfx end, nil, nil, "vib", "center", "bgm" ),
+ 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= newButton(760,160, 160,60,color.white,40, function()setting.vib=(setting.vib+1)%6 VIB(1)end, nil, "sfx", "fullscreen", "swap", "voc" ),
+ voc= newButton(940,160, 160,60,color.white,40, function()setting.voc=not setting.voc end, nil, "sfx", "fullscreen", "vib", nil ),
+ fullscreen= newButton(850,230, 340,60,color.white,40, function()
setting.fullscreen=not setting.fullscreen
love.window.setFullscreen(setting.fullscreen)
if not setting.fullscreen then
- love.resize(gc.getWidth(),gc.getHeight())
+ love.resize(gc.getWidth(),gc.getHeight())
end
- end,up="vib",down="bgblock",left="bg"},
- bgblock={x=850,y=300, w=340, h=60,rgb=color.white, code=function()
- setting.bgblock=not setting.bgblock
- --if not setting.bgblock then for i=1,16 do BGblockList[i].v=3*BGblockList[i].v end end
- end,up="fullscreen",down="frame",left="arrU"},
- frame= {x=850,y=370, w=340, h=60,rgb=color.white, code=function()
+ end,nil,"vib","bgblock","bg",nil),
+ bgblock= newButton(850,300, 340,60,color.white,40, function()
+ setting.bgblock=not setting.bgblock--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),
+ frame= newButton(850,370, 340,60,color.white,40, function()
setting.frameMul=setting.frameMul+(setting.frameMul<50 and 5 or 10)
if setting.frameMul>100 then setting.frameMul=25 end
- end,up="bgblock",down="skin",left="sdarrU"},
- skin= {x=740,y=440, w=120, h=60,rgb=color.white, code=function()
+ end,nil,"bgblock","skin","sdarrU",nil),
+ skin= newButton(740,440, 120,60,color.white,40, function()
setting.skin=setting.skin%6+1
changeBlockSkin(setting.skin)
- end,up="frame",down="back",left="ctrl",right="smo"},
- smo= {x=920,y=440, w=200, h=60,f=27,rgb=color.white, code=function()
+ end,nil,"frame","back","ctrl","smo"),
+ smo= newButton(920,440, 200,60,color.white,27, function()
setting.smo=not setting.smo
- end,up="frame",down="back",left="skin"},
- back= {x=640,y=620, w=300,h=70,rgb=color.white, code=back,up="lang"},
+ end,nil,"frame","back","skin",nil),
+ back= newButton(640,620, 300,70,color.white,40, back,nil,nil,"lang",nil,nil),
},
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
- back={x=640,y=410,w=170,h=80,f=45,code=back},
- hide={x=640,y=210,w=500,h=80,f=45,code=function()
+ hide= newButton(640,210,500,80,color.white,45,function()
setting.virtualkeySwitch=not setting.virtualkeySwitch
- end},
- default={x=450,y=310,w=170,h=80,code=function()
+ end),
+ default=newButton(450,310,170,80,color.white,40,function()
for K=1,#virtualkey do
local b,b0=virtualkey[K],virtualkeySet[defaultSel][K]
b[1],b[2],b[3],b[4]=b0[1],b0[2],b0[3],b0[4]
end--Default virtualkey
defaultSel=defaultSel%5+1
- end},
- snap={x=640,y=310,w=170,h=80,code=function()
+ end),
+ snap= newButton(640,310,170,80,color.white,40,function()
snapLevel=snapLevel%6+1
- end},
- alpha={x=830,y=310,w=170,h=80,f=45,code=function()
+ end),
+ alpha= newButton(830,310,170,80,color.white,45,function()
setting.virtualkeyAlpha=(setting.virtualkeyAlpha+1)%11
--Adjust virtualkey alpha
- end},
- icon={x=450,y=410,w=170,h=80,f=45,code=function()
+ end),
+ icon= newButton(450,410,170,80,color.white,45,function()
setting.virtualkeyIcon=not setting.virtualkeyIcon
--Switch virtualkey icon
- end},
- size={x=830,y=410,w=170,h=80,f=45,code=function()
+ end),
+ size= newButton(830,410,170,80,color.white,45,function()
if sel then
local b=virtualkey[sel]
b[4]=b[4]+10
if b[4]==150 then b[4]=40 end
b[3]=b[4]^2
end
- end},
+ end),
+ back= newButton(640,410,170,80,color.white,45,back),
},
help={
- his={x=1050,y=520,w=230,h=60,rgb=color.white,code=function()gotoScene("history")end,down="qq",left="back"},
- 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"},
- back={x=640,y=600,w=180,h=60,rgb=color.white,code=back,up="his",right="qq"},
+ his= newButton(1050, 520,230,60,color.white,40,function()gotoScene("history")end, nil, nil, "qq", "back", nil),
+ 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= newButton(640, 600,180,60,color.white,40,back, nil, "his", nil, nil, "qq"),
},
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},
- next= {x=1205,y=320,w=100, h=300, rgb=color.white,hide=function()return sel==#updateLog end,code=function()sel=sel+1 end},
- back= {x=640, y=640,w=200,h=70, rgb=color.white,code=back},
+ prev= newButton(75, 320,100,300,color.white,40,function()love.keypressed("left")end,function()return sel==1 end),
+ next= newButton(1205, 320,100,300,color.white,40,function()love.keypressed("right")end,function()return sel==#updateLog end),
+ back= newButton(640, 640,200,70, color.white,40,back),
},
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"},
- back={x=640,y=590,w=180,h=60,rgb=color.white,code=back,right="path"},
+ path= newButton(980,590,250,60,color.white,30,function()sys.openURL(fs.getSaveDirectory())end,function()return mobile end,nil,nil,"back",nil),
+ 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
}
\ No newline at end of file
diff --git a/main.lua b/main.lua
index c6e88ba5..0a84931d 100644
--- a/main.lua
+++ b/main.lua
@@ -7,10 +7,11 @@ local find,format=string.find,string.format
local ins,rem=table.insert,table.remove
local Timer=tm.getTime
-- sort=table.sort
--------------------------------------------------------------
+
+local F=false
null=function()end
+-------------------------------------------------------------
system=sys.getOS()
-local mobile=system=="Android"or system=="iOS"
local xOy=love.math.newTransform()
local mx,my,mouseShow=-20,-20,false
local touching--1st touching ID
@@ -22,10 +23,9 @@ curBG="none"
voicePlaying={}
local devMode=0
-local F=false
-kb.setKeyRepeat(F)
-kb.setTextInput(F)
-ms.setVisible(F)
+kb.setKeyRepeat(true)
+kb.setTextInput(false)
+ms.setVisible(false)
-------------------------------------------------------------
local Fonts={}
function setFont(s)
@@ -43,21 +43,21 @@ function setFont(s)
end
customSel={22,22,1,1,7,3,1,1,8,4,1,1,1}
preField={h=20}
-for i=1,18 do preField[i]={0,0,0,0,0,0,0,0,0,0}end
-for i=19,20 do preField[i]={-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}end
+for i=1,10 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
--Game system Vars
setting={
ghost=true,center=true,
- grid=F,swap=true,
+ grid=false,swap=true,
fxs=3,bg=true,
das=10,arr=2,
sddas=0,sdarr=2,
lang=1,
-
+
sfx=true,bgm=true,
- vib=3,voc=F,
- fullscreen=F,
+ vib=3,voc=false,
+ fullscreen=false,
bgblock=true,
skin=1,smo=true,
keyMap={
@@ -91,7 +91,7 @@ setting={
},
virtualkeyAlpha=3,
virtualkeyIcon=true,
- virtualkeySwitch=F,
+ virtualkeySwitch=false,
frameMul=100,
}
stat={
@@ -126,9 +126,9 @@ virtualkeyPressTime={0,0,0,0,0,0,0,0,0,0,0,0,0}
-------------------------------------------------------------
require("class")
require("toolfunc")
+require("ai")
require("gamefunc")
require("list")
-require("ai")
require("dataList")
require("texture")
local Tmr=require("timer")
@@ -147,18 +147,7 @@ if sys.getPowerInfo()~="unknown"then
gc.clear(0,0,0,.3)
gc.setLineWidth(4)
setFont(25)
- if pow then
- 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
+ local charging
if state~="battery"then
gc.setColor(1,1,1)
if state=="nobattery"then
@@ -166,8 +155,22 @@ if sys.getPowerInfo()~="unknown"then
gc.line(61.5,.5,83.5,22.5)
elseif state=="charging"or state=="charged"then
gc.draw(chargeImage,84,3)
+ F=true
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.pop()gc.setCanvas()
end
@@ -209,20 +212,22 @@ local sceneInit={
mode=function()
curBG="none"
saveData()
+ destroyPlayers()
BGM("blank")
end,
custom=function()
sel=sel or 1
+ destroyPlayers()
curBG=customRange.bg[customSel[12]]
BGM(customRange.bgm[customSel[13]])
end,
draw=function()
curBG="none"
- kb.setKeyRepeat(true)
clearSureTime=0
pen,sx,sy=1,1,1
end,
play=function()
+ kb.setKeyRepeat(false)
restartCount=0
if needResetGameData then
resetGameData()
@@ -276,37 +281,41 @@ local function onVirtualkey(x,y)
end
local function buttonControl_key(i)
if i=="up"or i=="down"or i=="left"or i=="right"then
- if Buttons.sel then
- Buttons.sel=Buttons[scene][Buttons.sel[i]]or Buttons.sel
+ if Widget.sel then
+ Widget.sel=Widget[scene][Widget.sel[i]]or Widget.sel
else
- Buttons.sel=select(2,next(Buttons[scene]))
+ Widget.sel=select(2,next(Widget[scene]))
end
elseif i=="space"or i=="return"then
- if not sceneSwaping and Buttons.sel then
- local B=Buttons.sel
- B.alpha=1
- B.code()
- if B.hide and B.hide()then Buttons.sel=nil end
- SFX("button")
- VOICE("nya")
+ if not sceneSwaping and Widget.sel then
+ local W=Widget.sel
+ if W.type=="button"then
+ W.alpha=1
+ W.code()
+ if W.hide and W.hide()then Widget.sel=nil end
+ SFX("button")
+ VOICE("nya")
+ end
end
end
end
local function buttonControl_gamepad(i)
if i=="dpup"or i=="dpdown"or i=="dpleft"or i=="dpright"then
- if Buttons.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
+ if Widget.sel then
+ 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
- Buttons.sel=select(2,next(Buttons[scene]))
+ Widget.sel=select(2,next(Widget[scene]))
end
elseif i=="start"then
- if not sceneSwaping and Buttons.sel then
- local B=Buttons.sel
- B.alpha=1
- B.code()
- if B.hide and B.hide()then Buttons.sel=nil end
- SFX("button")
- VOICE("nya")
+ if not sceneSwaping and Widget.sel then
+ local W=Widget.sel
+ if W.type=="button"then
+ W.alpha=1
+ W.code()
+ if W.hide and W.hide()then Widget.sel=nil end
+ SFX("button")
+ VOICE("nya")
+ end
end
end
end
@@ -381,7 +390,11 @@ function keyDown.music(key)
elseif key=="up"then
sel=(sel-2)%#musicID+1
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
back()
end
@@ -450,7 +463,12 @@ function touchMove.draw(id,x,y,dx,dy)
end
function keyDown.draw(key)
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
if not sx then sx=1 end
if not sy then sy=1 end
@@ -606,6 +624,7 @@ function touchDown.play(id,x,y)
local t=onVirtualkey(x,y)
if t then
pressKey(t,players[1])
+ VIB(0)
end
end
end
@@ -702,15 +721,17 @@ function love.mousepressed(x,y,k,t,num)
back()
end
if k==1 then
- if not sceneSwaping and Buttons.sel then
- local B=Buttons.sel
- B.code()
- B.alpha=1
- Buttons.sel=nil
- love.mousemoved(x,y,0,0)
- SFX("button")
- VOICE("nya")
- VIB(1)
+ if not sceneSwaping and Widget.sel then
+ local W=Widget.sel
+ if W.type=="button"then
+ W.code()
+ W.alpha=1
+ Widget.sel=nil
+ love.mousemoved(x,y,0,0)
+ SFX("button")
+ VOICE("nya")
+ VIB(1)
+ end
end
end
end
@@ -718,15 +739,17 @@ function love.mousemoved(x,y,dx,dy,t)
if t then return end
mouseShow=true
mx,my=xOy:inverseTransformPoint(x,y)
- Buttons.sel=nil
+ Widget.sel=nil
if mouseMove[scene]then
mouseMove[scene](mx,my,dx/scr.k,dy/scr.k)
end
- for _,B in next,Buttons[scene]do
- if not(B.hide and B.hide())then
- if abs(mx-B.x)W.x and mxW.y and myW.x and xW.y and y.02 and(B.alpha+(B.alphat then B.alpha=B.alpha-.02 elseif B.alpha.02 and(W.alpha+(W.alphat then W.alpha=W.alpha-.02 elseif W.alpha0 then
+ if devMode==2 then
+ gc.setColor(1,1,0)
+ end
gc.print(mx.." "..my,5,640)
gc.print(#freeRow.."/"..freeRow.L,5,660)
gc.print(gcinfo(),5,680)
@@ -999,7 +1037,7 @@ function love.run()
return function()
PUMP()
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
end
tm.step()
@@ -1031,7 +1069,7 @@ if fs.getInfo("usersetting")then
loadSetting()
elseif system=="Android" or system=="iOS"then
setting.virtualkeySwitch=true
- setting.swap=F
+ setting.swap=false
end
math.randomseed(os.time()*626)
swapLanguage(setting.lang)
diff --git a/paint.lua b/paint.lua
index 3385fdcd..15db7712 100644
--- a/paint.lua
+++ b/paint.lua
@@ -26,11 +26,13 @@ local modeLevelColor={
NORMAL=color.green,
HARD=color.magenta,
LUNATIC=color.red,
+ EXTRA=color.lightMagenta,
+ ULTIMATE=color.lightYellow,
+ FINAL=color.lightGrey,
+ ["EASY+"]=color.darkCyan,
["NORMAL+"]=color.darkGreen,
["HARD+"]=color.darkMagenta,
["LUNATIC+"]=color.darkRed,
- EXTRA=color.lightMagenta,
- ULTIMATE=color.lightYellow,
MESS=color.lightGrey,
GM=color.blue,
@@ -109,7 +111,7 @@ FX={
shake=0,--Screen shake(frame)
attack={},--Attack beam
badge={},--badge thrown
-
+
appear=function(t,a)
setFont(t.font)
gc.setColor(1,1,1,a)
@@ -246,27 +248,27 @@ end,
game1=function()
gc.setColor(1,1,1)
gc.draw(background1,640,360,Timer()*.15,12,nil,64,64)
-end,
+end,--Rainbow
game2=function()
gc.setColor(1,.5,.5)
gc.draw(background1,640,360,Timer()*.2,12,nil,64,64)
-end,
+end,--Red rainbow
game3=function()
gc.setColor(.6,.6,1)
gc.draw(background1,640,360,Timer()*.25,12,nil,64,64)
-end,
+end,--Blue rainbow
game4=function()
gc.setColor(.1,.5,.5)
local x=Timer()%4*320
gc.draw(background2,x,0,nil,10)
gc.draw(background2,x-1280,0,nil,10)
-end,
+end,--Fast strap
game5=function()
local t=2.5-Timer()%20%6%2.5
if t<.5 then gc.clear(t,t,t)
else gc.clear(0,0,0)
end
-end,
+end,--Lightning
game6=function()
local t=1.2-Timer()%10%3%1.2
if t<.5 then gc.clear(t,t,t)
@@ -275,7 +277,7 @@ game6=function()
gc.setColor(.3,.3,.3)
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)
-end,
+end,--Fast lightning&spining tetromino
rgb=function()
gc.clear(
sin(Timer()*1.2)*.15+.5,
@@ -361,19 +363,19 @@ function Pnt.mode()
end
function Pnt.music()
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.draw(drawableText.musicRoom,20,20)
gc.setColor(1,1,1)
gc.draw(drawableText.musicRoom,22,23)
- gc.draw(drawableText.nowPlaying,520,83)
+ gc.draw(drawableText.nowPlaying,490,110)
setFont(35)
for i=1,#musicID do
gc.print(musicID[i],50,90+30*i)
end
setFont(50)
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
function Pnt.custom()
gc.setColor(1,1,1,.3+sin(Timer()*8)*.2)
@@ -406,7 +408,7 @@ function Pnt.draw()
local B=preField[y][x]
if B>0 then
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,625-30*y,30*x-5,605-30*y)
end
@@ -424,7 +426,7 @@ function Pnt.draw()
gc.setLineWidth(13)
gc.setColor(blockColor[pen])
gc.rectangle("line",945,605,70,70)
- elseif pen==0 then
+ elseif pen==-1 then
gc.setLineWidth(5)
gc.setColor(.9,.9,.9)
gc.line(960,620,1000,660)
@@ -443,16 +445,11 @@ function Pnt.play()
gc.push("transform")
gc.origin()
gc.setColor(1,1,1,P.result and max(20-P.endCounter,0)*.05 or 1)
- local h=#P.clearing
local F=P.field
for j=1,#F do
- if j==P.clearing[h]and P.falling>-1 then
- h=h-1
- else
- 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
+ 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--Field
if P.alive then
gc.setLineWidth(2)
@@ -471,6 +468,7 @@ function Pnt.play()
end
gc.pop()
gc.setCanvas()
+ --draw content
end
gc.setColor(1,1,1)
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.circle("line",P.centerX,P.centerY,(840-20*min(P.endCounter,30))*P.size)
end
+ --draw Canvas
else
gc.push("transform")
gc.translate(P.x,P.y)gc.scale(P.size)--Position
@@ -497,26 +496,24 @@ function Pnt.play()
end--Grid lines
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)
- -- 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 (1-(P.falling/P.gameEnv.fall)^3)*30 or 0
- local h=#P.clearing
+ local dy,stepY=0,setting.smo and(P.falling/(P.gameEnv.fall+1))^2.5*30 or 30
+ local h=1
for j=int(P.fieldBeneath/30+1),#P.field do
- if j==P.clearing[h]and P.falling>-1 then
- h=h-1
+ while j==P.clearing[h]and P.falling>-1 do
+ h=h+1
dy=dy+stepY
- gc.translate(0,stepY)
+ gc.translate(0,-stepY)
gc.setColor(1,1,1,P.falling/P.gameEnv.fall)
- gc.rectangle("fill",0,600-30*j,320,30-stepY)
- else
- for i=1,10 do
- if P.field[j][i]>0 then
- gc.setColor(1,1,1,min(P.visTime[j][i]*.05,1))
- drawPixel(j,i,P.field[j][i])
- end
+ gc.rectangle("fill",0,630-30*j,320,stepY)
+ end
+ for i=1,10 do
+ if P.field[j][i]>0 then
+ gc.setColor(1,1,1,min(P.visTime[j][i]*.05,1))
+ drawPixel(j,i,P.field[j][i])
end
end
end--Field
- gc.translate(0,-dy)
+ gc.translate(0,dy)
for i=1,#P.shade do
local S=P.shade[i]
gc.setColor(1,1,1,S[1]*.12)
@@ -535,10 +532,28 @@ function Pnt.play()
end
end end
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)
+ local trans=P.lockDelay/P.gameEnv.lock
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
if P.cur.bk[i][j]then
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
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
gc.draw(spinCenter,x,600-30*(P.curY+P.sc[1]-1)+15,nil,nil,nil,4,4)
gc.translate(0,dy)
@@ -761,10 +776,10 @@ function Pnt.pause()
end
setFont(40)
if system~="Android"then
- mStr(text.space.."/"..text.enter,640,300)
- gc.print("ESC",610,598)
+ mStr(text.space.."/"..text.enter,640,335)
+ gc.print("ESC",610,509)
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
function Pnt.setting()
gc.setColor(1,1,1)
diff --git a/timer.lua b/timer.lua
index 6a6eb2dc..eeb802c8 100644
--- a/timer.lua
+++ b/timer.lua
@@ -102,8 +102,12 @@ play=function(dt)
end
for p=1,#players do
P=players[p]
- if P.keyPressing[1]or P.keyPressing[2]then
- P.moving=P.moving+(P.moving>0 and 1 or -1)
+ if P.keyPressing[1]then
+ 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
P.moving=0
end
@@ -140,23 +144,15 @@ play=function(dt)
end
end
- if P.ai and P.waiting==-1 then
- P.ai.controlDelay=P.ai.controlDelay-1
- if P.ai.controlDelay==0 then
- if #P.ai.controls>0 then
- local C=P.ai.controls
- pressKey(C[1],P)releaseKey(C[1],P)
- local k=#C for i=1,k do C[i]=C[i+1]end--table.remove(C,1)
- P.ai.controlDelay=P.ai.controlDelay0+1
- else
- 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
+ if not P.human and P.control and P.waiting==-1 then
+ local C=P.AI_keys
+ P.AI_delay=P.AI_delay-1
+ if not C[1]then
+ P.AI_stage=AI_think[P.AI_mode][P.AI_stage](C)
+ elseif P.AI_delay<=0 then
+ pressKey(C[1],P)releaseKey(C[1],P)
+ local k=#C for i=1,k do C[i]=C[i+1]end--table.remove(C,1)
+ P.AI_delay=P.AI_delay0*2
end
end
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
end end
end--Fresh visible time
-
- if P.keyPressing[1]or P.keyPressing[2]then
- P.moving=P.moving+(P.moving>0 and 1 or -1)
- local d=abs(P.moving)-P.gameEnv.das
- if d>1 then
- if P.gameEnv.arr>0 then
- if d%P.gameEnv.arr==0 then
- act[P.moving>0 and"moveRight"or"moveLeft"](true)
+ if P.moving<0 then
+ if P.keyPressing[1]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.moveLeft(true)
+ else
+ act.insLeft()
end
- else
- act[P.moving>0 and"insRight"or"insLeft"]()
+ if x~=P.curX then P.moving=P.moving+P.gameEnv.arr-1 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
- else
- P.moving=0
end
if P.keyPressing[7]and not P.keyPressing[9]then
local d=abs(P.downing)-P.gameEnv.sddas
@@ -197,16 +210,17 @@ play=function(dt)
end
if P.falling>=0 then
P.falling=P.falling-1
- if P.falling>=0 then goto stop end
- if P.human and P.gameEnv.fall>0 and #P.field>P.clearing[1]then SFX("fall")end
- for i=1,#P.clearing do
- removeRow(P.field,P.clearing[i])
- removeRow(P.visTime,P.clearing[i])
- end
- for i=1,#P.clearing do
- P.clearing[i]=nil
+ if P.falling>=0 then
+ goto stop
+ else
+ local L=#P.clearing
+ if P.human and P.gameEnv.fall>0 and #P.field+L>P.clearing[L]then SFX("fall")end
+ for i=1,L do
+ P.clearing[i]=nil
+ end
end
end
+ if not P.control then goto stop end
if P.waiting>=0 then
P.waiting=P.waiting-1
if P.waiting==-1 then resetblock()end
@@ -215,11 +229,17 @@ play=function(dt)
if P.curY~=P.y_img then
if P.dropDelay>=0 then
P.dropDelay=P.dropDelay-1
- if P.dropDelay>=0 then goto stop end
+ if P.dropDelay>0 then goto stop end
end
- drop()
+ P.curY=P.curY-1
+ P.spinLast=false
if P.y_img~=P.curY then
P.dropDelay=P.gameEnv.drop
+ elseif P.AI_mode=="CC"then
+ P.AI_needFresh=true
+ if not P.AIdata._20G and P.gameEnv.drop=0 then goto stop end
drop()
+ if P.AI_mode=="CC"then
+ P.AI_needFresh=true
+ end
end
::stop::
if P.b2b1==P.b2b then
@@ -248,14 +271,14 @@ play=function(dt)
end
if P.falling>=0 then
P.falling=P.falling-1
- if P.falling>=0 then goto stop end
- if P.human and P.gameEnv.fall>0 and #P.field>P.clearing[1]then SFX("fall")end
- for i=1,#P.clearing do
- removeRow(P.field,P.clearing[i])
- removeRow(P.visTime,P.clearing[i])
- end
- for i=1,#P.clearing do
- P.clearing[i]=nil
+ if P.falling>=0 then
+ goto stop
+ else
+ local L=#P.clearing
+ if P.human and P.gameEnv.fall>0 and #P.field+L>P.clearing[L]then SFX("fall")end
+ for i=1,L do
+ P.clearing[i]=nil
+ end
end
end::stop::
if P.endCounter<40 then
@@ -297,6 +320,7 @@ play=function(dt)
if b.t>=60 then rem(P.bonus,i)end
end
end
+
for i=#P.atkBuffer,1,-1 do
local atk=P.atkBuffer[i]
atk.time=atk.time+1
diff --git a/toolfunc.lua b/toolfunc.lua
index cff083b0..7ee47972 100644
--- a/toolfunc.lua
+++ b/toolfunc.lua
@@ -25,6 +25,22 @@ function mDraw(s,x,y)
gc.draw(s,x-s:getWidth()*.5,y)
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)
local t=rem(freeRow)
for i=1,10 do
@@ -62,11 +78,13 @@ local drawableTextLoad={
}
function swapLanguage(l)
text=require("language/"..langID[l])
- Buttons.sel=nil
- for S,L in next,Buttons do
- for N,B in next,L do
- B.alpha=0
- B.t=text.ButtonText[S][N]
+ Widget.sel=nil
+ for S,L in next,Widget do
+ for N,W in next,L do
+ if W.type=="button"then
+ W.alpha=0
+ W.text=text.ButtonText[S][N]
+ end
end
end
gc.push("transform")
@@ -101,7 +119,7 @@ function changeBlockSkin(n)
gc.setCanvas()
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)
if setting.vib>0 then
love.system.vibrate(vibrateLevel[setting.vib+t])
@@ -132,21 +150,25 @@ function VOICE(s,n)
end
end
function BGM(s)
- if setting.bgm and bgmPlaying~=s then
- if bgmPlaying then newTask(Event_task.bgmFadeOut,nil,bgmPlaying)end
- for i=#Task,1,-1 do
- local T=Task[i]
- if T.code==Event_task.bgmFadeIn then
- T.code=Event_task.bgmFadeOut
- elseif T.code==Event_task.bgmFadeOut and T.data==s then
- rem(Task,i)
+ if setting.bgm then
+ if bgmPlaying~=s then
+ if bgmPlaying then newTask(Event_task.bgmFadeOut,nil,bgmPlaying)end
+ for i=#Task,1,-1 do
+ local T=Task[i]
+ if T.code==Event_task.bgmFadeIn then
+ T.code=Event_task.bgmFadeOut
+ elseif T.code==Event_task.bgmFadeOut and T.data==s then
+ rem(Task,i)
+ 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
- if s then
- newTask(Event_task.bgmFadeIn,nil,s)
- bgm[s]:play()
- end
- bgmPlaying=s
end
end
@@ -199,7 +221,7 @@ function gotoScene(s,style)
time=swap[style][1],mid=swap[style][2],
draw=swap[style].d
}
- Buttons.sel=nil
+ Widget.sel=nil
if style~="none"then
SFX("swipe")
end
@@ -218,10 +240,10 @@ local prevMenu={
mode="main",
custom="mode",
draw=function()
- kb.setKeyRepeat(false)
gotoScene("custom")
end,
play=function()
+ kb.setKeyRepeat(true)
updateStat()
clearTask("play")
gotoScene(curMode.id~="custom"and"mode"or"custom","deck")
@@ -249,7 +271,6 @@ function pauseGame()
pauseTimer=0--Pause timer for animation
if not gamefinished then
pauseCount=pauseCount+1
- if bgmPlaying then bgm[bgmPlaying]:pause()end
end
for i=1,#players.alive do
local l=players.alive[i].keyPressing
@@ -262,7 +283,6 @@ function pauseGame()
gotoScene("pause","none")
end
function resumeGame()
- if bgmPlaying then bgm[bgmPlaying]:play()end
gotoScene("play","fade")
end
local dataOpt={
diff --git a/updateLog.lua b/updateLog.lua
index 48b2d7d3..dedabba8 100644
--- a/updateLog.lua
+++ b/updateLog.lua
@@ -1,27 +1,40 @@
return{
[=[Future outlook:
- "classic" rule
- backfire mode
- Encrypt source code(JIT to byte code)
- game recording
- virtual key switch(all keys)
- easier CTWC
- fineese/bigbang mode
- more FXs
- TTT mode
- smarter AI
+ Brand New GUI:
+ custom restart method
+ custom block color/direction
+ custom sequence
+ virtual key switch(all keys)
+ Normal Things:
+ demo play at main menu
+ any screen size
+ CC smarter(think of gaebage buffer)
+ fineese/bigbang mode & easier CTWC
+ new AI:task-Z
+ game recording
+ TTT mode
+ Hard Things:
+ Encrypt source code(JIT to byte code)
infinite 1v1
square mode
- 3d features
- layer-feeling
- more animation]=],[=[
+ more FXs & 3d features & animations]=],[=[
+0.7.23:
+ 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:
scoring system
smooth dropping
can change FX level
new attaking FX
new bone skin
- baattery info/time display
+ battery info/time display
in-game update log(this page)
fast game
much many more better GUI details