diff options
author | Johanna Ploog <j-p-e-g@users.sourceforge.net> | 2011-01-26 22:25:53 +0100 |
---|---|---|
committer | Johanna Ploog <j-p-e-g@users.sourceforge.net> | 2011-01-26 22:25:53 +0100 |
commit | 15f9564af6a3b7110457d28eea60a7812dc61e0f (patch) | |
tree | 7e151e80719ac750cc147a2d62174202d10e0975 /crawl-ref/source/tutorial.cc | |
parent | 8e2100892ea82e72b5d9f2ca36f8374ed54481bd (diff) | |
download | crawl-ref-15f9564af6a3b7110457d28eea60a7812dc61e0f.tar.gz crawl-ref-15f9564af6a3b7110457d28eea60a7812dc61e0f.zip |
Allow setting skills from the tutorial map.
This is a hacky solution and only handles Spellcasting, Conjurations,
and Invocations. Also, for the default skills already set in ng-setup
reassess_starting_skills (now moved to skills.cc) is applied twice.
Diffstat (limited to 'crawl-ref/source/tutorial.cc')
-rw-r--r-- | crawl-ref/source/tutorial.cc | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc index 09053f6c7f..ba88fb66dc 100644 --- a/crawl-ref/source/tutorial.cc +++ b/crawl-ref/source/tutorial.cc @@ -4,14 +4,15 @@ */ #include "AppHdr.h" +#include "tutorial.h" #include "externs.h" #include "maps.h" #include "message.h" #include "mpr.h" #include "player.h" +#include "skills.h" #include "state.h" -#include "tutorial.h" mapref_vector get_tutorial_maps() { @@ -43,6 +44,25 @@ void set_tutorial_hunger(int hunger) you.hunger = hunger; } +void set_tutorial_skill(const char *skill, int level) +{ + if (!crawl_state.game_is_tutorial()) + return; + + bool need_exercise_check = true; + if (strcmp(skill, "spellcasting") == 0) + you.skills[SK_SPELLCASTING] = level; + else if (strcmp(skill, "conjurations") == 0) + you.skills[SK_CONJURATIONS] = level; + else if (strcmp(skill, "invocations") == 0) + you.skills[SK_INVOCATIONS] = level; + else + need_exercise_check = false; + + if (need_exercise_check) + reassess_starting_skills(); +} + void tutorial_death_message() { mprnojoin("You die..."); |