player has the rune. (jarpiain/dpeg)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1858 c06c8d41-db1a-0410-9941-cceddc491573
3SAXELKUWVP3KWQCANMGQONEOSMRSQPSNDUSN43XRRYOMEGHULNAC
// XXX: Relies on RUNE_xxx == BRANCH_xxx. See rune_type in enum.h.
static bool player_has_rune(branch_type branch)
{
for (int i = 0; i < ENDOFPACK; i++)
if (is_valid_item( you.inv[i] )
&& you.inv[i].base_type == OBJ_MISCELLANY
&& you.inv[i].sub_type == MISC_RUNE_OF_ZOT
&& you.inv[i].plus == branch)
{
return (true);
}
return (false);
}
// The tomb is a laid out maze, it'd be a shame if the player
// just teleports through any of it... so we only allow
// teleport once they have the rune.
ret = false;
for (int i = 0; i < ENDOFPACK; i++)
{
if (is_valid_item( you.inv[i] )
&& you.inv[i].base_type == OBJ_MISCELLANY
&& you.inv[i].sub_type == MISC_RUNE_OF_ZOT
&& you.inv[i].plus == BRANCH_TOMB)
{
ret = true;
break;
}
}
ret = player_has_rune(you.where_are_you);