コード例 #1
0
ファイル: x-spell.c プロジェクト: mangband/mangband
/* Copy of "cast_spell", but with no "finalization" */
bool cast_spell_hack(int Ind, int tval, int index)
{
	player_type *p_ptr = Players[Ind];
	bool done;

	/* START */
	p_ptr->current_spell = index;

	if (tval == TV_MAGIC_BOOK)
	{
		done = cast_mage_spell(Ind, index);
	}
	else if (tval == TV_PRAYER_BOOK)
	{
		done = cast_priest_spell(Ind, index);
	}
	else
	{
		done = cast_undead_spell(Ind, index);
	}

	/* DONE */
	if (done) p_ptr->current_spell = -1;

	return done;
}
コード例 #2
0
ファイル: x-spell.c プロジェクト: apwhite/angband
bool cast_spell(int tval, int index, int dir)
{
	if (tval == TV_MAGIC_BOOK)
	{
		return cast_mage_spell(index, dir);
	}
	else
	{
		return cast_priest_spell(index, dir);
	}
}