强化水印&系统优化

This commit is contained in:
MrZ_26
2020-07-09 19:39:06 +08:00
parent a3302ab2bc
commit 3d22f5d8ca
11 changed files with 90 additions and 87 deletions

View File

@@ -128,7 +128,9 @@ local keyDown,keyUp={},{}
local gamepadDown,gamepadUp={},{}
function keyDown.load(k)
if k=="s"then
if k=="a"then
sceneTemp.skip=true
elseif k=="s"then
marking=nil
sceneTemp.skip=true
end

View File

@@ -2,7 +2,7 @@ local langList={
{
anykey="按任意键继续",
newVersion="检测到更新!存档格式可能更新,设置已重置",
marking="游戏作者:MrZ_26\n出现此水印则为非法录屏上传",
marking="游戏作者:MrZ_26\n任何视频不得出现此水印",
lang="中文",
atkModeName={"随机","徽章","击杀","反击"},
royale_remain=function(n)return"剩余 "..n.." 名玩家"end,
@@ -430,7 +430,7 @@ local langList={
{
anykey="按任意键继续",
newVersion="检测到更新!存档格式可能更新,设置已重置",
marking="游戏作者:MrZ_26\n出现此水印则为非法录屏上传",
marking="游戏作者:MrZ_26\n任何视频不得出现此水印",
lang="全中文",
atkModeName={"随机","徽章","击杀","反击"},
royale_remain=function(n)return"剩余 "..n.." 名玩家"end,

View File

@@ -357,6 +357,12 @@ function Pnt.draw()
end
end
function Pnt.play()
if marking then
setFont(36)
local x=game.frame*2%1800-260
gc.setColor(1,1,1,abs(0.26*(1-x/640))-0.0626)
mStr(text.marking,x,260+62*sin(Timer()))
end
for p=1,#players do
players[p]:draw()
end
@@ -465,7 +471,7 @@ function Pnt.pause()
mText(game.result and drawableText[game.result]or drawableText.pause,640,50-10*(5-sceneTemp.timer*.1)^1.5)
--Infos
if frame>180 then
if game.frame>180 then
_=S.list
setFont(26)
for i=1,10 do
@@ -475,7 +481,7 @@ function Pnt.pause()
end
--Radar Chart
if T>.5 and frame>180 then
if T>.5 and game.frame>180 then
T=T*2-1
gc.setLineWidth(2)
gc.push("transform")

View File

@@ -158,7 +158,7 @@ function Tmr.draw()
if sceneTemp.sure>0 then sceneTemp.sure=sceneTemp.sure-1 end
end
function Tmr.play(dt)
frame=frame+1
game.frame=game.frame+1
stat.time=stat.time+dt
local P1=players[1]
for i=#FX_attack,1,-1 do
@@ -199,10 +199,10 @@ function Tmr.play(dt)
end
end
if frame<180 then
if frame==179 then
if game.frame<180 then
if game.frame==179 then
gameStart()
elseif frame==60 or frame==120 then
elseif game.frame==60 or game.frame==120 then
SFX.play("ready")
end
for p=1,#players do
@@ -232,14 +232,11 @@ function Tmr.play(dt)
local P=players[p]
P:update(dt)
end
if frame%120==0 then
if game.frame%120==0 then
if modeEnv.royaleMode then freshMostDangerous()end
if marking and rnd()<.2 then
TEXT.show(text.marking,rnd(162,scr.w-162),rnd(126,scr.h-200),40,"mark",.626)
end--mark 2s each 10s
end
if P1.alive then
if frame%26==0 and setting.warn then
if game.frame%26==0 and setting.warn then
local F=P1.field
local M=#F
local height=0

View File

@@ -218,6 +218,9 @@ function WIDGET.press(x,y)
local W=WIDGET.sel
if not W then return end
if W.type=="button"then
for k,v in next,W do
print(k,v)
end
W.code()
W:FX()
SFX.play("button")

View File

@@ -155,10 +155,10 @@ local Widgets={
back= newButton(1200, 640,120,120,C.white, 35,BACK),
},
play={
pause= newButton(1235,45,80,80,C.white,25,pauseGame),
pause= newButton(1235,45,80,80,C.white,25,function()pauseGame()end),
},
pause={
resume= newButton(640,290,240,100,C.white,30,resumeGame),
resume= newButton(640,290,240,100,C.white,30,function()resumeGame()end),
restart=newButton(640,445,240,100,C.white,33,function()
TASK.clear("play")
mergeStat(stat,players[1].stat)

View File

@@ -17,7 +17,7 @@ function love.conf(t)
W.resizable=true
W.fullscreentype="desktop"--"exclusive"
W.fullscreen=false
W.vsync=0--infinite fps
W.vsync=0--unlimit
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

View File

@@ -223,6 +223,7 @@ function loadGame(M)
end
function resetPartGameData()
game={
frame=150-setting.reTime*15,
result=false,
pauseTime=0,
pauseCount=0,
@@ -230,7 +231,6 @@ function resetPartGameData()
warnLVL0=0,
warnLVL=0,
}
frame=150-setting.reTime*15
destroyPlayers()
curMode.load()
TEXT.clear()
@@ -258,6 +258,7 @@ function resetPartGameData()
end
function resetGameData()
game={
frame=150-setting.reTime*15,
result=false,
pauseTime=0,--Time paused
pauseCount=0,--Pausing count
@@ -265,7 +266,6 @@ function resetGameData()
warnLVL0=0,
warnLVL=0,
}
frame=150-setting.reTime*15
destroyPlayers()
modeEnv=curMode.env
curMode.load()--bg/bgm need redefine in custom,so up here

View File

@@ -97,7 +97,7 @@ local TRS={
[13]={{ 0,-1},{ 0, 1},{ 1, 0}},
[31]={{ 0, 1},{ 0,-1},{-1, 0}},
},--J
{},--L
{},--L
{
[01]={{-1, 0},{-1, 1},{ 0,-2},{-1,-2},{-1,-1}},
[10]={{ 1, 0},{ 1,-1},{ 0, 2},{ 1, 2},{ 0,-1},{ 1, 1}},

View File

@@ -226,7 +226,7 @@ end
local function Pupdate_alive(P,dt)
if P.timing then P.stat.time=P.stat.time+dt end
if P.keyRec then
local _=frame
local _=game.frame
local v=0
for i=2,10 do v=v+i*(i-1)*7.2/(_-P.keyTime[i])end P.keySpeed=P.keySpeed*.99+v*.1
v=0
@@ -518,7 +518,6 @@ local function Pdraw_norm(P)
end
end--Grid
gc.translate(0,P.fieldBeneath)
gc.setScissor(scr.x+(P.absFieldX+P.fieldOff.x)*scr.k,scr.y+(P.absFieldY+P.fieldOff.y)*scr.k,300*P.size*scr.k,610*P.size*scr.k)
if P.falling==-1 then
for j=int(P.fieldBeneath/30+1),#P.field do
for i=1,10 do
@@ -599,57 +598,54 @@ local function Pdraw_norm(P)
gc.translate(0,dy)
end
::E::
gc.setScissor()--In-playField things
gc.translate(0,-P.fieldBeneath)
gc.setBlendMode("replace","alphamultiply")--SPEED UPUP(?)
gc.setLineWidth(2)
gc.setColor(1,1,1)
gc.rectangle("line",-1,-11,302,612)--Draw boarder
gc.rectangle("line",301,0,15,601)--Draw atkBuffer boarder
local h=0
for i=1,#P.atkBuffer do
local A=P.atkBuffer[i]
local bar=A.amount*30
if h+bar>600 then bar=600-h end
if not A.sent then
if A.time<20 then
bar=bar*(20*A.time)^.5*.05
--Appear
end
if A.countdown>0 then
gc.setColor(attackColor[A.lv][1])
gc.rectangle("fill",303,599-h,11,-bar+3)
gc.setColor(attackColor[A.lv][2])
gc.rectangle("fill",303,599-h+(-bar+3),11,-(-bar+3)*(1-A.countdown/A.cd0))
--Timing
else
local t=math.sin((Timer()-i)*30)*.5+.5
local c1,c2=attackColor[A.lv][1],attackColor[A.lv][2]
gc.setColor(c1[1]*t+c2[1]*(1-t),c1[2]*t+c2[2]*(1-t),c1[3]*t+c2[3]*(1-t))
gc.rectangle("fill",303,599-h,11,-bar+3)
--Warning
end
else
gc.setColor(attackColor[A.lv][1])
bar=bar*(20-A.time)*.05
gc.rectangle("fill",303,599-h,11,-bar+2)
--Disappear
gc.setLineWidth(2)
gc.setColor(1,1,1)
gc.rectangle("line",-1,-11,302,612)--Draw boarder
gc.rectangle("line",301,0,15,601)--Draw atkBuffer boarder
local h=0
for i=1,#P.atkBuffer do
local A=P.atkBuffer[i]
local bar=A.amount*30
if h+bar>600 then bar=600-h end
if not A.sent then
if A.time<20 then
bar=bar*(20*A.time)^.5*.05
--Appear
end
h=h+bar
end--Buffer line
local a,b=P.b2b,P.b2b1 if a>b then a,b=b,a end
gc.setColor(.8,1,.2)
gc.rectangle("fill",-14,599,11,-b*.5)
gc.setColor(P.b2b<40 and color.white or P.b2b<=1e3 and color.lightRed or color.lightBlue)
gc.rectangle("fill",-14,599,11,-a*.5)
gc.setColor(1,1,1)
if Timer()%.5<.3 then
gc.rectangle("fill",-15,b<40 and 578.5 or 98.5,13,3)
if A.countdown>0 then
gc.setColor(attackColor[A.lv][1])
gc.rectangle("fill",303,599-h,11,-bar+3)
gc.setColor(attackColor[A.lv][2])
gc.rectangle("fill",303,599-h+(-bar+3),11,-(-bar+3)*(1-A.countdown/A.cd0))
--Timing
else
local t=math.sin((Timer()-i)*30)*.5+.5
local c1,c2=attackColor[A.lv][1],attackColor[A.lv][2]
gc.setColor(c1[1]*t+c2[1]*(1-t),c1[2]*t+c2[2]*(1-t),c1[3]*t+c2[3]*(1-t))
gc.rectangle("fill",303,599-h,11,-bar+3)
--Warning
end
else
gc.setColor(attackColor[A.lv][1])
bar=bar*(20-A.time)*.05
gc.rectangle("fill",303,599-h,11,-bar+2)
--Disappear
end
gc.rectangle("line",-16,-3,15,604)--Draw b2b bar boarder
--B2B indictator
gc.translate(-P.fieldOff.x,-P.fieldOff.y)
gc.setBlendMode("alpha")
h=h+bar
end--Buffer line
local a,b=P.b2b,P.b2b1 if a>b then a,b=b,a end
gc.setColor(.8,1,.2)
gc.rectangle("fill",-14,599,11,-b*.5)
gc.setColor(P.b2b<40 and color.white or P.b2b<=1e3 and color.lightRed or color.lightBlue)
gc.rectangle("fill",-14,599,11,-a*.5)
gc.setColor(1,1,1)
if Timer()%.5<.3 then
gc.rectangle("fill",-15,b<40 and 578.5 or 98.5,13,3)
end
gc.rectangle("line",-16,-3,15,604)--Draw b2b bar boarder
--B2B indictator
gc.translate(-P.fieldOff.x,-P.fieldOff.y)
if P.gameEnv.hold then
mText(drawableText.hold,-81,-15)
@@ -691,8 +687,8 @@ local function Pdraw_norm(P)
gc.draw(drawableText.modeName,-135,-65)
gc.draw(drawableText.levelName,437-drawableText.levelName:getWidth(),-65)
gc.setColor(1,1,1)
if frame<180 then
local count=179-frame
if game.frame<180 then
local count=179-game.frame
gc.push("transform")
gc.translate(155,220)
setFont(95)
@@ -1349,7 +1345,7 @@ end
function player.drop(P)--Place piece
local _
local CHN=VOC.getFreeChannel()
P.dropTime[11]=ins(P.dropTime,1,frame)--update speed dial
P.dropTime[11]=ins(P.dropTime,1,game.frame)--update speed dial
local cmb=P.combo
P.waiting=P.gameEnv.wait
local STAT=P.stat
@@ -1771,17 +1767,17 @@ function player.pressKey(P,i)
P.act[i](P)
if P.control then
if P.keyRec then
ins(P.keyTime,1,frame)
ins(P.keyTime,1,game.frame)
P.keyTime[11]=nil
end
P.stat.key=P.stat.key+1
end
--ins(rec,{i,frame})
--ins(rec,{i,game.frame})
end
function player.releaseKey(P,i)
if P.keyPressing[i]then
P.keyPressing[i]=false
-- if recording then ins(rec,{-i,frame})end
-- if recording then ins(rec,{-i,game.frame})end
end
end
--------------------------</Methods>--------------------------
@@ -2146,7 +2142,7 @@ function player.act.func(P)
P.gameEnv.Fkey(P)
end
function player.act.restart(P)
if P.gameEnv.quickR or frame<180 then
if P.gameEnv.quickR or game.frame<180 then
TASK.clear("play")
resetPartGameData()
end

View File

@@ -1,13 +1,10 @@
local S=[=[
"Patron"(time ordered,may not accurate):
[rmb100+]:
那没事了(T6300)
加油啊,钉钉动了的大哥哥(T3228)
弥佑瑶
Alan
幽灵3383
靏鸖龘龘
込余
那没事了(T6300) 加油啊,钉钉动了的大哥哥(T3228)
弥佑瑶 Alan
幽灵3383 靏鸖龘龘
込余 saki
[rmb10+]:
八零哥 蕴空之灵 gggf127 dtg
ThTsOd Fireboos 金巧 10元
@@ -19,7 +16,7 @@ local S=[=[
PCX kagura77 呆喂 GlowingEmbers
轩辕辚 HimuroAki TCV100 tech有养成系统了@7065
HAGE KANOBU 闪电和拐棍 葡萄味的曼妥思 世界沃德
蓝绿 天生的魔法师 saki 琳雨空 T8779.易缄
蓝绿 天生的魔法师 琳雨空 T8779.易缄 吃水榴莲
Thanks!!!
@@ -83,14 +80,16 @@ Future outlook:
new:
--TODO: custom sequence
many new tips
better watermark
changed:
faster&harder attacker-ultimate
faster & harder attacker-ultimate
little easier to get S in PC challenge (easy mode)
easier to get S in infinite mode, c4w, PC
harder to unlock sprint 400/1000
code:
file sorted
task system rewrited, now perfect
task system rewrited, now perfect (maybe)
remove scissors/blendMode setting in drawing players
fixed:
hard move won't deactive "spin"
do not clear dead enemies' field