|
@@ -38,10 +38,17 @@ void Spell::loadSpellIcon(QString spell_folder) {
|
|
|
}
|
|
|
|
|
|
void Spell::loadSpellTraits(QString spell_folder) {
|
|
|
- /*
|
|
|
- * you can do it by yourself, i need to sleep
|
|
|
- */
|
|
|
-
|
|
|
+ QFile file(spell_folder + "traits.txt");
|
|
|
+ file.open(QIODevice::ReadOnly);
|
|
|
+ QTextStream in(&file);
|
|
|
+ in.setCodec("UTF-8");
|
|
|
+ QString traits_containts = in.readAll();
|
|
|
+ QStringList params = traits_containts.split("\n");
|
|
|
+ assert(params.size() >= 1);
|
|
|
+ size_t countEffects = params[0].toInt();
|
|
|
+ for (size_t i = 1; i <= countEffects; ++i){
|
|
|
+ effects_.push_back(new Effect(params[i]));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
QString Spell::getSpellName() const {
|