玩家新增getCenterX方法,移除SFX.fieldPlay
This commit is contained in:
@@ -25,9 +25,6 @@ function SFX.init(list)
|
|||||||
end
|
end
|
||||||
SFX.loadOne=nil
|
SFX.loadOne=nil
|
||||||
|
|
||||||
function SFX.fieldPlay(s,v,P)
|
|
||||||
SFX.play(s,v,(P.curX+P.cur.sc[2]-5.5)*.15)
|
|
||||||
end
|
|
||||||
function SFX.play(s,vol,pos)
|
function SFX.play(s,vol,pos)
|
||||||
if SETTING.sfx==0 or vol==0 then return end
|
if SETTING.sfx==0 or vol==0 then return end
|
||||||
local S=Sources[s]--Source list
|
local S=Sources[s]--Source list
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ do
|
|||||||
if P.gameEnv.ospin then
|
if P.gameEnv.ospin then
|
||||||
local x,y=P.curX,P.curY
|
local x,y=P.curX,P.curY
|
||||||
if y==P.ghoY and((P:solid(x-1,y)or P:solid(x-1,y+1)))and(P:solid(x+2,y)or P:solid(x+2,y+1))then
|
if y==P.ghoY and((P:solid(x-1,y)or P:solid(x-1,y+1)))and(P:solid(x+2,y)or P:solid(x+2,y+1))then
|
||||||
if P.sound then SFX.fieldPlay("rotatekick",nil,P)end
|
if P.sound then SFX.play("rotatekick",nil,P:getCenterX()*.15)end
|
||||||
local D=P.spinSeq%100*10+d
|
local D=P.spinSeq%100*10+d
|
||||||
P.spinSeq=D
|
P.spinSeq=D
|
||||||
if D<100 then return end
|
if D<100 then return end
|
||||||
@@ -155,11 +155,11 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if P.sound then SFX.fieldPlay("rotate",nil,P)end
|
if P.sound then SFX.play("rotate",nil,P:getCenterX()*.15)end
|
||||||
P.spinSeq=0
|
P.spinSeq=0
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if P.sound then SFX.fieldPlay("rotate",nil,P)end
|
if P.sound then SFX.play("rotate",nil,P:getCenterX()*.15)end
|
||||||
end
|
end
|
||||||
end,--O
|
end,--O
|
||||||
{
|
{
|
||||||
@@ -270,7 +270,7 @@ do
|
|||||||
[31]={{ 0,-1},{ 1, 0}},
|
[31]={{ 0,-1},{ 1, 0}},
|
||||||
},--W
|
},--W
|
||||||
function(P,d)
|
function(P,d)
|
||||||
if P.type=="human"then SFX.fieldPlay("rotate",nil,P)end
|
if P.type=="human"then SFX.play("rotate",nil,P:getCenterX()*.15)end
|
||||||
local kickData=XspinList[d]
|
local kickData=XspinList[d]
|
||||||
for test=1,#kickData do
|
for test=1,#kickData do
|
||||||
local x,y=P.curX+kickData[test][1],P.curY+kickData[test][2]
|
local x,y=P.curX+kickData[test][1],P.curY+kickData[test][2]
|
||||||
|
|||||||
@@ -315,6 +315,9 @@ function Player.pushNextList(P,L,mir)--Push some nexts to nextQueue
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Player.getCenterX(P)
|
||||||
|
return P.curX+P.cur.sc[2]-5.5
|
||||||
|
end
|
||||||
function Player.solid(P,x,y)
|
function Player.solid(P,x,y)
|
||||||
if x<1 or x>10 or y<1 then return true end
|
if x<1 or x>10 or y<1 then return true end
|
||||||
if y>#P.field then return false end
|
if y>#P.field then return false end
|
||||||
@@ -579,7 +582,7 @@ function Player.spin(P,d,ifpre)
|
|||||||
kickData=kickData[P.cur.dir*10+idir]
|
kickData=kickData[P.cur.dir*10+idir]
|
||||||
if not kickData then
|
if not kickData then
|
||||||
P:freshBlock("move")
|
P:freshBlock("move")
|
||||||
SFX.fieldPlay(ifpre and"prerotate"or"rotate",nil,P)
|
SFX.play(ifpre and"prerotate"or"rotate",nil,P:getCenterX()*.15)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local icb=BLOCKS[P.cur.id][idir]
|
local icb=BLOCKS[P.cur.id][idir]
|
||||||
@@ -605,7 +608,7 @@ function Player.spin(P,d,ifpre)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if P.sound then
|
if P.sound then
|
||||||
SFX.fieldPlay(ifpre and"prerotate"or P:ifoverlap(P.cur.bk,P.curX,P.curY+1)and P:ifoverlap(P.cur.bk,P.curX-1,P.curY)and P:ifoverlap(P.cur.bk,P.curX+1,P.curY)and"rotatekick"or"rotate",nil,P)
|
SFX.play(ifpre and"prerotate"or P:ifoverlap(P.cur.bk,P.curX,P.curY+1)and P:ifoverlap(P.cur.bk,P.curX-1,P.curY)and P:ifoverlap(P.cur.bk,P.curX+1,P.curY)and"rotatekick"or"rotate",nil,P:getCenterX()*.15)
|
||||||
end
|
end
|
||||||
P.stat.rotate=P.stat.rotate+1
|
P.stat.rotate=P.stat.rotate+1
|
||||||
return
|
return
|
||||||
@@ -615,7 +618,7 @@ function Player.spin(P,d,ifpre)
|
|||||||
kickData(P,d)
|
kickData(P,d)
|
||||||
else
|
else
|
||||||
P:freshBlock("move")
|
P:freshBlock("move")
|
||||||
SFX.fieldPlay(ifpre and"prerotate"or"rotate",nil,P)
|
SFX.play(ifpre and"prerotate"or"rotate",nil,P:getCenterX()*.15)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local phyHoldKickX={
|
local phyHoldKickX={
|
||||||
@@ -1118,11 +1121,11 @@ do--Player.drop(P)--Place piece
|
|||||||
elseif ENV.fine then
|
elseif ENV.fine then
|
||||||
SFX.play("finesseError",.8)
|
SFX.play("finesseError",.8)
|
||||||
else
|
else
|
||||||
SFX.fieldPlay("lock",nil,P)
|
SFX.play("lock",nil,P:getCenterX()*.15)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif P.sound then
|
elseif P.sound then
|
||||||
SFX.fieldPlay("lock",nil,P)
|
SFX.play("lock",nil,P:getCenterX()*.15)
|
||||||
end
|
end
|
||||||
|
|
||||||
if finePts<=1 then
|
if finePts<=1 then
|
||||||
@@ -1902,7 +1905,7 @@ function Player.act_hardDrop(P)
|
|||||||
P.fieldOff.vy=P.gameEnv.shakeFX*.6
|
P.fieldOff.vy=P.gameEnv.shakeFX*.6
|
||||||
end
|
end
|
||||||
if P.sound then
|
if P.sound then
|
||||||
SFX.fieldPlay("drop",nil,P)
|
SFX.play("drop",nil,P:getCenterX()*.15)
|
||||||
VIB(1)
|
VIB(1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user