mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Support for damage bonus (Ciele, Luna). Creeps won't grow on first day.
This commit is contained in:
@@ -144,9 +144,9 @@
|
|||||||
134 4 2 1 114
|
134 4 2 1 114
|
||||||
134 4 2 3 114
|
134 4 2 3 114
|
||||||
135 4 2 1 115
|
135 4 2 1 115
|
||||||
136 5 13 0 100
|
136 5 100 13 0
|
||||||
137 8 53 0 0
|
137 8 53 0 0
|
||||||
138 5 15 0 50
|
138 5 50 15 0
|
||||||
139 8 46 0 0
|
139 8 46 0 0
|
||||||
140 8 43 0 0
|
140 8 43 0 0
|
||||||
141 8 47 0 0
|
141 8 47 0 0
|
||||||
|
|||||||
@@ -1044,7 +1044,7 @@ void CGHeroInstance::initObj()
|
|||||||
bonus.type = Bonus::PRIMARY_SKILL;
|
bonus.type = Bonus::PRIMARY_SKILL;
|
||||||
bonus.subtype = PrimarySkill::DEFENSE;
|
bonus.subtype = PrimarySkill::DEFENSE;
|
||||||
break;
|
break;
|
||||||
case 3://damage, TODO: handle it!
|
case 3:
|
||||||
bonus.type = Bonus::CREATURE_DAMAGE;
|
bonus.type = Bonus::CREATURE_DAMAGE;
|
||||||
bonus.subtype = 0; //both min and max
|
bonus.subtype = 0; //both min and max
|
||||||
break;
|
break;
|
||||||
@@ -1063,8 +1063,8 @@ void CGHeroInstance::initObj()
|
|||||||
break;
|
break;
|
||||||
case 5://spell damage bonus in percent
|
case 5://spell damage bonus in percent
|
||||||
bonus.type = Bonus::SPECIFIC_SPELL_DAMAGE;
|
bonus.type = Bonus::SPECIFIC_SPELL_DAMAGE;
|
||||||
bonus.valType = Bonus::PERCENT_TO_ALL;
|
bonus.valType = Bonus::BASE_NUMBER; // current spell system is screwed
|
||||||
bonus.additionalInfo = it->additionalinfo;
|
bonus.subtype = it->subtype; //spell id
|
||||||
speciality.bonuses.push_back (bonus);
|
speciality.bonuses.push_back (bonus);
|
||||||
break;
|
break;
|
||||||
case 6://damage bonus for bless (Adela)
|
case 6://damage bonus for bless (Adela)
|
||||||
@@ -2819,7 +2819,7 @@ void CGCreature::initObj()
|
|||||||
}
|
}
|
||||||
void CGCreature::newTurn() const
|
void CGCreature::newTurn() const
|
||||||
{//Works only for stacks of single type of size up to 2 millions
|
{//Works only for stacks of single type of size up to 2 millions
|
||||||
if (slots.begin()->second.count < CREEP_SIZE && cb->getDate(1) == 1)
|
if (slots.begin()->second.count < CREEP_SIZE && cb->getDate(1) == 1 && cb->getDate(0) > 1)
|
||||||
{
|
{
|
||||||
ui32 power = temppower * (100 + WEEKLY_GROWTH)/100;
|
ui32 power = temppower * (100 + WEEKLY_GROWTH)/100;
|
||||||
cb->setObjProperty(id, 10, std::min (power/1000 , (ui32)CREEP_SIZE)); //set new amount
|
cb->setObjProperty(id, 10, std::min (power/1000 , (ui32)CREEP_SIZE)); //set new amount
|
||||||
|
|||||||
@@ -3038,25 +3038,18 @@ ui32 BattleInfo::calculateSpellDmg( const CSpell * sp, const CGHeroInstance * ca
|
|||||||
ret *= 1.15f;
|
ret *= 1.15f;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
//applying hero bonuses
|
//applying hero bonuses
|
||||||
if(sp->air && caster && caster->valOfBonuses(Bonus::AIR_SPELL_DMG_PREMY) != 0)
|
ret *= (100.f + caster->valOfBonuses(Bonus::SPELL_DAMAGE) + caster->valOfBonuses(Bonus::SPECIFIC_SPELL_DAMAGE, sp->id)) / 100.0f;
|
||||||
{
|
|
||||||
|
if(sp->air)
|
||||||
ret *= (100.0f + caster->valOfBonuses(Bonus::AIR_SPELL_DMG_PREMY)) / 100.0f;
|
ret *= (100.0f + caster->valOfBonuses(Bonus::AIR_SPELL_DMG_PREMY)) / 100.0f;
|
||||||
}
|
else if(sp->fire) //only one type of bonus for Magic Arrow
|
||||||
else if(sp->fire && caster && caster->valOfBonuses(Bonus::FIRE_SPELL_DMG_PREMY) != 0)
|
|
||||||
{
|
|
||||||
ret *= (100.0f + caster->valOfBonuses(Bonus::FIRE_SPELL_DMG_PREMY)) / 100.0f;
|
ret *= (100.0f + caster->valOfBonuses(Bonus::FIRE_SPELL_DMG_PREMY)) / 100.0f;
|
||||||
}
|
else if(sp->water)
|
||||||
else if(sp->water && caster && caster->valOfBonuses(Bonus::WATER_SPELL_DMG_PREMY) != 0)
|
|
||||||
{
|
|
||||||
ret *= (100.0f + caster->valOfBonuses(Bonus::WATER_SPELL_DMG_PREMY)) / 100.0f;
|
ret *= (100.0f + caster->valOfBonuses(Bonus::WATER_SPELL_DMG_PREMY)) / 100.0f;
|
||||||
}
|
else if(sp->earth)
|
||||||
else if(sp->earth && caster && caster->valOfBonuses(Bonus::EARTH_SPELL_DMG_PREMY) != 0)
|
|
||||||
{
|
|
||||||
ret *= (100.0f + caster->valOfBonuses(Bonus::EARTH_SPELL_DMG_PREMY)) / 100.0f;
|
ret *= (100.0f + caster->valOfBonuses(Bonus::EARTH_SPELL_DMG_PREMY)) / 100.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
//affected creature-specific part
|
//affected creature-specific part
|
||||||
if(affectedCreature)
|
if(affectedCreature)
|
||||||
{
|
{
|
||||||
@@ -3081,14 +3074,12 @@ ui32 BattleInfo::calculateSpellDmg( const CSpell * sp, const CGHeroInstance * ca
|
|||||||
ret *= affectedCreature->valOfBonuses(Bonus::SPELL_DAMAGE_REDUCTION, 3);
|
ret *= affectedCreature->valOfBonuses(Bonus::SPELL_DAMAGE_REDUCTION, 3);
|
||||||
ret /= 100;
|
ret /= 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
//general spell dmg reduction
|
//general spell dmg reduction
|
||||||
if(sp->air && affectedCreature->hasBonusOfType(Bonus::SPELL_DAMAGE_REDUCTION, -1)) //air spell & protection from air
|
if(sp->air && affectedCreature->hasBonusOfType(Bonus::SPELL_DAMAGE_REDUCTION, -1)) //air spell & protection from air
|
||||||
{
|
{
|
||||||
ret *= affectedCreature->valOfBonuses(Bonus::SPELL_DAMAGE_REDUCTION, -1);
|
ret *= affectedCreature->valOfBonuses(Bonus::SPELL_DAMAGE_REDUCTION, -1);
|
||||||
ret /= 100;
|
ret /= 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
//dmg increasing
|
//dmg increasing
|
||||||
if( affectedCreature->hasBonusOfType(Bonus::MORE_DAMAGE_FROM_SPELL, sp->id) )
|
if( affectedCreature->hasBonusOfType(Bonus::MORE_DAMAGE_FROM_SPELL, sp->id) )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -462,7 +462,6 @@ bool CCreatureTypeLimiter::limit(const Bonus &b, const CBonusSystemNode &node) c
|
|||||||
|
|
||||||
return c != creature && (!includeUpgrades || !creature->isMyUpgrade(c)); //drop bonus if it's not our creature and (we dont check upgrades or its not our upgrade)
|
return c != creature && (!includeUpgrades || !creature->isMyUpgrade(c)); //drop bonus if it's not our creature and (we dont check upgrades or its not our upgrade)
|
||||||
}
|
}
|
||||||
|
|
||||||
CCreatureTypeLimiter::CCreatureTypeLimiter(const CCreature &Creature, ui8 IncludeUpgrades /*= true*/)
|
CCreatureTypeLimiter::CCreatureTypeLimiter(const CCreature &Creature, ui8 IncludeUpgrades /*= true*/)
|
||||||
:creature(&Creature), includeUpgrades(IncludeUpgrades)
|
:creature(&Creature), includeUpgrades(IncludeUpgrades)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -150,7 +150,8 @@ namespace PrimarySkill
|
|||||||
BONUS_NAME(DARKNESS) /*val = radius */ \
|
BONUS_NAME(DARKNESS) /*val = radius */ \
|
||||||
BONUS_NAME(SPECIAL_SECONDARY_SKILL) /*val = id, additionalInfo = value per level in percent*/ \
|
BONUS_NAME(SPECIAL_SECONDARY_SKILL) /*val = id, additionalInfo = value per level in percent*/ \
|
||||||
BONUS_NAME(SPECIAL_SPELL_LEV) /*val = id, additionalInfo = value per level in percent*/\
|
BONUS_NAME(SPECIAL_SPELL_LEV) /*val = id, additionalInfo = value per level in percent*/\
|
||||||
BONUS_NAME(SPECIFIC_SPELL_DAMAGE) /*val = id of spell, additionalInfo = value*/\
|
BONUS_NAME(SPELL_DAMAGE) /*val = value*/\
|
||||||
|
BONUS_NAME(SPECIFIC_SPELL_DAMAGE) /*subtype = id of spell, val = value*/\
|
||||||
BONUS_NAME(SPECIAL_BLESS_DAMAGE) /*val = spell (bless), additionalInfo = value per level in percent*/\
|
BONUS_NAME(SPECIAL_BLESS_DAMAGE) /*val = spell (bless), additionalInfo = value per level in percent*/\
|
||||||
BONUS_NAME(MAXED_SPELL) /*val = id*/\
|
BONUS_NAME(MAXED_SPELL) /*val = id*/\
|
||||||
BONUS_NAME(SPECIAL_PECULIAR_ENCHANT) /*blesses and curses with id = val dependent on unit's level, subtype = 0 or 1 for Coronius*/\
|
BONUS_NAME(SPECIAL_PECULIAR_ENCHANT) /*blesses and curses with id = val dependent on unit's level, subtype = 0 or 1 for Coronius*/\
|
||||||
|
|||||||
Reference in New Issue
Block a user