1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

vcmi: convert magic schools to MAGIC_SCHOOL_SKILL

It is already used by battlefields.
This commit is contained in:
Konstantin
2023-02-27 13:35:52 +03:00
parent 64ad7558c6
commit ddcff9dc36
2 changed files with 9 additions and 11 deletions

View File

@@ -410,8 +410,8 @@
"base" : { "base" : {
"effects" : { "effects" : {
"main" : { "main" : {
"subtype" : "skill.fireMagic", "subtype" : 2,
"type" : "SECONDARY_SKILL_PREMY", "type" : "MAGIC_SCHOOL_SKILL",
"valueType" : "BASE_NUMBER" "valueType" : "BASE_NUMBER"
} }
} }
@@ -438,8 +438,8 @@
"base" : { "base" : {
"effects" : { "effects" : {
"main" : { "main" : {
"subtype" : "skill.airMagic", "subtype" : 1,
"type" : "SECONDARY_SKILL_PREMY", "type" : "MAGIC_SCHOOL_SKILL",
"valueType" : "BASE_NUMBER" "valueType" : "BASE_NUMBER"
} }
} }
@@ -466,8 +466,8 @@
"base" : { "base" : {
"effects" : { "effects" : {
"main" : { "main" : {
"subtype" : "skill.waterMagic", "subtype" : 4,
"type" : "SECONDARY_SKILL_PREMY", "type" : "MAGIC_SCHOOL_SKILL",
"valueType" : "BASE_NUMBER" "valueType" : "BASE_NUMBER"
} }
} }
@@ -494,8 +494,8 @@
"base" : { "base" : {
"effects" : { "effects" : {
"main" : { "main" : {
"subtype" : "skill.earthMagic", "subtype" : 8,
"type" : "SECONDARY_SKILL_PREMY", "type" : "MAGIC_SCHOOL_SKILL",
"valueType" : "BASE_NUMBER" "valueType" : "BASE_NUMBER"
} }
} }

View File

@@ -595,9 +595,7 @@ int32_t CGHeroInstance::getSpellSchoolLevel(const spells::Spell * spell, int32_t
spell->forEachSchool([&, this](const spells::SchoolInfo & cnf, bool & stop) spell->forEachSchool([&, this](const spells::SchoolInfo & cnf, bool & stop)
{ {
int32_t thisSchool = std::max<int32_t>( int32_t thisSchool = valOfBonuses(Bonus::MAGIC_SCHOOL_SKILL, 1 << (static_cast<ui8>(cnf.id))); //FIXME: Bonus shouldn't be additive (Witchking Artifacts : Crown of Skies)
valOfBonuses(Bonus::SECONDARY_SKILL_PREMY, cnf.skill),
valOfBonuses(Bonus::MAGIC_SCHOOL_SKILL, 1 << (static_cast<ui8>(cnf.id)))); //FIXME: Bonus shouldn't be additive (Witchking Artifacts : Crown of Skies)
if(thisSchool > skill) if(thisSchool > skill)
{ {
skill = thisSchool; skill = thisSchool;