Skip to content

Commit

Permalink
DM: Add F0306_CHAMPION_GetStaminaAdjustedValue
Browse files Browse the repository at this point in the history
  • Loading branch information
Bendegúz Nagy committed Aug 26, 2016
1 parent ef2411f commit 493c8ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions engines/dm/champion.cpp
Expand Up @@ -336,4 +336,15 @@ void ChampionMan::drawChampionBarGraphs(ChampionIndex champIndex) {
warning("MISSING CODE: F0078_MOUSE_ShowPointer");
}


int16 ChampionMan::getStaminaAdjustedValue(Champion *champ, int16 val) {
int16 currStamina = champ->_currStamina;
int16 halfMaxStamina = champ->_maxStamina / 2;
if (currStamina < halfMaxStamina) {
val /= 2;
return val + ((uint32)val * (uint32)currStamina) / halfMaxStamina;
}
return val;
}

}
1 change: 1 addition & 0 deletions engines/dm/champion.h
Expand Up @@ -405,6 +405,7 @@ class ChampionMan {
void resetDataToStartGame(); // @ F0278_CHAMPION_ResetDataToStartGame
void addCandidateChampionToParty(uint16 championPortraitIndex); // @ F0280_CHAMPION_AddCandidateChampionToParty
void drawChampionBarGraphs(ChampionIndex champIndex); // @ F0287_CHAMPION_DrawBarGraphs
int16 getStaminaAdjustedValue(Champion *champ, int16 val); // @ F0306_CHAMPION_GetStaminaAdjustedValue
};


Expand Down

0 comments on commit 493c8ed

Please sign in to comment.