1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +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" : {
"effects" : {
"main" : {
"subtype" : "skill.fireMagic",
"type" : "SECONDARY_SKILL_PREMY",
"subtype" : 2,
"type" : "MAGIC_SCHOOL_SKILL",
"valueType" : "BASE_NUMBER"
}
}
@ -438,8 +438,8 @@
"base" : {
"effects" : {
"main" : {
"subtype" : "skill.airMagic",
"type" : "SECONDARY_SKILL_PREMY",
"subtype" : 1,
"type" : "MAGIC_SCHOOL_SKILL",
"valueType" : "BASE_NUMBER"
}
}
@ -466,8 +466,8 @@
"base" : {
"effects" : {
"main" : {
"subtype" : "skill.waterMagic",
"type" : "SECONDARY_SKILL_PREMY",
"subtype" : 4,
"type" : "MAGIC_SCHOOL_SKILL",
"valueType" : "BASE_NUMBER"
}
}
@ -494,8 +494,8 @@
"base" : {
"effects" : {
"main" : {
"subtype" : "skill.earthMagic",
"type" : "SECONDARY_SKILL_PREMY",
"subtype" : 8,
"type" : "MAGIC_SCHOOL_SKILL",
"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)
{
int32_t thisSchool = std::max<int32_t>(
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)
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)
if(thisSchool > skill)
{
skill = thisSchool;