Skip to content

Commit

Permalink
Fixed IRS sound effects
Browse files Browse the repository at this point in the history
  • Loading branch information
electraminer committed Dec 12, 2024
1 parent 941697c commit 112c7e5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
32 changes: 15 additions & 17 deletions parts/player/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ function Player:act_moveRight(auto)
self.moving=0
end
end
function Player:act_rotRight()
function Player:act_rotRight(ifpre)
if not self.control then return end
if self.cur then
self.ctrlCount=self.ctrlCount+1
Expand All @@ -278,7 +278,7 @@ function Player:act_rotRight()
self:resolveIRS()
self.keyPressing[3] = true
end
self:spin(1)
self:spin(1,ifpre)
self:_triggerEvent('hook_rotate',1)

-- Disable held inputs if IRS is off
Expand All @@ -287,7 +287,7 @@ function Player:act_rotRight()
end
end
end
function Player:act_rotLeft()
function Player:act_rotLeft(ifpre)
if not self.control then return end
if self.cur then
self.ctrlCount=self.ctrlCount+1
Expand All @@ -299,15 +299,15 @@ function Player:act_rotLeft()
self:resolveIRS()
self.keyPressing[4] = true
end
self:spin(3)
self:spin(3,ifpre)
self:_triggerEvent('hook_rotate',3)
-- Disable held inputs if IRS is off
if not self.gameEnv.irs then
self.keyPressing[4]=false
end
end
end
function Player:act_rot180()
function Player:act_rot180(ifpre)
if not self.control then return end
if self.cur then
self.ctrlCount=self.ctrlCount+2
Expand All @@ -319,7 +319,7 @@ function Player:act_rot180()
self:resolveIRS()
self.keyPressing[5] = true
end
self:spin(2)
self:spin(2,ifpre)
self:_triggerEvent('hook_rotate',2)
-- Disable held inputs if IRS is off
if not self.gameEnv.irs then
Expand Down Expand Up @@ -1247,15 +1247,15 @@ function Player:resetBlock()-- Reset Block's position and execute I*S
else
-- If we're currently dying or in an entry-delay mode (20g), perform the rotation right away.
if pressing[5] then
self:act_rot180()
self:act_rot180(true)
elseif pressing[3] then
if pressing[4] then
self:act_rot180()
self:act_rot180(true)
else
self:act_rotRight()
self:act_rotRight(true)
end
elseif pressing[4] then
self:act_rotLeft()
self:act_rotLeft(true)
end
end
-- Disable held inputs if IRS is off
Expand Down Expand Up @@ -1308,9 +1308,7 @@ function Player:spin(d,ifpre)

-- Fresh ghost and freshTime
local t=self.freshTime
if not ifpre then
self:freshMoveBlock()
end
self:freshMoveBlock()
if kickData[test][2]>0 and self.freshTime==t and self.curY~=self.imgY then
self.freshTime=self.freshTime-1
end
Expand Down Expand Up @@ -2572,15 +2570,15 @@ function Player:resolveIRS()

self.bufferedIRS = false
if pressing[5] then
self:act_rot180()
self:act_rot180(true)
elseif pressing[3] then
if pressing[4] then
self:act_rot180()
self:act_rot180(true)
else
self:act_rotRight()
self:act_rotRight(true)
end
elseif pressing[4] then
self:act_rotLeft()
self:act_rotLeft(true)
end
end

Expand Down
2 changes: 1 addition & 1 deletion version.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
return {
["apkCode"]=1722,
["code"]=1722,
["string"]="V0.17.22 + IRSv1.1",
["string"]="V0.17.22 + IRSv1.1.1",
["room"]="ver A-14",
["name"]="暂停 Break",
}

0 comments on commit 112c7e5

Please sign in to comment.