重构next和hold系统,支持多next
This commit is contained in:
10
main.lua
10
main.lua
@@ -29,6 +29,11 @@ love.keyboard.setKeyRepeat(true)
|
|||||||
love.keyboard.setTextInput(false)
|
love.keyboard.setTextInput(false)
|
||||||
love.mouse.setVisible(false)
|
love.mouse.setVisible(false)
|
||||||
|
|
||||||
|
MODOPT={
|
||||||
|
-- nextStartPos=2,
|
||||||
|
-- drop=0,
|
||||||
|
-- lock=0,
|
||||||
|
}
|
||||||
CUSTOMENV={
|
CUSTOMENV={
|
||||||
--Basic
|
--Basic
|
||||||
drop=60,
|
drop=60,
|
||||||
@@ -36,8 +41,9 @@ CUSTOMENV={
|
|||||||
wait=0,
|
wait=0,
|
||||||
fall=0,
|
fall=0,
|
||||||
|
|
||||||
next=6,
|
nextCount=6,
|
||||||
hold=true,
|
nextStartPos=1,
|
||||||
|
holdCount=1,
|
||||||
oncehold=true,
|
oncehold=true,
|
||||||
|
|
||||||
--Visual
|
--Visual
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ return function(type,speedLV,next,hold,node)
|
|||||||
if type=="CC"then
|
if type=="CC"then
|
||||||
return{
|
return{
|
||||||
type="CC",
|
type="CC",
|
||||||
next=next,
|
nextCount=next,
|
||||||
hold=hold,
|
hold=hold>0,
|
||||||
delta=AISpeed[speedLV],
|
delta=AISpeed[speedLV],
|
||||||
node=node,
|
node=node,
|
||||||
}
|
}
|
||||||
|
|||||||
18
parts/ai.lua
18
parts/ai.lua
@@ -66,19 +66,21 @@ if _CC then
|
|||||||
CC.setNode(opt,P.AIdata.node)
|
CC.setNode(opt,P.AIdata.node)
|
||||||
P.AI_bot=CC.new(opt,wei)
|
P.AI_bot=CC.new(opt,wei)
|
||||||
CC.free(opt)CC.free(wei)
|
CC.free(opt)CC.free(wei)
|
||||||
for i=1,P.AIdata.next do
|
for i=1,P.AIdata.nextCount do
|
||||||
CC.addNext(P.AI_bot,CCblockID[P.next[i].id])
|
CC.addNext(P.AI_bot,CCblockID[P.nextQueue[i].id])
|
||||||
end
|
end
|
||||||
CC.updateField(P)
|
CC.updateField(P)
|
||||||
P.hd=nil
|
|
||||||
P.holded=false
|
while P.holdQueue[1]do rem(P.holdQueue)end
|
||||||
P.cur=rem(P.next,1)
|
P.holdTime=P.gameEnv.holdCount
|
||||||
|
|
||||||
|
P.cur=rem(P.nextQueue,1)
|
||||||
P.sc,P.dir=spinCenters[P.cur.id][0],0
|
P.sc,P.dir=spinCenters[P.cur.id][0],0
|
||||||
P.r,P.c=#P.cur.bk,#P.cur.bk[1]
|
P.r,P.c=#P.cur.bk,#P.cur.bk[1]
|
||||||
P.curX,P.curY=blockPos[P.cur.id],21+ceil(P.fieldBeneath/30)-P.r+min(int(#P.field*.2),2)
|
P.curX,P.curY=blockPos[P.cur.id],21+ceil(P.fieldBeneath/30)-P.r+min(int(#P.field*.2),2)
|
||||||
|
|
||||||
P:newNext()
|
P:newNext()
|
||||||
local id=CCblockID[P.next[P.AIdata.next].id]
|
local id=CCblockID[P.nextQueue[P.AIdata.nextCount].id]
|
||||||
if id then
|
if id then
|
||||||
CC.addNext(P.AI_bot,id)
|
CC.addNext(P.AI_bot,id)
|
||||||
end
|
end
|
||||||
@@ -204,13 +206,13 @@ return{
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for ifhold=0,P.gameEnv.hold and 1 or 0 do
|
for ifhold=0,P.gameEnv.holdCount>0 and 1 or 0 do
|
||||||
--Get block id
|
--Get block id
|
||||||
local bn
|
local bn
|
||||||
if ifhold==0 then
|
if ifhold==0 then
|
||||||
bn=P.cur and P.cur.id
|
bn=P.cur and P.cur.id
|
||||||
else
|
else
|
||||||
bn=P.hd and P.hd.id or P.next[1]and P.next[1].id
|
bn=P.holdQueue[1]and P.holdQueue[1].id or P.nextQueue[1]and P.nextQueue[1].id
|
||||||
end
|
end
|
||||||
if not bn then goto CTN end
|
if not bn then goto CTN end
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ function restoreVirtualKey()
|
|||||||
B.isDown=false
|
B.isDown=false
|
||||||
B.pressTime=0
|
B.pressTime=0
|
||||||
end
|
end
|
||||||
if not modeEnv.Fkey then
|
if not MODEENV.Fkey then
|
||||||
virtualkey[9].ava=false
|
virtualkey[9].ava=false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -64,7 +64,7 @@ end
|
|||||||
function copyQuestArgs()
|
function copyQuestArgs()
|
||||||
local ENV=CUSTOMENV
|
local ENV=CUSTOMENV
|
||||||
local str=""..
|
local str=""..
|
||||||
(ENV.hold and"H"or"Z")..
|
(ENV.hold>0 and"H"or"Z")..
|
||||||
(ENV.ospin and"O"or"Z")..
|
(ENV.ospin and"O"or"Z")..
|
||||||
(ENV.missionKill and"M"or"Z")..
|
(ENV.missionKill and"M"or"Z")..
|
||||||
ENV.sequence
|
ENV.sequence
|
||||||
@@ -72,7 +72,7 @@ function copyQuestArgs()
|
|||||||
end
|
end
|
||||||
function pasteQuestArgs(str)
|
function pasteQuestArgs(str)
|
||||||
local ENV=CUSTOMENV
|
local ENV=CUSTOMENV
|
||||||
ENV.hold= byte(str,1)~=90
|
ENV.holdCount= byte(str,1)~=90 and 1 or 0
|
||||||
ENV.ospin= byte(str,2)~=90
|
ENV.ospin= byte(str,2)~=90
|
||||||
ENV.missionKill= byte(str,3)~=90
|
ENV.missionKill= byte(str,3)~=90
|
||||||
ENV.sequence= sub(str,4)
|
ENV.sequence= sub(str,4)
|
||||||
@@ -451,19 +451,19 @@ function resetGameData()
|
|||||||
GAME.seed=rnd(261046101471026)
|
GAME.seed=rnd(261046101471026)
|
||||||
|
|
||||||
destroyPlayers()
|
destroyPlayers()
|
||||||
modeEnv=CURMODE.env
|
MODEENV=CURMODE.env
|
||||||
restoreVirtualKey()
|
restoreVirtualKey()
|
||||||
CURMODE.load()
|
CURMODE.load()
|
||||||
if modeEnv.task then
|
if MODEENV.task then
|
||||||
for i=1,#PLAYERS do
|
for i=1,#PLAYERS do
|
||||||
PLAYERS[i]:newTask(modeEnv.task)
|
PLAYERS[i]:newTask(MODEENV.task)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
BG.set(modeEnv.bg)
|
BG.set(MODEENV.bg)
|
||||||
BGM.play(modeEnv.bgm)
|
BGM.play(MODEENV.bgm)
|
||||||
|
|
||||||
TEXT.clear()
|
TEXT.clear()
|
||||||
if modeEnv.royaleMode then
|
if MODEENV.royaleMode then
|
||||||
for i=1,#PLAYERS do
|
for i=1,#PLAYERS do
|
||||||
PLAYERS[i]:changeAtk(randomTarget(PLAYERS[i]))
|
PLAYERS[i]:changeAtk(randomTarget(PLAYERS[i]))
|
||||||
end
|
end
|
||||||
@@ -508,19 +508,19 @@ function resetPartGameData(replaying)
|
|||||||
end
|
end
|
||||||
|
|
||||||
destroyPlayers()
|
destroyPlayers()
|
||||||
modeEnv=CURMODE.env
|
MODEENV=CURMODE.env
|
||||||
restoreVirtualKey()
|
restoreVirtualKey()
|
||||||
CURMODE.load()
|
CURMODE.load()
|
||||||
if modeEnv.task then
|
if MODEENV.task then
|
||||||
for i=1,#PLAYERS do
|
for i=1,#PLAYERS do
|
||||||
PLAYERS[i]:newTask(modeEnv.task)
|
PLAYERS[i]:newTask(MODEENV.task)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
BG.set(modeEnv.bg)
|
BG.set(MODEENV.bg)
|
||||||
BGM.play(modeEnv.bgm)
|
BGM.play(MODEENV.bgm)
|
||||||
|
|
||||||
TEXT.clear()
|
TEXT.clear()
|
||||||
if modeEnv.royaleMode then
|
if MODEENV.royaleMode then
|
||||||
for i=1,#PLAYERS do
|
for i=1,#PLAYERS do
|
||||||
PLAYERS[i]:changeAtk(randomTarget(PLAYERS[i]))
|
PLAYERS[i]:changeAtk(randomTarget(PLAYERS[i]))
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ return{
|
|||||||
minarr=1,
|
minarr=1,
|
||||||
drop=0,lock=15,
|
drop=0,lock=15,
|
||||||
wait=15,fall=6,
|
wait=15,fall=6,
|
||||||
next=3,
|
nextCount=3,
|
||||||
visible="fast",
|
visible="fast",
|
||||||
freshLimit=15,
|
freshLimit=15,
|
||||||
dropPiece=score,
|
dropPiece=score,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ return{
|
|||||||
color=COLOR.red,
|
color=COLOR.red,
|
||||||
env={
|
env={
|
||||||
drop=30,lock=60,
|
drop=30,lock=60,
|
||||||
next=1,
|
nextCount=1,
|
||||||
block=false,center=0,ghost=0,
|
block=false,center=0,ghost=0,
|
||||||
dropFX=0,lockFX=0,
|
dropFX=0,lockFX=0,
|
||||||
visible="none",
|
visible="none",
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ return{
|
|||||||
irs=false,ims=false,
|
irs=false,ims=false,
|
||||||
center=0,ghost=0,
|
center=0,ghost=0,
|
||||||
drop=3,lock=3,wait=10,fall=25,
|
drop=3,lock=3,wait=10,fall=25,
|
||||||
next=1,hold=false,
|
nextCount=1,hold=false,
|
||||||
sequence="rnd",
|
sequence="rnd",
|
||||||
RS="Classic",
|
RS="Classic",
|
||||||
freshLimit=0,
|
freshLimit=0,
|
||||||
|
|||||||
@@ -50,41 +50,41 @@ return{
|
|||||||
env={},
|
env={},
|
||||||
load=function()
|
load=function()
|
||||||
for k,v in next,CUSTOMENV do
|
for k,v in next,CUSTOMENV do
|
||||||
modeEnv[k]=v
|
MODEENV[k]=v
|
||||||
end
|
end
|
||||||
if BAG[1]then
|
if BAG[1]then
|
||||||
modeEnv.bag=BAG
|
MODEENV.bag=BAG
|
||||||
else
|
else
|
||||||
modeEnv.bag=nil
|
MODEENV.bag=nil
|
||||||
end
|
end
|
||||||
if MISSION[1]then
|
if MISSION[1]then
|
||||||
modeEnv.mission=MISSION
|
MODEENV.mission=MISSION
|
||||||
else
|
else
|
||||||
modeEnv.mission=nil
|
MODEENV.mission=nil
|
||||||
end
|
end
|
||||||
modeEnv.dropPiece=PLY.check_lineReach
|
MODEENV.dropPiece=PLY.check_lineReach
|
||||||
for y=1,20 do
|
for y=1,20 do
|
||||||
if notAir(FIELD[1][y])then
|
if notAir(FIELD[1][y])then
|
||||||
--Switch clear mode on
|
--Switch clear mode on
|
||||||
modeEnv.dropPiece=checkClear
|
MODEENV.dropPiece=checkClear
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
PLY.newPlayer(1,340,15)
|
PLY.newPlayer(1,340,15)
|
||||||
local L=modeEnv.opponent
|
local L=MODEENV.opponent
|
||||||
if L~=0 then
|
if L~=0 then
|
||||||
modeEnv.target=nil
|
MODEENV.target=nil
|
||||||
if L<6 then
|
if L<6 then
|
||||||
PLY.newAIPlayer(2,965,360,.5,AIBUILDER("9S",2*L))
|
PLY.newAIPlayer(2,965,360,.5,AIBUILDER("9S",2*L))
|
||||||
else
|
else
|
||||||
PLY.newAIPlayer(2,965,360,.5,AIBUILDER("CC",2*L-11,int(L*.5-1.5),modeEnv.hold,4000*L))
|
PLY.newAIPlayer(2,965,360,.5,AIBUILDER("CC",2*L-11,int(L*.5-1.5),MODEENV.hold,4000*L))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for _,P in next,PLAYERS.alive do
|
for _,P in next,PLAYERS.alive do
|
||||||
setField(P,1)
|
setField(P,1)
|
||||||
end
|
end
|
||||||
modeEnv.bg=CUSTOMENV.bg
|
MODEENV.bg=CUSTOMENV.bg
|
||||||
modeEnv.bgm=CUSTOMENV.bgm
|
MODEENV.bgm=CUSTOMENV.bgm
|
||||||
end,
|
end,
|
||||||
mesDisp=function(P)
|
mesDisp=function(P)
|
||||||
setFont(55)
|
setFont(55)
|
||||||
|
|||||||
@@ -39,30 +39,30 @@ return{
|
|||||||
},
|
},
|
||||||
load=function()
|
load=function()
|
||||||
for k,v in next,CUSTOMENV do
|
for k,v in next,CUSTOMENV do
|
||||||
modeEnv[k]=v
|
MODEENV[k]=v
|
||||||
end
|
end
|
||||||
if BAG[1]then
|
if BAG[1]then
|
||||||
modeEnv.bag=BAG
|
MODEENV.bag=BAG
|
||||||
else
|
else
|
||||||
modeEnv.bag=nil
|
MODEENV.bag=nil
|
||||||
end
|
end
|
||||||
if MISSION[1]then
|
if MISSION[1]then
|
||||||
modeEnv.mission=MISSION
|
MODEENV.mission=MISSION
|
||||||
else
|
else
|
||||||
modeEnv.mission=nil
|
MODEENV.mission=nil
|
||||||
end
|
end
|
||||||
PLY.newPlayer(1,340,15)
|
PLY.newPlayer(1,340,15)
|
||||||
local L=modeEnv.opponent
|
local L=MODEENV.opponent
|
||||||
if L~=0 then
|
if L~=0 then
|
||||||
modeEnv.target=nil
|
MODEENV.target=nil
|
||||||
if L<6 then
|
if L<6 then
|
||||||
PLY.newAIPlayer(2,965,360,.5,AIBUILDER("9S",2*L))
|
PLY.newAIPlayer(2,965,360,.5,AIBUILDER("9S",2*L))
|
||||||
else
|
else
|
||||||
PLY.newAIPlayer(2,965,360,.5,AIBUILDER("CC",2*L-11,int(L*.5-1.5),modeEnv.hold,4000*L))
|
PLY.newAIPlayer(2,965,360,.5,AIBUILDER("CC",2*L-11,int(L*.5-1.5),MODEENV.hold,4000*L))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
modeEnv.bg=CUSTOMENV.bg
|
MODEENV.bg=CUSTOMENV.bg
|
||||||
modeEnv.bgm=CUSTOMENV.bgm
|
MODEENV.bgm=CUSTOMENV.bgm
|
||||||
end,
|
end,
|
||||||
mesDisp=function(P)
|
mesDisp=function(P)
|
||||||
local dx,dy=P.fieldOff.x,P.fieldOff.y
|
local dx,dy=P.fieldOff.x,P.fieldOff.y
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ return{
|
|||||||
env={
|
env={
|
||||||
drop=5,lock=60,
|
drop=5,lock=60,
|
||||||
fall=6,
|
fall=6,
|
||||||
next=3,
|
nextCount=3,
|
||||||
freshLimit=15,
|
freshLimit=15,
|
||||||
pushSpeed=2,
|
pushSpeed=2,
|
||||||
task=function(P)
|
task=function(P)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ return{
|
|||||||
env={
|
env={
|
||||||
drop=30,lock=60,
|
drop=30,lock=60,
|
||||||
fall=10,
|
fall=10,
|
||||||
next=3,
|
nextCount=3,
|
||||||
freshLimit=15,
|
freshLimit=15,
|
||||||
pushSpeed=1,
|
pushSpeed=1,
|
||||||
task=function(P)
|
task=function(P)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ return{
|
|||||||
for _=1,3 do P:getNext(7)end
|
for _=1,3 do P:getNext(7)end
|
||||||
end,
|
end,
|
||||||
freshMethod=function(P)
|
freshMethod=function(P)
|
||||||
if not P.next[1] then
|
if not P.nextQueue[1] then
|
||||||
local height=FREEROW.get(0)
|
local height=FREEROW.get(0)
|
||||||
local max=#P.field
|
local max=#P.field
|
||||||
if max>0 then
|
if max>0 then
|
||||||
@@ -92,7 +92,7 @@ return{
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
target=100,dropPiece=PLY.check_lineReach,
|
target=100,dropPiece=PLY.check_lineReach,
|
||||||
next=1,hold=false,
|
nextCount=1,hold=false,
|
||||||
ospin=false,
|
ospin=false,
|
||||||
freshLimit=15,
|
freshLimit=15,
|
||||||
bg="glow",bgm="reason",
|
bg="glow",bgm="reason",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ return{
|
|||||||
sequence="bag",
|
sequence="bag",
|
||||||
bag={1,1,2,2,3,3,4,4,5,5,6,6},
|
bag={1,1,2,2,3,3,4,4,5,5,6,6},
|
||||||
target=100,dropPiece=PLY.check_lineReach,
|
target=100,dropPiece=PLY.check_lineReach,
|
||||||
next=3,
|
nextCount=3,
|
||||||
ospin=false,
|
ospin=false,
|
||||||
freshLimit=15,
|
freshLimit=15,
|
||||||
bg="glow",bgm="reason",
|
bg="glow",bgm="reason",
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ local function check_LVup(P)
|
|||||||
ENV.target=26
|
ENV.target=26
|
||||||
SFX.play("reach")
|
SFX.play("reach")
|
||||||
elseif T==26 then--Stage 3: dig to bottom
|
elseif T==26 then--Stage 3: dig to bottom
|
||||||
if not P.hd then P.life=P.life+1 end--1 up if ban hold
|
if not P.holdQueue[1]then P.life=P.life+1 end--1 up if ban hold
|
||||||
P.waiting=45
|
P.waiting=45
|
||||||
ENV.skin[1],ENV.skin[2]=ENV.skin[2],ENV.skin[1]
|
ENV.skin[1],ENV.skin[2]=ENV.skin[2],ENV.skin[1]
|
||||||
ENV.skin[3],ENV.skin[4]=ENV.skin[4],ENV.skin[3]
|
ENV.skin[3],ENV.skin[4]=ENV.skin[4],ENV.skin[3]
|
||||||
@@ -135,7 +135,7 @@ return{
|
|||||||
das=5,arr=1,
|
das=5,arr=1,
|
||||||
drop=0,lock=15,
|
drop=0,lock=15,
|
||||||
wait=10,fall=10,
|
wait=10,fall=10,
|
||||||
next=2,
|
nextCount=2,
|
||||||
sequence="his4",
|
sequence="his4",
|
||||||
target=12,dropPiece=check_LVup,
|
target=12,dropPiece=check_LVup,
|
||||||
mission={4,4,4,64},
|
mission={4,4,4,64},
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ end
|
|||||||
return{
|
return{
|
||||||
color=COLOR.red,
|
color=COLOR.red,
|
||||||
env={
|
env={
|
||||||
next=4,
|
nextCount=4,
|
||||||
hold=false,
|
hold=false,
|
||||||
drop=60,lock=60,
|
drop=60,lock=60,
|
||||||
fall=20,
|
fall=20,
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ end
|
|||||||
return{
|
return{
|
||||||
color=COLOR.green,
|
color=COLOR.green,
|
||||||
env={
|
env={
|
||||||
next=4,
|
nextCount=4,
|
||||||
hold=false,
|
hold=false,
|
||||||
drop=120,lock=180,
|
drop=120,lock=180,
|
||||||
fall=20,
|
fall=20,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ return{
|
|||||||
color=COLOR.green,
|
color=COLOR.green,
|
||||||
env={
|
env={
|
||||||
drop=60,lock=60,
|
drop=60,lock=60,
|
||||||
next=0,hold=false,
|
nextCount=0,hold=false,
|
||||||
sequence="rnd",
|
sequence="rnd",
|
||||||
target=40,dropPiece=PLY.check_lineReach,
|
target=40,dropPiece=PLY.check_lineReach,
|
||||||
bg="aura",bgm="waterfall",
|
bg="aura",bgm="waterfall",
|
||||||
|
|||||||
@@ -156,18 +156,121 @@ local function drawNextPreview(P,B)
|
|||||||
end
|
end
|
||||||
end end
|
end end
|
||||||
end
|
end
|
||||||
local function drawHold(P,clr)
|
|
||||||
local B=P.hd.bk
|
|
||||||
local texture=SKIN.curText
|
|
||||||
for i=1,#B do for j=1,#B[1]do
|
|
||||||
if B[i][j]then
|
|
||||||
Draw(texture[clr],30*(j+2.06-#B[1]*.5)-30,-30*(i+1.36-#B*.5))-- drawCell(i+1.36-#B*.5,j+2.06-#B[1]*.5,clr)
|
|
||||||
end
|
|
||||||
end end
|
|
||||||
end
|
|
||||||
|
|
||||||
local draw={}
|
local draw={}
|
||||||
|
|
||||||
|
function draw.drawNext_norm(P)
|
||||||
|
local ENV=P.gameEnv
|
||||||
|
local N=ENV.nextCount*72
|
||||||
|
local texture=SKIN.curText
|
||||||
|
gc.push("transform")
|
||||||
|
gc.translate(316,116)
|
||||||
|
gc.setColor(0,0,0,.4)gc.rectangle("fill",0,-80,124,N+8)
|
||||||
|
gc.setColor(1,1,1)gc.rectangle("line",0,-80,124,N+8)
|
||||||
|
mText(drawableText.next,62,-131)
|
||||||
|
N=1
|
||||||
|
while N<=ENV.nextCount and P.nextQueue[N]do
|
||||||
|
local bk,clr=P.nextQueue[N].bk,P.nextQueue[N].color
|
||||||
|
for i=1,#bk do for j=1,#bk[1] do
|
||||||
|
if bk[i][j]then
|
||||||
|
Draw(texture[clr],30*(j+2.06-#bk[1]*.5)-30,-30*(i+3.76-2.4*N-#bk*.5))-- drawCell(i-2.4*N-#bk*.5,j+12.6-#bk[1]*.5,clr)
|
||||||
|
end
|
||||||
|
end end
|
||||||
|
N=N+1
|
||||||
|
end
|
||||||
|
|
||||||
|
if ENV.bagLine then
|
||||||
|
local L=ENV.bagLen
|
||||||
|
local C=-P.pieceCount%L--Phase
|
||||||
|
gc.setColor(.8,.5,.5)
|
||||||
|
for i=C,N-1,L do
|
||||||
|
local y=72*i-77
|
||||||
|
gc.line(2+P.fieldOff.x,y,120,y)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
gc.pop()
|
||||||
|
end
|
||||||
|
function draw.drawNext_hidden(P)
|
||||||
|
local ENV=P.gameEnv
|
||||||
|
local N=ENV.nextCount*72
|
||||||
|
local texture=SKIN.curText
|
||||||
|
gc.push("transform")
|
||||||
|
gc.translate(316,116)
|
||||||
|
gc.setColor(.5,0,0,.4)gc.rectangle("fill",0,-80,124,N+8)
|
||||||
|
gc.setColor(1,1,1)gc.rectangle("line",0,-80,124,N+8)
|
||||||
|
mText(drawableText.next,62,-131)
|
||||||
|
N=min(ENV.nextStartPos,P.pieceCount+1)
|
||||||
|
while N<=ENV.nextCount and P.nextQueue[N]do
|
||||||
|
local bk,clr=P.nextQueue[N].bk,P.nextQueue[N].color
|
||||||
|
for i=1,#bk do for j=1,#bk[1] do
|
||||||
|
if bk[i][j]then
|
||||||
|
Draw(texture[clr],30*(j+2.06-#bk[1]*.5)-30,-30*(i+3.76-2.4*N-#bk*.5))-- drawCell(i-2.4*N-#bk*.5,j+12.6-#bk[1]*.5,clr)
|
||||||
|
end
|
||||||
|
end end
|
||||||
|
N=N+1
|
||||||
|
end
|
||||||
|
|
||||||
|
if ENV.bagLine then
|
||||||
|
local L=ENV.bagLen
|
||||||
|
local C=-P.pieceCount%L--Phase
|
||||||
|
gc.setColor(.8,.5,.5)
|
||||||
|
for i=C,N-1,L do
|
||||||
|
local y=72*i-77
|
||||||
|
gc.line(2+P.fieldOff.x,y,120,y)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
gc.pop()
|
||||||
|
end
|
||||||
|
|
||||||
|
function draw.drawHold_norm(P)
|
||||||
|
local texture=SKIN.curText
|
||||||
|
gc.push("transform")
|
||||||
|
gc.translate(-140,116)
|
||||||
|
gc.setColor(0,0,0,.4)gc.rectangle("fill",0,-80,124,80)
|
||||||
|
gc.setColor(1,1,1)gc.rectangle("line",0,-80,124,80)
|
||||||
|
if P.holdTime==0 then gc.setColor(.6,.4,.4)end
|
||||||
|
mText(drawableText.hold,62,-131)
|
||||||
|
|
||||||
|
local B=P.holdQueue[1]
|
||||||
|
if B then
|
||||||
|
local bk,clr=B.bk,B.color
|
||||||
|
for i=1,#bk do for j=1,#bk[1]do
|
||||||
|
if bk[i][j]then
|
||||||
|
Draw(texture[clr],30*(j+2.06-#bk[1]*.5)-30,-30*(i+3.76-2.4*1-#bk*.5))-- drawCell(i+1.36-#B*.5,j+2.06-#B[1]*.5,clr)
|
||||||
|
end
|
||||||
|
end end
|
||||||
|
end
|
||||||
|
gc.pop()
|
||||||
|
end
|
||||||
|
function draw.drawHold_multi(P)
|
||||||
|
local ENV=P.gameEnv
|
||||||
|
local N=ENV.holdCount*72
|
||||||
|
local texture=SKIN.curText
|
||||||
|
gc.push("transform")
|
||||||
|
gc.translate(-140,116)
|
||||||
|
gc.setColor(0,0,0,.4)gc.rectangle("fill",0,-80,124,N+8)
|
||||||
|
gc.setColor(1,1,1)gc.rectangle("line",0,-80,124,N+8)
|
||||||
|
if P.holdTime==0 then gc.setColor(.6,.4,.4)end
|
||||||
|
mText(drawableText.hold,62,-131)
|
||||||
|
|
||||||
|
gc.setColor(1,1,1)
|
||||||
|
if P.holdQueue[ENV.holdCount]then
|
||||||
|
N=P.holdTime+1
|
||||||
|
else
|
||||||
|
N=1
|
||||||
|
end
|
||||||
|
for n=1,#P.holdQueue do
|
||||||
|
if n==N then gc.setColor(.6,.4,.4)end
|
||||||
|
local bk,clr=P.holdQueue[n].bk,P.holdQueue[n].color
|
||||||
|
for i=1,#bk do for j=1,#bk[1]do
|
||||||
|
if bk[i][j]then
|
||||||
|
Draw(texture[clr],30*(j+2.06-#bk[1]*.5)-30,-30*(i+3.76-2.4*n-#bk*.5))-- drawCell(i+1.36-#B*.5,j+2.06-#B[1]*.5,clr)
|
||||||
|
end
|
||||||
|
end end
|
||||||
|
end
|
||||||
|
gc.pop()
|
||||||
|
end
|
||||||
|
|
||||||
function draw.drawTargetLine(P,r)
|
function draw.drawTargetLine(P,r)
|
||||||
if r<21+(P.fieldBeneath+P.fieldUp)/30 and r>0 then
|
if r<21+(P.fieldBeneath+P.fieldUp)/30 and r>0 then
|
||||||
gc.setLineWidth(4)
|
gc.setLineWidth(4)
|
||||||
@@ -273,8 +376,8 @@ function draw.norm(P)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--Draw next preview
|
--Draw next preview
|
||||||
if ENV.nextPos and P.next[1]then
|
if ENV.nextPos and P.nextQueue[1]then
|
||||||
drawNextPreview(P,P.next[1].bk)
|
drawNextPreview(P,P.nextQueue[1].bk)
|
||||||
end
|
end
|
||||||
|
|
||||||
gc.setScissor()
|
gc.setScissor()
|
||||||
@@ -346,49 +449,13 @@ function draw.norm(P)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--Draw Hold
|
--Draw Hold
|
||||||
if ENV.hold then
|
P:drawHold()
|
||||||
gc.push("transform")
|
|
||||||
gc.translate(-140,116)
|
|
||||||
gc.setColor(0,0,0,.4)gc.rectangle("fill",0,-80,124,80)
|
|
||||||
gc.setColor(1,1,1)gc.rectangle("line",0,-80,124,80)
|
|
||||||
if P.holded then gc.setColor(.6,.4,.4)end
|
|
||||||
mText(drawableText.hold,62,-131)
|
|
||||||
if P.hd then drawHold(P,P.hd.color)end
|
|
||||||
gc.pop()
|
|
||||||
end
|
|
||||||
|
|
||||||
--Draw Next(s)
|
--Draw Next(s)
|
||||||
local N=ENV.next*72
|
P:drawNext()
|
||||||
if ENV.next>0 then
|
|
||||||
gc.setColor(0,0,0,.4)gc.rectangle("fill",316,36,124,N)
|
|
||||||
gc.setColor(1,1,1)gc.rectangle("line",316,36,124,N)
|
|
||||||
mText(drawableText.next,378,-15)
|
|
||||||
N=1
|
|
||||||
local texture=SKIN.curText
|
|
||||||
while N<=ENV.next and P.next[N]do
|
|
||||||
local bk,clr=P.next[N].bk,P.next[N].color
|
|
||||||
for i=1,#bk do for j=1,#bk[1] do
|
|
||||||
if bk[i][j]then
|
|
||||||
Draw(texture[clr],30*(j+12.6-#bk[1]*.5)-30,-30*(i-2.4*N-#bk*.5))-- drawCell(i-2.4*N-#bk*.5,j+12.6-#bk[1]*.5,clr)
|
|
||||||
end
|
|
||||||
end end
|
|
||||||
N=N+1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--Draw Bagline(s)
|
|
||||||
if ENV.bagLine then
|
|
||||||
local L=ENV.bagLen
|
|
||||||
local C=-P.pieceCount%L--Phase
|
|
||||||
gc.setColor(.8,.5,.5)
|
|
||||||
for i=C,N-1,L do
|
|
||||||
local y=72*i+36
|
|
||||||
gc.line(318+P.fieldOff.x,y,438,y)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--Draw target selecting pad
|
--Draw target selecting pad
|
||||||
if modeEnv.royaleMode then
|
if MODEENV.royaleMode then
|
||||||
if P.atkMode then
|
if P.atkMode then
|
||||||
gc.setColor(1,.8,0,P.swappingAtkMode*.02)
|
gc.setColor(1,.8,0,P.swappingAtkMode*.02)
|
||||||
gc.rectangle("fill",RCPB[2*P.atkMode-1],RCPB[2*P.atkMode],90,35,8,4)
|
gc.rectangle("fill",RCPB[2*P.atkMode-1],RCPB[2*P.atkMode],90,35,8,4)
|
||||||
@@ -539,7 +606,7 @@ function draw.small(P)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--Draw badge
|
--Draw badge
|
||||||
if modeEnv.royaleMode then
|
if MODEENV.royaleMode then
|
||||||
gc.setColor(1,1,1)
|
gc.setColor(1,1,1)
|
||||||
for i=1,P.strength do
|
for i=1,P.strength do
|
||||||
gc.draw(IMG.badgeIcon,12*i-7,4,nil,.5)
|
gc.draw(IMG.badgeIcon,12*i-7,4,nil,.5)
|
||||||
@@ -598,20 +665,22 @@ function draw.demo(P)
|
|||||||
end
|
end
|
||||||
gc.pop()
|
gc.pop()
|
||||||
|
|
||||||
--Draw hold
|
|
||||||
local blockImg=TEXTURE.miniBlock
|
local blockImg=TEXTURE.miniBlock
|
||||||
if P.hd then
|
--Draw hold
|
||||||
local id=P.hd.id
|
local N=1
|
||||||
|
while P.holdQueue[N]do
|
||||||
|
local id=P.holdQueue[N].id
|
||||||
_=P.color[id]
|
_=P.color[id]
|
||||||
gc.setColor(_[1],_[2],_[3],.3)
|
gc.setColor(_[1],_[2],_[3],.3)
|
||||||
_=blockImg[id]
|
_=blockImg[id]
|
||||||
gc.draw(_,15,30,nil,16,nil,0,_:getHeight()*.5)
|
gc.draw(_,15,40*N-10,nil,16,nil,_:getWidth(),_:getHeight()*.5)
|
||||||
|
N=N+1
|
||||||
end
|
end
|
||||||
|
|
||||||
--Draw next
|
--Draw next
|
||||||
local N=1
|
N=1
|
||||||
while N<=ENV.next and P.next[N]do
|
while N<=ENV.nextCount and P.nextQueue[N]do
|
||||||
local id=P.next[N].id
|
local id=P.nextQueue[N].id
|
||||||
_=P.color[id]
|
_=P.color[id]
|
||||||
gc.setColor(_[1],_[2],_[3],.3)
|
gc.setColor(_[1],_[2],_[3],.3)
|
||||||
_=blockImg[id]
|
_=blockImg[id]
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
return{
|
return{
|
||||||
das=10,arr=2,sddas=2,sdarr=2,
|
das=10,
|
||||||
ihs=true,irs=true,ims=true,
|
arr=2,
|
||||||
|
sddas=2,
|
||||||
|
sdarr=2,
|
||||||
|
ihs=true,
|
||||||
|
irs=true,
|
||||||
|
ims=true,
|
||||||
swap=true,
|
swap=true,
|
||||||
|
|
||||||
ghost=.3,center=1,
|
ghost=.3,center=1,
|
||||||
@@ -20,8 +25,8 @@ return{
|
|||||||
drop=60,lock=60,
|
drop=60,lock=60,
|
||||||
wait=0,fall=0,
|
wait=0,fall=0,
|
||||||
bone=false,
|
bone=false,
|
||||||
next=6,
|
nextCount=6,nextStartPos=1,
|
||||||
hold=true,oncehold=true,
|
holdCount=1,oncehold=true,
|
||||||
ospin=true,
|
ospin=true,
|
||||||
RS="TRS",
|
RS="TRS",
|
||||||
sequence="bag",
|
sequence="bag",
|
||||||
|
|||||||
@@ -72,99 +72,12 @@ local function releaseKey_Rec(P,keyID)
|
|||||||
end
|
end
|
||||||
P.keyPressing[keyID]=false
|
P.keyPressing[keyID]=false
|
||||||
end
|
end
|
||||||
local function loadGameEnv(P)--Load gameEnv
|
|
||||||
P.gameEnv={}--Current game setting environment
|
|
||||||
local ENV=P.gameEnv
|
|
||||||
--Load game settings
|
|
||||||
for k,v in next,gameEnv0 do
|
|
||||||
if modeEnv[k]~=nil then
|
|
||||||
v=modeEnv[k] --Mode setting
|
|
||||||
-- DBP("mode-"..k..":"..tostring(v))
|
|
||||||
elseif GAME.setting[k]~=nil then
|
|
||||||
v=GAME.setting[k] --Game setting
|
|
||||||
-- DBP("game-"..k..":"..tostring(v))
|
|
||||||
elseif SETTING[k]~=nil then
|
|
||||||
v=SETTING[k] --Global setting
|
|
||||||
-- DBP("global-"..k..":"..tostring(v))
|
|
||||||
-- else
|
|
||||||
-- DBP("default-"..k..":"..tostring(v))
|
|
||||||
end
|
|
||||||
if type(v)~="table"then--Default setting
|
|
||||||
ENV[k]=v
|
|
||||||
else
|
|
||||||
ENV[k]=copyTable(v)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local function applyGameEnv(P)--Finish gameEnv processing
|
|
||||||
local ENV=P.gameEnv
|
|
||||||
|
|
||||||
P._20G=ENV.drop==0
|
|
||||||
P.dropDelay=ENV.drop
|
|
||||||
P.lockDelay=ENV.lock
|
|
||||||
|
|
||||||
P.color={}
|
|
||||||
for _=1,7 do
|
|
||||||
P.color[_]=SKIN.libColor[ENV.skin[_]]
|
|
||||||
end
|
|
||||||
|
|
||||||
P.life=ENV.life
|
|
||||||
|
|
||||||
P.keyAvailable={true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true}
|
|
||||||
if ENV.noTele then
|
|
||||||
for i=11,20 do
|
|
||||||
if i~=14 then
|
|
||||||
P.keyAvailable[i]=false
|
|
||||||
virtualkey[i].ava=false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
for _,v in next,ENV.keyCancel do
|
|
||||||
P.keyAvailable[v]=false
|
|
||||||
virtualkey[v].ava=false
|
|
||||||
end
|
|
||||||
P:setInvisible(
|
|
||||||
ENV.visible=="show"and -1 or
|
|
||||||
ENV.visible=="time"and 300 or
|
|
||||||
ENV.visible=="fast"and 20 or
|
|
||||||
ENV.visible=="none"and 0
|
|
||||||
)
|
|
||||||
P:set20G(P._20G)
|
|
||||||
P:setHold(ENV.hold)
|
|
||||||
P:setRS(ENV.RS)
|
|
||||||
|
|
||||||
if type(ENV.mission)=="table"then
|
|
||||||
P.curMission=1
|
|
||||||
end
|
|
||||||
|
|
||||||
ENV.das=max(ENV.das,ENV.mindas)
|
|
||||||
ENV.arr=max(ENV.arr,ENV.minarr)
|
|
||||||
ENV.sdarr=max(ENV.sdarr,ENV.minsdarr)
|
|
||||||
ENV.next=min(ENV.next,SETTING.maxNext)
|
|
||||||
|
|
||||||
if ENV.sequence~="bag"and ENV.sequence~="loop"then
|
|
||||||
ENV.bagLine=false
|
|
||||||
else
|
|
||||||
ENV.bagLen=#ENV.bag
|
|
||||||
end
|
|
||||||
|
|
||||||
if ENV.next==0 then ENV.nextPos=false end
|
|
||||||
|
|
||||||
if ENV.lockFX==0 then ENV.lockFX=nil end
|
|
||||||
if ENV.dropFX==0 then ENV.dropFX=nil end
|
|
||||||
if ENV.moveFX==0 then ENV.moveFX=nil end
|
|
||||||
if ENV.clearFX==0 then ENV.clearFX=nil end
|
|
||||||
if ENV.shakeFX==0 then ENV.shakeFX=nil end
|
|
||||||
|
|
||||||
if ENV.ghost==0 then ENV.ghost=nil end
|
|
||||||
if ENV.center==0 then ENV.center=nil end
|
|
||||||
end
|
|
||||||
local function newEmptyPlayer(id,x,y,size)
|
local function newEmptyPlayer(id,x,y,size)
|
||||||
local P={id=id}
|
local P={id=id}
|
||||||
PLAYERS[id]=P
|
PLAYERS[id]=P
|
||||||
PLAYERS.alive[id]=P
|
PLAYERS.alive[id]=P
|
||||||
|
|
||||||
--Inherit functions of player class
|
--Inherit functions of Player class
|
||||||
for k,v in next,Player do P[k]=v end
|
for k,v in next,Player do P[k]=v end
|
||||||
|
|
||||||
if P.id==1 and GAME.recording then
|
if P.id==1 and GAME.recording then
|
||||||
@@ -224,10 +137,10 @@ local function newEmptyPlayer(id,x,y,size)
|
|||||||
--P.cur={bk=matrix[2], id=shapeID, color=colorID, name=nameID}
|
--P.cur={bk=matrix[2], id=shapeID, color=colorID, name=nameID}
|
||||||
--P.sc,P.dir={0,0},0--SpinCenterCoord, direction
|
--P.sc,P.dir={0,0},0--SpinCenterCoord, direction
|
||||||
--P.r,P.c=0,0--row, col
|
--P.r,P.c=0,0--row, col
|
||||||
--P.hd={...},same as P.cur
|
|
||||||
-- P.curX,P.curY,P.imgY,P.minY=0,0,0,0--x,y,ghostY
|
-- P.curX,P.curY,P.imgY,P.minY=0,0,0,0--x,y,ghostY
|
||||||
P.holded=false
|
P.holdQueue={}
|
||||||
P.next={}
|
P.holdTime=0
|
||||||
|
P.nextQueue={}
|
||||||
P.seqData={}
|
P.seqData={}
|
||||||
|
|
||||||
P.freshTime=0
|
P.freshTime=0
|
||||||
@@ -276,6 +189,100 @@ local function newEmptyPlayer(id,x,y,size)
|
|||||||
|
|
||||||
return P
|
return P
|
||||||
end
|
end
|
||||||
|
local function loadGameEnv(P)--Load gameEnv
|
||||||
|
P.gameEnv={}--Current game setting environment
|
||||||
|
local ENV=P.gameEnv
|
||||||
|
local MODOPT=MODOPT
|
||||||
|
local GAME=GAME
|
||||||
|
local SETTING=SETTING
|
||||||
|
--Load game settings
|
||||||
|
for k,v in next,gameEnv0 do
|
||||||
|
if MODOPT[k]~=nil then
|
||||||
|
v=MODOPT[k] --Mod setting
|
||||||
|
-- DBP("mod-"..k..":"..tostring(v))
|
||||||
|
elseif MODEENV[k]~=nil then
|
||||||
|
v=MODEENV[k] --Mode setting
|
||||||
|
-- DBP("mode-"..k..":"..tostring(v))
|
||||||
|
elseif GAME.setting[k]~=nil then
|
||||||
|
v=GAME.setting[k] --Game setting
|
||||||
|
-- DBP("game-"..k..":"..tostring(v))
|
||||||
|
elseif SETTING[k]~=nil then
|
||||||
|
v=SETTING[k] --Global setting
|
||||||
|
-- DBP("global-"..k..":"..tostring(v))
|
||||||
|
-- else
|
||||||
|
-- DBP("default-"..k..":"..tostring(v))
|
||||||
|
end
|
||||||
|
if type(v)~="table"then--Default setting
|
||||||
|
ENV[k]=v
|
||||||
|
else
|
||||||
|
ENV[k]=copyTable(v)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local function applyGameEnv(P)--Finish gameEnv processing
|
||||||
|
local ENV=P.gameEnv
|
||||||
|
|
||||||
|
P._20G=ENV.drop==0
|
||||||
|
P.dropDelay=ENV.drop
|
||||||
|
P.lockDelay=ENV.lock
|
||||||
|
|
||||||
|
P.color={}
|
||||||
|
for _=1,7 do
|
||||||
|
P.color[_]=SKIN.libColor[ENV.skin[_]]
|
||||||
|
end
|
||||||
|
|
||||||
|
P.life=ENV.life
|
||||||
|
|
||||||
|
P.keyAvailable={true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true}
|
||||||
|
if ENV.noTele then
|
||||||
|
for i=11,20 do
|
||||||
|
if i~=14 then
|
||||||
|
P.keyAvailable[i]=false
|
||||||
|
virtualkey[i].ava=false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _,v in next,ENV.keyCancel do
|
||||||
|
P.keyAvailable[v]=false
|
||||||
|
virtualkey[v].ava=false
|
||||||
|
end
|
||||||
|
P:setInvisible(
|
||||||
|
ENV.visible=="show"and -1 or
|
||||||
|
ENV.visible=="time"and 300 or
|
||||||
|
ENV.visible=="fast"and 20 or
|
||||||
|
ENV.visible=="none"and 0
|
||||||
|
)
|
||||||
|
P:set20G(P._20G)
|
||||||
|
P:setHold(ENV.holdCount)
|
||||||
|
P:setNext(ENV.nextCount,ENV.nextStartPos>1)
|
||||||
|
P:setRS(ENV.RS)
|
||||||
|
|
||||||
|
if type(ENV.mission)=="table"then
|
||||||
|
P.curMission=1
|
||||||
|
end
|
||||||
|
|
||||||
|
ENV.das=max(ENV.das,ENV.mindas)
|
||||||
|
ENV.arr=max(ENV.arr,ENV.minarr)
|
||||||
|
ENV.sdarr=max(ENV.sdarr,ENV.minsdarr)
|
||||||
|
ENV.nextCount=min(ENV.nextCount,SETTING.maxNext)
|
||||||
|
|
||||||
|
if ENV.sequence~="bag"and ENV.sequence~="loop"then
|
||||||
|
ENV.bagLine=false
|
||||||
|
else
|
||||||
|
ENV.bagLen=#ENV.bag
|
||||||
|
end
|
||||||
|
|
||||||
|
if ENV.nextCount==0 then ENV.nextPos=false end
|
||||||
|
|
||||||
|
if ENV.lockFX==0 then ENV.lockFX=nil end
|
||||||
|
if ENV.dropFX==0 then ENV.dropFX=nil end
|
||||||
|
if ENV.moveFX==0 then ENV.moveFX=nil end
|
||||||
|
if ENV.clearFX==0 then ENV.clearFX=nil end
|
||||||
|
if ENV.shakeFX==0 then ENV.shakeFX=nil end
|
||||||
|
|
||||||
|
if ENV.ghost==0 then ENV.ghost=nil end
|
||||||
|
if ENV.center==0 then ENV.center=nil end
|
||||||
|
end
|
||||||
--------------------------</Lib Func>--------------------------
|
--------------------------</Lib Func>--------------------------
|
||||||
|
|
||||||
--------------------------<Public>--------------------------
|
--------------------------<Public>--------------------------
|
||||||
@@ -303,48 +310,16 @@ function PLY.newDemoPlayer(id,x,y,size)
|
|||||||
P.control=true
|
P.control=true
|
||||||
P.gameEnv={
|
P.gameEnv={
|
||||||
das=10,arr=2,sddas=2,sdarr=2,
|
das=10,arr=2,sddas=2,sdarr=2,
|
||||||
swap=true,
|
|
||||||
|
|
||||||
ghost=SETTING.ghost,
|
|
||||||
center=SETTING.center,
|
|
||||||
smooth=SETTING.smooth,
|
|
||||||
grid=SETTING.grid,
|
|
||||||
text=SETTING.text,
|
|
||||||
score=SETTING.score,
|
|
||||||
lockFX=SETTING.lockFX,
|
|
||||||
dropFX=SETTING.dropFX,
|
|
||||||
moveFX=SETTING.moveFX,
|
|
||||||
clearFX=SETTING.clearFX,
|
|
||||||
shakeFX=SETTING.shakeFX,
|
|
||||||
|
|
||||||
drop=1e99,lock=1e99,
|
drop=1e99,lock=1e99,
|
||||||
wait=10,fall=20,
|
wait=10,fall=20,
|
||||||
bone=false,
|
|
||||||
next=6,
|
|
||||||
hold=true,oncehold=true,
|
|
||||||
ospin=true,
|
|
||||||
RS="TRS",
|
|
||||||
sequence="bag",
|
|
||||||
bag={1,2,3,4,5,6,7},
|
|
||||||
face={0,0,0,0,0,0,0},
|
|
||||||
skin=copyTable(SETTING.skin),
|
|
||||||
mission=false,
|
|
||||||
|
|
||||||
life=1e99,
|
life=1e99,
|
||||||
pushSpeed=3,
|
|
||||||
block=true,
|
|
||||||
noTele=false,
|
|
||||||
visible="show",
|
|
||||||
freshLimit=1e99,easyFresh=true,
|
|
||||||
|
|
||||||
keyCancel={},
|
|
||||||
mindas=0,minarr=0,minsdarr=0,
|
|
||||||
}
|
}
|
||||||
|
loadGameEnv(P)
|
||||||
applyGameEnv(P)
|
applyGameEnv(P)
|
||||||
prepareSequence(P)
|
prepareSequence(P)
|
||||||
P:loadAI({
|
P:loadAI({
|
||||||
type="CC",
|
type="CC",
|
||||||
next=5,
|
nextCount=5,
|
||||||
hold=true,
|
hold=true,
|
||||||
delay=30,
|
delay=30,
|
||||||
delta=4,
|
delta=4,
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ function Player.createBeam(P,R,send,color)
|
|||||||
local r,g,b=unpack(SKIN.libColor[color])
|
local r,g,b=unpack(SKIN.libColor[color])
|
||||||
r,g,b=r*2,g*2,b*2
|
r,g,b=r*2,g*2,b*2
|
||||||
|
|
||||||
local a=modeEnv.royaleMode and not(P.human or R.human)and .2 or 1
|
local a=MODEENV.royaleMode and not(P.human or R.human)and .2 or 1
|
||||||
SYSFX.newAttack(1-SETTING.atkFX*.1,x1,y1,x2,y2,wid,r,g,b,a*(SETTING.atkFX+2)*.0626)
|
SYSFX.newAttack(1-SETTING.atkFX*.1,x1,y1,x2,y2,wid,r,g,b,a*(SETTING.atkFX+2)*.0626)
|
||||||
end
|
end
|
||||||
--------------------------</FX>--------------------------
|
--------------------------</FX>--------------------------
|
||||||
@@ -113,16 +113,34 @@ function Player.set20G(P,if20g,init)
|
|||||||
virtualkey[7].ava=not if20g
|
virtualkey[7].ava=not if20g
|
||||||
if init and if20g and P.AI_mode=="CC"then CC.switch20G(P)end
|
if init and if20g and P.AI_mode=="CC"then CC.switch20G(P)end
|
||||||
end
|
end
|
||||||
function Player.setHold(P,ifhold)
|
function Player.setHold(P,count)
|
||||||
P.gameEnv.hold=ifhold
|
if not count then
|
||||||
P.keyAvailable[8]=ifhold
|
count=0
|
||||||
virtualkey[8].ava=ifhold
|
elseif count==true then
|
||||||
if not ifhold then
|
count=1
|
||||||
P.hd=nil
|
end
|
||||||
|
P.gameEnv.holdCount=count
|
||||||
|
P.holdTime=count
|
||||||
|
P.keyAvailable[8]=count>0
|
||||||
|
virtualkey[8].ava=count>0
|
||||||
|
if count==0 then
|
||||||
|
P.drawHold=NULL
|
||||||
|
while P.holdQueue[1]do rem(P.holdQueue)end
|
||||||
|
elseif count==1 then
|
||||||
|
P.drawHold=PLY.draw.drawHold_norm
|
||||||
|
else
|
||||||
|
P.drawHold=PLY.draw.drawHold_multi
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player.setNext(P,next)
|
function Player.setNext(P,next,hidden)
|
||||||
P.gameEnv.next=next
|
P.gameEnv.nextCount=next
|
||||||
|
if next==0 then
|
||||||
|
P.drawNext=NULL
|
||||||
|
elseif not hidden then
|
||||||
|
P.drawNext=PLY.draw.drawNext_norm
|
||||||
|
else
|
||||||
|
P.drawNext=PLY.draw.drawNext_hidden
|
||||||
|
end
|
||||||
end
|
end
|
||||||
function Player.setInvisible(P,time)
|
function Player.setInvisible(P,time)
|
||||||
if time<0 then
|
if time<0 then
|
||||||
@@ -510,8 +528,9 @@ function Player.spin(P,d,ifpre)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player.hold(P,ifpre)
|
function Player.hold(P,ifpre)
|
||||||
if not P.holded and (ifpre or P.waiting==-1) and P.gameEnv.hold then
|
if P.holdTime>0 and(ifpre or P.waiting==-1)then
|
||||||
local H,C=P.hd,P.cur
|
local N=#P.holdQueue<P.gameEnv.holdCount and #P.holdQueue+1 or 1
|
||||||
|
local H,C=P.holdQueue[N],P.cur
|
||||||
if not(H or C)then return end
|
if not(H or C)then return end
|
||||||
|
|
||||||
--Finesse check
|
--Finesse check
|
||||||
@@ -524,31 +543,33 @@ function Player.hold(P,ifpre)
|
|||||||
P.spinLast=false
|
P.spinLast=false
|
||||||
P.spinSeq=0
|
P.spinSeq=0
|
||||||
|
|
||||||
P.cur,P.hd=H,C--Swap hold
|
P.cur,P.holdQueue[N]=H,C--Swap hold
|
||||||
H,C=P.hd,P.cur
|
H,C=P.holdQueue[N],P.cur
|
||||||
|
|
||||||
if P.next[1]or C then--Make hold available in fixed sequence
|
if P.nextQueue[1]or C then--Make hold available in fixed sequence
|
||||||
P.holded=P.gameEnv.oncehold
|
if P.gameEnv.oncehold then
|
||||||
|
P.holdTime=P.holdTime-1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if H then
|
if H then
|
||||||
local hid=P.hd.id
|
local hid=P.holdQueue[N].id
|
||||||
P.hd.bk=BLOCKS[hid][P.gameEnv.face[hid]]
|
P.holdQueue[N].bk=BLOCKS[hid][P.gameEnv.face[hid]]
|
||||||
end
|
end
|
||||||
if not C then
|
if not C then
|
||||||
C=rem(P.next,1)
|
C=rem(P.nextQueue,1)
|
||||||
P:newNext()
|
P:newNext()
|
||||||
if C then
|
if C then
|
||||||
P.cur=C
|
P.cur=C
|
||||||
P.pieceCount=P.pieceCount+1
|
P.pieceCount=P.pieceCount+1
|
||||||
if P.AI_mode=="CC"then
|
if P.AI_mode=="CC"then
|
||||||
local next=P.next[P.AIdata.next]
|
local next=P.nextQueue[P.AIdata.nextCount]
|
||||||
if next then
|
if next then
|
||||||
CC.addNext(P.AI_bot,next.id)
|
CC.addNext(P.AI_bot,next.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
P.holded=false
|
P.holdTime=0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if C then
|
if C then
|
||||||
@@ -556,10 +577,14 @@ function Player.hold(P,ifpre)
|
|||||||
P:freshBlock(false,true)
|
P:freshBlock(false,true)
|
||||||
P.dropDelay=P.gameEnv.drop
|
P.dropDelay=P.gameEnv.drop
|
||||||
P.lockDelay=P.gameEnv.lock
|
P.lockDelay=P.gameEnv.lock
|
||||||
P.freshTime=max(P.freshTime-5,0)
|
P.freshTime=max(P.freshTime-5,int(P.gameEnv.freshLimit*(P.gameEnv.holdCount-P.holdTime)/P.gameEnv.holdCount))
|
||||||
if P:ifoverlap(P.cur.bk,P.curX,P.curY)then P:lock()P:lose()end
|
if P:ifoverlap(P.cur.bk,P.curX,P.curY)then P:lock()P:lose()end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if #P.holdQueue==P.gameEnv.holdCount then
|
||||||
|
ins(P.holdQueue,rem(P.holdQueue,1))
|
||||||
|
end
|
||||||
|
|
||||||
if P.sound then
|
if P.sound then
|
||||||
SFX.play(ifpre and"prehold"or"hold")
|
SFX.play(ifpre and"prehold"or"hold")
|
||||||
end
|
end
|
||||||
@@ -569,20 +594,20 @@ end
|
|||||||
|
|
||||||
function Player.getNext(P,n)
|
function Player.getNext(P,n)
|
||||||
local E=P.gameEnv
|
local E=P.gameEnv
|
||||||
ins(P.next,{bk=BLOCKS[n][E.face[n]],id=n,color=E.bone and 17 or E.skin[n],name=n})
|
ins(P.nextQueue,{bk=BLOCKS[n][E.face[n]],id=n,color=E.bone and 17 or E.skin[n],name=n})
|
||||||
end
|
end
|
||||||
function Player.popNext(P)--Pop next queue to hand
|
function Player.popNext(P)--Pop next queue to hand
|
||||||
P.holded=false
|
P.holdTime=P.gameEnv.holdCount
|
||||||
P.spinLast=false
|
P.spinLast=false
|
||||||
P.spinSeq=0
|
P.spinSeq=0
|
||||||
P.ctrlCount=0
|
P.ctrlCount=0
|
||||||
|
|
||||||
P.cur=rem(P.next,1)
|
P.cur=rem(P.nextQueue,1)
|
||||||
P:newNext()
|
P:newNext()
|
||||||
if P.cur then
|
if P.cur then
|
||||||
P.pieceCount=P.pieceCount+1
|
P.pieceCount=P.pieceCount+1
|
||||||
if P.AI_mode=="CC"then
|
if P.AI_mode=="CC"then
|
||||||
local next=P.next[P.AIdata.next]
|
local next=P.nextQueue[P.AIdata.nextCount]
|
||||||
if next then
|
if next then
|
||||||
CC.addNext(P.AI_bot,next.id)
|
CC.addNext(P.AI_bot,next.id)
|
||||||
end
|
end
|
||||||
@@ -873,9 +898,9 @@ do--player:drop()--Place piece
|
|||||||
end
|
end
|
||||||
piece.finePts=finePts
|
piece.finePts=finePts
|
||||||
|
|
||||||
P.stat.finesseRate=P.stat.finesseRate+finePts
|
STAT.finesseRate=STAT.finesseRate+finePts
|
||||||
if finePts<5 then
|
if finePts<5 then
|
||||||
P.stat.extraPiece=P.stat.extraPiece+1
|
STAT.extraPiece=STAT.extraPiece+1
|
||||||
if ENV.fineKill then
|
if ENV.fineKill then
|
||||||
P:lose()
|
P:lose()
|
||||||
end
|
end
|
||||||
@@ -1036,7 +1061,7 @@ do--player:drop()--Place piece
|
|||||||
if P.b2b>1200 then P.b2b=1200 end
|
if P.b2b>1200 then P.b2b=1200 end
|
||||||
|
|
||||||
--Bonus atk/def when focused
|
--Bonus atk/def when focused
|
||||||
if modeEnv.royaleMode then
|
if MODEENV.royaleMode then
|
||||||
local i=min(#P.atker,9)
|
local i=min(#P.atker,9)
|
||||||
if i>1 then
|
if i>1 then
|
||||||
atk=atk+reAtk[i]
|
atk=atk+reAtk[i]
|
||||||
@@ -1061,7 +1086,7 @@ do--player:drop()--Place piece
|
|||||||
off=off+_
|
off=off+_
|
||||||
if send>0 then
|
if send>0 then
|
||||||
local T
|
local T
|
||||||
if modeEnv.royaleMode then
|
if MODEENV.royaleMode then
|
||||||
if P.atkMode==4 then
|
if P.atkMode==4 then
|
||||||
local M=#P.atker
|
local M=#P.atker
|
||||||
if M>0 then
|
if M>0 then
|
||||||
@@ -1218,7 +1243,7 @@ function Player.loadAI(P,AIdata)--Load AI params
|
|||||||
delay=AIdata.delay,
|
delay=AIdata.delay,
|
||||||
delta=AIdata.delta,
|
delta=AIdata.delta,
|
||||||
|
|
||||||
next=AIdata.next,
|
nextCount=AIdata.nextCount,
|
||||||
hold=AIdata.hold,
|
hold=AIdata.hold,
|
||||||
_20G=P._20G,
|
_20G=P._20G,
|
||||||
bag=AIdata.bag,
|
bag=AIdata.bag,
|
||||||
@@ -1229,6 +1254,7 @@ function Player.loadAI(P,AIdata)--Load AI params
|
|||||||
P.AI_delay0=int(P.AI_delay0*.26)
|
P.AI_delay0=int(P.AI_delay0*.26)
|
||||||
end
|
end
|
||||||
if P.AI_mode=="CC"then
|
if P.AI_mode=="CC"then
|
||||||
|
P:setHold(1)
|
||||||
P:setRS("SRS")
|
P:setRS("SRS")
|
||||||
local opt,wei=CC.getConf()
|
local opt,wei=CC.getConf()
|
||||||
CC.fastWeights(wei)
|
CC.fastWeights(wei)
|
||||||
@@ -1238,10 +1264,11 @@ function Player.loadAI(P,AIdata)--Load AI params
|
|||||||
CC.setNode(opt,P.AIdata.node)
|
CC.setNode(opt,P.AIdata.node)
|
||||||
P.AI_bot=CC.new(opt,wei)
|
P.AI_bot=CC.new(opt,wei)
|
||||||
CC.free(opt)CC.free(wei)
|
CC.free(opt)CC.free(wei)
|
||||||
for i=1,AIdata.next do
|
for i=1,AIdata.nextCount do
|
||||||
CC.addNext(P.AI_bot,P.next[i].id)
|
CC.addNext(P.AI_bot,P.nextQueue[i].id)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
P:setHold(1)
|
||||||
P:setRS("TRS")
|
P:setRS("TRS")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1323,7 +1350,7 @@ function Player.win(P,result)
|
|||||||
if P.result then return end
|
if P.result then return end
|
||||||
P:die()
|
P:die()
|
||||||
P.result="WIN"
|
P.result="WIN"
|
||||||
if modeEnv.royaleMode then
|
if MODEENV.royaleMode then
|
||||||
P.modeData.event=1
|
P.modeData.event=1
|
||||||
P:changeAtk()
|
P:changeAtk()
|
||||||
end
|
end
|
||||||
@@ -1331,7 +1358,7 @@ function Player.win(P,result)
|
|||||||
GAME.result=result or"win"
|
GAME.result=result or"win"
|
||||||
SFX.play("win")
|
SFX.play("win")
|
||||||
VOC.play("win")
|
VOC.play("win")
|
||||||
if modeEnv.royaleMode then
|
if MODEENV.royaleMode then
|
||||||
BGM.play("8-bit happiness")
|
BGM.play("8-bit happiness")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1362,7 +1389,7 @@ function Player.lose(P,force)
|
|||||||
|
|
||||||
if P.AI_mode=="CC"then
|
if P.AI_mode=="CC"then
|
||||||
CC.destroy(P.AI_bot)
|
CC.destroy(P.AI_bot)
|
||||||
P.hd=nil
|
while P.holdQueue[1]do rem(P.holdQueue)end
|
||||||
P:loadAI(P.AIdata)
|
P:loadAI(P.AIdata)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1398,7 +1425,7 @@ function Player.lose(P,force)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
P.result="K.O."
|
P.result="K.O."
|
||||||
if modeEnv.royaleMode then
|
if MODEENV.royaleMode then
|
||||||
P:changeAtk()
|
P:changeAtk()
|
||||||
P.modeData.event=#PLAYERS.alive+1
|
P.modeData.event=#PLAYERS.alive+1
|
||||||
P.strength=0
|
P.strength=0
|
||||||
@@ -1440,7 +1467,7 @@ function Player.lose(P,force)
|
|||||||
GAME.result="gameover"
|
GAME.result="gameover"
|
||||||
SFX.play("fail")
|
SFX.play("fail")
|
||||||
VOC.play("lose")
|
VOC.play("lose")
|
||||||
if modeEnv.royaleMode then
|
if MODEENV.royaleMode then
|
||||||
if P.modeData.event==2 then
|
if P.modeData.event==2 then
|
||||||
BGM.play("hay what kind of feeling")
|
BGM.play("hay what kind of feeling")
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ local freshPrepare={
|
|||||||
for i=1,L do
|
for i=1,L do
|
||||||
P.seqData[i]=bag[L+1-i]
|
P.seqData[i]=bag[L+1-i]
|
||||||
end
|
end
|
||||||
while #P.next<6 do
|
while #P.nextQueue<6 do
|
||||||
if P.seqData[1]then
|
if P.seqData[1]then
|
||||||
P:getNext(rem(P.seqData))
|
P:getNext(rem(P.seqData))
|
||||||
else
|
else
|
||||||
@@ -27,7 +27,7 @@ freshMethod={
|
|||||||
none=NULL,
|
none=NULL,
|
||||||
bag=function(P)
|
bag=function(P)
|
||||||
local bag=P.seqData
|
local bag=P.seqData
|
||||||
while #P.next<6 do
|
while #P.nextQueue<6 do
|
||||||
if #bag==0 then--Copy a new bag
|
if #bag==0 then--Copy a new bag
|
||||||
local bag0=P.gameEnv.bag
|
local bag0=P.gameEnv.bag
|
||||||
for i=1,#bag0 do bag[i]=bag0[i]end
|
for i=1,#bag0 do bag[i]=bag0[i]end
|
||||||
@@ -36,7 +36,7 @@ freshMethod={
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
his4=function(P)
|
his4=function(P)
|
||||||
while #P.next<6 do
|
while #P.nextQueue<6 do
|
||||||
local bag=P.gameEnv.bag
|
local bag=P.gameEnv.bag
|
||||||
local L=#bag
|
local L=#bag
|
||||||
for n=1,4 do
|
for n=1,4 do
|
||||||
@@ -51,7 +51,7 @@ freshMethod={
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
rnd=function(P)
|
rnd=function(P)
|
||||||
while #P.next<6 do
|
while #P.nextQueue<6 do
|
||||||
local bag=P.gameEnv.bag
|
local bag=P.gameEnv.bag
|
||||||
local L=#bag
|
local L=#bag
|
||||||
for i=1,4 do
|
for i=1,4 do
|
||||||
@@ -59,14 +59,14 @@ freshMethod={
|
|||||||
repeat
|
repeat
|
||||||
i=bag[P:RND(L)]
|
i=bag[P:RND(L)]
|
||||||
count=count+1
|
count=count+1
|
||||||
until i~=P.next[#P.next].id or count>=L
|
until i~=P.nextQueue[#P.nextQueue].id or count>=L
|
||||||
P:getNext(i)
|
P:getNext(i)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
reverb=function(P)
|
reverb=function(P)
|
||||||
local seq=P.seqData
|
local seq=P.seqData
|
||||||
while #P.next<6 do
|
while #P.nextQueue<6 do
|
||||||
if #seq==0 then
|
if #seq==0 then
|
||||||
local bag0=P.gameEnv.bag
|
local bag0=P.gameEnv.bag
|
||||||
for i=1,#bag0 do seq[i]=bag0[i]end
|
for i=1,#bag0 do seq[i]=bag0[i]end
|
||||||
@@ -87,7 +87,7 @@ freshMethod={
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
loop=function(P)
|
loop=function(P)
|
||||||
while #P.next<6 do
|
while #P.nextQueue<6 do
|
||||||
if #P.seqData==0 then
|
if #P.seqData==0 then
|
||||||
local bag=P.gameEnv.bag
|
local bag=P.gameEnv.bag
|
||||||
local L=#bag
|
local L=#bag
|
||||||
@@ -99,11 +99,11 @@ freshMethod={
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
fixed=function(P)
|
fixed=function(P)
|
||||||
while #P.next<6 do
|
while #P.nextQueue<6 do
|
||||||
if P.seqData[1]then
|
if P.seqData[1]then
|
||||||
P:getNext(rem(P.seqData))
|
P:getNext(rem(P.seqData))
|
||||||
else
|
else
|
||||||
if not(P.cur or P.hd)then P:lose(true)end
|
if not(P.cur or P.holdQueue[1])then P:lose(true)end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ function update.alive(P,dt)
|
|||||||
for i=2,10 do v=v+i*(i-1)*7.2/(_-P.dropTime[i])end
|
for i=2,10 do v=v+i*(i-1)*7.2/(_-P.dropTime[i])end
|
||||||
P.dropSpeed=P.dropSpeed*.99+v*.1
|
P.dropSpeed=P.dropSpeed*.99+v*.1
|
||||||
|
|
||||||
if modeEnv.royaleMode then
|
if MODEENV.royaleMode then
|
||||||
if P.keyPressing[9]then
|
if P.keyPressing[9]then
|
||||||
P.swappingAtkMode=min(P.swappingAtkMode+2,30)
|
P.swappingAtkMode=min(P.swappingAtkMode+2,30)
|
||||||
else
|
else
|
||||||
@@ -313,7 +313,7 @@ function update.dead(P,dt)
|
|||||||
P.keySpeed=P.keySpeed*.96+P.stat.key/P.stat.time*60*.04
|
P.keySpeed=P.keySpeed*.96+P.stat.key/P.stat.time*60*.04
|
||||||
P.dropSpeed=P.dropSpeed*.96+P.stat.piece/P.stat.time*60*.04
|
P.dropSpeed=P.dropSpeed*.96+P.stat.piece/P.stat.time*60*.04
|
||||||
--Final average speeds
|
--Final average speeds
|
||||||
if modeEnv.royaleMode then
|
if MODEENV.royaleMode then
|
||||||
P.swappingAtkMode=min(P.swappingAtkMode+2,30)
|
P.swappingAtkMode=min(P.swappingAtkMode+2,30)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ WIDGET.init("custom_advance",{
|
|||||||
WIDGET.newSwitch({name="bone", x=1190, y=550, disp=WIDGET.lnk_CUSval("bone"), code=WIDGET.lnk_CUSrev("bone")}),
|
WIDGET.newSwitch({name="bone", x=1190, y=550, disp=WIDGET.lnk_CUSval("bone"), code=WIDGET.lnk_CUSrev("bone")}),
|
||||||
|
|
||||||
--Control
|
--Control
|
||||||
WIDGET.newSlider({name="next", x=130, y=410,w=200,unit=6, disp=WIDGET.lnk_CUSval("next"), code=WIDGET.lnk_CUSsto("next")}),
|
WIDGET.newSlider({name="next", x=130, y=410,w=200,unit=6, disp=WIDGET.lnk_CUSval("nextCount"),code=WIDGET.lnk_CUSsto("nextCount")}),
|
||||||
WIDGET.newSwitch({name="hold", x=260, y=480, disp=WIDGET.lnk_CUSval("hold"), code=WIDGET.lnk_CUSrev("hold")}),
|
WIDGET.newSwitch({name="hold", x=260, y=480, disp=WIDGET.lnk_CUSval("hold"), code=WIDGET.lnk_CUSrev("hold")}),
|
||||||
WIDGET.newSwitch({name="oncehold", x=260, y=560, disp=WIDGET.lnk_CUSval("oncehold"), code=WIDGET.lnk_CUSrev("oncehold"),hide=function()return not CUSTOMENV.hold end}),
|
WIDGET.newSwitch({name="oncehold", x=260, y=560, disp=WIDGET.lnk_CUSval("oncehold"), code=WIDGET.lnk_CUSrev("oncehold"),hide=function()return not CUSTOMENV.hold end}),
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ function sceneInit.main()
|
|||||||
}
|
}
|
||||||
BG.set("space")
|
BG.set("space")
|
||||||
|
|
||||||
modeEnv=NONE
|
MODEENV=NONE
|
||||||
--Create demo player
|
--Create demo player
|
||||||
destroyPlayers()
|
destroyPlayers()
|
||||||
GAME.frame=0
|
GAME.frame=0
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ function Tmr.play(dt)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--Fresh royale target
|
--Fresh royale target
|
||||||
if modeEnv.royaleMode and GAME.frame%120==0 then
|
if MODEENV.royaleMode and GAME.frame%120==0 then
|
||||||
freshMostDangerous()
|
freshMostDangerous()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -308,7 +308,7 @@ function Pnt.play()
|
|||||||
gc.setColor(1,1,1)
|
gc.setColor(1,1,1)
|
||||||
if SETTING.VKSwitch then drawVirtualkey()end
|
if SETTING.VKSwitch then drawVirtualkey()end
|
||||||
|
|
||||||
if modeEnv.royaleMode then
|
if MODEENV.royaleMode then
|
||||||
local P=PLAYERS[1]
|
local P=PLAYERS[1]
|
||||||
gc.setLineWidth(5)
|
gc.setLineWidth(5)
|
||||||
gc.setColor(.8,1,0,.2)
|
gc.setColor(.8,1,0,.2)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ function Tick.lose(P)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not modeEnv.royaleMode and #PLAYERS>1 then
|
if not MODEENV.royaleMode and #PLAYERS>1 then
|
||||||
P.y=P.y+P.endCounter*.26
|
P.y=P.y+P.endCounter*.26
|
||||||
P.absFieldY=P.absFieldY+P.endCounter*.26
|
P.absFieldY=P.absFieldY+P.endCounter*.26
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user