NagyD / SDLPoP

An open-source port of Prince of Persia, based on the disassembly of the DOS version.
GNU General Public License v3.0
1.1k stars 141 forks source link

Various gameplay bug fixes #81

Closed Falcury closed 8 years ago

Falcury commented 8 years ago

Fix unintended sword strike immediately after drawing sword Sometimes, the kid may automatically strike immediately after drawing the sword. This especially happens when dropping down from a higher floor and then turning towards the opponent.

I think this happens because ctrl1_shift2 may still be -1 in draw_sword(), after which control_shift2 is set to -1 in rest_ctrl1().

Fix retreating out of a room without the room actually changing By repeatedly pressing 'back' in a swordfight, you can retreat out of a room without the room changing. (Trick 35)

The game waits for a 'legal frame' (e.g. frame_170_stand_with_sword) until leaving is possible; However, this frame is never reached if you press 'back' in the correct pattern!

Proposed solution: also allow the room to be changed on frame_157_walk_with_sword Note that this means that the delay for leaving rooms in a swordfight becomes noticably shorter.

Fix running jump through tapestry The kid can jump through a tapestry with a running jump to the left, if there is a floor above it (when you just miss that floor, the kid jumps through the tapestry instead of falling down in front of it)

The proposed solution is to treat tapestries (when approached to the left) as if they are a wall in start_fall().

Fix guards being pushed into walls Guards can be pushed into walls, because the game does not correctly check for walls located behind a guard.

Fix jumping through a wall above a closed gate By doing a running jump into a wall, you can fall behind a closed gate two floors down. (e.g. skip in Level 7)

This happens because in_wall() mistakenly gets called (which in turn happens because Char.curr_col is not immediately updated after jumping into a wall and getting bumped, even though Char.x has been changed) and in_wall() tries to 'eject' the kid from the wall, but in the wrong direction. The proposed fix is to update Char.curr_col by calling determine_col() in do_fall().