Added "Always reverse" option for rotation reversal.

This commit is contained in:
Joe Zeng 2020-11-06 19:17:32 -05:00
parent f52da36bf7
commit 9b04e14388
10 changed files with 61 additions and 12 deletions

View File

@ -8,7 +8,7 @@ ConfigScene.options = {
-- this serves as reference to what the options' values mean i guess? -- this serves as reference to what the options' values mean i guess?
{"manlock", "Manual locking",{"Per ruleset","Per gamemode","Harddrop", "Softdrop"}}, {"manlock", "Manual locking",{"Per ruleset","Per gamemode","Harddrop", "Softdrop"}},
{"piece_colour", "Piece Colours", {"Per ruleset","Arika" ,"TTC"}}, {"piece_colour", "Piece Colours", {"Per ruleset","Arika" ,"TTC"}},
{"world_reverse", "World Reverse", {"No", "Yes"}}, {"world_reverse","World Reverse", {"No" ,"SRS only" ,"Always"}},
} }
local optioncount = #ConfigScene.options local optioncount = #ConfigScene.options

View File

@ -110,7 +110,14 @@ function ARS:onPieceDrop(piece, grid)
piece.lock_delay = 0 -- step reset piece.lock_delay = 0 -- step reset
end end
function ARS:get180RotationValue() return 3 end function ARS:get180RotationValue()
if config.gamesettings.world_reverse == 3 then
return 3
else
return 1
end
end
function ARS:getDefaultOrientation() return 3 end -- downward facing pieces by default function ARS:getDefaultOrientation() return 3 end -- downward facing pieces by default
return ARS return ARS

View File

@ -185,7 +185,14 @@ function ARS:onPieceRotate(piece, grid)
end end
end end
function ARS:get180RotationValue() return 3 end function ARS:get180RotationValue()
if config.gamesettings.world_reverse == 3 then
return 3
else
return 1
end
end
function ARS:getDefaultOrientation() return 3 end -- downward facing pieces by default function ARS:getDefaultOrientation() return 3 end -- downward facing pieces by default
return ARS return ARS

View File

@ -172,7 +172,14 @@ function ARS:onPieceRotate(piece, grid)
end end
end end
function ARS:get180RotationValue() return 3 end function ARS:get180RotationValue()
if config.gamesettings.world_reverse == 3 then
return 3
else
return 1
end
end
function ARS:getDefaultOrientation() return 3 end -- downward facing pieces by default function ARS:getDefaultOrientation() return 3 end -- downward facing pieces by default
return ARS return ARS

View File

@ -184,5 +184,12 @@ function SRS:onPieceRotate(piece, grid)
end end
end end
function SRS:get180RotationValue() return 3 end function SRS:get180RotationValue()
if config.gamesettings.world_reverse == 1 then
return 1
else
return 3
end
end
return SRS return SRS

View File

@ -151,7 +151,14 @@ function ARS:onPieceDrop(piece, grid)
piece.lock_delay = 0 -- step reset piece.lock_delay = 0 -- step reset
end end
function ARS:get180RotationValue() return 3 end function ARS:get180RotationValue()
if config.gamesettings.world_reverse == 3 then
return 3
else
return 1
end
end
function ARS:getDefaultOrientation() return 3 end -- downward facing pieces by default function ARS:getDefaultOrientation() return 3 end -- downward facing pieces by default
return ARS return ARS

View File

@ -100,7 +100,7 @@ function CRAP:attemptRotate(new_inputs, piece, grid, initial)
end end
if rot_dir == 0 then return end if rot_dir == 0 then return end
if self.world and config.gamesettings.world_reverse == 2 then if config.gamesettings.world_reverse == 3 or (self.world and config.gamesettings.world_reverse == 2) then
rot_dir = 4 - rot_dir rot_dir = 4 - rot_dir
end end

View File

@ -76,7 +76,7 @@ function Ruleset:attemptRotate(new_inputs, piece, grid, initial)
end end
if rot_dir == 0 then return end if rot_dir == 0 then return end
if self.world and config.gamesettings.world_reverse == 2 then if config.gamesettings.world_reverse == 3 or (self.world and config.gamesettings.world_reverse == 2) then
rot_dir = 4 - rot_dir rot_dir = 4 - rot_dir
end end

View File

@ -185,5 +185,12 @@ function SRS:onPieceRotate(piece, grid)
end end
end end
function SRS:get180RotationValue() return 3 end function SRS:get180RotationValue()
if config.gamesettings.world_reverse == 1 then
return 1
else
return 3
end
end
return SRS return SRS

View File

@ -127,7 +127,14 @@ function Tengen:onPieceDrop(piece, grid)
piece.lock_delay = 0 -- step reset piece.lock_delay = 0 -- step reset
end end
function Tengen:get180RotationValue() return config["reverse_rotate"] and 1 or 3 end function Tengen:get180RotationValue()
if config.gamesettings.world_reverse == 3 then
return 1
else
return 3
end
end
function Tengen:getDefaultOrientation() return 3 end -- downward facing pieces by default function Tengen:getDefaultOrientation() return 3 end -- downward facing pieces by default
return Tengen return Tengen