修复旋转时场地晃动的逻辑会跟玩家sound有关
This commit is contained in:
@@ -624,22 +624,22 @@ do
|
||||
P.freshTime=P.freshTime-1
|
||||
end
|
||||
|
||||
if P.sound then
|
||||
local sfx
|
||||
if ifpre then
|
||||
sfx='prerotate'
|
||||
elseif P:ifoverlap(icb,x,y+1)and P:ifoverlap(icb,x-1,y)and P:ifoverlap(icb,x+1,y)then
|
||||
sfx='rotatekick'
|
||||
if P.gameEnv.shakeFX then
|
||||
if d==1 or d==3 then
|
||||
P.fieldOff.va=P.fieldOff.va+(2-d)*P.gameEnv.shakeFX*6e-3
|
||||
else
|
||||
P.fieldOff.va=P.fieldOff.va+P:getCenterX()*P.gameEnv.shakeFX*3e-3
|
||||
end
|
||||
local sfx
|
||||
if ifpre then
|
||||
sfx='prerotate'
|
||||
elseif P:ifoverlap(icb,x,y+1)and P:ifoverlap(icb,x-1,y)and P:ifoverlap(icb,x+1,y)then
|
||||
sfx='rotatekick'
|
||||
if P.gameEnv.shakeFX then
|
||||
if d==1 or d==3 then
|
||||
P.fieldOff.va=P.fieldOff.va+(2-d)*P.gameEnv.shakeFX*6e-3
|
||||
else
|
||||
P.fieldOff.va=P.fieldOff.va+P:getCenterX()*P.gameEnv.shakeFX*3e-3
|
||||
end
|
||||
else
|
||||
sfx='rotate'
|
||||
end
|
||||
else
|
||||
sfx='rotate'
|
||||
end
|
||||
if P.sound then
|
||||
SFX.play(sfx,nil,P:getCenterX()*.15)
|
||||
end
|
||||
P.stat.rotate=P.stat.rotate+1
|
||||
|
||||
@@ -698,22 +698,22 @@ function Player:spin(d,ifpre)
|
||||
end
|
||||
|
||||
--Sound & Field shaking
|
||||
if self.sound then
|
||||
local sfx
|
||||
if ifpre then
|
||||
sfx='prerotate'
|
||||
elseif self:ifoverlap(icb,ix,iy+1)and self:ifoverlap(icb,ix-1,iy)and self:ifoverlap(icb,ix+1,iy)then
|
||||
sfx='rotatekick'
|
||||
if self.gameEnv.shakeFX then
|
||||
if d==1 or d==3 then
|
||||
self.fieldOff.va=self.fieldOff.va+(2-d)*self.gameEnv.shakeFX*6e-3
|
||||
else
|
||||
self.fieldOff.va=self.fieldOff.va+self:getCenterX()*self.gameEnv.shakeFX*3e-3
|
||||
end
|
||||
local sfx
|
||||
if ifpre then
|
||||
sfx='prerotate'
|
||||
elseif self:ifoverlap(icb,ix,iy+1)and self:ifoverlap(icb,ix-1,iy)and self:ifoverlap(icb,ix+1,iy)then
|
||||
sfx='rotatekick'
|
||||
if self.gameEnv.shakeFX then
|
||||
if d==1 or d==3 then
|
||||
self.fieldOff.va=self.fieldOff.va+(2-d)*self.gameEnv.shakeFX*6e-3
|
||||
else
|
||||
self.fieldOff.va=self.fieldOff.va+self:getCenterX()*self.gameEnv.shakeFX*3e-3
|
||||
end
|
||||
else
|
||||
sfx='rotate'
|
||||
end
|
||||
else
|
||||
sfx='rotate'
|
||||
end
|
||||
if self.sound then
|
||||
SFX.play(sfx,nil,self:getCenterX()*.15)
|
||||
end
|
||||
self.stat.rotate=self.stat.rotate+1
|
||||
|
||||
Reference in New Issue
Block a user