1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Quick fix for 2245 & 2238

This commit is contained in:
AlexVinS 2015-09-14 12:31:47 +03:00
parent d4ae63e7ef
commit 3c053e5dd5
2 changed files with 15 additions and 13 deletions

View File

@ -1022,7 +1022,7 @@
"inFrenzy" : {
"type" : "IN_FRENZY",
"val" : 100,
"duration" : "STACK_GETS_TURN"
"duration" : "N_TURNS"//hardcoded to 1
}
}
},
@ -1096,7 +1096,7 @@
},
"berserk" : {
"index" : 59,
"targetType" : "CREATURE",
"targetType" : "LOCATION",
"animation":{
"affect":["C01SPF"] //C01SPF0
@ -1111,7 +1111,7 @@
"effects" : {
"attacksNearestCreature" : {
"type" : "ATTACKS_NEAREST_CREATURE",
"duration" : "N_TURNS"
"duration" : "N_TURNS" //hardcoded to 1
}
}
},

View File

@ -488,19 +488,21 @@ void DefaultSpellMechanics::battleLogSingleTarget(std::vector<std::string> & log
int DefaultSpellMechanics::calculateDuration(const CGHeroInstance * caster, int usedSpellPower) const
{
if(!caster)
{
if (!usedSpellPower)
return 3; //default duration of all creature spells
else
return usedSpellPower; //use creature spell power
}
switch(owner->id)
{
case SpellID::FRENZY:
case SpellID::FRENZY:
case SpellID::BERSERK:
return 1;
default: //other spells
return caster->getPrimSkillLevel(PrimarySkill::SPELL_POWER) + caster->valOfBonuses(Bonus::SPELL_DURATION);
default: //other spells
if(caster == nullptr)
{
if (!usedSpellPower)
return 3; //default duration of all creature spells
else
return usedSpellPower; //use creature spell power
}
else
return caster->getPrimSkillLevel(PrimarySkill::SPELL_POWER) + caster->valOfBonuses(Bonus::SPELL_DURATION);
}
}