MCPcopy Create free account
hub / github.com/crawl/crawl / tile_command_not_applicable

Function tile_command_not_applicable

crawl-ref/source/tilereg-cmd.cc:168–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168bool 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
194bool tile_command_not_applicable(const command_type cmd)
195{

Callers 7

handle_mouseMethod · 0.85
_tile_for_abilityFunction · 0.85
handle_mouseMethod · 0.85
updateMethod · 0.85
updateMethod · 0.85
handle_mouseMethod · 0.85
updateMethod · 0.85

Calls 8

context_for_commandFunction · 0.85
can_rest_hereFunction · 0.85
you_worshipFunction · 0.85
your_talentsFunction · 0.85
can_cast_spellsFunction · 0.85
i_feel_safeFunction · 0.85
get_map_displayMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected