Skip to content

Instantly share code, notes, and snippets.

@amalloy
Last active February 16, 2017 18:02
Show Gist options
  • Save amalloy/671bd7400fc37c4bc2daabd34132da66 to your computer and use it in GitHub Desktop.
Save amalloy/671bd7400fc37c4bc2daabd34132da66 to your computer and use it in GitHub Desktop.
bool item_is_rechargeable(const item_def &it, bool hide_charged)
{
const bool is_wand = it.base_type == OBJ_WANDS;
return (is_wand || is_xp_evoker(it))
&& (!hide_charged
|| (is_wand && item_ident(it, ISFLAG_KNOW_PLUSES)
&& it.charges < wand_max_charges(it))
|| !evoker_is_charged(it));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment