MCPcopy Create free account
hub / github.com/TurningWheel/Barony / startTutorial

Method startTutorial

src/mod_tools.cpp:73–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71};
72
73void GameModeManager_t::Tutorial_t::startTutorial(std::string mapToSet)
74{
75 if ( mapToSet.compare("") == 0 )
76 {
77 launchHub();
78 }
79 else
80 {
81 if ( mapToSet.find(".lmp") == std::string::npos )
82 {
83 mapToSet.append(".lmp");
84 }
85 setTutorialMap(mapToSet);
86 }
87#ifndef EDITOR
88 gameModeManager.setMode(gameModeManager.GameModes::GAME_MODE_TUTORIAL);
89 GameplayPreferences_t::reset();
90 gameplayPreferences[0].process();
91#endif
92 stats[0]->clearStats();
93 strcpy(stats[0]->name, "Player");
94 stats[0]->sex = static_cast<sex_t>(local_rng.rand() % 2);
95 stats[0]->playerRace = RACE_HUMAN;
96 stats[0]->stat_appearance = local_rng.rand() % NUMAPPEARANCES;
97 client_classes[0] = CLASS_WARRIOR;
98 initClass(0);
99}
100
101void GameModeManager_t::Tutorial_t::buttonReturnToTutorialHub(button_t* my)
102{

Callers 1

onClickEntryMethod · 0.80

Calls 6

appendMethod · 0.80
setModeMethod · 0.80
randMethod · 0.80
initClassFunction · 0.70
processMethod · 0.45
clearStatsMethod · 0.45

Tested by

no test coverage detected