Compare commits

...

3 Commits

Author SHA1 Message Date
MrZ_26
b8f57f5a1c 0.8.9 2020-02-19 17:41:23 +08:00
MrZ_26
d02048f0dc 0.8.8 2020-02-18 23:05:10 +08:00
MrZ_26
4da080c6f5 0.8.7 2020-02-14 19:26:57 +08:00
106 changed files with 1500 additions and 976 deletions

BIN
BGM/chlorine.ogg Normal file

Binary file not shown.

Binary file not shown.

BIN
SFX/finesseError.ogg Normal file

Binary file not shown.

View File

@@ -1,10 +1,10 @@
gameVersion="Alpha V0.8.6"
gameVersion="Alpha V0.8.9"
function love.conf(t)
t.identity="Techmino"--Save directory name
t.identity="Techmino"--SaveDir name
t.version="11.1"
t.console=X
t.gammacorrect=X
t.appendidentity=X--Search files in source before save directory
t.console=false
t.gammacorrect=false
t.appendidentity=true--Search files in source before save directory
t.accelerometerjoystick=false--ios/android加速度计=摇杆
t.audio.mixwithsystem=true
@@ -13,23 +13,23 @@ function love.conf(t)
W.icon="/image/icon.png"
W.width,W.height=1280,720
W.minwidth,W.minheight=640,360
W.borderless=X
W.resizable=1
W.borderless=false
W.resizable=true
W.fullscreentype="desktop"--"exclusive"
W.fullscreen=X
W.fullscreen=false
W.vsync=0--0:∞fps
W.msaa=X--The number of samples to use with multi-sampled antialiasing (number)
W.depth=0--Bits per sample in the depth buffer
W.stencil=1--Bits per sample in the stencil buffer
W.msaa=false--num of samples to use with multi-sampled antialiasing
W.depth=0--bits/samp of depth buffer
W.stencil=1--bits/samp of stencil buffer
W.display=1--Monitor ID
W.highdpi=X--Enable high-dpi mode for the window on a Retina display (boolean)
W.highdpi=false--High-dpi mode for the window on a Retina display
W.x,W.y=nil
local M=t.modules
M.window,M.system,M.event=1,1,1
M.audio,M.sound=1,1
M.math,M.data=1,1
M.timer,M.graphics,M.font,M.image=1,1,1,1
M.mouse,M.touch,M.keyboard,M.joystick=1,1,1,1
M.physics,M.thread,M.video=X
M.window,M.system,M.event=true,true,true
M.audio,M.sound=true,true
M.math,M.data=true,true
M.timer,M.graphics,M.font,M.image=true,true,true,true
M.mouse,M.touch,M.keyboard,M.joystick=true,true,true,true
M.physics,M.thread,M.video=false,false,false
end

View File

@@ -22,7 +22,12 @@ function AITemplate(type,speedLV,next,hold,node)
end
-------------------------<Events>-------------------------
local function gameOver()
saveStat()
local M=curMode
if M.pauseLimit and(pauseCount==1 and pauseTime>2.6 or pauseTime>6.26)then
TEXT(text.invalidGame,640,260,80,"flicker",.5)
return
end
local R=M.getRank
if R then
local P=players[1]
@@ -37,27 +42,29 @@ local function gameOver()
modeRanks[m]=modes[m].score and 0 or 6
end
end
saveUnlock()
end
end
local D=M.score(P)
local L=M.records
local p=#L--排名数-1
if p>0 then
::L::
if M.comp(D,L[p])then--是否靠前
p=p-1
if p>0 then
goto L
local D=M.score(P)
local L=M.records
local p=#L--排名数-1
if p>0 then
::L::
if M.comp(D,L[p])then--是否靠前
p=p-1
if p>0 then
goto L
end
end
end
end
if p<10 then
if p==0 then
P:showText(text.newRecord,0,-100,100,"beat",.5)
if p<10 then
if p==0 then
P:showText(text.newRecord,0,-100,100,"beat",.5)
end
D.date=os.date("%Y/%m/%d %H:%M")
ins(L,p+1,D)
if L[11]then L[11]=nil end
saveRecord(M.saveFileName,L)
end
ins(L,p+1,D)
if L[11]then L[11]=nil end
saveRecord(M.saveFileName,L)
end
end
end--Save record
@@ -88,7 +95,7 @@ function Event.win(P,result)
die(P)
P.result="WIN"
if modeEnv.royaleMode then
P.rank=1
P.modeData.event=1
P:changeAtk()
end
if P.human then
@@ -130,8 +137,8 @@ function Event.lose(P)
P.result="K.O."
if modeEnv.royaleMode then
P:changeAtk()
P.rank=#players.alive+1
P:showText(P.rank,0,-120,60,"appear",1,12)
P.modeData.event=#players.alive+1
P:showText(P.modeData.event,0,-120,60,"appear",1,12)
P.strength=0
if P.lastRecv then
local A,i=P,0
@@ -142,7 +149,7 @@ function Event.lose(P)
if P.id==1 or A.id==1 then
P.killMark=A.id==1
end
A.ko,A.badge=A.ko+1,A.badge+P.badge+1
A.modeData.point,A.badge=A.modeData.point+1,A.badge+P.badge+1
for i=A.strength+1,4 do
if A.badge>=royaleData.powerUp[i]then
A.strength=i
@@ -254,91 +261,91 @@ end
-------------------------</Tasks>-------------------------
-------------------------<Modes>--------------------------
modes={
{"sprint_10", id=1, x=0, y=0, shape=1,size=35,unlock={2,3}},
{"sprint_20", id=2, x=-300, y=0, shape=1,size=45,unlock={73,74,75}},
{"sprint_40", id=3, x=0, y=-400, shape=1,size=55,unlock={4,9}},
{"sprint_100", id=4, x=-200, y=-400, shape=1,size=45,unlock={5,7}},
{"sprint_400", id=5, x=-400, y=-400, shape=1,size=35,unlock={6}},
{"sprint_1000", id=6, x=-600, y=-400, shape=1,size=35,unlock={}},
{"drought_normal", id=7, x=-400, y=-200, shape=1,size=35,unlock={8}},
{"drought_lunatic", id=8, x=-600, y=-200, shape=1,size=35,unlock={}},
{"marathon_normal", id=9, x=0, y=-600, shape=1,size=55,unlock={10,11,22,31,36,37,48,68,71,72}},
{"marathon_hard", id=10, x=0, y=-800, shape=1,size=45,unlock={27}},
{"solo_1", id=11, x=-300, y=-1000, shape=1,size=35,unlock={12}},
{"solo_2", id=12, x=-500, y=-1000, shape=1,size=35,unlock={13}},
{"solo_3", id=13, x=-700, y=-1000, shape=1,size=35,unlock={14,16}},
{"solo_4", id=14, x=-900, y=-1000, shape=1,size=35,unlock={15}},
{"solo_5", id=15, x=-1100, y=-1000, shape=1,size=35,unlock={}},
{"techmino49_easy", id=16, x=-900, y=-1200, shape=1,size=35,unlock={17,19}},
{"techmino49_hard", id=17, x=-900, y=-1400, shape=1,size=35,unlock={18}},
{"techmino49_ultimate", id=18, x=-900, y=-1600, shape=1,size=35,unlock={}},
{"sprint_10", id=1, x=0, y=0, size=35,shape=1,icon="timer", unlock={2,3}},
{"sprint_20", id=2, x=-300, y=0, size=45,shape=1,icon="timer", unlock={73,74,75}},
{"sprint_40", id=3, x=0, y=-400, size=55,shape=1,icon="timer", unlock={4,9}},
{"sprint_100", id=4, x=-200, y=-400, size=45,shape=1,icon="timer", unlock={5,7}},
{"sprint_400", id=5, x=-400, y=-400, size=35,shape=1,icon="timer", unlock={6}},
{"sprint_1000", id=6, x=-600, y=-400, size=35,shape=1,icon="timer", unlock={}},
{"drought_normal", id=7, x=-400, y=-200, size=35,shape=1,icon="noI", unlock={8}},
{"drought_lunatic", id=8, x=-600, y=-200, size=35,shape=1,icon="mess", unlock={}},
{"marathon_normal", id=9, x=0, y=-600, size=55,shape=1,icon="flag", unlock={10,11,22,31,36,37,48,68,71,72}},
{"marathon_hard", id=10, x=0, y=-800, size=45,shape=1,icon="flag", unlock={27}},
{"solo_1", id=11, x=-300, y=-1000, size=35,shape=1,icon="solo", unlock={12}},
{"solo_2", id=12, x=-500, y=-1000, size=35,shape=1,icon="solo", unlock={13}},
{"solo_3", id=13, x=-700, y=-1000, size=35,shape=1,icon="solo", unlock={14,16}},
{"solo_4", id=14, x=-900, y=-1000, size=35,shape=1,icon="solo", unlock={15}},
{"solo_5", id=15, x=-1100, y=-1000, size=35,shape=1,icon="solo", unlock={}},
{"techmino49_easy", id=16, x=-900, y=-1200, size=35,shape=1,icon="", unlock={17,19}},
{"techmino49_hard", id=17, x=-900, y=-1400, size=35,shape=1,icon="", unlock={18}},
{"techmino49_ultimate", id=18, x=-900, y=-1600, size=35,shape=1,icon="", unlock={}},
{"techmino99_easy", id=19, x=-1100, y=-1400, shape=1,size=35,unlock={20}},
{"techmino99_hard", id=20, x=-1100, y=-1600, shape=1,size=35,unlock={21}},
{"techmino99_ultimate", id=21, x=-1100, y=-1800, shape=1,size=35,unlock={}},
{"round_1", id=22, x=-300, y=-800, shape=1,size=35,unlock={23}},
{"round_2", id=23, x=-500, y=-800, shape=1,size=35,unlock={24}},
{"round_3", id=24, x=-700, y=-800, shape=1,size=35,unlock={25}},
{"round_4", id=25, x=-900, y=-800, shape=1,size=35,unlock={26}},
{"round_5", id=26, x=-1100, y=-800, shape=1,size=35,unlock={}},
{"techmino99_easy", id=19, x=-1100, y=-1400, size=35,shape=1,icon="", unlock={20}},
{"techmino99_hard", id=20, x=-1100, y=-1600, size=35,shape=1,icon="", unlock={21}},
{"techmino99_ultimate", id=21, x=-1100, y=-1800, size=35,shape=1,icon="", unlock={}},
{"round_1", id=22, x=-300, y=-800, size=35,shape=1,icon="round", unlock={23}},
{"round_2", id=23, x=-500, y=-800, size=35,shape=1,icon="round", unlock={24}},
{"round_3", id=24, x=-700, y=-800, size=35,shape=1,icon="round", unlock={25}},
{"round_4", id=25, x=-900, y=-800, size=35,shape=1,icon="round", unlock={26}},
{"round_5", id=26, x=-1100, y=-800, size=35,shape=1,icon="round", unlock={}},
{"master_beginner", id=27, x=0, y=-1000, shape=1,size=35,unlock={28}},
{"master_adavnce", id=28, x=0, y=-1200, shape=1,size=35,unlock={29,30}},
{"master_final", id=29, x=0, y=-1400, shape=1,size=35,unlock={}},
{"GM", id=30, x=150, y=-1500, shape=1,size=35,unlock={}},
{"master_beginner", id=27, x=0, y=-1000, size=35,shape=1,icon="", unlock={28}},
{"master_adavnce", id=28, x=0, y=-1200, size=35,shape=1,icon="", unlock={29,30}},
{"master_final", id=29, x=0, y=-1400, size=35,shape=1,icon="", unlock={}},
{"GM", id=30, x=150, y=-1500, size=35,shape=1,icon="", unlock={}},
{"blind_easy", id=31, x=150, y=-700, shape=1,size=35,unlock={32}},
{"blind_normal", id=32, x=150, y=-800, shape=1,size=35,unlock={33}},
{"blind_hard", id=33, x=150, y=-900, shape=1,size=35,unlock={34}},
{"blind_lunatic", id=34, x=150, y=-1000, shape=1,size=35,unlock={35}},
{"blind_ultimate", id=35, x=150, y=-1100, shape=1,size=35,unlock={}},
{"blind_easy", id=31, x=150, y=-700, size=35,shape=1,icon="", unlock={32}},
{"blind_normal", id=32, x=150, y=-800, size=35,shape=1,icon="", unlock={33}},
{"blind_hard", id=33, x=150, y=-900, size=35,shape=1,icon="", unlock={34}},
{"blind_lunatic", id=34, x=150, y=-1000, size=35,shape=1,icon="", unlock={35}},
{"blind_ultimate", id=35, x=150, y=-1100, size=35,shape=1,icon="", unlock={}},
{"classic_fast", id=36, x=-300, y=-1200, shape=1,size=35,unlock={}},
{"classic_fast", id=36, x=-300, y=-1200, size=35,shape=2,icon="classic", unlock={}},
{"survivor_easy", id=37, x=300, y=-600, shape=1,size=35,unlock={38}},
{"survivor_normal", id=38, x=500, y=-600, shape=1,size=35,unlock={39,42,44,46}},
{"survivor_hard", id=39, x=700, y=-600, shape=1,size=35,unlock={40}},
{"survivor_lunatic", id=40, x=900, y=-600, shape=1,size=35,unlock={41}},
{"survivor_ultimate", id=41, x=1100, y=-600, shape=1,size=35,unlock={}},
{"attacker_hard", id=42, x=300, y=-800, shape=1,size=35,unlock={43}},
{"attacker_ultimate", id=43, x=300, y=-1000, shape=1,size=35,unlock={}},
{"survivor_easy", id=37, x=300, y=-600, size=35,shape=1,icon="", unlock={38}},
{"survivor_normal", id=38, x=500, y=-600, size=35,shape=1,icon="", unlock={39,42,44,46}},
{"survivor_hard", id=39, x=700, y=-600, size=35,shape=1,icon="", unlock={40}},
{"survivor_lunatic", id=40, x=900, y=-600, size=35,shape=1,icon="", unlock={41}},
{"survivor_ultimate", id=41, x=1100, y=-600, size=35,shape=1,icon="", unlock={}},
{"attacker_hard", id=42, x=300, y=-800, size=35,shape=1,icon="", unlock={43}},
{"attacker_ultimate", id=43, x=300, y=-1000, size=35,shape=1,icon="", unlock={}},
{"defender_normal", id=44, x=500, y=-800, shape=1,size=35,unlock={45}},
{"defender_lunatic", id=45, x=500, y=-1000, shape=1,size=35,unlock={}},
{"defender_normal", id=44, x=500, y=-800, size=35,shape=1,icon="", unlock={45}},
{"defender_lunatic", id=45, x=500, y=-1000, size=35,shape=1,icon="", unlock={}},
{"dig_hard", id=46, x=700, y=-800, shape=1,size=35,unlock={47}},
{"dig_ultimate", id=47, x=700, y=-1000, shape=1,size=35,unlock={}},
{"dig_hard", id=46, x=700, y=-800, size=35,shape=1,icon="", unlock={47}},
{"dig_ultimate", id=47, x=700, y=-1000, size=35,shape=1,icon="", unlock={}},
{"bigbang", id=48, x=400, y=-400, shape=1,size=55,unlock={49,51,56}},
{"c4wtrain_normal", id=49, x=700, y=-400, shape=1,size=35,unlock={50}},
{"c4wtrain_lunatic", id=50, x=900, y=-400, shape=1,size=35,unlock={}},
{"bigbang", id=48, x=400, y=-400, size=55,shape=1,icon="", unlock={49,51,56}},
{"c4wtrain_normal", id=49, x=700, y=-400, size=35,shape=1,icon="", unlock={50}},
{"c4wtrain_lunatic", id=50, x=900, y=-400, size=35,shape=1,icon="", unlock={}},
{"pctrain_normal", id=51, x=700, y=-200, shape=1,size=35,unlock={52,53}},
{"pctrain_lunatic", id=52, x=900, y=-200, shape=1,size=35,unlock={}},
{"pcchallenge_normal", id=53, x=800, y=-100, shape=1,size=35,unlock={54}},
{"pcchallenge_hard", id=54, x=1000, y=-100, shape=1,size=35,unlock={55}},
{"pcchallenge_lunatic", id=55, x=1200, y=-100, shape=1,size=35,unlock={}},
{"tech_normal", id=56, x=400, y=-100, shape=1,size=35,unlock={57,58}},
{"tech_normal+", id=57, x=650, y=150, shape=1,size=35,unlock={64,67}},
{"tech_hard", id=58, x=400, y=50, shape=1,size=35,unlock={59,60}},
{"tech_hard+", id=59, x=250, y=50, shape=1,size=35,unlock={}},
{"tech_lunatic", id=60, x=400, y=200, shape=1,size=35,unlock={61,62}},
{"tech_lunatic+", id=61, x=250, y=200, shape=1,size=35,unlock={}},
{"tech_ultimate", id=62, x=400, y=350, shape=1,size=35,unlock={63}},
{"tech_ultimate+", id=63, x=250, y=350, shape=1,size=35,unlock={}},
{"tsd_easy", id=64, x=800, y=200, shape=1,size=35,unlock={65}},
{"tsd_hard", id=65, x=1000, y=200, shape=1,size=35,unlock={66}},
{"tsd_ultimate", id=66, x=1200, y=200, shape=1,size=35,unlock={}},
{"pctrain_normal", id=51, x=700, y=-200, size=35,shape=1,icon="", unlock={52,53}},
{"pctrain_lunatic", id=52, x=900, y=-200, size=35,shape=1,icon="", unlock={}},
{"pcchallenge_normal", id=53, x=800, y=-100, size=35,shape=1,icon="", unlock={54}},
{"pcchallenge_hard", id=54, x=1000, y=-100, size=35,shape=1,icon="", unlock={55}},
{"pcchallenge_lunatic", id=55, x=1200, y=-100, size=35,shape=1,icon="", unlock={}},
{"tech_normal", id=56, x=400, y=-100, size=35,shape=1,icon="", unlock={57,58}},
{"tech_normal+", id=57, x=650, y=150, size=35,shape=1,icon="", unlock={64,67}},
{"tech_hard", id=58, x=400, y=50, size=35,shape=1,icon="", unlock={59,60}},
{"tech_hard+", id=59, x=250, y=50, size=35,shape=1,icon="", unlock={}},
{"tech_lunatic", id=60, x=400, y=200, size=35,shape=1,icon="", unlock={61,62}},
{"tech_lunatic+", id=61, x=250, y=200, size=35,shape=1,icon="", unlock={}},
{"tech_ultimate", id=62, x=400, y=350, size=35,shape=1,icon="", unlock={63}},
{"tech_ultimate+", id=63, x=250, y=350, size=35,shape=1,icon="", unlock={}},
{"tsd_easy", id=64, x=800, y=200, size=35,shape=1,icon="", unlock={65}},
{"tsd_hard", id=65, x=1000, y=200, size=35,shape=1,icon="", unlock={66}},
{"tsd_ultimate", id=66, x=1200, y=200, size=35,shape=1,icon="", unlock={}},
{"ultra", id=67, x=650, y=400, shape=1,size=35,unlock={}},
{"zen", id=68, x=-900, y=-600, shape=1,size=35,unlock={69,70}},
{"infinite", id=69, x=-900, y=-400, shape=1,size=35,unlock={}},
{"infinite_dig", id=70, x=-1100, y=-600, shape=1,size=35,unlock={}},
{"custom_clear", id=71, x=200, y=-350, shape=2,size=45,unlock={}},
{"custom_puzzle", id=72, x=200, y=-200, shape=2,size=45,unlock={}},
{"hotseat_2P", id=73, x=-300, y=200, shape=2,size=45,unlock={}},
{"hotseat_3P", id=74, x=-450, y=200, shape=2,size=45,unlock={}},
{"hotseat_4P", id=75, x=-600, y=200, shape=2,size=45,unlock={}},
{"ultra", id=67, x=650, y=400, size=35,shape=1,icon="", unlock={}},
{"zen", id=68, x=-900, y=-600, size=35,shape=1,icon="zen", unlock={69,70}},
{"infinite", id=69, x=-900, y=-400, size=35,shape=1,icon="", unlock={}},
{"infinite_dig", id=70, x=-1100, y=-600, size=35,shape=1,icon="", unlock={}},
{"custom_clear", id=71, x=200, y=-350, size=45,shape=3,icon="custom", unlock={}},
{"custom_puzzle", id=72, x=200, y=-200, size=45,shape=3,icon="puzzle", unlock={}},
{"hotseat_2P", id=73, x=-300, y=200, size=45,shape=3,icon="", unlock={}},
{"hotseat_3P", id=74, x=-450, y=200, size=45,shape=3,icon="", unlock={}},
{"hotseat_4P", id=75, x=-600, y=200, size=45,shape=3,icon="", unlock={}},
}
modeRanks={}
for i=1,#modes do

View File

@@ -1,7 +1,10 @@
setting={
das=10,arr=2,
sddas=0,sdarr=2,
quickR=true,swap=true,
reTime=10,
maxNext=6,
quickR=true,
swap=true,
fine=false,
--game
@@ -14,13 +17,13 @@ setting={
fullscreen=false,
bg=true,
bgblock=true,
bgspace=true,
lang=1,
skin=1,
--graphic
sfx=10,bgm=7,
vib=3,voc=0,
vib=0,voc=0,
stereo=6,
--sound
@@ -32,12 +35,12 @@ setting={
{},{},{},{},{},{},{},
--joystick
},
VKSwitch=true,
VKTrack=true,--If tracked
VKDodge=false,--If repel
VKTchW=3,--Touch Weight
VKCurW=4,--CurPos Weight
VKIcon=true,
VKSwitch=false,--if disp
VKTrack=false,--if tracked
VKDodge=false,--if dodge
VKTchW=3,--Touch-Pos Weight
VKCurW=4,--Cur-Pos Weight
VKIcon=true,--if disp icon
VKAlpha=3,
--control
}

View File

@@ -11,12 +11,19 @@ spin判定:
细节不赘述
攻击系统:
消1/2/3/4攻击0/1/2/4
spin1/2/3攻击2/4/6,若mini则减半
B2B:增加1~2(techrash)/1~3(spin)攻击
B3B:满B2B效果+1额外抵挡
PC:将其它的伤害之和开根号后向上取整,再+6~10(本局内递增)+2额外抵挡
连击:0,0,1,1,2,2,3,3,4,4,3……
普通消除:
1/2/3/4攻击0.25/1.25/2.25/4
特殊消除:
spin1/2/3攻击2/4/6,若mini则减半
B2B:加1(techrash/spin1/spin2)或2(spin3)攻击
B3B:在B2B效果之上再+1攻击和+1额外抵挡
连击:0,0,1,1,2,2,3,3,4,4,3……
特殊消除会增加B2B点数,让之后的特殊消除获得B2B(B3B)增益(详细说明见下文)
PC:将上述伤害之和开根号,再+6~10(本局内递增)+2额外抵挡(注:本局消行数>4时会将B2B点数拉满)
根据上述规则计算后,向下取整,攻击打出
分数系统:
玩得越牛逼得分越高嗷(
攻击延迟:
消2/3的攻击生效最快,消四其次,spin攻击生效较慢,高连击生效最慢
@@ -27,13 +34,12 @@ spin判定:
没有用上的额外抵挡会被丢弃,最后剩下的攻击力会发送给对手
back to back(B2B)点数说明:
B2B点数的范围在0~1200
在40及以上特殊消除时B2B,在1000以上特殊消除时B3B,1200封顶
消四+100
空spin加20,不超过1000
spin1~3+50/100/180 (mini*.5)
B2B点数的范围在0~1200,在点数>=40时进行特殊消除为B2B,>1000时特殊消除为B3B
普通消除-250
1000以上空放一块-40(不减到低于1000)
spin1/2/3:+50/100/180(mini减半)
消四:+100
空spin:+20,此法得到的点数不能超过1000
当点数在1000以上时空放一块-40(不减到低于1000)
混战模式说明:
许多玩家同时进行一局游戏对手都是AI,不是真人).随着玩家数量的减少,方块下落/垃圾生效速度/垃圾升起速度都会增加.淘汰其它玩家后可以获得一个徽章和该玩家持有的徽章,增强自己的攻击力.

275
file.lua Normal file
View File

@@ -0,0 +1,275 @@
local fs=love.filesystem
local int,max,min=math.floor,math.max,math.min
local sub,find=string.sub,string.find
local toN,toS=tonumber,tostring
local concat=table.concat
local function splitS(s,sep)
local t,n={},1
repeat
local p=find(s,sep)or #s+1
t[n]=sub(s,1,p-1)
n=n+1
s=sub(s,p+#sep)
until #s==0
return t
end
function loadRecord(N)
local F=fs.newFile(N..".dat")
if F:open("r")then
local s=loadstring(F:read())
local T={}
setfenv(s,T)
T[1]=s()
return T[1]
end
end
local function dumpTable(L)
local s="{\n"
for k,v in next,L do
local T
T=type(k)
if T=="number"then k="["..k.."]="
elseif T=="string"then k=k.."="
else error("Error data type!")
end
T=type(v)
if T=="number"then v=tostring(v)
elseif T=="string"then v="\""..v.."\""
elseif T=="table"then v=dumpTable(v)
else error("Error data type!")
end
s=s..k..v..",\n"
end
return s.."}"
end
function saveRecord(N,L)
local F=fs.newFile(N..".dat")
F:open("w")
local _=F:write("return"..dumpTable(L))
F:flush()
F:close()
if not _ then
TEXT(text.recSavingError..mes,640,480,40,"appear",.4)
end
end
function delRecord(N)
fs.remove(N..".dat")
end
function saveUnlock()
local t={}
local RR=modeRanks
for i=1,#RR do
t[i]=RR[i]or"X"
end
t=concat(t,",")
local F=FILE.unlock
F:open("w")
local _=F:write(t)
F:flush()
F:close()
if not _ then
TEXT(text.unlockSavingError..mes,640,480,40,"appear",.4)
end
end
function loadUnlock()
local F=FILE.unlock
F:open("r")
local t=F:read()
F:close()
t=splitS(t,",")
for i=1,#modeRanks do
local v=toN(t[i])
if not v or v<0 or v>6 or v~=int(v)then v=false end
modeRanks[i]=v
end
end
local statOpy={
"run","game","time",
"extraPiece","extraRate",
"key","rotate","hold","piece","row",
"atk","send","recv","pend",
"clear_1","clear_2","clear_3","clear_4",
"spin_0","spin_1","spin_2","spin_3",
"b2b","b3b","pc","score",
}
function loadStat()
local F=FILE.data
F:open("r")
local t=F:read()
F:close()
t=splitS(t,"\r\n")
for i=1,#t do
local p=find(t[i],"=")
if p then
local t,v=sub(t[i],1,p-1),sub(t[i],p+1)
for i=1,#statOpy do
if t==statOpy[i]then
v=toN(v)if not v or v<0 then v=0 end
stat[t]=v
break
end
end
end
end
end
function saveStat()
local t={}
for i=1,#statOpy do
t[i]=statOpy[i].."="..toS(stat[statOpy[i]])
end
t=concat(t,"\r\n")
local F=FILE.data
F:open("w")
local _=F:write(t)
F:flush()
F:close()
if not _ then
TEXT(text.statSavingError..mes,640,480,40,"appear",.4)
end
end
function loadSetting()
local F=FILE.setting
F:open("r")
local t=F:read()
F:close()
t=splitS(t,"\r\n")
for i=1,#t do
local p=find(t[i],"=")
if p then
local t,v=sub(t[i],1,p-1),sub(t[i],p+1)
if--10档的设置
--声音
t=="sfx"or t=="bgm"or t=="voc"or t=="stereo"or
--三个触摸设置项
t=="VKTchW"or t=="VKCurW"or t=="VKAlpha"or
--重开时间
t=="reTime"
then
v=toN(v)
if v and v==int(v)and v>=0 and v<=10 then
setting[t]=v
end
elseif t=="vib"then
setting.vib=toN(v:match("[012345]"))or 0
elseif t=="fullscreen"then
setting.fullscreen=v=="true"
love.window.setFullscreen(setting.fullscreen)
elseif
--开关设置们
t=="bg"or
t=="ghost"or t=="center"or t=="grid"or t=="swap"or
t=="quickR"or t=="fine"or t=="bgspace"or t=="smo"or
t=="VKSwitch"or t=="VKTrack"or t=="VKDodge"or t=="VKIcon"
then
setting[t]=v=="true"
elseif t=="frameMul"then
setting.frameMul=min(max(toN(v)or 100,0),100)
elseif t=="das"or t=="arr"or t=="sddas"or t=="sdarr"then
v=toN(v)if not v or v<0 then v=0 end
setting[t]=int(v)
elseif t=="dropFX"or t=="shakeFX"or t=="atkFX"then
setting[t]=toN(v:match("[012345]"))or 0
elseif t=="lang"then
setting[t]=toN(v:match("[123]"))or 1
elseif t=="skin"then
setting[t]=toN(v:match("[12345678]"))or 1
elseif t=="keymap"then
v=splitS(v,"/")
for i=1,16 do
local v1=splitS(v[i],",")
for j=1,#v1 do
setting.keyMap[i][j]=v1[j]
end
end
elseif t=="VK"then
v=splitS(v,"/")
local SK
for i=1,#v do
if v[i]then
SK=splitS(v[i],",")
local K=VK_org[i]
K.ava=SK[1]=="T"
K.x,K.y,K.r=toN(SK[2]),toN(SK[3]),toN(SK[4])
end
end
elseif t=="lastPlay"then
v=toN(v)
mapCam.lastPlay=v and modeRanks[v]and v or 1
end
end
end
end
local saveOpt={
"das","arr",
"sddas","sdarr",
"reTime",
"quickR",
"swap",
"fine",
"ghost","center",
"smo","grid",
"dropFX",
"shakeFX",
"atkFX",
"frameMul",
"fullscreen",
"bg",
"bgspace",
"lang",
"skin",
"sfx","bgm",
"vib","voc",
"stereo",
"VKSwitch",
"VKTrack",
"VKDodge",
"VKTchW",
"VKCurW",
"VKIcon",
"VKAlpha",
}
function saveSetting()
local vk={}--virtualkey table
for i=1,#VK_org do
local V=VK_org[i]
vk[i]=concat({
V.ava and"T"or"F",
int(V.x+.5),
int(V.y+.5),
V.r,
},",")
end--pre-pack virtualkey setting
local map={}
for i=1,16 do
map[i]=concat(setting.keyMap[i],",")
end
local t={
"keymap="..toS(concat(map,"/")),
"VK="..toS(concat(vk,"/")),
"lastPlay="..mapCam.lastPlay,
}
for i=1,#saveOpt do
t[#t+1]=saveOpt[i].."="..toS(setting[saveOpt[i]])
end
t=concat(t,"\r\n")
local F=FILE.setting
F:open("w")
local _,mes=F:write(t)
F:flush()
F:close()
if _ then
TEXT(text.settingSaved,370,330,30,"appear")
else
TEXT(text.settingSavingError.."123",370,350,20,"appear",.3)
end
end

BIN
font.ttf

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

BIN
image/BG/bg1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
image/mess/speedLimit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
image/modeIcon/custom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 767 B

BIN
image/modeIcon/puzzle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 B

BIN
image/modeIcon/solo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 915 B

BIN
image/modeIcon/timer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
image/modeIcon/zen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -39,7 +39,7 @@ return{
custom="自定义游戏",
customOption={
drop="下落延迟:",
drop="下落速度:",
lock="锁定延迟:",
wait="放块延迟:",
fall="消行延迟:",
@@ -54,7 +54,7 @@ return{
bgm="背景音乐:",
},
customVal={
drop={"[20G]",1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,""},
drop={"0G","1/180G","1/60G","1/40G","1/30G","1/25G","1/20G","1/18G","1/16G","1/14G","1/12G","1/10G","1/9G","1/8G","1/7G","1/6G","1/5G","1/4G","1/3G","1/2G","1G","2G","4G","8G","20G"},
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,
@@ -68,7 +68,7 @@ return{
},
softdropdas="软降DAS:",
softdroparr="软降ARR:",
snapLevelName={"任意摆放","10px吸附","20px吸附","40px吸附","60px吸附","80px吸附"},
snapLevelName={"无吸附","10px吸附","20px吸附","40px吸附","60px吸附","80px吸附"},
keyboard="键盘",joystick="手柄",
space="空格",enter="回车",
ctrlSetHelp="方向键选择/翻页,回车修改,esc返回",
@@ -77,10 +77,11 @@ return{
setting_sound="声音设置",
musicRoom="音乐室",
nowPlaying="正在播放:",
unlockSavingError="解锁保存失败:",
recSavingError="纪录保存失败:",
statSavingError="数据保存失败:",
settingSaved="设置已保存",
settingSavingError="设置保存失败:",
statSavingError="数据保存失败:",
copySuccess="已复制到剪切板",
dataCorrupted="数据损坏",
VKTchW="触摸点权重",
@@ -89,6 +90,8 @@ return{
noScore="暂无成绩",
highScore="最佳成绩",
newRecord="打破纪录",
invalidGame="成绩无效",
errorMsg="Techmino遇到了问题,需要重新启动.\n我们已收集了一些错误信息,你可以向作者进行反馈.",
actName=actName,
@@ -124,6 +127,8 @@ return{
"秘密数字:626",
"CLASSIC SEXY RUSSIAN BLOCKS",
"戴上耳机以获得最佳体验",
"少女祈祷中",
"少女折寿中",
"LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI
"(第一次才准)今日幸运数字:"..math.random(100,626),
},
@@ -171,15 +176,16 @@ return{
]],
support="支持作者",
group="官方QQ群",
warning=" 止 私 自 传 播",
warning="止直接传播游戏本体",
WidgetText={
main={
lang="言/A",
play="开始",
setting="设置",
music="音乐室",
stat="统计信息",
help="帮助",
qplay="快速开始",
lang="言/A",
quit="退出",
},
mode={
@@ -245,6 +251,8 @@ return{
arrD="-",arrU="+",
sddasD="-",sddasU="+",
sdarrD="-",sdarrU="+",
reTime="开局等待时间",
maxNext="最大预览数量",
quickR="快速重新开始",
swap="组合键切换攻击模式",
fine="极简操作提示音",
@@ -260,7 +268,7 @@ return{
center="旋转中心",
skin="皮肤",
bg="背景",
bgblock="背景动画",
bgspace="星空背景",
smo="平滑下落",
dropFX="下落特效等级",
shakeFX="晃动特效等级",

View File

@@ -39,7 +39,7 @@ return{
custom="自定义游戏",
customOption={
drop="下落延迟:",
drop="下落速度:",
lock="锁定延迟:",
wait="放块延迟:",
fall="消行延迟:",
@@ -54,7 +54,7 @@ return{
bgm="背景音乐:",
},
customVal={
drop={"[20G]",1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,""},
drop={"0G","1/180G","1/60G","1/40G","1/30G","1/25G","1/20G","1/18G","1/16G","1/14G","1/12G","1/10G","1/9G","1/8G","1/7G","1/6G","1/5G","1/4G","1/3G","1/2G","1G","2G","4G","8G","20G"},
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,
@@ -68,7 +68,7 @@ return{
},
softdropdas="软降DAS:",
softdroparr="软降ARR:",
snapLevelName={"任意摆放","10px吸附","20px吸附","40px吸附","60px吸附","80px吸附"},
snapLevelName={"无吸附","10px吸附","20px吸附","40px吸附","60px吸附","80px吸附"},
keyboard="键盘",joystick="手柄",
space="空格",enter="回车",
ctrlSetHelp="方向键选择/翻页,回车修改,esc返回",
@@ -77,10 +77,11 @@ return{
setting_sound="声音设置",
musicRoom="音乐室",
nowPlaying="正在播放:",
unlockSavingError="解锁保存失败:",
recSavingError="纪录保存失败:",
statSavingError="数据保存失败:",
settingSaved="设置已保存",
settingSavingError="设置保存失败:",
statSavingError="数据保存失败:",
copySuccess="已复制到剪切板",
dataCorrupted="数据损坏",
VKTchW="触摸点权重",
@@ -89,6 +90,8 @@ return{
noScore="暂无成绩",
highScore="最佳成绩",
newRecord="打破纪录",
invalidGame="成绩无效",
errorMsg="Techmino遇到了问题,需要重新启动.\n我们已收集了一些错误信息,你可以向作者进行反馈.",
actName=actName,
@@ -124,6 +127,8 @@ return{
"秘密数字:626",
"CLASSIC SEXY RUSSIAN BLOCKS",
"戴上耳机以获得最佳体验",
"少女祈祷中",
"少女折寿中",
"LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI
"(第一次才准)今日幸运数字:"..math.random(100,626),
},
@@ -171,15 +176,16 @@ return{
]],
support="支持作者",
group="官方QQ群",
warning=" 止 私 自 传 播",
warning="止直接传播游戏本体",
WidgetText={
main={
lang="言/A",
play="开始",
setting="设置",
music="音乐室",
stat="统计信息",
help="帮助",
qplay="快速开始",
lang="言/A",
quit="退出",
},
mode={
@@ -246,6 +252,8 @@ return{
arrD="-",arrU="+",
sddasD="-",sddasU="+",
sdarrD="-",sdarrU="+",
reTime="开局等待时间",
maxNext="最大预览数量",
quickR="快速重新开始",
swap="组合键切换攻击模式",
fine="极简操作提示音",
@@ -261,7 +269,7 @@ return{
center="旋转中心",
skin="皮肤",
bg="背景",
bgblock="背景动画",
bgspace="星空背景",
smo="平滑下落",
dropFX="下落特效等级",
shakeFX="晃动特效等级",

View File

@@ -37,7 +37,7 @@ return{
custom="Custom Game",
customOption={
drop="Drop delay:",
drop="Drop speed:",
lock="Lock delay:",
wait="Next piece delay:",
fall="Clear row delay:",
@@ -52,7 +52,7 @@ return{
bgm="BGM:",
},
customVal={
drop={"[20G]",1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,""},
drop={"0G","1/180G","1/60G","1/40G","1/30G","1/25G","1/20G","1/18G","1/16G","1/14G","1/12G","1/10G","1/9G","1/8G","1/7G","1/6G","1/5G","1/4G","1/3G","1/2G","1G","2G","4G","8G","20G"},
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,
@@ -75,10 +75,11 @@ return{
setting_sound="Sound setting",
musicRoom="Music Room",
nowPlaying="Now Playing:",
unlockSavingError="Failed to save unlock:",
recSavingError="Failed to save record:",
settingSaved="Setting saved",
settingSavingError="Failed to save setting:",
statSavingError="Failed to save stat:",
settingSaved="Setting Saved",
settingSavingError="Failed to save setting:",
copySuccess="Copy Success",
dataCorrupted="Data Corrupted",
VKTchW="Touch weight",
@@ -87,6 +88,8 @@ return{
noScore="No Score Yet",
highScore="Highscore",
newRecord="New Rocord",
invalidGame="Invalid Game",
errorMsg="Techmino ran into a problem and needs to restart.\nWe collected some error info,and you can send them to author.",
actName=actName,
@@ -123,6 +126,8 @@ return{
"Techmino=Technique+Tetromino",
"CLASSIC SEXY RUSSIAN BLOCKS",
"Headphones for better experience",
"少女祈禱中",
"少女折壽中",
"LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI
"(first effective)Your luck number today:"..math.random(100,626),
},
@@ -170,15 +175,16 @@ Lib used:
]],
support="Support Author",
group="Official QQ Group",
warning="DO NOT DISTRIBUTE",
warning="DO NOT SHARE APP",
WidgetText={
main={
lang="言/A",
play="Play",
setting="Settings",
music="Music room",
stat="Statistics",
help="Help",
qplay="qPlay",
lang="言/A",
quit="Quit",
},
mode={
@@ -244,6 +250,8 @@ Lib used:
arrD="-",arrU="+",
sddasD="-",sddasU="+",
sdarrD="-",sdarrU="+",
reTime="Delay before game",
maxNext="Max next count",
quickR="Quick restart",
swap="Combo key to change ATK mode",
fine="Finesse error SFX",
@@ -259,7 +267,7 @@ Lib used:
center="Center",
skin="Skin",
bg="Background",
bgblock="BG animation",
bgspace="BG space",
smo="Smoooth drop",
dropFX="Drop FX level",
shakeFX="Shake FX level",

View File

@@ -59,7 +59,7 @@ blockColor={
sfx={
"welcome",
"click","enter",
"error","error_long",
"finesseError","finesseError_long",
--Stereo sfxs(cannot set position)
"button","swipe",
"ready","start","win","fail","collect",
@@ -72,6 +72,8 @@ sfx={
"spin_0","spin_1","spin_2","spin_3",
"emit","blip_1","blip_2",
"perfectclear",
"error",
--Mono sfxs
}
bgm={
@@ -89,6 +91,7 @@ bgm={
"rockblock",
"8-bit happiness",
"shining terminal",
"chlorine",
"end",
}
voiceBank={}--{{srcs1},{srcs2},...}
@@ -160,7 +163,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},
drop={1e99,180,60,40,30,25,20,18,16,14,12,10,9,8,7,6,5,4,3,2,1,.5,.25,.125,0},
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},

342
main.lua
View File

@@ -2,15 +2,17 @@
第一次搞这么大的工程,参考价值不是很大
如果你有时间并且也热爱俄罗斯方块的话,来看代码或者帮助优化的话欢迎!
]]
math.randomseed(os.time()*626)
local love=love
local ms,kb,tc=love.mouse,love.keyboard,love.touch
local gc,sys=love.graphics,love.system
local Timer=love.timer.getTime
local int,rnd,max,min=math.floor,math.random,math.max,math.min
local abs=math.abs
local rem=table.remove
package.path="?.lua"
NULL=function()end
package.path="?.lua"--boost
function NULL()end
--Libs
-------------------------------------------------------------
system=sys.getOS()
@@ -18,13 +20,16 @@ local xOy=love.math.newTransform()
local mx,my,mouseShow=-20,-20,false
local touching=nil--第一触摸ID
local touchDist=nil
joysticks={}
local devMode=0
players={alive={},human=0}
scr={x=0,y=0,w=nil,h=nil,k=1}
scr={x=0,y=0,w=0,h=0,rad=0,k=1}--x,y,wid,hei,radius,scale K
local scr=scr
mapCam={
sel=nil,--selected mode ID
lastPlay=1,--last played mode ID
x=0,y=0,k=1,--camera pos/k
x1=0,y1=0,k1=1,--camera pos/k shown
--basic paras
@@ -51,13 +56,14 @@ kb.setTextInput(false)
ms.setVisible(false)
--Application Vars
-------------------------------------------------------------
customSel={22,22,1,1,7,3,1,1,8,4,1,1,1}
customSel={1,22,1,1,7,3,1,1,8,4,1,1,1}
preField={h=20}
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
-------------------------------------------------------------
space=require("parts/space")local space=space
setFont=require("parts/font")
blocks=require("parts/mino")
-- require("parts/light")
@@ -67,6 +73,7 @@ require("default_data")
require("class")
require("ai")
require("toolfunc")
require("file")
require("sound")
require("text")
require("list")
@@ -118,19 +125,6 @@ if sys.getPowerInfo()~="unknown"then
end
end
end
local function getNewBlock()
FX_BGblock.ct=FX_BGblock.ct+1
if FX_BGblock.ct==17 then FX_BGblock.ct=1 end
local t=FX_BGblock.list[FX_BGblock.ct]
t.bn,t.size=FX_BGblock.next,2+3*rnd()
t.b=blocks[t.bn][rnd(0,3)]
t.x=rnd(-#t.b[1]*t.size*30+100,1180)
t.y=0
t.ty=720+#t.b*30*t.size
t.v=t.size*(1+rnd())
FX_BGblock.next=FX_BGblock.next%7+1
return t
end
local function onVirtualkey(x,y)
local dist,nearest=1e10
for K=1,#virtualkey do
@@ -221,6 +215,8 @@ local function onMode(x,y)
if M.shape==1 then
if x>M.x-s and x<M.x+s and y>M.y-s and y<M.y+s then return _ end
elseif M.shape==2 then
if abs(x-M.x)+abs(y-M.y)<s then return _ end
elseif M.shape==3 then
if(x-M.x)^2+(y-M.y)^2<s^2 then return _ end
end
end
@@ -438,10 +434,10 @@ function keyDown.draw(key)
end
elseif key=="escape"then
scene.back()
elseif key=="c"then
if kb.isDown("lctrl","rctrl")then copyBoard()end
elseif key=="v"then
if kb.isDown("lctrl","rctrl")then pasteBoard()end
elseif key=="c"and kb.isDown("lctrl","rctrl")then
copyBoard()
elseif key=="v"and kb.isDown("lctrl","rctrl")then
pasteBoard()
else
pen=penKey[key]or pen
end
@@ -455,6 +451,17 @@ function mouseDown.setting_sound(x,y,k)
if t>1 then
VOICE((t<1.5 or t>15)and"doubt"or rnd()<.8 and"happy"or"egg")
sceneTemp.last=Timer()
if rnd()<.26 then
for i=1,#modes do
local M=modes[i]
for i=1,#M.unlock do
local m=M.unlock[i]
modeRanks[m]=modes[m].score and(modeRanks[m]and max(modeRanks[m],0)or 0)or 6
end
end
saveUnlock()
TEXT("DEVMODE:UNLOCKALL",640,360,50,"stretch",.6)
end
end
end
end
@@ -467,7 +474,7 @@ function keyDown.setting_key(key)
if key=="escape"then
if s.kS then
s.kS=false
SFX("error",.5)
SFX("finesseError",.5)
else
scene.back()
end
@@ -514,7 +521,7 @@ function gamepadDown.setting_key(key)
if key=="back"then
if s.jS then
s.jS=false
SFX("error",.5)
SFX("finesseError",.5)
else
scene.back()
end
@@ -797,10 +804,11 @@ local function widgetControl_gamepad(i)
end
local lastX,lastY--last clickDown pos
function love.mousepressed(x,y,k,t,num)
if t then return end
mouseShow=true
if devMode>0 then print(x,y)end
if t or scene.swapping then return end
mx,my=xOy:inverseTransformPoint(x,y)
if devMode>0 then print(mx,my)end
if scene.swapping then return end
if mouseDown[scene.cur]then
mouseDown[scene.cur](mx,my,k)
elseif k==2 then
@@ -815,9 +823,10 @@ function love.mousepressed(x,y,k,t,num)
lastY=my
end
function love.mousemoved(x,y,dx,dy,t)
if t then return end
mouseShow=true
if t or scene.swapping then return end
mx,my=xOy:inverseTransformPoint(x,y)
if scene.swapping then return end
dx,dy=dx/scr.k,dy/scr.k
if mouseMove[scene.cur]then
mouseMove[scene.cur](mx,my,dx,dy)
@@ -835,12 +844,13 @@ function love.mousemoved(x,y,dx,dy,t)
end
end
function love.mousereleased(x,y,k,t,num)
if t or scene.swapping then return end
if t then return end
mx,my=xOy:inverseTransformPoint(x,y)
if t or scene.swapping then return end
if mouseUp[scene.cur]then
mouseUp[scene.cur](mx,my,k)
end
if(mx-lastX)^2+(my-lastY)^2<26 and mouseClick[scene.cur]then
if lastX and(mx-lastX)^2+(my-lastY)^2<26 and mouseClick[scene.cur]then
mouseClick[scene.cur](mx,my,k)
end
end
@@ -857,9 +867,10 @@ function love.touchpressed(id,x,y)
love.touchmoved(id,x,y,0,0)
end
touchDist=nil--reset distance
lastX,lastY=xOy:inverseTransformPoint(x,y)
x,y=xOy:inverseTransformPoint(x,y)
lastX,lastY=x,y
if touchDown[scene.cur]then
touchDown[scene.cur](id,lastX,lastY)
touchDown[scene.cur](id,x,y)
end
end
function love.touchmoved(id,x,y,dx,dy)
@@ -917,6 +928,8 @@ function love.keypressed(i)
elseif i=="q"then
local W=widget_sel
if W then W:getInfo()end
elseif i=="f3"then
error("Techmino:挂了")
elseif widget_sel then
local W=widget_sel
if i=="left"then W.x=W.x-10
@@ -943,6 +956,17 @@ function love.keyreleased(i)
if keyUp[scene.cur]then keyUp[scene.cur](i)end
end
function love.joystickadded(JS)
joysticks[#joysticks+1]=JS
end
function love.joystickremoved(JS)
for i=1,#joysticks do
if joysticks[i]==JS then
rem(joysticks,i)
return
end
end
end
local keyMirror={
dpup="up",
dpdown="down",
@@ -966,9 +990,26 @@ function love.gamepadreleased(joystick,i)
end
end
--[[
function love.joystickpressed(js,k)end
function love.joystickaxis(js,axis,val)end
function love.joystickhat(js,hat,dir)end
function love.joystickpressed(JS,k)
mouseShow=false
if scene.swapping then return end
if gamepadDown[scene.cur]then gamepadDown[scene.cur](i)
elseif keyDown[scene.cur]then keyDown[scene.cur](keyMirror[i]or i)
elseif i=="back"then scene.back()
else widgetControl_gamepad(i)
end
end
function love.joystickreleased(JS,k)
if scene.swapping then return end
if gamepadUp[scene.cur]then gamepadUp[scene.cur](i)
end
end
function love.joystickaxis(JS,axis,val)
end
function love.joystickhat(JS,hat,dir)
end
function love.sendData(data)end
function love.receiveData(id,data)end
]]
@@ -978,6 +1019,7 @@ end
function love.resize(w,h)
love.timer.sleep(.26)
scr.w,scr.h,scr.r=w,h,h/w
scr.rad=(w^2+h^2)^.5
if scr.r>=.5625 then
scr.k=w/1280
scr.x,scr.y=0,(h-w*9/16)*.5
@@ -985,14 +1027,14 @@ function love.resize(w,h)
scr.k=h/720
scr.x,scr.y=(w-h*16/9)*.5,0
end
gc.origin()
xOy=xOy:setTransformation(w*.5,h*.5,nil,scr.k,nil,640,360)
gc.replaceTransform(xOy)
if setting.bgspace then space.new()end
end
function love.focus(f)
if system~="Android" and not f and scene.cur=="play"then pauseGame()end
end
function love.update(dt)
if setting.bgspace then space.update()end
for i=#sysFX,1,-1 do
local S=sysFX[i]
S[2]=S[2]+1
@@ -1002,18 +1044,6 @@ function love.update(dt)
end
end
end
for i=#FX_BGblock,1,-1 do
local B=FX_BGblock[i]
B.y=B.y+B.v
if B.y>B.ty then rem(FX_BGblock,i)end
end
if setting.bgblock then
FX_BGblock.tm=FX_BGblock.tm-1
if FX_BGblock.tm==0 then
FX_BGblock[#FX_BGblock+1]=getNewBlock()
FX_BGblock.tm=rnd(20,30)
end
end
for i=#texts,1,-1 do
local t=texts[i]
t.c=t.c+t.spd
@@ -1069,7 +1099,7 @@ function love.update(dt)
Q.s=Q[2]and 2 or 4
elseif Q.s==2 then--播放1,准备2
if Q[1]:getDuration()-Q[1]:tell()<.08 then
Q[2]=getVoice(Q[2])--Bug:no voice called Q[2](may fixed)
Q[2]=getVoice(Q[2])
Q[2]:setVolume(setting.voc*.1)
Q[2]:play()
Q.s=3
@@ -1082,7 +1112,7 @@ function love.update(dt)
Q.s=Q[2]and 2 or 4
end
elseif Q.s==4 then--最后播放
if not Q[1].isPlaying(Q[1])then--Bug:Q[1] is nil
if not Q[1].isPlaying(Q[1])then
Q[1]=nil
Q.s=0
end
@@ -1092,103 +1122,157 @@ function love.update(dt)
W:update()
end--更新控件
end
function love.errorhandler(msg)
local PUMP,POLL=love.event.pump,love.event.poll
love.mouse.setVisible(true)
love.audio.stop()
local err={"Error:"..msg}
local trace=debug.traceback("",2)
local c=2
for l in string.gmatch(trace,"(.-)\n")do
if c>2 then
if not string.find(l,"boot")then
err[c]=string.gsub(l,"^\t*","")
c=c+1
end
else
err[2]="Traceback"
c=3
end
end
print(table.concat(err,"\n"),1,c-2)
-- err=err:gsub("%[string \"(.-)\"%]","%1")
local CAP
local function _(_)CAP=gc.newImage(_)end
gc.captureScreenshot(_)
local T=true
return function()
PUMP()
for e,a,b in POLL()do
if e=="quit"or a=="escape"then
destroyPlayers()
return 1
elseif a=="return"or a=="start"then
destroyPlayers()
return"restart"
elseif e=="resize"then
love.resize(a,b)
end
end
if T then
if sfx.error then
SFX("error",.8)
end
T=false
else
gc.discard()
gc.clear(.3,.5,.9)
gc.setColor(1,1,1)
gc.push("transform")
gc.replaceTransform(xOy)
gc.draw(CAP,100,365,nil,512/CAP:getWidth(),288/CAP:getHeight())
setFont(120)
gc.print(":(",100,40)
setFont(38)
gc.printf(text.errorMsg,100,200,1280-100)
setFont(20)
gc.print(err[1],626,360)
gc.print("TRACEBACK",626,410)
for i=4,#err-2 do
gc.print(err[i],626,355+20*i)
end
gc.pop()
end
gc.present()
love.timer.sleep(.1)
end
end
local scs={1,2,1,2,1,2,1,2,1,2,1.5,1.5,.5,2.5}
local FPS=love.timer.getFPS
function love.draw()
gc.discard()--SPEED UPUPUP!
Pnt.BG[setting.bg and curBG or"grey"]()
gc.setColor(1,1,1,.2)
for n=1,#FX_BGblock do
local b,img=FX_BGblock[n].b,blockSkin[FX_BGblock[n].bn]
local size=FX_BGblock[n].size
for i=1,#b do for j=1,#b[1]do
if b[i][j]then
gc.draw(img,FX_BGblock[n].x+(j-1)*30*size,FX_BGblock[n].y-i*30*size,nil,size)
if setting.bgspace then
space.draw()
end
gc.push("transform")
gc.replaceTransform(xOy)
if Pnt[scene.cur]then Pnt[scene.cur]()end
for k,W in next,Widget[scene.cur]do
if not(W.hide and W.hide())then
W:draw()
end
end end
end--Draw BG falling blocks
if Pnt[scene.cur]then Pnt[scene.cur]()end
for k,W in next,Widget[scene.cur]do
if not(W.hide and W.hide())then
W:draw()
end
end--Draw widgets
if mouseShow then
local r=Timer()*.5
gc.setColor(1,1,1,min(1-math.abs(1-r%1*2),.3))
r=int(r)%7+1
gc.draw(miniBlock[r],mx,my,Timer()%3.1416*4,20,20,scs[2*r]-.5,#blocks[r][0]-scs[2*r-1]+.5)
gc.setColor(1,1,1,.5)gc.circle("fill",mx,my,5)
gc.setColor(1,1,1)gc.circle("fill",mx,my,3)
end--Awesome mouse!
end--Draw widgets
if mouseShow then
local r=Timer()*.5
gc.setColor(1,1,1,min(1-math.abs(1-r%1*2),.3))
r=int(r)%7+1
gc.draw(miniBlock[r],mx,my,Timer()%3.1416*4,20,20,scs[2*r]-.5,#blocks[r][0]-scs[2*r-1]+.5)
gc.setColor(1,1,1,.5)gc.circle("fill",mx,my,5)
gc.setColor(1,1,1)gc.circle("fill",mx,my,3)
end--Awesome mouse!
gc.setLineWidth(6)
for i=1,#sysFX do
local S=sysFX[i]
if S[1]==0 then
gc.setColor(1,1,1,1-S[2]/S[3])
local r=(10*S[2]/S[3])^1.2
gc.rectangle("line",S[4]-r,S[5]-r,S[6]+2*r,S[7]+2*r)
--按钮波纹
elseif S[1]==1 then
gc.setColor(S[4],S[5],S[6],1-S[2]/S[3])
gc.rectangle("fill",S[7],S[8],S[9],S[10],2)
--开关/滑条残影
end
end--guiFXs
for i=1,#texts do
local t=texts[i]
local p=t.c
gc.setColor(1,1,1,p<.2 and p*5 or p<.8 and 1 or 5-p*5)
setFont(t.font)
t:draw()
end--Floating Texts
gc.pop()
gc.setColor(1,1,1)
if powerInfoCanvas then
gc.draw(powerInfoCanvas)
gc.draw(powerInfoCanvas,0,0,0,scr.k)
end--Power Info
gc.setLineWidth(6)
for i=1,#sysFX do
local S=sysFX[i]
if S[1]==0 then
gc.setColor(1,1,1,1-S[2]/S[3])
local r=(10*S[2]/S[3])^1.2
gc.rectangle("line",S[4]-r,S[5]-r,S[6]+2*r,S[7]+2*r)
--按钮波纹
elseif S[1]==1 then
gc.setColor(S[4],S[5],S[6],1-S[2]/S[3])
gc.rectangle("fill",S[7],S[8],S[9],S[10],2)
--开关/滑条残影
end
end--guiFXs
for i=1,#texts do
local t=texts[i]
local p=t.c
gc.setColor(1,1,1,p<.2 and p*5 or p<.8 and 1 or 5-p*5)
setFont(t.font)
t:draw()
end--Floating Texts
if scene.swapping then
scene.swap.draw(scene.swap.time)
end--Swapping animation
if scr.r~=.5625 then
gc.setColor(0,0,0)
if scr.r>.5625 then
local d=(scr.h-scr.w*9/16)*.5/scr.k
gc.rectangle("fill",0,0,1280,-d)
gc.rectangle("fill",0,720,1280,d)
else--高窗口
local d=(scr.w-scr.h*16/9)*.5/scr.k
gc.rectangle("fill",0,0,-d,720)
gc.rectangle("fill",1280,0,d,720)
end--扁窗口
end--Black side
local _=scene.swap
_.draw(_.time)
end--Scene swapping animation
setFont(15)
gc.setColor(1,1,1)
gc.print(FPS(),5,700)
local _=scr.h-20
gc.print(FPS(),5,_)
if devMode>0 then
gc.setColor(1,devMode==2 and .5 or 1,1)
gc.print("Tasks:"..#Task,5,600)
gc.print("Voices:"..#voiceQueue,5,620)
gc.print("Mouse:"..mx.." "..my,5,640)
gc.print("Free Row:"..#freeRow.."/"..freeRow.L,5,660)
gc.print("Cache used:"..gcinfo(),5,680)
end
gc.setColor(1,1,devMode==2 and .6 or 1)
gc.print("Cache used:"..gcinfo(),5,_-20)
gc.print("Free Row:"..#freeRow.."/"..freeRow.L,5,_-40)
gc.print("Mouse:"..mx.." "..my,5,_-60)
gc.print("Voices:"..#voiceQueue,5,_-80)
gc.print("Tasks:"..#Task,5,_-100)
end--DEV info
end
function love.run()
local T=love.timer
local lastFrame,lastFreshPow=T.getTime(),T.getTime()
local sleep=T.sleep
local lastFrame,lastFreshPow=T.getTime()
local lastFreshPow=lastFrame
local readyDrawFrame=0
local mini=love.window.isMinimized
local PUMP,POLL=love.event.pump,love.event.poll
love.resize(gc.getWidth(),gc.getHeight())
scene.init("load")--Scene Launch
while true do
return function()
PUMP()
for N,a,b,c,d,e in POLL()do
if N=="quit"then
destroyPlayers()
goto END
elseif love[N]then
if love[N]then
love[N](a,b,c,d,e)
elseif N=="quit"then
destroyPlayers()
return 1
end
end
T.step()
@@ -1202,18 +1286,17 @@ function love.run()
end
end
if Timer()-lastFrame<.058 then
T.sleep(.01)
sleep(.01)
end
while Timer()-lastFrame<.0158 do
T.sleep(.001)
end
sleep(.001)
end--try easily control 60FPS
lastFrame=Timer()
if Timer()-lastFreshPow>1 then
updatePowerInfo()
lastFreshPow=Timer()
end
end
::END::
end
-------------------------------------------------------------
local F=love.filesystem
@@ -1237,15 +1320,16 @@ end
FILE={
data=F.newFile("data.dat"),
setting=F.newFile("setting.dat"),
unlock=F.newFile("unlock.dat"),
}
if F.getInfo("unlock.dat")then loadUnlock()end
if F.getInfo("data.dat")then loadStat()end
if F.getInfo("setting.dat")then
loadSetting()
elseif system=="Android"or system=="iOS" then
setting.swap=false
else
setting.VKSwitch=false
setting.VKSwitch=true
setting.vib=3
end
math.randomseed(os.time()*626)
changeLanguage(setting.lang)
changeBlockSkin(setting.skin)

View File

@@ -4,6 +4,7 @@ local function score(P)
local F=false
if P.modeData.point<70 then--if Less then MM
local R=#P.cleared
if R==0 then return end
if R==4 then R=10 end
P.modeData.point=P.modeData.point+R
P.modeData.event=sectionName[int(P.modeData.point*.1)+1]
@@ -12,14 +13,14 @@ end
return{
name={
"",
"",
"GM",
"",
"",
"GrandMaster",
},
level={
"",
"",
"",
"GM",
"GM",
"GM",
},
info={
"成为方块大师",
@@ -42,11 +43,13 @@ return{
Event.win(P,"finish")
end
end,
arr=1,
minarr=1,
bg="game3",bgm="shining terminal",
},
},
slowMark=true,
load=function()
newPlayer(1,340,15)
players[1].modeData.event="M7"
end,
mesDisp=function(P,dx,dy)
mDraw(drawableText.line,-82,300)
@@ -63,6 +66,6 @@ return{
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]>b[2]end,
getRank=function(P)
local P=P.modeData.point
return P==80 and 5 or P>=70 and 4 or P>=60 and 3 or P>=40 and 2 or P>=20 and 1
return P==80 and 5 or P>=70 and 4 or P>=60 and 3 or P>=40 and 2 or P>=20 and 1 or P>=5 and 0
end,
}

View File

@@ -52,6 +52,7 @@ return{
end,
bg="game3",bgm="push",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -66,7 +67,7 @@ return{
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local W=P.modedata.event
return W>100 and 4 or W>=80 and 3 or W>=50 and 2 or W>=20 and 1
local W=P.modeData.event
return W>100 and 4 or W>=80 and 3 or W>=50 and 2 or W>=20 and 1 or W>=5 and 0
end,
}

View File

@@ -60,7 +60,8 @@ return{
end
end,
bg="game4",bgm="shining terminal",
},
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -79,7 +80,7 @@ return{
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local W=P.modedata.event
return W>40 and 4 or W>=30 and 3 or W>=20 and 2 or W>=10 and 1
local W=P.modeData.event
return W>40 and 4 or W>=30 and 3 or W>=20 and 2 or W>=10 and 1 or W>=5 and 0
end,
}

View File

@@ -22,7 +22,7 @@ return{
"All-spin 入门教程",
"All-spin Tutorial!",
},
color=color.grey,
color=color.lightGrey,
env={
drop=1e99,lock=1e99,
hold=false,
@@ -30,12 +30,16 @@ return{
task=nil,
bg="game1",bgm="newera",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
mesDisp=function(P,dx,dy)
setFont(50)
mStr("UNFINISHED",150,100)
for i=1,10 do
mStr("UNFINISHED",-126+35*i,60*i-110)
mStr("UNFINISHED",626-60*i,60*i-90)
end
end,
score=function(P)return{P.modeData.event,P.stat.extraRate}end,
scoreDisp=function(D)return D[1].."Stage "..format("%.2f",D[2]).."%"end,

View File

@@ -1,3 +1,4 @@
local min=math.min
return{
name={
"隐形",
@@ -23,6 +24,7 @@ return{
target=200,
bg="glow",bgm="newera",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -33,7 +35,7 @@ return{
mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340)
end,
score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
@@ -48,7 +50,8 @@ return{
return
L>=150 and 3 or
L>=100 and 2 or
L>=40 and 1
L>=40 and 1 or
L>=1 and 0
end
end,
}

View File

@@ -1,3 +1,4 @@
local min=math.min
return{
name={
"隐形",
@@ -25,6 +26,7 @@ return{
target=200,
bg="rgb",bgm="secret7th",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -35,7 +37,7 @@ return{
mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340)
end,
score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
@@ -50,7 +52,8 @@ return{
return
L>=150 and 3 or
L>=90 and 2 or
L>=40 and 1
L>=40 and 1 or
L>=1 and 0
end
end,
}

View File

@@ -1,3 +1,4 @@
local min=math.min
return{
name={
"隐形",
@@ -25,6 +26,7 @@ return{
target=200,
bg="rgb",bgm="secret8th",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -35,7 +37,7 @@ return{
mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340)
end,
score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
@@ -50,7 +52,8 @@ return{
return
L>=150 and 3 or
L>=100 and 2 or
L>=40 and 1
L>=40 and 1 or
L>=1 and 0
end
end,
}

View File

@@ -1,3 +1,4 @@
local min=math.min
return{
name={
"隐形",
@@ -24,6 +25,7 @@ return{
target=200,
bg="glow",bgm="reason",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -34,7 +36,7 @@ return{
mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340)
end,
score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
@@ -49,7 +51,8 @@ return{
return
L>=150 and 3 or
L>=100 and 2 or
L>=40 and 1
L>=40 and 1 or
L>=1 and 0
end
end,
}

View File

@@ -1,3 +1,4 @@
local min=math.min
return{
name={
"隐形",
@@ -26,6 +27,7 @@ return{
target=200,
bg="rgb",bgm="secret7th",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -36,7 +38,7 @@ return{
mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340)
end,
score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
@@ -46,6 +48,7 @@ return{
L>=100 and 4 or
L>=50 and 3 or
L>=26 and 2 or
L>=10 and 1
L>=10 and 1 or
L>=1 and 0
end,
}

View File

@@ -1,4 +1,4 @@
local rnd=math.random
local rnd,min=math.random,math.min
local function check_c4w(P)
for i=1,#P.cleared do
P.field[#P.field+1]=getNewRow(10)
@@ -38,8 +38,9 @@ return{
drop=5,lock=30,
dropPiece=check_c4w,
freshLimit=15,ospin=false,
bg="rgb",bgm="newera",
bg="rgb",bgm="chlorine",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
local P=players[1]
@@ -65,7 +66,7 @@ return{
mDraw(drawableText.combo,-82,358)
mDraw(drawableText.mxcmb,-82,450)
end,
score=function(P)return{P.combo<=100 and P.combo or 100,P.stat.time}end,
score=function(P)return{min(P.combo,100),P.stat.time}end,
scoreDisp=function(D)return D[1].." Combo "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
@@ -80,7 +81,8 @@ return{
return
L>=70 and 3 or
L>=40 and 2 or
L>=20 and 1
L>=20 and 1 or
L>=5 and 0
end
end,
}

View File

@@ -1,4 +1,4 @@
local rnd=math.random
local rnd,min=math.random,math.min
local function check_c4w(P)
for i=1,#P.cleared do
P.field[#P.field+1]=getNewRow(10)
@@ -36,8 +36,9 @@ return{
drop=30,lock=60,oncehold=false,
dropPiece=check_c4w,
freshLimit=15,ospin=false,
bg="rgb",bgm="newera",
bg="rgb",bgm="chlorine",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
local P=players[1]
@@ -63,7 +64,7 @@ return{
mDraw(drawableText.combo,-82,358)
mDraw(drawableText.mxcmb,-82,450)
end,
score=function(P)return{P.modeData.point<=100 and P.modeData.point or 100,P.stat.time}end,
score=function(P)return{min(P.modeData.point,100),P.stat.time}end,
scoreDisp=function(D)return D[1].." Combo "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
@@ -78,7 +79,8 @@ return{
else
return
L>=60 and 2 or
L>=30 and 1
L>=30 and 1 or
L>=10 and 0
end
end,
}

View File

@@ -40,6 +40,8 @@ return{
target=10,dropPiece=check_LVup,
bg="rgb",bgm="rockblock",
},
pauseLimit=true,
slowMark=true,
load=function()
newPlayer(1,340,15)
end,
@@ -63,6 +65,7 @@ return{
L>=191 and 4 or
L>=110 and 3 or
L>=50 and 2 or
L>=2 and 1
L>=5 and 1 or
L>=1 and 0
end,
}

View File

@@ -53,6 +53,7 @@ return{
end,
bg="game4",bgm="way",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -73,6 +74,7 @@ return{
W>=80 and 4 or
W>=55 and 3 or
W>=30 and 2 or
W>=20 and 1
W>=20 and 1 or
L>=5 and 0
end,
}

View File

@@ -53,6 +53,7 @@ return{
end,
bg="game3",bgm="way",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -73,6 +74,7 @@ return{
W>=100 and 4 or
W>=70 and 3 or
W>=40 and 2 or
W>=10 and 1
W>=10 and 1 or
L>=3 and 0
end,
}

View File

@@ -31,6 +31,7 @@ return{
end,
bg="game2",bgm="push",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -49,6 +50,7 @@ return{
W>=110 and 4 or
W>=80 and 3 or
W>=50 and 2 or
W>=20 and 1
W>=20 and 1 or
L>=5 and 0
end,
}

View File

@@ -29,7 +29,8 @@ return{
end
end,
bg="game2",bgm="secret7th",
},
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -48,6 +49,7 @@ return{
W>=100 and 4 or
W>=80 and 3 or
W>=50 and 2 or
W>=20 and 1
W>=20 and 1 or
L>=5 and 0
end,
}

View File

@@ -1,3 +1,4 @@
local min=math.min
return{
name={
"干旱",
@@ -23,6 +24,7 @@ return{
freshLimit=15,
bg="glow",bgm="reason",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -31,17 +33,23 @@ return{
local R=100-P.stat.row
mStr(R>=0 and R or 0,-82,280)
end,
score=function(P)return{P.stat.row<=100 and P.stat.row or 100,P.stat.time}end,
score=function(P)return{min(P.stat.row,100),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
if P.stat.row<100 then return end
local T=P.stat.time
return
T<=70 and 5 or
T<=110 and 4 or
T<=160 and 3 or
T<=240 and 2 or
1
local L=P.stat.row
if L>=100 then
local T=P.stat.time
return
T<=70 and 5 or
T<=110 and 4 or
T<=160 and 3 or
T<=240 and 2 or
1
else
return
L>=50 and 1 or
L>=10 and 0
end
end,
}

View File

@@ -1,3 +1,4 @@
local min=math.min
return{
name={
"干旱",
@@ -23,6 +24,7 @@ return{
freshLimit=15,
bg="glow",bgm="reason",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -31,17 +33,23 @@ return{
local R=100-P.stat.row
mStr(R>=0 and R or 0,-82,280)
end,
score=function(P)return{P.stat.row<=100 and P.stat.row or 100,P.stat.time}end,
score=function(P)return{min(P.stat.row,100),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
if P.stat.row<100 then return end
local T=P.stat.time
return
T<=65 and 5 or
T<=100 and 4 or
T<=145 and 3 or
T<=220 and 2 or
1
local L=P.stat.row
if L>=100 then
local T=P.stat.time
return
T<=65 and 5 or
T<=100 and 4 or
T<=145 and 3 or
T<=220 and 2 or
1
else
return
L>=50 and 1 or
L>=10 and 0
end
end,
}

View File

@@ -32,7 +32,7 @@ return{
mDraw(drawableText.eff,-82,425)
end,
score=function(P)return{P.stat.score}end,
scoreDisp=function(D)return D[1]end,
scoreDisp=function(D)return tostring(D[1])end,
comp=function(a,b)return a[1]>b[1]end,
getRank=function(P)
local L=P.stat.row
@@ -41,6 +41,7 @@ return{
L>=1500 and 4 or
L>=1000 and 3 or
L>=500 and 2 or
L>=100 and 1
L>=100 and 1 or
L>=20 and 0
end,
}

View File

@@ -58,6 +58,7 @@ return{
L>=400 and 4 or
L>=200 and 3 or
L>=100 and 2 or
L>=10 and 1
L>=40 and 1 or
L>=5 and 0
end,
}

View File

@@ -1,7 +1,16 @@
local gc=love.graphics
local function check(P)
if P.stat.row>=200 then
Event.win(P,"finish")
if P.stat.row>=P.gameEnv.target then
local T=P.gameEnv.target
if T==50 then
P.gameEnv.drop=.25
P.gameEnv.target=100
elseif T==100 then
P.gameEnv._20G=true
P.gameEnv.target=200
else
Event.win(P,"finish")
end
end
end
@@ -23,17 +32,20 @@ return{
},
color=color.magenta,
env={
_20G=true,fall=15,
dropPiece=check,
drop=.5,fall=30,
target=50,dropPiece=check,
mindas=7,minarr=1,minsdarr=1,
bg="strap",bgm="race",
},
pauseLimit=true,
slowMark=true,
load=function()
newPlayer(1,340,15)
end,
mesDisp=function(P,dx,dy)
setFont(45)
mStr(P.stat.row,-82,320)
mStr(200,-82,370)
mStr(P.gameEnv.target,-82,370)
gc.rectangle("fill",-125,375,90,4)
end,
score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end,
@@ -45,12 +57,13 @@ return{
local T=P.stat.time
return
T<=200 and 5 or
T<=260 and 4 or
T<=270 and 4 or
3
else
return
L>=100 and 2 or
L>=50 and 1
L>=50 and 1 or
L>=10 and 0
end
end,
}

View File

@@ -1,15 +1,14 @@
local gc=love.graphics
local marathon_drop={[0]=60,48,40,30,24,18,15,12,10,8,7,6,5,4,3,2,1,1,0,0}
local dropSpeed={[0]=60,50,40,30,25,20,15,12,9,7,5,4,3,2,1,1,.5,.5,.25,.25}
local function check_LVup(P)
local T=P.modeData.point+10
if P.stat.row>=T then
if T==200 then
Event.win(P,"finish")
else
P.gameEnv.drop=marathon_drop[T/10]
if T==180 then P.gameEnv._20G=true end
SFX("reach")
P.gameEnv.drop=dropSpeed[T/10]
P.modeData.point=T
SFX("reach")
end
end
end
@@ -32,10 +31,14 @@ return{
},
color=color.green,
env={
drop=60,fall=20,
fall=30,
target=10,dropPiece=check_LVup,
mindas=7,minarr=1,minsdarr=1,
minsdarr=1,
bg="strap",bgm="way",
},
pauseLimit=true,
slowMark=true,
load=function()
newPlayer(1,340,15)
end,
@@ -53,13 +56,14 @@ return{
if L>=200 then
local T=P.stat.time
return
T<=180 and 5 or
T<=240 and 4 or
T<=185 and 5 or
T<=250 and 4 or
3
else
return
L>=150 and 2 or
L>=100 and 1
L>=100 and 1 or
L>=20 and 0
end
end,
}

View File

@@ -55,10 +55,11 @@ return{
wait=death_wait[1],
fall=death_fall[1],
dropPiece=score,
das=6,arr=1,
mindas=6,minarr=1,
freshLimit=15,
bg="game2",bgm="secret7th",
},
slowMark=true,
load=function()
newPlayer(1,340,15)
end,
@@ -74,18 +75,19 @@ return{
return a[1]>b[1]or(a[1]==b[1]and(a[2]<b[2]or a[2]==b[2]and a[3]<b[3]))
end,
getRank=function(P)
local L=P.stat.row
local L=P.stat.techrash
local S=P.modeData.point
if S==500 then
return
L<=260 and 5 or
L<=320 and 4 or
L>=30 and 5 or
L>=25 and 4 or
3
else
return
S>=426 and 3 or
S>=326 and 2 or
S>=226 and 1
S>=226 and 1 or
S>=50 and 0
end
end,
}

View File

@@ -63,6 +63,7 @@ return{
freshLimit=15,
bg="strap",bgm="secret8th",
},
slowMark=true,
load=function()
newPlayer(1,340,15)
end,
@@ -78,18 +79,19 @@ return{
return a[1]>b[1]or(a[1]==b[1]and(a[2]<b[2]or a[2]==b[2]and a[3]<b[3]))
end,
getRank=function(P)
local L=P.stat.row
local L=P.stat.techrash
local S=P.modeData.point
if S==500 then
return
L<=250 and 5 or
L<=300 and 4 or
L>=30 and 5 or
L>=25 and 4 or
3
else
return
S>=420 and 3 or
S>=250 and 2 or
S>=120 and 1
S>=120 and 1 or
S>=30 and 0
end
end,
}

View File

@@ -54,11 +54,12 @@ return{
_20G=true,lock=12,
wait=10,fall=10,
dropPiece=score,
das=5,arr=1,
mindas=5,minarr=1,
freshLimit=15,
easyFresh=false,bone=true,
bg="none",bgm="shining terminal",
},
slowMark=true,
load=function()
newPlayer(1,340,15)
end,
@@ -79,6 +80,7 @@ return{
S>=800 and 4 or
S>=600 and 3 or
S>=400 and 2 or
S>=200 and 1
S>=200 and 1 or
L>=50 and 0
end,
}

View File

@@ -24,6 +24,7 @@ return{
ospin=false,
bg="rgb",bgm="infinite",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -52,6 +53,7 @@ return{
L>=13 and 4 or
L>=10 and 3 or
L>=7 and 2 or
L>=4 and 1
L>=4 and 1 or
L>=1 and 0
end,
}

View File

@@ -24,6 +24,7 @@ return{
ospin=false,
bg="rgb",bgm="infinite",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -52,6 +53,7 @@ return{
L>=12 and 4 or
L>=9 and 3 or
L>=6 and 2 or
L>=3 and 1
L>=3 and 1 or
L>=1 and 0
end,
}

View File

@@ -23,6 +23,7 @@ return{
ospin=false,
bg="rgb",bgm="newera",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -51,6 +52,7 @@ return{
L>=20 and 4 or
L>=16 and 3 or
L>=13 and 2 or
L>=10 and 1
L>=10 and 1 or
L>=1 and 0
end,
}

View File

@@ -88,8 +88,9 @@ return{
freshLimit=15,
dropPiece=newPC,
ospin=false,
bg="rgb",bgm="newera",
bg="rgb",bgm="chlorine",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
newPC(players[1])
@@ -109,6 +110,7 @@ return{
L>=40 and 4 or
L>=30 and 3 or
L>=20 and 2 or
L>=10 and 1
L>=10 and 1 or
L>=1 and 0
end,
}

View File

@@ -71,8 +71,9 @@ return{
sequence="none",
dropPiece=newPC,
ospin=false,
bg="rgb",bgm="newera",
bg="rgb",bgm="chlorine",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
newPC(players[1])
@@ -92,6 +93,7 @@ return{
L>=60 and 4 or
L>=40 and 3 or
L>=25 and 2 or
L>=15 and 1
L>=15 and 1 or
L>=1 and 0
end,
}

View File

@@ -28,7 +28,7 @@ return{
},
color=color.cyan,
env={
drop=60,lock=60,
drop=1e99,lock=1e99,
oncehold=false,
dropPiece=update_round,
bg="game2",bgm="push",

View File

@@ -28,7 +28,7 @@ return{
},
color=color.green,
env={
drop=60,lock=60,
drop=1e99,lock=1e99,
oncehold=false,
dropPiece=update_round,
bg="game2",bgm="push",

View File

@@ -28,7 +28,7 @@ return{
},
color=color.magenta,
env={
drop=60,lock=60,
drop=1e99,lock=1e99,
oncehold=false,
dropPiece=update_round,
bg="game2",bgm="push",

View File

@@ -28,7 +28,7 @@ return{
},
color=color.red,
env={
drop=60,lock=60,
drop=1e99,lock=1e99,
oncehold=false,
dropPiece=update_round,
bg="game2",bgm="push",

View File

@@ -28,7 +28,7 @@ return{
},
color=color.lightYellow,
env={
drop=60,lock=60,
drop=1e99,lock=1e99,
oncehold=false,
dropPiece=update_round,
bg="game2",bgm="push",

View File

@@ -20,6 +20,7 @@ return{
freshLimit=15,
bg="game2",bgm="race",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
newPlayer(2,965,360,.5,AITemplate("9S",3))

View File

@@ -20,6 +20,7 @@ return{
freshLimit=15,
bg="game2",bgm="race",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
newPlayer(2,965,360,.5,AITemplate("9S",5))

View File

@@ -20,6 +20,7 @@ return{
freshLimit=15,
bg="game2",bgm="race",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
newPlayer(2,965,360,.5,AITemplate("9S",7))

View File

@@ -20,6 +20,7 @@ return{
freshLimit=15,
bg="game2",bgm="race",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
newPlayer(2,965,360,.5,AITemplate("9S",8))

View File

@@ -20,6 +20,7 @@ return{
freshLimit=15,
bg="game2",bgm="race",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
newPlayer(2,965,360,.5,AITemplate("9S",9))

View File

@@ -48,6 +48,7 @@ return{
T<=10 and 4 or
T<=25 and 3 or
T<=40 and 2 or
T<=60 and 1
T<=62 and 1 or
0
end,
}

View File

@@ -48,6 +48,7 @@ return{
T<=90 and 4 or
T<=130 and 3 or
T<=200 and 2 or
T<=270 and 1
T<=270 and 1 or
0
end,
}

View File

@@ -48,6 +48,7 @@ return{
T<=1000 and 4 or
T<=1400 and 3 or
T<=2200 and 2 or
T<=3000 and 1
T<=3000 and 1 or
0
end,
}

View File

@@ -47,7 +47,8 @@ return{
T<=13 and 5 or
T<=18 and 4 or
T<=45 and 3 or
T<=70 and 2 or
T<=100 and 1
T<=80 and 2 or
T<=126 and 1 or
0
end,
}

View File

@@ -44,10 +44,11 @@ return{
if P.stat.row<40 then return end
local T=P.stat.time
return
T<=25 and 5 or
T<=32 and 4 or
T<=26 and 5 or
T<=32.6 and 4 or
T<=40 and 3 or
T<=60 and 2 or
T<=120 and 1
T<=62 and 2 or
T<=183 and 1 or
0
end,
}

View File

@@ -48,6 +48,7 @@ return{
T<=330 and 4 or
T<=420 and 3 or
T<=626 and 2 or
T<=1000 and 1
T<=1000 and 1 or
0
end,
}

View File

@@ -33,15 +33,14 @@ return{
end,
bg="glow",bgm="newera",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
mesDisp=function(P,dx,dy)
mDraw(drawableText.line,-82,300)
mDraw(drawableText.techrash,-82,420)
setFont(75)
mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340)
setFont(65)
mStr(P.modeData.event,-82,310)
mDraw(drawableText.wave,-82,375)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,
@@ -53,6 +52,7 @@ return{
W>=60 and 4 or
W>=45 and 3 or
W>=30 and 2 or
W>=15 and 1
W>=15 and 1 or
W>=5 and 0
end,
}

View File

@@ -38,15 +38,14 @@ return{
end,
bg="glow",bgm="newera",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
mesDisp=function(P,dx,dy)
mDraw(drawableText.line,-82,300)
mDraw(drawableText.techrash,-82,420)
setFont(75)
mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340)
setFont(65)
mStr(P.modeData.event,-82,310)
mDraw(drawableText.wave,-82,375)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,
@@ -58,6 +57,7 @@ return{
W>=60 and 4 or
W>=45 and 3 or
W>=30 and 2 or
W>=15 and 1
W>=15 and 1 or
W>=5 and 0
end,
}

View File

@@ -34,15 +34,14 @@ return{
end,
bg="glow",bgm="newera",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
mesDisp=function(P,dx,dy)
mDraw(drawableText.line,-82,300)
mDraw(drawableText.techrash,-82,420)
setFont(75)
mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340)
setFont(65)
mStr(P.modeData.event,-82,310)
mDraw(drawableText.wave,-82,375)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,
@@ -54,6 +53,7 @@ return{
W>=80 and 4 or
W>=55 and 3 or
W>=30 and 2 or
W>=15 and 1
W>=15 and 1 or
W>=5 and 0
end,
}

View File

@@ -38,15 +38,14 @@ return{
end,
bg="glow",bgm="newera",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
mesDisp=function(P,dx,dy)
mDraw(drawableText.line,-82,300)
mDraw(drawableText.techrash,-82,420)
setFont(75)
mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340)
setFont(65)
mStr(P.modeData.event,-82,310)
mDraw(drawableText.wave,-82,375)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,
@@ -58,6 +57,7 @@ return{
W>=55 and 4 or
W>=45 and 3 or
W>=30 and 2 or
W>=15 and 1
W>=15 and 1 or
W>=5 and 0
end,
}

View File

@@ -40,6 +40,7 @@ return{
end,
bg="rgb",bgm="secret7th",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -58,6 +59,7 @@ return{
W>=26 and 4 or
W>=20 and 3 or
W>=10 and 2 or
W>=5 and 1
W>=5 and 1 or
W>=1 and 0
end,
}

View File

@@ -49,6 +49,7 @@ return{
L>=126 and 4 or
L>=90 and 3 or
L>=60 and 2 or
L>=30 and 1
L>=30 and 1 or
L>=5 and 0
end,
}

View File

@@ -49,6 +49,7 @@ return{
L>=126 and 4 or
L>=90 and 3 or
L>=60 and 2 or
L>=30 and 1
L>=30 and 1 or
L>=5 and 0
end,
}

View File

@@ -49,6 +49,7 @@ return{
L>=140 and 4 or
L>=90 and 3 or
L>=60 and 2 or
L>=30 and 1
L>=30 and 1 or
L>=5 and 0
end,
}

View File

@@ -49,6 +49,7 @@ return{
L>=140 and 4 or
L>=90 and 3 or
L>=60 and 2 or
L>=30 and 1
L>=30 and 1 or
L>=5 and 0
end,
}

View File

@@ -49,6 +49,7 @@ return{
L>=126 and 4 or
L>=80 and 3 or
L>=50 and 2 or
L>=20 and 1
L>=20 and 1 or
L>=5 and 0
end,
}

View File

@@ -49,6 +49,7 @@ return{
L>=126 and 4 or
L>=80 and 3 or
L>=50 and 2 or
L>=20 and 1
L>=20 and 1 or
L>=5 and 0
end,
}

View File

@@ -50,6 +50,7 @@ return{
L>=150 and 4 or
L>=100 and 3 or
L>=70 and 2 or
L>=40 and 1
L>=40 and 1 or
L>=10 and 0
end,
}

View File

@@ -50,6 +50,7 @@ return{
L>=150 and 4 or
L>=100 and 3 or
L>=70 and 2 or
L>=40 and 1
L>=40 and 1 or
L>=10 and 0
end,
}

View File

@@ -56,17 +56,17 @@ return{
local n=2
for i=1,4 do for j=1,6 do
if L[n]then
newPlayer(n,78*i-54,115*j-98,.09,AITemplate("9S",rnd(4,6)))
newPlayer(n,78*i-54,115*j-98,.09,AITemplate("9S",rnd(2,5)))
else
newPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(4,6)-1,2,true,10000))
newPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(2,5)-1,2,true,10000))
end
n=n+1
end end
for i=9,12 do for j=1,6 do
if L[n]then
newPlayer(n,78*i+267,115*j-98,.09,AITemplate("9S",rnd(4,6)))
newPlayer(n,78*i+267,115*j-98,.09,AITemplate("9S",rnd(2,5)))
else
newPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(4,6)-1,2,true,10000))
newPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(2,5)-1,2,true,10000))
end
n=n+1
end end
@@ -74,7 +74,7 @@ return{
mesDisp=function(P,dx,dy)
setFont(35)
mStr(#players.alive.."/49",-82,175)
mStr(P.ko,-70,215)
mStr(P.modeData.point,-70,215)
gc.draw(drawableText.ko,-127,225)
setFont(20)
gc.setColor(1,.5,0,.6)
@@ -86,16 +86,17 @@ return{
gc.draw(badgeIcon,16*i-138,260)
end
end,
score=function(P)return{P.rank,P.ko}end,
score=function(P)return{P.modeData.event,P.modeData.point}end,
scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]>b[2]end,
getRank=function(P)
local R=P.rank
local R=P.modeData.event
return
R==1 and 5 or
R<=3 and 4 or
R<=5 and 3 or
R<=10 and 2 or
R<=15 and 1
R<=15 and 1 or
R<=45 and 0
end,
}

View File

@@ -56,17 +56,17 @@ return{
local n=2
for i=1,4 do for j=1,6 do
if L[n]then
newPlayer(n,78*i-54,115*j-98,.09,AITemplate("9S",rnd(4,8)))
newPlayer(n,78*i-54,115*j-98,.09,AITemplate("9S",rnd(4,7)))
else
newPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(4,8)-1,3,true,20000))
newPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(4,7)-1,3,true,20000))
end
n=n+1
end end
for i=9,12 do for j=1,6 do
if L[n]then
newPlayer(n,78*i+267,115*j-98,.09,AITemplate("9S",rnd(4,8)))
newPlayer(n,78*i+267,115*j-98,.09,AITemplate("9S",rnd(4,7)))
else
newPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(4,8)-1,3,true,20000))
newPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(4,7)-1,3,true,20000))
end
n=n+1
end end
@@ -74,7 +74,7 @@ return{
mesDisp=function(P,dx,dy)
setFont(35)
mStr(#players.alive.."/49",-82,175)
mStr(P.ko,-70,215)
mStr(P.modeData.point,-70,215)
gc.draw(drawableText.ko,-127,225)
setFont(20)
gc.setColor(1,.5,0,.6)
@@ -86,16 +86,17 @@ return{
gc.draw(badgeIcon,16*i-138,260)
end
end,
score=function(P)return{P.rank,P.ko}end,
score=function(P)return{P.modeData.event,P.modeData.point}end,
scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]>b[2]end,
getRank=function(P)
local R=P.rank
local R=P.modeData.event
return
R==1 and 5 or
R==2 and 4 or
R<=4 and 3 or
R<=6 and 2 or
R<=8 and 1
R<=8 and 1 or
R<=45 and 0
end,
}

View File

@@ -74,7 +74,7 @@ return{
mesDisp=function(P,dx,dy)
setFont(35)
mStr(#players.alive.."/49",-82,175)
mStr(P.ko,-70,215)
mStr(P.modeData.point,-70,215)
gc.draw(drawableText.ko,-127,225)
setFont(20)
gc.setColor(1,.5,0,.6)
@@ -86,16 +86,17 @@ return{
gc.draw(badgeIcon,16*i-138,260)
end
end,
score=function(P)return{P.rank,P.ko}end,
score=function(P)return{P.modeData.event,P.modeData.point}end,
scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]>b[2]end,
getRank=function(P)
local R=P.rank
local R=P.modeData.event
return
R==1 and 5 or
R==2 and 4 or
R==3 and 3 or
R==4 and 2 or
R<=6 and 1
R<=6 and 1 or
R<=45 and 0
end,
}

View File

@@ -56,17 +56,17 @@ return{
local n=2
for i=1,7 do for j=1,7 do
if L[n]then
newPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(4,8)))
newPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(2,5)))
else
newPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(4,8)-1,2,true,10000))
newPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(2,5)-1,2,true,10000))
end
n=n+1
end end
for i=15,21 do for j=1,7 do
if L[n]then
newPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(4,8)))
newPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(2,5)))
else
newPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(4,8)-1,2,true,10000))
newPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(2,5)-1,2,true,10000))
end
n=n+1
end end
@@ -74,7 +74,7 @@ return{
mesDisp=function(P,dx,dy)
setFont(35)
mStr(#players.alive.."/99",-82,175)
mStr(P.ko,-70,215)
mStr(P.modeData.point,-70,215)
gc.draw(drawableText.ko,-127,225)
setFont(20)
gc.setColor(1,.5,0,.6)
@@ -86,16 +86,17 @@ return{
gc.draw(badgeIcon,16*i-138,260)
end
end,
score=function(P)return{P.rank,P.ko}end,
score=function(P)return{P.modeData.event,P.modeData.point}end,
scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]>b[2]end,
getRank=function(P)
local R=P.rank
local R=P.modeData.event
return
R==1 and 5 or
R<=3 and 4 or
R<=6 and 3 or
R<=10 and 2 or
R<=20 and 1
R<=20 and 1 or
R<=90 and 0
end,
}

View File

@@ -56,17 +56,17 @@ return{
local n=2
for i=1,7 do for j=1,7 do
if L[n]then
newPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(4,6)))
newPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(4,7)))
else
newPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(4,6)-1,3,true,20000))
newPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(4,7)-1,3,true,20000))
end
n=n+1
end end
for i=15,21 do for j=1,7 do
if L[n]then
newPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(4,6)))
newPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(4,7)))
else
newPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(4,6)-1,3,true,20000))
newPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(4,7)-1,3,true,20000))
end
n=n+1
end end
@@ -74,7 +74,7 @@ return{
mesDisp=function(P,dx,dy)
setFont(35)
mStr(#players.alive.."/99",-82,175)
mStr(P.ko,-70,215)
mStr(P.modeData.point,-70,215)
gc.draw(drawableText.ko,-127,225)
setFont(20)
gc.setColor(1,.5,0,.6)
@@ -86,16 +86,17 @@ return{
gc.draw(badgeIcon,16*i-138,260)
end
end,
score=function(P)return{P.rank,P.ko}end,
score=function(P)return{P.modeData.event,P.modeData.point}end,
scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]>b[2]end,
getRank=function(P)
local R=P.rank
local R=P.modeData.event
return
R==1 and 5 or
R<=3 and 4 or
R<=6 and 3 or
R<=8 and 2 or
R<=10 and 1
R<=10 and 1 or
R<=90 and 0
end,
}

View File

@@ -56,17 +56,17 @@ return{
local n=2
for i=1,7 do for j=1,7 do
if L[n]then
newPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(4,6)))
newPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(8,10)))
else
newPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(4,6)-1,LV+1,true,LV*10000))
newPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(8,10)-1,4,true,30000))
end
n=n+1
end end
for i=15,21 do for j=1,7 do
if L[n]then
newPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(4,6)))
newPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(8,10)))
else
newPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(4,6)-1,LV+1,true,LV*10000))
newPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(8,10)-1,4,true,30000))
end
n=n+1
end end
@@ -74,7 +74,7 @@ return{
mesDisp=function(P,dx,dy)
setFont(35)
mStr(#players.alive.."/99",-82,175)
mStr(P.ko,-70,215)
mStr(P.modeData.point,-70,215)
gc.draw(drawableText.ko,-127,225)
setFont(20)
gc.setColor(1,.5,0,.6)
@@ -86,16 +86,17 @@ return{
gc.draw(badgeIcon,16*i-138,260)
end
end,
score=function(P)return{P.rank,P.ko}end,
score=function(P)return{P.modeData.event,P.modeData.point}end,
scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]>b[2]end,
getRank=function(P)
local R=P.rank
local R=P.modeData.event
return
R==1 and 5 or
R==2 and 4 or
R==3 and 3 or
R<=5 and 2 or
R<=7 and 1
R<=7 and 1 or
R<=90 and 0
end,
}

View File

@@ -32,6 +32,7 @@ return{
ospin=false,
bg="matrix",bgm="reason",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -41,7 +42,7 @@ return{
mDraw(drawableText.tsd,-82,407)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return"NO."..D[1]" KO:"..D[2]end,
scoreDisp=function(D)return D[1].."TSD "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local T=P.modeData.event
@@ -50,6 +51,7 @@ return{
T>=20 and 4 or
T>=15 and 3 or
T>=10 and 2 or
T>=6 and 1
T>=6 and 1 or
T>=1 and 0
end,
}

View File

@@ -32,6 +32,7 @@ return{
ospin=false,
bg="matrix",bgm="reason",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -41,7 +42,7 @@ return{
mDraw(drawableText.tsd,-82,407)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return"NO."..D[1]" KO:"..D[2]end,
scoreDisp=function(D)return D[1].."TSD "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local T=P.modeData.event
@@ -50,6 +51,7 @@ return{
T>=19 and 4 or
T>=16 and 3 or
T>=13 and 2 or
T>=10 and 1
T>=10 and 1 or
T>=1 and 0
end,
}

View File

@@ -32,6 +32,7 @@ return{
ospin=false,
bg="matrix",bgm="reason",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -41,7 +42,7 @@ return{
mDraw(drawableText.tsd,-82,407)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return"NO."..D[1]" KO:"..D[2]end,
scoreDisp=function(D)return D[1].."TSD "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local T=P.modeData.event
@@ -50,6 +51,7 @@ return{
T>=18 and 4 or
T>=16 and 3 or
T>=14 and 2 or
T>=12 and 1
T>=12 and 1 or
T>=1 and 0
end,
}

View File

@@ -1,3 +1,4 @@
local gc=love.graphics
return{
name={
"限时打分",
@@ -24,6 +25,7 @@ return{
end,
bg="matrix",bgm="infinite",
},
pauseLimit=true,
load=function()
newPlayer(1,340,15)
end,
@@ -33,7 +35,7 @@ return{
gc.arc("fill",-40,100,50,0,1)
end,
score=function(P)return{P.score}end,
scoreDisp=function(D)return D[1]end,
scoreDisp=function(D)return tostring(D[1])end,
comp=function(a,b)return a[1]>b[1]end,
getRank=function(P)
local T=P.stat.score

View File

@@ -30,15 +30,15 @@ return{
mStr(R>=0 and R or 0,-82,280)
end,
score=function(P)return{P.stat.score}end,
scoreDisp=function(D)return D[1]end,
scoreDisp=function(D)return tostring(D[1])end,
comp=function(a,b)return a[1]>b[1]end,
getRank=function(P)
local T=P.stat.score
return
T>=1e5 and 5 or
T>=8e4 and 4 or
T>=5e4 and 3 or
T>=2e4 and 2 or
T>=12e4 and 5 or
T>=10e4 and 4 or
T>=6e4 and 3 or
T>=3e4 and 2 or
T>=1e4 and 1
end,
}

172
paint.lua
View File

@@ -1,12 +1,11 @@
local gc=love.graphics
local setFont=setFont
local int,abs,rnd,max,min,sin=math.floor,math.abs,math.random,math.max,math.min,math.sin
local int,ceil,rnd,max,min,sin=math.floor,math.ceil,math.random,math.max,math.min,math.sin
local format=string.format
local Timer=love.timer.getTime
local scr=scr
local modeRankColor={
[0]=color.darkGrey, --Not pass
color.bronze, --Rank1
color.lightGrey, --Rank2
color.lightYellow, --Rank3
@@ -31,8 +30,6 @@ local function stencil_miniTitle()
end
end
FX_BGblock={tm=150,next=7,ct=0,list={}}--Falling tetrominos on background
for _=1,16 do FX_BGblock.list[_]={v=0}end
FX_attack={}--Attack beam
FX_badge={}--Badge thrown
sysFX={}
@@ -61,21 +58,19 @@ end
local function drawVirtualkey()
local a=setting.VKAlpha*.1
for i=1,#virtualkey do
if i~=9 or modeEnv.Fkey then
local B=virtualkey[i]
if B.ava then
local _=virtualkeyDown[i]and gc.setColor(.7,.7,.7,a)or gc.setColor(1,1,1,a)--Dark magic
gc.setLineWidth(B.r*.07)
local ΔY=virtualkeyPressTime[i]
gc.circle("line",B.x,B.y+ΔY,B.r)--Outline circle
if setting.VKIcon then
gc.draw(VKIcon[i],B.x,B.y+ΔY,nil,B.r*.025,nil,18,18)
end--Icon
if ΔY>0 then
gc.setColor(1,1,1,a*ΔY*.1)
gc.circle("line",B.x,B.y,B.r*(1.4-ΔY*.04))
end--Ripple
end
local B=virtualkey[i]
if B.ava then
local _=virtualkeyDown[i]and gc.setColor(.7,.7,.7,a)or gc.setColor(1,1,1,a)--Dark magic
gc.setLineWidth(B.r*.07)
local ΔY=virtualkeyPressTime[i]
gc.circle("line",B.x,B.y+ΔY,B.r)--Outline circle
if setting.VKIcon then
gc.draw(VKIcon[i],B.x,B.y+ΔY,nil,B.r*.025,nil,18,18)
end--Icon
if ΔY>0 then
gc.setColor(1,1,1,a*ΔY*.1)
gc.circle("line",B.x,B.y,B.r*(1.4-ΔY*.04))
end--Ripple
end
end
end
@@ -103,35 +98,37 @@ function Pnt.BG.rgb()
end
function Pnt.BG.strap()
gc.setColor(1,1,1)
local x=Timer()%32*40
gc.draw(background2,x,0,nil,10)
gc.draw(background2,x-1280,0,nil,10)
local x=Timer()%16*-64
::L::
gc.draw(background2,x,0,nil,8,scr.h)
x=x+1024--image width*8
if x<scr.w then goto L end
end
function Pnt.BG.flink()
local t=.13-Timer()%3%1.7
if t<.25 then
gc.clear(t,t,t)
else
gc.clear(0,0,0)
if t<.25 then gc.clear(t,t,t)
else gc.clear(0,0,0)
end
end
function Pnt.BG.game1()
gc.setColor(1,1,1)
gc.draw(background1,640,360,Timer()*.15,12,nil,64,64)
gc.draw(background1,scr.w*.5,scr.h*.5,Timer()*.15,scr.rad*.0625,nil,16,16)
end--Rainbow
function Pnt.BG.game2()
gc.setColor(1,.5,.5)
gc.draw(background1,640,360,Timer()*.2,12,nil,64,64)
gc.draw(background1,scr.w*.5,scr.h*.5,Timer()*.15,scr.rad*.0625,nil,16,16)
end--Red rainbow
function Pnt.BG.game3()
gc.setColor(.6,.6,1)
gc.draw(background1,640,360,Timer()*.25,12,nil,64,64)
gc.draw(background1,scr.w*.5,scr.h*.5,Timer()*.15,scr.rad*.0625,nil,16,16)
end--Blue rainbow
function Pnt.BG.game4()
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)
local x=Timer()%8*-128
::L::
gc.draw(background2,x,0,nil,8,scr.h)
x=x+1024--image width*8
if x<scr.w then goto L end
end--Fast strap
function Pnt.BG.game5()
local t=2.5-Timer()%20%6%2.5
@@ -149,16 +146,19 @@ function Pnt.BG.game6()
local r=7-int(Timer()*.5)%7
gc.draw(miniBlock[r],640,360,Timer()%3.1416*6,400,400,scs[2*r]-.5,#blocks[r][0]-scs[2*r-1]+.5)
end--Fast lightning&spining tetromino
local matrixT={}for i=0,15 do matrixT[i]={}for j=0,8 do matrixT[i][j]=love.math.noise(i,j)+2 end end
local matrixT={}for i=1,20 do matrixT[i]={}for j=1,20 do matrixT[i][j]=love.math.noise(i,j)+2 end end
function Pnt.BG.matrix()
gc.scale(scr.k)
gc.clear(.15,.15,.15)
for i=0,15 do
for j=0,8 do
local _=ceil(scr.y/80)
for i=1,ceil(scr.x/80)do
for j=1,_ do
local t=sin(matrixT[i][j]*Timer())*.2+.2
gc.setColor(1,1,1,t)
gc.rectangle("fill",80*i,80*j,80,80)
gc.rectangle("fill",80*i,80*j,-80,-80)
end
end
gc.scale(1/scr.k)
end
function Pnt.load()
@@ -208,7 +208,9 @@ function Pnt.mode()
gc.scale(cam.zoomK)
gc.translate(-cam.x1,-cam.y1)
gc.scale(cam.k1)
local MM,R=modes,modeRanks
local MM=modes
local R=modeRanks
setFont(30)
for _=1,#MM do
local M=MM[_]
if R[_]then
@@ -225,7 +227,14 @@ function Pnt.mode()
local S=M.size
local d=((M.x-(cam.x1+(cam.sel and -180 or 0))/cam.k1)^2+(M.y-cam.y1/cam.k1)^2)^.55
if d<500 then S=S*(1.25-d*0.0005) end
gc.setColor(modeRankColor[modeRanks[M.id]])
local c=modeRankColor[modeRanks[M.id]]
if c then
gc.setColor(c)
else
c=.5+sin(Timer()*6+_)*.2
S=S*(.8+c*.5)
gc.setColor(c,c,c)
end
if M.shape==1 then--Rectangle
gc.rectangle("fill",M.x-S,M.y-S,2*S,2*S)
if cam.sel==_ then
@@ -233,42 +242,73 @@ function Pnt.mode()
gc.setLineWidth(10)
gc.rectangle("line",M.x-S+5,M.y-S+5,2*S-10,2*S-10)
end
elseif M.shape==2 then--Octagon
elseif M.shape==2 then--diamond
gc.circle("fill",M.x,M.y,S+5,4)
if cam.sel==_ then
gc.setColor(1,1,1)
gc.setLineWidth(10)
gc.circle("line",M.x,M.y,S+5,4)
end
elseif M.shape==3 then--Octagon
gc.circle("fill",M.x,M.y,S,8)
if cam.sel==_ then
gc.setColor(1,1,1)
gc.setLineWidth(10)
gc.circle("line",M.x,M.y,S-5,8)
gc.circle("line",M.x,M.y,S,8)
end
end
if M.icon then
local i=M.icon
local l=i:getWidth()*.5
local k=S/l*.8
gc.setColor(0,0,0,2)
gc.draw(i,M.x-1,M.y-1,nil,k,nil,l,l)
gc.draw(i,M.x-1,M.y+1,nil,k,nil,l,l)
gc.draw(i,M.x+1,M.y-1,nil,k,nil,l,l)
gc.draw(i,M.x+1,M.y+1,nil,k,nil,l,l)
gc.setColor(1,1,1)
gc.draw(i,M.x,M.y,nil,k,nil,l,l)
end
end
end
gc.pop()
if cam.sel then
local M=MM[cam.sel]
local lang=setting.lang
gc.setColor(.6,.6,.6,.5)
gc.setColor(.7,.7,.7,.5)
gc.rectangle("fill",920,0,360,720)--Info board
gc.setColor(M.color)
setFont(40)
mStr(M.name[lang],1030,5)
setFont(30)
mStr(M.level[lang],1030,50)
setFont(40)mStr(M.name[lang],1100,5)
setFont(30)mStr(M.level[lang],1100,50)
gc.setColor(1,1,1)
setFont(30)
gc.printf(M.info[lang],1100-180,130,360,"center")
local L=M.records
if L[1]then
setFont(28)gc.printf(M.info[lang],920,110,360,"center")
if M.slowMark then
gc.draw(ctrlSpeedLimit,1230,50,nil,.4)
end
if M.score then
mDraw(drawableText.highScore,1100,240)
gc.setColor(.3,.3,.3,.8)
gc.setColor(.4,.4,.4,.8)
gc.rectangle("fill",940,290,320,280)--Highscore board
local L=M.records
gc.setColor(1,1,1)
setFont(23)
for i=1,#L do
gc.print(M.scoreDisp(L[i]),955,275+25*i)
if L[1]then
for i=1,#L do
local t=M.scoreDisp(L[i])
local s=#t
local dy
if s<15 then dy=0
elseif s<25 then dy=2
else dy=4
end
setFont(int(26-s*.4))
gc.print(t,955,275+dy+25*i)
setFont(10)
local _=L[i].date
if _ then gc.print(_,1155,284+25*i)end
end
else
mDraw(drawableText.noScore,1100,370)
end
elseif M.score then
mDraw(drawableText.noScore,1100,370)
end
end
if cam.keyCtrl then
@@ -424,11 +464,17 @@ end
function Pnt.pause()
Pnt.play()
gc.setColor(0,0,0,pauseTimer*.015)
gc.rectangle("fill",0,0,1280,720)
gc.setColor(1,1,1,pauseTimer*.02)
gc.push("transform")
gc.origin()
gc.rectangle("fill",0,0,scr.w,scr.h)
gc.pop()
setFont(25)
gc.setColor(1,1,1,pauseTimer*.02)
if pauseCount>0 then
local _=curMode.pauseLimit and(pauseCount==1 and pauseTime>2.6 or pauseTime>6.26)
if _ then gc.setColor(1,.4,.4,pauseTimer*.02)end
gc.print(text.pauseCount..":["..pauseCount.."] "..format("%0.2f",pauseTime).."s",110,150)
if _ then gc.setColor(1,1,1,pauseTimer*.02)end
end
for i=1,8 do
gc.print(text.stat[i+3],110,30*i+270)
@@ -449,12 +495,12 @@ end
function Pnt.setting_game()
gc.setColor(1,1,1)
mDraw(drawableText.setting_game,640,15)
setFont(35)
mStr("DAS:"..setting.das,290,205)
mStr("ARR:"..setting.arr,610,205)
setFont(23)
mStr(text.softdropdas..setting.sddas,290,323)
mStr(text.softdroparr..setting.sdarr,610,323)
setFont(33)
mStr("DAS:"..setting.das.."F",290,205)
mStr("ARR:"..setting.arr.."F",610,205)
setFont(22)
mStr(text.softdropdas..setting.sddas.."F",290,323)
mStr(text.softdroparr..setting.sdarr.."F",610,323)
end
function Pnt.setting_graphic()
gc.setColor(1,1,1)

113
parts/space.lua Normal file
View File

@@ -0,0 +1,113 @@
local gc=love.graphics
local sin,cos,rnd,min=math.sin,math.cos,math.random,math.min
local W,H,R--w,h+=100,r=real Radius
local stars={}
local planet={}
local function newPlanet()
local a=rnd()*3.142
local r=(H+W)*(rnd()*2+1)*.06
planet.r=r
planet.x=W*.5+cos(a)*(R+r)
planet.y=H*.5+sin(a)*(R+r)
planet.vx=-cos(a+rnd()-.5)*.126
planet.vy=-sin(a+rnd()-.5)*.126
planet.R=.7+rnd()*.2
planet.G=.7+rnd()*.1
end
local space={}--LIB
function space.resize(w,h)
R=((w*.5)^2+(h*.5)^2)^.5
W,H=w+100,h+100
end
function space.new()
if not W then space.resize(scr.w,scr.h)end
newPlanet()
for i=1,2600,5 do
local s=0.75*2^(rnd()*1.5)
stars[i]=s --size
stars[i+1]=rnd(W) --x
stars[i+2]=rnd(H) --y
stars[i+3]=(rnd()-.5)*.05*s --vx
stars[i+4]=(rnd()-.5)*.05*s --vy
end--800 stars
end
function space.translate(dx,dy)
planet.x=planet.x+dx*.26
planet.y=planet.y+dy*.26
for i=1,2600,5 do
local s=stars[i]
stars[i+1]=stars[i+1]+dx*s
stars[i+2]=stars[i+2]+dy*s
end
end
function space.scale(k)
planet.r=planet.r*k^.15
for i=1,2600,5 do
local s=stars[i]
local x=stars[i+1]
local y=stars[i+2]
s=s*k
x=W*.5+(x-W*.5)*k
y=H*.5+(y-H*.5)*k
if k>1 then
if x%W~=x or y%H~=y then
s=.75
x=W*.5+(rnd()-.5)*W*.5
y=H*.5+(rnd()-.5)*H*.5
end
--out,new small one
elseif s<.75 then
local vx,vy
repeat
s=rnd()*.75+2.25
stars[i]=s --size
x=rnd(W) --x
y=rnd(H) --y
vx=(rnd()-.5)*.15 --vx
vy=(rnd()-.5)*.15 --vy
until x<100 or x>W-100 or y<100 or y>H-100
stars[i+3]=vx
stars[i+4]=vy
--disappear,new big one
end
stars[i]=s
stars[i+1]=x
stars[i+2]=y
end
end
function space.update(dt)
local x,y=planet.x,planet.y
planet.x=planet.x+planet.vx
planet.y=planet.y+planet.vy
if((planet.x-W*.5)^2+(planet.y-H*.5)^2)^.5>R+planet.r then
newPlanet()
end
for i=1,2600,5 do
stars[i+1]=(stars[i+1]+stars[i+3])%W
stars[i+2]=(stars[i+2]+stars[i+4])%H
end--stars moving
end
function space.draw()
if not stars[1]then return end
gc.translate(-50,-50)
gc.setLineWidth(7)
gc.setColor(planet.R,planet.G,.6,.2)
gc.circle("line",planet.x,planet.y,planet.r+1)
gc.setColor(planet.R,planet.G,.6,.5)
gc.circle("fill",planet.x,planet.y,planet.r)
gc.setColor(.9,.9,.9)
for i=1,2600,5 do
local x,y=stars[i+1],stars[i+2]
gc.circle("fill",x,y,stars[i])
end
gc.translate(50,50)
end
function space.discard()
stars={}
planet={}
collectgarbage()
end
return space

View File

@@ -4,6 +4,7 @@ local Timer=love.timer.getTime
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 format=string.format
local actName=actName--controllings' id
local scr=scr--screen camera
-------------------------</Head>-------------------------
@@ -27,6 +28,7 @@ local gameEnv0={
freshLimit=1e99,easyFresh=true,
fine=false,fineKill=false,
target=1e99,dropPiece=NULL,
mindas=0,minarr=0,minsdarr=0,
bg="none",bgm="race"
}
local renATK={[0]=0,0,0,1,1,2,2,3,3,4,4}--3 else
@@ -41,9 +43,10 @@ local spinSCR={--[blockName][row]
{250,800,1500},--T
{300,1000,2200},--O
{300,1000,1800},--I
}--MUL:1.2,2.0
--Techrash:1K;MUL:1.3,1.8
--Mini*=.5
}
--B2BMUL:1.2/2.0
--Techrash:1K;MUL:1.3/1.8
--Mini*=.6
local visible_opt={show=1e99,time=300,fast=20,none=5}
local reAtk={0,0,1,1,1,2,2,3,3}
local reDef={0,1,1,2,3,3,4,4,5}
@@ -100,8 +103,8 @@ local TRS={
[03]={TMP1,{1,0}, {1,1}, {0,-2}, {-1,1} },
[30]={TMP1,{-1,0}, {-1,-1},{0,2}, {-1,2} },
[12]={TMP1,{1,0}, {1,-1}, {0,2}, {1,2}, {1,1} },
[21]={TMP1,{-1,0}, {-1,1}, {0,-2}, {-1,-2},{-1,-1} },
[32]={TMP1,{-1,0}, {-1,-1},{1,0}, {0,2}, {-1,2} },
[21]={TMP1,{-1,0}, {-1,-1},{-1,1}, {0,-2}, {-1,-2},{-1,-1} },
[32]={TMP1,{-1,0}, {-1,-1},{-1,1}, {1,0}, {0,2}, {-1,2} },
[23]={TMP1,{1,0}, {1,1}, {-1,0}, {0,-2}, {1,-2} },
[02]={TMP1,{1,0}, {-1,0}, {0,-1}, {0,1} },
[20]={TMP1,{-1,0}, {1,0}, {0,1}, {0,-1} },
@@ -113,10 +116,10 @@ local TRS={
[10]={TMP1,{1,0}, {1,-1}, {0,2}, {1,2} },
[03]={TMP1,{1,0}, {1,1}, {0,-2}, {1,-2}, {1,-1}, {0,1} },
[30]={TMP1,{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1}, {-1,1} },
[12]={TMP1,{1,0}, {1,-1}, {-1,0}, {0,2}, {1,2} },
[12]={TMP1,{1,0}, {1,-1}, {1,1}, {-1,0}, {0,2}, {1,2} },
[21]={TMP1,{-1,0}, {-1,1}, {1,0}, {0,-2}, {-1,-2} },
[32]={TMP1,{-1,0}, {-1,-1},{0,2}, {-1,2}, {-1,1} },
[23]={TMP1,{1,0}, {1,1}, {0,-2}, {1,-2}, {1,-1} },
[23]={TMP1,{1,0}, {1,-1}, {1,1}, {0,-2}, {1,-2}, {1,-1} },
[02]={TMP1,{-1,0}, {1,0}, {0,-1}, {0,1} },
[20]={TMP1,{1,0}, {-1,0}, {0,1}, {0,-1} },
[13]={TMP1,{0,-1}, {1,0}, {0,1} },
@@ -515,7 +518,7 @@ function Pdraw_small(P)
if P.result then
gc.setColor(1,1,1,min(P.endCounter,60)*.01)
setFont(17)mStr(P.result,32,47)
setFont(15)mStr(P.rank,30,82)
setFont(15)mStr(P.modeData.event,30,82)
end
gc.pop()
gc.setCanvas()
@@ -724,11 +727,23 @@ function player.update(P,dt)
goto stop
end
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
local D=P.dropDelay
if D>1 then
P.dropDelay=D-1
goto stop
end
if D==1 then
P.curY=P.curY-1
else
local _=P.curY-P.y_img--max fall dist
D=1/D--fall dist
if D<_ then
P.curY=P.curY-D
assert(P.curY==int(P.curY),"y:"..P.curY.." fall:"..D.." D_env:"..P.gameEnv.drop)
else
P.curY=P.y_img
end
end
P.curY=P.curY-1
P.spinLast=false
if P.y_img~=P.curY then
P.dropDelay=P.gameEnv.drop
@@ -962,10 +977,10 @@ function player.fineError(P,rate)
P.stat.extraRate=P.stat.extraRate+rate
if P.human then
if P.gameEnv.fineKill then
SFX("error_long")
SFX("finesseError_long")
Event.lose(P)
elseif setting.fine then
SFX("error")
SFX("finesseError")
end
elseif P.gameEnv.fineKill then
Event.lose(P)
@@ -1507,7 +1522,7 @@ function player.drop(P)--Place piece
P:showText(text.mini,0,-80,35,"appear")
send=send*.5
sendTime=sendTime+60
cscore=cscore*.5
cscore=cscore*.6
P.b2b=P.b2b+b2bPoint[cc]*.5
if P.human then
VOICE("mini",CHN)
@@ -1524,7 +1539,7 @@ function player.drop(P)--Place piece
elseif #P.field>0 then
P.b2b=max(P.b2b-250,0)
P:showText(text.clear[cc],0,-30,27+cc*3,"appear",(8-cc)*.3)
send=cc-1
send=cc-.75
sendTime=20+send*20
cscore=cscore+clearSCR[cc]
P.lastClear=cc
@@ -1542,7 +1557,7 @@ function player.drop(P)--Place piece
end
if #P.field==0 then
P:showText(text.PC,0,-80,50,"flicker")
send=ceil(send^.5)+min(6+P.stat.pc,10)
send=send^.5+min(6+P.stat.pc,10)
exblock=exblock+2
sendTime=sendTime+60
if P.stat.row>4 then
@@ -1975,7 +1990,7 @@ function newDemoPlayer(id,x,y,size)
block=true,
visible="show",
Fkey=NULL,puzzle=false,ospin=true,
Fkey=nil,puzzle=false,ospin=true,
freshLimit=1e99,easyFresh=true,
target=1e99,dropPiece=NULL,
}
@@ -2084,10 +2099,9 @@ function newPlayer(id,x,y,size,AIdata)
P.field,P.visTime={},{}
P.atkBuffer={sum=0}
P.ko,P.badge,P.strength=0,0,0
P.badge,P.strength=0,0
P.atkMode,P.swappingAtkMode=1,20
P.atker,P.atking,P.lastRecv={}
P.rank=nil
--Royale-related
P.gameEnv={}--Current game setting environment
@@ -2099,7 +2113,12 @@ function newPlayer(id,x,y,size,AIdata)
else
P.gameEnv[k]=v
end
end--reset current game settings
end--load game settings
P.gameEnv.das=max(P.gameEnv.das,P.gameEnv.mindas)
P.gameEnv.arr=max(P.gameEnv.arr,P.gameEnv.minarr)
P.gameEnv.sdarr=max(P.gameEnv.sdarr,P.gameEnv.minsdarr)
if not AIdata then P.gameEnv.next=min(P.gameEnv.next,setting.maxNext)end--AIdata is not human
P.cur={bk={{}},id=0,color=0,name=0}--shape,shapeID,colorID,nameID
P.sc,P.dir,P.r,P.c={0,0},0,0,0--spinCenter,direction,row,col
P.curX,P.curY,P.y_img=0,0,0--x,y,ghostY

Some files were not shown because too many files have changed in this diff Show More