Added ability to enable/disable synchroes

On by default in anything but world rulesets.
Gamemodes / rulesets can override this setting.
pull/13/head
Ishaan Bhardwaj 2020-12-04 10:57:43 -05:00
parent 891f96e814
commit 3d5b33f41a
2 changed files with 12 additions and 3 deletions

View File

@ -9,7 +9,8 @@ ConfigScene.options = {
{"manlock", "Manual locking",{"Per ruleset","Per gamemode","Harddrop", "Softdrop"}},
{"piece_colour", "Piece Colours", {"Per ruleset","Arika" ,"TTC"}},
{"world_reverse","A Button Rotation", {"Left" ,"Auto" ,"Right"}},
{"das_last_key", "DAS Switch", {"Default", "Instant"}}
{"das_last_key", "DAS Switch", {"Default", "Instant"}},
{"synchroes_allowed", "Synchroes", {"Per ruleset", "On", "Off"}}
}
local optioncount = #ConfigScene.options

View File

@ -211,8 +211,16 @@ function Ruleset:processPiece(
drop_locked, hard_drop_locked,
hard_drop_enabled, additive_gravity
)
self:rotatePiece(inputs, piece, grid, prev_inputs, false)
self:movePiece(piece, grid, move, gravity >= 20)
local synchroes_allowed = ({not self.world, true, false})[config.gamesettings.synchroes_allowed]
if synchroes_allowed then
self:rotatePiece(inputs, piece, grid, prev_inputs, false)
self:movePiece(piece, grid, move, gravity >= 20)
else
self:movePiece(piece, grid, move, gravity >= 20)
self:rotatePiece(inputs, piece, grid, prev_inputs, false)
end
self:dropPiece(
inputs, piece, grid, gravity, drop_speed, drop_locked, hard_drop_locked,
hard_drop_enabled, additive_gravity