| 166 | } |
| 167 | |
| 168 | bool tile_command_not_applicable(const command_type cmd, bool safe) |
| 169 | { |
| 170 | // in the level map, only the map pan commands work |
| 171 | const bool map_cmd = context_for_command(cmd) == KMC_LEVELMAP; |
| 172 | if (tiles.get_map_display() != map_cmd) |
| 173 | return true; |
| 174 | |
| 175 | switch (cmd) |
| 176 | { |
| 177 | case CMD_REST: |
| 178 | return !safe || !can_rest_here(); |
| 179 | case CMD_EXPLORE: |
| 180 | case CMD_INTERLEVEL_TRAVEL: |
| 181 | case CMD_MEMORISE_SPELL: |
| 182 | return !safe; |
| 183 | case CMD_DISPLAY_RELIGION: |
| 184 | return you_worship(GOD_NO_GOD); |
| 185 | case CMD_USE_ABILITY: |
| 186 | return your_talents().empty(); |
| 187 | case CMD_CAST_SPELL: |
| 188 | return !you.spell_no || !can_cast_spells(true); |
| 189 | default: |
| 190 | return false; |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | bool tile_command_not_applicable(const command_type cmd) |
| 195 | { |
no test coverage detected