# HG changeset patch # User Wuzzy # Date 1492057541 -7200 # Node ID 09010333c9473ad353eb8feda02d2cae565c23a4 # Parent 0b5aa545e058858afa71b9807933a24c6795dbb3 Randomize forts and graves in new teams diff -r 0b5aa545e058 -r 09010333c947 QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Thu Apr 13 05:44:23 2017 +0200 +++ b/QTfrontend/hwform.cpp Thu Apr 13 06:25:41 2017 +0200 @@ -473,14 +473,19 @@ } HWTeam defaultTeam(teamName); + // Randomize fort and grave for greater variety by default + defaultTeam.setGrave(HWNamegen::getRandomGrave()); + defaultTeam.setFort(HWNamegen::getRandomFort()); defaultTeam.saveToFile(); teamslist.push_back(teamName); - // Team 2, Team 3, Team 4 + // Add 3 additional teams to allow local multiplayer instantly for(int i=2; i<=4; i++) { teamName = tr("Team %1").arg(i); HWTeam numberTeam(teamName); + numberTeam.setGrave(HWNamegen::getRandomGrave()); + numberTeam.setFort(HWNamegen::getRandomFort()); numberTeam.saveToFile(); teamslist.push_back(teamName); } diff -r 0b5aa545e058 -r 09010333c947 QTfrontend/ui/page/pageeditteam.cpp --- a/QTfrontend/ui/page/pageeditteam.cpp Thu Apr 13 05:44:23 2017 +0200 +++ b/QTfrontend/ui/page/pageeditteam.cpp Thu Apr 13 06:25:41 2017 +0200 @@ -347,7 +347,12 @@ m_playerHash = playerHash; lazyLoad(); + // Mostly create a default team, with 2 important exceptions: HWTeam newTeam(name); + // Randomize grave to make it less likely that default teams have equal graves (important for resurrector) + newTeam.setGrave(HWNamegen::getRandomGrave()); + // Randomize fort for greater variety in fort mode with default teams + newTeam.setFort(HWNamegen::getRandomFort()); loadTeam(newTeam); } diff -r 0b5aa545e058 -r 09010333c947 QTfrontend/util/namegen.h --- a/QTfrontend/util/namegen.h Thu Apr 13 05:44:23 2017 +0200 +++ b/QTfrontend/util/namegen.h Thu Apr 13 06:25:41 2017 +0200 @@ -31,6 +31,10 @@ static void teamRandomName(HWTeam & team, const int HedgehogNumber); static void teamRandomNames(HWTeam & team, const bool changeteamname); + static QString getRandomGrave(); + static QString getRandomFort(); + static QString getRandomFlag(); + static QString getRandomVoice(); private: HWNamegen(); @@ -43,10 +47,6 @@ static QStringList dictContents(const QString filename); static QStringList dictsForHat(const QString hatname); - static QString getRandomGrave(); - static QString getRandomFort(); - static QString getRandomFlag(); - static QString getRandomVoice(); static void teamRandomName(HWTeam & team, const int HedgehogNumber, const QStringList & dict); };