1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

* artifact manipulation in exchange window works (without switching artifacts between different heroes)

* support for 3 new artifacts:
- Ring of Vitality
- Ring of Life
- Vial of Lifeblood
* restructures creature ability preparing (creature abilities are now loaded from cr_abils.txt file). It needs further work - all changes in abilities should be moved from CCreatureHandler.cpp to cr_abils.txt as it's done in this commit (I hope it's clear how it should be done as there is an example)
This commit is contained in:
mateuszb
2009-06-28 13:49:39 +00:00
parent 9093320da8
commit 85eb5c7eb9
9 changed files with 254 additions and 276 deletions

View File

@@ -437,13 +437,13 @@ askInterfaceForMove:
}
void CGameHandler::prepareAttacked(BattleStackAttacked &bsa, CStack *def)
{
bsa.killedAmount = bsa.damageAmount / def->creature->hitPoints;
unsigned damageFirst = bsa.damageAmount % def->creature->hitPoints;
bsa.killedAmount = bsa.damageAmount / def->MaxHealth();
unsigned damageFirst = bsa.damageAmount % def->MaxHealth();
if( def->firstHPleft <= damageFirst )
{
bsa.killedAmount++;
bsa.newHP = def->firstHPleft + def->creature->hitPoints - damageFirst;
bsa.newHP = def->firstHPleft + def->MaxHealth() - damageFirst;
}
else
{
@@ -849,6 +849,8 @@ void CGameHandler::setupBattle( BattleInfo * curB, int3 tile, CCreatureSet &army
stacks.back()->luck = hero1->getCurrentLuck(i->first,false);
stacks.back()->features.push_back(makeFeature(StackFeature::ATTACK_BONUS, StackFeature::WHOLE_BATTLE, 0, hero1->getPrimSkillLevel(0), StackFeature::BONUS_FROM_HERO));
stacks.back()->features.push_back(makeFeature(StackFeature::DEFENCE_BONUS, StackFeature::WHOLE_BATTLE, 0, hero1->getPrimSkillLevel(1), StackFeature::BONUS_FROM_HERO));
stacks.back()->features.push_back(makeFeature(StackFeature::HP_BONUS, StackFeature::WHOLE_BATTLE, 0, hero1->valOfBonuses(HeroBonus::STACK_HEALTH), StackFeature::BONUS_FROM_HERO));
stacks.back()->firstHPleft = stacks.back()->MaxHealth();
}
else
{
@@ -900,6 +902,8 @@ void CGameHandler::setupBattle( BattleInfo * curB, int3 tile, CCreatureSet &army
stacks.back()->luck = hero2->getCurrentLuck(i->first,false);
stacks.back()->features.push_back(makeFeature(StackFeature::ATTACK_BONUS, StackFeature::WHOLE_BATTLE, 0, hero2->getPrimSkillLevel(0), StackFeature::BONUS_FROM_HERO));
stacks.back()->features.push_back(makeFeature(StackFeature::DEFENCE_BONUS, StackFeature::WHOLE_BATTLE, 0, hero2->getPrimSkillLevel(1), StackFeature::BONUS_FROM_HERO));
stacks.back()->features.push_back(makeFeature(StackFeature::HP_BONUS, StackFeature::WHOLE_BATTLE, 0, hero2->valOfBonuses(HeroBonus::STACK_HEALTH), StackFeature::BONUS_FROM_HERO));
stacks.back()->firstHPleft = stacks.back()->MaxHealth();
}
else
{