Skip to content

Commit

Permalink
Fix soft drop bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mm304321141 committed Aug 12, 2024
1 parent 3338d0e commit 49eac12
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
3 changes: 2 additions & 1 deletion BotrisBattle.NET/BotrisType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,11 @@ public enum Block
// Enum for Command
public enum Command
{
hold, move_left, move_right, sonic_left, sonic_right,
hold, move_left, move_right, sonic_left, sonic_right, hard_drop,
rotate_cw, rotate_ccw, drop, sonic_drop
}


// Enum for ClearName
public enum ClearName
{
Expand Down
18 changes: 5 additions & 13 deletions ZZZTOJ.Botris/ZZZBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public MoveResult GetMove(RequestMovePayload requestMovePayload)

requestMovePayload.GameState.held == null ? ' ': requestMovePayload.GameState.held[0],
requestMovePayload.GameState.canHold, requestMovePayload.GameState.current.piece[0],
requestMovePayload.GameState.current.x, 21 - requestMovePayload.GameState.current.y, requestMovePayload.GameState.current.rotation,
requestMovePayload.GameState.current.x, 20 - requestMovePayload.GameState.current.y, requestMovePayload.GameState.current.rotation,
true, false, requestMovePayload.GameState.garbageQueued.Length, comboTable, BotSetting.NextCnt, BotSetting.Level, 0);
string resultpath = Marshal.PtrToStringAnsi(path);
_IOBoard.NextQueue.Enqueue(TetrisMino.Z);
Expand All @@ -153,22 +153,16 @@ public MoveResult GetMove(RequestMovePayload requestMovePayload)
case 'z':
case 'Z':
_IOBoard.LeftRotation();

moveResult.moves.Add(Command.rotate_ccw);
break;
case 'c':
case 'C':
_IOBoard.RightRotation();

moveResult.moves.Add(Command.rotate_cw);

break;
case 'l':
_IOBoard.MoveLeft();

moveResult.moves.Add(Command.move_left);


break;
case 'L':
while (_IOBoard.MoveLeft()) ;
Expand All @@ -182,14 +176,14 @@ public MoveResult GetMove(RequestMovePayload requestMovePayload)
case 'R':
while (_IOBoard.MoveRight()) ;
moveResult.moves.Add(Command.sonic_right);

break;
case 'd':
_IOBoard.SoftDrop();
moveResult.moves.Add(Command.drop);
break;
case 'D':
_IOBoard.SonicDrop();

moveResult.moves.Add(Command.sonic_drop);

break;
case 'v':
//_IOBoard.OnHold();
Expand Down Expand Up @@ -232,9 +226,7 @@ public MoveResult GetMove(RequestMovePayload requestMovePayload)
// moveResult.expected_cells[i][0] = list[i].Y;
//}
_IOBoard.HardDrop();

moveResult.moves.Add(Command.drop);

//moveResult.moves.Add(Command.hard_drop);
break;
default:
break;
Expand Down

0 comments on commit 49eac12

Please sign in to comment.