Esempio n. 1
0
void BagArtifacts::RemoveScroll(const Artifact & art)
{
    Spell spell(art.GetSpell());
    if(spell.isValid())
    {
	iterator it = std::find(begin(), end(), spell);
	if(it != end()) (*it).Reset();
    }
}
Esempio n. 2
0
bool HeroBase::CanTranscribeScroll(const Artifact & art) const
{
    Spell spell = art.GetSpell();

    if(spell.isValid() && CanCastSpell(spell))
    {
	int learning = GetLevelSkill(Skill::Secondary::LEARNING);

	return ((3 <  spell.Level() && Skill::Level::EXPERT == learning) ||
	    (3 == spell.Level() && Skill::Level::ADVANCED <= learning) ||
	    (3 > spell.Level() && Skill::Level::BASIC <= learning));
    }

    return false;
}
Esempio n. 3
0
void HeroBase::TranscribeScroll(const Artifact & art)
{
    Spell spell = art.GetSpell();

    if(spell.isValid())
    {
	// add spell
	spell_book.Append(spell);

	// remove art
	bag_artifacts.RemoveScroll(art);

	// reduce mp and resource
	SpellCasted(spell);
    }
}