| 765 | |
| 766 | const auto at{_ctx.game->state->get_player_pos()}; |
| 767 | if (_ctx.game->state->level->at(at).has_spinner()) { |
| 768 | |
| 769 | auto new_facing{static_cast<Enums::Map::Direction>( |
| 770 | _ctx.get_random(Enums::System::Random::ZERO_TO_3))}; |
| 771 | _ctx.game->state->set_player_facing(new_facing); |
| 772 | |
| 773 | DEBUG_LOG("Player triggered spinner"); |
| 774 | } |
| 775 | } |
| 776 | |
| 777 | auto Sorcery::Engine::_turn_right() -> void { |
| 778 | |
| 779 | switch (_ctx.game->state->get_player_facing()) { |
| 780 | using enum Enums::Map::Direction; |
| 781 | case NORTH: |
| 782 | _ctx.game->state->set_player_facing(EAST); |
| 783 | break; |
| 784 | case SOUTH: |
| 785 | _ctx.game->state->set_player_facing(WEST); |
| 786 | break; |
| 787 | case EAST: |
| 788 | _ctx.game->state->set_player_facing(SOUTH); |
| 789 | break; |
| 790 | case WEST: |
| 791 | _ctx.game->state->set_player_facing(NORTH); |
| 792 | break; |
| 793 | default: |
| 794 | break; |
| 795 | } |
| 796 | |
| 797 | _ctx.controller->set_last_dir(Enums::Map::Direction::EAST); |
| 798 | _ctx.controller->set_can_undo(false); |
| 799 | |
| 800 | const auto at{_ctx.game->state->get_player_pos()}; |
| 801 | if (_ctx.game->state->level->at(at).has_spinner()) { |
| 802 |
nothing calls this directly
no test coverage detected